终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataServer.cs 1.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using BPA.Helper;
  8. using BPASmartClient.MQTT;
  9. namespace BPASmartClient.MorkS
  10. {
  11. public class DataServer
  12. {
  13. private volatile static DataServer _Instance;
  14. public static DataServer GetInstance => _Instance ?? (_Instance = new DataServer());
  15. private DataServer() { }
  16. public void Init()
  17. {
  18. MQTTProxy mQTTProxy = new MQTTProxy();
  19. mQTTProxy.Connected = new Action(() =>
  20. {
  21. mQTTProxy.Subscrib("");
  22. ThreadManage.GetInstance().StartLong(new Action(() =>
  23. {
  24. mQTTProxy.Publish("", "");
  25. Thread.Sleep(100);
  26. }), "海科食堂大屏监听");
  27. });
  28. mQTTProxy.Connect("UserName", "Password", "Host", 1883, $"MORKS 设备监听数据{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
  29. }
  30. //订单信息(正在制作,等待制作,制作完成)
  31. //煮面炉上下状态(6个煮面炉上或下)
  32. //温度状态(煮面炉温度是否到达)
  33. //料仓位置(当前料仓在几号位置)
  34. //料仓上下物料检测
  35. //落碗机构缺碗检测
  36. //机器人状态
  37. //当日订单总量
  38. //报警信息
  39. }
  40. }