更新20260608
This commit is contained in:
@@ -735,7 +735,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel
|
||||
currentRun.Add(point);
|
||||
verticalLoadPoints.Add(new ObservablePoint(standardTime, point.VerticalLoadN));
|
||||
horizontalFrictionPoints.Add(new ObservablePoint(standardTime, point.HorizontalFrictionN));
|
||||
displacementPoints.Add(new ObservablePoint(standardTime, point.DisplacementMm));
|
||||
UpdateLinearDisplacementSeries(point);
|
||||
frictionCoefficientPoints.Add(new ObservablePoint(standardTime, point.FrictionCoefficient));
|
||||
|
||||
UploadProgress = Math.Min(99, currentRun.Count);
|
||||
@@ -1042,15 +1042,15 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel
|
||||
private void LogRealtimeCurveSummary(string stage)
|
||||
{
|
||||
var expectedCount = currentRun.Count;
|
||||
var lastPoint = currentRun.Count > 0 ? currentRun[^1] : null;
|
||||
var countsMatch =
|
||||
verticalLoadPoints.Count == expectedCount
|
||||
&& horizontalFrictionPoints.Count == expectedCount
|
||||
&& frictionCoefficientPoints.Count == expectedCount
|
||||
&& displacementPoints.Count == expectedCount;
|
||||
var lastPoint = currentRun.Count > 0 ? currentRun[^1] : null;
|
||||
&& IsLinearDisplacementSeriesSynchronized(lastPoint);
|
||||
|
||||
Log.Information(
|
||||
"实时曲线同步汇总:Stage={Stage}, TestNumber={TestNumber}, DataPointCount={DataPointCount}, ChartCounts=[Vertical:{VerticalCount}, Friction:{FrictionCount}, Coefficient:{CoefficientCount}, Displacement:{DisplacementCount}], CountsMatch={CountsMatch}, LastDataPoint={LastDataPoint}, ChartLast=[Vertical:{VerticalChart}, Friction:{FrictionChart}, Coefficient:{CoefficientChart}, Displacement:{DisplacementChart}]",
|
||||
"实时曲线同步汇总:Stage={Stage}, TestNumber={TestNumber}, DataPointCount={DataPointCount}, ChartCounts=[Vertical:{VerticalCount}, Friction:{FrictionCount}, Coefficient:{CoefficientCount}, DisplacementLine:{DisplacementCount}], DisplacementMode=零点到真实端点直线, CountsMatch={CountsMatch}, LastDataPoint={LastDataPoint}, ChartLast=[Vertical:{VerticalChart}, Friction:{FrictionChart}, Coefficient:{CoefficientChart}, DisplacementEndpoint:{DisplacementChart}]",
|
||||
stage,
|
||||
TestNumber,
|
||||
expectedCount,
|
||||
@@ -1073,7 +1073,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel
|
||||
verticalLoadPoints.Count == expectedCount
|
||||
&& horizontalFrictionPoints.Count == expectedCount
|
||||
&& frictionCoefficientPoints.Count == expectedCount
|
||||
&& displacementPoints.Count == expectedCount;
|
||||
&& IsLinearDisplacementSeriesSynchronized(point);
|
||||
var valuesMatch =
|
||||
countsMatch
|
||||
&& ChartPointMatches(verticalLoadPoints[^1], point.TimeSeconds, point.VerticalLoadN)
|
||||
@@ -1084,7 +1084,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel
|
||||
if (!countsMatch || !valuesMatch)
|
||||
{
|
||||
Log.Warning(
|
||||
"实时曲线数据不同步:TestNumber={TestNumber}, PointIndex={PointIndex}, ExpectedCount={ExpectedCount}, Counts=[Vertical:{VerticalCount}, Friction:{FrictionCount}, Coefficient:{CoefficientCount}, Displacement:{DisplacementCount}], ValuesMatch={ValuesMatch}, DataPoint=[Time:{Time:F3}s, Vertical:{Vertical:F3}N, Friction:{Friction:F3}N, Coefficient:{Coefficient:F5}, Displacement:{Displacement:F3}mm], ChartLast=[Vertical:{VerticalChart}, Friction:{FrictionChart}, Coefficient:{CoefficientChart}, Displacement:{DisplacementChart}]",
|
||||
"实时曲线数据不同步:TestNumber={TestNumber}, PointIndex={PointIndex}, ExpectedCount={ExpectedCount}, Counts=[Vertical:{VerticalCount}, Friction:{FrictionCount}, Coefficient:{CoefficientCount}, DisplacementLine:{DisplacementCount}], DisplacementMode=零点到真实端点直线, ValuesMatch={ValuesMatch}, DataPoint=[Time:{Time:F3}s, Vertical:{Vertical:F3}N, Friction:{Friction:F3}N, Coefficient:{Coefficient:F5}, Displacement:{Displacement:F3}mm], ChartLast=[Vertical:{VerticalChart}, Friction:{FrictionChart}, Coefficient:{CoefficientChart}, DisplacementEndpoint:{DisplacementChart}]",
|
||||
TestNumber,
|
||||
expectedCount,
|
||||
expectedCount,
|
||||
@@ -1126,6 +1126,53 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel
|
||||
expectedCount);
|
||||
}
|
||||
|
||||
private void UpdateLinearDisplacementSeries(SlipDataPoint endpoint)
|
||||
{
|
||||
if (displacementPoints.Count == 0)
|
||||
{
|
||||
displacementPoints.Add(new ObservablePoint(0, 0));
|
||||
}
|
||||
|
||||
if (endpoint.TimeSeconds <= 0.000001)
|
||||
{
|
||||
while (displacementPoints.Count > 1)
|
||||
{
|
||||
displacementPoints.RemoveAt(displacementPoints.Count - 1);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var endpointPoint = new ObservablePoint(endpoint.TimeSeconds, endpoint.DisplacementMm);
|
||||
if (displacementPoints.Count == 1)
|
||||
{
|
||||
displacementPoints.Add(endpointPoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
displacementPoints[1] = endpointPoint;
|
||||
}
|
||||
|
||||
while (displacementPoints.Count > 2)
|
||||
{
|
||||
displacementPoints.RemoveAt(displacementPoints.Count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsLinearDisplacementSeriesSynchronized(SlipDataPoint? endpoint)
|
||||
{
|
||||
if (endpoint is null)
|
||||
{
|
||||
return displacementPoints.Count == 0;
|
||||
}
|
||||
|
||||
var expectedCount = endpoint.TimeSeconds <= 0.000001 ? 1 : 2;
|
||||
return displacementPoints.Count == expectedCount
|
||||
&& ChartPointMatches(displacementPoints[0], 0, 0)
|
||||
&& (expectedCount == 1
|
||||
|| ChartPointMatches(displacementPoints[^1], endpoint.TimeSeconds, endpoint.DisplacementMm));
|
||||
}
|
||||
|
||||
private static bool ChartPointMatches(ObservablePoint chartPoint, double expectedX, double expectedY) =>
|
||||
NearlyEquals(chartPoint.X, expectedX) && NearlyEquals(chartPoint.Y, expectedY);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user