|
|
@@ -37,6 +37,7 @@ namespace BPASmartClient |
|
|
|
/// </summary> |
|
|
|
public partial class MainWindow : Window |
|
|
|
{ |
|
|
|
public MainConsole mainConsole; |
|
|
|
public MainWindow() |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
@@ -67,7 +68,8 @@ namespace BPASmartClient |
|
|
|
|
|
|
|
ThreadManage.GetInstance().Start(new Action(() => |
|
|
|
{ |
|
|
|
new MainConsole().Start(); |
|
|
|
mainConsole = new MainConsole(); |
|
|
|
mainConsole.Start(); |
|
|
|
GetDevices(); |
|
|
|
}), "启动主控制台", false); |
|
|
|
|
|
|
@@ -82,10 +84,51 @@ namespace BPASmartClient |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowEx(ex.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
}), "启动主IoT", false); |
|
|
|
|
|
|
|
|
|
|
|
ActionManage.GetInstance.Register(new Action<object>((o) => |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
if (o is IOTCommandModel iot) |
|
|
|
{ |
|
|
|
switch (iot.CommandName) |
|
|
|
{ |
|
|
|
case 0://控制类 |
|
|
|
if (iot.CommandValue != null && iot.CommandValue.Count>0) |
|
|
|
{ |
|
|
|
switch (iot.CommandValue.Keys.ToList()[0]) |
|
|
|
{ |
|
|
|
case "程序启动": |
|
|
|
//mainConsole.Start(); |
|
|
|
break; |
|
|
|
//mainConsole.Stop(); |
|
|
|
case "程序停止": |
|
|
|
break; |
|
|
|
case "程序复位": |
|
|
|
//mainConsole.Stop(); |
|
|
|
//mainConsole.Start(); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, MainViewModel.GetInstance().window, "大屏控制", iot.CommandValue.Keys.ToList()[0]); |
|
|
|
} |
|
|
|
break; |
|
|
|
case 1://设置类 |
|
|
|
break; |
|
|
|
case 2://通知类 |
|
|
|
if (iot.CommandValue != null && iot.CommandValue.ContainsKey("text")) |
|
|
|
{ |
|
|
|
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, MainViewModel.GetInstance().window, "大屏通知", iot.CommandValue["text"]); |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
})); |
|
|
|
}), "IotBroadcast"); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 获取设备集合 |
|
|
|