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

* Read old vehicle files

* Drift correction only for new vehicle files
parent e6510e50
Branches
Tags
No related merge requests found
...@@ -1100,6 +1100,7 @@ Public Module main_calculation_call ...@@ -1100,6 +1100,7 @@ Public Module main_calculation_call
End If End If
'Check the left drift 'Check the left drift
If Not vehicle.OldVehicle Then
If Math.Abs(Convert.ToDouble(vehicle.tqDriftLeft)) > 25 Then If Math.Abs(Convert.ToDouble(vehicle.tqDriftLeft)) > 25 Then
Flag = False Flag = False
logme(9, False, format("The tqLeftDrift in the vehicle file ({0}) is greater then |25|!", Job.vehicle_fpath)) logme(9, False, format("The tqLeftDrift in the vehicle file ({0}) is greater then |25|!", Job.vehicle_fpath))
...@@ -1109,6 +1110,9 @@ Public Module main_calculation_call ...@@ -1109,6 +1110,9 @@ Public Module main_calculation_call
Flag = False Flag = False
logme(9, False, format("The tqRightDrift in the vehicle file ({0}) is greater then |25|!", Job.vehicle_fpath)) logme(9, False, format("The tqRightDrift in the vehicle file ({0}) is greater then |25|!", Job.vehicle_fpath))
End If End If
Else
logme(8, False, format("Old vehicle file is used. CALCULATION WITHOUT DRIFT CORRECTION! ({0})", Job.vehicle_fpath))
End If
Return Flag Return Flag
End Function End Function
......
...@@ -18,7 +18,9 @@ Public Enum VehicleConfig ...@@ -18,7 +18,9 @@ Public Enum VehicleConfig
End Enum End Enum
Public Enum gearBoxConfig Public Enum gearBoxConfig
AT
APT APT
MT_AMT
SMT SMT
AMT AMT
DCT DCT
...@@ -26,6 +28,7 @@ End Enum ...@@ -26,6 +28,7 @@ End Enum
Public Class cVehicle Public Class cVehicle
Inherits cJsonFile Inherits cJsonFile
Private IsOldVeh As Boolean
Protected Overrides Function HeaderOverlay() As JObject Protected Overrides Function HeaderOverlay() As JObject
Return JObject.Parse(<json>{ Return JObject.Parse(<json>{
...@@ -146,7 +149,75 @@ The generic parameters for classes are stored in the GenShape.shp", ...@@ -146,7 +149,75 @@ The generic parameters for classes are stored in the GenShape.shp",
} }
}</json>.Value }</json>.Value
End Function End Function
Public Shared Function JSchemaStrOld(Optional ByVal isStrictBody As Boolean = False) As String
Dim allowAdditionalProps_str As String = (Not isStrictBody).ToString.ToLower
Return <json>{
"title": "Schema for VECTO-Air Drag VEHICLE",
"type": "object", "additionalProperties": <%= allowAdditionalProps_str %>,
"required": true,
"properties": {
"classCode": {
"title": "Class code [1-16]",
"type": "integer",
"required": true,
"description": "The class the vehicle belongs to according to the legislation.
The generic parameters for classes are stored in the GenShape.shp",
},
"configuration with trailer": {
"title": "Vehicle Configuration with trailer",
"enum": ["no", "yes"],
"required": true,
"title": "Vehicle contains trailer?",
},
"GVMMax": {
"title": "Maximum gross vehicle mass [kg]",
"type":"number",
"required": true,
},
"vVehMax": {
"title": "Vehicle maximum design speed [km/h]",
"type":"number",
"required": false,
},
"vehHeight": {
"title": "Vehicle height [m]",
"type":"number",
"required": true,
} ,
"anemometerHeight": {
"title": "Anemomenter height [m]",
"type":"number",
"required": true,
},
"testMass": {
"title": "Vehicle test mass [kg]",
"type":"number",
"required": true,
},
"gearRatio_low": {
"title": "Gear ratio low speed",
"type":"string",
"required": true,
},
"gearRatio_high": {
"title": "Gear ratio high speed",
"type":"string",
"required": true,
},
"axleRatio": {
"title": "Axle ratio",
"type":"string",
"required": true,
},
"gearBox_type": {
"title": "gearBox type",
"enum": ["MT_AMT", "AT"],
"required": true,
"title": "Gear box type is MT_AMT or AT?",
},
}
}</json>.Value
End Function
''' <summary>creates defaults</summary> ''' <summary>creates defaults</summary>
''' <remarks>See cJsonFile() constructor</remarks> ''' <remarks>See cJsonFile() constructor</remarks>
...@@ -177,8 +248,15 @@ The generic parameters for classes are stored in the GenShape.shp", ...@@ -177,8 +248,15 @@ The generic parameters for classes are stored in the GenShape.shp",
End If End If
' Check schema ' Check schema
If (Me.FileVersion = "1.0.0") Then
Dim schema = JsonSchema.Parse(JSchemaStrOld(isStrictBody))
ValidateJson(Body, schema, validateMsgs)
IsOldVeh = True
Else
Dim schema = JsonSchema.Parse(JSchemaStr(isStrictBody)) Dim schema = JsonSchema.Parse(JSchemaStr(isStrictBody))
ValidateJson(Body, schema, validateMsgs) ValidateJson(Body, schema, validateMsgs)
IsOldVeh = False
End If
If validateMsgs.Any() Then Return If validateMsgs.Any() Then Return
...@@ -327,6 +405,14 @@ The generic parameters for classes are stored in the GenShape.shp", ...@@ -327,6 +405,14 @@ The generic parameters for classes are stored in the GenShape.shp",
Me.Body("tDriftCheck") = value Me.Body("tDriftCheck") = value
End Set End Set
End Property End Property
Public Property OldVehicle As Boolean
Get
Return IsOldVeh
End Get
Set(ByVal value As Boolean)
IsOldVeh = value
End Set
End Property
#End Region ' "json props" #End Region ' "json props"
Public ReadOnly Property IsWithTrailer As Boolean Public ReadOnly Property IsWithTrailer As Boolean
...@@ -337,13 +423,13 @@ The generic parameters for classes are stored in the GenShape.shp", ...@@ -337,13 +423,13 @@ The generic parameters for classes are stored in the GenShape.shp",
Public ReadOnly Property IsAPT As Boolean Public ReadOnly Property IsAPT As Boolean
Get Get
Return Me.gearBox_type = gearBoxConfig.APT Return (Me.gearBox_type = gearBoxConfig.APT Or Me.gearBox_type = gearBoxConfig.AT)
End Get End Get
End Property End Property
Public ReadOnly Property IsSMT_AMT_DCT As Boolean Public ReadOnly Property IsSMT_AMT_DCT As Boolean
Get Get
Return (Me.gearBox_type = gearBoxConfig.SMT Or Me.gearBox_type = gearBoxConfig.AMT Or Me.gearBox_type = gearBoxConfig.DCT) Return (Me.gearBox_type = gearBoxConfig.SMT Or Me.gearBox_type = gearBoxConfig.AMT Or Me.gearBox_type = gearBoxConfig.DCT Or Me.gearBox_type = gearBoxConfig.MT_AMT)
End Get End Get
End Property End Property
End Class End Class
...@@ -644,8 +644,13 @@ Public Module input ...@@ -644,8 +644,13 @@ Public Module input
End If End If
Next sKV Next sKV
If (vehicleX.OldVehicle) Then
CalcData(tCompCali.tq_l_c).Add(InputData(tComp.tq_l)(tDim))
CalcData(tCompCali.tq_r_c).Add(InputData(tComp.tq_r)(tDim))
Else
CalcData(tCompCali.tq_l_c).Add(InputData(tComp.tq_l)(tDim) - vehicleX.tqDriftLeft * (InputData(tComp.t)(tDim) - vehicleX.tDriftZero) / (vehicleX.tDriftCheck - vehicleX.tDriftZero)) CalcData(tCompCali.tq_l_c).Add(InputData(tComp.tq_l)(tDim) - vehicleX.tqDriftLeft * (InputData(tComp.t)(tDim) - vehicleX.tDriftZero) / (vehicleX.tDriftCheck - vehicleX.tDriftZero))
CalcData(tCompCali.tq_r_c).Add(InputData(tComp.tq_r)(tDim) - vehicleX.tqDriftRight * (InputData(tComp.t)(tDim) - vehicleX.tDriftZero) / (vehicleX.tDriftCheck - vehicleX.tDriftZero)) CalcData(tCompCali.tq_r_c).Add(InputData(tComp.tq_r)(tDim) - vehicleX.tqDriftRight * (InputData(tComp.t)(tDim) - vehicleX.tDriftZero) / (vehicleX.tDriftCheck - vehicleX.tDriftZero))
End If
If valid_set Then If valid_set Then
If tDim = 0 Then If tDim = 0 Then
......
...@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ...@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.1.8.3")> <Assembly: AssemblyVersion("3.1.8.4")>
<Assembly: AssemblyFileVersion("3.1.8.3")> <Assembly: AssemblyFileVersion("3.1.8.4")>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment