Fixes in Scales

This commit is contained in:
2023-08-11 22:11:44 +02:00
parent 041e674af9
commit b11dcd273d
7 changed files with 39 additions and 19 deletions

View File

@ -74,14 +74,15 @@ namespace Elwig {
foreach (var s in Config.Scales) {
try {
var id = s[0];
var type = s[1].ToLower();
var type = s[1]?.ToLower();
var model = s[2];
var cnx = s[3];
var empty = s[4];
var filling = s[5];
int? limit = s[6] == null ? null : int.Parse(s[6]);
var log = s[7];
if (type == "systec") {
list.Add(new SystecScale(id, model, cnx, empty, filling, limit));
list.Add(new SystecScale(id, model, cnx, empty, filling, limit, log));
} else {
throw new ArgumentException($"Invalid scale type: \"{type}\"");
}