当前位置: 首页>>代码示例>>C#>>正文


C# Device.GetRealChildren方法代码示例

本文整理汇总了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);
									}
								}
							}
						}
					}
				}
			}
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:27,代码来源:DeviceStatesManager.cs

示例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();
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:12,代码来源:MonitoringPanel.cs

示例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;
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:24,代码来源:DevicesOnShleifHelper.cs

示例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;
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:42,代码来源:DeviceStatesManager.cs

示例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);
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:25,代码来源:DeviceStatesManager.Parameters.cs


注:本文中的FiresecAPI.Models.Device.GetRealChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。