@@ -228,6 +228,7 @@ namespace BPASmartClient.DRCoffee | |||||
MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | MessageLog.GetInstance.ShowEx($"BPASmartClient.DRCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | ||||
} | } | ||||
}); | }); | ||||
InitStatus(); | |||||
} | } | ||||
} | } | ||||
@@ -60,6 +60,7 @@ namespace BPASmartClient.Device | |||||
{ | { | ||||
p.DeviceId = this.DeviceId; | p.DeviceId = this.DeviceId; | ||||
p.Init(); | p.Init(); | ||||
}); | }); | ||||
this.peripherals = peripherals; | this.peripherals = peripherals; | ||||
} | } | ||||
@@ -73,6 +74,7 @@ namespace BPASmartClient.Device | |||||
foreach (var key in peripheral.GetAllStatus().Keys) | foreach (var key in peripheral.GetAllStatus().Keys) | ||||
{ | { | ||||
peripheralStatus[key] = peripheral.GetAllStatus()[key]; | peripheralStatus[key] = peripheral.GetAllStatus()[key]; | ||||
Status.Update(key, peripheral.GetAllStatus()[key]); | |||||
} | } | ||||
} | } | ||||
Thread.Sleep(100); | Thread.Sleep(100); | ||||
@@ -329,6 +329,7 @@ namespace BPASmartClient.GSIceCream | |||||
MessageLog.GetInstance.ShowEx($"BPASmartClient.GSIceCream 中引发错误,IceCreamMachine 类,描述:[{ex.Message}]"); | MessageLog.GetInstance.ShowEx($"BPASmartClient.GSIceCream 中引发错误,IceCreamMachine 类,描述:[{ex.Message}]"); | ||||
} | } | ||||
}); | }); | ||||
InitStatus(); | |||||
} | } | ||||
} | } | ||||
@@ -139,7 +139,12 @@ namespace BPASmartClient.IoT | |||||
List<object> dataVNode = new List<object>(); | List<object> dataVNode = new List<object>(); | ||||
Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.ForEach(device => | Plugin.GetInstance()?.GetPlugin<DeviceMgr>()?.GetDevices()?.ForEach(device => | ||||
{ | { | ||||
var obj=new | |||||
Dictionary<string, object> keys=new Dictionary<string, object>(); | |||||
keys["电机"] = "正常"; | |||||
keys["电机"] = "正常"; | |||||
keys["电机"] = "正常"; | |||||
keys["电机"] = "正常"; | |||||
var obj =new | |||||
{ | { | ||||
DeviceId=device.DeviceId, | DeviceId=device.DeviceId, | ||||
Name=device.Name, | Name=device.Name, | ||||
@@ -151,11 +156,10 @@ namespace BPASmartClient.IoT | |||||
Status = device.Status.GetStatus(), | Status = device.Status.GetStatus(), | ||||
}; | }; | ||||
dataVNode.Add(obj); | dataVNode.Add(obj); | ||||
dataVNode.Add(obj); dataVNode.Add(obj); dataVNode.Add(obj); dataVNode.Add(obj); dataVNode.Add(obj); dataVNode.Add(obj); dataVNode.Add(obj); | |||||
}); | }); | ||||
if (dataVNode.Count > 0) | if (dataVNode.Count > 0) | ||||
{ | { | ||||
iOTDevSXModel.KZSX = Tools.JsonConvertTools<DevSX>(new DevSX { data = new List<DevSXBase> { new DevSXBase { SXMC = "", SXLX = "" } } }); | |||||
iOTDevSXModel.JBSX = Tools.JsonConvertTools<DevSX>(new DevSX { data = new List<DevSXBase> { new DevSXBase { SXMC = "", SXLX = "" } } }); | |||||
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()); | ||||
} | } | ||||
@@ -283,6 +283,7 @@ namespace BPASmartClient.KLMCoffee | |||||
MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | MessageLog.GetInstance.ShowEx($"BPASmartClient.KLMCoffee 中引发错误,CoffeeMachine 类,描述:[{ex.Message}]"); | ||||
} | } | ||||
}); | }); | ||||
InitStatus(); | |||||
} | } | ||||
@@ -238,6 +238,7 @@ namespace BPASmartClient.Lebai | |||||
public override void Start() | public override void Start() | ||||
{ | { | ||||
Connect(IpAddress); | Connect(IpAddress); | ||||
} | } | ||||
public override void Stop() | public override void Stop() | ||||
@@ -250,6 +251,7 @@ namespace BPASmartClient.Lebai | |||||
{ | { | ||||
}); | }); | ||||
InitStatus(); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -377,7 +377,7 @@ namespace BPASmartClient.SCChip | |||||
MessageLog.GetInstance.ShowEx($"BPASmartClient.SCChip 中引发错误,ICChipMachine 类,描述:[{ex.Message}]"); | MessageLog.GetInstance.ShowEx($"BPASmartClient.SCChip 中引发错误,ICChipMachine 类,描述:[{ex.Message}]"); | ||||
} | } | ||||
}); | }); | ||||
InitStatus(); | |||||
} | } | ||||
} | } | ||||
@@ -22,7 +22,7 @@ namespace BPASmartClient.ViewModel | |||||
/// </summary> | /// </summary> | ||||
public class LogViewModel :ObservableObject | public class LogViewModel :ObservableObject | ||||
{ | { | ||||
public DispatcherTimer dispatcherTimer; | |||||
//public DispatcherTimer dispatcherTimer; | |||||
public string ClientId= System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | public string ClientId= System.Configuration.ConfigurationManager.AppSettings["ClientId"].ToString(); | ||||
private ObservableCollection<LogModel> _LogModels; | private ObservableCollection<LogModel> _LogModels; | ||||
public ObservableCollection<LogModel> LogDataGrid | public ObservableCollection<LogModel> LogDataGrid | ||||
@@ -63,7 +63,7 @@ namespace BPASmartClient.ViewModel | |||||
LogTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), | LogTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), | ||||
LogType = "严重", | LogType = "严重", | ||||
LogMessage = s, | LogMessage = s, | ||||
LogVla = "错误日志", | |||||
LogVla = "错误日志" | |||||
}); | }); | ||||
})); | })); | ||||
}); | }); | ||||
@@ -71,16 +71,6 @@ namespace BPASmartClient.ViewModel | |||||
{ | { | ||||
ExcellOrder(); | ExcellOrder(); | ||||
}); | }); | ||||
//dispatcherTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };//1秒一流转 | |||||
//dispatcherTimer.Tick += delegate | |||||
//{ | |||||
// if (TimedClear) | |||||
// { | |||||
// } | |||||
//}; | |||||
//dispatcherTimer.Start(); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -129,6 +119,7 @@ namespace BPASmartClient.ViewModel | |||||
System.Windows.MessageBox.Show("无数据!"); | System.Windows.MessageBox.Show("无数据!"); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 打开指定路径下文件,比如:Word、Excel、Dll、图片等都可以(前提是你已经安装打开程序的对应软件) | /// 打开指定路径下文件,比如:Word、Excel、Dll、图片等都可以(前提是你已经安装打开程序的对应软件) | ||||
/// </summary> | /// </summary> | ||||