From 08adc9d5e01d7505a76bef4b35163c72096ca9ae Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 3 Dec 2024 15:20:08 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=AE=E6=94=B9=E5=AE=9A?= =?UTF-8?q?=E7=82=B9=E5=B7=A1=E6=A3=80=E5=8F=96=E6=B6=88=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Business/FixedPointBusiness.cs | 41 ++++++++++- SlnMesnac.Config/AppConfig.cs | 5 ++ SlnMesnac.WPF/MainWindow.xaml | 6 +- SlnMesnac.WPF/Page/IndexControl.xaml.cs | 2 + SlnMesnac.WPF/SlnMesnac.WPF.csproj | 2 + SlnMesnac.WPF/Templates/image/logo.png | Bin 0 -> 13958 bytes .../ViewModel/IndexControlViewModel.cs | 64 ++---------------- .../ViewModel/MainWindowViewModel.cs | 16 +++-- SlnMesnac.WPF/appsettings.json | 59 ++++++++-------- 9 files changed, 98 insertions(+), 97 deletions(-) create mode 100644 SlnMesnac.WPF/Templates/image/logo.png diff --git a/SlnMesnac.Business/FixedPointBusiness.cs b/SlnMesnac.Business/FixedPointBusiness.cs index e14cec9..719635e 100644 --- a/SlnMesnac.Business/FixedPointBusiness.cs +++ b/SlnMesnac.Business/FixedPointBusiness.cs @@ -51,10 +51,19 @@ namespace SlnMesnac.Business { Task.Run(() => { + isFlag = true; + Task.Delay(1000).Wait(); base.InitEquip(2); //判断PLC状态,下发工作模式 + if (!isFlag) + { + _log.Info($"定点巡检取消"); + return; + } + + if (!_plc.writeInt32ByAddress("VD1516", 1)) //下发轨道电机启动信号 { throw new ArgumentException($"定点巡检模式启动信号写入PLC失败;VD1516写1"); @@ -63,6 +72,10 @@ namespace SlnMesnac.Business _log.Info($"定点巡检模式启动信号写入PLC成功;VD1516写1"); SendTrackMotorAddress(busbarInfo); + + isFlag = false; + + _log.Info($"定点巡检结束"); }); } catch (Exception ex) @@ -71,8 +84,16 @@ namespace SlnMesnac.Business } } - public void EndFixedPoint(base_busbar_info busbarInfo) + public void EndFixedPoint(base_busbar_info busbarInfo,bool isClose = false) { + + if (isClose) + { + _log.Info($"定点巡检取消"); + isFlag = false; + return; + } + if (busbarInfo.isRotate == 1) { GimbaRotationControlEvent?.Invoke("20", "4", "10"); @@ -83,7 +104,7 @@ namespace SlnMesnac.Business throw new ArgumentException($"定点巡检模式下发检测完成信号写入失败;VD1512写1"); } _log.Info($"定点巡检模式下发检测完成信号写入PLC成功;VD1512写1"); - _log.Info($"定点巡检结束"); + //_log.Info($"定点巡检结束"); } @@ -103,6 +124,11 @@ namespace SlnMesnac.Business this.AwaitArriveSignal("VD1528"); //等待轨道相机到位信号 + if (!isFlag) + { + return; + } + this.SendLiftMotorDict(busbarInfo); } @@ -119,6 +145,11 @@ namespace SlnMesnac.Business bool is_arrive = true; while (is_arrive) { + if (!isFlag) + { + break; + } + int is_arrive_flag = _plc.readInt32ByAddress(signal); //读取PLC轨道电机到位信号 if (is_arrive_flag == 1) { @@ -155,7 +186,6 @@ namespace SlnMesnac.Business private void SendLiftMotorDict(base_busbar_info busbar) { - if (!_plc.writeFloatByAddress("VD1524", ((float)busbar.busbarDist))) //下发母排距离,升降电机升降的距离 { throw new ArgumentException($"下发母排升降距离写入失败;VD1524写{busbar.cabinetCode}"); @@ -164,6 +194,11 @@ namespace SlnMesnac.Business this.AwaitArriveSignal("VD1504"); //等待升降电机到位信号 + if (!isFlag) + { + return; + } + //控制云台旋转 if (busbar.isRotate == 1) { diff --git a/SlnMesnac.Config/AppConfig.cs b/SlnMesnac.Config/AppConfig.cs index 17a4228..6452eb5 100644 --- a/SlnMesnac.Config/AppConfig.cs +++ b/SlnMesnac.Config/AppConfig.cs @@ -36,6 +36,11 @@ namespace SlnMesnac.Config /// 日志文件路径 /// public string logPath { get; set; } + + /// + /// 系统标题 + /// + public string SystemTitleStr { get; set; } /// /// 可见光图像保存路径 diff --git a/SlnMesnac.WPF/MainWindow.xaml b/SlnMesnac.WPF/MainWindow.xaml index d6454cb..eda76a8 100644 --- a/SlnMesnac.WPF/MainWindow.xaml +++ b/SlnMesnac.WPF/MainWindow.xaml @@ -20,7 +20,11 @@ - + + + + + diff --git a/SlnMesnac.WPF/Page/IndexControl.xaml.cs b/SlnMesnac.WPF/Page/IndexControl.xaml.cs index ff59bd0..0f65452 100644 --- a/SlnMesnac.WPF/Page/IndexControl.xaml.cs +++ b/SlnMesnac.WPF/Page/IndexControl.xaml.cs @@ -242,8 +242,10 @@ namespace SlnMesnac.WPF.Page else { btn_fixedmode.Background = new SolidColorBrush(Colors.Transparent); + is_fixed_model = false; + indexControlViewModel.Stop_PointMode(); } } diff --git a/SlnMesnac.WPF/SlnMesnac.WPF.csproj b/SlnMesnac.WPF/SlnMesnac.WPF.csproj index 7e04033..b83cec5 100644 --- a/SlnMesnac.WPF/SlnMesnac.WPF.csproj +++ b/SlnMesnac.WPF/SlnMesnac.WPF.csproj @@ -15,6 +15,7 @@ + @@ -58,6 +59,7 @@ + diff --git a/SlnMesnac.WPF/Templates/image/logo.png b/SlnMesnac.WPF/Templates/image/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..706588acbdec236acd72a1925efce5420bffd401 GIT binary patch literal 13958 zcmbVTWm6msjIK~zi!WB(eQ_xicXwEzcyV_qZi~Ci;_fcR-L;GB;uLqd_wFa$huBOe zU!F`R$s`fVic)CE0OSuJKA_1+i>v-8cm5+*MEL*sn>k+Bf8wLFs??7U)l7$G))xQrPxQS%MMb$k(XFi@rT8r7NakZ2? zx+hD&&Q4sQbs80}zhF87B&+G&%{AAOGJOTE6(|C968a*uSmGc5k~0Ma2a{mIsf)Oo zB9K!BVAjXQ31NQo7QVQC^t({_G)K5O@AyIqOTF&6&+(q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zx4JpcL?{@RECm?GfHkTVD)>u5D;tQLv4SY}UnFde6P@MIqpQ#~*38L1_pwfDzv1=cU@P!jAP$huCye>CKc?sK%hPId8b*u_tCU# z - //{ - // var url = $"{_appConfig.videoFilePath}\\可见光\\{fileName}"; - // CHCNetSDK.NET_DVR_MakeKeyFrame(m_lUserID, 1); - // if (!CHCNetSDK.NET_DVR_SaveRealData(Scenery_RealHandle, url)) - // { - // var str = "可见光通道开启巡检录像失败, error code= " + NET_DVR_GetLastError(); - // _log.Info(str); - // return; - // } - // else - // { - // _log.Info($"可见光通道开启巡检录像成功"); - // } - //}); - - //Task.Run(() => - //{ - // var url = $"{_appConfig.videoFilePath}\\热成像\\{fileName}"; - // CHCNetSDK.NET_DVR_MakeKeyFrame(m_lUserID, 2); - // if (!CHCNetSDK.NET_DVR_SaveRealData(Thermal_RealHandle, url)) - // { - // var str = "热成像通道开启巡检录像失败, error code= " + NET_DVR_GetLastError(); - // _log.Info(str); - // return; - // } - // else - // { - // _log.Info($"热成像通道开启巡检录像成功"); - // } - //}); inspModeBusiness.Start(taskCode, fileName); } @@ -654,37 +623,14 @@ namespace SlnMesnac.WPF.ViewModel /// public void Stop_InspMode() { - //Task.Run(() => - //{ - // if (!CHCNetSDK.NET_DVR_StopSaveRealData(Scenery_RealHandle)) - // { - // var str = "可见光通道关闭巡检录像失败, error code= " + NET_DVR_GetLastError(); - // _log.Info(str); - // return; - // } - // else - // { - // _log.Info($"可见光通道关闭巡检录像成功"); - // } - //}); - - //Task.Run(() => - //{ - // if (!CHCNetSDK.NET_DVR_StopSaveRealData(Thermal_RealHandle)) - // { - // var str = "热成像通道关闭巡检录像失败, error code= " + NET_DVR_GetLastError(); - // _log.Info(str); - // return; - // } - // else - // { - // _log.Info($"热成像通道关闭巡检录像成功"); - // } - //}); - inspModeBusiness.Stop(); } + public void Stop_PointMode() + { + fixedPointBusiness.EndFixedPoint(null,true); + } + private int lastTrackMotorAddress = 0; private void RefreshTrackMotorAddress() { diff --git a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs index e55eb58..1a5f881 100644 --- a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs @@ -2,6 +2,7 @@ using GalaSoft.MvvmLight.Command; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using SlnMesnac.Config; using SlnMesnac.Plc; using SlnMesnac.WPF.Page; using SlnMesnac.WPF.Page.CabinetInfo; @@ -15,6 +16,8 @@ namespace SlnMesnac.WPF.ViewModel { private readonly ILogger _logger; + private readonly AppConfig _appConfig; + //代码生成 private readonly GenerateControl generateControl = new GenerateControl(); @@ -33,13 +36,13 @@ namespace SlnMesnac.WPF.ViewModel set { _PlcStatus = value; RaisePropertyChanged(nameof(PlcStatus)); } } /// - /// 箱壳扫码器状态 + /// 系统标题 /// - private int _ShellScannerStatus = 0; - public int ShellScannerStatus + private string _SystemTitleStr = "智能巡检控制系统"; + public string SystemTitleStr { - get { return _ShellScannerStatus; } - set { _ShellScannerStatus = value; RaisePropertyChanged(nameof(ShellScannerStatus)); } + get { return _SystemTitleStr; } + set { _SystemTitleStr = value; RaisePropertyChanged(nameof(SystemTitleStr)); } } /// @@ -88,6 +91,9 @@ namespace SlnMesnac.WPF.ViewModel _logger = App.ServiceProvider.GetService>(); + _appConfig = App.ServiceProvider.GetService(); + SystemTitleStr = _appConfig.SystemTitleStr; + ControlOnClickCommand = new RelayCommand(obj => ControlOnClick(obj)); FormControlCommand = new RelayCommand(x => FormControl(x)); RefreshPlcStatus(); diff --git a/SlnMesnac.WPF/appsettings.json b/SlnMesnac.WPF/appsettings.json index b3eb2e0..6b88f47 100644 --- a/SlnMesnac.WPF/appsettings.json +++ b/SlnMesnac.WPF/appsettings.json @@ -7,33 +7,34 @@ } }, "AllowedHosts": "*", - "AppConfig": { - "logPath": "D:\\巡检机器人控制系统\\日志信息", - "visibleRangePath": "D:\\智慧热电监控平台\\uploadPath\\日志信息\\可见光图像", - "infraredImagePath": "D:\\智慧热电监控平台\\uploadPath\\日志信息\\红外热成像", - "videoFilePath": "D:\\智慧热电监控平台\\uploadPath\\日志信息\\巡检录像", - "cameraIp": "192.168.2.64", - "cameraPort": 8000, - "cameraUserName": "admin", - "cameraPassword": "haiwei@2024", - "checkCycle": 5, - "SqlConfig": [ - { - "configId": "iot", - "dbType": 0, - "connStr": "Data Source=192.168.2.165;Port=3306;Initial Catalog=iot_smarthotspot;uid=root;pwd=haiwei@123;Charset=utf8mb4;SslMode=none" - } - ], - "PlcConfig": [ - { - "configId": 1, - "plcType": "SiemensPlc", - //"plcIp": "127.0.0.1", - "plcIp": "192.168.2.1", - "plcPort": 102, - "plcKey": "iot", - "isFlage": "true" - } - ] - } + "AppConfig": { + "SystemTitleStr": "赛轮热电智能巡检控制系统", + "logPath": "D:\\巡检机器人控制系统\\日志信息", + "visibleRangePath": "D:\\智慧热电监控平台\\uploadPath\\日志信息\\可见光图像", + "infraredImagePath": "D:\\智慧热电监控平台\\uploadPath\\日志信息\\红外热成像", + "videoFilePath": "D:\\智慧热电监控平台\\uploadPath\\日志信息\\巡检录像", + "cameraIp": "192.168.2.64", + "cameraPort": 8000, + "cameraUserName": "admin", + "cameraPassword": "haiwei@2024", + "checkCycle": 5, + "SqlConfig": [ + { + "configId": "iot", + "dbType": 0, + "connStr": "Data Source=192.168.2.165;Port=3306;Initial Catalog=iot_smarthotspot;uid=root;pwd=haiwei@123;Charset=utf8mb4;SslMode=none" + } + ], + "PlcConfig": [ + { + "configId": 1, + "plcType": "SiemensPlc", + "plcIp": "127.0.0.1", + //"plcIp": "192.168.2.1", + "plcPort": 102, + "plcKey": "iot", + "isFlage": "true" + } + ] + } }