From b8510ca5d1e56ef78cd27c45b6bd65a2c13f6b27 Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期一, 17 三月 2025 15:12:34 +0800 Subject: [PATCH] 代码优化 --- 项目代码/WIDESEAWCS_Server 正式/SerialPortService/SerialPortService.cs | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 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 55f5c4e..ff94dff 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" @@ -1,4 +1,4 @@ -锘縰sing System; +锘�/*using System; using System.Collections.Generic; using System.Data; using System.Diagnostics; @@ -8,22 +8,21 @@ 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; + + namespace WIDESEA_SerialPortService { public class SerialPortService : ServiceBase<Dt_TorqueOp, ISerialPortRepository>, ISerialPortService { - private SerialPortTestService _serialPortTestService; // 涓插彛鏈嶅姟 + //private SerialPortTestJob _SerialPortTestJob; // 涓插彛鏈嶅姟 public SerialPortService(ISerialPortRepository BaseDal) : base(BaseDal) { + //_SerialPortTestJob = new SerialPortTestJob("COM3", this); - //_serialPortTestService = new SerialPortTestService("COM3"); - // 浼犻�� SerialPortService 鍒� SerialPortTestService - _serialPortTestService = new SerialPortTestService("COM3", this); } public WebResponseContent AddSerialPort(Dt_TorqueOp TorqueOp) @@ -32,6 +31,7 @@ //BaseDal.Db.Insertable(TorqueOp).ExecuteCommand(); BaseDal.AddData(TorqueOp); + content = WebResponseContent.Instance.OK("鎴愬姛"); return content; @@ -44,7 +44,7 @@ //WebResponseContent content = new WebResponseContent(); // 鎵撳紑涓插彛骞跺紑濮嬪彂閫佹暟鎹� - _serialPortTestService.OpenSerialPort(); + //_SerialPortTestJob.OpenSerialPort(); //return content; } @@ -55,18 +55,20 @@ public void StopSerialPortCom() { //WebResponseContent content = new WebResponseContent(); - _serialPortTestService.CloseSerialPort(); // 鍏抽棴涓插彛 - //return content; + //_SerialPortTestJob.CloseSerialPort(); // 鍏抽棴涓插彛 + // return content; } public List<string> GetSerialPortCom() { - - return _serialPortTestService.GetReceivedData(); + + //return _serialPortTestService.GetReceivedData(); + return null; } } } +*/ \ No newline at end of file -- Gitblit v1.9.3