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