Add weight limit to scale
This commit is contained in:
@ -29,8 +29,9 @@ namespace Elwig.Helpers.Weighing {
|
||||
public int ScaleNr { get; private set; }
|
||||
public bool IsReady { get; private set; }
|
||||
public bool HasFillingClearance { get; private set; }
|
||||
public int? WeightLimit { get; private set; }
|
||||
|
||||
public SystecScale(int scaleNr, string model, string connection, string? empty = null, string? fill = null) {
|
||||
public SystecScale(int scaleNr, string model, string connection, string? empty = null, string? fill = null, int? limit = null) {
|
||||
ScaleNr = scaleNr;
|
||||
Model = model;
|
||||
IsReady = true;
|
||||
@ -81,6 +82,9 @@ namespace Elwig.Helpers.Weighing {
|
||||
EmptyDelay = int.Parse(parts[1]);
|
||||
}
|
||||
FillingClearanceMode = ConvertOutput(fill);
|
||||
WeightLimit = limit;
|
||||
if (FillingClearanceMode != null && WeightLimit == null)
|
||||
throw new ArgumentException("Weight limit has to be set, if filling clearance supervision is enalbed");
|
||||
|
||||
Writer = new(stream, Encoding.ASCII, -1, true);
|
||||
Reader = new(stream, Encoding.ASCII, false, -1, true);
|
||||
|
Reference in New Issue
Block a user