コード例 #1
0
ファイル: DelayDescriptor.cs プロジェクト: saeednazari/Rubezh
		public DelayDescriptor(XDelay delay)
		{
			DatabaseType = DatabaseType.Gk;
			DescriptorType = DescriptorType.Delay;
			Delay = delay;
			Build();
		}
コード例 #2
0
ファイル: DelayViewModel.cs プロジェクト: saeednazari/Rubezh
		public DelayViewModel(XDelay delay)
		{
			ShowJournalCommand = new RelayCommand(OnShowJournal);
			ShowPropertiesCommand = new RelayCommand(OnShowProperties);
			Delay = delay;
			State.StateChanged += new System.Action(OnStateChanged);
			OnStateChanged();
		}
コード例 #3
0
ファイル: GkDatabase.cs プロジェクト: saeednazari/Rubezh
		public void AddDelay(XDelay delay)
		{
			if (!Delays.Contains(delay))
			{
				delay.GKDescriptorNo = NextDescriptorNo;
				delay.GkDatabaseParent = RootDevice;
				Delays.Add(delay);
			}
		}
コード例 #4
0
		public PumpStationDescriptor(GkDatabase gkDatabase, XPumpStation pumpStation)
		{
			DatabaseType = DatabaseType.Gk;
			DescriptorType = DescriptorType.PumpStation;
			PumpStation = pumpStation;

			MainDelay = new XDelay();
			MainDelay.UID = GuidHelper.CreateOn(PumpStation.UID);
			gkDatabase.AddDelay(MainDelay);

			Build();
		}
コード例 #5
0
		public DelayDetailsViewModel(XDelay delay)
		{
			Delay = delay;
			State.StateChanged += new Action(OnStateChanged);

			ShowCommand = new RelayCommand(OnShow);
			ShowJournalCommand = new RelayCommand(OnShowJournal);
			SetAutomaticStateCommand = new RelayCommand(OnSetAutomaticState, CanSetAutomaticState);
			SetManualStateCommand = new RelayCommand(OnSetManualState, CanSetManualState);
			SetIgnoreStateCommand = new RelayCommand(OnSetIgnoreState, CanSetIgnoreState);
			TurnOnCommand = new RelayCommand(OnTurnOn);
			TurnOnNowCommand = new RelayCommand(OnTurnOnNow);
			TurnOffCommand = new RelayCommand(OnTurnOff);

			Title = Delay.Name;
			TopMost = true;
		}
コード例 #6
0
		public PumpStationCreator(GkDatabase gkDatabase, XPumpStation pumpStation, XDelay mainDelay)
		{
			GkDatabase = gkDatabase;
			PumpStation = pumpStation;
			MainDelay = mainDelay;

			PumpDelays = new List<PumpDelay>();

			FirePumpDevices = new List<XDevice>();
			foreach (var nsDevice in pumpStation.NSDevices)
			{
				if (nsDevice.Driver.IsPump)
				{
					var pumpTypeProperty = nsDevice.Properties.FirstOrDefault(x => x.Name == "PumpType");
					if (pumpTypeProperty != null)
					{
						if (pumpTypeProperty.Value == 0)
							FirePumpDevices.Add(nsDevice);
						if (pumpTypeProperty.Value == 1)
							JNPumpDevice = nsDevice;
					}
				}
			}
		}
コード例 #7
0
ファイル: XDelayState.cs プロジェクト: saeednazari/Rubezh
		public XDelayState(XDelay delay)
		{
			Delay = delay;
		}
コード例 #8
0
		void CreateDelays()
		{
			for (int i = 1; i < FirePumpDevices.Count; i++)
			{
				var pumpDevice = FirePumpDevices[i];
				var delay = new XDelay()
				{
					Name = "Задержка пуска ШУН " + pumpDevice.DottedAddress,
					DelayTime = (ushort)PumpStation.NSDeltaTime,
					SetTime = 2,
					DelayRegime = DelayRegime.Off
				};
				delay.UID = GuidHelper.CreateOn(pumpDevice.UID);

				var pumpDelay = new PumpDelay
				{
					Delay = delay,
					Device = pumpDevice
				};
				PumpDelays.Add(pumpDelay);

				GkDatabase.AddDelay(delay);
				var delayDescriptor = new DelayDescriptor(delay);
				GkDatabase.Descriptors.Add(delayDescriptor);
			}
		}