This commit is contained in:
+7
-1
@@ -145,7 +145,13 @@ namespace Elwig {
|
||||
var list = new List<IScale>();
|
||||
foreach (var s in Config.Scales) {
|
||||
try {
|
||||
list.Add(Scale.FromConfig(s));
|
||||
var scale = Scale.FromConfig(s);
|
||||
if (scale is ICommandScale cmd) {
|
||||
try {
|
||||
await cmd.SetDateAndTime(DateTime.Now);
|
||||
} catch { }
|
||||
}
|
||||
list.Add(scale);
|
||||
} catch (Exception exc) {
|
||||
list.Add(new InvalidScale(s.Id));
|
||||
if (s.Required)
|
||||
|
||||
@@ -182,13 +182,13 @@ namespace Elwig.Documents {
|
||||
} else {
|
||||
var info = part.WeighingInfo;
|
||||
weighing.Add(Italic("Waage/Terminal:"))
|
||||
.Add(Normal(" " + (info.ScaleId ?? "1") + "/" + (part.ScaleTerminalId ?? "?") + ", "))
|
||||
.Add(Normal(" " + (info.ScaleId ?? "?") + "/" + (part.ScaleTerminalId ?? "?") + ", "))
|
||||
.Add(Italic("ID:"))
|
||||
.Add(Normal(" " + (info.Id ?? "?")));
|
||||
if (info.Date != null || info.Time != null)
|
||||
weighing.Add(Normal(" \u2013 "));
|
||||
if (info.Time != null)
|
||||
weighing.Add(Normal($"{info.Time:HH:mm}"));
|
||||
weighing.Add(Normal($"{info.Time:HH:mm:ss}"));
|
||||
if (info.Date != null)
|
||||
weighing.Add(Normal($", {info.Date:dd.MM.yyyy}"));
|
||||
if (info.Gross != null && info.Tare != null && info.Net != null) {
|
||||
|
||||
Reference in New Issue
Block a user