void AddRemoteZoneToPanel(BinaryPanel binaryPanel, Zone zone)
		{
			if (!binaryPanel.RemoteZones.Contains(zone))
			{
				var remoteBinaryPanels = new HashSet<Device>();
				foreach (var zoneDevice in zone.DevicesInZone)
				{
					var remoteBinaryPanel = BinaryPanels.FirstOrDefault(x => x.ParentPanel == zoneDevice.ParentPanel);
					if (remoteBinaryPanel.ParentPanel.UID != binaryPanel.ParentPanel.UID)
					{
						remoteBinaryPanels.Add(remoteBinaryPanel.ParentPanel);
					}
				}

				foreach (var remoteBinaryPanel in remoteBinaryPanels)
				{
					var zoneBinaryPanel = BinaryPanels.FirstOrDefault(x => x.ParentPanel == remoteBinaryPanel);
					var binaryZone = new BinaryZone(zone)
					{
						IsRemote = true,
						ParentPanel = remoteBinaryPanel
					};
					binaryZone.BinaryPanels.Add(binaryPanel);
					binaryZone.BinaryPanels.Add(zoneBinaryPanel);
					binaryPanel.RemoteZones.Add(zone);
					binaryPanel.BinaryRemoteZones.Add(binaryZone);
				}
			}
		}
Пример #2
0
		public ZoneTable(FlashDatabase flashDatabase, BinaryZone binaryZone)
			: base(flashDatabase, "Зона " + binaryZone.Zone.PresentationName)
		{
			binaryZone.TableBase = this;
			BinaryZone = binaryZone;
			Zone = binaryZone.Zone;
		}
Пример #3
0
		public RemoteZoneTable(FlashDatabase panelDatabase, BinaryZone binaryZone)
			: base(panelDatabase, "Внешеяя зона " + binaryZone.Zone.PresentationName)
		{
			binaryZone.IsRemote = true;
			BinaryZone = binaryZone;
			binaryZone.TableBase = this;
			Zone = binaryZone.Zone;
		}
		void AddLocalZoneToPanel(BinaryPanel binaryPanel, Zone zone)
		{
			var binaryZone = new BinaryZone(zone)
			{
				ParentPanel = binaryPanel.ParentPanel
			};
			if (!binaryPanel.LocalZones.Contains(zone))
			{
				binaryPanel.LocalZones.Add(zone);
				binaryPanel.BinaryLocalZones.Add(binaryZone);
			}
			if (!binaryZone.BinaryPanels.Contains(binaryPanel))
			{
				binaryZone.BinaryPanels.Add(binaryPanel);
			}
		}