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