终端一体化运控平台
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.
 
 
 

265 lines
10 KiB

  1. using BPASmartClient.Helper;
  2. using FryPot_DosingSystem.Control;
  3. using Microsoft.Toolkit.Mvvm.ComponentModel;
  4. using Microsoft.Toolkit.Mvvm.Input;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace FryPot_DosingSystem.ViewModel
  12. {
  13. internal class DebugViewModel : ObservableObject
  14. {
  15. public ObservableCollection<ushort> LineOneRollerCode { get; set; } = new ObservableCollection<ushort>() { 101,102,103,104,105,106,107,108,401,402,403,404,405,406,407,408};
  16. public ObservableCollection<ushort> LineTwoRollerCode { get; set; } = new ObservableCollection<ushort>() {201,202,203,204,205,206,207,208,501,502,503,504,505,506,507,508 };
  17. public ObservableCollection<ushort> LineThreeRollerCode { get; set; } = new ObservableCollection<ushort>() { 301,302,303,304,305,306,307,308};
  18. //滚筒线1绑定命令
  19. public RelayCommand RollerLineRunning { get; set; }
  20. public RelayCommand EightWorkLoc { get; set; }
  21. public RelayCommand FryPotInputArrive { get; set; }
  22. public RelayCommand FryPotEmptyRollerArrive { get; set; }
  23. public RelayCommand LineOneTaskExit { get; set; }
  24. public RelayCommand AGVLOneArrive { get; set; }
  25. public RelayCommand AGVFryPotDownArrive { get; set; }
  26. public RelayCommand AGVFryPotUpArrive { get; set; }
  27. public RelayCommand AGVFryPotGetEmptyRoller { get; set; }
  28. public RelayCommand AGVLineOneLoadCom { get; set; }//线体1上料完成
  29. //滚筒线2绑定命令
  30. public RelayCommand RollerLineTwoRunning { get; set; }
  31. //public RelayCommand EightWorkLoc { get; set; }
  32. public RelayCommand FryPotTwoInputArrive { get; set; }
  33. public RelayCommand FryPotTwoEmptyRollerArrive { get; set; }
  34. public RelayCommand LineTwoTaskExit { get; set; }
  35. public RelayCommand AGVLTwoArrive { get; set; }
  36. public RelayCommand AGVFryPotTwoDownArrive { get; set; }
  37. public RelayCommand AGVFryPotTwoUpArrive { get; set; }
  38. public RelayCommand AGVFryPotTwoGetEmptyRoller { get; set; }
  39. public RelayCommand AGVLineTwoLoadCom { get; set; }//线体2上料完成
  40. //滚筒线3绑定命令
  41. public RelayCommand RollerLineThreeRunning { get; set; }
  42. //public RelayCommand EightWorkLoc { get; set; }
  43. public RelayCommand FryPotThreeInputArrive { get; set; }
  44. public RelayCommand FryPotThreeEmptyRollerArrive { get; set; }
  45. public RelayCommand LineThreeTaskExit { get; set; }
  46. public RelayCommand AGVLThreeArrive { get; set; }
  47. public RelayCommand AGVFryPotThreeDownArrive { get; set; }
  48. public RelayCommand AGVFryPotThreeUpArrive { get; set; }
  49. public RelayCommand AGVFryPotThreeGetEmptyRoller { get; set; }
  50. public RelayCommand AGVLineThreeLoadCom { get; set; }//线体3上料完成
  51. //AGV接口联调
  52. public RelayCommand AgvDebug { get; set; }
  53. //线体123空桶清洗以及回收
  54. public RelayCommand AgvArriveLineOneEmptyRollerLoc { get; set; }
  55. public RelayCommand AgvLineOneLoadEmptyCom { get; set; }
  56. public RelayCommand AgvArriveLineTwoEmptyRollerLoc { get; set; }
  57. public RelayCommand AgvLineTwoLoadEmptyCom { get; set; }
  58. public RelayCommand AgvArriveLineThreeEmptyRollerLoc { get; set; }
  59. public RelayCommand AgvLineThreeLoadEmptyCom { get; set; }
  60. public RelayCommand CleanPlateCallAgv { get; set; }
  61. public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料
  62. public RelayCommand AgvArriveLineFourLoc { get; set; }
  63. public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料
  64. public RelayCommand EmptyRollerCleanTaskRestart { get; set; }
  65. public DebugViewModel()
  66. {
  67. AgvDebug = new RelayCommand(new Action(() =>
  68. {
  69. ActionManage.GetInstance.Send("AgvDebug");
  70. }));
  71. EmptyRollerCleanTaskRestart = new RelayCommand(() =>
  72. {
  73. ActionManage.GetInstance.Send("EmptyRollerCleanTaskRestart");
  74. });
  75. AgvLineOneLoadEmptyCom = new RelayCommand(() => {
  76. ActionManage.GetInstance.Send("AgvLineOneLoadEmptyCom");
  77. });
  78. AgvLineTwoLoadEmptyCom = new RelayCommand(() => {
  79. ActionManage.GetInstance.Send("AgvLineTwoLoadEmptyCom");
  80. });
  81. AgvLineThreeLoadEmptyCom = new RelayCommand(() => {
  82. ActionManage.GetInstance.Send("AgvLineThreeLoadEmptyCom");
  83. });
  84. AGVLineOneLoadCom = new RelayCommand(() =>
  85. {
  86. ActionManage.GetInstance.Send("AGVLineOneLoadCom");
  87. });
  88. AGVLineTwoLoadCom = new RelayCommand(() =>
  89. {
  90. ActionManage.GetInstance.Send("AGVLineTwoLoadCom");
  91. });
  92. AGVLineThreeLoadCom = new RelayCommand(() =>
  93. {
  94. ActionManage.GetInstance.Send("AGVLineThreeLoadCom");
  95. });
  96. AgvArriveLineOneEmptyRollerLoc = new RelayCommand(new Action(() =>
  97. {
  98. ActionManage.GetInstance.Send("AgvArriveLineOneEmptyRollerLoc");
  99. }));
  100. AgvArriveLineTwoEmptyRollerLoc = new RelayCommand(new Action(() =>
  101. {
  102. ActionManage.GetInstance.Send("AgvArriveLineTwoEmptyRollerLoc");
  103. }));
  104. AgvArriveLineThreeEmptyRollerLoc = new RelayCommand(new Action(() =>
  105. {
  106. ActionManage.GetInstance.Send("AgvArriveLineThreeEmptyRollerLoc");
  107. }));
  108. CleanPlateCallAgv = new RelayCommand(new Action(() =>
  109. {
  110. ActionManage.GetInstance.Send("CleanPlateCallAgv");
  111. }));
  112. AgvArriveCleanPlateLoc = new RelayCommand(new Action(() =>
  113. {
  114. ActionManage.GetInstance.Send("AgvArriveCleanPlateLoc");
  115. }));
  116. AgvArriveCleanPlateLocLoad = new RelayCommand(new Action(() =>
  117. {
  118. ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoad");
  119. }));
  120. AgvArriveLineFourLoc = new RelayCommand(new Action(() =>
  121. {
  122. ActionManage.GetInstance.Send("AgvArriveLineFourLoc");
  123. }));
  124. RollerLineRunning = new RelayCommand(new Action(() =>
  125. {
  126. ActionManage.GetInstance.Send("RollerLineRunning");
  127. }));
  128. FryPotInputArrive = new RelayCommand(new Action(() =>
  129. {
  130. ActionManage.GetInstance.Send("FryPotInputArrive");
  131. }));
  132. FryPotEmptyRollerArrive = new RelayCommand(new Action(() =>
  133. {
  134. ActionManage.GetInstance.Send("FryPotEmptyRollerArrive");
  135. }));
  136. AGVLOneArrive = new RelayCommand(new Action(() =>
  137. {
  138. ActionManage.GetInstance.Send("AGVLOneArrive");
  139. }));
  140. AGVFryPotDownArrive = new RelayCommand(new Action(() =>
  141. {
  142. ActionManage.GetInstance.Send("AGVFryPotDownArrive");
  143. }));
  144. AGVFryPotUpArrive = new RelayCommand(new Action(() =>
  145. {
  146. ActionManage.GetInstance.Send("AGVFryPotUpArrive");
  147. }));
  148. AGVFryPotGetEmptyRoller = new RelayCommand(new Action(() =>
  149. {
  150. ActionManage.GetInstance.Send("AGVFryPotGetEmptyRoller");
  151. }));
  152. //滚筒线2
  153. RollerLineTwoRunning = new RelayCommand(new Action(() =>
  154. {
  155. ActionManage.GetInstance.Send("RollerLineTwoRunning");
  156. }));
  157. FryPotTwoInputArrive = new RelayCommand(new Action(() =>
  158. {
  159. ActionManage.GetInstance.Send("FryPotTwoInputArrive");
  160. }));
  161. FryPotTwoEmptyRollerArrive = new RelayCommand(new Action(() =>
  162. {
  163. ActionManage.GetInstance.Send("FryPotTwoEmptyRollerArrive");
  164. }));
  165. AGVLTwoArrive = new RelayCommand(new Action(() =>
  166. {
  167. ActionManage.GetInstance.Send("AGVLTwoArrive");
  168. }));
  169. AGVFryPotTwoDownArrive = new RelayCommand(new Action(() =>
  170. {
  171. ActionManage.GetInstance.Send("AGVFryPotTwoDownArrive");
  172. }));
  173. AGVFryPotTwoUpArrive = new RelayCommand(new Action(() =>
  174. {
  175. ActionManage.GetInstance.Send("AGVFryPotTwoUpArrive");
  176. }));
  177. AGVFryPotTwoGetEmptyRoller = new RelayCommand(new Action(() =>
  178. {
  179. ActionManage.GetInstance.Send("AGVFryPotTwoGetEmptyRoller");
  180. }));
  181. //滚筒线3
  182. RollerLineThreeRunning = new RelayCommand(new Action(() =>
  183. {
  184. ActionManage.GetInstance.Send("RollerLineThreeRunning");
  185. }));
  186. FryPotThreeInputArrive = new RelayCommand(new Action(() =>
  187. {
  188. ActionManage.GetInstance.Send("FryPotThreeInputArrive");
  189. }));
  190. FryPotThreeEmptyRollerArrive = new RelayCommand(new Action(() =>
  191. {
  192. ActionManage.GetInstance.Send("FryPotThreeEmptyRollerArrive");
  193. }));
  194. AGVLThreeArrive = new RelayCommand(new Action(() =>
  195. {
  196. ActionManage.GetInstance.Send("AGVLThreeArrive");
  197. }));
  198. AGVFryPotThreeDownArrive = new RelayCommand(new Action(() =>
  199. {
  200. ActionManage.GetInstance.Send("AGVFryPotThreeDownArrive");
  201. }));
  202. AGVFryPotThreeUpArrive = new RelayCommand(new Action(() =>
  203. {
  204. ActionManage.GetInstance.Send("AGVFryPotThreeUpArrive");
  205. }));
  206. AGVFryPotThreeGetEmptyRoller = new RelayCommand(new Action(() =>
  207. {
  208. ActionManage.GetInstance.Send("AGVFryPotThreeGetEmptyRoller");
  209. }));
  210. LineOneTaskExit = new RelayCommand(new Action(() =>
  211. {
  212. ActionManage.GetInstance.Send("LineOneTaskExit");
  213. }));
  214. LineTwoTaskExit = new RelayCommand(new Action(() =>
  215. {
  216. ActionManage.GetInstance.Send("LineTwoTaskExit");
  217. }));
  218. LineThreeTaskExit = new RelayCommand(new Action(() =>
  219. {
  220. ActionManage.GetInstance.Send("LineThreeTaskExit");
  221. }));
  222. }
  223. }
  224. }