Files
elwig/Elwig/Helpers/Weighing/WeighingResult.cs

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>&lt;Weight/WeighingId/Date/Time&gt;</returns>
public override readonly string ToString() {
var w = Weight != null ? $"{Weight}kg" : "";
return $"<{w}/{WeighingId}/{Date:yyyy-MM-dd}/{Time:HH:mm}>";
}
}
}