更新121
This commit is contained in:
@@ -404,8 +404,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="实时千分表" Style="{StaticResource MetricTitle}" />
|
||||
<TextBlock Grid.Row="1"
|
||||
x:Name="RelativeDisplacementText"
|
||||
Text="{Binding RelativeDisplacementText}"
|
||||
x:Name="DialIndicatorText"
|
||||
Text="{Binding DialIndicatorText}"
|
||||
Style="{StaticResource MetricValue}"
|
||||
Foreground="#0F766E"
|
||||
VerticalAlignment="Center" />
|
||||
@@ -633,7 +633,7 @@
|
||||
Margin="8,0,8,0" />
|
||||
<Button Grid.Column="2"
|
||||
x:Name="StartDisplacementButton"
|
||||
Content="启动"
|
||||
Content="{Binding DisplacementTestButtonText}"
|
||||
Command="{Binding StartDisplacementCommand}"
|
||||
Style="{StaticResource StartButtonStyle}"
|
||||
Margin="8,0,8,0" />
|
||||
@@ -900,7 +900,7 @@
|
||||
Command="{Binding VentValveCommand}"
|
||||
Margin="8,0,8,0" />
|
||||
<Button Grid.Column="3"
|
||||
Content="启动"
|
||||
Content="{Binding SpeedTorqueTestButtonText}"
|
||||
Command="{Binding StartSpeedTorqueCommand}"
|
||||
Style="{StaticResource StartButtonStyle}"
|
||||
Margin="8,0,8,0" />
|
||||
@@ -1019,7 +1019,7 @@
|
||||
Command="{Binding SaveNoLoadSpeedSettingCommand}"
|
||||
Margin="0,0,8,0" />
|
||||
<Button Grid.Column="1"
|
||||
Content="开始空载转速"
|
||||
Content="{Binding NoLoadSpeedTestButtonText}"
|
||||
Command="{Binding RecordNoLoadSpeedCommand}"
|
||||
Style="{StaticResource StartButtonStyle}"
|
||||
Margin="8,0,0,0" />
|
||||
|
||||
@@ -173,6 +173,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
private int _snapshotWriteInProgress;
|
||||
private bool _sessionExported;
|
||||
private double _dialZero;
|
||||
private double _dialIndicator;
|
||||
private double _relativeDisplacement;
|
||||
private double _axialAxisPosition;
|
||||
private double _axialSampleStart;
|
||||
@@ -210,7 +211,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
private bool _isVentValveOpen;
|
||||
private bool _hasShownSpeedTorqueEndWarnings;
|
||||
private DateTime _lastParameterReadFailureLogAt = DateTime.MinValue;
|
||||
private string _relativeDisplacementText = "0.000 mm";
|
||||
private string _dialIndicatorText = "0.000 mm";
|
||||
private string _axialAxisPositionText = "0.000 mm";
|
||||
private string _axialSamplePairText = "-- / --";
|
||||
private string _axialSampleDifferenceText = "--";
|
||||
@@ -241,6 +242,9 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
private string _holdTorqueInput = "0";
|
||||
private string _torqueHoldTimeInput = "0";
|
||||
private string _axialForceSetpointModeButtonText = "轴向跳动力设置";
|
||||
private string _displacementTestButtonText = "测试";
|
||||
private string _speedTorqueTestButtonText = "测试";
|
||||
private string _noLoadSpeedTestButtonText = "测试";
|
||||
private string _displacementResetButtonText = "复位";
|
||||
private string _speedTorqueResetButtonText = "复位";
|
||||
private string _ventValveButtonText = "开启通气阀";
|
||||
@@ -502,10 +506,10 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
|
||||
public string PlcTimeoutMillisecondsInput { get; set; } = "2000";
|
||||
|
||||
public string RelativeDisplacementText
|
||||
public string DialIndicatorText
|
||||
{
|
||||
get => _relativeDisplacementText;
|
||||
private set => SetProperty(ref _relativeDisplacementText, value);
|
||||
get => _dialIndicatorText;
|
||||
private set => SetProperty(ref _dialIndicatorText, value);
|
||||
}
|
||||
|
||||
public string AxialAxisPositionText
|
||||
@@ -652,6 +656,24 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
private set => SetProperty(ref _displacementResetButtonText, value);
|
||||
}
|
||||
|
||||
public string DisplacementTestButtonText
|
||||
{
|
||||
get => _displacementTestButtonText;
|
||||
private set => SetProperty(ref _displacementTestButtonText, value);
|
||||
}
|
||||
|
||||
public string SpeedTorqueTestButtonText
|
||||
{
|
||||
get => _speedTorqueTestButtonText;
|
||||
private set => SetProperty(ref _speedTorqueTestButtonText, value);
|
||||
}
|
||||
|
||||
public string NoLoadSpeedTestButtonText
|
||||
{
|
||||
get => _noLoadSpeedTestButtonText;
|
||||
private set => SetProperty(ref _noLoadSpeedTestButtonText, value);
|
||||
}
|
||||
|
||||
public string AxialForceSetpointModeButtonText
|
||||
{
|
||||
get => _axialForceSetpointModeButtonText;
|
||||
@@ -703,6 +725,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
_noLoadSpeedRecord = ReadFloatValue(values, NoLoadSpeedRecordRegister, "空载转速记录");
|
||||
_noLoadSpeedErrorRate = ReadFloatValue(values, NoLoadSpeedErrorRateRegister, "转速误差率");
|
||||
_realtimePressure = ReadFloatValue(values, PressureDisplayRegister, "压力显示");
|
||||
_dialIndicator = dialIndicator;
|
||||
_relativeDisplacement = dialIndicator - _dialZero;
|
||||
_axialForce = axialForce;
|
||||
_realtimeTorque = realtimeTorque;
|
||||
@@ -2295,7 +2318,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await PulsePlcAsync(NoLoadSpeedRecordCoil, "记录空载转速"))
|
||||
if (!await PulsePlcAsync(NoLoadSpeedRecordCoil, "空载转速测试"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2303,6 +2326,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
PrepareSessionForNewRun();
|
||||
_activeNoLoadSpeedRun = CreateTestRun("空载转速测试");
|
||||
_noLoadCaptureDeadline = DateTime.Now.Add(NoLoadCaptureDuration);
|
||||
NoLoadSpeedTestButtonText = "测试中";
|
||||
UpdateDataCaptureStatus();
|
||||
}
|
||||
|
||||
@@ -2314,7 +2338,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await PulsePlcAsync(SpeedTorqueStartCoil, "转速/扭矩启动"))
|
||||
if (!await PulsePlcAsync(SpeedTorqueStartCoil, "转速/扭矩测试"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2327,6 +2351,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
|
||||
PrepareSessionForNewRun();
|
||||
_isSpeedTorqueRunning = true;
|
||||
SpeedTorqueTestButtonText = "测试中";
|
||||
_hasShownSpeedTorqueEndWarnings = false;
|
||||
_finalSpeed = null;
|
||||
_finalTorque = null;
|
||||
@@ -2377,6 +2402,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
FinalizeSpeedTorqueRun("复位前中止");
|
||||
PersistCurrentPayloadSnapshot("转速/扭矩复位前");
|
||||
_isSpeedTorqueRunning = false;
|
||||
SpeedTorqueTestButtonText = "测试";
|
||||
_realtimeSpeed = 0;
|
||||
_realtimeTorque = 0;
|
||||
_speedTorqueZero = _speedTorqueAxisPosition;
|
||||
@@ -2426,7 +2452,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await PulsePlcAsync(AxialStartCoil, "轴向启动"))
|
||||
if (!await PulsePlcAsync(AxialStartCoil, "轴向测试"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2439,6 +2465,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
|
||||
PrepareSessionForNewRun();
|
||||
_isDisplacementRunning = true;
|
||||
DisplacementTestButtonText = "测试中";
|
||||
_activeDisplacementRun = CreateTestRun("轴向位移动量测试");
|
||||
_finalDisplacement = null;
|
||||
_finalAxialForce = null;
|
||||
@@ -2496,6 +2523,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
_finalAxialForce = null;
|
||||
await UpdateAxialForceFromInputAsync();
|
||||
_isDisplacementRunning = false;
|
||||
DisplacementTestButtonText = "测试";
|
||||
UpdateDisplacementDisplay();
|
||||
Log.Information("轴向复位完成,千分表零点 {DialZero}", _dialZero);
|
||||
}
|
||||
@@ -2703,6 +2731,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
}
|
||||
|
||||
_isDisplacementRunning = false;
|
||||
DisplacementTestButtonText = "测试";
|
||||
_finalDisplacement = Math.Abs(_axialSampleDifference) > 0.000001 ? _axialSampleDifference : _relativeDisplacement;
|
||||
_finalAxialForce = GetScaledAxialForce();
|
||||
FinalizeDisplacementRun(status);
|
||||
@@ -2718,7 +2747,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
|
||||
private bool TryGetDialValue(out double value)
|
||||
{
|
||||
value = _dialZero + _relativeDisplacement;
|
||||
value = _dialIndicator;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2798,6 +2827,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
}
|
||||
|
||||
_isSpeedTorqueRunning = false;
|
||||
SpeedTorqueTestButtonText = "测试";
|
||||
_realtimeSpeed = speed;
|
||||
_realtimeTorque = torque;
|
||||
_finalSpeed = speed;
|
||||
@@ -2909,7 +2939,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
|
||||
private void UpdateDisplacementDisplay()
|
||||
{
|
||||
RelativeDisplacementText = $"{FormatDisplacement(_relativeDisplacement)} mm";
|
||||
DialIndicatorText = $"{FormatDisplacement(_dialIndicator)} mm";
|
||||
AxialAxisPositionText = $"{FormatDisplacement(_axialAxisPosition)} mm";
|
||||
AxialSamplePairText = $"{FormatDisplacement(_axialSampleStart)} / {FormatDisplacement(_axialSampleEnd)} mm";
|
||||
AxialSampleDifferenceText = $"{FormatDisplacement(_axialSampleDifference)} mm";
|
||||
@@ -3245,6 +3275,7 @@ public sealed class MainWindowViewModel : ObservableObject
|
||||
_completedRuns.Add(_activeNoLoadSpeedRun);
|
||||
_activeNoLoadSpeedRun = null;
|
||||
_noLoadCaptureDeadline = null;
|
||||
NoLoadSpeedTestButtonText = "测试";
|
||||
PersistCurrentPayloadSnapshot("空载转速记录完成");
|
||||
UpdateDataCaptureStatus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user