|
|
@@ -684,13 +684,13 @@ namespace TeamAAS_VP.Core
|
|
|
|
|
|
var torqueConfig = _configService.GetTorqueReaderConfig();
|
|
|
|
|
|
- if (torqueConfig!=null)
|
|
|
+ if (torqueConfig != null)
|
|
|
{
|
|
|
try
|
|
|
- {
|
|
|
+ {
|
|
|
var port = FileHelper.ReadJsonFile<TorqueProduceModel>(FilePath.TorqueReaderConfigurationPath);
|
|
|
if (string.IsNullOrEmpty(port.TorqueMeasureSerialPort))
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
client = new TouchSocket.SerialPorts.SerialPortClient();
|
|
|
client.Connecting = (client1, e) => { return EasyTask.CompletedTask; };//即将连接到端口
|
|
|
@@ -720,7 +720,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SendTaskMessage("请设置扭力测量仪串口!" , MessageLevel.Error);
|
|
|
+ SendTaskMessage("请设置扭力测量仪串口!", MessageLevel.Error);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -732,7 +732,7 @@ namespace TeamAAS_VP.Core
|
|
|
else
|
|
|
{
|
|
|
TorqueSerialPortConfig config = new TorqueSerialPortConfig();
|
|
|
- FileHelper.WriteJsonFile(config,FilePath.TorqueReaderConfigurationPath);
|
|
|
+ FileHelper.WriteJsonFile(config, FilePath.TorqueReaderConfigurationPath);
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -2065,7 +2065,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
|
|
|
//读取产品结果
|
|
|
- Int16 resultIndex = plc.ReadNode<Int16>(addressConfig.In_Result.Address);
|
|
|
+ Int16 resultIndex = plc.ReadNode<Int16>(string.Format(addressConfig.In_Result.Address, i));
|
|
|
|
|
|
//目前只记录当前站
|
|
|
if (i == 0)
|
|
|
@@ -2131,7 +2131,7 @@ namespace TeamAAS_VP.Core
|
|
|
_pressureCts?.Cancel();
|
|
|
_pressureTimeoutCts?.Cancel();
|
|
|
_pressureLinkedCts?.Dispose();
|
|
|
- _pressureSamples.Clear();
|
|
|
+ _pressureSamples?.Clear();
|
|
|
|
|
|
_pressureCts = new CancellationTokenSource();
|
|
|
_pressureTimeoutCts = new CancellationTokenSource();
|
|
|
@@ -2250,7 +2250,7 @@ namespace TeamAAS_VP.Core
|
|
|
_pressureLinkedCts?.Dispose();
|
|
|
_pressureTimeoutCts?.Dispose();
|
|
|
_pressureCts?.Dispose();
|
|
|
- _pressureSamples.Clear();
|
|
|
+ _pressureSamples?.Clear();
|
|
|
}
|
|
|
catch { }
|
|
|
}
|