diff --git a/CSE/Calculation/main_calculation_call.vb b/CSE/Calculation/main_calculation_call.vb index b43acc93bb4d6a6d6514969b2507e6517973e057..b11b59802a7fe7eaf59518f7969b066afe93b11d 100644 --- a/CSE/Calculation/main_calculation_call.vb +++ b/CSE/Calculation/main_calculation_call.vb @@ -51,6 +51,7 @@ fOutCalcRes(isCalibrate) End Try Else + ' Declaration Dim MSC As New cMSC Dim vMSC As New cVirtMSC diff --git a/CSE/Calculation/sub_linear_regression.vb b/CSE/Calculation/sub_linear_regression.vb index a852e4b2af40be30356a54b371062a1a3a8a95e3..08ec315d11c8aba9174e54041a3e9e94328d3a80 100644 --- a/CSE/Calculation/sub_linear_regression.vb +++ b/CSE/Calculation/sub_linear_regression.vb @@ -400,7 +400,7 @@ ' Find the correct curve For i = 0 To GenShape.veh_class.Count - 1 - If GenShape.veh_class(i) = vehicleX.classCode And CBool(GenShape.veh_conf(i)) = vehicleX.IsRigid Then + If GenShape.veh_class(i) = vehicleX.classCode And CBool(GenShape.veh_conf(i)) = Not vehicleX.IsRigid Then pos = i Exit For End If diff --git a/CSE/GUI/F_Main.vb b/CSE/GUI/F_Main.vb index 3397092ebbb34c44af801c688aee5fc5db227f85..77e92557e0fd11f1667d175346692852bae350ae 100644 --- a/CSE/GUI/F_Main.vb +++ b/CSE/GUI/F_Main.vb @@ -242,6 +242,9 @@ Public Class F_Main ' Change the button "Exec" --> "Cancel" Me.CalibrationState = True + ' Reset Values + Job.ResetValue(True) + ' Save the Jobfiles doSaveJob(False) @@ -322,6 +325,9 @@ Public Class F_Main fWriteLog(2, 4, "----- Speed runs ") + ' Reset Values + Job.ResetValue() + ' Save the Jobfiles doSaveJob(False) diff --git a/CSE/IO/cJob.vb b/CSE/IO/cJob.vb index c3128cca1e47550a51d41c266be324243b662acf..a2037e274cf670e61c907ed9945e4e34958cc23f 100644 --- a/CSE/IO/cJob.vb +++ b/CSE/IO/cJob.vb @@ -185,6 +185,24 @@ Public Class cJob MyBase.New(inputFilePath, skipValidation) End Sub + ' Reset the Values to Standard + Friend Sub ResetValue(Optional IsCalibration As Boolean = False) + If IsCalibration Then + Job.fv_veh = 0 + Job.fa_pe = 1 + Job.fv_pe = 0 + Job.beta_ame = 0 + End If + + Job.CdxA = 0 + Job.beta = 0 + Job.delta_CdxA = 0 + Job.CdxA0 = 0 + Job.CdxA0_opt2 = 0 + Job.valid_t_tire = True + Job.valid_t_amb = True + Job.valid_RRC = True + End Sub Protected Overrides Function BodySchemaStr() As String Return JSchemaStr() @@ -220,19 +238,19 @@ Public Class cJob Public beta_f As Double Public beta_d As Double - Public fv_veh As Double = 0 - Public fv_veh_opt2 As Double = 0 - Public fa_pe As Double = 1 - Public fv_pe As Double = 0 - Public beta_ame As Double = 0 - Public CdxA As Double = 0 - Public beta As Double = 0 - Public delta_CdxA As Double = 0 - Public CdxA0 As Double = 0 - Public CdxA0_opt2 As Double = 0 - Public valid_t_tire As Boolean = True - Public valid_t_amb As Boolean = True - Public valid_RRC As Boolean = True + Public fv_veh As Double + Public fv_veh_opt2 As Double + Public fa_pe As Double + Public fv_pe As Double + Public beta_ame As Double + Public CdxA As Double + Public beta As Double + Public delta_CdxA As Double + Public CdxA0 As Double + Public CdxA0_opt2 As Double + Public valid_t_tire As Boolean + Public valid_t_amb As Boolean + Public valid_RRC As Boolean Protected Overrides Sub OnContentUpdated() Dim anem = PropOrDefault(".Anemometer") diff --git a/DemoData/EvaluationDemo.csjob.json b/DemoData/EvaluationDemo.csjob.json index ff5898ada5ddf76cdb8dac07206a5707c14f3b03..5a741c878a91641f0e50da50be0a9a25828fd616 100644 --- a/DemoData/EvaluationDemo.csjob.json +++ b/DemoData/EvaluationDemo.csjob.json @@ -3,413 +3,10 @@ "Title": "vecto-cse JOB", "FileVersion": "1.0.0", "AppVersion": "2.0.1-pre3", - "ModifiedDate": "2014.06.24 16:20:19 +02:00", + "ModifiedDate": "2014.06.25 08:36:29 +02:00", "CreatedBy": "VKMTHD\\martindippold@Dippold(lic: 88070b7c-1b69-4d65-a112-10c57f86f5ad)", "StrictBody": null, - "BodySchema": { - "title": "Schema for vecto-cse VEHICLE", - "type": "object", - "additionalProperties": true, - "required": true, - "properties": { - "vehicle_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to Vehicle file (*.csveh)" - }, - "Anemometer": { - "type": "object", - "description": "The Anemometer calibration factors (floats).", - "default": { - "v_air_f": 1, - "v_air_d": 0, - "beta_f": 1, - "beta_d": 0 - } - }, - "ambient_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to the Ambient(Weather) file (*.csamb)" - }, - "calib_track_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to Track-sections (*.csmsc)." - }, - "calib_run_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to a measurement-file (*.csdat)" - }, - "coast_track_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to Track-sections (*.csmsc)." - }, - "low1_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to a measurement-file (*.csdat)" - }, - "high_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to a measurement-file (*.csdat)" - }, - "low2_fpath": { - "type": [ - "null", - "string" - ], - "description": "File-path to a measurement-file (*.csdat)" - }, - "Criteria": { - "title": "Schema for vecto-cse CRITERIA", - "type": "object", - "additionalProperties": true, - "required": true, - "properties": { - "Processing": { - "type": "object", - "required": true, - "additionalProperties": true, - "properties": { - "rho_air_ref": { - "type": "number", - "required": true, - "description": "Reference air density.", - "units": "kg/m^3" - }, - "accel_correction": { - "type": "boolean", - "required": true, - "description": "When True, applies acceleration correction." - }, - "gradient_correction": { - "type": "boolean", - "required": true, - "description": "When True, applies gradient correction." - }, - "hz_out": { - "type": "integer", - "required": true, - "description": "The sampling-rate of the result files.", - "units": "Hz" - }, - "rr_corr_factor": { - "type": "number", - "required": true, - "description": "Rolling resistance correction factor" - }, - "acc_corr_avg": { - "type": "number", - "required": true, - "description": "Averaging of vehicle speed for correction of acceleration forces.", - "units": "s" - }, - "dist_float": { - "type": "number", - "required": true, - "description": "Distance used for calculation of floatinig average signal used for stability criteria in low speeds.", - "units": "m" - } - } - }, - "Validation": { - "type": "object", - "required": true, - "additionalProperties": true, - "properties": { - "trigger_delta_x_max": { - "type": "number", - "required": true, - "description": "+/- size of the control area around a MS start/end point where a trigger signal is valid (driving direction).", - "units": "m" - }, - "trigger_delta_y_max": { - "type": "number", - "required": true, - "description": "+/- size of the control area around a MS start/end point where a trigger signal is valid (perpendicular to driving direction)", - "units": "m" - }, - "delta_head_max": { - "type": "number", - "required": true, - "description": "+/- maximum deviation from heading as read from the csdat-file to the heading from csms-file for a valid dataset.", - "units": "°" - }, - "segruns_min_CAL": { - "type": "integer", - "required": true, - "description": "Minimum number of valid datasets required for the calibration test (per combination of MS ID and DIR ID)." - }, - "segruns_min_LS": { - "type": "integer", - "required": true, - "description": "Minimum number of valid datasets required for the low speed (per combination of MS ID and DIR ID)." - }, - "segruns_min_HS": { - "type": "integer", - "required": true, - "description": "Minimum number of valid datasets required for the high speed (per combination of MS ID and DIR ID)." - }, - "segruns_min_head_MS": { - "type": "integer", - "required": true, - "description": "Minimum TOTAL number of valid datasets required for the high speed per heading." - }, - "delta_Hz_max": { - "type": "number", - "required": true, - "description": "Maximum allowed deviation of timestep-size in csdat-file from 100Hz.", - "units": "%" - }, - "delta_parallel_max": { - "type": "number", - "required": true, - "description": "Maximum heading difference for measurement section (parallelism criteria for test track layout).", - "units": "°" - }, - "v_wind_avg_max_CAL": { - "type": "number", - "required": true, - "description": "Maximum average wind speed (calibration).", - "units": "m/s" - }, - "v_wind_1s_max_CAL": { - "type": "number", - "required": true, - "description": "Maximum gust wind speed (calibration).", - "units": "m/s" - }, - "beta_avg_max_CAL": { - "type": "number", - "required": true, - "description": "Maximum average beta (calibration).", - "units": "°" - }, - "leng_crit": { - "type": "number", - "required": true, - "description": "Maximum absolute difference of distance driven with lenght of section as specified in configuration", - "units": "M" - }, - "v_wind_avg_max_LS": { - "type": "number", - "required": true, - "description": "Maximum average wind speed during (low speed).", - "units": "m/s" - }, - "v_wind_1s_max_LS": { - "type": "number", - "required": true, - "description": "Maximum gust wind speed (low speed).", - "units": "m/s" - }, - "v_veh_avg_min_LS": { - "type": "number", - "required": true, - "description": "Minimum average vehicle speed (low speed).", - "units": "km/h" - }, - "v_veh_avg_max_LS": { - "type": "number", - "required": true, - "description": "Maximum average vehicle speed (low speed).", - "units": "km/h" - }, - "v_veh_float_delta_LS": { - "type": "number", - "required": true, - "description": "+/- maximum deviation of floating average vehicle speed from average vehicle speed over entire section (low speed)", - "units": "km/h" - }, - "tq_sum_float_delta_LS": { - "type": "number", - "required": true, - "description": "+/- maximum relative deviation of floating average torque from average torque over entire section (low speed)" - }, - "v_wind_avg_max_HS": { - "type": "number", - "required": true, - "description": "Maximum average wind speed (high speed).", - "units": "m/s" - }, - "v_wind_1s_max_HS": { - "type": "number", - "required": true, - "description": "Maximum gust wind speed (high speed).", - "units": "m/s" - }, - "beta_avg_max_HS": { - "type": "number", - "required": true, - "description": "Maximum average beta during (high speed).", - "units": "°" - }, - "v_veh_avg_min_HS": { - "type": "number", - "required": true, - "description": "Minimum average vehicle speed (high speed).", - "units": "km/h" - }, - "v_veh_1s_delta_HS": { - "type": "number", - "required": true, - "description": "+/- maximum deviation of 1s average vehicle speed from average vehicle speed over entire section (high speed).", - "units": "km/h" - }, - "tq_sum_1s_delta_HS": { - "type": "number", - "required": true, - "description": "+/- maximum relative deviation of 1s average torque from average torque over entire section (high speed)." - }, - "delta_t_tyre_max": { - "type": "number", - "required": true, - "description": "Maximum variation of tyre temperature between high speeds and low speeds.", - "units": "°C" - }, - "delta_rr_corr_max": { - "type": "number", - "required": true, - "description": "Maximum difference of RRC from the two low speed runs.", - "units": "kg/t" - }, - "t_amb_min": { - "type": "number", - "required": true, - "description": "Minimum ambient temperature (measured at the vehicle) during the tests (evaluated based on the used datasets only)", - "units": "°C" - }, - "t_amb_max": { - "type": "number", - "required": true, - "description": "Maximum ambient temperature (measured at the vehicle) during the tests (evaluated based on the used datasets only) .", - "units": "°C" - }, - "t_amb_var": { - "type": "number", - "required": true, - "description": "Maximum variation of ambient temperature (measured at the vehicle) during the tests (evaluated based on the used datasets only).", - "units": "°C" - }, - "t_amb_tarmac": { - "type": "number", - "required": true, - "description": "Maximum temperature below which no documentation of tarmac conditions is necessary.", - "units": "°C" - } - } - } - } - }, - "properties": { - "Calibration": { - "type": "object", - "required": true, - "additionalProperties": true, - "properties": { - "fv_veh": { - "type": "number", - "required": true, - "description": "Calibration factor for vehicle speed." - }, - "fv_pe": { - "type": "number", - "required": true, - "description": "Calibration factor for air speed (position error)." - }, - "fa_pe": { - "type": "number", - "required": true, - "description": "Position error correction factor for measured air inflow angle (beta)." - }, - "beta_ame": { - "type": "number", - "required": true, - "description": "Calibration factor for beta (misalignment).", - "units": "°" - } - } - }, - "Evaluation": { - "type": "object", - "required": true, - "additionalProperties": true, - "properties": { - "CdxA": { - "type": "number", - "required": true, - "description": "Average CdxA before yaw angle correction", - "units": "m^2" - }, - "beta": { - "type": "number", - "required": true, - "description": "Average absolute yaw angle from high speed tests.", - "units": "m^2" - }, - "delta_CdxA": { - "type": "number", - "required": true, - "description": "Correction of CdxA for yaw angle.", - "units": "m^2" - }, - "CdxA0": { - "type": "number", - "required": true, - "description": "Correction of CdxA for zero yaw angle.", - "units": "m^2" - }, - "CdxA0_opt2": { - "type": "number", - "required": true, - "description": "Average CdxA for zero yaw angle (yaw angle correction performed before averaging of measurement sections).", - "units": "m^2" - } - } - }, - "Validity": { - "type": "object", - "required": true, - "additionalProperties": true, - "properties": { - "valid_t_tire": { - "type": "boolean", - "required": true, - "description": "Invalid if the maximum ambient temperature exceeded." - }, - "valid_t_amb": { - "type": "boolean", - "required": true, - "description": "Invalid if the ambient temperature fallen below minimum." - }, - "valid_RRC": { - "type": "boolean", - "required": true, - "description": "Invalid if the ambient temperature higher than allowed." - } - } - } - } - } - } + "BodySchema": null }, "Body": { "vehicle_fpath": "DemoData\\VehicleDemo.csveh.json", @@ -464,18 +61,18 @@ "t_amb_tarmac": 25 } }, - "fv_veh": 0.0, + "fv_veh": 0.971, "fa_pe": 1.0, - "fv_pe": 0.0, - "beta_ame": 0.0, - "CdxA": 0.0, - "beta": 0.0, - "delta_CdxA": 0.0, - "CdxA0": 0.0, - "CdxA0_opt2": 0.0, + "fv_pe": 1.073, + "beta_ame": -0.01, + "CdxA": 5.59563, + "beta": 0.94651, + "delta_CdxA": 0.08069, + "CdxA0": 5.51494, + "CdxA0_opt2": 5.50584, "valid_t_tire": true, "valid_t_amb": true, - "valid_RRC": true, + "valid_RRC": false, "v_air_f": 1.0, "v_air_d": 0.0, "beta_f": 1.0,