Weighing: Add SchemberEventScale

This commit is contained in:
2024-02-21 18:33:36 +01:00
parent d289a5d4bf
commit 10b78dfb72
6 changed files with 130 additions and 36 deletions

View File

@ -24,7 +24,7 @@ namespace Elwig.Helpers.Weighing {
int? limit = config.Limit != null ? int.Parse(config.Limit) : null;
if (config.Type == "SysTec-IT") {
return new SysTecITScale(config.Id, config.Model!, config.Connection!, config.Empty, config.Filling, limit, config.Log);
} else if (config.Type == "Schember-evt") {
} else if (config.Type == "Schember-Evt") {
return new SchemberEventScale(config.Id, config.Model!, config.Connection!, config.Empty, config.Filling, limit, config.Log);
} else {
throw new ArgumentException($"Invalid scale type: \"{config.Type}\"");
@ -39,7 +39,7 @@ namespace Elwig.Helpers.Weighing {
Tcp = Utils.OpenTcpConnection(cnx);
Stream = Tcp.GetStream();
} else {
throw new ArgumentException("Unsupported scheme");
throw new ArgumentException($"Unsupported scheme: \"{cnx.Split(':')[0]}\"");
}
LogPath = log;