From cd980fcd263828c55bbf20bede0823790e6bec6a Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 27 May 2022 10:02:24 +0800 Subject: [PATCH 1/2] 333 --- .../BPASmartClient.CustomResource.csproj | 11 +- .../Properties/App.xaml | 35 ----- .../Properties/App.xaml.cs | 132 ------------------ 3 files changed, 4 insertions(+), 174 deletions(-) delete mode 100644 BPASmartClient.CustomResource/Properties/App.xaml delete mode 100644 BPASmartClient.CustomResource/Properties/App.xaml.cs diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj index 63cfb701..1fbb2759 100644 --- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj +++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj @@ -7,6 +7,10 @@ true + + + + @@ -171,13 +175,6 @@ - - - $(DefaultXamlRuntime) - MSBuild:Compile - - - diff --git a/BPASmartClient.CustomResource/Properties/App.xaml b/BPASmartClient.CustomResource/Properties/App.xaml deleted file mode 100644 index 5b068fc6..00000000 --- a/BPASmartClient.CustomResource/Properties/App.xaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPASmartClient.CustomResource/Properties/App.xaml.cs b/BPASmartClient.CustomResource/Properties/App.xaml.cs deleted file mode 100644 index b5919965..00000000 --- a/BPASmartClient.CustomResource/Properties/App.xaml.cs +++ /dev/null @@ -1,132 +0,0 @@ -using BPA.Message; -using BPA.Message.Enum; -using BPASmartClient.Helper; -using BPASmartClient.Message; -using BPASmartClient.Model; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Configuration; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Forms; - -namespace BPASmartClient -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : System.Windows.Application - { - protected override void OnStartup(StartupEventArgs e) - { - base.OnStartup(e); - SystemHelper.GetInstance.CreateDesktopShortcut(); - AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - DataRead(); - MainWindow mainView = new MainWindow(); - mainView.Show(); - SplitScreenDisplay(); - NoCompleteOrderInit(); - } - - /// - /// 分屏显示 - /// - private void SplitScreenDisplay() - { - if (Screen.AllScreens.Length == 3) - { - //left = new MORKD_Window_Left(); - //right = new MORKD_Window_Right(); - - //Screen[] screen = Screen.AllScreens; - //Rectangle[] rectangle = new Rectangle[screen.Length]; - //Window[] windows = new Window[screen.Length]; - //windows[0] = mainView; - //windows[1] = left; - //windows[2] = right; - //for (int i = 0; i < screen.Length; i++) - //{ - // rectangle[i] = screen[i].WorkingArea; - // windows[i].Height = rectangle[i].Height; - // windows[i].Width = rectangle[i].Width; - // windows[i].Top = rectangle[i].Top; - // windows[i].Left = rectangle[i].Left; - //} - - //left.Show(); - //right.Show(); - //windows[1].Owner = windows[0]; - //windows[2].Owner = windows[0]; - } - } - - /// - /// 未完成订单初始化 - /// - private void NoCompleteOrderInit() - { - if (Json.Data.orderLists.Count > 0) - { - OrderListDialogView listDialogView = new OrderListDialogView(); - listDialogView.ShowDialog(); - } - } - - private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - var ErroLog = e.ExceptionObject.ToString(); - MessageLog.GetInstance.Show(ErroLog); - TextHelper.GetInstance.WriteTextInfo(ErroLog, "ErroLog"); - DataSave(); - //SqlHelper.GetInstance.Save(); - //MainConsole.Main.GetInstance.DataSave(); - //IotReport.GetInstance.HttpAddLog(new BPA.Message.API请求.LogTable - //{ - // ClientId = InternetInfo.ClientId.ToString(), - // LogTime = DateTime.Now, - // LogType = "1", - // LogMessage = ErroLog, - // LogVla = "异常", - //}); - // Process.Start($"{AppDomain.CurrentDomain.BaseDirectory}{AppDomain.CurrentDomain.FriendlyName}.exe"); - } - - protected override void OnExit(ExitEventArgs e) - { - base.OnExit(e); - DataSave(); - //IotReport.Close(); - //SqlHelper.GetInstance.Save(); - //MainConsole.Main.GetInstance.DataSave(); - ThreadManage.GetInstance().Dispose(); - System.Environment.Exit(0); - - } - - /// - /// 输入保存 - /// - private void DataSave() - { - Json.Save(); - //Sqlite.GetInstance.Save(); - } - - /// - /// 输入读取 - /// - private void DataRead() - { - Json.Read(); - Task.Run(new Action(() => { Sqlite.GetInstance.GetData(); })); - } - - - - } -} From 7138d1c29a4237fec61d8664a4c3e3e6d02f0dcb Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 27 May 2022 10:34:16 +0800 Subject: [PATCH 2/2] 3232 --- BPASmartClient.IoT/DataVClient.cs | 1 + BPASmartClient.IoT/Model/DataVReport.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/BPASmartClient.IoT/DataVClient.cs b/BPASmartClient.IoT/DataVClient.cs index a2354915..b2d6c6b9 100644 --- a/BPASmartClient.IoT/DataVClient.cs +++ b/BPASmartClient.IoT/DataVClient.cs @@ -159,6 +159,7 @@ namespace BPASmartClient.IoT if (DeviceDataV.InitializeNo(ProductKey, DeviceName, DeviceSecret, ref message)) { MessageLog.GetInstance.Show($"客户端:【{ClientId}】,设备名称{DeviceName}阿里云连接成功"); + DeviceDataV.DataVMessageAction += DevIOTActionHandler; UpDataFile(); } else diff --git a/BPASmartClient.IoT/Model/DataVReport.cs b/BPASmartClient.IoT/Model/DataVReport.cs index 560343b7..5fdbb077 100644 --- a/BPASmartClient.IoT/Model/DataVReport.cs +++ b/BPASmartClient.IoT/Model/DataVReport.cs @@ -75,6 +75,9 @@ namespace BPASmartDatavDeviceClient.IoT return false; } IOT_Subscribe(BroadcastTopic);//订阅广播主题 + IOT_Subscribe(FileUpLoadReplyTopic); + IOT_Subscribe(FileUpLoadSendReplyTopic); + IOT_Subscribe(CancelFileUpLoadSendTopic); if (!DatavDeviceClient.IsConnected) message += $"客户端:【】,设备名称{deviceTable.devicename}阿里云连接失败.不能上报业务信息"; return DatavDeviceClient.IsConnected; }