Compare commits

...

2 Commits

Author SHA1 Message Date
37adf92e80 Bump version to 0.8.8 2024-07-22 09:48:53 +02:00
4c75dbe4aa GassnerScale: Hot fix record parsing 2024-07-22 09:48:18 +02:00
2 changed files with 8 additions and 9 deletions
Elwig

@ -7,7 +7,7 @@
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon> <ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
<Version>0.8.7</Version> <Version>0.8.8</Version>
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages> <SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>

@ -60,14 +60,13 @@ namespace Elwig.Helpers.Weighing {
throw new IOException("Invalid response from scale: Received record has invalid size"); throw new IOException("Invalid response from scale: Received record has invalid size");
var line = record[2..]; var line = record[2..];
var status = line[ 0.. 2]; var brutto = line[ 0.. 7].Trim();
var brutto = line[ 2.. 9].Trim(); var tara = line[ 7..14].Trim();
var tara = line[ 9..16].Trim(); var netto = line[14..21].Trim();
var netto = line[16..23].Trim(); var scaleNr = line[21..23].Trim();
var scaleNr = line[23..25].Trim(); var identNr = line[23..29].Trim();
var identNr = line[25..31].Trim(); var date = line[29..37];
var date = line[31..39]; var time = line[37..43];
var time = line[39..45];
identNr = identNr.Length > 0 && identNr != "0" ? identNr : null; identNr = identNr.Length > 0 && identNr != "0" ? identNr : null;
var parsedDate = DateOnly.ParseExact(date, "yyyyMMdd"); var parsedDate = DateOnly.ParseExact(date, "yyyyMMdd");