master
sunhonglei 7 months ago
parent 0d8ee5355b
commit f3df27995d
  1. 43
      ViewModel/Grading/GradingResultVM.cs

@ -661,17 +661,19 @@ public class GradingResultVM : BaseViewModel
col = 0; col = 0;
dataRow = sheet.CreateRow(row); dataRow = sheet.CreateRow(row);
Measurements info = algorithmResult.measurements; Measurements info = algorithmResult.measurements;
dataRow.CreateCell(col++).SetCellValue($"{info.M1}(mm)"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.M1)}(mm)");
dataRow.CreateCell(col++).SetCellValue($"{info.M2}(mm)"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.M2)}(mm)");
dataRow.CreateCell(col++).SetCellValue($"{info.M3}(mm)"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.M3)}(mm)");
dataRow.CreateCell(col++).SetCellValue($"{info.TABLE*100}%"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_P(info.TABLE)}%");
dataRow.CreateCell(col++).SetCellValue($"{info.CROWN_HEIGHT * 100}%"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_P(info.CROWN_HEIGHT)}%");
dataRow.CreateCell(col++).SetCellValue($"{info.PAV_DEPTH * 100}%"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_P(info.PAV_DEPTH)}%");
dataRow.CreateCell(col++).SetCellValue($"{info.TOTAL_DEPTH * 100}%"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_P(info.TOTAL_DEPTH)}%");
dataRow.CreateCell(col++).SetCellValue($"{info.CROWN_ANGLE}°"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.CROWN_ANGLE)}°");
dataRow.CreateCell(col++).SetCellValue($"{info.PAV_ANGLE}°"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.PAV_ANGLE)}°");
dataRow.CreateCell(col++).SetCellValue($"{info.CULET}(mm)"); // TODO 底尖直径
dataRow.CreateCell(col++).SetCellValue($"{info.GIRDLE * 100}%"); dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.CULET)}(mm)");
dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_P(info.GIRDLE)}%");
// TODO 腰部厚度英文
dataRow.CreateCell(col++).SetCellValue($"{info.M1}"); dataRow.CreateCell(col++).SetCellValue($"{info.M1}");
dataRow.CreateCell(col++).SetCellValue($""); dataRow.CreateCell(col++).SetCellValue($"");
string sysmlevel = ""; string sysmlevel = "";
@ -687,7 +689,24 @@ public class GradingResultVM : BaseViewModel
{ {
workbook.Write(stream); workbook.Write(stream);
} }
}
/// <summary>
/// 百分比用的小数格式化
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
private string FormatDouble_P(double value)
{
return (Math.Floor(value*1000)/10).ToString(digitsFormat);
}
/// <summary>
/// 直接值(角度,直径)用的小数格式化
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
private string FormatDouble_A(double value)
{
return (Math.Floor(value * 10) / 10).ToString(digitsFormat);
} }
private void DatFile(string filePath) private void DatFile(string filePath)
{ {

Loading…
Cancel
Save