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.
 
 

323 lines
10 KiB

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