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