diff --git a/VECTO/GUI/VehicleForm.Designer.vb b/VECTO/GUI/VehicleForm.Designer.vb index 55dacc3f792b787179936d17d7959afa0294d563..a272f91ddaa529261c16197b2b738eb585020666 100644 --- a/VECTO/GUI/VehicleForm.Designer.vb +++ b/VECTO/GUI/VehicleForm.Designer.vb @@ -147,6 +147,13 @@ Partial Class VehicleForm Me.btAddMaxTorqueEntry = New System.Windows.Forms.Button() Me.cbLegislativeClass = New System.Windows.Forms.ComboBox() Me.Label21 = New System.Windows.Forms.Label() + Me.tpADAS = New System.Windows.Forms.TabPage() + Me.GroupBox5 = New System.Windows.Forms.GroupBox() + Me.lblPCC = New System.Windows.Forms.Label() + Me.cbEngineStopStart = New System.Windows.Forms.CheckBox() + Me.Label22 = New System.Windows.Forms.Label() + Me.cbEcoRoll = New System.Windows.Forms.ComboBox() + Me.cbPcc = New System.Windows.Forms.ComboBox() Me.GroupBox6.SuspendLayout Me.ToolStrip1.SuspendLayout Me.GroupBox7.SuspendLayout @@ -172,6 +179,8 @@ Partial Class VehicleForm Me.Panel1.SuspendLayout Me.TabPage2.SuspendLayout Me.TabPage3.SuspendLayout + Me.tpADAS.SuspendLayout + Me.GroupBox5.SuspendLayout Me.SuspendLayout ' 'Label1 @@ -1050,6 +1059,7 @@ Partial Class VehicleForm Me.TabControl1.Controls.Add(Me.TabPage1) Me.TabControl1.Controls.Add(Me.TabPage2) Me.TabControl1.Controls.Add(Me.TabPage3) + Me.TabControl1.Controls.Add(Me.tpADAS) Me.TabControl1.Location = New System.Drawing.Point(6, 173) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 @@ -1216,6 +1226,75 @@ Partial Class VehicleForm Me.Label21.TabIndex = 42 Me.Label21.Text = "Maximum Laden Mass" ' + 'tpADAS + ' + Me.tpADAS.Controls.Add(Me.GroupBox5) + Me.tpADAS.Location = New System.Drawing.Point(4, 22) + Me.tpADAS.Name = "tpADAS" + Me.tpADAS.Padding = New System.Windows.Forms.Padding(3) + Me.tpADAS.Size = New System.Drawing.Size(579, 355) + Me.tpADAS.TabIndex = 3 + Me.tpADAS.Text = "ADAS" + Me.tpADAS.UseVisualStyleBackColor = true + ' + 'GroupBox5 + ' + Me.GroupBox5.Controls.Add(Me.cbPcc) + Me.GroupBox5.Controls.Add(Me.cbEcoRoll) + Me.GroupBox5.Controls.Add(Me.Label22) + Me.GroupBox5.Controls.Add(Me.cbEngineStopStart) + Me.GroupBox5.Controls.Add(Me.lblPCC) + Me.GroupBox5.Location = New System.Drawing.Point(6, 6) + Me.GroupBox5.Name = "GroupBox5" + Me.GroupBox5.Size = New System.Drawing.Size(565, 136) + Me.GroupBox5.TabIndex = 0 + Me.GroupBox5.TabStop = false + Me.GroupBox5.Text = "ADAS Options" + ' + 'lblPCC + ' + Me.lblPCC.AutoSize = true + Me.lblPCC.Location = New System.Drawing.Point(6, 88) + Me.lblPCC.Name = "lblPCC" + Me.lblPCC.Size = New System.Drawing.Size(122, 13) + Me.lblPCC.TabIndex = 3 + Me.lblPCC.Text = "Predictive Cruise Control" + ' + 'cbEngineStopStart + ' + Me.cbEngineStopStart.AutoSize = true + Me.cbEngineStopStart.Location = New System.Drawing.Point(6, 19) + Me.cbEngineStopStart.Name = "cbEngineStopStart" + Me.cbEngineStopStart.Size = New System.Drawing.Size(203, 17) + Me.cbEngineStopStart.TabIndex = 4 + Me.cbEngineStopStart.Text = "Engine Stop/Start during vehicle stop" + Me.cbEngineStopStart.UseVisualStyleBackColor = true + ' + 'Label22 + ' + Me.Label22.AutoSize = true + Me.Label22.Location = New System.Drawing.Point(6, 42) + Me.Label22.Name = "Label22" + Me.Label22.Size = New System.Drawing.Size(47, 13) + Me.Label22.TabIndex = 6 + Me.Label22.Text = "Eco-Roll" + ' + 'cbEcoRoll + ' + Me.cbEcoRoll.FormattingEnabled = true + Me.cbEcoRoll.Location = New System.Drawing.Point(18, 58) + Me.cbEcoRoll.Name = "cbEcoRoll" + Me.cbEcoRoll.Size = New System.Drawing.Size(179, 21) + Me.cbEcoRoll.TabIndex = 7 + ' + 'cbPcc + ' + Me.cbPcc.FormattingEnabled = true + Me.cbPcc.Location = New System.Drawing.Point(18, 104) + Me.cbPcc.Name = "cbPcc" + Me.cbPcc.Size = New System.Drawing.Size(179, 21) + Me.cbPcc.TabIndex = 8 + ' 'VehicleForm ' Me.AcceptButton = Me.ButOK @@ -1283,6 +1362,9 @@ Partial Class VehicleForm Me.TabPage2.ResumeLayout(false) Me.TabPage3.ResumeLayout(false) Me.TabPage3.PerformLayout + Me.tpADAS.ResumeLayout(false) + Me.GroupBox5.ResumeLayout(false) + Me.GroupBox5.PerformLayout Me.ResumeLayout(false) Me.PerformLayout @@ -1400,4 +1482,11 @@ End Sub Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents Label20 As System.Windows.Forms.Label Friend WithEvents Label21 As Label + Friend WithEvents tpADAS As TabPage + Friend WithEvents GroupBox5 As GroupBox + Friend WithEvents cbEngineStopStart As CheckBox + Friend WithEvents lblPCC As Label + Friend WithEvents Label22 As Label + Friend WithEvents cbPcc As ComboBox + Friend WithEvents cbEcoRoll As ComboBox End Class diff --git a/VECTO/GUI/VehicleForm.vb b/VECTO/GUI/VehicleForm.vb index 3e0ef9e67b02b403c71e1d62a8626b6a5e3fb035..e5f26c3e02176d07255e9101f55f867f0716e21a 100644 --- a/VECTO/GUI/VehicleForm.vb +++ b/VECTO/GUI/VehicleForm.vb @@ -91,13 +91,22 @@ Public Class VehicleForm .Select(Function(category) New With {Key .Value = category, .Label = category.GetName()}).ToList() End If - + cbEcoRoll.ValueMember = "Value" + cbEcoRoll.DisplayMember = "Label" + cbEcoRoll.DataSource = [Enum].GetValues(GetType(EcoRollType)).Cast(Of EcoRollType).Select(Function(ecoRoll) new With {Key .Value = ecoRoll, .Label = ecoRoll.GetName()}).ToList() + + + cbPcc.ValueMember = "Value" + cbPcc.DisplayMember = "Label" + cbPcc.DataSource = [Enum].GetValues(GetType(PredictiveCruiseControlType)).Cast(Of PredictiveCruiseControlType).Select(Function(pcc) new With {Key .Value = pcc, .Label = pcc.GetName()}).ToList() + + tpADAS.Enabled = Cfg.DeclMode CbCat.ValueMember = "Value" CbCat.DisplayMember = "Label" CbCat.DataSource = [Enum].GetValues(GetType(VehicleCategory)) _ .Cast(Of VehicleCategory) _ - .Select(Function(category) New With {Key .Value = category, .label = category.GetLabel()}).ToList() + .Select(Function(category) New With {Key .Value = category, .Label = category.GetLabel()}).ToList() cbAngledriveType.ValueMember = "Value" cbAngledriveType.DisplayMember = "Label" @@ -384,6 +393,17 @@ Public Class VehicleForm TbRtRatio.Text = retarder.Ratio.ToGUIFormat() TbRtPath.Text = If(retarder.LossMap Is Nothing, "", GetRelativePath(retarder.LossMap.Source, basePath)) + if (vehicle.SavedInDeclarationMode) then + Dim declVehicle as IVehicleDeclarationInputData = vehicle + cbPcc.SelectedValue = declVehicle.ADAS.PredictiveCruiseControl + cbEcoRoll.SelectedValue = declvehicle.ADAS.EcoRoll + cbEngineStopStart.Checked = declVehicle.ADAS.EngineStopStart + Else + cbPcc.SelectedValue = PredictiveCruiseControlType.None + cbEcoRoll.SelectedValue = EcoRollType.None + cbEngineStopStart.Checked = False + End If + LvRRC.Items.Clear() Dim i As Integer = 0 Dim a0 As IAxleEngineeringInputData @@ -510,6 +530,9 @@ Public Class VehicleForm veh.torqueLimitsList.Add(tl) Next + veh.EcoRollType = CType(cbEcoRoll.SelectedValue, EcoRollType) + veh.PCC = CType(cbPcc.SelectedValue, PredictiveCruiseControlType) + veh.EngineStop = cbEngineStopStart.Checked '--------------------------------------------------------------------------------- If Not veh.SaveFile Then diff --git a/VECTO/Input Files/Vehicle.vb b/VECTO/Input Files/Vehicle.vb index df9637d45c880633089fbc1341b3c5bf3da76c23..78fa5bedffda5e775c6aae9aff166769ae571412 100644 --- a/VECTO/Input Files/Vehicle.vb +++ b/VECTO/Input Files/Vehicle.vb @@ -68,6 +68,10 @@ Public Class Vehicle Public legClass As LegislativeClass Public VehicleHeight As Double + public EcoRolltype as EcoRollType + public PCC as PredictiveCruiseControlType + public EngineStop as Boolean + Public Sub New() _path = "" @@ -408,6 +412,10 @@ Public Class Vehicle End Property Public ReadOnly Property IVehicleEngineeringInputData_Components As IVehicleComponentsEngineering Implements IVehicleEngineeringInputData.Components + get + Return me + End Get + End Property Public ReadOnly Property CrosswindCorrectionMap As TableData _ Implements IAirdragEngineeringInputData.CrosswindCorrectionMap @@ -739,25 +747,20 @@ Public Class Vehicle Public ReadOnly Property EngineStopStart As Boolean Implements IAdvancedDriverAssistantSystemDeclarationInputData.EngineStopStart get - return DeclarationData.Vehicle.ADAS.EngineStopStartDefault - End Get - End Property - - Public ReadOnly Property EcoRollWitoutEngineStop As Boolean Implements IAdvancedDriverAssistantSystemDeclarationInputData.EcoRollWitoutEngineStop - get - return DeclarationData.Vehicle.ADAS.EcoRollWitoutEngineStop + return EngineStop End Get End Property - Public ReadOnly Property EcoRollWithEngineStop As Boolean Implements IAdvancedDriverAssistantSystemDeclarationInputData.EcoRollWithEngineStop + Public ReadOnly Property EcoRoll As EcoRollType Implements IAdvancedDriverAssistantSystemDeclarationInputData.EcoRoll get - Return DeclarationData.Vehicle.ADAS.EcoRollWithEngineStop + return EcoRolltype End Get End Property + Public ReadOnly Property PredictiveCruiseControl As PredictiveCruiseControlType Implements IAdvancedDriverAssistantSystemDeclarationInputData.PredictiveCruiseControl get - Return DeclarationData.Vehicle.ADAS.PredictiveCruiseControlDefault + Return PCC End Get End Property diff --git a/VECTO/OutputData/JSONFileWriter.vb b/VECTO/OutputData/JSONFileWriter.vb index 0212e6da074a7fe722ffd8e85c9f7e6545d8ee0e..a1a735399feafd43e953c8fe2184ceaf30426c10 100644 --- a/VECTO/OutputData/JSONFileWriter.vb +++ b/VECTO/OutputData/JSONFileWriter.vb @@ -16,7 +16,7 @@ Public Class JSONFileWriter Public Const GearboxFormatVersion As Integer = 6 - Public Const VehicleFormatVersion As Integer = 7 + Public Const VehicleFormatVersion As Integer = 8 Private Const VectoJobFormatVersion As Integer = 4 @@ -229,9 +229,16 @@ Public Class JSONFileWriter {"TwinTyres", axle.TwinTyres}, {"RRCISO", axle.Tyre.RollResistanceCoefficient}, {"FzISO", axle.Tyre.TyreTestLoad.Value()}, - {"Type", axle.AxleType.ToString()} + {"Type", axle.AxleType.ToString()} }}}}} + if (Cfg.DeclMode) then + Dim declVehicle As IVehicleDeclarationInputData = vehicle + body("EngineStopStart") = declVehicle.ADAS.EngineStopStart + body("EcoRoll") = declVehicle.ADAS.EcoRoll.ToString() + body("PredictiveCruiseControl") = declVehicle.ADAS.PredictiveCruiseControl.ToString() + End If + If (Not IsNothing(airdrag.AirDragArea)) Then body("CdA") = airdrag.AirDragArea.Value() End If diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs index bd4e03f44da2d76b6bf150dd163e8d491752a28b..2c174f12e5eda71fbb22e96f96c65a904f04d381 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs @@ -71,9 +71,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON case 3: return new JSONInputDataV3(json, filename, tolerateMissing); case 4: - if (json["Body"]["DeclarationVehicle"] != null) { - return new JSONVTPInputDataV4(json, filename, tolerateMissing); - } + if (json["Body"]["DeclarationVehicle"] != null) { + return new JSONVTPInputDataV4(json, filename, tolerateMissing); + } return new JSONInputDataV4(json, filename, tolerateMissing); default: throw new VectoException("Job-File: Unsupported FileVersion. Got: {0} ", version); @@ -87,6 +87,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON switch (version) { case 7: return new JSONVehicleDataV7(json, filename, job,tolerateMissing); + case 8: + return new JSONVehicleDataV8(json, filename, job, tolerateMissing); default: throw new VectoException("Vehicle-File: Unsupported FileVersion. Got {0}", version); } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs index 2275f00a4d0b2e162b96b0bdc544cf223f20b7d5..e2fa7641765825cee5130fe46a6f12bbab2c0456 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs @@ -44,6 +44,27 @@ using TUGraz.VectoCore.Models.Declaration; namespace TUGraz.VectoCore.InputData.FileIO.JSON { + + public class JSONVehicleDataV8 : JSONVehicleDataV7 + { + public JSONVehicleDataV8(JObject data, string fileName, IJSONVehicleComponents job, bool tolerateMissing = false) : base(data, fileName, job, tolerateMissing) { } + + #region Implementation of IAdvancedDriverAssistantSystemDeclarationInputData + + public override bool EngineStopStart { get { return Body.GetEx<bool>("EngineStopStart"); } } + public override EcoRollType EcoRoll { get { return EcorollTypeHelper.Parse(Body.GetEx<string>("EcoRoll")); } } + + public override PredictiveCruiseControlType PredictiveCruiseControl + { + get { + return Body.GetEx<string>("PredictiveCruiseControl").ParseEnum<PredictiveCruiseControlType>(); + } + } + + #endregion + } + + public class JSONVehicleDataV7 : JSONFile, IVehicleEngineeringInputData, IRetarderInputData, IAngledriveInputData, IPTOTransmissionInputData, IAirdragEngineeringInputData, IAdvancedDriverAssistantSystemDeclarationInputData, IVehicleComponentsDeclaration, IVehicleComponentsEngineering, IAxlesEngineeringInputData, IAxlesDeclarationInputData { @@ -57,16 +78,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #region IVehicleInputData - public string Identifier { get { return Path.GetFileNameWithoutExtension(_sourceFile); } } + public virtual string Identifier { get { return Path.GetFileNameWithoutExtension(_sourceFile); } } - public bool ExemptedVehicle { get { return false; } } + public virtual bool ExemptedVehicle { get { return false; } } - public string VIN + public virtual string VIN { get { return Constants.NOT_AVailABLE; } } - public LegislativeClass LegislativeClass + public virtual LegislativeClass LegislativeClass { get { return Body["LegislativeClass"] != null @@ -75,7 +96,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON } } - public VehicleCategory VehicleCategory + public virtual VehicleCategory VehicleCategory { get { return @@ -98,7 +119,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Body.GetEx<double>(JsonKeys.Vehicle_GrossVehicleMassRating).SI(Unit.SI.Ton).Cast<Kilogram>(); } } - public IList<ITorqueLimitInputData> TorqueLimits + public virtual IList<ITorqueLimitInputData> TorqueLimits { get { var retVal = new List<ITorqueLimitInputData>(); @@ -125,7 +146,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Body.GetEx<double>(JsonKeys.Vehicle_DynamicTyreRadius).SI(Unit.SI.Milli.Meter).Cast<Meter>(); } } - public Meter Height + public virtual Meter Height { get { return Body["VehicleHeight"] == null ? null : Body.GetEx<double>("VehicleHeight").SI<Meter>(); } } @@ -154,12 +175,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return AxleWheels().Cast<IAxleEngineeringInputData>().ToList(); } } - public string ManufacturerAddress + public virtual string ManufacturerAddress { get { return Constants.NOT_AVailABLE; } } - public PerSecond EngineIdleSpeed + public virtual PerSecond EngineIdleSpeed { get { return Body["IdlingSpeed"] != null ? Body.GetEx<double>("IdlingSpeed").RPMtoRad() : null; } } @@ -213,7 +234,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Job.Gearbox; } } - public ITorqueConverterDeclarationInputData TorqueConverter { get { return Job.TorqueConverter; } } + public virtual ITorqueConverterDeclarationInputData TorqueConverter { get { return Job.TorqueConverter; } } IGearboxEngineeringInputData IVehicleComponentsEngineering.GearboxInputData { @@ -240,7 +261,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return this; } } - public IEngineEngineeringInputData EngineInputData + public virtual IEngineEngineeringInputData EngineInputData { get { return Job.Engine; } } @@ -285,22 +306,22 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return this; } } - public bool VocationalVehicle { get { return DeclarationData.Vehicle.VocationalVehicleDefault; } } + public virtual bool VocationalVehicle { get { return DeclarationData.Vehicle.VocationalVehicleDefault; } } - public bool SleeperCab { get { return DeclarationData.Vehicle.SleeperCabDefault; } } + public virtual bool SleeperCab { get { return DeclarationData.Vehicle.SleeperCabDefault; } } - public TankSystem? TankSystem { get { return DeclarationData.Vehicle.TankSystemDefault; } } - public IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get { return this; } } + public virtual TankSystem? TankSystem { get { return DeclarationData.Vehicle.TankSystemDefault; } } + public virtual IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get { return this; } } - public bool ZeroEmissionVehicle { get { return DeclarationData.Vehicle.ZeroEmissionVehicleDefault; } } + public virtual bool ZeroEmissionVehicle { get { return DeclarationData.Vehicle.ZeroEmissionVehicleDefault; } } - public bool HybridElectricHDV { get { return DeclarationData.Vehicle.HybridElectricHDVDefault; } } + public virtual bool HybridElectricHDV { get { return DeclarationData.Vehicle.HybridElectricHDVDefault; } } - public bool DualFuelVehicle { get { return DeclarationData.Vehicle.DualFuelVehicleDefault; } } + public virtual bool DualFuelVehicle { get { return DeclarationData.Vehicle.DualFuelVehicleDefault; } } - public Watt MaxNetPower1 { get { return null; } } + public virtual Watt MaxNetPower1 { get { return null; } } - public Watt MaxNetPower2 { get { return null; } } + public virtual Watt MaxNetPower2 { get { return null; } } IVehicleComponentsDeclaration IVehicleDeclarationInputData.Components { @@ -491,7 +512,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON } } - public TableData PTOCycle + public virtual TableData PTOCycle { get { var pto = Body[JsonKeys.Vehicle_PTO]; @@ -515,17 +536,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion - public string Manufacturer + public virtual string Manufacturer { get { return Constants.NOT_AVailABLE; } } - public string Model + public virtual string Model { get { return Constants.NOT_AVailABLE; } } - public string Date + public virtual string Date { get { return Constants.NOT_AVailABLE; } } @@ -535,27 +556,28 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return CertificationMethod.NotCertified; } } - public string CertificationNumber + public virtual string CertificationNumber { get { return Constants.NOT_AVailABLE; } } - public DigestData DigestValue + public virtual DigestData DigestValue { get { return null; } } #region Implementation of IAdvancedDriverAssistantSystemDeclarationInputData - public bool EngineStopStart { get { return DeclarationData.Vehicle.ADAS.EngineStopStartDefault; } } - public bool EcoRollWitoutEngineStop { get { return DeclarationData.Vehicle.ADAS.EcoRollWitoutEngineStop; } } - public bool EcoRollWithEngineStop { get { return DeclarationData.Vehicle.ADAS.EcoRollWithEngineStop; } } - public PredictiveCruiseControlType PredictiveCruiseControl { get { + public virtual bool EngineStopStart { get { return DeclarationData.Vehicle.ADAS.EngineStopStartDefault; } } + public virtual EcoRollType EcoRoll { get { return DeclarationData.Vehicle.ADAS.EcoRoll; } } + + public virtual PredictiveCruiseControlType PredictiveCruiseControl { get { return DeclarationData.Vehicle.ADAS.PredictiveCruiseControlDefault; } } #endregion - - + } + + }