优化对齐方式
This commit is contained in:
@@ -51,11 +51,14 @@ namespace DrillTools
|
|||||||
|
|
||||||
private static void AppendRows(StringBuilder report, IReadOnlyList<ReportRow> rows)
|
private static void AppendRows(StringBuilder report, IReadOnlyList<ReportRow> rows)
|
||||||
{
|
{
|
||||||
|
// Column widths and gaps match the header/separator layout exactly.
|
||||||
|
// Separator sections: [0..6]=7 [9..16]=8 [20..25]=6 [37..40]=4 [52..58]=7 [61..71]=11 [74..86]=13 [89..98]=10
|
||||||
|
// Gaps between sections: 2sp 3sp 11sp 11sp 2sp 2sp 2sp
|
||||||
foreach (var row in rows)
|
foreach (var row in rows)
|
||||||
{
|
{
|
||||||
report.AppendLine(string.Format(
|
report.AppendLine(string.Format(
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
"{0,8}{1,10}{2,10}{3,17}{4,16}{5,14}{6,15}{7,12}",
|
"{0,-7} {1,-8} {2,-6} {3,-4} {4,-7} {5,-11} {6,-13} {7,-10}",
|
||||||
1,
|
1,
|
||||||
row.ToolRef,
|
row.ToolRef,
|
||||||
row.ToolNumber,
|
row.ToolNumber,
|
||||||
@@ -72,7 +75,7 @@ namespace DrillTools
|
|||||||
report.AppendLine("=========================================================== =========== ============= ==========");
|
report.AppendLine("=========================================================== =========== ============= ==========");
|
||||||
report.AppendLine(string.Format(
|
report.AppendLine(string.Format(
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
"{0,69}{1,14}{2,15}{3,12}",
|
"{0,59} {1,-11} {2,-13} {3,-10}",
|
||||||
"Totals:",
|
"Totals:",
|
||||||
rows.Sum(row => row.PlatedHits),
|
rows.Sum(row => row.PlatedHits),
|
||||||
rows.Sum(row => row.UnplatedHits),
|
rows.Sum(row => row.UnplatedHits),
|
||||||
|
|||||||
Reference in New Issue
Block a user