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 9412c611 authored by Martin Dippold's avatar Martin Dippold
Browse files

* Update calculation with cardan speed: Calculation only if engine speed is...

* Update calculation with cardan speed: Calculation only if engine speed is not given an automated transmission is used
parent af68205d
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,6 @@
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
'
' See the LICENSE.txt for the specific language governing permissions and limitations.
Module CSE_Globals
Public Enum tComp
t
......@@ -458,25 +457,25 @@ Module CSE_Globals
Case tCompCali.rh_stat
Return "rh_stat"
Case tCompCali.n_ec
If gearBoxConfig.AT Then
If AT Then
Return "n_card"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng"
Else
Return "ERROR"
End If
Case tCompCali.n_ec_1s
If gearBoxConfig.AT Then
If AT Then
Return "n_card_1s"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_1s"
Else
Return "ERROR"
End If
Case tCompCali.n_ec_float
If gearBoxConfig.AT Then
If AT Then
Return "n_card_float"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_float"
Else
Return "ERROR"
......@@ -616,57 +615,57 @@ Module CSE_Globals
Case tCompErg.calcT
Return "calcT"
Case tCompErg.n_ec
If gearBoxConfig.AT Then
If AT Then
Return "n_card"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng"
Else
Return "ERROR"
End If
Case tCompErg.n_ec_1s
If gearBoxConfig.AT Then
If AT Then
Return "n_card_1s"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_1s"
Else
Return "ERROR"
End If
Case tCompErg.n_ec_float
If gearBoxConfig.AT Then
If AT Then
Return "n_card_float"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_float"
Else
Return "ERROR"
End If
Case tCompErg.n_ec_1s_max
If gearBoxConfig.AT Then
If AT Then
Return "n_card_1s_max"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_1s_max"
Else
Return "ERROR"
End If
Case tCompErg.n_ec_1s_min
If gearBoxConfig.AT Then
If AT Then
Return "n_card_1s_min"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_1s_min"
Else
Return "ERROR"
End If
Case tCompErg.n_ec_float_max
If gearBoxConfig.AT Then
If AT Then
Return "n_card_float_max"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_float_max"
Else
Return "ERROR"
End If
Case tCompErg.n_ec_float_min
If gearBoxConfig.AT Then
If AT Then
Return "n_card_float_min"
ElseIf gearBoxConfig.MT_AMT Then
ElseIf MT_AMT Then
Return "n_eng_float_min"
Else
Return "ERROR"
......@@ -768,7 +767,13 @@ Module CSE_Globals
Case tCompErg.val_dist
Return "val_dist"
Case tCompErg.val_n_eng
If AT Then
Return "val_n_card"
ElseIf MT_AMT Then
Return "val_n_eng"
Else
Return "ERROR"
End If
Case tCompErg.CdxAß_singleDS
Return "CdxA(ß)_singleDS"
Case tCompErg.r_dyn
......
......@@ -690,7 +690,7 @@ Module Signal_identification
anz = 0
If coastingSeq = 1 Or coastingSeq = 2 Then
' Set the gearRatio
If gearBoxConfig.MT_AMT Then
If MT_AMT Then
igear = vehicleX.gearRatio_low
Else
igear = 1
......@@ -702,7 +702,7 @@ Module Signal_identification
End If
Else
' Set the gearRatio
If gearBoxConfig.MT_AMT Then
If MT_AMT Then
igear = vehicleX.gearRatio_high
Else
igear = 1
......@@ -712,7 +712,7 @@ Module Signal_identification
' Calculate n_eng/n_card of the speed run
For i = 0 To CalcData(tCompCali.SecID).Count - 1
If gearBoxConfig.MT_AMT Then
If MT_AMT Then
CalcData(tCompCali.n_ec)(i) = InputData(tComp.n_eng)(i)
Else
CalcData(tCompCali.n_ec)(i) = InputData(tComp.n_card)(i)
......
......@@ -32,7 +32,7 @@ Public Module main_calculation_call
logme(7, False, "Reading Input Files...")
Dim vehicle As New cVehicle(Job.vehicle_fpath)
ReadInputMSC(MSC, Job.calib_track_fpath, isCalibrate)
ReadDataFile(Job.calib_run_fpath, MSC)
ReadDataFile(Job.calib_run_fpath, MSC, vehicle)
' Exit function if error is detected
If BWorker.CancellationPending Then Return
......@@ -98,7 +98,7 @@ Public Module main_calculation_call
' Output on the GUI
logme(6, False, "Reading the data file...")
ReadDataFile(Job.coasting_fpaths(i), MSC)
ReadDataFile(Job.coasting_fpaths(i), MSC, vehicle)
' Exit function if error is detected
If BWorker.CancellationPending Then Return
......@@ -820,7 +820,7 @@ Public Module main_calculation_call
' Evaluation
Select Case coastingSeq
Case 1, 2 ' Low speed test
If gearBoxConfig.MT_AMT Then
If MT_AMT Then
igear = vehicleX.gearRatio_low
Else
igear = 1
......@@ -857,7 +857,7 @@ Public Module main_calculation_call
ErgValues(tCompErg.val_tq_1s)(i) = 1
Next i
Case Else ' high speed test
If gearBoxConfig.MT_AMT Then
If MT_AMT Then
igear = vehicleX.gearRatio_high
Else
igear = 1
......
......@@ -985,7 +985,7 @@ Partial Class F_Main
Me.ListBoxWar.Margin = New System.Windows.Forms.Padding(2)
Me.ListBoxWar.Name = "ListBoxWar"
Me.ListBoxWar.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple
Me.ListBoxWar.Size = New System.Drawing.Size(915, 160)
Me.ListBoxWar.Size = New System.Drawing.Size(915, 147)
Me.ListBoxWar.TabIndex = 26
'
'TabPageErr
......@@ -1011,7 +1011,7 @@ Partial Class F_Main
Me.ListBoxErr.Margin = New System.Windows.Forms.Padding(2)
Me.ListBoxErr.Name = "ListBoxErr"
Me.ListBoxErr.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple
Me.ListBoxErr.Size = New System.Drawing.Size(913, 160)
Me.ListBoxErr.Size = New System.Drawing.Size(913, 147)
Me.ListBoxErr.TabIndex = 27
'
'TextBoxVeh
......
......@@ -150,16 +150,23 @@ The generic parameters for classes are stored in the GenShape.shp",
Return
End If
'' Check schema
''
' Check schema
Dim schema = JsonSchema.Parse(JSchemaStr(isStrictBody))
ValidateJson(Body, schema, validateMsgs)
If validateMsgs.Any() Then Return
'' Check others
''
'' Check if vehicle class with the given configuration class is available
' Set transmission
If IsAT Then
AT = True
MT_AMT = False
ElseIf IsMT Then
AT = False
MT_AMT = True
End If
' Check others
' Check if vehicle class with the given configuration class is available
For i = 0 To GenShape.veh_class.Count - 1
If GenShape.veh_class(i) = Me.classCode AndAlso CBool(GenShape.veh_conf(i)) = CBool(Me.configuration) Then
Job.fa_pe = GenShape.fa_pe(i)
......@@ -167,13 +174,10 @@ The generic parameters for classes are stored in the GenShape.shp",
End If
Next i
'' The configuration was not found!
''
' The configuration was not found!
validateMsgs.Add(format("The vehicle (class: {0}, configuration {1}) was not found in the generic shape file. \n\iPlease add it in .", Me.classCode, Me.configuration))
End Sub
#Region "json props"
Public Property classCode As Integer
Get
......@@ -257,7 +261,6 @@ The generic parameters for classes are stored in the GenShape.shp",
Me.Body("axleRatio") = value
End Set
End Property
Public Property gearBox_type As gearBoxConfig
Get
Dim value As String = Me.Body("gearBox_type")
......@@ -275,4 +278,16 @@ The generic parameters for classes are stored in the GenShape.shp",
Return Me.configuration = VehicleConfig.Rigid
End Get
End Property
Public ReadOnly Property IsAT As Boolean
Get
Return Me.gearBox_type = gearBoxConfig.AT
End Get
End Property
Public ReadOnly Property IsMT As Boolean
Get
Return Me.gearBox_type = gearBoxConfig.MT_AMT
End Get
End Property
End Class
......@@ -176,7 +176,7 @@ Public Module input
End Sub
' Read the data file
Public Sub ReadDataFile(ByVal Datafile As String, ByVal MSCX As cMSC)
Public Sub ReadDataFile(ByVal Datafile As String, ByVal MSCX As cMSC, ByVal vehicleX As cVehicle)
' Declarations
Using FileInMeasure As New cFile_V3
Dim Line(), txt As String
......@@ -221,13 +221,8 @@ Public Module input
MeasCheck.Add(tComp.v_veh_CAN, False)
MeasCheck.Add(tComp.vair_ic, False)
MeasCheck.Add(tComp.beta_ic, False)
If gearBoxConfig.AT Then
MeasCheck.Add(tComp.n_card, False)
ElseIf gearBoxConfig.MT_AMT Then
MeasCheck.Add(tComp.n_eng, False)
Else
Throw New Exception("gearBox_type in vehicle file not defined")
End If
MeasCheck.Add(tComp.tq_l, False)
MeasCheck.Add(tComp.tq_r, False)
MeasCheck.Add(tComp.t_amb_veh, False)
......@@ -286,6 +281,27 @@ Public Module input
OptPar(2) = False
Case tComp.user_valid
valid_set = True
Case tComp.n_card, tComp.n_eng
If vehicleX.IsAT Then
If MeasCheck(tComp.n_card) = False Then
If MeasCheck(tComp.n_eng) = False Then
Throw New Exception("Missing signal for " & fCompName(tComp.n_eng) & " or " & fCompName(tComp.n_card))
Else
MT_AMT = True
AT = False
End If
Else
AT = True
MT_AMT = False
End If
End If
If vehicleX.IsMT Then
MT_AMT = True
AT = False
If MeasCheck(tComp.n_eng) = False Then
Throw New Exception("Missing signal for " & fCompName(sKVM.Key))
End If
End If
Case Else
Throw New Exception("Missing signal for " & fCompName(sKVM.Key))
End Select
......
......@@ -296,9 +296,10 @@ Module output
AddToErg(tComp.v_veh_CAN, fCompName(tComp.v_veh_CAN), fCompUnit(tComp.v_veh_CAN), "InputData")
AddToErg(tComp.vair_ic, fCompName(tComp.vair_ic), fCompUnit(tComp.vair_ic), "InputData")
AddToErg(tComp.beta_ic, fCompName(tComp.beta_ic), fCompUnit(tComp.beta_ic), "InputData")
If gearBoxConfig.MT_AMT Then
If MT_AMT Then
AddToErg(tComp.n_eng, fCompName(tComp.n_eng), fCompUnit(tComp.n_eng), "InputData")
Else
ElseIf AT Then
If InputData(tComp.n_eng).Count > 0 Then AddToErg(tComp.n_eng, fCompName(tComp.n_eng), fCompUnit(tComp.n_eng), "InputData")
AddToErg(tComp.n_card, fCompName(tComp.n_card), fCompUnit(tComp.n_card), "InputData")
End If
AddToErg(tComp.tq_l, fCompName(tComp.tq_l), fCompUnit(tComp.tq_l), "InputData")
......
......@@ -49,10 +49,11 @@ Module declaration_public
Public Zone1CentralMeridian = -177 ' Central UTM zone meridian (Will be changed by zone adjustment)
Public Const AmeAng = 180 ' Installation angle of the anemomenter
' Constances for the array declaration
Public JumpPoint As List(Of Integer) ' Point at that a jump in the time-resolved data is detected
Public OptPar() As Boolean = ({True, True, True}) ' Array to identify if optional parameters are given
Public AT As Boolean = False ' Calculation of an automatic transmission (with n_card)
Public MT_AMT As Boolean = False ' Calculation of an manual transmission (always when n_eng available)
' Boolean for the programm control
Public FileBlock As Boolean = False ' Variable if a file is blocked by an other process
......@@ -116,5 +117,4 @@ Module declaration_public
' *****************************************************************
' Backgroundworker
Public BWorker As System.ComponentModel.BackgroundWorker
End Module
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment