终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

451 linhas
24 KiB

  1. using BPASmartClient.Business;
  2. using BPASmartClient.Device;
  3. using BPASmartClient.DRCoffee;
  4. using BPA.Helper;
  5. using BPASmartClient.LebaiRobot;
  6. using BPASmartClient.Model;
  7. using BPASmartClient.Model.乐白机器人;
  8. using BPASmartClient.Model.冰淇淋.Enum;
  9. using BPASmartClient.Model.单片机;
  10. using BPASmartClient.Model.单片机.Enum;
  11. using BPASmartClient.Model.咖啡机.Enum;
  12. using BPA.Helper;
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Collections.ObjectModel;
  16. using System.Linq;
  17. using System.Threading;
  18. namespace BPASmartClient.MorkT_Container.ViewModel;
  19. public class DebugViewModel : NotifyBase
  20. {
  21. #region 乐白机器人
  22. /// <summary>
  23. /// 乐白机器人连接状态
  24. /// </summary>
  25. public string RobotConnected { get { return _robotConnected; } set { _robotConnected = value; OnPropertyChanged(); } }
  26. private string _robotConnected { get; set; }
  27. /// <summary>
  28. /// 乐白机器人的模式状态
  29. /// </summary>
  30. public string RobotMode { get { return _robotMode; } set { _robotMode = value; OnPropertyChanged(); } }
  31. private string _robotMode { get; set; }
  32. /// <summary>
  33. /// 机器人控制指令
  34. /// </summary>
  35. public BPARelayCommand<object> Button_RobotControlCommand { get; set; }
  36. public BPARelayCommand<object> IceMaker_State { get; set; }
  37. public BPARelayCommand Robot_DOutput { get; set; }
  38. /// <summary>
  39. /// 机器人控制
  40. /// </summary>
  41. /// <param name="o"></param>
  42. private void Button_RobotControl(object o)
  43. {
  44. EventBus.GetInstance().Publish(new LebaiRobot_LebaiControlEvent { DeviceId = DeviceId, LebaiControl = o.ToString() });
  45. }
  46. private void Button_RobotDoutput()
  47. {
  48. bool DO_Value =int.Parse(Robot_DOutput_Value) == 0;
  49. EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { Pin = int.Parse(Robot_DOutput_Pin), Value = DO_Value });
  50. }
  51. public bool Robot_TCPDI0 { get { return _robot_TCPDI0; } set { _robot_TCPDI0 = value;OnPropertyChanged(); } }
  52. private bool _robot_TCPDI0;
  53. public bool Robot_DI0 { get { return _robot_DI0; } set { _robot_DI0 = value; OnPropertyChanged(); } }
  54. private bool _robot_DI0;
  55. public bool Robot_DI1 { get { return _robot_DI1; } set { _robot_DI1 = value; OnPropertyChanged(); } }
  56. private bool _robot_DI1;
  57. public bool Robot_DI2 { get { return _robot_DI2; } set { _robot_DI2 = value; OnPropertyChanged(); } }
  58. private bool _robot_DI2;
  59. public bool Robot_DI3 { get { return _robot_DI3; } set { _robot_DI3 = value; OnPropertyChanged(); } }
  60. private bool _robot_DI3;
  61. public string Robot_DOutput_Pin { get { return _robot_DOutput_Pin; } set { _robot_DOutput_Pin = value; OnPropertyChanged(); } }
  62. private string _robot_DOutput_Pin { get; set; }
  63. public string Robot_DOutput_Value { get { return _robot_DOutput_Valuet; } set { _robot_DOutput_Valuet = value; OnPropertyChanged(); } }
  64. private string _robot_DOutput_Valuet { get; set; }
  65. #endregion
  66. #region 单片机
  67. public string MCUConnected { get { return _mcuConnected; } set { _mcuConnected = value; OnPropertyChanged(); } }
  68. private string _mcuConnected { get; set; }
  69. public bool MCUDI0 { get { return _mCUDI0; } set { _mCUDI0 = value; OnPropertyChanged(); } }
  70. private bool _mCUDI0 { get; set; }
  71. public bool MCUDI1 { get { return _mCUDI1; } set { _mCUDI1 = value; OnPropertyChanged(); } }
  72. private bool _mCUDI1 { get; set; }
  73. public bool MCUDI2 { get { return _mCUDI2; } set { _mCUDI2 = value; OnPropertyChanged(); } }
  74. private bool _mCUDI2 { get; set; }
  75. public bool MCUDI3 { get { return _mCUDI3; } set { _mCUDI3 = value; OnPropertyChanged(); } }
  76. private bool _mCUDI3 { get; set; }
  77. public bool MCUDI4 { get { return _mCUDI4; } set { _mCUDI4 = value; OnPropertyChanged(); } }
  78. private bool _mCUDI4 { get; set; }
  79. public bool MCUDI5 { get { return _mCUDI5; } set { _mCUDI5 = value; OnPropertyChanged(); } }
  80. private bool _mCUDI5 { get; set; }
  81. public bool MCUDI6 { get { return _mCUDI6; } set { _mCUDI6 = value; OnPropertyChanged(); } }
  82. private bool _mCUDI6 { get; set; }
  83. public bool MCUDI7 { get { return _mCUDI7; } set { _mCUDI7 = value; OnPropertyChanged(); } }
  84. private bool _mCUDI7 { get; set; }
  85. public BPARelayCommand Button_MCUOuputCommand { get; set; }
  86. public BPARelayCommand Button_MCUDOuputCommand { get; set; }
  87. public int MCU_PWM_CH { get { return _choosePWM; } set { _choosePWM = value; OnPropertyChanged(); } }
  88. private int _choosePWM = 1;
  89. public int PWMInputNumber { get { return _pwmInputNumber; } set { _pwmInputNumber = value; OnPropertyChanged(); } }
  90. private int _pwmInputNumber = 1;
  91. private int[] DICH { get { return _diCH; } set { _diCH = value; OnPropertyChanged(); } }
  92. private int[] _diCH = new int[8];
  93. public int MCU_DO_CH { get { return _mcuDO_CH; } set { _mcuDO_CH = value; OnPropertyChanged(); } }
  94. private int _mcuDO_CH = 1;
  95. public bool MCU_DO_Value { get { return _mcu_DO_Valuer; } set { _mcu_DO_Valuer = value; OnPropertyChanged(); } }
  96. private bool _mcu_DO_Valuer = true;
  97. private void Button_McuPWMOutput()
  98. {
  99. string sChoosePWM = Convert.ToString(MCU_PWM_CH + 1);
  100. new WriteMcu() { TagName = "ServoControl", Address = sChoosePWM, Value = PWMInputNumber }.Publish();
  101. }
  102. private void Button_McuDOutput()
  103. {
  104. string sChooseDO = Convert.ToString(MCU_DO_CH + 1);
  105. new WriteMcu() { TagName = "OutputControl", Address = sChooseDO, Value = MCU_DO_Value }.Publish();
  106. }
  107. #endregion
  108. #region 果汁机
  109. /// <summary>
  110. /// 果汁机的连接状态
  111. /// </summary>
  112. public string JuicerConnected { get { return _JuicerConnected; } set { _JuicerConnected = value; OnPropertyChanged(); } }
  113. private string _JuicerConnected { get; set; }
  114. public System.Windows.Visibility JuiceState_Heating { get { return _juiceState_Heating; } set { _juiceState_Heating = value;OnPropertyChanged(); } }
  115. public System.Windows.Visibility _juiceState_Heating { get; set; }
  116. public System.Windows.Visibility JuiceState_Cooling { get { return _juiceState_Cooling; } set { _juiceState_Cooling = value; OnPropertyChanged(); } }
  117. public System.Windows.Visibility _juiceState_Cooling { get; set; }
  118. public System.Windows.Visibility JuiceState_LackOfWater { get { return _juiceState_LackOfWater; } set { _juiceState_LackOfWater = value; OnPropertyChanged(); } }
  119. public System.Windows.Visibility _juiceState_LackOfWater { get; set; }
  120. public System.Windows.Visibility JuiceState_ChildLocks { get { return _juiceState_ChildLocks; } set { _juiceState_ChildLocks = value; OnPropertyChanged(); } }
  121. public System.Windows.Visibility _juiceState_ChildLocks { get; set; }
  122. public System.Windows.Visibility JuiceState_Using { get { return _juiceState_Using; } set { _juiceState_Using = value; OnPropertyChanged(); } }
  123. public System.Windows.Visibility _juiceState_Using { get; set; }
  124. public string MakeJuice_Index { get { return _makeJuice_Index; } set { _makeJuice_Index = value; OnPropertyChanged(); } }
  125. public string _makeJuice_Index { get; set; }
  126. public BPARelayCommand Button_MakeJuiceCommand { get; set; }
  127. public void Button_MakeJuice()
  128. {
  129. new WriteJuicer() { Value = MakeJuice_Index }.Publish();
  130. }
  131. #endregion
  132. #region 制冰机
  133. public string IceMakerConnect { get { return _iceMakerConnect; } set { _iceMakerConnect = value;OnPropertyChanged(); } }
  134. private string _iceMakerConnect { get; set; }
  135. public int IceMakerState { get { return _iceMakerState; } set { _iceMakerState = value; OnPropertyChanged(); } }
  136. private int _iceMakerState { get; set; }
  137. public string IceMakerState1 { get { return _iceMakerState1; } set { _iceMakerState1 = value; OnPropertyChanged(); } }
  138. private string _iceMakerState1 { get; set; }
  139. public string IceMakerState2 { get { return _iceMakerState2; } set { _iceMakerState2 = value; OnPropertyChanged(); } }
  140. private string _iceMakerState2 { get; set; }
  141. public string IceMakerState3 { get { return _iceMakerState3; } set { _iceMakerState3 = value; OnPropertyChanged(); } }
  142. private string _iceMakerState3 { get; set; }
  143. public string IceMakerState4 { get { return _iceMakerState4; } set { _iceMakerState4 = value; OnPropertyChanged(); } }
  144. private string _iceMakerState4 { get; set; }
  145. public string IceMakerState5 { get { return _iceMakerState5; } set { _iceMakerState5 = value; OnPropertyChanged(); } }
  146. private string _iceMakerState5 { get; set; }
  147. public int IceMaker_IceTime { get { return _iceMaker_IceTime; } set { _iceMaker_IceTime = value; OnPropertyChanged(); } }
  148. private int _iceMaker_IceTime = 3;
  149. #region 订单模拟
  150. public BPARelayCommand SimOrderMakeCoffee { get; set; }
  151. public BPARelayCommand SimOrderMakeJuice { get; set; }
  152. public BPARelayCommand SimOrderMakeTea { get; set; }
  153. public BPARelayCommand SimOrderMakeWater { get; set; }
  154. public int SimOrder_JuiceList { get { return _simOrder_JuiceList; } set { _simOrder_JuiceList = value; OnPropertyChanged(); } }
  155. public int _simOrder_JuiceList { get; set; }
  156. public string SimOrder_JuiceMakeID { get { return _simOrder_JuiceMakeID; } set { _simOrder_JuiceMakeID = value; OnPropertyChanged(); } }
  157. public string _simOrder_JuiceMakeID { get; set; }
  158. #endregion
  159. public BPARelayCommand IceMaker_BtnPowerOn { get; set; }
  160. public BPARelayCommand IceMaker_BtnStandby { get; set;}
  161. public BPARelayCommand IceMaker_BtnPump { get; set;}
  162. public BPARelayCommand IceMaker_BtnStart { get; set; }
  163. public BPARelayCommand IceMaker_BtnEnd { get; set; }
  164. public BPARelayCommand IceMaker_BtnSetIceTime { get; set; }
  165. private void IceMaker_BtnPowerOnCommand()
  166. {
  167. new PowerOnMakeIce().Publish();
  168. }
  169. private void IceMaker_BtnStandbyCommand()
  170. {
  171. new StandbyMakeIce().Publish();
  172. }
  173. private void IceMaker_BtnPumpCommand()
  174. {
  175. new PumpMakeIce().Publish();
  176. }
  177. private void IceMaker_BtnStartCommand()
  178. {
  179. new StartMakeIce().Publish();
  180. }
  181. private void IceMaker_BtnEndCommand()
  182. {
  183. new StopMakeIce().Publish();
  184. }
  185. private void IceMaker_BtnSetIceTimeCommand()
  186. {
  187. new SetIceNumber{ Value= IceMaker_IceTime * 0.1 }.Publish();
  188. }
  189. #endregion
  190. #region 咖啡机
  191. /// <summary>
  192. /// 咖啡机连接状态
  193. /// </summary>
  194. public string CoffeeConnected { get { return _coffeeConnected; } set { _coffeeConnected = value; OnPropertyChanged(); } }
  195. private string _coffeeConnected { get; set; }
  196. /// <summary>
  197. /// 咖啡机状态
  198. /// </summary>
  199. public string CoffeeStatus { get { return _coffeeStatus; } set { _coffeeStatus = value; OnPropertyChanged(); } }
  200. private string _coffeeStatus { get; set; }
  201. /// <summary>
  202. /// 应用状态
  203. /// </summary>
  204. public string AppStatus { get { return _appStatus; } set { _appStatus = value; OnPropertyChanged(); } }
  205. private string _appStatus { get; set; }
  206. /// <summary>
  207. /// 告警
  208. /// </summary>
  209. public string Warning { get { return _warning; } set { _warning = value; OnPropertyChanged(); } }
  210. public string _warning { get; set; }
  211. /// <summary>
  212. /// 故障信息
  213. /// </summary>
  214. public string CaffeeFault { get { return _caffeeFault; } set { _caffeeFault = value; OnPropertyChanged(); } }
  215. public string _caffeeFault { get; set; }
  216. public List<string> Coffees { get; set; } = new List<string>();
  217. public string SelectedCoffee { get { return _selectedCoffee; } set { _selectedCoffee = value; OnPropertyChanged(); } }
  218. public string _selectedCoffee { get; set; }
  219. public List<string> CoffeeCmds { get; set; } = new List<string>();
  220. public string SelectedCoffeeCmd { get; set; }
  221. public string SimOrderCoffeeList { get { return _simOrderCoffeeList; } set { _simOrderCoffeeList = value; OnPropertyChanged(); } }
  222. public string _simOrderCoffeeList { get; set; }
  223. /// <summary>
  224. /// 制作咖啡
  225. /// </summary>
  226. public BPARelayCommand Button_MakeCoffeeCommand { get; set; }
  227. /// <summary>
  228. /// 停止制作咖啡
  229. /// </summary>
  230. public BPARelayCommand Button_StopMakeCoffeCommand { get; set; }
  231. /// <summary>
  232. /// 咖啡模式设置
  233. /// </summary>
  234. public BPARelayCommand Button_CoffeeModeSetCommand { get; set; }
  235. private void Button_MakeCoffee()
  236. {
  237. EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() { DeviceId = DeviceId, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SelectedCoffee) });
  238. }
  239. private void Button_StopMakeCoffe()
  240. {
  241. EventBus.GetInstance().Publish(new DRCoffee_CancelMakeCoffeeEvent() { DeviceId = DeviceId });
  242. }
  243. private void Button_CoffeeModeSet()
  244. {
  245. EventBus.GetInstance().Publish(new DRCoffee_CoffeeCommCmdEvent() { DeviceId = DeviceId, CommCmd = (DrCoffeeCommCmd)Enum.Parse(typeof(DrCoffeeCommCmd), SelectedCoffeeCmd) });
  246. }
  247. #endregion
  248. /// <summary>
  249. /// 设备ID
  250. /// </summary>
  251. public int DeviceId { get; set; }
  252. /// <summary>
  253. /// 设备数据
  254. /// </summary>
  255. public ObservableCollection<VariableMonitor> variableMonitors { get; set; }
  256. public DebugViewModel()
  257. {
  258. SimOrderMakeCoffee = new BPARelayCommand(() =>
  259. {
  260. new MorkTSimOrder() { OrderNum = 1, DrinkCode = (DrCoffeeDrinksCode)Enum.Parse(typeof(DrCoffeeDrinksCode), SimOrderCoffeeList) }.Publish();
  261. });
  262. SimOrderMakeJuice = new BPARelayCommand(() =>
  263. {
  264. new MorkTSimOrder() { OrderNum = 2, JuiceList = SimOrder_JuiceList, JuiceMakeID = SimOrder_JuiceMakeID }.Publish();
  265. });
  266. SimOrderMakeTea = new BPARelayCommand(() =>
  267. {
  268. new MorkTSimOrder() { OrderNum = 3 }.Publish();
  269. });
  270. SimOrderMakeWater = new BPARelayCommand(() =>
  271. {
  272. new MorkTSimOrder() { OrderNum = 4 }.Publish();
  273. });
  274. Button_RobotControlCommand = new BPARelayCommand<object>(Button_RobotControl);
  275. Robot_DOutput = new BPARelayCommand(Button_RobotDoutput);
  276. Button_MakeCoffeeCommand = new BPARelayCommand(Button_MakeCoffee);
  277. Button_StopMakeCoffeCommand = new BPARelayCommand(Button_StopMakeCoffe);
  278. Button_CoffeeModeSetCommand = new BPARelayCommand(Button_CoffeeModeSet);
  279. Button_MCUOuputCommand = new BPARelayCommand(Button_McuPWMOutput);
  280. Button_MCUDOuputCommand = new BPARelayCommand(Button_McuDOutput);
  281. Button_MakeJuiceCommand = new BPARelayCommand(Button_MakeJuice);
  282. IceMaker_BtnPowerOn = new BPARelayCommand(IceMaker_BtnPowerOnCommand);
  283. IceMaker_BtnStandby = new BPARelayCommand(IceMaker_BtnStandbyCommand);
  284. IceMaker_BtnPump = new BPARelayCommand(IceMaker_BtnPumpCommand);
  285. IceMaker_BtnStart = new BPARelayCommand(IceMaker_BtnStartCommand);
  286. IceMaker_BtnEnd = new BPARelayCommand(IceMaker_BtnEndCommand);
  287. IceMaker_BtnSetIceTime = new BPARelayCommand(IceMaker_BtnSetIceTimeCommand);
  288. foreach (DrCoffeeDrinksCode code in Enum.GetValues(typeof(DrCoffeeDrinksCode)))
  289. {
  290. Coffees.Add(code.ToString());
  291. }
  292. SelectedCoffee = Coffees[0];
  293. SimOrderCoffeeList = Coffees[0];
  294. foreach (DrCoffeeCommCmd code in Enum.GetValues(typeof(DrCoffeeCommCmd)))
  295. {
  296. CoffeeCmds.Add(code.ToString());
  297. }
  298. SelectedCoffeeCmd = CoffeeCmds[0];
  299. Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices().ForEach(device =>
  300. {
  301. if (device.Name == "Container") DeviceId = device.DeviceId
  302. ;
  303. });
  304. TaskManage.GetInstance.StartLong(new Action(async () =>
  305. {
  306. variableMonitors = Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.FirstOrDefault(p => p.DeviceId == DeviceId)?.variableMonitors;
  307. if (variableMonitors != null && variableMonitors.Count > 0)
  308. {
  309. #region 机器人
  310. RobotConnected = variableMonitors.FirstOrDefault(p => p.Notes == "机器人连接状态").CurrentValue == "True" ? "已连接" : "未连接";
  311. RobotMode = variableMonitors.FirstOrDefault(p => p.Notes == "机器人状态").CurrentValue;
  312. Robot_TCPDI0 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人TCP输入状态").SwitchValue;
  313. Robot_DI0 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入0状态").SwitchValue;
  314. Robot_DI1 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入1状态").SwitchValue;
  315. Robot_DI2 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入2状态").SwitchValue;
  316. Robot_DI3 = variableMonitors.FirstOrDefault(p => p.Notes == "机器人输入3状态").SwitchValue;
  317. #endregion
  318. #region 咖啡机
  319. CoffeeConnected = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
  320. CoffeeStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机状态").CurrentValue;
  321. AppStatus = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机应用状态").CurrentValue;
  322. Warning = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机告警").CurrentValue;
  323. CaffeeFault = variableMonitors.FirstOrDefault(p => p.Notes == "咖啡机故障").CurrentValue;
  324. #endregion
  325. #region 单片机
  326. MCUConnected = variableMonitors.FirstOrDefault(p => p.Notes == "单片机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
  327. MCUDI0 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入0状态").SwitchValue;
  328. MCUDI1 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入1状态").SwitchValue;
  329. MCUDI2 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入2状态").SwitchValue;
  330. MCUDI3 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入3状态").SwitchValue;
  331. MCUDI4 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入4状态").SwitchValue;
  332. MCUDI5 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入5状态").SwitchValue;
  333. MCUDI6 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入6状态").SwitchValue;
  334. MCUDI7 = variableMonitors.FirstOrDefault(p => p.Notes == "单片机输入7状态").SwitchValue;
  335. #endregion
  336. #region 制冰机
  337. IceMakerConnect = variableMonitors.FirstOrDefault(p => p.Notes == "制冰机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
  338. IceMakerState = variableMonitors.FirstOrDefault(p => p.Notes == "制冰机设备状态").IntValue;
  339. if (IceMakerState>=0 && IceMakerState<=255)
  340. {
  341. byte a = (byte)IceMakerState;
  342. if ((a >> 0 & 1) == 1)
  343. {
  344. IceMakerState1 = "关机状态";
  345. }
  346. else
  347. {
  348. IceMakerState1 = "开机状态";
  349. }
  350. if ((a >> 1 & 1) == 1)
  351. {
  352. IceMakerState2 = "制冰状态";
  353. }
  354. else
  355. {
  356. IceMakerState2 = "待机状态";
  357. }
  358. if ((a >> 2 & 1) == 1)
  359. {
  360. IceMakerState3 = "电机故障";
  361. }
  362. else
  363. {
  364. IceMakerState3 = "正常";
  365. }
  366. if ((a >> 3 & 1) == 1)
  367. {
  368. IceMakerState4 = "缺水";
  369. }
  370. else
  371. {
  372. IceMakerState4 = "正常";
  373. }
  374. if ((a >> 4 & 1) == 1)
  375. {
  376. IceMakerState5 = "冰满";
  377. }
  378. else
  379. {
  380. IceMakerState5 = "未定义";
  381. }
  382. }
  383. #endregion
  384. /*
  385. List<int> res = new List<int>();
  386. byte[] receive = new byte[32] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32 };
  387. res.Add(receive.Skip(24).Take(4).ToArray().BytesToInt());
  388. res.Add(receive.Skip(28).Take(4).ToArray().BytesToInt());
  389. int[] am = res.ToArray();
  390. var Juicestate1 = Convert.ToString(am[0], 2);
  391. var Juicestate2 = am[1];
  392. int cd = Juicestate1.IndexOf("0");*/
  393. #region 果汁机
  394. JuicerConnected = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机连接状态").CurrentValue == "True" ? "已连接" : "未连接";
  395. JuiceState_Heating = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机制热").CurrentValue == "True" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
  396. JuiceState_Cooling = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机制冷").CurrentValue == "True" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
  397. JuiceState_LackOfWater = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机缺水").CurrentValue == "True" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
  398. JuiceState_ChildLocks = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机童锁").CurrentValue == "True" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
  399. JuiceState_Using = variableMonitors.FirstOrDefault(p => p.Notes == "果汁机使用").CurrentValue == "True" ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
  400. #endregion
  401. Thread.Sleep(200);
  402. }
  403. }), "MorkT-状态刷新");
  404. }
  405. }