From 046dcbb07e37dde4423e33c575934afb727e70b1 Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期五, 28 二月 2025 09:50:03 +0800 Subject: [PATCH] 通讯连接 --- 项目代码/WIDESEAWCS_Server 正式/SerialPortService/SerialPortService.cs | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/SerialPortService/SerialPortService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/SerialPortService/SerialPortService.cs" index 7ef37ba..55f5c4e 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/SerialPortService/SerialPortService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/SerialPortService/SerialPortService.cs" @@ -8,6 +8,7 @@ using RJCP.IO.Ports; using WIDESEA_ISerialPortRepository; using WIDESEA_ISerialPortService; +using WIDESEA_SerialPortTestService; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Model.Models.SerialPort; @@ -20,26 +21,22 @@ public SerialPortService(ISerialPortRepository BaseDal) : base(BaseDal) { - _serialPortTestService = new SerialPortTestService("COM3"); + //_serialPortTestService = new SerialPortTestService("COM3"); + // 浼犻�� SerialPortService 鍒� SerialPortTestService + _serialPortTestService = new SerialPortTestService("COM3", this); } public WebResponseContent AddSerialPort(Dt_TorqueOp TorqueOp) { WebResponseContent content = new WebResponseContent(); - BaseDal.Db.Insertable(TorqueOp).ExecuteCommand(); + //BaseDal.Db.Insertable(TorqueOp).ExecuteCommand(); + + BaseDal.AddData(TorqueOp); + + content = WebResponseContent.Instance.OK("鎴愬姛"); return content; } - //// 鍚姩涓插彛閫氫俊 - //public WebResponseContent StartSerialPortCom() - //{ - // WebResponseContent content = new WebResponseContent(); - - // // 鎵撳紑涓插彛骞跺紑濮嬪彂閫佹暟鎹� - // _serialPortTestService.OpenSerialPort(); - - // return content; - //} // 鍚姩涓插彛閫氫俊 public void StartSerialPortCom() -- Gitblit v1.9.3