终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

162 line
8.5 KiB

  1. using BPASmartClient.Helper;
  2. using BPASmartClient.MorkF.Model;
  3. using Microsoft.Toolkit.Mvvm.ComponentModel;
  4. using Microsoft.Toolkit.Mvvm.Input;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPASmartClient.MorkF.ViewModel
  11. {
  12. internal class DebugViewModel : ObservableObject
  13. {
  14. public bool SimOrderEnable { get { return General_Config.SimOrderAllow; } set { General_Config.SimOrderAllow = value; OnPropertyChanged(); } }
  15. #region 设备控制
  16. public RelayCommand PlcInite { get; set; }
  17. public RelayCommand SimulateOrder { get; set; }
  18. public RelayCommand MaterialOne { get; set; }
  19. public RelayCommand MaterialTwo { get; set; }
  20. public RelayCommand MaterialThree { get; set; }
  21. public RelayCommand MaterialFour { get; set; }
  22. public RelayCommand MaterialFive { get; set; }
  23. public RelayCommand OpenExhaust { get;set; }
  24. public RelayCommand CloaseExhaust { get; set; }
  25. public RelayCommand StartQXOne { get; set; }
  26. public RelayCommand StartQXTwo { get; set; }
  27. #endregion
  28. #region 菜品控制
  29. public RelayCommand ShreddCabbage { get; set; }
  30. public RelayCommand FryPork { get; set; }
  31. public RelayCommand XingBaoGu { get; set; }
  32. #endregion
  33. #region 配料仓控制
  34. public List<string> PassageWays = new List<string>()
  35. {
  36. "通道1",
  37. "通道2",
  38. "通道3",
  39. "通道4",
  40. "通道5",
  41. "通道6",
  42. "通道7",
  43. "通道8",
  44. "通道9",
  45. "通道10",
  46. "通道11",
  47. "通道12",
  48. "通道13",
  49. "通道14",
  50. };
  51. public int PassagePosition { get { return _passagePosition; } set { _passagePosition = value; OnPropertyChanged(); } }
  52. private int _passagePosition;
  53. public int Weight { get { return _weight; } set { _weight = value; OnPropertyChanged(); } }
  54. private int _weight;
  55. public RelayCommand OutMaterials { get; set; }
  56. #endregion
  57. #region 炒锅1
  58. public RelayCommand AddOil { get; set; }
  59. public RelayCommand StartFire { get; set; }
  60. public RelayCommand StopFire { get; set; }
  61. public RelayCommand StartStir { get; set; }
  62. public RelayCommand StopStir { get; set; }
  63. public RelayCommand OutFood { get; set; }
  64. public RelayCommand StirArmGoOrigin { get; set; }
  65. public RelayCommand StirArmGoWork { get; set; }
  66. public RelayCommand HBOTGoWork { get; set; }
  67. public RelayCommand OutMeal { get; set; }
  68. public RelayCommand SetFire { get; set; }
  69. public RelayCommand SetStir { get; set; }
  70. public List<int> lstFire { get; set; } = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  71. public List<int> lstStir { get; set; } = new List<int>() { 1, 2, 3 };
  72. public int FireGear { get { return _fireGear; } set { _fireGear = value; OnPropertyChanged(); } }
  73. private int _fireGear;
  74. public int StirGear { get { return _stirGear; } set { _stirGear = value; OnPropertyChanged(); } }
  75. private int _stirGear;
  76. #endregion
  77. #region 炒锅2
  78. public RelayCommand SecAddOil { get; set; }
  79. public RelayCommand SecTempTurnOff { get; set; }
  80. public RelayCommand SecOneBlock { get; set; }
  81. public RelayCommand SecTwoBlock { get; set; }
  82. public RelayCommand SecThreeBlock { get; set; }
  83. public RelayCommand SecOverTurnOff { get; set; }
  84. public RelayCommand SecOverOneBlock { get; set; }
  85. public RelayCommand SecOverTwoBlock { get; set; }
  86. public RelayCommand SecOverThreeBlock { get; set; }
  87. public RelayCommand SecOverGoOn { get; set; }
  88. public RelayCommand SecOverGoDown { get; set; }
  89. public RelayCommand SecAutoModel { get; set; }
  90. public RelayCommand SecManualModel { get; set; }
  91. #endregion
  92. public DebugViewModel()
  93. {
  94. #region 设备控制
  95. PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); });
  96. SimulateOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("SimultaorOrder"); });
  97. MaterialOne = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialOne"); });
  98. MaterialTwo = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialTwo"); });
  99. MaterialThree = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialThree"); });
  100. MaterialFour = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialFour"); });
  101. MaterialFive = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialFive"); });
  102. OpenExhaust = new RelayCommand(() => { ActionManage.GetInstance.Send("OpenExhaust"); });
  103. CloaseExhaust = new RelayCommand(() => { ActionManage.GetInstance.Send("CloseExhaust"); });
  104. StartQXOne = new RelayCommand(() => { ActionManage.GetInstance.Send("StartQXOne", 1); });
  105. StartQXTwo = new RelayCommand(() => { ActionManage.GetInstance.Send("StartQXTwo", 2); });
  106. #endregion
  107. ShreddCabbage = new RelayCommand(() => { ActionManage.GetInstance.Send("ShreddCabbage"); });
  108. FryPork = new RelayCommand(() => { ActionManage.GetInstance.Send("FryPork"); });
  109. XingBaoGu = new RelayCommand(() => { ActionManage.GetInstance.Send("XingBaoGu"); });
  110. #region 配料仓控制
  111. OutMaterials = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMaterials" ,new List<int> { PassagePosition,Weight } ); });
  112. #endregion
  113. #region 炒锅1
  114. AddOil = new RelayCommand(() => { ActionManage.GetInstance.Send("AddOil", 1); });//加油
  115. StartFire = new RelayCommand(() => { ActionManage.GetInstance.Send("StartFire"); });//加热启动
  116. StopFire = new RelayCommand(() => { ActionManage.GetInstance.Send("StopFire"); });//加热停止
  117. StartStir = new RelayCommand(() => { ActionManage.GetInstance.Send("StartStir"); });//搅拌启动
  118. StopStir = new RelayCommand(() => { ActionManage.GetInstance.Send("StopStir"); });//搅拌停止
  119. OutFood = new RelayCommand(() => { ActionManage.GetInstance.Send("OutFood"); });//倒菜启动
  120. StirArmGoOrigin = new RelayCommand(() => { ActionManage.GetInstance.Send("StirArmGoOrigin"); });//搅拌臂去原点位
  121. StirArmGoWork = new RelayCommand(() => { ActionManage.GetInstance.Send("StirArmGoWork"); });//搅拌臂去炒制位
  122. HBOTGoWork = new RelayCommand(() => { ActionManage.GetInstance.Send("HBOTGoWork"); });//放盒子到位
  123. OutMeal = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMeal"); });//出餐启动
  124. SetFire = new RelayCommand(() => { ActionManage.GetInstance.Send("SetFire", new List<int> { FireGear }); });//加热挡位设定
  125. SetStir = new RelayCommand(() => { ActionManage.GetInstance.Send("SetStir", new List<int> { StirGear }); });//搅拌挡位设定
  126. #endregion
  127. #region 炒锅2
  128. SecAddOil = new RelayCommand(() => { ActionManage.GetInstance.Send("AddOil", 2); });
  129. SecTempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff", 2); });
  130. SecOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock", 2); });
  131. SecTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock", 2); });
  132. SecThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock", 2); });
  133. SecOverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff", 2); });
  134. SecOverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock", 2); });
  135. SecOverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock", 2); });
  136. SecOverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock", 2); });
  137. SecOverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn", 2); });
  138. SecOverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown", 2); });
  139. SecAutoModel = new RelayCommand(() => { ActionManage.GetInstance.Send("AutoModel", 2); });
  140. SecManualModel = new RelayCommand(() => { ActionManage.GetInstance.Send("ManualModel", 2); });
  141. #endregion
  142. }
  143. }
  144. }