public DelayDescriptor(XDelay delay) { DatabaseType = DatabaseType.Gk; DescriptorType = DescriptorType.Delay; Delay = delay; Build(); }
public DelayViewModel(XDelay delay) { ShowJournalCommand = new RelayCommand(OnShowJournal); ShowPropertiesCommand = new RelayCommand(OnShowProperties); Delay = delay; State.StateChanged += new System.Action(OnStateChanged); OnStateChanged(); }
public void AddDelay(XDelay delay) { if (!Delays.Contains(delay)) { delay.GKDescriptorNo = NextDescriptorNo; delay.GkDatabaseParent = RootDevice; Delays.Add(delay); } }
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(); }
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; }
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; } } } }
public XDelayState(XDelay delay) { Delay = delay; }
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); } }