using System; namespace Elwig.Helpers.Weighing { /// /// Result of a weighing process on an industrial scale /// public struct WeighingResult { /// /// Measured net weight in kg /// public int? Weight; /// /// Weighing id (or IdentNr) provided by the scale /// public string? WeighingId; /// /// Wheighing id (or IdentNr) provided by the scale optionally combined with the current date /// public string? FullWeighingId; /// /// Date string provided by the scale /// public DateOnly? Date; /// /// Time string provided by the scale /// public TimeOnly? Time; /// <Weight/WeighingId/Date/Time> public override readonly string ToString() { var w = Weight != null ? $"{Weight}kg" : ""; return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm}>"; } } }