|
@@ -41,7 +41,18 @@ namespace BPASmartClient.IoT |
|
|
DeviceSecret = System.Configuration.ConfigurationManager.AppSettings["DeviceSecret"].ToString(); |
|
|
DeviceSecret = System.Configuration.ConfigurationManager.AppSettings["DeviceSecret"].ToString(); |
|
|
StartupMode = System.Configuration.ConfigurationManager.AppSettings["StartupMode"].ToString(); |
|
|
StartupMode = System.Configuration.ConfigurationManager.AppSettings["StartupMode"].ToString(); |
|
|
BroadcastPubTopic = InternetInfo.BroadcastPubTopic; |
|
|
BroadcastPubTopic = InternetInfo.BroadcastPubTopic; |
|
|
BroadcastMaintainPubTopic = $"{InternetInfo.BroadcastPubTopic}Maintain"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//MaintainTable maintainTable = new MaintainTable(); |
|
|
|
|
|
//maintainTable.Id = Guid.NewGuid().ToString(); |
|
|
|
|
|
//maintainTable.MaintainTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
//maintainTable.MaintainType = "一般"; |
|
|
|
|
|
//maintainTable.MaintainVla = "MorkS"; |
|
|
|
|
|
//maintainTable.MaintainMessage = "xxxxx故障需要维修"; |
|
|
|
|
|
//maintainTable.DeviceId = ""; |
|
|
|
|
|
//maintainTable.ClientId = ClientId; |
|
|
|
|
|
//maintainTable.devicename = DeviceDataV.deviceTable.devicename; |
|
|
|
|
|
//maintainTables.Add(maintainTable); |
|
|
} |
|
|
} |
|
|
#endregion |
|
|
#endregion |
|
|
|
|
|
|
|
@@ -51,7 +62,6 @@ namespace BPASmartClient.IoT |
|
|
public string ProductKey { set; get; } |
|
|
public string ProductKey { set; get; } |
|
|
public string DeviceSecret { set; get; } |
|
|
public string DeviceSecret { set; get; } |
|
|
public string BroadcastPubTopic { set; get; } |
|
|
public string BroadcastPubTopic { set; get; } |
|
|
public string BroadcastMaintainPubTopic { set; get; } |
|
|
|
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// DataV 服务地址 |
|
|
/// DataV 服务地址 |
|
|
/// </summary> |
|
|
/// </summary> |
|
@@ -112,18 +122,15 @@ namespace BPASmartClient.IoT |
|
|
{ |
|
|
{ |
|
|
if (DeviceDataV != null && DeviceDataV.GetIsConnected() && DeviceDataV.deviceTable != null) |
|
|
if (DeviceDataV != null && DeviceDataV.GetIsConnected() && DeviceDataV.deviceTable != null) |
|
|
{ |
|
|
{ |
|
|
// AlarmTime = GetPropertyValue(obj, "Time").ToString(), |
|
|
|
|
|
//AlarmType = GetPropertyValue(obj, "Type").ToString(), |
|
|
|
|
|
//AlarmMessage = GetPropertyValue(obj, "Text").ToString(), |
|
|
|
|
|
//AlarmVla = "告警", |
|
|
|
|
|
//DeviceId = Devid.ToString(), |
|
|
|
|
|
//KeyID = id, |
|
|
|
|
|
maintainTable.MaintainTime = DateTime.Now.ToString(); |
|
|
|
|
|
maintainTable.MaintainType = "一般"; |
|
|
|
|
|
maintainTable.MaintainVla = "维修"; |
|
|
|
|
|
|
|
|
maintainTable.Id=Guid.NewGuid().ToString(); |
|
|
|
|
|
//maintainTable.MaintainTime = DateTime.Now.ToString(); |
|
|
|
|
|
//maintainTable.MaintainType = "一般"; |
|
|
|
|
|
//maintainTable.MaintainVla = "MorkS"; |
|
|
|
|
|
//maintainTable.MaintainMessage = "xxxxx故障需要维修"; |
|
|
|
|
|
//maintainTable.DeviceId = ""; |
|
|
maintainTable.ClientId = ClientId; |
|
|
maintainTable.ClientId = ClientId; |
|
|
maintainTable.devicename = DeviceDataV.deviceTable.devicename; |
|
|
maintainTable.devicename = DeviceDataV.deviceTable.devicename; |
|
|
DeviceDataV.IOT_Publish(BroadcastMaintainPubTopic, Tools.JsonConvertTools(maintainTable)); |
|
|
|
|
|
|
|
|
maintainTables.Add(maintainTable); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
@@ -243,7 +250,10 @@ namespace BPASmartClient.IoT |
|
|
}); |
|
|
}); |
|
|
if (dataVNode.Count > 0) |
|
|
if (dataVNode.Count > 0) |
|
|
{ |
|
|
{ |
|
|
iOTDevSXModel.Maintain= Tools.JsonConvertTools(maintainTables); |
|
|
|
|
|
|
|
|
if (maintainTables.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
iOTDevSXModel.Maintain = Tools.JsonConvertTools(maintainTables); |
|
|
|
|
|
} |
|
|
iOTDevSXModel.NodeStatus = Tools.JsonConvertTools(new { data = dataVNode }); |
|
|
iOTDevSXModel.NodeStatus = Tools.JsonConvertTools(new { data = dataVNode }); |
|
|
DeviceDataV.IOT_Publish(DeviceDataV.PubTopic, iOTDevSXModel.Tojson()); |
|
|
DeviceDataV.IOT_Publish(DeviceDataV.PubTopic, iOTDevSXModel.Tojson()); |
|
|
} |
|
|
} |
|
|