@@ -0,0 +1,21 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Model | |||||
{ | |||||
public class OrderStatistics | |||||
{ | |||||
/// <summary> | |||||
/// 订单总量 | |||||
/// </summary> | |||||
public int Count { get; set; } | |||||
/// <summary> | |||||
/// 统计时间 | |||||
/// </summary> | |||||
public DateTime StatisticsTime { get; set; } | |||||
} | |||||
} |
@@ -273,6 +273,8 @@ namespace BPASmartClient.MorkS | |||||
if (order.MorkOrder.GoodBatchings == null) return; | if (order.MorkOrder.GoodBatchings == null) return; | ||||
if (mORKS.HistorySuborderId.Contains(order.MorkOrder.SuborderId)) return; | if (mORKS.HistorySuborderId.Contains(order.MorkOrder.SuborderId)) return; | ||||
OrderCount++; | OrderCount++; | ||||
Json<OrderStatistics>.Data.StatisticsTime=DateTime.Now; | |||||
Json<OrderStatistics>.Data.Count++; | |||||
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT); | OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT); | ||||
DeviceProcessLogShow($"接收到{OrderCount}次订单,订单ID:{order.MorkOrder.SuborderId}"); | DeviceProcessLogShow($"接收到{OrderCount}次订单,订单ID:{order.MorkOrder.SuborderId}"); | ||||
mORKS.HistorySuborderId.Add(order.MorkOrder.SuborderId); | mORKS.HistorySuborderId.Add(order.MorkOrder.SuborderId); | ||||
@@ -0,0 +1,45 @@ | |||||
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; | |||||
namespace BPASmartClient.MorkS | |||||
{ | |||||
public class DataServer | |||||
{ | |||||
private volatile static DataServer _Instance; | |||||
public static DataServer GetInstance => _Instance ?? (_Instance = new DataServer()); | |||||
private DataServer() { } | |||||
public void Init() | |||||
{ | |||||
MQTTProxy mQTTProxy = new MQTTProxy(); | |||||
mQTTProxy.Connected = new Action(() => | |||||
{ | |||||
mQTTProxy.Subscrib(""); | |||||
ThreadManage.GetInstance().StartLong(new Action(() => | |||||
{ | |||||
mQTTProxy.Publish("", ""); | |||||
Thread.Sleep(100); | |||||
}), "海科食堂大屏监听"); | |||||
}); | |||||
mQTTProxy.Connect("UserName", "Password", "Host", 1883, $"MORKS 设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); | |||||
} | |||||
//订单信息(正在制作,等待制作,制作完成) | |||||
//煮面炉上下状态(6个煮面炉上或下) | |||||
//温度状态(煮面炉温度是否到达) | |||||
//料仓位置(当前料仓在几号位置) | |||||
//料仓上下物料检测 | |||||
//落碗机构缺碗检测 | |||||
//机器人状态 | |||||
//当日订单总量 | |||||
//报警信息 | |||||
} | |||||
} |