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

308 regels
12 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. using System.Windows.Input;
  12. namespace FryPot_DosingSystem.ViewModel
  13. {
  14. internal class DebugViewModel : ObservableObject
  15. {
  16. 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};
  17. 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 };
  18. public ObservableCollection<ushort> LineThreeRollerCode { get; set; } = new ObservableCollection<ushort>() { 301,302,303,304,305,306,307,308};
  19. //滚筒线1绑定命令
  20. public RelayCommand RollerLineRunning { get; set; }
  21. public RelayCommand EightWorkLoc { get; set; }
  22. public RelayCommand FryPotInputArrive { get; set; }
  23. public RelayCommand FryPotEmptyRollerArrive { get; set; }
  24. public RelayCommand LineOneTaskExit { get; set; }
  25. public RelayCommand LineOneRecipeComSignal { get; set; }
  26. public RelayCommand AGVLOneArrive { get; set; }
  27. public RelayCommand AGVFryPotDownArrive { get; set; }
  28. public RelayCommand AGVFryPotUpArrive { get; set; }
  29. public RelayCommand AGVFryPotGetEmptyRoller { get; set; }
  30. public RelayCommand AGVLineOneLoadCom { get; set; }//线体1上料完成
  31. //滚筒线2绑定命令
  32. public RelayCommand RollerLineTwoRunning { get; set; }
  33. //public RelayCommand EightWorkLoc { get; set; }
  34. public RelayCommand FryPotTwoInputArrive { get; set; }
  35. public RelayCommand FryPotTwoEmptyRollerArrive { get; set; }
  36. public RelayCommand LineTwoTaskExit { get; set; }
  37. public RelayCommand LineTwoRecipeComSignal { get; set; }
  38. public RelayCommand AGVLTwoArrive { get; set; }
  39. public RelayCommand AGVFryPotTwoDownArrive { get; set; }
  40. public RelayCommand AGVFryPotTwoUpArrive { get; set; }
  41. public RelayCommand AGVFryPotTwoGetEmptyRoller { get; set; }
  42. public RelayCommand AGVLineTwoLoadCom { get; set; }//线体2上料完成
  43. //滚筒线3绑定命令
  44. public RelayCommand RollerLineThreeRunning { get; set; }
  45. //public RelayCommand EightWorkLoc { get; set; }
  46. public RelayCommand FryPotThreeInputArrive { get; set; }
  47. public RelayCommand FryPotThreeEmptyRollerArrive { get; set; }
  48. public RelayCommand LineThreeTaskExit { get; set; }
  49. public RelayCommand LineThreeRecipeComSignal { get; set; }
  50. public RelayCommand AGVLThreeArrive { get; set; }
  51. public RelayCommand AGVFryPotThreeDownArrive { get; set; }
  52. public RelayCommand AGVFryPotThreeUpArrive { get; set; }
  53. public RelayCommand AGVFryPotThreeGetEmptyRoller { get; set; }
  54. public RelayCommand AGVLineThreeLoadCom { get; set; }//线体3上料完成
  55. //AGV接口联调
  56. public RelayCommand AgvDebug { get; set; }
  57. //线体123空桶清洗以及回收
  58. public RelayCommand AgvArriveLineOneEmptyRollerLoc { get; set; }
  59. public RelayCommand AgvLineOneLoadEmptyCom { get; set; }
  60. public RelayCommand AgvArriveLineTwoEmptyRollerLoc { get; set; }
  61. public RelayCommand AgvLineTwoLoadEmptyCom { get; set; }
  62. public RelayCommand AgvArriveLineThreeEmptyRollerLoc { get; set; }
  63. public RelayCommand AgvLineThreeLoadEmptyCom { get; set; }
  64. public RelayCommand CleanPlateCallAgv { get; set; }
  65. public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料
  66. public RelayCommand AgvArriveCleanPlateLocCom { get; set; }//下料完成
  67. public RelayCommand AgvArriveLineFourLoc { get; set; }//下料
  68. public RelayCommand AgvArriveLineFourLocCom { get; set; }//4号线空桶下料完成
  69. public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料
  70. public RelayCommand AgvArriveCleanPlateLocLoadCom { get; set; }//上料完成
  71. public RelayCommand EmptyRollerCleanTaskRestart { get; set; }
  72. public RelayCommand LineTwoEmptyRollerCleanTaskRestart { get; set; }
  73. public RelayCommand LineThreeEmptyRollerCleanTaskRestart { get; set; }
  74. public DebugViewModel()
  75. {
  76. AgvDebug = new RelayCommand(new Action(() =>
  77. {
  78. ActionManage.GetInstance.Send("AgvDebug");
  79. }));
  80. AgvArriveCleanPlateLocCom = new RelayCommand(() =>
  81. {
  82. ActionManage.GetInstance.Send("AgvArriveCleanPlateLocCom");
  83. });
  84. AgvArriveLineFourLocCom = new RelayCommand(() =>
  85. {
  86. ActionManage.GetInstance.Send("AgvArriveLineFourLocCom");
  87. });
  88. AgvArriveCleanPlateLocLoadCom = new RelayCommand(() =>
  89. {
  90. ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoadCom");
  91. });
  92. LineOneRecipeComSignal = new RelayCommand(() =>
  93. {
  94. ActionManage.GetInstance.Send("LineOneRecipeComSignal");
  95. });
  96. LineTwoRecipeComSignal = new RelayCommand(() =>
  97. {
  98. ActionManage.GetInstance.Send("LineTwoRecipeComSignal");
  99. });
  100. LineThreeRecipeComSignal = new RelayCommand(() =>
  101. {
  102. ActionManage.GetInstance.Send("LineThreeRecipeComSignal");
  103. });
  104. EmptyRollerCleanTaskRestart = new RelayCommand(() =>
  105. {
  106. ActionManage.GetInstance.Send("EmptyRollerCleanTaskRestart");
  107. });
  108. LineTwoEmptyRollerCleanTaskRestart = new RelayCommand(() =>
  109. {
  110. ActionManage.GetInstance.Send("LineTwoEmptyRollerCleanTaskRestart");
  111. });
  112. LineThreeEmptyRollerCleanTaskRestart = new RelayCommand(() =>
  113. {
  114. ActionManage.GetInstance.Send("LineThreeEmptyRollerCleanTaskRestart");
  115. });
  116. AgvLineOneLoadEmptyCom = new RelayCommand(() => {
  117. ActionManage.GetInstance.Send("AgvLineOneLoadEmptyCom");
  118. });
  119. AgvLineTwoLoadEmptyCom = new RelayCommand(() => {
  120. ActionManage.GetInstance.Send("AgvLineTwoLoadEmptyCom");
  121. });
  122. AgvLineThreeLoadEmptyCom = new RelayCommand(() => {
  123. ActionManage.GetInstance.Send("AgvLineThreeLoadEmptyCom");
  124. });
  125. AGVLineOneLoadCom = new RelayCommand(() =>
  126. {
  127. ActionManage.GetInstance.Send("AGVLineOneLoadCom");
  128. });
  129. AGVLineTwoLoadCom = new RelayCommand(() =>
  130. {
  131. ActionManage.GetInstance.Send("AGVLineTwoLoadCom");
  132. });
  133. AGVLineThreeLoadCom = new RelayCommand(() =>
  134. {
  135. ActionManage.GetInstance.Send("AGVLineThreeLoadCom");
  136. });
  137. AgvArriveLineOneEmptyRollerLoc = new RelayCommand(new Action(() =>
  138. {
  139. ActionManage.GetInstance.Send("AgvArriveLineOneEmptyRollerLoc");
  140. }));
  141. AgvArriveLineTwoEmptyRollerLoc = new RelayCommand(new Action(() =>
  142. {
  143. ActionManage.GetInstance.Send("AgvArriveLineTwoEmptyRollerLoc");
  144. }));
  145. AgvArriveLineThreeEmptyRollerLoc = new RelayCommand(new Action(() =>
  146. {
  147. ActionManage.GetInstance.Send("AgvArriveLineThreeEmptyRollerLoc");
  148. }));
  149. CleanPlateCallAgv = new RelayCommand(new Action(() =>
  150. {
  151. ActionManage.GetInstance.Send("CleanPlateCallAgv");
  152. }));
  153. AgvArriveCleanPlateLoc = new RelayCommand(new Action(() =>
  154. {
  155. ActionManage.GetInstance.Send("AgvArriveCleanPlateLoc");
  156. }));
  157. AgvArriveCleanPlateLocLoad = new RelayCommand(new Action(() =>
  158. {
  159. ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoad");
  160. }));
  161. AgvArriveLineFourLoc = new RelayCommand(new Action(() =>
  162. {
  163. ActionManage.GetInstance.Send("AgvArriveLineFourLoc");
  164. }));
  165. RollerLineRunning = new RelayCommand(new Action(() =>
  166. {
  167. ActionManage.GetInstance.Send("RollerLineRunning");
  168. }));
  169. FryPotInputArrive = new RelayCommand(new Action(() =>
  170. {
  171. ActionManage.GetInstance.Send("FryPotInputArrive");
  172. }));
  173. FryPotEmptyRollerArrive = new RelayCommand(new Action(() =>
  174. {
  175. ActionManage.GetInstance.Send("FryPotEmptyRollerArrive");
  176. }));
  177. AGVLOneArrive = new RelayCommand(new Action(() =>
  178. {
  179. ActionManage.GetInstance.Send("AGVLOneArrive");
  180. }));
  181. AGVFryPotDownArrive = new RelayCommand(new Action(() =>
  182. {
  183. ActionManage.GetInstance.Send("AGVFryPotDownArrive");
  184. }));
  185. AGVFryPotUpArrive = new RelayCommand(new Action(() =>
  186. {
  187. ActionManage.GetInstance.Send("AGVFryPotUpArrive");
  188. }));
  189. AGVFryPotGetEmptyRoller = new RelayCommand(new Action(() =>
  190. {
  191. ActionManage.GetInstance.Send("AGVFryPotGetEmptyRoller");
  192. }));
  193. //滚筒线2
  194. RollerLineTwoRunning = new RelayCommand(new Action(() =>
  195. {
  196. ActionManage.GetInstance.Send("RollerLineTwoRunning");
  197. }));
  198. FryPotTwoInputArrive = new RelayCommand(new Action(() =>
  199. {
  200. ActionManage.GetInstance.Send("FryPotTwoInputArrive");
  201. }));
  202. FryPotTwoEmptyRollerArrive = new RelayCommand(new Action(() =>
  203. {
  204. ActionManage.GetInstance.Send("FryPotTwoEmptyRollerArrive");
  205. }));
  206. AGVLTwoArrive = new RelayCommand(new Action(() =>
  207. {
  208. ActionManage.GetInstance.Send("AGVLTwoArrive");
  209. }));
  210. AGVFryPotTwoDownArrive = new RelayCommand(new Action(() =>
  211. {
  212. ActionManage.GetInstance.Send("AGVFryPotTwoDownArrive");
  213. }));
  214. AGVFryPotTwoUpArrive = new RelayCommand(new Action(() =>
  215. {
  216. ActionManage.GetInstance.Send("AGVFryPotTwoUpArrive");
  217. }));
  218. AGVFryPotTwoGetEmptyRoller = new RelayCommand(new Action(() =>
  219. {
  220. ActionManage.GetInstance.Send("AGVFryPotTwoGetEmptyRoller");
  221. }));
  222. //滚筒线3
  223. RollerLineThreeRunning = new RelayCommand(new Action(() =>
  224. {
  225. ActionManage.GetInstance.Send("RollerLineThreeRunning");
  226. }));
  227. FryPotThreeInputArrive = new RelayCommand(new Action(() =>
  228. {
  229. ActionManage.GetInstance.Send("FryPotThreeInputArrive");
  230. }));
  231. FryPotThreeEmptyRollerArrive = new RelayCommand(new Action(() =>
  232. {
  233. ActionManage.GetInstance.Send("FryPotThreeEmptyRollerArrive");
  234. }));
  235. AGVLThreeArrive = new RelayCommand(new Action(() =>
  236. {
  237. ActionManage.GetInstance.Send("AGVLThreeArrive");
  238. }));
  239. AGVFryPotThreeDownArrive = new RelayCommand(new Action(() =>
  240. {
  241. ActionManage.GetInstance.Send("AGVFryPotThreeDownArrive");
  242. }));
  243. AGVFryPotThreeUpArrive = new RelayCommand(new Action(() =>
  244. {
  245. ActionManage.GetInstance.Send("AGVFryPotThreeUpArrive");
  246. }));
  247. AGVFryPotThreeGetEmptyRoller = new RelayCommand(new Action(() =>
  248. {
  249. ActionManage.GetInstance.Send("AGVFryPotThreeGetEmptyRoller");
  250. }));
  251. LineOneTaskExit = new RelayCommand(new Action(() =>
  252. {
  253. ActionManage.GetInstance.Send("LineOneTaskExit");
  254. }));
  255. LineTwoTaskExit = new RelayCommand(new Action(() =>
  256. {
  257. ActionManage.GetInstance.Send("LineTwoTaskExit");
  258. }));
  259. LineThreeTaskExit = new RelayCommand(new Action(() =>
  260. {
  261. ActionManage.GetInstance.Send("LineThreeTaskExit");
  262. }));
  263. }
  264. }
  265. }