Преглед на файлове

Morks数据上报模型搭建

样式分支
pry преди 2 години
родител
ревизия
fc2bf12324
променени са 3 файла, в които са добавени 68 реда и са изтрити 0 реда
  1. +21
    -0
      BPASmartClient.Model/OrderStatistics.cs
  2. +2
    -0
      BPASmartClient.MorkS/Control_Morks.cs
  3. +45
    -0
      BPASmartClient.MorkS/DataServer.cs

+ 21
- 0
BPASmartClient.Model/OrderStatistics.cs Целия файл

@@ -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; }
}
}

+ 2
- 0
BPASmartClient.MorkS/Control_Morks.cs Целия файл

@@ -273,6 +273,8 @@ namespace BPASmartClient.MorkS
if (order.MorkOrder.GoodBatchings == null) return;
if (mORKS.HistorySuborderId.Contains(order.MorkOrder.SuborderId)) return;
OrderCount++;
Json<OrderStatistics>.Data.StatisticsTime=DateTime.Now;
Json<OrderStatistics>.Data.Count++;
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT);
DeviceProcessLogShow($"接收到{OrderCount}次订单,订单ID:{order.MorkOrder.SuborderId}");
mORKS.HistorySuborderId.Add(order.MorkOrder.SuborderId);


+ 45
- 0
BPASmartClient.MorkS/DataServer.cs Целия файл

@@ -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个煮面炉上或下)
//温度状态(煮面炉温度是否到达)
//料仓位置(当前料仓在几号位置)
//料仓上下物料检测
//落碗机构缺碗检测
//机器人状态
//当日订单总量
//报警信息
}
}

Зареждане…
Отказ
Запис