From fb313fbce00f163a9d44a13117709fa78b46cb14 Mon Sep 17 00:00:00 2001 From: fyf <11621@LAPTOP-04QQU0AO> Date: Fri, 18 Mar 2022 10:02:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HBLConsole.Business/IotReport.cs | 7 ++++++- HBLConsole.MORKS/Control_MORKS.cs | 3 ++- HBLConsole.MainConsole/Main.cs | 2 +- HBLConsole/App.xaml.cs | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/HBLConsole.Business/IotReport.cs b/HBLConsole.Business/IotReport.cs index dae8bd3..e281163 100644 --- a/HBLConsole.Business/IotReport.cs +++ b/HBLConsole.Business/IotReport.cs @@ -44,6 +44,11 @@ namespace HBLConsole.Business /// IControl control; + public void Close() + { + IOTDev.GetInstance().Disconnect(); + } + public T GetTypeValue(string str) { return (T)control.GetT().GetType().GetProperty(str).GetValue(control.GetT(), null); @@ -112,7 +117,7 @@ namespace HBLConsole.Business { ThreadOperate.GetInstance.StartLong(new Action(() => { - if (iSLinks && GeneralConfig.DeviceType.ToString() == "MORKS") + if (iSLinks && GeneralConfig.DeviceType.ToString() == "MO7RKS") { SetData(); IOTDev.GetInstance().IOT_Publish(IOTDev.PubTopic, iOTDevSXModel.Tojson()); diff --git a/HBLConsole.MORKS/Control_MORKS.cs b/HBLConsole.MORKS/Control_MORKS.cs index f2c500b..6995fc3 100644 --- a/HBLConsole.MORKS/Control_MORKS.cs +++ b/HBLConsole.MORKS/Control_MORKS.cs @@ -12,7 +12,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using BPA.Message.Enum; - +using HBLConsole.GVL; namespace HBLConsole.MORKS { @@ -228,6 +228,7 @@ namespace HBLConsole.MORKS ThreadOperate.GetInstance.StartLong(new Action(() => { mORKS.AllowRun = mORKS.InitComplete && !mORKS.TemperatureReached; + GeneralConfig.Healthy = mORKS.AllowRun; TakeBowlTask(); diff --git a/HBLConsole.MainConsole/Main.cs b/HBLConsole.MainConsole/Main.cs index b4be3fb..6f6b001 100644 --- a/HBLConsole.MainConsole/Main.cs +++ b/HBLConsole.MainConsole/Main.cs @@ -51,7 +51,7 @@ namespace HBLConsole.MainConsole { ThreadOperate.GetInstance.Start(new Action(() => { - //InternetInfo.ConfigInit();//从 consul 获取配置数据 + InternetInfo.ConfigInit();//从 consul 获取配置数据 SimpleFactory.GetInstance.DeviceInit();//设备初始化 Topics.Clear(); Topics.Add(TOPIC.GetInstance.GetOrderPushTopic(GeneralConfig.DeviceType, InternetInfo.ClientId)); diff --git a/HBLConsole/App.xaml.cs b/HBLConsole/App.xaml.cs index 570a578..1b3a562 100644 --- a/HBLConsole/App.xaml.cs +++ b/HBLConsole/App.xaml.cs @@ -13,6 +13,7 @@ using HBLConsole.Model; using HBLConsole.MainConsole; using HBLConsole.GVL; using BPA.Message.Enum; +using HBLConsole.Business; namespace HBLConsole { @@ -49,6 +50,7 @@ namespace HBLConsole protected override void OnExit(ExitEventArgs e) { + IotReport.GetInstance.Close(); base.OnExit(e); SqlHelper.GetInstance.Save(); MainConsole.Main.GetInstance.DataSave();