本文整理汇总了C#中FiresecAPI.Models.Device.GetRealChildren方法的典型用法代码示例。如果您正苦于以下问题:C# Device.GetRealChildren方法的具体用法?C# Device.GetRealChildren怎么用?C# Device.GetRealChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FiresecAPI.Models.Device
的用法示例。
在下文中一共展示了Device.GetRealChildren方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateRealChildrenStateOnPanelState
void UpdateRealChildrenStateOnPanelState(Device panelDevice, BitArray bitArray)
{
foreach (var device in panelDevice.GetRealChildren())
{
foreach (var metadataDeviceState in MetadataHelper.GetMetadataDeviceStates(device, true))
{
if (metadataDeviceState.leave != null)
{
foreach (var leaveDeviceState in metadataDeviceState.leave)
{
if (leaveDeviceState.panelState != null)
{
var pabelBitNo = Int32.Parse(leaveDeviceState.panelState);
var hasBit = bitArray[pabelBitNo];
if (!hasBit)
{
if (device.DeviceState.States.RemoveAll(x => x.DriverState.Code == metadataDeviceState.ID) > 0)
{
ForseUpdateDeviceStates(device);
}
}
}
}
}
}
}
}
示例2: MonitoringPanel
public MonitoringPanel(Device device)
{
PanelDevice = device;
Requests = new List<Request>();
ResetStateIds = new List<string>();
DevicesToIgnore = new List<Device>();
ZonesToSetGuard = new List<Zone>();
ZonesToResetGuard = new List<Zone>();
CommandItems = new List<CommandItem>();
RealChildren = PanelDevice.GetRealChildren();
DeviceStatesManager = new DeviceStatesManager();
}
示例3: GetLocalForPanel
public static List<DevicesOnShleif> GetLocalForPanel(Device parentPanel)
{
var devicesOnShleifs = new List<DevicesOnShleif>();
for (int i = 1; i <= parentPanel.Driver.ShleifCount; i++)
{
var devicesOnShleif = new DevicesOnShleif()
{
ShleifNo = i
};
devicesOnShleifs.Add(devicesOnShleif);
}
foreach (var device in parentPanel.GetRealChildren())
{
if (device.ParentPanel.UID == parentPanel.UID)
{
var devicesOnShleif = devicesOnShleifs.FirstOrDefault(x => x.ShleifNo == device.ShleifNo);
if (devicesOnShleif != null)
{
devicesOnShleif.Devices.Add(device);
}
}
}
return devicesOnShleifs;
}
示例4: ReadConfigurationAndUpdateStates
public bool ReadConfigurationAndUpdateStates(Device panelDevice)
{
var getConfigurationOperationHelper = new GetConfigurationOperationHelper(true);
RemoteDeviceConfiguration = getConfigurationOperationHelper.GetDeviceConfiguration(panelDevice);
if (RemoteDeviceConfiguration == null)
return false;
RemoteDeviceConfiguration.Update();
var isDBMissmatch = !ConfigurationCompareHelper.Compare(panelDevice, RemoteDeviceConfiguration);
if (panelDevice.DeviceState.IsDBMissmatch != isDBMissmatch)
{
panelDevice.DeviceState.IsDBMissmatch = isDBMissmatch;
ForseUpdateDeviceStates(panelDevice);
}
var remoteRealChildren = RemoteDeviceConfiguration.RootDevice.GetRealChildren();
var localRealChildren = panelDevice.GetRealChildren();
foreach (var remoteDevice in remoteRealChildren)
{
var device = localRealChildren.FirstOrDefault(x => x.IntAddress == remoteDevice.IntAddress);
if (device != null)
{
device.StateWordOffset = remoteDevice.StateWordOffset;
device.StateWordBytes = remoteDevice.StateWordBytes;
device.RawParametersOffset = remoteDevice.RawParametersOffset;
device.RawParametersBytes = remoteDevice.RawParametersBytes;
ParseDeviceState(device);
}
}
foreach (var remoteZone in RemoteDeviceConfiguration.Zones)
{
var zone = ConfigurationManager.Zones.FirstOrDefault(x => x.No == remoteZone.No);
if (zone != null)
{
zone.LocalDeviceNo = remoteZone.LocalDeviceNo;
}
}
return true;
}
示例5: UpdatePanelParameters
public void UpdatePanelParameters(Device panel)
{
HasChanges = false;
var faultyCount = panel.GetRealChildren().Where(x => x.DeviceState.States.Any(y => y.DriverState.Name == "Неисправность")).Count();
SetParameter(panel, faultyCount, "Heиcпpaвныx локальных уcтpoйcтв");
var externalCount = 0;
SetParameter(panel, externalCount, "Внешних устройств");
var totalCount = panel.GetRealChildren().Count;
SetParameter(panel, totalCount, "Всего устройств");
var bypassCount = panel.GetRealChildren().Where(x => x.DeviceState.States.Any(y => y.DriverState.Name == "Аппаратный обход устройства")).Count();
SetParameter(panel, bypassCount, "Обойденных устройств");
var lostCount = panel.GetRealChildren().Where(x => x.DeviceState.States.Any(y => y.DriverState.Name == "Потеря связи")).Count();
SetParameter(panel, lostCount, "Потерянных устройств");
var dustfilledCount = panel.GetRealChildren().Where(x => x.DeviceState.States.Any(y => y.DriverState.Code == "HighDustiness")).Count();
SetParameter(panel, dustfilledCount, "Запыленных устройств");
if (HasChanges)
NotifyStateChanged(panel);
}