From 07223f68b4cf74786269115b290f073e0fc97354 Mon Sep 17 00:00:00 2001 From: yanjinhui <3306209981@qq.com> Date: 星期一, 03 三月 2025 09:47:27 +0800 Subject: [PATCH] 1 --- 项目代码/WIDESEAWCS_Server 正式/WIDESEAWCS_Tasks/SerialPort/SerialPortTestJob.cs | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Tasks/SerialPort/SerialPortTestJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Tasks/SerialPort/SerialPortTestJob.cs" index 51b4d47..5a33896 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Tasks/SerialPort/SerialPortTestJob.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Tasks/SerialPort/SerialPortTestJob.cs" @@ -2,14 +2,13 @@ using System.Text; using Quartz; using WIDESEA_ISerialPortService; -using WIDESEAWCS_Model.Models.SerialPort; +using WIDESEAWCS_Model.Models; namespace WIDESEAWCS_Tasks { public class SerialPortTestJob:IJob { - // 鍦� SerialPortTestService 绫讳腑娣诲姞瀵� ISerialPortService 鐨勫紩鐢� private readonly ISerialPortService _serialPortService; public readonly string _port; @@ -23,17 +22,13 @@ SerialPort = new SerialPort(_port); - - //涓插彛鎺ユ敹鍒版暟鎹椂锛孲erialPort 浼氳嚜鍔ㄨЕ鍙� DataReceived 浜嬩欢 //SerialPort.DataReceived += OnDataReceived; //鎺ユ敹涓插彛鍙戝嚭鐨勬暟鎹� } private CancellationTokenSource _cancellationTokenSource; private Task _sendTask; - private int commandType = 2; - - + private int commandType = 2; // 鍛戒护瀛楃涓� private string command0 = ""; // 涓嶅彂閫佸懡浠� @@ -43,7 +38,7 @@ public Task Execute(IJobExecutionContext context) { - OpenSerialPort(); + //OpenSerialPort(); SerialPort.DataReceived += OnDataReceived; return Task.CompletedTask; -- Gitblit v1.9.3