Skip to content

Commit

Permalink
Merge branch 'import-dialog'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamaa committed Oct 28, 2023
2 parents 5ca1e16 + 0d34671 commit 4015144
Show file tree
Hide file tree
Showing 10 changed files with 591 additions and 52 deletions.
6 changes: 5 additions & 1 deletion source/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

Development
-------------
NEW:
* Added a new series selection dialog for known (non-CSV) file types

CHANGED:
* Upgrade TeeChart to v4.2023.4.18

Version 2.5.0
Expand All @@ -15,7 +19,7 @@ NEW:
* Added support for reading and writing REXCHANGE header values for ZRXP files #123

FIXED:
* Analysis function Accumulate now repects the input interpretation
* Analysis function Accumulate now respects the input interpretation
* Time Series Properties and Values windows now restore on toolbar button press if previously minimized
* Importing from SWMM binary output format:
* Read and store metadata
Expand Down
5 changes: 0 additions & 5 deletions source/Classes/TimeSeriesFile.vb
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ Public MustInherit Class TimeSeriesFile
''' </summary>
Public TimeSeries As Dictionary(Of Integer, TimeSeries)

''' <summary>
''' Instance of the ImportDialog
''' </summary>
Friend ImportDiag As ImportDiag

#End Region 'Eigenschaften

#Region "Properties"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
32 changes: 5 additions & 27 deletions source/Dialogs/ImportDiag.vb → source/Dialogs/ImportCSVDialog.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Imports System.IO
Imports System.Text.RegularExpressions

Friend Class ImportDiag
Friend Class ImportCSVDialog
Inherits System.Windows.Forms.Form

#Region "Eigenschaften"
Expand Down Expand Up @@ -106,9 +106,6 @@ Friend Class ImportDiag

Me.datei = fileInstance

'add type name of file instance to dialog title
Me.Text &= $" - file format: {Me.datei.GetType().Name}"

'initialize input delay timer
Me.inputTimer = New Timers.Timer(1000)
Me.inputTimer.SynchronizingObject = Me
Expand All @@ -135,7 +132,7 @@ Friend Class ImportDiag
Me.ComboBox_DecimalSeparator.Items.Add(Constants.comma)
Me.ComboBox_DecimalSeparator.EndUpdate()

'Combobox Datumsformat füllen
'Combobox Datumsformat füllen
For Each datumsformat As String In Helpers.DateFormats.Values
Me.DateFormat = datumsformat
Next
Expand Down Expand Up @@ -172,25 +169,6 @@ Friend Class ImportDiag
'Dateiname anzeigen
Me.Label_File.Text = "File: " & Path.GetFileName(Me.datei.File)

'Workaround for binary file formats
If TypeOf Me.datei Is Fileformats.SWMM_OUT _
Or TypeOf Me.datei Is Fileformats.SydroSQLite _
Or TypeOf Me.datei Is Fileformats.DFS0 _
Or TypeOf Me.datei Is Fileformats.WBL Then

Me.TextBox_Preview.Text = $"{Path.GetFileName(Me.datei.File)} is a binary file.{eol}Preview is not available!"
'Disable all other fields
Me.GroupBox_Dateformat.Enabled = False
Me.GroupBox_Columns.Enabled = False
Me.GroupBox_DecimalMark.Enabled = False
Me.GroupBox_Settings.Enabled = False
Me.Label_Encoding.Enabled = False
Me.ComboBox_Encoding.Enabled = False
Me.Button_EncodingAutodetect.Enabled = False

Exit Sub
End If

'Vorschau anzeigen
Dim fs As New FileStream(Me.datei.File, FileMode.Open, FileAccess.Read)
Dim StrRead As New StreamReader(fs, Me.selectedEncoding)
Expand All @@ -207,7 +185,7 @@ Friend Class ImportDiag
End If

'replace tab characters with a visual representation
line = line.Replace(vbTab, " » ")
line = line.Replace(vbTab, " » ")

text &= line & Constants.eol

Expand All @@ -226,7 +204,7 @@ Friend Class ImportDiag

End Sub

'OK Button gedrückt
'OK Button gedrückt
'******************
Private Sub Button_OK_Click(sender As Object, e As EventArgs) Handles Button_OK.Click

Expand Down Expand Up @@ -267,7 +245,7 @@ Friend Class ImportDiag
'------------------
Try

'Datenzeile muss nach Überschriften und Einheiten sein!
'Datenzeile muss nach Überschriften und Einheiten sein!
Me.IsInitializing = True
If (Me.NumericUpDown_LineData.Value <= Me.NumericUpDown_LineTitles.Value) Then
Me.NumericUpDown_LineData.Value = Me.NumericUpDown_LineTitles.Value + 1
Expand Down
219 changes: 219 additions & 0 deletions source/Dialogs/SelectSeriesDialog.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4015144

Please sign in to comment.