using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.MQTT; using BPA.Message; using BPASmartClient.Model; namespace BPASmartClient.MorkS { public class DataServer { private volatile static DataServer _Instance; public static DataServer GetInstance => _Instance ?? (_Instance = new DataServer()); private DataServer() { } public ScreenModelMorkS morkS { get; set; } = new ScreenModelMorkS(); MQTTProxy mQTTProxy = new MQTTProxy(); public void Init() { mQTTProxy.Connected = new Action(() => { mQTTProxy.Subscrib(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机)); ThreadManage.GetInstance().StartLong(new Action(() => { morkS.MorkS_OrderCount = Json.Data.Count; SendScreenDataModel sendScreenDataModel = new SendScreenDataModel(); sendScreenDataModel.Name = ScreenDeviceType.煮面机; sendScreenDataModel.Value = morkS.ToJSON(); mQTTProxy.Publish(ScreenTOPIC.GetInstance.GetTopic(ScreenDeviceType.煮面机), sendScreenDataModel.ToJSON()); Thread.Sleep(100); }), "海科食堂大屏监听"); }); mQTTProxy.Connect("UserName", "Password", "Host", 1883, $"MORKS 设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); } //订单信息(正在制作,等待制作,制作完成) //煮面炉上下状态(6个煮面炉上或下) //温度状态(煮面炉温度是否到达) //料仓位置(当前料仓在几号位置) //料仓上下物料检测 //落碗机构缺碗检测 //机器人状态 //当日订单总量 //报警信息 } }