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

Skip to content
Snippets Groups Projects
Commit 6bd18d43 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Added checks if some Required Fields are filled (Electric Motor File, EM ADC...

Added checks if some Required Fields are filled (Electric Motor File, EM ADC Loss Map). Otherwise application would crash.
parent 49959026
No related branches found
No related tags found
No related merge requests found
......@@ -658,13 +658,25 @@ Public Class VehicleForm
For Each reess As ListViewItem In lvREESSPacks.Items
veh.ReessPacks.Add(tuple.Create(reess.SubItems(REESPackTbl.ReessFile).Text, reess.SubItems(REESPackTbl.Count).Text.ToInt(), reess.SubItems(REESPackTbl.StringId).Text.ToInt()))
Next
veh.InitialSOC = tbInitialSoC.Text.ToDouble() / 100.0
veh.InitialSOC = tbInitialSoC.Text.ToDouble(80) / 100.0
If tbElectricMotor.Text = "" then
MsgBox("Electric Motor File is required.")
tcVehicleComponents.SelectedTab = tpElectricComponents
tbElectricMotor.Focus()
return false
End If
veh.ElectricMotorFile.Init(GetPath(file), tbElectricMotor.Text)
veh.ElectricMotorPosition = CType(cbEmPos.SelectedValue, PowertrainPosition)
veh.ElectricMotorCount = tbEmCount.Text.ToInt()
veh.ElectricMotorRatio = tbRatioEm.Text.ToDouble()
veh.ElectricMotorCount = tbEmCount.Text.ToInt(1)
veh.ElectricMotorRatio = tbRatioEm.Text.ToDouble(1)
'veh.ElectricMotorMechEff = tbEmADCLossMap.Text.ToDouble()
If tbEmADCLossMap.Text = "" then
MsgBox("Loss Map EM ADC is required.")
tcVehicleComponents.SelectedTab = tpElectricComponents
tbEmADCLossMap.Focus()
return false
End If
veh.ElectricMotorMechLossMap.Init(GetPath(file), tbEmADCLossMap.Text)
if (veh.ElectricMotorPosition = PowertrainPosition.HybridP2_5)
veh.ElectricMotorPerGearRatios = lvRatioPerGear.Items.Cast(Of ListViewItem).Select(function(item) item.SubItems(RatiosPerGearTbl.Ratio).Text.ToDouble(0)).ToArray()
......
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