Example #1
0
		void OnManageOutputDoors()
		{
			var beforeDoors = new List<GKDoor>(OutputDoors.Select(x => x.Door));
			var doorsSelectationViewModel = new DoorsSelectationViewModel(beforeDoors);
			if (DialogService.ShowModalWindow(doorsSelectationViewModel))
			{
				var afterDoors = doorsSelectationViewModel.Doors;
				foreach (var door in beforeDoors)
				{
					if (!afterDoors.Contains(door))
						door.EnterZoneUID = Guid.Empty;
				}
				afterDoors.ForEach(door => door.EnterZoneUID = Zone.UID);
				ServiceFactory.SaveService.GKChanged = true;
			}
			Update();
		}
Example #2
0
		public OPCDetailsViewModel()
		{		
			var zones = GKManager.Zones.Where(x => GKManager.DeviceConfiguration.OPCSettings.ZoneUIDs.Contains(x.UID)).ToList();
			ZonesSelectationViewModel = new ZonesSelectationViewModel(zones, true);
			var guardzones = GKManager.GuardZones.Where(x => GKManager.DeviceConfiguration.OPCSettings.GuardZoneUIDs.Contains(x.UID)).ToList();
			GuardZonesSelectationViewModel = new GuardZonesSelectationViewModel(guardzones);
			var directions = GKManager.Directions.Where(x => GKManager.DeviceConfiguration.OPCSettings.DiretionUIDs.Contains(x.UID)).ToList();
			DirectionsSelectationViewModel = new DirectionsSelectationViewModel(directions);
			var delays = GKManager.Delays.Where(x => GKManager.DeviceConfiguration.OPCSettings.DelayUIDs.Contains(x.UID)).ToList();
			DelaysSelectationViewModel = new DelaysSelectationViewModel(delays);
			var devices = GKManager.Devices.Where(x => GKManager.DeviceConfiguration.OPCSettings.DeviceUIDs.Contains(x.UID)).ToList();
			DevicesSelectationViewModel = new DevicesSelectationViewModel(devices, GKManager.Devices.Where(x => x.Driver.IsReal).ToList());
			var mpts = GKManager.MPTs.Where(x => GKManager.DeviceConfiguration.OPCSettings.MPTUIDs.Contains(x.UID)).ToList();
			MPTsSelectationViewModel = new MPTsSelectationViewModel(mpts);
			var ns = GKManager.PumpStations.Where(x => GKManager.DeviceConfiguration.OPCSettings.NSUIDs.Contains(x.UID)).ToList();
			PumpStationsSelectationViewModel = new PumpStationsSelectationViewModel(ns);
			var doors = GKManager.Doors.Where(x => GKManager.DeviceConfiguration.OPCSettings.DoorUIDs.Contains(x.UID)).ToList();
			DoorsSelectationViewModel = new DoorsSelectationViewModel(doors);
		}
Example #3
0
		void OnSelectGKDoors(SelectGKDoorsEventArg selectDoorsEventArg)
		{
			var doorsSelectionViewModel = new DoorsSelectationViewModel(selectDoorsEventArg.Doors);
			selectDoorsEventArg.Cancel = !ServiceFactory.DialogService.ShowModalWindow(doorsSelectionViewModel);
			selectDoorsEventArg.Doors = doorsSelectionViewModel.TargetDoors.ToList();
		}
Example #4
0
		void OnManageInputDoors()
		{
			var beforeDoors = new List<GKDoor>(InputDoors.Select(x => x.Door));
			var doorsTypes = new List<GKDoorType> { GKDoorType.AirlockBooth, GKDoorType.Barrier, GKDoorType.Turnstile, GKDoorType.TwoWay };
			var doorsSelectationViewModel = new DoorsSelectationViewModel(beforeDoors, doorsTypes);
			if (DialogService.ShowModalWindow(doorsSelectationViewModel))
			{
				var afterDoors = doorsSelectationViewModel.Doors;
				foreach (var door in beforeDoors)
				{
					if (!afterDoors.Contains(door))
						door.ExitZoneUID = Guid.Empty;
				}
				afterDoors.ForEach(door => door.ExitZoneUID = Zone.UID);
				ServiceFactory.SaveService.GKChanged = true;
			}
			Update();
		}
Example #5
0
		void OnSelectDoors()
		{
			var doorsSelectationViewModel = new DoorsSelectationViewModel(Doors);
			if (DialogService.ShowModalWindow(doorsSelectationViewModel))
			{
				Doors = doorsSelectationViewModel.Doors;
				OnPropertyChanged(() => PresenrationDoors);
			}
		}