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

Skip to content
Snippets Groups Projects
Commit 4d68de94 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

don't deserialize fuel map directly, read filename into string and create map

parent 13e235be
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,8 @@ Public Interface IVectoInputs
''' <remarks></remarks>
Property FuelMap As IFuelConsumptionMap
Property FuelMapFile As String
''' <summary>
''' Fuel density used in Vecto.
''' </summary>
......
......@@ -8,7 +8,7 @@
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
'
' See the LICENSE.txt for the specific language governing permissions and limitations.
Imports Newtonsoft.Json
Public Class VectoInputs
Implements IVectoInputs
......@@ -43,8 +43,12 @@ Public Class VectoInputs
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
<JsonIgnore>
Public Property FuelMap As IFuelConsumptionMap Implements IVectoInputs.FuelMap
<JsonProperty("FuelMap")>
Public Property FuelMapFile As String Implements IVectoInputs.FuelMapFile
''' <summary>
''' Fuel Density as used in Vecto.
''' </summary>
......
......@@ -129,7 +129,7 @@ Public Class AuxiliaryConfig
'Consumer list
If _
Me.ElectricalUserInputsConfig.ElectricalConsumers.Items.Count <>
other.ElectricalUserInputsConfig.ElectricalConsumers.Items.count Then Return False
other.ElectricalUserInputsConfig.ElectricalConsumers.Items.Count Then Return False
Dim i As Integer
For i = 0 To Me.ElectricalUserInputsConfig.ElectricalConsumers.Items.Count - 1
Dim thisConsumer, otherConsumer As IElectricalConsumer
......@@ -153,7 +153,7 @@ Public Class AuxiliaryConfig
'ResultCardIdle
If _
Me.ElectricalUserInputsConfig.ResultCardIdle.Results.count <>
Me.ElectricalUserInputsConfig.ResultCardIdle.Results.Count <>
other.ElectricalUserInputsConfig.ResultCardIdle.Results.Count Then Return False
For i = 0 To Me.ElectricalUserInputsConfig.ResultCardIdle.Results.Count - 1
If _
......@@ -165,7 +165,7 @@ Public Class AuxiliaryConfig
'ResultCardOverrun
If _
Me.ElectricalUserInputsConfig.ResultCardOverrun.Results.count <>
Me.ElectricalUserInputsConfig.ResultCardOverrun.Results.Count <>
other.ElectricalUserInputsConfig.ResultCardOverrun.Results.Count Then Return False
For i = 0 To Me.ElectricalUserInputsConfig.ResultCardOverrun.Results.Count - 1
If _
......@@ -178,7 +178,7 @@ Public Class AuxiliaryConfig
'ResultCardTraction
If _
Me.ElectricalUserInputsConfig.ResultCardTraction.Results.count <>
Me.ElectricalUserInputsConfig.ResultCardTraction.Results.Count <>
other.ElectricalUserInputsConfig.ResultCardTraction.Results.Count Then Return False
For i = 0 To Me.ElectricalUserInputsConfig.ResultCardTraction.Results.Count - 1
If _
......@@ -322,7 +322,14 @@ Public Class AuxiliaryConfig
'This is where we Assume values of loaded( Deserialized ) object.
AssumeValuesOfOther(tmpAux)
Dim tmp As cMAP = New cMAP
tmp.FilePath = Path.Combine(Path.GetDirectoryName(auxFile), tmpAux.VectoInputs.FuelMapFile)
If Not tmp.ReadFile() Then
MessageBox.Show("Unable to read fuel map, aborting.")
Return False
End If
tmp.Triangulate()
VectoInputs.FuelMap = tmp
Catch ex As Exception
returnValue = False
......@@ -360,7 +367,7 @@ Public Class AuxiliaryConfig
otherConsumer.PhaseIdle_TractionOn,
otherConsumer.PowerNetVoltage,
otherConsumer.NumberInActualVehicle,
otherConsumer.info)
otherConsumer.Info)
Me.ElectricalUserInputsConfig.ElectricalConsumers.Items.Add(newConsumer)
......
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