更新20260602版本
This commit is contained in:
@@ -7,6 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using A = DocumentFormat.OpenXml.Drawing;
|
||||
using C = DocumentFormat.OpenXml.Drawing.Charts;
|
||||
using Xdr = DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||
@@ -18,6 +19,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services
|
||||
private const string InfoSheetName = "试验信息";
|
||||
private const string ResultSheetName = "结果汇总";
|
||||
private const string DataSheetName = "实时数据";
|
||||
private const int StandardTrialCount = 3;
|
||||
|
||||
public string Export(SlipReportExport report)
|
||||
{
|
||||
@@ -100,12 +102,26 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services
|
||||
{
|
||||
result.Index,
|
||||
result.Time,
|
||||
result.StaticCoefficientValue,
|
||||
result.DynamicCoefficientValue,
|
||||
result.StaticCoefficient,
|
||||
result.DynamicCoefficient,
|
||||
result.Verdict
|
||||
});
|
||||
}
|
||||
|
||||
var latest = results.Take(StandardTrialCount).ToList();
|
||||
if (latest.Count == StandardTrialCount)
|
||||
{
|
||||
rows.Add(new object?[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty });
|
||||
rows.Add(new object?[]
|
||||
{
|
||||
"近3次平均",
|
||||
string.Empty,
|
||||
latest.Average(result => result.StaticCoefficientValue).ToString("F2", CultureInfo.InvariantCulture),
|
||||
latest.Average(result => result.DynamicCoefficientValue).ToString("F2", CultureInfo.InvariantCulture),
|
||||
"GB/T 3903.6-2024 8.2"
|
||||
});
|
||||
}
|
||||
|
||||
AddWorksheet(workbookPart, sheets, sheetId, ResultSheetName, rows, "A", "E");
|
||||
}
|
||||
|
||||
@@ -264,23 +280,30 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services
|
||||
{
|
||||
const uint xAxisId = 48650112U;
|
||||
const uint yAxisId = 48672768U;
|
||||
const uint coefficientAxisId = 48689152U;
|
||||
|
||||
var scatterChart = new C.ScatterChart(
|
||||
var forceChart = new C.ScatterChart(
|
||||
new C.ScatterStyle { Val = C.ScatterStyleValues.LineMarker },
|
||||
CreateSeries(0, "正压力(N)", 2, lastRow),
|
||||
CreateSeries(1, "摩擦力(N)", 3, lastRow),
|
||||
CreateSeries(2, "位移量(mm)", 4, lastRow),
|
||||
CreateSeries(3, "摩擦系数", 5, lastRow),
|
||||
new C.AxisId { Val = xAxisId },
|
||||
new C.AxisId { Val = yAxisId });
|
||||
var coefficientChart = new C.ScatterChart(
|
||||
new C.ScatterStyle { Val = C.ScatterStyleValues.LineMarker },
|
||||
CreateSeries(3, "摩擦系数", 5, lastRow),
|
||||
new C.AxisId { Val = xAxisId },
|
||||
new C.AxisId { Val = coefficientAxisId });
|
||||
|
||||
var chart = new C.Chart(
|
||||
CreateTitle("防滑性能实时曲线"),
|
||||
new C.PlotArea(
|
||||
new C.Layout(),
|
||||
scatterChart,
|
||||
forceChart,
|
||||
coefficientChart,
|
||||
CreateValueAxis(xAxisId, yAxisId, C.AxisPositionValues.Bottom, "时间(s)"),
|
||||
CreateValueAxis(yAxisId, xAxisId, C.AxisPositionValues.Left, "载荷 / 摩擦力 / 位移 / 系数")),
|
||||
CreateValueAxis(yAxisId, xAxisId, C.AxisPositionValues.Left, "载荷 / 摩擦力 / 位移"),
|
||||
CreateValueAxis(coefficientAxisId, xAxisId, C.AxisPositionValues.Right, "摩擦系数")),
|
||||
new C.Legend(
|
||||
new C.LegendPosition { Val = C.LegendPositionValues.Bottom },
|
||||
new C.Layout()),
|
||||
|
||||
Reference in New Issue
Block a user