DeiveryAdminWindow: Display percentage of weight in status bar

This commit is contained in:
2023-10-01 09:37:17 +02:00
parent b79ba14f9e
commit e79f4baa2f

View File

@ -503,8 +503,8 @@ namespace Elwig.Windows {
if (groups.Count == 1) {
var g = groups.First().Key;
if (g != "") {
StatusWeight.Text += $" ({g})";
StatusGradation.Text += $" ({g})";
StatusWeight.Text += $" [{g}]";
StatusGradation.Text += $" [{g}]";
}
var sortGroups = parts
@ -514,12 +514,12 @@ namespace Elwig.Windows {
.ToList();
if (sortGroups.Count > 1 && sortGroups.Count <= 4) {
StatusWeight.Text += $" = {string.Join(" + ", sortGroups.Select(g => $"{g.Item2:N0} kg" + (g.Key == "" ? "" : $" ({g.Key})")))}";
StatusGradation.Text += $" = {string.Join(" + ", sortGroups.Select(g => $"{g.Item3:N1}/{g.Item4:N1}/{g.Item5:N1}" + (g.Key == "" ? "" : $" ({g.Key})")))}";
StatusWeight.Text += $" = {string.Join(" + ", sortGroups.Select(g => $"{g.Item2:N0} kg ({(double)g.Item2 / weight:0%})" + (g.Key == "" ? "" : $" [{g.Key}]")))}";
StatusGradation.Text += $" = {string.Join(" + ", sortGroups.Select(g => $"{g.Item3:N1}/{g.Item4:N1}/{g.Item5:N1}" + (g.Key == "" ? "" : $" [{g.Key}]")))}";
}
} else if (groups.Count <= 4) {
StatusWeight.Text += $" = {string.Join(" + ", groups.Select(g => $"{g.Item2:N0} kg" + (g.Key == "" ? "" : $" ({g.Key})")))}";
StatusGradation.Text += $" = {string.Join(" + ", groups.Select(g => $"{g.Item3:N1}/{g.Item4:N1}/{g.Item5:N1}" + (g.Key == "" ? "" : $" ({g.Key})")))}";
StatusWeight.Text += $" = {string.Join(" + ", groups.Select(g => $"{g.Item2:N0} kg ({(double)g.Item2 / weight:0%})" + (g.Key == "" ? "" : $" [{g.Key}]")))}";
StatusGradation.Text += $" = {string.Join(" + ", groups.Select(g => $"{g.Item3:N1}/{g.Item4:N1}/{g.Item5:N1}" + (g.Key == "" ? "" : $" [{g.Key}]")))}";
}
}
} else {