Skip to content

Commit

Permalink
display an error text in the Time Series Properties window when a tim…
Browse files Browse the repository at this point in the history
…e series' volume is NaN
  • Loading branch information
jamaa committed Nov 19, 2023
1 parent 62ce0f5 commit 28cfaf8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

Development
-------------
NEW:
* Added an error text in the Time Series Properties window when a time series' volume is NaN

FIXED:
* Fixed superfluous metadata in export to ZRXP format #126
* Added a check for title uniqueness when a title is edited in the Time Series properties window
* Disable the ability to sort columns in the Time Series Values window
* Disabled the ability to sort columns in the Time Series Values window

Version 2.6.0
-------------
Expand Down
26 changes: 26 additions & 0 deletions source/Views/PropertiesWindow.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,34 @@ Friend Class PropertiesWindow
''' </summary>
''' <param name="seriesList">the new List of TimeSeries</param>
Public Overloads Sub Update(ByRef seriesList As List(Of TimeSeries))

Me.TimeSeriesBindingSource.DataSource = seriesList
MyBase.Update()

End Sub

''' <summary>
''' Handles data binding complete
''' Adds cell error texts for NaN volumes
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub DataGridView1_DataBindingComplete(sender As Object, e As DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete

'Add cell error texts for NaN volume
Dim colIndex_Volume As Integer
For Each column As DataGridViewColumn In Me.DataGridView1.Columns
If column.Name = "Volume" Then
colIndex_Volume = column.Index
Exit For
End If
Next
For Each row As DataGridViewRow In Me.DataGridView1.Rows
If Double.IsNaN(row.Cells(colIndex_Volume).Value) Then
row.Cells(colIndex_Volume).ErrorText = "Interpretation and/or unit do not allow volume calculation!"
End If
Next

End Sub

''' <summary>
Expand Down

0 comments on commit 28cfaf8

Please sign in to comment.