| | |
| | | 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) |
| | |
| | | //BaseDal.Db.Insertable(TorqueOp).ExecuteCommand(); |
| | | |
| | | BaseDal.AddData(TorqueOp); |
| | | |
| | | |
| | | content = WebResponseContent.Instance.OK("æå"); |
| | | return content; |
| | |
| | | //WebResponseContent content = new WebResponseContent(); |
| | | |
| | | // æå¼ä¸²å£å¹¶å¼å§åéæ°æ® |
| | | _serialPortTestService.OpenSerialPort(); |
| | | //_SerialPortTestJob.OpenSerialPort(); |
| | | |
| | | //return content; |
| | | } |
| | |
| | | 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; |
| | | |
| | | } |
| | | |