From 97287feb399a4da8646184eb4b9b8e95de05542a Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Tue, 22 Oct 2024 16:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E8=BF=9E=E6=8E=A5"=E5=86=B0=E7=AE=B1?= =?UTF-8?q?=E4=B8=B2=E5=8F=A3=E5=A4=B1=E8=B4=A5"=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/App.xaml.cs | 2 +- DM_Weight/Port/PortUtil.cs | 26 +++++++++++--------- DM_Weight/ViewModels/LoginWindowViewModel.cs | 8 +++--- DM_Weight/Views/LoginWindow.xaml | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs index 8ba205c..59cd61d 100644 --- a/DM_Weight/App.xaml.cs +++ b/DM_Weight/App.xaml.cs @@ -234,7 +234,7 @@ namespace DM_Weight // 调试页面 containerRegistry.RegisterForNavigation(); //主设置页面 - //containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); ////冰箱抽屉设置页面 //containerRegistry.RegisterForNavigation(); diff --git a/DM_Weight/Port/PortUtil.cs b/DM_Weight/Port/PortUtil.cs index 14a6d27..75c9a49 100644 --- a/DM_Weight/Port/PortUtil.cs +++ b/DM_Weight/Port/PortUtil.cs @@ -624,18 +624,20 @@ namespace DM_Weight.Port { logger.Error("条码枪串口打开错误" + e.Message); } - try - { - string FridgePortPath = ConfigurationManager.AppSettings["FridgePortPath"]; - logger.Info($"打开冰箱串口【{FridgePortPath}】"); - fridgeSerial = new SerialPort(FridgePortPath, 9600, Parity.None, 8); - fridgeSerial.Open(); - logger.Info($"冰箱串口打开结果【{fridgeSerial.IsOpen}】"); - } - catch (Exception e) - { - logger.Error("冰箱串口打开错误" + e.Message); - } + #region 湘潭毒麻柜无冰箱 + //try + //{ + // string FridgePortPath = ConfigurationManager.AppSettings["FridgePortPath"]; + // logger.Info($"打开冰箱串口【{FridgePortPath}】"); + // fridgeSerial = new SerialPort(FridgePortPath, 9600, Parity.None, 8); + // fridgeSerial.Open(); + // logger.Info($"冰箱串口打开结果【{fridgeSerial.IsOpen}】"); + //} + //catch (Exception e) + //{ + // logger.Error("冰箱串口打开错误" + e.Message); + //} + #endregion if (_canBusExsit) { try diff --git a/DM_Weight/ViewModels/LoginWindowViewModel.cs b/DM_Weight/ViewModels/LoginWindowViewModel.cs index 9144f2a..c2fa9cd 100644 --- a/DM_Weight/ViewModels/LoginWindowViewModel.cs +++ b/DM_Weight/ViewModels/LoginWindowViewModel.cs @@ -91,10 +91,10 @@ namespace DM_Weight.ViewModels get => _fingerMsg; set => SetProperty(ref _fingerMsg, value); } - public bool FridgePortMsg - { - get => !_portUtil.fridgeSerial.IsOpen; - } + //public bool FridgePortMsg + //{ + // get => !_portUtil.fridgeSerial.IsOpen; + //} //录像机登录状态 private bool _hikMsg; public bool HIKMsg diff --git a/DM_Weight/Views/LoginWindow.xaml b/DM_Weight/Views/LoginWindow.xaml index 000a75f..4fce4ab 100644 --- a/DM_Weight/Views/LoginWindow.xaml +++ b/DM_Weight/Views/LoginWindow.xaml @@ -199,7 +199,7 @@ - +