yanjinhui
2025-02-28 9ccc290da5093ec8f3a46cd0206b021e0f3620a1
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/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()