|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804 |
- using BPA.Message;
- using BPA.Message.Enum;
- using BPASmartClient.Business;
- using BPASmartClient.Device;
- using BPASmartClient.EventBus;
- using BPASmartClient.Helper;
- using BPASmartClient.Model;
- using BPASmartClient.MorkBF.ViewModel;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using static BPASmartClient.EventBus.EventBus;
-
- namespace BPASmartClient.MorkBF
- {
- public class Control_MorkBF : BaseDevice
- {
- GVL_MorkBF morkBF = new GVL_MorkBF();
-
- public override DeviceClientType DeviceType => DeviceClientType.MORKCS;
-
- public override void DoMain()
- {
-
- MonitorViewModel.DeviceId = DeviceId;
- CommandRegist();//调试
- ServerInit();
- DataParse();//数据解析
- ScreenDataServer();//大屏数据上报
- DeviceProcessLogShow("MORKF 设备初始化完成");
- }
-
- private void DataParse()
- {
- EventBus.EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBackHandle)
- {
- if (@event == null) return;
- if (@event is DoOrderEvent order)
- {
- if (order.MorkOrder.GoodBatchings == null) return;
- OrderCount++;
- DeviceProcessLogShow($"接收到{OrderCount}次订单");
-
-
-
- }
-
- });
- }
-
- private void ServerInit()
- {
- //物料信息
- EventBus.EventBus.GetInstance().Subscribe<MaterialDeliveryEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
- {
- if (@event == null) return;
- if (@event is MaterialDeliveryEvent material)
- {
- orderMaterialDelivery = material.orderMaterialDelivery;
-
- }
- });
-
- //配方数据信息
- EventBus.EventBus.GetInstance().Subscribe<RecipeBomEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack)
- {
- if (@event == null) return;
- if (@event is RecipeBomEvent recipe)
- {
- recipeBoms = recipe.recipeBoms;
- }
- });
- }
- /// <summary>
- /// 调试
- /// </summary>
- /// <exception cref="NotImplementedException"></exception>
- private void CommandRegist()
- {
- #region 炒锅1
- ActionManage.GetInstance.Register(FirePot1_SetFireGear, "FirePot1_SetFireGear");//炒锅1设定加热挡位
- ActionManage.GetInstance.Register(FirePot1_StartFire, "FirePot1_StartFire");//炒锅1加热启动
- ActionManage.GetInstance.Register(FirePot1_StartFire, "FirePot1_StopFire");//炒锅1关闭加热
- ActionManage.GetInstance.Register(FirePot1_SetStirGear, "FirePot1_SetStirGear");//炒锅1设定搅拌挡位
- ActionManage.GetInstance.Register(FirePot1_StartStir, "FirePot1_StartStir");//炒锅1搅拌启动
- ActionManage.GetInstance.Register(FirePot1_StartStir, "FirePot1_StopStir");//炒锅1搅拌停止
- ActionManage.GetInstance.Register(FirePot1_SetTurnSpeed, "FirePot1_SetTurnSpeed");//炒锅1翻转频率设定
- #endregion
- #region 炒锅2
- ActionManage.GetInstance.Register(FirePot2_SetFireGear, "FirePot2_SetFireGear");//炒锅2设定加热挡位
- ActionManage.GetInstance.Register(FirePot2_StartFire, "FirePot2_StartFire");//炒锅2加热启动
- ActionManage.GetInstance.Register(FirePot2_StartFire, "FirePot2_StopFire");//炒锅2关闭加热
- ActionManage.GetInstance.Register(FirePot2_SetStirGear, "FirePot2_SetStirGear");//炒锅2设定搅拌挡位
- ActionManage.GetInstance.Register(FirePot2_StartStir, "FirePot2_StartStir");//炒锅2搅拌启动
- ActionManage.GetInstance.Register(FirePot2_StartStir, "FirePot2_StopStir");//炒锅2搅拌停止
- ActionManage.GetInstance.Register(FirePot2_SetTurnSpeed, "FirePot2_SetTurnSpeed");//炒锅2翻转频率设定
- #endregion
- #region 炒锅通用
- ActionManage.GetInstance.Register(FirePot_Reset, "FirePot_Reset");//复位;
- ActionManage.GetInstance.Register(FirePot_PotGotoOrigin, "FirePot_PotGotoOrigin");//炒锅回原点
- ActionManage.GetInstance.Register(FirePot_PotGotoP1, "FirePot_PotGotoP1");//炒锅去位置1
- ActionManage.GetInstance.Register(FirePot_PotGotoP2, "FirePot_PotGotoP2");//炒锅去位置2
- ActionManage.GetInstance.Register(FirePot_PotGotoP3, "FirePot_PotGotoP3");//炒锅去位置3
- ActionManage.GetInstance.Register(FirePot_PotGotoP4, "FirePot_PotGotoP4");//炒锅去位置4
- ActionManage.GetInstance.Register(FirePot_PotGotoOutFoodPositiong, "FirePot_PotGotoOutFoodPositiong");//炒锅去出餐位置
- ActionManage.GetInstance.Register(FirePot_PotGotoInFoodPosition, "FirePot_PotGotoInFoodPosition");//炒锅去投料位置
- ActionManage.GetInstance.Register(FirePot_StartOutFood, "FirePot_StartOutFood");//出餐启动
- ActionManage.GetInstance.Register(FirePot_Clean, "FirePot_Clean");//清洗
- ActionManage.GetInstance.Register(FirePot_StartPumpWater, "FirePot_StartPumpWater");//抽水启动
- ActionManage.GetInstance.Register(FirePot_StartPumpOil, "FirePot_StartPumpOil");//抽油启动
- #endregion
- #region 机器人
- ActionManage.GetInstance.Register(RobotStart, "RobotStart");//机器人启动
- ActionManage.GetInstance.Register(RobotStop, "RobotStop");//机器人停止
- ActionManage.GetInstance.Register(RobotReset, "RobotReset");//复位
- ActionManage.GetInstance.Register(RobotProgramStart, "RobotProgramStart");//程序启动
- ActionManage.GetInstance.Register(Robot_Pot1AllowInMaterail, "Robot_Pot1AllowInMaterail");//1号炒锅允许机器人投料
- ActionManage.GetInstance.Register(Robot_Pot1OutFoodInSlowDown, "Robot_Pot1OutFoodInSlowDown");//1号炒锅出餐倒料到减速位
- ActionManage.GetInstance.Register(Robot_Pot1OutFood, "Robot_Pot1OutFoodInSlowDown");//1号炒锅出餐倒料完成
- ActionManage.GetInstance.Register(Robot_Pot2AllowInMaterail, "Robot_Pot2AllowInMaterail");//2号炒锅允许机器人投料
- ActionManage.GetInstance.Register(Robot_Pot2OutFoodInSlowDown, "Robot_Pot2OutFoodInSlowDown");//2号炒锅出餐倒料到减速位
- ActionManage.GetInstance.Register(Robot_Pot2OutFood, "Robot_Pot2OutFood");//2号炒锅出餐倒料完成
- ActionManage.GetInstance.Register(RobotActionStart, "Robot_Pot2OutFood");//2号炒锅出餐倒料完成
-
-
- #endregion
-
- }
-
- public override void MainTask()
- {
- }
-
- private void FirePot1_Process()
- {
-
- }
-
- private void FirePot2_Process()
- {
-
- }
-
- public override void ReadData()
- {
- GetStatus("M20.0",new Action<object>((o)=>
- {
- if (o == null) return;
- if(o is bool[] values&&values.Length == 19)
- {
- morkBF.FirePot1_InitCompleted = values[0];
- morkBF.FirePot1_IsAuto = values[1];
- morkBF.FirePot1_Emergencystop = values[2];
- morkBF.FirePot1_MealTubExist = values[3];
- morkBF.FirePot1_VegetablesTub1Exist = values[4];
- morkBF.FirePot1_VegetablesTub2Exist = values[5];
- morkBF.FirePot1_Seasoning1Exist = values[6];
- morkBF.FirePot1_Seasoning2Exist = values[7];
- morkBF.FirePot1_Accessories1Exist = values[8];
- morkBF.FirePot1_Accessories2Exist = values[9];
- morkBF.FirePot1_OutFoodTubExist = values[10];
- morkBF.FirePot1_OnOrigin = values[11];
- morkBF.FirePot1_FirePosition1 = values[12];
- morkBF.FirePot1_FirePosition2 = values[13];
- morkBF.FirePot1_FirePosition3 = values[14];
- morkBF.FirePot1_FirePosition4 = values[15];
- morkBF.FirePot1_PotOnOutFoodPosition = values[16];
- morkBF.FirePot1_PotOnIntoFoodPosition = values[17];
- morkBF.FirePot1_PotOnCleanPosition = values[18];
-
- }
- }),0);
-
- GetStatus("VW120", new Action<object>((o) =>
- {
- if (o == null) return;
- if (o is int[] values&&values.Length == 2)
- {
- morkBF.FirePot1_Temperature = values[0];
- morkBF.FirePot1_Pulse = values[1];
-
- }
- }), 0);
-
- GetStatus("M25.0", new Action<object>((o) =>
- {
- if (o == null) return;
- if (o is bool[] values&& values.Length == 19)
- {
- morkBF.FirePot2_InitCompleted = values[0];
- morkBF.FirePot2_IsAuto = values[1];
- morkBF.FirePot2_Emergencystop = values[2];
- morkBF.FirePot2_MealTubExist = values[3];
- morkBF.FirePot2_VegetablesTub1Exist = values[4];
- morkBF.FirePot2_VegetablesTub2Exist = values[5];
- morkBF.FirePot2_Seasoning1Exist = values[6];
- morkBF.FirePot2_Seasoning2Exist = values[7];
- morkBF.FirePot2_Accessories1Exist = values[8];
- morkBF.FirePot2_Accessories2Exist = values[9];
- morkBF.FirePot2_OutFoodTubExist = values[10];
- morkBF.FirePot2_OnOrigin = values[11];
- morkBF.FirePot2_FirePosition1 = values[12];
- morkBF.FirePot2_FirePosition2 = values[13];
- morkBF.FirePot2_FirePosition3 = values[14];
- morkBF.FirePot2_FirePosition4 = values[15];
- morkBF.FirePot2_PotOnOutFoodPosition = values[16];
- morkBF.FirePot2_PotOnIntoFoodPosition = values[17];
- morkBF.FirePot2_PotOnCleanPosition = values[18];
-
- }
- }), 0);
-
- GetStatus("VW150", new Action<object>((o) =>
- {
- if (o == null) return;
- if (o is int[] values&& values.Length == 2)
- {
- morkBF.FirePot2_Temperature = values[0];
- morkBF.FirePot2_Pulse = values[1];
-
- }
- }), 0);
- GetStatus("GM500", new Action<object>((o) =>
- {
- if (o == null) return;
- if (o is bool[] values && values.Length == 7)
- {
- morkBF.Robot_FirePot1OutMeal = values[0];
- morkBF.Robot_FirePot1OutVegetables1 = values[1];
- morkBF.Robot_FirePot1OutVegetables2 = values[2];
- morkBF.Robot_FirePot1OutSeasoning = values[3];
- morkBF.Robot_FirePot1OutAccessories = values[4];
- morkBF.Robot_ArriveFirePot1 = values[5];
- morkBF.Robot_FirePot1OutFoodComplete = values[6];
-
- }
- }), 1);
- GetStatus("GM510", new Action<object>((o) =>
- {
- if (o == null) return;
- if (o is bool[] values && values.Length == 7)
- {
- morkBF.Robot_FirePot2OutMeal = values[0];
- morkBF.Robot_FirePot2OutVegetables1 = values[1];
- morkBF.Robot_FirePot2OutVegetables2 = values[2];
- morkBF.Robot_FirePot2OutSeasoning = values[3];
- morkBF.Robot_FirePot2OutAccessories = values[4];
- morkBF.Robot_ArriveFirePot2 = values[5];
- morkBF.Robot_FirePot2OutFoodComplete = values[6];
-
- }
- }), 1);
- GetStatus("GI5", new Action<object>((o) =>
- {
- if (o == null) return;
- if (o is int[] values && values.Length == 1)
- {
- morkBF.Robot_ActionCallback = values[0];
- }
- }), 1);
-
- }
-
- public override void ResetProgram()
- {
- morkBF = null;
- morkBF = new GVL_MorkBF();
- }
-
- public override void SimOrder()
- {
-
- }
-
- public override void Stop()
- {
-
- }
-
- /// <summary>
- /// 获取炒锅PLC的所有状态
- /// </summary>
- /// <param name="key"></param>
- /// <param name="action"></param>
- /// <param name="num">炒锅编号</param>
- private void GetStatus(string key, Action<object> action, int num)
- {
- if (dicPort2peripheralStatus.ContainsKey(num))
- {
- if (dicPort2peripheralStatus[num].ContainsKey(key))
- {
- action((object)dicPort2peripheralStatus[num][key]);//获取PLC指定地址的状态值
- }
- }
- }
-
- #region 控制
- private void FirePot_Write(string address, object value, int i = 0)
- {
- WriteControlExact(address, value, i);
- }
- private void Robot_Write(string address, object value, int i = 1)
- {
- WriteControlExact(address, value, i);
- }
- #region 炒锅1
-
- /// <summary>
- /// 炒锅1设定加热挡位
- /// </summary>
- /// <param name="o"></param>
- private void FirePot1_SetFireGear(object o)
- {
- if (o == null) return;
- if (o is int value)
- {
- FirePot_Write("VW100", value);
- }
-
- }
- /// <summary>
- /// 炒锅1加热启停
- /// </summary>
- /// <param name="b"></param>
- private void FirePot1_StartFire(object o)
- {
- if (o == null) return;
- if (o is bool value)
- {
- FirePot_Write("M10.0", value);
- }
- }
- /// <summary>
- /// 炒锅1设置搅拌挡位
- /// </summary>
- /// <param name="o"></param>
- private void FirePot1_SetStirGear(object o)
- {
- if (o == null) return;
- if (o is int value)
- {
- FirePot_Write("VW102", value);
- }
- }
- /// <summary>
- /// 炒锅1搅拌启停
- /// </summary>
- /// <param name="o"></param>
- private void FirePot1_StartStir(object o)
- {
- if (o == null) return;
- if (o is bool value)
- {
- FirePot_Write("M10.1", value);
- }
- }
- /// <summary>
- /// 设置炒锅1翻转速度
- /// </summary>
- /// <param name="o"></param>
- private void FirePot1_SetTurnSpeed(object o)
- {
- if (o == null) return;
- if (o is int value)
- {
- FirePot_Write("VW104", value);
- }
- }
- #endregion
-
- #region 炒锅2
- /// <summary>
- /// 炒锅2设定加热挡位
- /// </summary>
- /// <param name="o"></param>
- private void FirePot2_SetFireGear(object o)
- {
- if (o == null) return;
- if (o is int value)
- {
- FirePot_Write("VW130", value);
- }
-
- }
- /// <summary>
- /// 炒锅2加热启停
- /// </summary>
- /// <param name="b"></param>
- private void FirePot2_StartFire(object o)
- {
- if (o == null) return;
- if (o is bool value)
- {
- FirePot_Write("M15.0", value);
- }
- }
- /// <summary>
- /// 炒锅2设置搅拌挡位
- /// </summary>
- /// <param name="o"></param>
- private void FirePot2_SetStirGear(object o)
- {
- if (o == null) return;
- if (o is int value)
- {
- FirePot_Write("VW132", value);
- }
- }
- /// <summary>
- /// 炒锅2搅拌启停
- /// </summary>
- /// <param name="o"></param>
- private void FirePot2_StartStir(object o)
- {
- if (o == null) return;
- if (o is bool value)
- {
- FirePot_Write("M15.1", value);
- }
- }
- /// <summary>
- /// 设置炒锅2翻转速度
- /// </summary>
- /// <param name="o"></param>
- private void FirePot2_SetTurnSpeed(object o)
- {
- if (o == null) return;
- if (o is int value)
- {
- FirePot_Write("VW134", value);
- }
- }
-
- #endregion
-
- #region 炒锅通用
- /// <summary>
- /// 炒锅复位
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_Reset(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
-
- }
- else if (i == 2)
- {
-
- }
- }
-
-
- }
- /// <summary>
- /// 炒锅回原点
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoOrigin(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M10.5", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M15.5", true);
- }
- }
- }
- /// <summary>
- /// 炒锅去位置1
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoP1(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.2", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.2", true);
- }
- }
- }
- /// <summary>
- /// 炒锅去位置2
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoP2(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.3", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.3", true);
- }
- }
- }
- /// <summary>
- /// 炒锅去位置3
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoP3(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.4", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.4", true);
- }
- }
- }
- /// <summary>
- /// 炒锅去位置4
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoP4(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.5", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.5", true);
- }
- }
- }
- /// <summary>
- /// 炒锅去出餐位置
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoOutFoodPositiong(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.6", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.6", true);
- }
- }
- }
- /// <summary>
- /// 炒锅去投料位置
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_PotGotoInFoodPosition(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.7", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.7", true);
- }
- }
- }
- /// <summary>
- /// 出餐启动
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_StartOutFood(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M10.6", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M15.6", true);
- }
-
- }
- }
- /// <summary>
- /// 清洗
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_Clean(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M10.7", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M15.7", true);
- }
- }
- }
- /// <summary>
- /// 抽水启动
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_StartPumpWater(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M11.0", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.0", true);
- }
- }
- }
- /// <summary>
- /// 抽油启动
- /// </summary>
- /// <param name="o"></param>
- private void FirePot_StartPumpOil(object o)
- {
- if (o == null) return;
- if (o is int i)
- {
- if (i == 1)
- {
- FirePot_Write("M16.0", true);
- }
- else if (i == 2)
- {
- FirePot_Write("M16.1", true);
- }
- }
- }
- #endregion
-
- #region 机器人
- /// <summary>
- /// 机器人启动
- /// </summary>
- private void RobotStart()
- {
- Robot_Write("GM600",true);
- }
- /// <summary>
- /// 机器人停止
- /// </summary>
- private void RobotStop()
- {
- Robot_Write("GM601", true);
- }
- /// <summary>
- /// 机器人复位
- /// </summary>
- private void RobotReset()
- {
- Robot_Write("GM602", true);
- }
- /// <summary>
- /// 机器人程序重启
- /// </summary>
- private void RobotProgramStart()
- {
- Robot_Write("GM603", true);
- }
- /// <summary>
- /// 1号炒锅允许机器人投料(炒锅在投料位给出)
- /// </summary>
- private void Robot_Pot1AllowInMaterail()
- {
- Robot_Write("GM520", true);
- }
- /// <summary>
- /// 1号炒锅出餐倒料到减速位
- /// </summary>
- private void Robot_Pot1OutFoodInSlowDown()
- {
- Robot_Write("GM621", true);
- }
- /// <summary>
- /// 1号炒锅出餐倒料完成
- /// </summary>
- private void Robot_Pot1OutFood()
- {
- Robot_Write("GM522", true);
- }
- /// <summary>
- /// 2号炒锅允许机器人投料(炒锅在投料位给出)
- /// </summary>
- private void Robot_Pot2AllowInMaterail()
- {
- Robot_Write("GM530", true);
- }
- /// <summary>
- /// 2号炒锅出餐倒料到减速位。开始倒菜
- /// </summary>
- private void Robot_Pot2OutFoodInSlowDown()
- {
- Robot_Write("GM531", true);
- }
- /// <summary>
- /// 2号炒锅出餐倒料完成
- /// </summary>
- private void Robot_Pot2OutFood()
- {
- Robot_Write("GM532", true);
- }
- /// <summary>
- ///
- /// </summary>
- private void RobotActionStart(object o)
- {
- if (o == null) return;
- if(o is int value)
- {
- Robot_Write("GI0",value);
- }
- }
- #endregion
-
-
-
- #endregion
-
-
- private void ScreenDataServer()
- {
- LocalMqtt.GetInstance.Init(ScreenDeviceType.大炒);
- ThreadManage.GetInstance().StartLong(new Action(() =>
- {
- List<StatsModel> statsModels = new List<StatsModel>();
- statsModels.Add(new StatsModel() { Name = "帝王蟹", Count = 666 });
- ScreenModelMaxWok maxWok = new ScreenModelMaxWok
- {
- IsRun = new Random().Next(0, 2) == 0 ? IsRun.运行 : IsRun.停止,
- WorkStatus_1 = (WorkStatus)new Random().Next(0, 3),
- WorkStatus_2 = (WorkStatus)new Random().Next(0, 3),
- RobotStatu = (WorkStatus)new Random().Next(0, 3),
- Alarm = new List<AlarmModel>(),
- FailuresCount = 0,
- StatsCount = statsModels,
- MaxWok_Dishes_1 = "满汉全席",
- MaxWok_Dishes_2 = "海鲜大餐",
- MaxWok_Task_1 = "炒制菜品",
- MaxWok_Task_2 = "热油",
- MaxWok_Process_1 = new List<ProcessModel>(),
- MaxWok_HeatGear_1 = new Random().Next(0, 5).ToString(),
- MaxWok_HeatGear_2 = new Random().Next(0, 5).ToString(),
- MaxWok_StirGear_1 = new Random().Next(0, 5).ToString(),
- MaxWok_StirGear_2 = new Random().Next(0, 5).ToString(),
- MaxWok_FlipSpeed_1 = new Random().Next(250, 450).ToString(),
- MaxWok_FlipSpeed_2 = new Random().Next(250, 450).ToString(),
- MaxWok_Temp_1 = new Random().Next(250, 450).ToString(),
- MaxWok_Temp_2 = new Random().Next(250, 450).ToString(),
- MaxWok_OrderCount_1 = 2,
- MaxWok_OrderCount_2 = 2,
- MaxWok_ErrorOrderCount_1 = 0,
- MaxWok_ErrorOrderCount_2 = 0,
-
- };
- LocalMqtt.GetInstance.Publish(maxWok);
- Thread.Sleep(1000);
-
- }), "大屏数据上报");
-
- }
- }
- }
|