|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- using BPASmartClient.Device;
- using BPASmartClient.Model;
- using System;
- using System.Collections.Concurrent;
- using System.Collections.Generic;
- using System.Linq;
- using System.Speech.Synthesis;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.MorkS
- {
- public class GVL_MORKS : IStatus
- {
- public List<string> HistorySuborderId { get; set; } = new List<string>();
- /// <summary>
- /// 机器人取面
- /// PLC -> M0.3
- /// ModbusTcp -> 323
- /// </summary>
- public bool RobotTakeNoodle { get; set; }
-
- /// <summary>
- /// 机器人出餐
- /// PLC -> M0.4
- /// ModbusTcp -> 324
- /// </summary>
- public bool RobotOutMeal { get; set; }
-
- /// <summary>
- /// 移动转台
- /// PLC -> M0.5
- /// ModbusTcp -> 325
- /// </summary>
- public bool MoveTurntable { get; set; }
-
-
- #region 临时变量
- /// <summary>
- /// 允许运行
- /// </summary>
- //[Circuit(new string[] { "机器人取面", "取碗控制" }, "允许运行")]
- [VariableMonitor("允许运行")]
- public bool AllowRun { get; set; }
-
- /// <summary>
- /// 优先级判断
- /// </summary>
- [VariableMonitor("优先级判断条件")]
- public bool PriorityJudgment { get; set; }
-
- /// <summary>
- /// 机器人任务互锁信号,false:取面,true:出餐
- /// </summary>
- //[Circuit(new string[] { "机器人取面", "出面控制" }, "机器人互锁", new bool[] { true, false })]
- [VariableMonitor("机器人任务互锁信号")]
- public bool RobotTaskInterlock { get; set; }
-
- /// <summary>
- /// 取碗互锁信号
- /// </summary>
- //[Circuit("取碗控制", "取碗互锁", true)]
- [VariableMonitor("取碗互锁信号")]
- public bool TakeBowlInterlock { get; set; }
-
- /// <summary>
- /// 取面互锁信号
- /// </summary>
- //[Circuit(new string[] { "机器人取面", "出面控制" }, "取面互锁信号", new bool[] { true, true })]
- [VariableMonitor("取面互锁信号")]
- public bool TakeNoodleInterlock { get; set; }
-
- /// <summary>
- /// 出面中
- /// </summary>
- //[Circuit("机器人取面", "出面中", true)]
- [VariableMonitor("出面中")]
- public bool OutNoodleing { get; set; }
-
- /// <summary>
- /// 允许取面
- /// </summary>
- //[Circuit(new string[] { "转台控制", "机器人取面" }, "允许取面", new bool[] { true, false })]
- [VariableMonitor("允许取面")]
- public bool AllowTakeNoodle { get; set; }
-
- /// <summary>
- /// 转台互锁信号
- /// </summary>
- [VariableMonitor("转台互锁信号")]
- public bool TurntableInterlock { get; set; }
- #endregion
-
- /// <summary>
- /// 初始化完成
- /// PLC -> M100.0
- /// ModbusTcp -> 1120
- /// </summary>
- //[Circuit(new string[] { "允许运行", "转台控制", "转台控制" }, "初始化完成")]
- [VariableMonitor("初始化完成", "M100.0", "1120")]
- public bool InitComplete { get; set; }
-
- /// <summary>
- /// 取碗机构空闲,True:忙碌,false:空闲
- /// PLC -> M100.1
- /// ModbusTcp -> 1121
- /// </summary>
- //[Circuit("取碗控制", "取碗机构空闲", true)]
- [VariableMonitor("取碗机构空闲", "M100.1", "1121")]
- public bool TakeBowlIdle { get; set; }
-
- /// <summary>
- /// 温度到达,True:表示到达,false:未到达
- /// PLC -> M100.2
- /// ModbusTcp -> 1122
- /// </summary>
- //[Circuit("允许运行", "温度到达")]
- [VariableMonitor("温度到达", "M100.2", "1122")]
- public bool TemperatureReached { get; set; }
-
- /// <summary>
- /// 允许到面,配料完成
- /// PLC -> M100.3
- /// ModbusTcp -> 1123
- /// </summary>
- //[Circuit("出面控制", "允许到面")]
- [VariableMonitor("允许到面", "M100.3", "1123")]
- public bool AllowFallNoodle { get; set; }
-
- /// <summary>
- /// 机器人取面完成
- /// PLC -> M100.4
- /// ModbusTcp -> 1124
- /// </summary>
- [VariableMonitor("机器人取面完成", "M100.4", "1124")]
- public bool RbTakeNoodleComplete { get; set; }
-
- /// <summary>
- /// 机器人倒面完成
- /// PLC -> M100.5
- /// ModbusTcp -> 1125
- /// </summary>
- [VariableMonitor("机器人倒面完成", "M100.5", "1125")]
- public bool RbFallNoodleComplete { get; set; }
-
- /// <summary>
- /// 机器人出餐完成,上报取餐完成
- /// PLC -> M100.6
- /// ModbusTcp -> 1126
- /// </summary>
- [VariableMonitor("机器人出餐完成", "M100.6", "1126")]
- public bool RbOutMealComplete { get; set; }
-
- /// <summary>
- /// 机器人空闲
- /// PLC -> M100.7
- /// ModbusTcp -> 1127
- /// </summary>
- //[Circuit(new string[] { "机器人取面", "出面控制" }, "机器人空闲")]
- [VariableMonitor("机器人空闲", "M100.7", "1127")]
- public bool RobotIdle { get; set; }
-
- /// <summary>
- /// 取餐口检测
- /// PLC -> M101.0
- /// ModbusTcp -> 1128
- /// </summary>
- //[Circuit("出面控制", "取餐口检测", true)]
- [VariableMonitor("取餐口检测", "M101.0", "1128")]
- public bool TakeMealDetect { get; set; }
-
- /// <summary>
- /// 缺碗信号,false:缺碗,true:有碗
- /// PLC -> M101.1
- /// ModbusTcp -> 1129
- /// </summary>
- [VariableMonitor("缺碗信号", "M101.1", "1129")]
- public bool MissingBowl { get; set; }
-
- /// <summary>
- /// 设备初始化中,执行中等于1,2秒后复位
- /// PLC -> M101.2
- /// ModbusTcp -> 1130
- /// </summary>
- [VariableMonitor("设备初始化中", "M101.2", "1130")]
- public bool DeviceIniting { get; set; }
-
- /// <summary>
- /// 转台下限检测
- /// PLC -> M101.3
- /// ModbusTcp -> 1131
- /// </summary>
- //[Circuit("转台控制", "转台下限检测有物料")]
- [VariableMonitor("转台下限检测", "M101.3", "1131")]
- public bool TurntableLowerLimit { get; set; }
-
- /// <summary>
- /// 缺碗信号 2
- /// PLC -> M101.4
- /// ModbusTcp -> 1132
- /// </summary>
- [VariableMonitor("缺碗信号 2", "M101.4", "1132")]
- public bool MissingBowlSignal2 { get; set; }
-
- /// <summary>
- /// 转台上限检测
- /// PLC -> M101.5
- /// ModbusTcp -> 1133
- /// </summary>
- [VariableMonitor("转台上限检测", "M101.5", "1133")]
- public bool TurntableUpLimit { get; set; }
-
- /// <summary>
- /// 补料完成
- /// PLC -> M101.6
- /// ModbusTcp -> 1134
- /// </summary>
- [VariableMonitor("补料完成", "M101.6", "1134")]
- public bool FeedComplete { get; set; }
-
- /// <summary>
- /// 转台移动到位
- /// PLC -> M101.7
- /// ModbusTcp -> 1135
- /// </summary>
- //[Circuit(new string[] { "转台控制", "机器人取面" }, "转台移动到位")]
- [VariableMonitor("转台移动到位", "M101.7", "1135")]
- public bool TurntableMoveInPlace { get; set; }
-
- /// <summary>
- /// 煮面炉状态,True:忙碌,false:空闲
- /// M102.0 - M102.5
- /// 1136 - 1141
- /// </summary>
- [VariableMonitor("煮面炉状态", "M102.0", "1136")]
- public bool[] NoodleCookerStatus { get; set; } = new bool[6] { false, false, false, false, false, false };
-
- /// <summary>
- /// 补料中
- /// M102.6
- /// 1142
- /// </summary>
- [VariableMonitor("补料中", "M102.6", "1142")]
- public bool Feeding { get; set; }
-
- /// <summary>
- /// 煮面完成,上升后给信号
- /// M103.0 - M103.5
- /// 1144 - 1149
- /// </summary>
- [VariableMonitor("煮面完成", "M103.0", "1144")]
- public bool[] CookNoodlesComplete { get; set; } = new bool[6] { false, false, false, false, false, false };
-
- /// <summary>
- /// 硬件设备异常
- /// PLC -> M235.0
- /// True:设备正常,False:设备异常
- /// </summary>
- [VariableMonitor("硬件设备异常", "M235.0", "")]
- public bool Error { get; set; } = false;
-
- /// <summary>
- /// 配方编号
- /// PLC -> VW0
- /// ModbusTcp -> 100
- /// </summary>
- [VariableMonitor("配方编号", "VW0", "100")]
- public ushort RecipeNumber { get; set; }
-
- /// <summary>
- /// 转台设置位置
- /// PLC -> VW2
- /// ModbusTcp -> 101
- /// </summary>
- [VariableMonitor("转台设置位置", "VW2", "101")]
- public ushort TurntableLoc { get; set; }
-
- /// <summary>
- /// 到面至煮面炉位置
- /// PLC -> VW4
- /// ModbusTcp -> 102
- /// </summary>
- [VariableMonitor("到面至煮面炉位置", "VW4", "102")]
- public ushort FallNoodleLoc { get; set; }
-
- /// <summary>
- /// 取面位置
- /// PLC -> VW6
- /// ModbusTcp -> 103
- /// </summary>
- [VariableMonitor("取面位置", "VW6", "103")]
- public ushort TakeNoodleLoc { get; set; }
-
- /// <summary>
- /// 转台反馈位置
- /// PLC -> VW372
- /// ModbusTcp -> 286
- /// </summary>
- [VariableMonitor("转台反馈位置", "VW372", "286")]
- public ushort TurntableFeedbackloc { get; set; }
-
- /// <summary>
- /// 机器人取面位置队列
- /// </summary>
- //[Circuit(new string[] { "转台控制", "机器人取面" }, "有机器人取面队列")]
- public ConcurrentQueue<OrderLocInfo> RBTakeNoodleTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
-
- /// <summary>
- /// 出碗队列
- /// </summary>
- //[Circuit("取碗控制", "有取碗队列数量")]
- public ConcurrentQueue<OrderLocInfo> TakeBowlTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();
-
- public List<DoOrderEvent> doOrderEvents { get; set; } = new List<DoOrderEvent>();
-
- /// <summary>
- /// 是否有面条
- /// </summary>
- public bool IsNoodles { get; set; } = true;
-
- /// <summary>
- /// 制作完成标志
- /// </summary>
- [VariableMonitor("制作完成标志")]
- public bool CookCompleteFlatBit { get; set; }
-
-
- #region 订单ID记录
- /// <summary>
- /// 取碗订单ID
- /// </summary>
- public string TakeBowlId = string.Empty;
- /// <summary>
- /// 取碗订单名称
- /// </summary>
- public string TakeBowName = string.Empty;
-
- /// <summary>
- /// 配料完成订单ID
- /// </summary>
- public string IngredientsCompleteId = string.Empty;
- /// <summary>
- /// 配料完成订单名称
- /// </summary>
- public string IngredientsCompleteName = string.Empty;
-
- /// <summary>
- /// 煮面口对应的订单ID
- /// </summary>
- public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, };
-
- /// <summary>
- /// 出餐订单ID
- /// </summary>
- public string OutMealId = string.Empty;
- /// <summary>
- /// 出餐订单名称
- /// </summary>
- public string OutMealName = string.Empty;
-
- /// <summary>
- /// 转台位置轮询
- /// </summary>
- public List<ushort> TurntableLocLists = new List<ushort>();
-
- /// <summary>
- /// 转台当前启动位置
- /// </summary>
- [VariableMonitor("转台当前启动位置")]
- public ushort CurrentLoc { get; set; } = 0;
-
- public SpeechSynthesizer speech = new SpeechSynthesizer();
-
- #endregion
- }
- }
|