SRDHomePageViewModel.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows.Input;
  4. using System.Windows.Threading;
  5. using MECF.Framework.Common.OperationCenter;
  6. using Prism.Mvvm;
  7. using Prism.Commands;
  8. using MECF.Framework.Common.CommonData.SRD;
  9. using MECF.Framework.Common.Persistent.SRD;
  10. using MECF.Framework.Common.CommonData.PUF;
  11. using MECF.Framework.Common.DataCenter;
  12. using MECF.Framework.Common.Utilities;
  13. using MECF.Framework.Common.RecipeCenter;
  14. using System.Collections.ObjectModel;
  15. using CyberX8_MainPages.PMs;
  16. using MECF.Framework.Common.Beckhoff.Station;
  17. using CyberX8_MainPages.Unity;
  18. using WaferInfo = OpenSEMI.ClientBase.WaferInfo;
  19. namespace CyberX8_MainPages.ViewModels
  20. {
  21. internal class SRDHomePageViewModel:BindableBase
  22. {
  23. #region 常量
  24. private const string COMMON_DATA = "CommonData";
  25. private const string PERSISTENT_VALUE = "PersistentValue";
  26. private const string WAFER_PRESENCE_STATUS = "WaferPresenceStatus";
  27. private const string SRD = "srd";
  28. private const string WAFER_HOLDER= "WaferHolder";
  29. private const string LOADER_DI_ENABLE = "LoaderDiEnable";
  30. private const string FACILITIES = "Facilities";
  31. private const string MOTION_DATA = "MotionData";
  32. private const double ARM_UI_HOME_POSITION = 25.682;
  33. private const double ARM_UI_CENTER_POSITION = -15;
  34. private const double ROTATION_UI_HOME_POSITION = 0;
  35. private const double FLIPPER_IN_POSITION = 41;
  36. private const double FLIPPER_OUT_POSITION = 0;
  37. #endregion
  38. #region 内部变量
  39. #region SRD
  40. /// <summary>
  41. /// SRDRecipeContent
  42. /// </summary>
  43. private string _recipeContent;
  44. /// <summary>
  45. /// TimeRemaining
  46. /// </summary>
  47. private double _timeRemaining;
  48. /// <summary>
  49. /// OfTotalTime
  50. /// </summary>
  51. private double _totalTime;
  52. /// <summary>
  53. /// OperatingMode
  54. /// </summary>
  55. private string _operatingMode;
  56. /// <summary>
  57. /// State
  58. /// </summary>
  59. private string _state;
  60. /// <summary>
  61. /// RecipeMode
  62. /// </summary>
  63. private string _recipeMode;
  64. /// <summary>
  65. /// AchievedRunRecipeCycle
  66. /// </summary>
  67. private int _achievedRunRecipeCycle;
  68. /// <summary>
  69. /// Loader DI
  70. /// </summary>
  71. private bool _loaderDiEnable;
  72. #endregion
  73. #region wafer
  74. /// <summary>
  75. /// WaferID
  76. /// </summary>
  77. private string _waferID = "";
  78. /// <summary>
  79. /// SeqRecipe
  80. /// </summary>
  81. private string _seqRecipe;
  82. /// <summary>
  83. /// Wafer信息
  84. /// </summary>
  85. private WaferInfo _waferInfo;
  86. #endregion
  87. #region SRD recipe
  88. /// <summary>
  89. /// RecipeModuleName
  90. /// </summary>
  91. private string _recipeModuleName;
  92. /// <summary>
  93. /// RecipeType
  94. /// </summary>
  95. private string _recipeType;
  96. /// <summary>
  97. /// 当前选择Recipe节点
  98. /// </summary>
  99. private RecipeNode _selectedRecipeNode;
  100. /// <summary>
  101. /// Recipe节点
  102. /// </summary>
  103. private ObservableCollection<RecipeNode> _recipeNodes;
  104. // <summary>
  105. /// 当前Recipe
  106. /// </summary>
  107. private string _currentRecipe;
  108. #endregion
  109. #region Common
  110. /// <summary>
  111. /// 模块名称
  112. /// </summary>
  113. private string _module;
  114. /// <summary>
  115. /// State Machine
  116. /// </summary>
  117. private string _stateMachine;
  118. /// <summary>
  119. /// Status
  120. /// </summary>
  121. private string _status;
  122. /// <summary>
  123. /// 数据
  124. /// </summary>
  125. private SrdCommonData _sRDCommonData;
  126. /// <summary>
  127. /// Threshold
  128. /// </summary>
  129. private SRDPersistentValue _sRDPersistent;
  130. /// <summary>
  131. /// WaferPresence
  132. /// </summary>
  133. private string _waferPresence;
  134. /// <summary>
  135. /// PresenceTest是否进行中
  136. /// </summary>
  137. private bool _isPresenceTesting;
  138. /// <summary>
  139. /// Test Without Wafers
  140. /// </summary>
  141. private bool _isWaferPresence;
  142. /// <summary>
  143. /// sRDArm运动数据
  144. /// </summary>
  145. private CommandMotionData _sRDArmMotionData;
  146. /// <summary>
  147. /// sRDRotation运动数据
  148. /// </summary>
  149. private CommandMotionData _sRDRotationMotionData;
  150. /// <summary>
  151. /// 页面功能启用
  152. /// </summary>
  153. private bool _isEnabled;
  154. /// <summary>
  155. /// AutoMode页面功能启用
  156. /// </summary>
  157. private bool _isAutoEnabled;
  158. #endregion
  159. #region 系统数据
  160. /// <summary>
  161. /// 定时器
  162. /// </summary>
  163. DispatcherTimer _timer;
  164. /// <summary>
  165. /// 查询后台数据集合
  166. /// </summary>
  167. private List<string> _rtDataKeys = new List<string>();
  168. /// <summary>
  169. /// rt查询key数值字典
  170. /// </summary>
  171. private Dictionary<string, object> _rtDataValueDic = new Dictionary<string, object>();
  172. /// <summary>
  173. /// UiRecipeManager
  174. /// </summary>
  175. private UiRecipeManager _uiRecipeManager = new UiRecipeManager();
  176. #endregion
  177. #region UI related
  178. /// <summary>
  179. /// SRD Arm UI位置
  180. /// </summary>
  181. private double _srdArmUIPosition = ARM_UI_HOME_POSITION;
  182. /// <summary>
  183. /// SRD Rotation UI位置
  184. /// </summary>
  185. private double _srdRotationUIPosition = ROTATION_UI_HOME_POSITION;
  186. /// <summary>
  187. /// Arm Axis位置数据
  188. /// </summary>
  189. private BeckhoffStationAxis _armAxis;
  190. /// <summary>
  191. /// Arm UI位置比例
  192. /// </summary>
  193. private double _armUIRatio;
  194. /// <summary>
  195. /// Flipper200 UI位置
  196. /// </summary>
  197. private ObservableCollection<double> _flipper200UIPosition = new ObservableCollection<double>(new double[3]);
  198. /// <summary>
  199. /// Flipper150 UI位置
  200. /// </summary>
  201. private ObservableCollection<double> _flipper150UIPosition = new ObservableCollection<double>(new double[3]);
  202. /// <summary>
  203. /// Flipper100 UI位置
  204. /// </summary>
  205. private ObservableCollection<double> _flipper100UIPosition = new ObservableCollection<double>(new double[3]);
  206. #endregion
  207. #endregion
  208. #region 属性
  209. #region SRD
  210. /// <summary>
  211. /// SRDRecipeContent
  212. /// </summary>
  213. public string SRDRecipeContent
  214. {
  215. get { return _recipeContent; }
  216. set { SetProperty(ref _recipeContent, value); }
  217. }
  218. /// <summary>
  219. /// TimeRemaining
  220. /// </summary>
  221. public double TimeRemaining
  222. {
  223. get { return _timeRemaining; }
  224. set { SetProperty(ref _timeRemaining, value); }
  225. }
  226. /// <summary>
  227. /// TotalTime
  228. /// </summary>
  229. public double TotalTime
  230. {
  231. get { return _totalTime; }
  232. set { SetProperty(ref _totalTime, value); }
  233. }
  234. /// <summary>
  235. /// OperatingMode
  236. /// </summary>
  237. public string OperatingMode
  238. {
  239. get { return _operatingMode; }
  240. set { SetProperty(ref _operatingMode, value); }
  241. }
  242. /// <summary>
  243. /// State
  244. /// </summary>
  245. public string State
  246. {
  247. get { return _state; }
  248. set { SetProperty(ref _state, value); }
  249. }
  250. /// <summary>
  251. /// RecipeMode
  252. /// </summary>
  253. public string RecipeMode
  254. {
  255. get { return _recipeMode; }
  256. set { SetProperty(ref _recipeMode, value); }
  257. }
  258. /// <summary>
  259. /// Run Recipe已经完成的次数
  260. /// </summary>
  261. public int AchievedRunRecipeCycle
  262. {
  263. get { return _achievedRunRecipeCycle; }
  264. set { SetProperty(ref _achievedRunRecipeCycle, value); }
  265. }
  266. /// <summary>
  267. /// Loader DI
  268. /// </summary>
  269. public bool LoaderDiEnable
  270. {
  271. get { return _loaderDiEnable; }
  272. set { SetProperty(ref _loaderDiEnable, value); }
  273. }
  274. #endregion
  275. #region wafer
  276. /// <summary>
  277. /// WaferID
  278. /// </summary>
  279. public string WaferID
  280. {
  281. get { return _waferID; }
  282. set { SetProperty(ref _waferID, value); }
  283. }
  284. /// <summary>
  285. /// SeqRecipe
  286. /// </summary>
  287. public string SeqRecipe
  288. {
  289. get { return _seqRecipe; }
  290. set { SetProperty(ref _seqRecipe, value); }
  291. }
  292. /// <summary>
  293. /// Wafer信息
  294. /// </summary>
  295. public WaferInfo WaferInfo
  296. {
  297. get { return _waferInfo; }
  298. set { SetProperty(ref _waferInfo, value); }
  299. }
  300. #endregion
  301. #region SRD recipe
  302. /// <summary>
  303. /// RecipeModuleName
  304. /// </summary>
  305. public string RecipeModuleName
  306. {
  307. get { return _recipeModuleName; }
  308. set { SetProperty(ref _recipeModuleName, value); }
  309. }
  310. /// <summary>
  311. /// RecipeType
  312. /// </summary>
  313. public string RecipeType
  314. {
  315. get { return _recipeType; }
  316. set { SetProperty(ref _recipeType, value); }
  317. }
  318. /// <summary>
  319. /// 当前运行的Recipe
  320. /// </summary>
  321. public string CurrentRecipe
  322. {
  323. get { return _currentRecipe; }
  324. set { SetProperty(ref _currentRecipe, value); }
  325. }
  326. #endregion
  327. #region Common
  328. /// <summary>
  329. /// 模块名称
  330. /// </summary>
  331. public string Module { get { return _module; } set { SetProperty(ref _module, value); } }
  332. /// <summary>
  333. /// StateMachine
  334. /// </summary>
  335. public string StateMachine
  336. {
  337. get { return _stateMachine; }
  338. set { SetProperty(ref _stateMachine, value); }
  339. }
  340. /// <summary>
  341. /// StateMachine
  342. /// </summary>
  343. public string Status
  344. {
  345. get { return _status; }
  346. set { SetProperty(ref _status, value); }
  347. }
  348. /// <summary>
  349. /// Commondata
  350. /// </summary>
  351. public SrdCommonData SRDCommonData
  352. {
  353. get { return _sRDCommonData; }
  354. set { SetProperty(ref _sRDCommonData, value); }
  355. }
  356. /// <summary>
  357. /// WaferPresence
  358. /// </summary>
  359. public string WaferPresence
  360. {
  361. get { return _waferPresence; }
  362. set { SetProperty(ref _waferPresence, value); }
  363. }
  364. /// <summary>
  365. /// Threshold
  366. /// </summary>
  367. public SRDPersistentValue SRDPersistent
  368. {
  369. get { return _sRDPersistent; }
  370. set { SetProperty(ref _sRDPersistent, value); }
  371. }
  372. /// <summary>
  373. /// Selected Recipe Node
  374. /// </summary>
  375. public RecipeNode SelectedRecipeNode
  376. {
  377. get { return _selectedRecipeNode; }
  378. set { SetProperty(ref _selectedRecipeNode, value); }
  379. }
  380. /// <summary>
  381. /// PresenceTest是否进行中
  382. /// </summary>
  383. public bool IsPresenceTesting
  384. {
  385. get { return _isPresenceTesting; }
  386. set { SetProperty(ref _isPresenceTesting, value); }
  387. }
  388. /// <summary>
  389. /// Test Without Wafers
  390. /// </summary>
  391. public bool IsWaferPresence
  392. {
  393. get { return _isWaferPresence; }
  394. set { SetProperty(ref _isWaferPresence, value); }
  395. }
  396. /// <summary>
  397. /// SRDArm运动数据
  398. /// </summary>
  399. public CommandMotionData SRDArmMotionData
  400. {
  401. get { return _sRDArmMotionData; }
  402. set { SetProperty(ref _sRDArmMotionData, value); }
  403. }
  404. /// <summary>
  405. /// SRDRotation运动数据
  406. /// </summary>
  407. public CommandMotionData SRDRotationMotionData
  408. {
  409. get { return _sRDRotationMotionData; }
  410. set { SetProperty(ref _sRDRotationMotionData, value); }
  411. }
  412. /// <summary>
  413. /// 页面功能启用
  414. /// </summary>
  415. public bool IsEnabled
  416. {
  417. get { return _isEnabled; }
  418. set { SetProperty(ref _isEnabled, value); }
  419. }
  420. /// <summary>
  421. /// AutoMode页面功能启用
  422. /// </summary>
  423. public bool IsAutoEnabled
  424. {
  425. get { return _isAutoEnabled; }
  426. set { SetProperty(ref _isAutoEnabled, value); }
  427. }
  428. #endregion
  429. #region UI related
  430. /// <summary>
  431. /// SRD ARM UI位置
  432. /// </summary>
  433. public double SRDArmUIPosition
  434. {
  435. get { return _srdArmUIPosition; }
  436. set { SetProperty(ref _srdArmUIPosition, value); }
  437. }
  438. /// <summary>
  439. /// SRD Rotation UI位置
  440. /// </summary>
  441. public double SRDRotationUIPosition
  442. {
  443. get { return _srdRotationUIPosition; }
  444. set { SetProperty(ref _srdRotationUIPosition, value); }
  445. }
  446. /// <summary>
  447. /// Flipper200 UI位置
  448. /// </summary>
  449. public ObservableCollection<double> Flipper200UIPosition
  450. {
  451. get { return _flipper200UIPosition; }
  452. set { SetProperty(ref _flipper200UIPosition, value); }
  453. }
  454. /// <summary>
  455. /// Flipper150 UI位置
  456. /// </summary>
  457. public ObservableCollection<double> Flipper150UIPosition
  458. {
  459. get { return _flipper150UIPosition; }
  460. set { SetProperty(ref _flipper150UIPosition, value); }
  461. }
  462. /// <summary>
  463. /// Flipper100 UI位置
  464. /// </summary>
  465. public ObservableCollection<double> Flipper100UIPosition
  466. {
  467. get { return _flipper100UIPosition; }
  468. set { SetProperty(ref _flipper100UIPosition, value); }
  469. }
  470. #endregion
  471. #endregion
  472. #region Command指令
  473. /// <summary>
  474. /// Initialize Command
  475. /// </summary>
  476. public ICommand InitializeCommand { get; set; }
  477. /// <summary>
  478. /// SwitchOn Command
  479. /// </summary>
  480. public ICommand SwitchOnCommand { get; set; }
  481. /// <summary>
  482. /// SwitchOff Command
  483. /// </summary>
  484. public ICommand SwitchOffCommand { get; set; }
  485. /// <summary>
  486. /// Loader Command
  487. /// </summary>
  488. public ICommand LoaderCommand { get; set; }
  489. /// <summary>
  490. /// Unloader Command
  491. /// </summary>
  492. public ICommand UnloaderCommand { get; set; }
  493. #endregion
  494. /// <summary>
  495. /// 构造函数
  496. /// </summary>
  497. public SRDHomePageViewModel()
  498. {
  499. InitializeCommand = new DelegateCommand<object>(InitializeAction);
  500. SwitchOnCommand = new DelegateCommand<object>(SwitchOnAction);
  501. SwitchOffCommand = new DelegateCommand<object>(SwitchOffAction);
  502. LoaderCommand = new DelegateCommand<object>(LoaderAction);
  503. UnloaderCommand = new DelegateCommand<object>(UnloaderAction);
  504. }
  505. /// <summary>
  506. /// 加载数据
  507. /// </summary>
  508. public void LoadData(string systemName)
  509. {
  510. Module = systemName;
  511. RecipeType = "srd";
  512. RecipeModuleName = "SRD Recipe";
  513. _rtDataKeys.Clear();
  514. _rtDataKeys.Add($"{Module}.IsHomed");
  515. _rtDataKeys.Add($"{Module}.{COMMON_DATA}");
  516. _rtDataKeys.Add($"{Module}.{PERSISTENT_VALUE}");
  517. _rtDataKeys.Add($"{Module}.{WAFER_PRESENCE_STATUS}");
  518. _rtDataKeys.Add($"{Module}.AchievedCycle");
  519. _rtDataKeys.Add($"{Module}.FsmState");
  520. _rtDataKeys.Add($"{Module}.CurrentStateMachine");
  521. _rtDataKeys.Add($"{Module}.CurrentStatus");
  522. _rtDataKeys.Add($"{Module}.WaferInfo");
  523. _rtDataKeys.Add($"{Module}.IsPresenceTesting");
  524. _rtDataKeys.Add($"{Module}.IsWaferPresence");
  525. _rtDataKeys.Add($"System.{FACILITIES}.{LOADER_DI_ENABLE}");
  526. _rtDataKeys.Add($"{Module}.Arm.{MOTION_DATA}");
  527. _rtDataKeys.Add($"{Module}.Rotation.{MOTION_DATA}");
  528. _rtDataKeys.Add($"Station.{Module}.Arm");
  529. _rtDataKeys.Add($"{Module}.CurrentRecipe");
  530. _rtDataKeys.Add($"{Module}.TotalTime");
  531. _rtDataKeys.Add($"{Module}.TimeRemain");
  532. if (_timer == null)
  533. {
  534. _timer = new DispatcherTimer();
  535. _timer.Interval = TimeSpan.FromMilliseconds(200);
  536. _timer.Tick += Timer_Tick;
  537. }
  538. _timer.Start();
  539. _rtDataValueDic = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
  540. if (_rtDataValueDic != null)
  541. {
  542. _armAxis = CommonFunction.GetValue<BeckhoffStationAxis>(_rtDataValueDic, $"Station.{Module}.Arm");
  543. //计算Arm位置比例
  544. if (_armAxis != null)
  545. {
  546. double armHomePos = double.Parse(_armAxis.Stations[0].Position);
  547. double armCenterPos = double.Parse(_armAxis.Stations[1].Position);
  548. _armUIRatio = (ARM_UI_HOME_POSITION - ARM_UI_CENTER_POSITION) / (armHomePos - armCenterPos);
  549. }
  550. }
  551. }
  552. /// <summary>
  553. /// 定时器执行
  554. /// </summary>
  555. /// <param name="sender"></param>
  556. /// <param name="e"></param>
  557. private void Timer_Tick(object sender, EventArgs e)
  558. {
  559. if (_rtDataKeys.Count != 0)
  560. {
  561. _rtDataValueDic = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
  562. if (_rtDataValueDic != null)
  563. {
  564. SRDCommonData = CommonFunction.GetValue<SrdCommonData>(_rtDataValueDic, $"{Module}.{COMMON_DATA}");
  565. SRDPersistent = CommonFunction.GetValue<SRDPersistentValue>(_rtDataValueDic, $"{Module}.{PERSISTENT_VALUE}");
  566. LoaderDiEnable = CommonFunction.GetValue<bool>(_rtDataValueDic, $"System.{FACILITIES}.{LOADER_DI_ENABLE}");
  567. AchievedRunRecipeCycle = CommonFunction.GetValue<int>(_rtDataValueDic, $"{Module}.AchievedCycle");
  568. WaferPresence = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.{WAFER_PRESENCE_STATUS}");
  569. State = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.FsmState");
  570. CurrentRecipe = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.CurrentRecipe");
  571. IsWaferPresence = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsWaferPresence");
  572. if (SRDPersistent != null)
  573. {
  574. if ("Manual".Equals(SRDPersistent.OperatingMode))
  575. {
  576. IsEnabled = true;
  577. IsAutoEnabled = true;
  578. }
  579. else if ("Auto".Equals(SRDPersistent.OperatingMode))
  580. {
  581. if (!IsWaferPresence)
  582. {
  583. InvokeClient.Instance.Service.DoOperation($"{Module}.UpdateIsWaferPresenceAction", true);
  584. }
  585. IsAutoEnabled = true;
  586. IsEnabled = false;
  587. }
  588. else
  589. {
  590. State = "Stopped";
  591. IsEnabled = false;
  592. IsAutoEnabled = false;
  593. }
  594. }
  595. StateMachine = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.CurrentStateMachine");
  596. Status = CommonFunction.GetValue<string>(_rtDataValueDic, $"{Module}.CurrentStatus");
  597. IsPresenceTesting = CommonFunction.GetValue<bool>(_rtDataValueDic, $"{Module}.IsPresenceTesting");
  598. SRDArmMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{Module}.Arm.{MOTION_DATA}");
  599. SRDRotationMotionData = CommonFunction.GetValue<CommandMotionData>(_rtDataValueDic, $"{Module}.Rotation.{MOTION_DATA}");
  600. //SRD Wafer信息
  601. if (ModuleManager.ModuleInfos[Module].WaferManager.Wafers.Count != 0)
  602. {
  603. WaferInfo = ModuleManager.ModuleInfos[Module].WaferManager.Wafers[0];
  604. }
  605. //计算ARM UI位置
  606. if (SRDArmMotionData != null)
  607. {
  608. SRDArmUIPosition = ARM_UI_HOME_POSITION + _armUIRatio * SRDArmMotionData.MotorPosition;
  609. }
  610. //计算Rotation UI位置
  611. if (SRDRotationMotionData != null)
  612. {
  613. SRDRotationUIPosition = SRDRotationMotionData.MotorPosition;
  614. }
  615. TotalTime = CommonFunction.GetValue<int>(_rtDataValueDic, $"{Module}.TotalTime");
  616. TimeRemaining = CommonFunction.GetValue<int>(_rtDataValueDic, $"{Module}.TimeRemain");
  617. if (State == "Idle")
  618. {
  619. TimeRemaining = 0;
  620. }
  621. //Flipper Position
  622. Flipper200UIPosition[0] = SRDCommonData.Flipper1Out200Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  623. Flipper200UIPosition[1] = SRDCommonData.Flipper2Out200Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  624. Flipper200UIPosition[2] = SRDCommonData.Flipper3Out200Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  625. Flipper150UIPosition[0] = SRDCommonData.Flipper1Out150Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  626. Flipper150UIPosition[1] = SRDCommonData.Flipper2Out150Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  627. Flipper150UIPosition[2] = SRDCommonData.Flipper3Out150Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  628. //Flipper100UIPosition[0] = SRDCommonData.Flipper1Out100Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  629. //Flipper100UIPosition[1] = SRDCommonData.Flipper2Out100Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  630. //Flipper100UIPosition[2] = SRDCommonData.Flipper3Out100Status ? FLIPPER_OUT_POSITION : FLIPPER_IN_POSITION;
  631. }
  632. }
  633. }
  634. /// <summary>
  635. /// 隐藏
  636. /// </summary>
  637. public void Hide()
  638. {
  639. if (_timer != null)
  640. {
  641. _timer.Stop();
  642. }
  643. }
  644. #region 指令Action
  645. /// <summary>
  646. /// Home Action
  647. /// </summary>
  648. /// <param name="param"></param>
  649. private void HomeAction(object param)
  650. {
  651. InvokeClient.Instance.Service.DoOperation($"{Module}.HomeAll");
  652. }
  653. /// <summary>
  654. /// Initialize Action
  655. /// </summary>
  656. /// <param name="param"></param>
  657. private void InitializeAction(object param)
  658. {
  659. InvokeClient.Instance.Service.DoOperation($"{Module}.InitializeHome");
  660. }
  661. /// <summary>
  662. /// Switch On Action
  663. /// </summary>
  664. /// <param name="param"></param>
  665. private void SwitchOnAction(object param)
  666. {
  667. InvokeClient.Instance.Service.DoOperation($"{Module}.SwitchOnAll");
  668. }
  669. /// <summary>
  670. /// Switch Off Action
  671. /// </summary>
  672. /// <param name="param"></param>
  673. private void SwitchOffAction(object param)
  674. {
  675. InvokeClient.Instance.Service.DoOperation($"{Module}.SwitchOffAll");
  676. }
  677. /// <summary>
  678. /// Loader Action
  679. /// </summary>
  680. /// <param name="param"></param>
  681. private void LoaderAction(object param)
  682. {
  683. InvokeClient.Instance.Service.DoOperation($"{Module}.Loader");
  684. }
  685. /// <summary>
  686. /// Unloader Action
  687. /// </summary>
  688. /// <param name="param"></param>
  689. private void UnloaderAction(object param)
  690. {
  691. InvokeClient.Instance.Service.DoOperation($"{Module}.Unloader");
  692. }
  693. #endregion
  694. }
  695. }