终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

GVL_MORKS.cs 12 KiB

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