Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 5ba3317c authored by Kostis ANAGNOSTOPOULOS's avatar Kostis ANAGNOSTOPOULOS
Browse files

Resturcture Modules and Folders

* Import + Export --> IO
* Move new JSON-classes go to IO folder.
* Minor filepath work, prepare for double-extensions ('.xxx.json').
parent 79d0abaa
No related branches found
No related tags found
No related merge requests found
......@@ -105,25 +105,24 @@
<ItemGroup>
<Compile Include="Classes\cGenShp.vb" />
<Compile Include="Classes\cMSC.vb" />
<Compile Include="Classes\cJsonFile.vb" />
<Compile Include="IO\cJsonFile.vb" />
<Compile Include="Classes\CResult.vb" />
<Compile Include="Classes\cPreferences.vb" />
<Compile Include="Classes\cSemanticVersion.vb" />
<Compile Include="IO\cPreferences.vb" />
<Compile Include="cSemanticVersion.vb" />
<Compile Include="Classes\csKey.vb" />
<Compile Include="Classes\cUTMCoord.vb" />
<Compile Include="Classes\cValidSec.vb" />
<Compile Include="Classes\cVehicle.vb" />
<Compile Include="IO\cVehicle.vb" />
<Compile Include="Classes\cVirtMSC.vb" />
<Compile Include="Export\Minor_routines_output.vb" />
<Compile Include="Export\output.vb" />
<Compile Include="Export\OutputTest.vb" />
<Compile Include="IO\output.vb" />
<Compile Include="IO\OutputTest.vb" />
<Compile Include="Calculation\Minor_routines_calculate.vb" />
<Compile Include="Calculation\main_calculation_call.vb" />
<Compile Include="Calculation\Signal_identification.vb" />
<Compile Include="Calculation\sub_linear_regression.vb" />
<Compile Include="Import\read_input.vb" />
<Compile Include="IO\input.vb" />
<Compile Include="GUI\Export_GUI.vb" />
<Compile Include="GUI\minor_routines_GUI.vb" />
<Compile Include="GUI\utils_GUI.vb" />
<Compile Include="GUI\cFileBrowser.vb" />
<Compile Include="GUI\F_Preferences.designer.vb">
<DependentUpon>F_Preferences.vb</DependentUpon>
......@@ -172,7 +171,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ApplicationEvents.vb" />
<Compile Include="Minor_routines.vb" />
<Compile Include="utils.vb" />
<Compile Include="Classes\cFile_v3.vb" />
<Compile Include="CSE_Globals.vb" />
<Compile Include="CSE_Types.vb" />
......
This diff is collapsed.
......@@ -7,8 +7,8 @@
Dim Jobname As String
If fEXT(JobFile) <> "csjob" Then
Jobname = fPath(JobFile) & "\" & fName(JobFile, False) & ".csjob"
If fEXT(JobFile) <> ".csjob" Then
Jobname = joinPaths(fPath(JobFile), fName(JobFile, False) & ".csjob")
Else
Jobname = JobFile
End If
......
......@@ -205,7 +205,7 @@ Public Class F_Main
If OutFolder <> Nothing Then
' Generate the folder if it is desired
Dim resEx As MsgBoxResult
resEx = MsgBox("Output folder doesn´t exist! Create Folder?", MsgBoxStyle.YesNo, "Create folder?")
resEx = MsgBox(format("Output-folder({0}) doesn´t exist! \n\nCreate Folder?", OutFolder), MsgBoxStyle.YesNo, "Create folder?")
If resEx = MsgBoxResult.Yes Then
MkDir(OutFolder)
Else
......@@ -358,7 +358,7 @@ Public Class F_Main
If OutFolder <> Nothing Then
' Generate the folder if it is desired
Dim resEx As MsgBoxResult
resEx = MsgBox("Output folder doesn´t exist! Create Folder?", MsgBoxStyle.YesNo, "Create folder?")
resEx = MsgBox(format("Output-folder({0}) doesn´t exist! \n\nCreate Folder?", OutFolder), MsgBoxStyle.YesNo, "Create folder?")
If resEx = MsgBoxResult.Yes Then
MkDir(OutFolder)
Else
......@@ -399,10 +399,10 @@ Public Class F_Main
If (JobFile <> Nothing) Then
' Clear the GUI
fClear_VECTO_Form(False)
OutFolder = fPath(JobFile) & "\Results\"
OutFolder = joinPaths(fPath(JobFile), "Results\")
' Identify the given Jobfile
If fEXT(JobFile) <> "txt" And fEXT(JobFile) <> "csjob" Then
If fEXT(JobFile) <> ".txt" And fEXT(JobFile) <> ".csjob" Then
fInfWarErr(8, False, "The Inputfile is not a regular VECTO-File: " & JobFile)
Else
' Read the Jobfile and insert the data in the GUI
......@@ -419,7 +419,7 @@ Public Class F_Main
' Open the filebrowser to select the folder and name of the Jobfile
If fbVECTO.SaveDialog(JobFile) Then
JobFile = fbVECTO.Files(0)
OutFolder = fPath(JobFile) & "\Results\"
OutFolder = joinPaths(fPath(JobFile), "Results\")
Me.Text = Formname & " " & JobFile
End If
If (JobFile = Nothing) Then
......
Imports Newtonsoft.Json.Linq
Module minor_routines_GUI
Module utils_GUI
' Clear the GUI
Public Function fClear_VECTO_Form(ByVal Komplet As Boolean, Optional ByVal Fields As Boolean = True) As Boolean
......@@ -374,7 +374,7 @@ Module minor_routines_GUI
If (File = Nothing) Then
fInfWarErr(8, False, "The " & NameFK(position) & "-Inputfile is not a regular " & NameFK(position) & "-File")
Return False
ElseIf (Not File.EndsWith(endung)) And Not (File = varOutStr) Then
ElseIf (Not File.EndsWith(endung, StringComparison.OrdinalIgnoreCase)) And Not (File = varOutStr) Then
fInfWarErr(8, False, "The " & NameFK(position) & "-Inputfile is not a regular " & NameFK(position) & "-File")
Return False
End If
......
File moved
File moved
File moved
File moved
' Read the input data
Public Module read_input
Public Module input
' Read the measurement section config file
Function ReadInputMSC(ByRef MSCX As cMSC, ByVal MSCfile As String, Optional ByVal calibration As Boolean = True) As Boolean
' Declarations
......@@ -79,7 +79,7 @@ Public Module read_input
Return False
End If
If fPath(MSCX.AltPath(i)) = Nothing Then MSCX.AltPath(i) = fPath(MSCfile) & "\" & MSCX.AltPath(i)
If fPath(MSCX.AltPath(i)) = Nothing Then MSCX.AltPath(i) = joinPaths(fPath(MSCfile), MSCX.AltPath(i))
fControlInput(MSCX.AltPath(i), 3, "csalt")
If Not FileIO.FileSystem.FileExists(MSCX.AltPath(i)) Then
fInfWarErrBW(9, False, "Altitude correction = on, altitude file doesen´t exist: " & MSCX.AltPath(i))
......
This diff is collapsed.
File moved
......@@ -3,7 +3,7 @@ Imports Newtonsoft.Json
Imports Newtonsoft.Json.Schema
Imports System.Text.RegularExpressions
Module Minor_routines
Module utils
''' <summary>
''' Utility to check compatibility when reading files, ie 1.0.1-somePre is compatible with [1.0.0--, 2.0.0--)
......@@ -42,8 +42,9 @@ Module Minor_routines
Pfad = Microsoft.VisualBasic.Right(Pfad, Microsoft.VisualBasic.Len(Pfad) - x)
If Not MitEndung Then
x = Pfad.LastIndexOf(".")
If x > 0 Then Pfad = Microsoft.VisualBasic.Left(Pfad, x)
Dim ext = fEXT(Pfad)
Pfad = Pfad.Remove(Pfad.Length - ext.Length)
End If
Return Pfad
......@@ -60,17 +61,16 @@ Module Minor_routines
Return Microsoft.VisualBasic.Left(Pfad, x)
End Function
' Identification from the filenend
' Identification from the filenend, including dot('.')
Public Function fEXT(ByVal Pfad As String) As String
Dim x As Int16
x = Pfad.LastIndexOf(".")
Dim ext = IO.Path.GetExtension(Pfad)
If x = -1 Then
Return ""
Else
Return Microsoft.VisualBasic.Right(Pfad, Microsoft.VisualBasic.Len(Pfad) - x - 1)
If ext.Equals(".json", StringComparison.OrdinalIgnoreCase) Then
Dim prevExt = IO.Path.GetExtension(Pfad.Remove(Pfad.Length - 5)) ' 5 = ".json".Length
ext = prevExt & ext
End If
Return ext
End Function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment