Skip to content

Commit

Permalink
WEL format: handle incomplete line with units
Browse files Browse the repository at this point in the history
  • Loading branch information
jamaa committed Sep 25, 2024
1 parent c155e9f commit 18ed09d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/FileFormats/WEL.vb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ Namespace Fileformats
For i = 1 To anzSpalten - 1 'first column is timestamp
sInfo = New TimeSeriesInfo()
sInfo.Name = ZeileSpalten.Substring(Me.DateTimeLength + (i - 1) * Me.ColumnWidth, Me.ColumnWidth).Trim()
sInfo.Unit = ZeileEinheiten.Substring(Me.DateTimeLength + (i - 1) * Me.ColumnWidth, Me.ColumnWidth).Trim()
If ZeileEinheiten.Length < Me.DateTimeLength + (i - 1) * Me.ColumnWidth + Me.ColumnWidth Then
Log.AddLogEntry(levels.warning, $"Unable to read unit for series {sInfo.Name}!")
sInfo.Unit = "-"
Else
sInfo.Unit = ZeileEinheiten.Substring(Me.DateTimeLength + (i - 1) * Me.ColumnWidth, Me.ColumnWidth).Trim()
End If
sInfo.Index = i
Me.TimeSeriesInfos.Add(sInfo)
Next
Expand Down

0 comments on commit 18ed09d

Please sign in to comment.