/*using System; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using RJCP.IO.Ports; using WIDESEA_ISerialPortRepository; using WIDESEA_ISerialPortService; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Model.Models.SerialPort; namespace WIDESEA_SerialPortService { public class SerialPortService : ServiceBase, ISerialPortService { //private SerialPortTestJob _SerialPortTestJob; // 串口服务 public SerialPortService(ISerialPortRepository BaseDal) : base(BaseDal) { //_SerialPortTestJob = new SerialPortTestJob("COM3", this); } public WebResponseContent AddSerialPort(Dt_TorqueOp TorqueOp) { WebResponseContent content = new WebResponseContent(); //BaseDal.Db.Insertable(TorqueOp).ExecuteCommand(); BaseDal.AddData(TorqueOp); content = WebResponseContent.Instance.OK("成功"); return content; } // 启动串口通信 public void StartSerialPortCom() { //WebResponseContent content = new WebResponseContent(); // 打开串口并开始发送数据 //_SerialPortTestJob.OpenSerialPort(); //return content; } // 停止串口通信 public void StopSerialPortCom() { //WebResponseContent content = new WebResponseContent(); //_SerialPortTestJob.CloseSerialPort(); // 关闭串口 // return content; } public List GetSerialPortCom() { //return _serialPortTestService.GetReceivedData(); return null; } } } */