itachilee 2 years ago
parent
commit
6a7be9ef89
3 changed files with 39 additions and 10 deletions
  1. +1
    -1
      HBLConsole.Business/HeartbeatReport.cs
  2. +30
    -9
      HBLConsole.Business/IotReport.cs
  3. +8
    -0
      HBLConsole/ViewModel/VariableMonitorViewModel.cs

+ 1
- 1
HBLConsole.Business/HeartbeatReport.cs View File

@@ -46,7 +46,7 @@ namespace HBLConsole.Business
MessagePackage.Timestamp = DateTime.Now;
MessagePackage.Message = deviceStatus;//GetMessage == null ? deviceStatus : GetMessage();
MqttHelper.GetInstance.MqttPublishAsync(Topic, MessagePackage.Serialize());
//IotReport.GetInstance.SendTargetMessage();
IotReport.GetInstance.SendTargetMessage();
Thread.Sleep(1000);
}), "设备心跳上报", true);



+ 30
- 9
HBLConsole.Business/IotReport.cs
File diff suppressed because it is too large
View File


+ 8
- 0
HBLConsole/ViewModel/VariableMonitorViewModel.cs View File

@@ -10,6 +10,8 @@ using HBLConsole.Attributes;
using System.Reflection;
using HBLConsole.Service;
using System.Threading;
using HBLConsole.Business;
using BPA.Message.IOT;

namespace HBLConsole.ViewModel
{
@@ -169,6 +171,8 @@ namespace HBLConsole.ViewModel

}
}
IotReport.GetInstance.SendNodeStatusMessage(Tools.JsonConvertTools(new IOTNode { data = VariableMonitors }));
Thread.Sleep(1000);
}), "变量监控");
}
@@ -177,4 +181,8 @@ namespace HBLConsole.ViewModel
public static ObservableCollection<VariableMonitor> VariableMonitors { get; set; } = new ObservableCollection<VariableMonitor>();

}
public class IOTNode
{
public ObservableCollection<VariableMonitor> data { get; set; }
}
}

Loading…
Cancel
Save