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

GVL_MORKS.cs 12 KiB

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. using BPASmartClient.Device;
  2. using BPASmartClient.Model;
  3. using System;
  4. using System.Collections.Concurrent;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Speech.Synthesis;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPASmartClient.MorkS
  11. {
  12. public class GVL_MORKS : IStatus
  13. {
  14. public List<string> HistorySuborderId { get; set; } = new List<string>();
  15. /// <summary>
  16. /// 机器人取面
  17. /// PLC -> M0.3
  18. /// ModbusTcp -> 323
  19. /// </summary>
  20. public bool RobotTakeNoodle { get; set; }
  21. /// <summary>
  22. /// 机器人出餐
  23. /// PLC -> M0.4
  24. /// ModbusTcp -> 324
  25. /// </summary>
  26. public bool RobotOutMeal { get; set; }
  27. /// <summary>
  28. /// 移动转台
  29. /// PLC -> M0.5
  30. /// ModbusTcp -> 325
  31. /// </summary>
  32. public bool MoveTurntable { get; set; }
  33. #region 临时变量
  34. /// <summary>
  35. /// 允许运行
  36. /// </summary>
  37. //[Circuit(new string[] { "机器人取面", "取碗控制" }, "允许运行")]
  38. [VariableMonitor("允许运行")]
  39. public bool AllowRun { get; set; }
  40. /// <summary>
  41. /// 优先级判断
  42. /// </summary>
  43. [VariableMonitor("优先级判断条件")]
  44. public bool PriorityJudgment { get; set; }
  45. /// <summary>
  46. /// 机器人任务互锁信号,false:取面,true:出餐
  47. /// </summary>
  48. //[Circuit(new string[] { "机器人取面", "出面控制" }, "机器人互锁", new bool[] { true, false })]
  49. [VariableMonitor("机器人任务互锁信号")]
  50. public bool RobotTaskInterlock { get; set; }
  51. /// <summary>
  52. /// 取碗互锁信号
  53. /// </summary>
  54. //[Circuit("取碗控制", "取碗互锁", true)]
  55. [VariableMonitor("取碗互锁信号")]
  56. public bool TakeBowlInterlock { get; set; }
  57. /// <summary>
  58. /// 取面互锁信号
  59. /// </summary>
  60. //[Circuit(new string[] { "机器人取面", "出面控制" }, "取面互锁信号", new bool[] { true, true })]
  61. [VariableMonitor("取面互锁信号")]
  62. public bool TakeNoodleInterlock { get; set; }
  63. /// <summary>
  64. /// 出面中
  65. /// </summary>
  66. //[Circuit("机器人取面", "出面中", true)]
  67. [VariableMonitor("出面中")]
  68. public bool OutNoodleing { get; set; }
  69. /// <summary>
  70. /// 允许取面
  71. /// </summary>
  72. //[Circuit(new string[] { "转台控制", "机器人取面" }, "允许取面", new bool[] { true, false })]
  73. [VariableMonitor("允许取面")]
  74. public bool AllowTakeNoodle { get; set; }
  75. /// <summary>
  76. /// 转台互锁信号
  77. /// </summary>
  78. [VariableMonitor("转台互锁信号")]
  79. public bool TurntableInterlock { get; set; }
  80. #endregion
  81. /// <summary>
  82. /// 初始化完成
  83. /// PLC -> M100.0
  84. /// ModbusTcp -> 1120
  85. /// </summary>
  86. //[Circuit(new string[] { "允许运行", "转台控制", "转台控制" }, "初始化完成")]
  87. [VariableMonitor("初始化完成", "M100.0", "1120")]
  88. public bool InitComplete { get; set; }
  89. /// <summary>
  90. /// 取碗机构空闲,True:忙碌,false:空闲
  91. /// PLC -> M100.1
  92. /// ModbusTcp -> 1121
  93. /// </summary>
  94. //[Circuit("取碗控制", "取碗机构空闲", true)]
  95. [VariableMonitor("取碗机构空闲", "M100.1", "1121")]
  96. public bool TakeBowlIdle { get; set; }
  97. /// <summary>
  98. /// 温度到达,True:表示到达,false:未到达
  99. /// PLC -> M100.2
  100. /// ModbusTcp -> 1122
  101. /// </summary>
  102. //[Circuit("允许运行", "温度到达")]
  103. [VariableMonitor("温度到达", "M100.2", "1122")]
  104. public bool TemperatureReached { get; set; }
  105. /// <summary>
  106. /// 允许到面,配料完成
  107. /// PLC -> M100.3
  108. /// ModbusTcp -> 1123
  109. /// </summary>
  110. //[Circuit("出面控制", "允许到面")]
  111. [VariableMonitor("允许到面", "M100.3", "1123")]
  112. public bool AllowFallNoodle { get; set; }
  113. /// <summary>
  114. /// 机器人取面完成
  115. /// PLC -> M100.4
  116. /// ModbusTcp -> 1124
  117. /// </summary>
  118. [VariableMonitor("机器人取面完成", "M100.4", "1124")]
  119. public bool RbTakeNoodleComplete { get; set; }
  120. /// <summary>
  121. /// 机器人倒面完成
  122. /// PLC -> M100.5
  123. /// ModbusTcp -> 1125
  124. /// </summary>
  125. [VariableMonitor("机器人倒面完成", "M100.5", "1125")]
  126. public bool RbFallNoodleComplete { get; set; }
  127. /// <summary>
  128. /// 机器人出餐完成,上报取餐完成
  129. /// PLC -> M100.6
  130. /// ModbusTcp -> 1126
  131. /// </summary>
  132. [VariableMonitor("机器人出餐完成", "M100.6", "1126")]
  133. public bool RbOutMealComplete { get; set; }
  134. /// <summary>
  135. /// 机器人空闲
  136. /// PLC -> M100.7
  137. /// ModbusTcp -> 1127
  138. /// </summary>
  139. //[Circuit(new string[] { "机器人取面", "出面控制" }, "机器人空闲")]
  140. [VariableMonitor("机器人空闲", "M100.7", "1127")]
  141. public bool RobotIdle { get; set; }
  142. /// <summary>
  143. /// 取餐口检测
  144. /// PLC -> M101.0
  145. /// ModbusTcp -> 1128
  146. /// </summary>
  147. //[Circuit("出面控制", "取餐口检测", true)]
  148. [VariableMonitor("取餐口检测", "M101.0", "1128")]
  149. public bool TakeMealDetect { get; set; }
  150. /// <summary>
  151. /// 缺碗信号,false:缺碗,true:有碗
  152. /// PLC -> M101.1
  153. /// ModbusTcp -> 1129
  154. /// </summary>
  155. [VariableMonitor("缺碗信号", "M101.1", "1129")]
  156. public bool MissingBowl { get; set; }
  157. /// <summary>
  158. /// 设备初始化中,执行中等于1,2秒后复位
  159. /// PLC -> M101.2
  160. /// ModbusTcp -> 1130
  161. /// </summary>
  162. [VariableMonitor("设备初始化中", "M101.2", "1130")]
  163. public bool DeviceIniting { get; set; }
  164. /// <summary>
  165. /// 转台下限检测
  166. /// PLC -> M101.3
  167. /// ModbusTcp -> 1131
  168. /// </summary>
  169. //[Circuit("转台控制", "转台下限检测有物料")]
  170. [VariableMonitor("转台下限检测", "M101.3", "1131")]
  171. public bool TurntableLowerLimit { get; set; }
  172. /// <summary>
  173. /// 缺碗信号 2
  174. /// PLC -> M101.4
  175. /// ModbusTcp -> 1132
  176. /// </summary>
  177. [VariableMonitor("缺碗信号 2", "M101.4", "1132")]
  178. public bool MissingBowlSignal2 { get; set; }
  179. /// <summary>
  180. /// 转台上限检测
  181. /// PLC -> M101.5
  182. /// ModbusTcp -> 1133
  183. /// </summary>
  184. [VariableMonitor("转台上限检测", "M101.5", "1133")]
  185. public bool TurntableUpLimit { get; set; }
  186. /// <summary>
  187. /// 补料完成
  188. /// PLC -> M101.6
  189. /// ModbusTcp -> 1134
  190. /// </summary>
  191. [VariableMonitor("补料完成", "M101.6", "1134")]
  192. public bool FeedComplete { get; set; }
  193. /// <summary>
  194. /// 转台移动到位
  195. /// PLC -> M101.7
  196. /// ModbusTcp -> 1135
  197. /// </summary>
  198. //[Circuit(new string[] { "转台控制", "机器人取面" }, "转台移动到位")]
  199. [VariableMonitor("转台移动到位", "M101.7", "1135")]
  200. public bool TurntableMoveInPlace { get; set; }
  201. /// <summary>
  202. /// 煮面炉状态,True:忙碌,false:空闲
  203. /// M102.0 - M102.5
  204. /// 1136 - 1141
  205. /// </summary>
  206. [VariableMonitor("煮面炉状态", "M102.0", "1136")]
  207. public bool[] NoodleCookerStatus { get; set; } = new bool[6] { false, false, false, false, false, false };
  208. /// <summary>
  209. /// 补料中
  210. /// M102.6
  211. /// 1142
  212. /// </summary>
  213. [VariableMonitor("补料中", "M102.6", "1142")]
  214. public bool Feeding { get; set; }
  215. /// <summary>
  216. /// 煮面完成,上升后给信号
  217. /// M103.0 - M103.5
  218. /// 1144 - 1149
  219. /// </summary>
  220. [VariableMonitor("煮面完成", "M103.0", "1144")]
  221. public bool[] CookNoodlesComplete { get; set; } = new bool[6] { false, false, false, false, false, false };
  222. /// <summary>
  223. /// 硬件设备异常
  224. /// PLC -> M235.0
  225. /// True:设备正常,False:设备异常
  226. /// </summary>
  227. [VariableMonitor("硬件设备异常", "M235.0", "")]
  228. public bool Error { get; set; } = false;
  229. /// <summary>
  230. /// 配方编号
  231. /// PLC -> VW0
  232. /// ModbusTcp -> 100
  233. /// </summary>
  234. [VariableMonitor("配方编号", "VW0", "100")]
  235. public ushort RecipeNumber { get; set; }
  236. /// <summary>
  237. /// 转台设置位置
  238. /// PLC -> VW2
  239. /// ModbusTcp -> 101
  240. /// </summary>
  241. [VariableMonitor("转台设置位置", "VW2", "101")]
  242. public ushort TurntableLoc { get; set; }
  243. /// <summary>
  244. /// 到面至煮面炉位置
  245. /// PLC -> VW4
  246. /// ModbusTcp -> 102
  247. /// </summary>
  248. [VariableMonitor("到面至煮面炉位置", "VW4", "102")]
  249. public ushort FallNoodleLoc { get; set; }
  250. /// <summary>
  251. /// 取面位置
  252. /// PLC -> VW6
  253. /// ModbusTcp -> 103
  254. /// </summary>
  255. [VariableMonitor("取面位置", "VW6", "103")]
  256. public ushort TakeNoodleLoc { get; set; }
  257. /// <summary>
  258. /// 转台反馈位置
  259. /// PLC -> VW372
  260. /// ModbusTcp -> 286
  261. /// </summary>
  262. [VariableMonitor("转台反馈位置", "VW372", "286")]
  263. public ushort TurntableFeedbackloc { get; set; }
  264. /// <summary>
  265. /// 机器人取面位置队列
  266. /// </summary>
  267. //[Circuit(new string[] { "转台控制", "机器人取面" }, "有机器人取面队列")]
  268. public ConcurrentQueue<OrderLocInfo> RBTakeNoodleTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  269. /// <summary>
  270. /// 出碗队列
  271. /// </summary>
  272. //[Circuit("取碗控制", "有取碗队列数量")]
  273. public ConcurrentQueue<OrderLocInfo> TakeBowlTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
  274. public List<DoOrderEvent> doOrderEvents { get; set; } = new List<DoOrderEvent>();
  275. /// <summary>
  276. /// 是否有面条
  277. /// </summary>
  278. public bool IsNoodles { get; set; } = true;
  279. /// <summary>
  280. /// 制作完成标志
  281. /// </summary>
  282. [VariableMonitor("制作完成标志")]
  283. public bool CookCompleteFlatBit { get; set; }
  284. #region 订单ID记录
  285. /// <summary>
  286. /// 取碗订单ID
  287. /// </summary>
  288. public string TakeBowlId = string.Empty;
  289. /// <summary>
  290. /// 取碗订单名称
  291. /// </summary>
  292. public string TakeBowName = string.Empty;
  293. /// <summary>
  294. /// 配料完成订单ID
  295. /// </summary>
  296. public string IngredientsCompleteId = string.Empty;
  297. /// <summary>
  298. /// 配料完成订单名称
  299. /// </summary>
  300. public string IngredientsCompleteName = string.Empty;
  301. /// <summary>
  302. /// 煮面口对应的订单ID
  303. /// </summary>
  304. public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, };
  305. /// <summary>
  306. /// 出餐订单ID
  307. /// </summary>
  308. public string OutMealId = string.Empty;
  309. /// <summary>
  310. /// 出餐订单名称
  311. /// </summary>
  312. public string OutMealName = string.Empty;
  313. /// <summary>
  314. /// 转台位置轮询
  315. /// </summary>
  316. public List<ushort> TurntableLocLists = new List<ushort>();
  317. /// <summary>
  318. /// 转台当前启动位置
  319. /// </summary>
  320. [VariableMonitor("转台当前启动位置")]
  321. public ushort CurrentLoc { get; set; } = 0;
  322. public SpeechSynthesizer speech = new SpeechSynthesizer();
  323. #endregion
  324. }
  325. }