Beispiel #1
0
		public static void ChangeEnterButtonDevice(GKDoor door, GKDevice device)
		{
			RemoveDependenctElement(door, door.EnterButtonUID);

			door.EnterButtonUID = device != null ? device.UID : Guid.Empty;
			if (door.EnterButton != null)
			{
				door.EnterButton.Door = null;
			}
			door.EnterButton = device;
			if (door.EnterButton != null)
			{
				door.EnterButton.Door = door;
				door.AddDependentElement(door.EnterButton);
			}
			door.OnChanged();
		}
Beispiel #2
0
		/// <summary>
		/// Удаление ТД
		/// </summary>
		/// <param name="door"></param>
		public static void RemoveDoor(GKDoor door)
		{
			Doors.Remove(door);
			Devices.Where(x => x.UID == door.EnterDeviceUID || x.UID == door.ExitDeviceUID || x.UID == door.LockDeviceUID || x.UID == door.LockControlDeviceUID).ToList().ForEach(x => x.Door = null);
			door.InputDependentElements.ForEach(x =>
			{
				x.OutputDependentElements.Remove(door);
			});

			door.OutputDependentElements.ForEach(x =>
			{
				x.InputDependentElements.Remove(door);
				x.UpdateLogic(DeviceConfiguration);
				x.OnChanged();
			});
			door.OnChanged();
		}
Beispiel #3
0
		/// <summary>
		/// Изменение ТД
		/// </summary>
		/// <param name="door"></param>
		public static void EditDoor(GKDoor door)
		{
			door.OnChanged();
			door.OutputDependentElements.ForEach(x => x.OnChanged());
			door.InputDependentElements.ForEach(x => x.OnChanged());
		}
Beispiel #4
0
		public static void ChangeExitZone(GKDoor door, GKSKDZone zone)
		{
			door.ExitZoneUID = zone != null ? zone.UID : Guid.Empty;
			door.OnChanged();
		}
Beispiel #5
0
		public static void ChangeLockControlDeviceExit(GKDoor door,  GKDevice device)
		{
			RemoveDependenctElement(door, door.LockControlDeviceExitUID);

			door.LockControlDeviceExitUID = device != null ? device.UID : Guid.Empty;
			if (door.LockControlDeviceExit != null)
			{
				door.LockControlDeviceExit.Door = null;
			}
			door.LockControlDeviceExit = device;
			if (door.LockControlDeviceExit != null)
			{
				door.LockControlDeviceExit.Door = door;
				door.AddDependentElement(door.LockControlDeviceExit);
			}
			door.OnChanged();
		}