コード例 #1
0
ファイル: FiresecDriver.cs プロジェクト: saeednazari/Rubezh
        public void StartWatcher(bool mustMonitorStates, bool mustMonitorJournal)
        {
            if (Watcher == null)
                Watcher = new Watcher(FiresecSerializedClient, mustMonitorStates, mustMonitorJournal);

            if (mustMonitorStates)
            {
                Watcher.ForceStateChanged();
                Watcher.ForceParametersChanged();
            }
        }
コード例 #2
0
		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);
			}
		}
コード例 #3
0
ファイル: Watcher.cs プロジェクト: saeednazari/Rubezh
        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);
		}