Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit e8a7d8c2 authored by David AMO GONZALEZ's avatar David AMO GONZALEZ
Browse files

feat(input): break sim. if LS test exceeds 25 min.

parent fada71ae
No related branches found
No related tags found
1 merge request!3Implement VECTO input for v2.7
...@@ -77,7 +77,7 @@ Public Module main_calculation_call ...@@ -77,7 +77,7 @@ Public Module main_calculation_call
' Read the input files ' Read the input files
logme(7, False, "Reading Input Files...") logme(7, False, "Reading Input Files...")
Dim vehicle As New cVehicle(Job.vehicle_fpath) Dim vehicle As New cVehicle(Job.vehicle_fpath)
If Not fCheckVeh(3, vehicle) And Job.mode = 1 Then Throw New Exception("Accuraty of vehicle parameters not ensured!") If Not fCheckVeh(3, vehicle) And Job.mode = 1 Then Throw New Exception("Accuracy of vehicle parameters not ensured!")
ReadInputMSC(MSC, Job.coast_track_fpath, isCalibrate) ReadInputMSC(MSC, Job.coast_track_fpath, isCalibrate)
If Crt.gradient_correction Then ReadAltitudeFiles(MSC, Altdata) If Crt.gradient_correction Then ReadAltitudeFiles(MSC, Altdata)
ReadWeather(Job.ambient_fpath) ReadWeather(Job.ambient_fpath)
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
' See the LICENSE.txt for the specific language governing permissions and limitations. ' See the LICENSE.txt for the specific language governing permissions and limitations.
' Read the input data ' Read the input data
Public Module input Public Module input
' Read the measurement section config file ' Read the measurement section config file
Sub ReadInputMSC(ByRef MSCX As cMSC, ByVal MSCfile As String, Optional ByVal calibration As Boolean = True) Sub ReadInputMSC(ByRef MSCX As cMSC, ByVal MSCfile As String, Optional ByVal calibration As Boolean = True)
' Declarations ' Declarations
...@@ -422,12 +424,13 @@ Public Module input ...@@ -422,12 +424,13 @@ Public Module input
Dim Comp As tComp Dim Comp As tComp
Dim MeasCheck As New Dictionary(Of tComp, Boolean) Dim MeasCheck As New Dictionary(Of tComp, Boolean)
Dim sKVM As New KeyValuePair(Of tComp, Boolean) Dim sKVM As New KeyValuePair(Of tComp, Boolean)
Dim Spalten As New Dictionary(Of tComp, Integer) Dim Spalten As New Dictionary(Of tComp, Integer) ' Spalten -> Columns
Dim sKV As New KeyValuePair(Of tComp, Integer) Dim sKV As New KeyValuePair(Of tComp, Integer)
Dim SpaltenUndef As New Dictionary(Of String, Integer) Dim SpaltenUndef As New Dictionary(Of String, Integer)
Dim sKVUndef As New KeyValuePair(Of String, Integer) Dim sKVUndef As New KeyValuePair(Of String, Integer)
Dim EnumStr As tCompCali Dim EnumStr As tCompCali
Dim UTMCoord As New cUTMCoord Dim UTMCoord As New cUTMCoord
Dim LowSpeedTestMaxDuration As Double = 25 * 60 ' 25 minutes in seconds
' Initialise ' Initialise
tDim = -1 tDim = -1
...@@ -642,6 +645,7 @@ Public Module input ...@@ -642,6 +645,7 @@ Public Module input
tDim += 1 tDim += 1
Line = FileInMeasure.ReadLine Line = FileInMeasure.ReadLine
For Each sKV In Spalten For Each sKV In Spalten
InputData(sKV.Key).Add(CDbl(Line(sKV.Value))) InputData(sKV.Key).Add(CDbl(Line(sKV.Value)))
If sKV.Key = tComp.t Then If sKV.Key = tComp.t Then
...@@ -738,6 +742,15 @@ Public Module input ...@@ -738,6 +742,15 @@ Public Module input
InputUndefData(sKVUndef.Key).Add(CDbl(Line(sKVUndef.Value))) InputUndefData(sKVUndef.Key).Add(CDbl(Line(sKVUndef.Value)))
Next Next
Loop Loop
If Datafile Is Job.low1_fpath Or Datafile Is Job.low2_fpath Then
Dim initTimestamp = CalcData(tComp.t).First()
Dim lastTimestamp = CalcData(tComp.t).Last()
If (lastTimestamp - initTimestamp) > LowSpeedTestMaxDuration Then
logme(9, False, "The maximum time for the low speed test shall not exceed 25 minutes.")
Throw New Exception("Low speed test shall not exceed 25 minutes.")
End If
End If
Catch ex As Exception Catch ex As Exception
Throw New Exception(format("Exception while reading file({0}), line({1}) due to: {2}!: ", Datafile, tDim + 1, ex.Message), ex) Throw New Exception(format("Exception while reading file({0}), line({1}) due to: {2}!: ", Datafile, tDim + 1, ex.Message), ex)
End Try End Try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment