快速工况的LV电压

CANLIN数据小数点处理
This commit is contained in:
2025-07-15 12:00:19 +08:00
parent f6d9437143
commit 9429e98d33
3 changed files with 13 additions and 5 deletions

View File

@@ -80,6 +80,11 @@ namespace CapMachine.Wpf.Models.Tag.Cell
}
}
/// <summary>
/// 临时数据
/// </summary>
private double _EngValueTemp = -1;
private double _EngValue;
/// <summary>
/// 工程值 SV
@@ -89,9 +94,12 @@ namespace CapMachine.Wpf.Models.Tag.Cell
get { return _EngValue; }
set
{
if (value != _EngValue)
if (value != _EngValueTemp)
{
_EngValue = value;
_EngValueTemp = value;
//有些从CANLIN读取的数据有很长的小数点需要处理
_EngValue = Math.Round(value, DecimalPoint);
//_EngValue = value;
RaisePropertyChanged();
//工程值转换成字符串,可以灵活显示
EngValueStr = Math.Round(value, DecimalPoint).ToString();
@@ -99,7 +107,7 @@ namespace CapMachine.Wpf.Models.Tag.Cell
}
}
private string? _EngValueStr="0";
private string? _EngValueStr = "0";
/// <summary>
/// 工程值的字符串 MV
/// </summary>

View File

@@ -36,7 +36,7 @@ namespace CapMachine.Wpf.ProPars
new PlcParsDataQuick(){ Name="SUBCOOL出口温度",EnName="LubePress",Step=100,Steps=new List<PlcMeterStepCellQuick>(),Ratio=10,Unit="" ,ValueStartAddress=1016, },
new PlcParsDataQuick(){ Name="LV电压",EnName="LVVol",Step=100,Steps=new List<PlcMeterStepCellQuick>(),Ratio=10,Unit="" ,ValueStartAddress=1024, },
new PlcParsDataQuick(){ Name="LV电压",EnName="LVVol",Step=100,Steps=new List<PlcMeterStepCellQuick>(),Ratio=1,Unit="" ,ValueStartAddress=1024, },
new PlcParsDataQuick(){ Name="OCR",EnName="OCR",Step=100,Steps=new List<PlcMeterStepCellQuick>(),Ratio=10,Unit="" ,ValueStartAddress=1020, },

View File

@@ -1418,7 +1418,7 @@ namespace CapMachine.Wpf.Services
while (ThreadEnable)
{
await Task.Delay(100);
await Task.Delay(300);
//await Task.CompletedTask;
DiagnosticsTime.Reset();