コード例 #1
0
ファイル: PumpStationCreator.cs プロジェクト: xbadcode/Rubezh
		void CreateDelays()
		{
			for (int i = 1; i < FirePumpDevices.Count; i++)
			{
				var pumpDevice = FirePumpDevices[i];
				var delay = new GKDelay()
				{
					Name = "Задержка пуска ШУН " + pumpDevice.DottedAddress,
					DelayTime = (ushort)PumpStation.NSDeltaTime,
					Hold = 2,
					DelayRegime = DelayRegime.Off,
					IsAutoGenerated = true,
					PumpStationUID = PumpStation.UID
				};
				delay.UID = Guid.NewGuid(); //GuidHelper.CreateOn(pumpDevice.UID, 0);

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

				var delayDescriptor = new DelayDescriptor(delay);
				Database.Descriptors.Add(delayDescriptor);
			}
		}
コード例 #2
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);
			}
		}