using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections.Concurrent; using BPA.Message; using BPASmartClient.Device; using BPASmartClient.Model; namespace BPASmartClient.MorkM { /// /// MORKS 设备数据 /// public class GVL_MORKM : IStatus { public GVL_MORKM() { for (int i = 0; i < 6; i++) { CookNodelId.Add(new CookNodleLocAndId() { CookNodelId = "", Loc = -1 }); } } /// /// 机器人取面 /// PLC -> M0.3 /// ModbusTcp -> 323 /// public bool RobotTakeNoodle { get; set; } /// /// 机器人出餐 /// PLC -> M0.4 /// ModbusTcp -> 324 /// public bool RobotOutMeal { get; set; } /// /// 移动转台 /// PLC -> M0.5 /// ModbusTcp -> 325 /// public bool MoveTurntable { get; set; } #region 临时变量 /// /// 允许运行 /// [VariableMonitor("允许运行")] public bool AllowRun { get; set; } /// /// //机器人任务互锁信号 /// [VariableMonitor("机器人任务互锁信号")] public bool RobotTaskInterlock { get; set; } /// /// 取碗互锁信号 /// [VariableMonitor("取碗互锁信号")] public bool TakeBowlInterlock { get; set; } /// /// 取面互锁信号 /// [VariableMonitor("取面互锁信号")] public bool TakeNoodleInterlock { get; set; } /// /// 出面中 /// [VariableMonitor("出面中")] public bool OutNoodleing { get; set; } /// /// 允许取面 /// [VariableMonitor("允许取面")] public bool AllowTakeNoodle { get; set; } /// /// 转台互锁信号 /// [VariableMonitor("转台互锁信号")] public bool TurntableInterlock { get; set; } /// /// 荤素出餐互锁 /// [VariableMonitor("荤素出餐互锁")] public bool ERLoc { get; set; } = false; /// /// 当前取餐位置 /// [VariableMonitor("当前取餐位置")] public int CurrentTakeMeakLoc { get; set; } = -1; #endregion /// /// 初始化完成 /// PLC -> M100.0 /// ModbusTcp -> 1120 /// [VariableMonitor("初始化完成", "M100.0", "1120")] public bool InitComplete { get; set; } /// /// 取碗机构空闲,True:忙碌,false:空闲 /// PLC -> M100.1 /// ModbusTcp -> 1121 /// [VariableMonitor("取碗机构空闲", "M100.1", "1121")] public bool TakeBowlIdle { get; set; } /// /// 温度到达,True:表示到达,false:未到达 /// PLC -> M100.2 /// ModbusTcp -> 1122 /// [VariableMonitor("温度到达", "M100.2", "1122")] public bool TemperatureReached { get; set; } /// /// 允许到面,配料完成 /// PLC -> M100.3 /// ModbusTcp -> 1123 /// [VariableMonitor("允许到面", "M100.3", "1123")] public bool AllowFallNoodle { get; set; } /// /// 机器人取面完成 /// PLC -> M100.4 /// ModbusTcp -> 1124 /// [VariableMonitor("机器人取面完成", "M100.4", "1124")] public bool RbTakeNoodleComplete { get; set; } /// /// 机器人倒面完成 /// PLC -> M100.5 /// ModbusTcp -> 1125 /// [VariableMonitor("机器人倒面完成", "M100.5", "1125")] public bool RbFallNoodleComplete { get; set; } /// /// 机器人出餐完成,上报取餐完成 /// PLC -> M100.6 /// ModbusTcp -> 1126 /// [VariableMonitor("机器人出餐完成", "M100.6", "1126")] public bool RbOutMealComplete { get; set; } /// /// 机器人空闲 /// PLC -> M100.7 /// ModbusTcp -> 1127 /// [VariableMonitor("机器人空闲", "M100.7", "1127")] public bool RobotIdle { get; set; } /// /// 取餐口检测 /// PLC -> M101.0 /// ModbusTcp -> 1128 /// [VariableMonitor("取餐口检测", "M101.0", "1128")] public bool TakeMealDetect { get; set; } /// /// 缺碗信号,false:缺碗,true:有碗 /// PLC -> M101.1 /// ModbusTcp -> 1129 /// [VariableMonitor("缺碗信号", "M101.1", "1129")] public bool MissingBowl { get; set; } /// /// 设备初始化中,执行中等于1,2秒后复位 /// PLC -> M101.2 /// ModbusTcp -> 1130 /// [VariableMonitor("设备初始化中", "M101.2", "1130")] public bool DeviceIniting { get; set; } /// /// 转台下限检测 /// PLC -> M101.3 /// ModbusTcp -> 1131 /// [VariableMonitor("转台下限检测", "M101.3", "1131")] public bool TurntableLowerLimit { get; set; } /// /// 缺碗信号 2 /// PLC -> M101.4 /// ModbusTcp -> 1132 /// [VariableMonitor("缺碗信号 2", "M101.4", "1132")] public bool MissingBowlSignal2 { get; set; } /// /// 转台上限检测 /// PLC -> M101.5 /// ModbusTcp -> 1133 /// [VariableMonitor("转台上限检测", "M101.5", "1133")] public bool TurntableUpLimit { get; set; } /// /// 补料完成 /// PLC -> M101.6 /// ModbusTcp -> 1134 /// [VariableMonitor("补料完成", "M101.6", "1134")] public bool FeedComplete { get; set; } /// /// 转台移动到位 /// PLC -> M101.7 /// ModbusTcp -> 1135 /// [VariableMonitor("转台移动到位", "M101.7", "1135")] public bool TurntableMoveInPlace { get; set; } /// /// 煮面炉状态,True:忙碌,false:空闲 /// M102.0 - M102.5 /// 1136 - 1141 /// [VariableMonitor("煮面炉状态", "M102.0", "1136")] public bool[] NoodleCookerStatus { get; set; } = new bool[6] { false, false, false, false, false, false }; /// /// 补料中 /// M102.6 /// 1142 /// [VariableMonitor("补料中", "M102.6", "1142")] public bool Feeding { get; set; } /// /// 煮面完成,上升后给信号 /// M103.0 - M103.5 /// 1144 - 1149 /// [VariableMonitor("煮面完成", "M103.0", "1144")] public bool[] CookNoodlesComplete { get; set; } = new bool[6] { false, false, false, false, false, false }; /// /// 硬件设备异常 /// PLC -> M235.0 /// True:设备正常,False:设备异常 /// [VariableMonitor("硬件设备异常", "M235.0", "")] public bool Error { get; set; } = false; /// /// 配方编号 /// PLC -> VW0 /// ModbusTcp -> 100 /// [VariableMonitor("配方编号", "VW0", "100")] public ushort RecipeNumber { get; set; } /// /// 转台设置位置 /// PLC -> VW2 /// ModbusTcp -> 101 /// [VariableMonitor("转台设置位置", "VW2", "101")] public ushort TurntableLoc { get; set; } /// /// 到面至煮面炉位置 /// PLC -> VW4 /// ModbusTcp -> 102 /// [VariableMonitor("到面至煮面炉位置", "VW4", "102")] public ushort FallNoodleLoc { get; set; } /// /// 取面位置 /// PLC -> VW6 /// ModbusTcp -> 103 /// [VariableMonitor("取面位置", "VW6", "103")] public ushort TakeNoodleLoc { get; set; } /// /// 转台反馈位置 /// PLC -> VW372 /// ModbusTcp -> 286 /// [VariableMonitor("转台反馈位置", "VW372", "286")] public ushort TurntableFeedbackloc { get; set; } /// /// 机器人取面位置队列 /// public ConcurrentQueue RBTakeNoodleTask { get; set; } = new ConcurrentQueue(); /// /// 出碗队列 /// public ConcurrentQueue TakeBowlTask { get; set; } = new ConcurrentQueue(); /// /// 是否有面条 /// public bool IsNoodles { get; set; } = true; public Dictionary ListOrder { get; set; } = new Dictionary(); //存放当前订单已做好素菜 public Dictionary ListOrderMeat { get; set; } = new Dictionary(); //存放当前订单已做好荤菜 public int DishNumber { set; get; } = 0; //当前订单中配菜的数量 #region 订单ID记录 /// /// 取碗订单ID /// public string TakeBowlId = string.Empty; /// /// 配料完成订单ID /// public string IngredientsCompleteId = string.Empty; /// /// 煮面口对应的订单ID /// //public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; public List CookNodelId { get; set; } = new List(); //public string[] CookNodelId = new string[6] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; public OrderLocInfo[] orderLocInfos = new OrderLocInfo[6] { null, null, null, null, null, null }; /// /// 出餐订单ID /// public string OutMealId = string.Empty; /// /// 冒菜制作方式,true:加汤,false:不加汤 /// public bool OutMealType { get; set; } = false; /// /// 转台位置轮询 /// public List TurntableLocLists = new List(); /// /// 转台当前启动位置 /// [VariableMonitor("转台当前启动位置")] public ushort CurrentLoc { get; set; } = 0; public List doOrderEvents { get; set; } = new List(); public int Num { get; set; } //记录同一个订单是否所有配菜均已出锅 public int Count { get; set; } = 0; //用于素菜的计数 public int CountMeat { get; set; } = 0;//用于荤菜计数 public int Vnum { get; set; } = 0; //单次订单素菜的总数 public int VegtabNum { get; set; } = 0;//记录一个订单中素菜的数量 public int TotalNum { get; set; } = 0; //单次订单的配菜总数 public ConcurrentQueue> Conqueue = new ConcurrentQueue>(); //记录订单的ID 以及素菜数量 public bool relock { get; set; } = false; //单次订单互锁 public bool HasVeg { get; set; } //是否有素菜判断 public bool VegNoodlesLock { get; set; } = false; //取面和取餐互锁 public int VegN { get; set; } = 0; //素菜出餐计数 #endregion } public class CookNodleLocAndId { public string CookNodelId { get; set; } public int Loc { get; set; } } }