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

Skip to content
Snippets Groups Projects
Commit ccb14773 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

read CFNCV and edit (started) through GUI

parent 5d8f7edb
No related branches found
No related tags found
No related merge requests found
Showing with 445 additions and 247 deletions
This diff is collapsed.
......@@ -151,7 +151,7 @@
<data name="PictureBox2.InitialImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAApMAAACBCAYAAACclzFEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wAAADsABataJCQAAIcpJREFUeF7tnY2167xxRVNCakgJqcElpAaXkB5SgmtwCV8NLsE1uARnH5ojj0ag
vwAADr8BOAVTJAAAIcpJREFUeF7tnY2167xxRVNCakgJqcElpAaXkB5SgmtwCV8NLsE1uARnH5ojj0ag
REok+HfOWvs9XZAiKYgABjMD6j/++c9/GmOMMacB/Tf8Bf4G/4C/wx/w59b+xphtaRYaY4wxRwT9FWRA
/hn+cyz7L5BxqT+07U/1fcaY7WgWGmOMMUdjNBjlhRyMyMZ2eSf1Qvx3ax9jzPo0C40xxpgjgeR91IvJ
UDb607iP+HtrH2PM+jQLjTHGmCOBFNYOQ/EvE/v8Z9pHND2Yxph1aRYaY4wxRwL9bzIS/2jtI9I+wsak
......
......@@ -10,6 +10,7 @@
' See the LICENSE.txt for the specific language governing permissions and limitations.
'Option Infer On
Imports System.Collections.Generic
Imports System.Drawing.Imaging
Imports System.IO
Imports System.Linq
......@@ -365,9 +366,40 @@ Public Class VectoVTPJobForm
Handles TbVEH.TextChanged
UpdateAuxList()
UpdatePic()
UpdateNCVs()
Change()
End Sub
Private Sub UpdateNCVs()
' TODO: Reset to default
Dim vehicleFile As String =
If _
(Not String.IsNullOrWhiteSpace(VectoFile), Path.Combine(Path.GetDirectoryName(VectoFile), TbVEH.Text),
TbVEH.Text)
If File.Exists(vehicleFile) Then
Try
Dim inputData As IDeclarationInputDataProvider =
_xmlInputReader.CreateDeclaration(XmlReader.Create(vehicleFile))
Dim fuels As IList(Of IEngineFuelDeclarationInputData) =
inputData.JobInputData.Vehicle.Components.EngineInputData.EngineModes.First().Fuels
Dim entry As IEngineFuelDeclarationInputData
For Each entry In fuels
Console.WriteLine("FuelType = " & entry.FuelType)
Console.WriteLine("CFNCV = " & entry.NetCalorificValueCorrectionFactor)
Next
Catch
End Try
End If
End Sub
Private Sub UpdateAuxList()
Dim vehicleFile As String =
If _
......@@ -758,6 +790,10 @@ Public Class VectoVTPJobForm
tbManufacturerRecord.Text = GetFilenameWithoutDirectory(ManRXMLFileBrowser.Files(0), GetPath(VectoFile))
End If
End Sub
Private Sub Label13_Click(sender As Object, e As EventArgs) Handles _ncvFuel1Lbl.Click
End Sub
End Class
......@@ -507,8 +507,9 @@ Public Class EngineFuel
Friend ReadOnly _fuelConsumptionMapPath As SubPath
Public ColdHotBalancingFactorInput As Double
Public correctionFactorRegPerInput As Double
Public ColdHotBalancingFactorInput As Double
Public NetCalorificValueCorrectionFactorInput As Double
Public correctionFactorRegPerInput As Double
Public FuelTypeInput As FuelType
Private engineData As Engine
......@@ -557,13 +558,19 @@ Public Class EngineFuel
End Get
End Property
Public ReadOnly Property CorrectionFactorRegPer As Double Implements IEngineFuelDeclarationInputData.CorrectionFactorRegPer
Get
Return correctionFactorRegPerInput
End Get
End Property
Public ReadOnly Property NetCalorificValueCorrectionFactor As Double Implements IEngineFuelDeclarationInputData.NetCalorificValueCorrectionFactor
Get
Return NetCalorificValueCorrectionFactorInput
End Get
End Property
Public ReadOnly Property CorrectionFactorRegPer As Double Implements IEngineFuelDeclarationInputData.CorrectionFactorRegPer
Get
Return correctionFactorRegPerInput
End Get
End Property
Public ReadOnly Property FuelType As FuelType Implements IEngineFuelDeclarationInputData.FuelType
Public ReadOnly Property FuelType As FuelType Implements IEngineFuelDeclarationInputData.FuelType
Get
Return FuelTypeInput
End Get
......
......@@ -582,6 +582,8 @@ namespace TUGraz.VectoCommon.InputData
double CorrectionFactorRegPer { get; }
double NetCalorificValueCorrectionFactor { get; }
/// <summary>
/// P067
/// P072, P073, P074
......
......@@ -126,6 +126,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
FuelType = jsonFuel.GetEx<string>("FuelType").ParseEnum<FuelType>(),
ColdHotBalancingFactor = jsonFuel.GetEx<double>("ColdHotBalancingFactor"),
CorrectionFactorRegPer = jsonFuel.GetEx<double>("CFRegPer"),
NetCalorificValueCorrectionFactor = jsonFuel.GetEx<double>("CFNCV"),
WHTCUrban = jsonFuel.GetEx<double>(JsonKeys.Engine_WHTC_Urban),
WHTCRural = jsonFuel.GetEx<double>(JsonKeys.Engine_WHTC_Rural),
WHTCMotorway = jsonFuel.GetEx<double>(JsonKeys.Engine_WHTC_Motorway),
......@@ -169,6 +170,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public double WHTCUrban { get; set; }
public double ColdHotBalancingFactor { get; set; }
public double CorrectionFactorRegPer { get; set; }
public double NetCalorificValueCorrectionFactor { get; set; }
public TableData FuelConsumptionMap { get; set; }
#endregion
......@@ -393,6 +395,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return 1; }
}
public double NetCalorificValueCorrectionFactor
{
get {
if (Body["CFNCV"] == null) {
return 1.0;
}
return Body.GetEx<double>("CFNCV");
}
}
public string Manufacturer
{
......
......@@ -184,6 +184,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public virtual double ColdHotBalancingFactor => GetDouble(XMLNames.Engine_ColdHotBalancingFactor);
public virtual double CorrectionFactorRegPer => GetDouble(XMLNames.Engine_CorrectionFactor_RegPer);
public virtual double NetCalorificValueCorrectionFactor => GetDouble(XMLNames.Engine_CorrecionFactor_NCV);
}
#endregion
......
......@@ -117,7 +117,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider
}
}
public virtual double CorrectionFactorNCV
public virtual double NetCalorificValueCorrectionFactor
{
get { return 1; }
}
......
......@@ -226,6 +226,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
WHTCMotorway = fuel.WHTCMotorway,
ColdHotCorrectionFactor = fuel.ColdHotBalancingFactor,
CorrectionFactorRegPer = fuel.CorrectionFactorRegPer,
NetCalorificValueCorrectionFactor = fuel.NetCalorificValueCorrectionFactor,
FuelData = DeclarationData.FuelData.Lookup(fuel.FuelType, vehicle.TankSystem),
ConsumptionMap = FuelConsumptionMapReader.Create(fuel.FuelConsumptionMap),
FuelConsumptionCorrectionFactor = DeclarationData.WHTCCorrection.Lookup(
......
......@@ -122,6 +122,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
WHTCRural = 1;
CorrectionFactorRegPer = 1;
FuelConsumptionCorrectionFactor = 1;
NetCalorificValueCorrectionFactor = 1;
}
[Required, Range(0.9, 2)]
......@@ -139,6 +140,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
[Required, Range(double.MinValue, double.MaxValue)]
public double CorrectionFactorRegPer { get; internal set; }
public double NetCalorificValueCorrectionFactor { get; internal set; }
public double FuelConsumptionCorrectionFactor { get; internal set; }
[Required, ValidateObject]
......
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