Weighing: Differentiate between scale and terminal

This commit is contained in:
2026-08-03 10:56:36 +02:00
parent 0d8cdd5d6e
commit 309f118739
20 changed files with 130 additions and 158 deletions
+6
View File
@@ -21,6 +21,11 @@ namespace Elwig.Helpers.Weighing {
/// </summary>
public int? NetWeight;
/// <summary>
/// Reported id of the scale
/// </summary>
public string? ScaleId;
/// <summary>
/// Weighing id (or IdentNr) provided by the scale
/// </summary>
@@ -49,6 +54,7 @@ namespace Elwig.Helpers.Weighing {
public readonly JsonObject ToJson() {
var obj = new JsonObject();
if (ScaleId != null) obj["scale"] = ScaleId;
if (FullWeighingId != null) obj["id"] = FullWeighingId;
if (WeighingId != null) obj["nr"] = int.Parse(WeighingId);
if (Date != null) obj["date"] = $"{Date:yyyy-MM-dd}";