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

Skip to content
Snippets Groups Projects
Commit 7634c505 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

adding milege and NCV test fuel to GUI, compute correction factor

parent e3bafe79
No related branches found
No related tags found
No related merge requests found
Showing
with 160 additions and 24 deletions
......@@ -80,6 +80,12 @@ Partial Class VectoVTPJobForm
Me.Label1 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.pnManufacturerRecord = New System.Windows.Forms.Panel()
Me.lblMileageUnit = New System.Windows.Forms.Label()
Me.tbMileage = New System.Windows.Forms.TextBox()
Me.lblMileage = New System.Windows.Forms.Label()
Me.lblNCVUnit = New System.Windows.Forms.Label()
Me.tbNCV = New System.Windows.Forms.TextBox()
Me.lblNCV = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.tbManufacturerRecord = New System.Windows.Forms.TextBox()
Me.ButtonManR = New System.Windows.Forms.Button()
......@@ -104,7 +110,7 @@ Partial Class VectoVTPJobForm
Me.GrCycles.Controls.Add(Me.LvCycles)
Me.GrCycles.Controls.Add(Me.BtDRIrem)
Me.GrCycles.Controls.Add(Me.BtDRIadd)
Me.GrCycles.Location = New System.Drawing.Point(12, 290)
Me.GrCycles.Location = New System.Drawing.Point(11, 324)
Me.GrCycles.Name = "GrCycles"
Me.GrCycles.Size = New System.Drawing.Size(515, 138)
Me.GrCycles.TabIndex = 10
......@@ -174,7 +180,7 @@ Partial Class VectoVTPJobForm
Me.GrAux.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.GrAux.Controls.Add(Me.LvAux)
Me.GrAux.Location = New System.Drawing.Point(12, 144)
Me.GrAux.Location = New System.Drawing.Point(11, 178)
Me.GrAux.Name = "GrAux"
Me.GrAux.Size = New System.Drawing.Size(515, 140)
Me.GrAux.TabIndex = 9
......@@ -237,7 +243,7 @@ Partial Class VectoVTPJobForm
'StatusStrip1
'
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabelGEN})
Me.StatusStrip1.Location = New System.Drawing.Point(0, 584)
Me.StatusStrip1.Location = New System.Drawing.Point(0, 609)
Me.StatusStrip1.Name = "StatusStrip1"
Me.StatusStrip1.Size = New System.Drawing.Size(944, 22)
Me.StatusStrip1.SizingGrip = false
......@@ -253,7 +259,7 @@ Partial Class VectoVTPJobForm
'ButOK
'
Me.ButOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.ButOK.Location = New System.Drawing.Point(778, 557)
Me.ButOK.Location = New System.Drawing.Point(778, 582)
Me.ButOK.Name = "ButOK"
Me.ButOK.Size = New System.Drawing.Size(75, 23)
Me.ButOK.TabIndex = 0
......@@ -264,7 +270,7 @@ Partial Class VectoVTPJobForm
'
Me.ButCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.ButCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.ButCancel.Location = New System.Drawing.Point(859, 557)
Me.ButCancel.Location = New System.Drawing.Point(859, 582)
Me.ButCancel.Name = "ButCancel"
Me.ButCancel.Size = New System.Drawing.Size(75, 23)
Me.ButCancel.TabIndex = 1
......@@ -481,7 +487,7 @@ Partial Class VectoVTPJobForm
Me.GroupBox1.Controls.Add(Me.tbC1)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.PictureBox2)
Me.GroupBox1.Location = New System.Drawing.Point(11, 434)
Me.GroupBox1.Location = New System.Drawing.Point(10, 468)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(515, 135)
Me.GroupBox1.TabIndex = 39
......@@ -572,22 +578,82 @@ Partial Class VectoVTPJobForm
'
'pnManufacturerRecord
'
Me.pnManufacturerRecord.Controls.Add(Me.lblMileageUnit)
Me.pnManufacturerRecord.Controls.Add(Me.tbMileage)
Me.pnManufacturerRecord.Controls.Add(Me.lblMileage)
Me.pnManufacturerRecord.Controls.Add(Me.lblNCVUnit)
Me.pnManufacturerRecord.Controls.Add(Me.tbNCV)
Me.pnManufacturerRecord.Controls.Add(Me.lblNCV)
Me.pnManufacturerRecord.Controls.Add(Me.Label8)
Me.pnManufacturerRecord.Controls.Add(Me.tbManufacturerRecord)
Me.pnManufacturerRecord.Controls.Add(Me.ButtonManR)
Me.pnManufacturerRecord.Location = New System.Drawing.Point(11, 112)
Me.pnManufacturerRecord.Name = "pnManufacturerRecord"
Me.pnManufacturerRecord.Size = New System.Drawing.Size(525, 36)
Me.pnManufacturerRecord.Size = New System.Drawing.Size(525, 66)
Me.pnManufacturerRecord.TabIndex = 41
'
'lblMileageUnit
'
Me.lblMileageUnit.AutoSize = true
Me.lblMileageUnit.Location = New System.Drawing.Point(476, 43)
Me.lblMileageUnit.Name = "lblMileageUnit"
Me.lblMileageUnit.Size = New System.Drawing.Size(27, 13)
Me.lblMileageUnit.TabIndex = 49
Me.lblMileageUnit.Text = "[km]"
'
'tbMileage
'
Me.tbMileage.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.tbMileage.Location = New System.Drawing.Point(394, 40)
Me.tbMileage.Name = "tbMileage"
Me.tbMileage.Size = New System.Drawing.Size(76, 20)
Me.tbMileage.TabIndex = 48
'
'lblMileage
'
Me.lblMileage.AutoSize = true
Me.lblMileage.Location = New System.Drawing.Point(281, 43)
Me.lblMileage.Name = "lblMileage"
Me.lblMileage.Size = New System.Drawing.Size(47, 13)
Me.lblMileage.TabIndex = 47
Me.lblMileage.Text = "Mileage:"
'
'lblNCVUnit
'
Me.lblNCVUnit.AutoSize = true
Me.lblNCVUnit.Location = New System.Drawing.Point(199, 43)
Me.lblNCVUnit.Name = "lblNCVUnit"
Me.lblNCVUnit.Size = New System.Drawing.Size(44, 13)
Me.lblNCVUnit.TabIndex = 46
Me.lblNCVUnit.Text = "[MJ/kg]"
'
'tbNCV
'
Me.tbNCV.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.tbNCV.Location = New System.Drawing.Point(117, 40)
Me.tbNCV.Name = "tbNCV"
Me.tbNCV.Size = New System.Drawing.Size(76, 20)
Me.tbNCV.TabIndex = 45
'
'lblNCV
'
Me.lblNCV.AutoSize = true
Me.lblNCV.Location = New System.Drawing.Point(4, 43)
Me.lblNCV.Name = "lblNCV"
Me.lblNCV.Size = New System.Drawing.Size(79, 13)
Me.lblNCV.TabIndex = 44
Me.lblNCV.Text = "NCV Test Fuel:"
'
'Label8
'
Me.Label8.AutoSize = true
Me.Label8.Location = New System.Drawing.Point(3, 11)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(108, 13)
Me.Label8.Size = New System.Drawing.Size(111, 13)
Me.Label8.TabIndex = 43
Me.Label8.Text = "Manufacturer Record"
Me.Label8.Text = "Manufacturer Record:"
'
'tbManufacturerRecord
'
......@@ -615,7 +681,7 @@ Partial Class VectoVTPJobForm
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.ButCancel
Me.ClientSize = New System.Drawing.Size(944, 606)
Me.ClientSize = New System.Drawing.Size(944, 631)
Me.Controls.Add(Me.pnManufacturerRecord)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.GroupBox1)
......@@ -719,4 +785,10 @@ End Sub
Friend WithEvents Label8 As Label
Friend WithEvents tbManufacturerRecord As TextBox
Friend WithEvents ButtonManR As Button
Friend WithEvents lblMileageUnit As Label
Friend WithEvents tbMileage As TextBox
Friend WithEvents lblMileage As Label
Friend WithEvents lblNCVUnit As Label
Friend WithEvents tbNCV As TextBox
Friend WithEvents lblNCV As Label
End Class
......@@ -200,6 +200,9 @@ Public Class VectoVTPJobForm
PopulateAuxiliaryList(auxInput)
tbMileage.Text = if(Cfg.DeclMode, inputData.JobInputData.Mileage.ConvertToKiloMeter().Value.ToGUIFormat(), "")
tbNCV.Text = if (Cfg.DeclMode, inputData.JobInputData.NetCalorificValueTestFuel.ConvertToMegaJoulePerKilogram().Value.ToGUIFormat(), "")
Dim coefficients As Double() = vectoJob.FanPowerCoefficents.ToArray()
If (coefficients.Length >= 1) Then
tbC1.Text = coefficients(0).ToGUIFormat()
......@@ -280,6 +283,10 @@ Public Class VectoVTPJobForm
vectoJob.CycleFiles.Add(sb)
Next
vectoJob.Mileage = tbMileage.Text.ToDouble(0).SI(Unit.SI.Kilo.Meter).Cast(of Meter)
vectoJob.NetCalorificValueTestFuel = tbNCV.Text.ToDouble(0).SI(Unit.SI.Mega.Joule.Per.Kilo.Gramm).Cast(of JoulePerKilogramm)
vectoJob.FanCoefficients = New Double() {
tbC1.Text.ToDouble(0),
tbC2.Text.ToDouble(0),
......@@ -703,6 +710,8 @@ Public Class VectoVTPJobForm
tbManufacturerRecord.Text = GetFilenameWithoutDirectory(ManRXMLFileBrowser.Files(0), GetPath(VectoFile))
End If
End Sub
End Class
......@@ -128,6 +128,9 @@ Public Class VectoVTPJob
Public ReadOnly Property VectoJobHash As IVectoHash Implements IVTPDeclarationJobInputData.VectoJobHash
Public ReadOnly Property VectoManufacturerReportHash As IVectoHash Implements IVTPDeclarationJobInputData.VectoManufacturerReportHash
Public Property Mileage As Meter Implements IVTPDeclarationJobInputData.Mileage
Public Property NetCalorificValueTestFuel As JoulePerKilogramm Implements IVTPDeclarationJobInputData.NetCalorificValueTestFuel
Public ReadOnly Property Cycles As IList(Of ICycleData) Implements IVTPEngineeringJobInputData.Cycles
......
......@@ -372,6 +372,8 @@ Public Class JSONFileWriter
body.Add("DeclarationVehicle", GetRelativePath(job.Vehicle.Source, Path.GetDirectoryName(filename)))
if declarationmode Then
body.add("ManufacturerRecord", GetRelativePath(job.ManufacturerReportInputData.Source, Path.GetDirectoryName(filename)))
body.Add("Mileage", job.Mileage.ConvertToKiloMeter().Value)
body.add("NCVTestFuel", job.NetCalorificValueTestFuel.ConvertToMegaJoulePerKilogram().Value())
End If
body.Add("FanPowerCoefficients", job.FanPowerCoefficents)
body.Add("FanDiameter", job.FanDiameter.Value())
......
......@@ -54,6 +54,10 @@ namespace TUGraz.VectoCommon.InputData
IVectoHash VectoManufacturerReportHash { get; }
Meter Mileage { get; }
JoulePerKilogramm NetCalorificValueTestFuel { get; }
IList<ICycleData> Cycles { get; }
IEnumerable<double> FanPowerCoefficents { get; }
......
......@@ -201,7 +201,12 @@ namespace TUGraz.VectoCommon.Utils
{
return new ConvertedSI(value.Value() * Kilo, "mm");
}
}
public static ConvertedSI ConvertToMegaJoulePerKilogram(this JoulePerKilogramm value)
{
return new ConvertedSI(value.Value() / Kilo / Kilo, "MJ/kg");
}
}
}
......
......@@ -206,6 +206,18 @@ namespace TUGraz.VectoCommon.Utils
}
}
/// <summary>
/// Quantifier for Mega (1E6).
/// </summary>
public UnitInstance Mega
{
get {
Factor *= Math.Pow(1E6, _exponent * _reciproc);
return this;
}
}
/// <summary>
/// [m]
/// </summary>
......
......@@ -696,6 +696,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
public IVectoHash VectoManufacturerReportHash { get; }
public Meter Mileage
{
get { return Body.GetEx<double>("Mileage").SI(Unit.SI.Kilo.Meter).Cast<Meter>(); }
}
public JoulePerKilogramm NetCalorificValueTestFuel
{
get { return Body.GetEx<double>("NCVTestFuel").SI(Unit.SI.Mega.Joule.Per.Kilo.Gramm).Cast<JoulePerKilogramm>(); }
}
string IManufacturerReport.Source { get { return Body["ManufacturerRecord"].Value<string>(); } }
public IList<ICycleData> Cycles
......
......@@ -16,7 +16,6 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
{
internal class DeclarationVTPModeVectoRunDataFactory : IVectoRunDataFactory
{
protected IVTPDeclarationJobInputData JobInputData;
private DriverData _driverdata;
private AirdragData _airdragData;
......@@ -33,8 +32,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
public IVTPReport Report;
public DeclarationVTPModeVectoRunDataFactory(IVTPDeclarationInputDataProvider ivtpProvider, IVTPReport report) : this(ivtpProvider.JobInputData, report)
{}
public DeclarationVTPModeVectoRunDataFactory(IVTPDeclarationInputDataProvider ivtpProvider, IVTPReport report) : this(
ivtpProvider.JobInputData, report) { }
protected DeclarationVTPModeVectoRunDataFactory(IVTPDeclarationJobInputData job, IVTPReport report)
{
......@@ -54,17 +53,19 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
{
var powertrainConfig = new VectoRunData() {
VehicleData =
_dao.CreateVehicleData(JobInputData.Vehicle, _segment.Missions.First(),
_segment.Missions.First().Loadings.First().Value, _segment.MunicipalBodyWeight),
_dao.CreateVehicleData(
JobInputData.Vehicle, _segment.Missions.First(),
_segment.Missions.First().Loadings.First().Value, _segment.MunicipalBodyWeight),
AirdragData = _airdragData,
EngineData = _engineData,
GearboxData = _gearboxData,
AxleGearData = _axlegearData,
Retarder = _retarderData,
Aux =
_dao.CreateAuxiliaryData(JobInputData.Vehicle.AuxiliaryInputData(),
_segment.Missions.First().MissionType,
_segment.VehicleClass),
_dao.CreateAuxiliaryData(
JobInputData.Vehicle.AuxiliaryInputData(),
_segment.Missions.First().MissionType,
_segment.VehicleClass),
};
powertrainConfig.VehicleData.VehicleClass = _segment.VehicleClass;
Report.InputDataHash = JobInputData.VectoJobHash;
......@@ -138,6 +139,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
// simulate the Measured cycle
foreach (var cycle in JobInputData.Cycles) {
var drivingCycle = DrivingCycleDataReader.ReadFromDataTable(cycle.CycleData, cycle.Name, false);
// Loading is not relevant as we use P_wheel
var runData = CreateVectoRunData(_segment, _segment.Missions.First(), 0.SI<Kilogram>());
runData.Cycle = new DrivingCycleProxy(drivingCycle, cycle.Name);
......@@ -151,18 +153,29 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
runData.Mission = new Mission() {
MissionType = MissionType.VerificationTest
};
var ncvStd = DeclarationData.FuelData.Lookup(JobInputData.Vehicle.EngineInputData.FuelType).LowerHeatingValue;
var ncvCorrection = ncvStd / JobInputData.NetCalorificValueTestFuel;
var mileageCorrection = GetMileagecorrectionFactor(JobInputData.Mileage);
runData.VTPData = new VTPData() {
CorrectionFactor = 1,
FuelNetCalorificValue = 0.SI<JoulePerKilogramm>()
CorrectionFactor = ncvCorrection * mileageCorrection,
FuelNetCalorificValue = JobInputData.NetCalorificValueTestFuel //0.SI<JoulePerKilogramm>()
};
yield return runData;
}
}
private double GetMileagecorrectionFactor(Meter mileage)
{
if (mileage > DeclarationData.VTPMode.RunInThreshold) {
return 1;
}
return DeclarationData.VTPMode.EvolutionCoefficient + (1 - DeclarationData.VTPMode.EvolutionCoefficient) * mileage /
DeclarationData.VTPMode.RunInThreshold;
}
protected VectoRunData CreateVectoRunData(Segment segment, Mission mission, Kilogram loading)
{
return new VectoRunData {
JobName = JobInputData.Vehicle.VIN,
EngineData = _engineData,
......@@ -181,7 +194,8 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
};
}
protected virtual List<VectoRunData.AuxData> CreateVTPAuxData(DeclarationDataAdapter dao, IVehicleDeclarationInputData vehicle, Segment segment)
protected virtual List<VectoRunData.AuxData> CreateVTPAuxData(
DeclarationDataAdapter dao, IVehicleDeclarationInputData vehicle, Segment segment)
{
var auxRD = dao.CreateAuxiliaryData(
vehicle.AuxiliaryInputData(), MissionType.RegionalDelivery, segment.VehicleClass)
......
......@@ -502,6 +502,9 @@ namespace TUGraz.VectoCore.Models.Declaration
public static class VTPMode
{
public static readonly Meter RunInThreshold = 15000.SI(Unit.SI.Kilo.Meter).Cast<Meter>();
public const double EvolutionCoefficient = 0.98;
public const MissionType SelectedMission = MissionType.LongHaul;
public const LoadingType SelectedLoading = LoadingType.ReferenceLoad;
}
......
{
"Header": {
"CreatedBy": "",
"Date": "2018-04-27T10:40:05.4111247Z",
"Date": "2018-05-02T11:40:41.8847449Z",
"AppVersion": "3",
"FileVersion": 4
},
......@@ -9,6 +9,8 @@
"SavedInDeclMode": true,
"DeclarationVehicle": "Tractor_4x2_vehicle-class-5_Generic vehicle.xml",
"ManufacturerRecord": "Tractor_4x2_vehicle-class-5_Generic vehicle.RSLT_MANUFACTURER.xml",
"Mileage": 10000.0,
"NCVTestFuel": 41.0,
"FanPowerCoefficients": [
5.5E-07,
15.0,
......
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