public void StartWatcher(bool mustMonitorStates, bool mustMonitorJournal) { if (Watcher == null) Watcher = new Watcher(FiresecSerializedClient, mustMonitorStates, mustMonitorJournal); if (mustMonitorStates) { Watcher.ForceStateChanged(); Watcher.ForceParametersChanged(); } }
public void StartWatcher(bool mustMonitorStates, bool mustMonitorJournal) { try { Watcher = new Watcher(FiresecSerializedClient, mustMonitorStates, mustMonitorJournal); if (mustMonitorStates) { Watcher.OnStateChanged(); Watcher.OnParametersChanged(); } } catch (Exception e) { Logger.Error(e, "FiresecDriver.Synchronyze"); FiresecDriver.LoadingErrors.Append(e.Message); } }
public Watcher(FiresecSerializedClient firesecSerializedClient, bool mustMonitorStates, bool mustMonitorJournal) { Current = this; FiresecSerializedClient = firesecSerializedClient; MustMonitorJournal = mustMonitorJournal; if (mustMonitorJournal) { SetLastEvent(); } if (mustMonitorStates) { FiresecSerializedClient.NewJournalRecords += new Action<List<JournalRecord>>(OnNewJournalRecords); FiresecSerializedClient.StateChanged += new Action<Models.CoreState.config>(OnStateChanged); FiresecSerializedClient.ParametersChanged += new Action<Models.DeviceParameters.config>(OnParametersChanged); } FiresecSerializedClient.ProgressEvent += new Action<int, string, int, int>(OnProgress); }