TopViewModel.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Event;
  3. using Aitex.Core.RT.Log;
  4. using Aitex.Core.Util;
  5. using Aitex.Core.WCF;
  6. using MECF.Framework.Common.DataCenter;
  7. using MECF.Framework.Common.OperationCenter;
  8. using Prism.Commands;
  9. using Prism.Mvvm;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Collections.ObjectModel;
  13. using System.Linq;
  14. using System.Windows;
  15. using System.Windows.Media;
  16. using System.Windows.Threading;
  17. using Venus_MainPages.Unity;
  18. using Venus_MainPages.Views;
  19. namespace Venus_MainPages.ViewModels
  20. {
  21. internal class TopViewModel : BindableBase
  22. {
  23. #region 私有字段
  24. private string m_Title;
  25. private string m_SoftwareVersion;
  26. //private DateTime m_DateTimeNow;
  27. private List<string> m_RtDataKeys = new List<string>();
  28. private Dictionary<string, object> m_RtDataValues;
  29. //private string ModuleName;
  30. private ObservableCollection<EventItem> m_EventLogList = new ObservableCollection<EventItem>();
  31. private EventItem m_CurrentEventItem = new EventItem();
  32. private string m_CurrentEventItemValue;
  33. //private object _lockObj = new object();
  34. private int m_EventLogListSelectedIndex;
  35. private Queue<EventItem> alarmQuery = new Queue<EventItem>();//控制alarm log 在 top UI显示
  36. private readonly int logMaxCount = 50;//log在ui最多显示数量
  37. private AITSignalTowerData m_SignalTowerData;
  38. private string m_HostCommunicationStatus;
  39. private string m_TimeTick;
  40. private string m_UserName;
  41. //private JetChamber m_SelectedJetChamber = JetChamber.None;
  42. private bool m_PMAIsInstalled;
  43. private bool m_PMBIsInstalled;
  44. private bool m_PMCIsInstalled;
  45. private bool m_PMDIsInstalled;
  46. private bool m_LLAIsInstalled;
  47. private bool m_LLBIsInstalled;
  48. private bool m_TMIsInstalled;
  49. private bool m_EFEMIsInstalled;
  50. //private List<eEvent> stopEntityId = new List<eEvent>()
  51. //{
  52. // eEvent.ERR_MATCH,
  53. // eEvent.ERR_RF,
  54. // eEvent.ERR_PENDULUM_VALVE,
  55. // eEvent.ERR_DEVICE_INFO,
  56. // eEvent.ERR_DRY_PUMP,
  57. // eEvent.ERR_HighTemperatureHeater
  58. // //eEvent.ERR_Sensor
  59. //};
  60. //private PressureType m_PressureType;
  61. //private ConfigType m_ConfigType;
  62. private bool m_IsExcludeInfoType;
  63. private TopView view;
  64. #endregion
  65. #region 属性
  66. public string UserName
  67. {
  68. get { return m_UserName; }
  69. set { SetProperty(ref m_UserName, value); }
  70. }
  71. //public DateTime DateTimeNow
  72. //{
  73. // get { return m_DateTimeNow; }
  74. // set { SetProperty(ref m_DateTimeNow, value); }
  75. //}
  76. public string Title
  77. {
  78. get { return m_Title; }
  79. set { SetProperty(ref m_Title, value); }
  80. }
  81. public string SoftwareVersion
  82. {
  83. get { return m_SoftwareVersion; }
  84. set { SetProperty(ref m_SoftwareVersion, value); }
  85. }
  86. public string TimeTick
  87. {
  88. get { return m_TimeTick; }
  89. set { SetProperty(ref m_TimeTick, value); }
  90. }
  91. public Dictionary<string, object> RtDataValues
  92. {
  93. get { return m_RtDataValues; }
  94. set { SetProperty(ref m_RtDataValues, value); }
  95. }
  96. public ObservableCollection<EventItem> EventLogList
  97. {
  98. get { return m_EventLogList; }
  99. set { SetProperty(ref m_EventLogList, value); }
  100. }
  101. public EventItem CurrentEventItem
  102. {
  103. get { return m_CurrentEventItem; }
  104. set { SetProperty(ref m_CurrentEventItem, value); }
  105. }
  106. public int EventLogListSelectedIndex
  107. {
  108. get { return m_EventLogListSelectedIndex; }
  109. set { SetProperty(ref m_EventLogListSelectedIndex, value); }
  110. }
  111. public string CurrentEventItemValue
  112. {
  113. get { return m_CurrentEventItemValue; }
  114. set { SetProperty(ref m_CurrentEventItemValue, value); }
  115. }
  116. public AITSignalTowerData SignalTowerData
  117. {
  118. get { return m_SignalTowerData; }
  119. set { SetProperty(ref m_SignalTowerData, value); }
  120. }
  121. public string HostCommunicationStatusBackground
  122. {
  123. get
  124. {
  125. switch (HostCommunicationStatus)
  126. {
  127. case "Disabled":
  128. return "#D79C11";
  129. case "Enabled":
  130. case "EnabledNotCommunicating":
  131. case "WaitCRA":
  132. case "WaitDelay":
  133. case "WaitCRFromHost":
  134. return "Transparent";
  135. case "EnabledCommunicating":
  136. return "LawnGreen";
  137. default:
  138. return "#D79C11";
  139. }
  140. }
  141. }
  142. public string m_HostBack;
  143. public string HostBack
  144. {
  145. get { return m_HostBack; }
  146. set { SetProperty(ref m_HostBack, value); }
  147. }
  148. [Subscription("System.CommunicationStatus")]
  149. public string HostCommunicationStatus
  150. {
  151. get { return m_HostCommunicationStatus; }
  152. set
  153. {
  154. SetProperty(ref m_HostCommunicationStatus, value);
  155. }
  156. }
  157. public bool IsEnableFAEnable
  158. {
  159. get
  160. {
  161. return HostCommunicationStatus == "Disabled";
  162. }
  163. }
  164. public bool _IsEnableEnable;
  165. public bool IsEnableEnable
  166. {
  167. get { return _IsEnableEnable; }
  168. set { SetProperty(ref _IsEnableEnable, value); }
  169. }
  170. public bool _IsEnableDisable;
  171. public bool IsEnableDisable
  172. {
  173. get { return _IsEnableDisable; }
  174. set { SetProperty(ref _IsEnableDisable, value); }
  175. }
  176. public bool IsExcludeInfoType
  177. {
  178. get { return m_IsExcludeInfoType; }
  179. set { SetProperty(ref m_IsExcludeInfoType, value); }
  180. }
  181. public FACommunicationState FACommunicationState
  182. {
  183. get
  184. {
  185. return string.IsNullOrEmpty(HostCommunicationStatus) ? FACommunicationState.Disabled
  186. : (FACommunicationState)Enum.Parse(typeof(FACommunicationState), HostCommunicationStatus);
  187. }
  188. }
  189. public bool PMAIsInstalled
  190. {
  191. get { return m_PMAIsInstalled; }
  192. set { SetProperty(ref m_PMAIsInstalled, value); }
  193. }
  194. public bool PMBIsInstalled
  195. {
  196. get { return m_PMBIsInstalled; }
  197. set { SetProperty(ref m_PMBIsInstalled, value); }
  198. }
  199. public bool PMCIsInstalled
  200. {
  201. get { return m_PMCIsInstalled; }
  202. set { SetProperty(ref m_PMCIsInstalled, value); }
  203. }
  204. public bool PMDIsInstalled
  205. {
  206. get { return m_PMDIsInstalled; }
  207. set { SetProperty(ref m_PMDIsInstalled, value); }
  208. }
  209. public bool LLAIsInstalled
  210. {
  211. get { return m_LLAIsInstalled; }
  212. set { SetProperty(ref m_LLAIsInstalled, value); }
  213. }
  214. public bool LLBIsInstalled
  215. {
  216. get { return m_LLBIsInstalled; }
  217. set { SetProperty(ref m_LLBIsInstalled, value); }
  218. }
  219. public bool TMIsInstalled
  220. {
  221. get { return m_TMIsInstalled; }
  222. set { SetProperty(ref m_TMIsInstalled, value); }
  223. }
  224. public SolidColorBrush DefaultBrush = new SolidColorBrush(Colors.LightCyan);
  225. public bool EFEMIsInstalled
  226. {
  227. get { return m_EFEMIsInstalled; }
  228. set { SetProperty(ref m_EFEMIsInstalled, value); }
  229. }
  230. private bool m_SETMIsInstalled;
  231. private bool m_DETMIsInstalled;
  232. private bool m_VCE1IsInstalled;
  233. private bool m_VCEAIsInstalled;
  234. private bool m_VCEBIsInstalled;
  235. public bool SETMIsInstalled
  236. {
  237. get { return m_SETMIsInstalled; }
  238. set { SetProperty(ref m_SETMIsInstalled, value); }
  239. }
  240. public bool DETMIsInstalled
  241. {
  242. get { return m_DETMIsInstalled; }
  243. set { SetProperty(ref m_DETMIsInstalled, value); }
  244. }
  245. public bool VCE1IsInstalled
  246. {
  247. get { return m_VCE1IsInstalled; }
  248. set { SetProperty(ref m_VCE1IsInstalled, value); }
  249. }
  250. public bool VCEAIsInstalled
  251. {
  252. get { return m_VCEAIsInstalled; }
  253. set { SetProperty(ref m_VCEAIsInstalled, value); }
  254. }
  255. public bool VCEBIsInstalled
  256. {
  257. get { return m_VCEBIsInstalled; }
  258. set { SetProperty(ref m_VCEBIsInstalled, value); }
  259. }
  260. #endregion
  261. #region 命令
  262. //private DelegateCommand _SwichLanguageCommand;
  263. //public DelegateCommand SwichLanguageCommand =>
  264. // _SwichLanguageCommand ?? (_SwichLanguageCommand = new DelegateCommand(OnSwitchLanguage));
  265. private DelegateCommand _ResetCommand;
  266. public DelegateCommand ResetCommand =>
  267. _ResetCommand ?? (_ResetCommand = new DelegateCommand(OnReset));
  268. private DelegateCommand _ClearCommand;
  269. public DelegateCommand ClearCommand =>
  270. _ClearCommand ?? (_ClearCommand = new DelegateCommand(OnClear));
  271. private DelegateCommand _SkipCommand;
  272. public DelegateCommand SkipCommand =>
  273. _SkipCommand ?? (_SkipCommand = new DelegateCommand(OnSkip));
  274. //private DelegateCommand _BuzzerOffCommand;
  275. //public DelegateCommand BuzzerOffCommand =>
  276. // _BuzzerOffCommand ?? (_BuzzerOffCommand = new DelegateCommand(OnBuzzerOff));
  277. private DelegateCommand _FADisableCommand;
  278. public DelegateCommand FADisableCommand =>
  279. _FADisableCommand ?? (_FADisableCommand = new DelegateCommand(FaDisable));
  280. private DelegateCommand _FAEnableCommand;
  281. public DelegateCommand FAEnableCommand =>
  282. _FAEnableCommand ?? (_FAEnableCommand = new DelegateCommand(FaEnable));
  283. private DelegateCommand _ExcludeInfoCommand;
  284. public DelegateCommand ExcludeInfoCommand =>
  285. _ExcludeInfoCommand ?? (_ExcludeInfoCommand = new DelegateCommand(OnExcludeInfo));
  286. private DelegateCommand _LogoutCommand;
  287. public DelegateCommand LogoutCommand =>
  288. _LogoutCommand ?? (_LogoutCommand = new DelegateCommand(OnLogout));
  289. private DelegateCommand _SwitchBuzzerCommand;
  290. public DelegateCommand SwitchBuzzerCommand =>
  291. _SwitchBuzzerCommand ?? (_SwitchBuzzerCommand = new DelegateCommand(OnSwitchBuzzer));
  292. private DelegateCommand<object> _LoadCommand;
  293. public DelegateCommand<object> LoadCommand =>
  294. _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
  295. #endregion
  296. #region 构造函数
  297. public TopViewModel()
  298. {
  299. m_SoftwareVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
  300. string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
  301. PMAIsInstalled = allModules.Contains("PMA");
  302. PMBIsInstalled = allModules.Contains("PMB");
  303. PMCIsInstalled = allModules.Contains("PMC");
  304. PMDIsInstalled = allModules.Contains("PMD");
  305. LLAIsInstalled = allModules.Contains("LLA");
  306. LLBIsInstalled = allModules.Contains("LLB");
  307. TMIsInstalled = allModules.Contains("TM");
  308. EFEMIsInstalled = allModules.Contains("EFEM");
  309. SETMIsInstalled = allModules.Contains("SETM");
  310. DETMIsInstalled = allModules.Contains("DETM");
  311. VCE1IsInstalled = allModules.Contains("VCE1");
  312. VCEAIsInstalled = allModules.Contains("VCEA");
  313. VCEBIsInstalled = allModules.Contains("VCEB");
  314. //ModuleName = "PMA";
  315. addDataKeys();
  316. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  317. DispatcherTimer timer = new DispatcherTimer();
  318. timer.Interval = TimeSpan.FromSeconds(1);
  319. timer.Tick += timer_Tick;
  320. timer.Start();
  321. EventClient.Instance.OnEvent += Instance_OnEvent;
  322. EventClient.Instance.Start();
  323. Title = QueryDataClient.Instance.Service.GetConfig($"System.Name").ToString();
  324. UserName = GlobalUser.Instance.User.Name;
  325. }
  326. #endregion
  327. #region 方法
  328. private void OnLoad(object obj)
  329. {
  330. view = obj as TopView;
  331. if (!VCE1IsInstalled)
  332. {
  333. this.view.moduleGrid.Children.Remove(this.view.vce1Title);
  334. this.view.vce1Title = null;
  335. }
  336. if (!VCEAIsInstalled)
  337. {
  338. this.view.moduleGrid.Children.Remove(this.view.vceATitle);
  339. this.view.vceATitle = null;
  340. }
  341. if (!VCEBIsInstalled)
  342. {
  343. this.view.moduleGrid.Children.Remove(this.view.vceBTitle);
  344. this.view.vceBTitle = null;
  345. }
  346. if (!PMAIsInstalled)
  347. {
  348. this.view.moduleGrid.Children.Remove(this.view.pmaTitle);
  349. this.view.pmaTitle = null;
  350. }
  351. if (!PMBIsInstalled)
  352. {
  353. this.view.moduleGrid.Children.Remove(this.view.pmbTitle);
  354. this.view.pmbTitle = null;
  355. }
  356. if (!PMCIsInstalled)
  357. {
  358. this.view.moduleGrid.Children.Remove(this.view.pmcTitle);
  359. this.view.pmcTitle = null;
  360. }
  361. if (!PMDIsInstalled)
  362. {
  363. this.view.moduleGrid.Children.Remove(this.view.pmdTitle);
  364. this.view.pmdTitle = null;
  365. }
  366. if (!SETMIsInstalled)
  367. {
  368. this.view.moduleGrid.Children.Remove(this.view.seTmTitle);
  369. this.view.seTmTitle = null;
  370. }
  371. if (!DETMIsInstalled)
  372. {
  373. this.view.moduleGrid.Children.Remove(this.view.deTmTitle);
  374. this.view.deTmTitle = null;
  375. }
  376. if (!TMIsInstalled)
  377. {
  378. this.view.moduleGrid.Children.Remove(this.view.tmTitle);
  379. this.view.tmTitle = null;
  380. }
  381. GC.Collect(); // This should pick up the control removed at a previous MouseDown
  382. GC.WaitForPendingFinalizers(); // Doesn't help either
  383. }
  384. void timer_Tick(object sender, EventArgs e)
  385. {
  386. TimeTick = DateTime.Now.ToString();
  387. RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
  388. SignalTowerData = CommonFunction.GetValue<AITSignalTowerData>(RtDataValues, $"System.SignalTower.DeviceData");
  389. HostCommunicationStatus = CommonFunction.GetValue<String>(RtDataValues, "System.CommunicationStatus");
  390. //IsEnableEnable = FACommunicationState == CommunicationState.Disabled;
  391. //IsEnableDisable = FACommunicationState != CommunicationState.Disabled;
  392. HostBack = HostCommunicationStatusBackground;
  393. IsEnableEnable = (HostCommunicationStatus == FACommunicationState.Disabled.ToString());
  394. IsEnableDisable = (HostCommunicationStatus != FACommunicationState.Disabled.ToString());
  395. }
  396. //private void OnSwitchLanguage()
  397. //{
  398. // List<ResourceDictionary> dictionaryList = new List<ResourceDictionary>();
  399. // foreach (ResourceDictionary dictionary in Application.Current.Resources.MergedDictionaries)
  400. // {
  401. // if (dictionary.Source != null)
  402. // {
  403. // dictionaryList.Add(dictionary);
  404. // }
  405. // }
  406. // string requestedCulture1 = @"/Venus_Themes;component/Languages/StringResources.en-US.xaml";
  407. // string requestedCulture2 = @"/Venus_Themes;component/Languages/StringResources.zh-CN.xaml";
  408. // ResourceDictionary resourceDictionary1 = dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedCulture1));
  409. // ResourceDictionary resourceDictionary2 = dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedCulture2));
  410. // if (dictionaryList.IndexOf(resourceDictionary1) < dictionaryList.IndexOf(resourceDictionary2))
  411. // {
  412. // Application.Current.Resources.MergedDictionaries.Remove(resourceDictionary1);
  413. // Application.Current.Resources.MergedDictionaries.Add(resourceDictionary1);
  414. // }
  415. // else
  416. // {
  417. // Application.Current.Resources.MergedDictionaries.Remove(resourceDictionary2);
  418. // Application.Current.Resources.MergedDictionaries.Add(resourceDictionary2);
  419. // }
  420. //}
  421. private void OnReset()
  422. {
  423. InvokeClient.Instance.Service.DoOperation("System.Reset");
  424. }
  425. private void addDataKeys()
  426. {
  427. if (PMAIsInstalled)
  428. {
  429. m_RtDataKeys.Add("PMA.FsmState");
  430. m_RtDataKeys.Add("PMA.IsOnline");
  431. m_RtDataKeys.Add("PMA.IsInclude");
  432. }
  433. if (PMBIsInstalled)
  434. {
  435. m_RtDataKeys.Add("PMB.FsmState");
  436. m_RtDataKeys.Add("PMB.IsOnline");
  437. m_RtDataKeys.Add("PMB.IsInclude");
  438. }
  439. if (PMCIsInstalled)
  440. {
  441. m_RtDataKeys.Add("PMC.FsmState");
  442. m_RtDataKeys.Add("PMC.IsOnline");
  443. m_RtDataKeys.Add("PMC.IsInclude");
  444. }
  445. if (PMDIsInstalled)
  446. {
  447. m_RtDataKeys.Add("PMD.FsmState");
  448. m_RtDataKeys.Add("PMD.IsOnline");
  449. m_RtDataKeys.Add("PMD.IsInclude");
  450. }
  451. m_RtDataKeys.Add("TM.FsmState");
  452. m_RtDataKeys.Add("TM.IsOnline");
  453. if (VCE1IsInstalled)
  454. {
  455. m_RtDataKeys.Add("VCE1.IsOnline");
  456. m_RtDataKeys.Add("VCE1.FsmState");
  457. }
  458. if (VCEAIsInstalled)
  459. {
  460. m_RtDataKeys.Add("VCEA.IsOnline");
  461. m_RtDataKeys.Add("VCEA.FsmState");
  462. }
  463. if (VCEBIsInstalled)
  464. {
  465. m_RtDataKeys.Add("VCEB.IsOnline");
  466. m_RtDataKeys.Add("VCEB.FsmState");
  467. }
  468. if (EFEMIsInstalled)
  469. {
  470. m_RtDataKeys.Add("EFEM.FsmState");
  471. m_RtDataKeys.Add("EFEM.IsOnline");
  472. }
  473. m_RtDataKeys.Add("LLA.FsmState");
  474. m_RtDataKeys.Add("LLA.IsOnline");
  475. m_RtDataKeys.Add("LLA.IsInclude");
  476. m_RtDataKeys.Add("LLB.FsmState");
  477. m_RtDataKeys.Add("LLB.IsOnline");
  478. m_RtDataKeys.Add("LLB.IsInclude");
  479. m_RtDataKeys.Add("SYSTEM.FsmState");
  480. m_RtDataKeys.Add("System.IsAutoMode");
  481. m_RtDataKeys.Add($"System.SignalTower.DeviceData");
  482. m_RtDataKeys.Add("System.CommunicationStatus");
  483. }
  484. private void Instance_OnEvent(EventItem eventItem)
  485. {
  486. if (IsExcludeInfoType && eventItem.Level == EventLevel.Information)
  487. {
  488. return;
  489. }
  490. GlobalEvents.Instance.OnEventItemRaiseChanged(eventItem);
  491. switch (eventItem.Type)
  492. {
  493. case EventType.EventUI_Notify:
  494. Application.Current.Dispatcher.Invoke(delegate
  495. {
  496. EventLogList.Insert(0, eventItem);
  497. if (EventLogList.Count > logMaxCount)
  498. {
  499. EventLogList.RemoveAt(EventLogList.Count - 1);
  500. }
  501. if (eventItem.Level == EventLevel.Alarm)
  502. {
  503. alarmQuery.Enqueue(eventItem);
  504. //if (m_ConfigType == ConfigType.Kepler2200)
  505. //{
  506. // if (stopEntityId.Contains((eEvent)eventItem.Id) && eventItem.Source.Contains("PM"))
  507. // {
  508. // InvokeClient.Instance.Service.DoOperation($"{eventItem.Source}.PmError");
  509. // }
  510. //}
  511. }
  512. if (alarmQuery.Count > 0)
  513. {
  514. CurrentEventItem = alarmQuery.First();
  515. }
  516. else
  517. {
  518. CurrentEventItem = eventItem;
  519. }
  520. EventLogListSelectedIndex = 0;
  521. });
  522. break;
  523. case EventType.Dialog_Nofity:
  524. //PopDialog(obj);
  525. break;
  526. case EventType.KickOut_Notify:
  527. break;
  528. case EventType.Sound_Notify:
  529. break;
  530. case EventType.UIMessage_Notify:
  531. //PopUIMessage(obj);
  532. break;
  533. }
  534. }
  535. private void OnClear()
  536. {
  537. CurrentEventItem = null;
  538. alarmQuery.Clear();
  539. EventLogList.Clear();
  540. }
  541. private void OnSkip()
  542. {
  543. if (alarmQuery.Count > 0)
  544. {
  545. alarmQuery.Dequeue();
  546. if (alarmQuery.Count > 0)
  547. {
  548. CurrentEventItem = alarmQuery.First();
  549. }
  550. else
  551. {
  552. CurrentEventItem = null;
  553. }
  554. }
  555. }
  556. //private void OnBuzzerOff()
  557. //{
  558. // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SignalTower.SwitchOffBuzzer");
  559. //}
  560. public void FaDisable()
  561. {
  562. InvokeClient.Instance.Service.DoOperation($"FACommand", "FADisable");
  563. }
  564. public void FaEnable()
  565. {
  566. InvokeClient.Instance.Service.DoOperation($"FACommand", "FAEnable");
  567. }
  568. public void OnExcludeInfo()
  569. {
  570. IsExcludeInfoType = !IsExcludeInfoType;
  571. }
  572. private void OnLogout()
  573. {
  574. var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is Window) as Window;
  575. LogoutView heaterView = new LogoutView();
  576. heaterView.WindowStartupLocation = WindowStartupLocation.CenterScreen;
  577. heaterView.Owner = _mainWindow;
  578. heaterView.Show();
  579. }
  580. private void OnSwitchBuzzer()
  581. {
  582. InvokeClient.Instance.Service.DoOperation($"System.{AITSignalTowerOperation.SwitchOffBuzzer}");
  583. }
  584. #endregion
  585. }
  586. }