diff --git a/Footwear Test methodsfor wholeshoe Slipresistanceperformance/Services/SlipExcelExportService.cs b/Footwear Test methodsfor wholeshoe Slipresistanceperformance/Services/SlipExcelExportService.cs index 8f41769..5ffa9ae 100644 --- a/Footwear Test methodsfor wholeshoe Slipresistanceperformance/Services/SlipExcelExportService.cs +++ b/Footwear Test methodsfor wholeshoe Slipresistanceperformance/Services/SlipExcelExportService.cs @@ -131,7 +131,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services { var rows = new List> { - new object?[] { "滑动开始后时间(s)", "垂直载荷(N)", "水平摩擦力(N)", "滑动位移(mm)", "摩擦系数" } + new object?[] { "时间(s)", "垂直压力(N)", "水平拉力(N)", "距离(mm)", "摩擦系数" } }; foreach (var point in points) @@ -244,17 +244,10 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services drawingsPart.WorksheetDrawing = new Xdr.WorksheetDrawing(); AddChartPart( drawingsPart, - CreateForceAndCoefficientChartSpace(lastRow), + CreateScreenshotStyleChartSpace(lastRow), 2U, - "防滑性能力与摩擦系数曲线", + "防滑性能测试曲线", 1, - 23); - AddChartPart( - drawingsPart, - CreateDisplacementChartSpace(lastRow), - 3U, - "滑动位移", - 25, 39); drawingsPart.WorksheetDrawing.Save(); worksheetPart.Worksheet.Save(); @@ -300,10 +293,10 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services new Xdr.ClientData())); } - private static C.ChartSpace CreateForceAndCoefficientChartSpace(int lastRow) + private static C.ChartSpace CreateScreenshotStyleChartSpace(int lastRow) { const uint xAxisId = 48650112U; - const uint forceAxisId = 48672768U; + const uint forceAndDistanceAxisId = 48672768U; const uint coefficientAxisId = 48689152U; var forceChart = new C.ScatterChart( @@ -311,21 +304,27 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services CreateSeries(0, 2, lastRow), CreateSeries(1, 3, lastRow), new C.AxisId { Val = xAxisId }, - new C.AxisId { Val = forceAxisId }); + new C.AxisId { Val = forceAndDistanceAxisId }); var coefficientChart = new C.ScatterChart( new C.ScatterStyle { Val = C.ScatterStyleValues.LineMarker }, CreateSeries(2, 5, lastRow), new C.AxisId { Val = xAxisId }, new C.AxisId { Val = coefficientAxisId }); + var distanceChart = new C.ScatterChart( + new C.ScatterStyle { Val = C.ScatterStyleValues.LineMarker }, + CreateSeries(3, 4, lastRow), + new C.AxisId { Val = xAxisId }, + new C.AxisId { Val = forceAndDistanceAxisId }); var chart = new C.Chart( - CreateTitle("防滑性能滑动阶段曲线"), + CreateTitle("防滑性能测试曲线"), new C.PlotArea( new C.Layout(), forceChart, coefficientChart, - CreateValueAxis(xAxisId, forceAxisId, C.AxisPositionValues.Bottom, "滑动开始后时间(s)"), - CreateValueAxis(forceAxisId, xAxisId, C.AxisPositionValues.Left, "垂直载荷 / 水平摩擦力 (N)"), + distanceChart, + CreateValueAxis(xAxisId, forceAndDistanceAxisId, C.AxisPositionValues.Bottom, "时间(s)"), + CreateValueAxis(forceAndDistanceAxisId, xAxisId, C.AxisPositionValues.Left, "压力(N)/距离(mm)"), CreateValueAxis(coefficientAxisId, xAxisId, C.AxisPositionValues.Right, "摩擦系数")), new C.Legend( new C.LegendPosition { Val = C.LegendPositionValues.Bottom }, @@ -337,34 +336,6 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services chart); } - private static C.ChartSpace CreateDisplacementChartSpace(int lastRow) - { - const uint xAxisId = 48700112U; - const uint displacementAxisId = 48722768U; - - var displacementChart = new C.ScatterChart( - new C.ScatterStyle { Val = C.ScatterStyleValues.LineMarker }, - CreateSeries(0, 4, lastRow), - new C.AxisId { Val = xAxisId }, - new C.AxisId { Val = displacementAxisId }); - - var chart = new C.Chart( - CreateTitle("滑动位移"), - new C.PlotArea( - new C.Layout(), - displacementChart, - CreateValueAxis(xAxisId, displacementAxisId, C.AxisPositionValues.Bottom, "滑动开始后时间(s)"), - CreateValueAxis(displacementAxisId, xAxisId, C.AxisPositionValues.Left, "滑动位移 (mm)")), - new C.Legend( - new C.LegendPosition { Val = C.LegendPositionValues.Bottom }, - new C.Layout()), - new C.PlotVisibleOnly { Val = true }); - - return new C.ChartSpace( - new C.EditingLanguage { Val = "zh-CN" }, - chart); - } - private static C.ScatterChartSeries CreateSeries(uint index, int yColumnIndex, int lastRow) { var sheet = EscapeSheetName(DataSheetName); diff --git a/Footwear Test methodsfor wholeshoe Slipresistanceperformance/ViewModels/MainWindowViewModel.cs b/Footwear Test methodsfor wholeshoe Slipresistanceperformance/ViewModels/MainWindowViewModel.cs index 28dc2a3..28dbbee 100644 --- a/Footwear Test methodsfor wholeshoe Slipresistanceperformance/ViewModels/MainWindowViewModel.cs +++ b/Footwear Test methodsfor wholeshoe Slipresistanceperformance/ViewModels/MainWindowViewModel.cs @@ -209,7 +209,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel { Name = "时间(s)", MinLimit = 0, - UnitWidth = 0.1, + MinStep = 0.05, SeparatorsPaint = new SolidColorPaint(SKColor.Parse("#D7E0EA")) { StrokeThickness = 1 }, SubseparatorsPaint = new SolidColorPaint(SKColor.Parse("#EEF3F8")) { StrokeThickness = 1 }, SubseparatorsCount = 4, @@ -225,8 +225,11 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel [ new Axis { - Name = "垂直载荷 / 水平摩擦力 (N)", + Name = "压力(N)/距离(mm)", MinLimit = 0, + MaxLimit = 800, + MinStep = 50, + ForceStepToMin = true, SeparatorsPaint = new SolidColorPaint(SKColor.Parse("#D7E0EA")) { StrokeThickness = 1 }, SubseparatorsPaint = new SolidColorPaint(SKColor.Parse("#EEF3F8")) { StrokeThickness = 1 }, SubseparatorsCount = 4, @@ -237,23 +240,13 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel Padding = new LiveChartsCore.Drawing.Padding(2, 2, 3, 2) }, new Axis - { - Name = "滑动位移 (mm)", - Position = LiveChartsCore.Measure.AxisPosition.End, - MinLimit = 0, - LabelsPaint = new SolidColorPaint(SKColor.Parse("#1D4ED8")), - NamePaint = new SolidColorPaint(SKColor.Parse("#1D4ED8")), - SeparatorsPaint = null, - TextSize = 11, - NameTextSize = 12, - Padding = new LiveChartsCore.Drawing.Padding(3, 2, 2, 2) - }, - new Axis { Name = "摩擦系数", Position = LiveChartsCore.Measure.AxisPosition.End, MinLimit = 0, - UnitWidth = 0.1, + MaxLimit = 1.5, + MinStep = 0.1, + ForceStepToMin = true, LabelsPaint = new SolidColorPaint(SKColor.Parse("#7E22CE")), NamePaint = new SolidColorPaint(SKColor.Parse("#7E22CE")), SeparatorsPaint = null, @@ -268,10 +261,10 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.ViewModel Log.Information("初始化主页面 ViewModel"); Series = [ - CreateLineSeries("垂直载荷(N)", verticalLoadPoints, "#DC2626", 0), - CreateLineSeries("水平摩擦力(N)", horizontalFrictionPoints, "#16A34A", 0), - CreateLineSeries("滑动位移(mm)", displacementPoints, "#2563EB", 1), - CreateLineSeries("摩擦系数", frictionCoefficientPoints, "#C026D3", 2) + CreateLineSeries("垂直压力(N)", verticalLoadPoints, "#DC2626", 0), + CreateLineSeries("水平拉力(N)", horizontalFrictionPoints, "#16A34A", 0), + CreateLineSeries("摩擦系数", frictionCoefficientPoints, "#C026D3", 1), + CreateLineSeries("距离(mm)", displacementPoints, "#2563EB", 0) ]; LoadDeviceSettings();