diff --git a/VECTO/GUI/VectoJobForm.Designer.vb b/VECTO/GUI/VectoJobForm.Designer.vb index 1f8a78c5624041fb6a8871f0a302ca15d5b5b491..068c5d3bb4ec803d772525101fb2e2f8e88dc820 100644 --- a/VECTO/GUI/VectoJobForm.Designer.vb +++ b/VECTO/GUI/VectoJobForm.Designer.vb @@ -97,6 +97,26 @@ Partial Class VectoJobForm Me.Label13 = New System.Windows.Forms.Label() Me.RdOverspeed = New System.Windows.Forms.RadioButton() Me.RdOff = New System.Windows.Forms.RadioButton() + Me.TabPgADAS = New System.Windows.Forms.TabPage() + Me.gbEcoRoll = New System.Windows.Forms.GroupBox() + Me.Label29 = New System.Windows.Forms.Label() + Me.Label30 = New System.Windows.Forms.Label() + Me.tbEcoRollUnderspeed = New System.Windows.Forms.TextBox() + Me.Label27 = New System.Windows.Forms.Label() + Me.Label28 = New System.Windows.Forms.Label() + Me.tbEcoRollActivationDelay = New System.Windows.Forms.TextBox() + Me.Label25 = New System.Windows.Forms.Label() + Me.Label26 = New System.Windows.Forms.Label() + Me.tbEcoRollMinSpeed = New System.Windows.Forms.TextBox() + Me.gbEngineStopStart = New System.Windows.Forms.GroupBox() + Me.tbEssUtility = New System.Windows.Forms.TextBox() + Me.Label24 = New System.Windows.Forms.Label() + Me.Label18 = New System.Windows.Forms.Label() + Me.tbMaxEngineOffTimespan = New System.Windows.Forms.TextBox() + Me.Label19 = New System.Windows.Forms.Label() + Me.Label17 = New System.Windows.Forms.Label() + Me.tbEngineStopStartActivationDelay = New System.Windows.Forms.TextBox() + Me.Label16 = New System.Windows.Forms.Label() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.ToolStripStatusLabelGEN = New System.Windows.Forms.ToolStripStatusLabel() Me.ButOK = New System.Windows.Forms.Button() @@ -125,26 +145,27 @@ Partial Class VectoJobForm Me.TbMass = New System.Windows.Forms.TextBox() Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) Me.lblEngineCharacteristics = New System.Windows.Forms.Label() - Me.TabPgADAS = New System.Windows.Forms.TabPage() - Me.GroupBox3 = New System.Windows.Forms.GroupBox() - Me.tbEssUtility = New System.Windows.Forms.TextBox() - Me.Label24 = New System.Windows.Forms.Label() - Me.Label18 = New System.Windows.Forms.Label() - Me.tbMaxEngineOffTimespan = New System.Windows.Forms.TextBox() - Me.Label19 = New System.Windows.Forms.Label() - Me.Label17 = New System.Windows.Forms.Label() - Me.tbEngineStopStartActivationDelay = New System.Windows.Forms.TextBox() - Me.Label16 = New System.Windows.Forms.Label() - Me.GroupBox4 = New System.Windows.Forms.GroupBox() - Me.Label25 = New System.Windows.Forms.Label() - Me.tbEcoRollMinSpeed = New System.Windows.Forms.TextBox() - Me.Label26 = New System.Windows.Forms.Label() - Me.Label27 = New System.Windows.Forms.Label() - Me.Label28 = New System.Windows.Forms.Label() - Me.tbEcoRollActivationDelay = New System.Windows.Forms.TextBox() - Me.Label29 = New System.Windows.Forms.Label() - Me.Label30 = New System.Windows.Forms.Label() - Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.gbPCC = New System.Windows.Forms.GroupBox() + Me.Label20 = New System.Windows.Forms.Label() + Me.Label22 = New System.Windows.Forms.Label() + Me.tbPCCUnderspeed = New System.Windows.Forms.TextBox() + Me.Label31 = New System.Windows.Forms.Label() + Me.Label33 = New System.Windows.Forms.Label() + Me.tbPCCOverspeed = New System.Windows.Forms.TextBox() + Me.Label34 = New System.Windows.Forms.Label() + Me.Label35 = New System.Windows.Forms.Label() + Me.tbPCCEnableSpeed = New System.Windows.Forms.TextBox() + Me.Label36 = New System.Windows.Forms.Label() + Me.Label37 = New System.Windows.Forms.Label() + Me.tbPCCMinSpeed = New System.Windows.Forms.TextBox() + Me.Label38 = New System.Windows.Forms.Label() + Me.Label39 = New System.Windows.Forms.Label() + Me.tbPCCPreviewUseCase1 = New System.Windows.Forms.TextBox() + Me.Label40 = New System.Windows.Forms.Label() + Me.Label41 = New System.Windows.Forms.Label() + Me.tbPCCPreviewUseCase2 = New System.Windows.Forms.TextBox() + Me.Label42 = New System.Windows.Forms.Label() + Me.Label43 = New System.Windows.Forms.Label() Me.TabPgGen.SuspendLayout Me.GrCycles.SuspendLayout Me.GrAux.SuspendLayout @@ -156,15 +177,16 @@ Partial Class VectoJobForm Me.pnLookAheadCoasting.SuspendLayout Me.GroupBox1.SuspendLayout Me.PnEcoRoll.SuspendLayout + Me.TabPgADAS.SuspendLayout + Me.gbEcoRoll.SuspendLayout + Me.gbEngineStopStart.SuspendLayout Me.StatusStrip1.SuspendLayout Me.ToolStrip1.SuspendLayout CType(Me.PictureBox1,System.ComponentModel.ISupportInitialize).BeginInit Me.CmOpenFile.SuspendLayout CType(Me.PicVehicle,System.ComponentModel.ISupportInitialize).BeginInit CType(Me.PicBox,System.ComponentModel.ISupportInitialize).BeginInit - Me.TabPgADAS.SuspendLayout - Me.GroupBox3.SuspendLayout - Me.GroupBox4.SuspendLayout + Me.gbPCC.SuspendLayout Me.SuspendLayout ' 'TabPgGen @@ -896,6 +918,194 @@ Partial Class VectoJobForm Me.RdOff.Text = "Off" Me.RdOff.UseVisualStyleBackColor = true ' + 'TabPgADAS + ' + Me.TabPgADAS.Controls.Add(Me.gbPCC) + Me.TabPgADAS.Controls.Add(Me.gbEcoRoll) + Me.TabPgADAS.Controls.Add(Me.gbEngineStopStart) + Me.TabPgADAS.Location = New System.Drawing.Point(4, 22) + Me.TabPgADAS.Name = "TabPgADAS" + Me.TabPgADAS.Size = New System.Drawing.Size(527, 487) + Me.TabPgADAS.TabIndex = 8 + Me.TabPgADAS.Text = "ADAS Parameters" + Me.TabPgADAS.UseVisualStyleBackColor = true + ' + 'gbEcoRoll + ' + Me.gbEcoRoll.Controls.Add(Me.Label29) + Me.gbEcoRoll.Controls.Add(Me.Label30) + Me.gbEcoRoll.Controls.Add(Me.tbEcoRollUnderspeed) + Me.gbEcoRoll.Controls.Add(Me.Label27) + Me.gbEcoRoll.Controls.Add(Me.Label28) + Me.gbEcoRoll.Controls.Add(Me.tbEcoRollActivationDelay) + Me.gbEcoRoll.Controls.Add(Me.Label25) + Me.gbEcoRoll.Controls.Add(Me.Label26) + Me.gbEcoRoll.Controls.Add(Me.tbEcoRollMinSpeed) + Me.gbEcoRoll.Location = New System.Drawing.Point(7, 115) + Me.gbEcoRoll.Name = "gbEcoRoll" + Me.gbEcoRoll.Size = New System.Drawing.Size(515, 100) + Me.gbEcoRoll.TabIndex = 6 + Me.gbEcoRoll.TabStop = false + Me.gbEcoRoll.Text = "Eco-Roll" + ' + 'Label29 + ' + Me.Label29.AutoSize = true + Me.Label29.Location = New System.Drawing.Point(305, 74) + Me.Label29.Name = "Label29" + Me.Label29.Size = New System.Drawing.Size(38, 13) + Me.Label29.TabIndex = 16 + Me.Label29.Text = "[km/h]" + ' + 'Label30 + ' + Me.Label30.AutoSize = true + Me.Label30.Location = New System.Drawing.Point(7, 74) + Me.Label30.Name = "Label30" + Me.Label30.Size = New System.Drawing.Size(114, 13) + Me.Label30.TabIndex = 14 + Me.Label30.Text = "Underspeed threshold:" + ' + 'tbEcoRollUnderspeed + ' + Me.tbEcoRollUnderspeed.Location = New System.Drawing.Point(247, 71) + Me.tbEcoRollUnderspeed.Name = "tbEcoRollUnderspeed" + Me.tbEcoRollUnderspeed.Size = New System.Drawing.Size(52, 20) + Me.tbEcoRollUnderspeed.TabIndex = 15 + ' + 'Label27 + ' + Me.Label27.AutoSize = true + Me.Label27.Location = New System.Drawing.Point(305, 48) + Me.Label27.Name = "Label27" + Me.Label27.Size = New System.Drawing.Size(18, 13) + Me.Label27.TabIndex = 13 + Me.Label27.Text = "[s]" + ' + 'Label28 + ' + Me.Label28.AutoSize = true + Me.Label28.Location = New System.Drawing.Point(7, 48) + Me.Label28.Name = "Label28" + Me.Label28.Size = New System.Drawing.Size(85, 13) + Me.Label28.TabIndex = 11 + Me.Label28.Text = "Activation delay:" + ' + 'tbEcoRollActivationDelay + ' + Me.tbEcoRollActivationDelay.Location = New System.Drawing.Point(247, 45) + Me.tbEcoRollActivationDelay.Name = "tbEcoRollActivationDelay" + Me.tbEcoRollActivationDelay.Size = New System.Drawing.Size(52, 20) + Me.tbEcoRollActivationDelay.TabIndex = 12 + ' + 'Label25 + ' + Me.Label25.AutoSize = true + Me.Label25.Location = New System.Drawing.Point(305, 22) + Me.Label25.Name = "Label25" + Me.Label25.Size = New System.Drawing.Size(38, 13) + Me.Label25.TabIndex = 10 + Me.Label25.Text = "[km/h]" + ' + 'Label26 + ' + Me.Label26.AutoSize = true + Me.Label26.Location = New System.Drawing.Point(7, 22) + Me.Label26.Name = "Label26" + Me.Label26.Size = New System.Drawing.Size(83, 13) + Me.Label26.TabIndex = 8 + Me.Label26.Text = "Minimum speed:" + ' + 'tbEcoRollMinSpeed + ' + Me.tbEcoRollMinSpeed.Location = New System.Drawing.Point(247, 19) + Me.tbEcoRollMinSpeed.Name = "tbEcoRollMinSpeed" + Me.tbEcoRollMinSpeed.Size = New System.Drawing.Size(52, 20) + Me.tbEcoRollMinSpeed.TabIndex = 9 + ' + 'gbEngineStopStart + ' + Me.gbEngineStopStart.Controls.Add(Me.tbEssUtility) + Me.gbEngineStopStart.Controls.Add(Me.Label24) + Me.gbEngineStopStart.Controls.Add(Me.Label18) + Me.gbEngineStopStart.Controls.Add(Me.tbMaxEngineOffTimespan) + Me.gbEngineStopStart.Controls.Add(Me.Label19) + Me.gbEngineStopStart.Controls.Add(Me.Label17) + Me.gbEngineStopStart.Controls.Add(Me.tbEngineStopStartActivationDelay) + Me.gbEngineStopStart.Controls.Add(Me.Label16) + Me.gbEngineStopStart.Location = New System.Drawing.Point(7, 9) + Me.gbEngineStopStart.Name = "gbEngineStopStart" + Me.gbEngineStopStart.Size = New System.Drawing.Size(515, 100) + Me.gbEngineStopStart.TabIndex = 5 + Me.gbEngineStopStart.TabStop = false + Me.gbEngineStopStart.Text = "Engine Stop/Start" + ' + 'tbEssUtility + ' + Me.tbEssUtility.Location = New System.Drawing.Point(247, 69) + Me.tbEssUtility.Name = "tbEssUtility" + Me.tbEssUtility.Size = New System.Drawing.Size(52, 20) + Me.tbEssUtility.TabIndex = 7 + ' + 'Label24 + ' + Me.Label24.AutoSize = true + Me.Label24.Location = New System.Drawing.Point(7, 72) + Me.Label24.Name = "Label24" + Me.Label24.Size = New System.Drawing.Size(141, 13) + Me.Label24.TabIndex = 6 + Me.Label24.Text = "Engie stop/start utility factor:" + ' + 'Label18 + ' + Me.Label18.AutoSize = true + Me.Label18.Location = New System.Drawing.Point(305, 46) + Me.Label18.Name = "Label18" + Me.Label18.Size = New System.Drawing.Size(18, 13) + Me.Label18.TabIndex = 5 + Me.Label18.Text = "[s]" + ' + 'tbMaxEngineOffTimespan + ' + Me.tbMaxEngineOffTimespan.Location = New System.Drawing.Point(247, 43) + Me.tbMaxEngineOffTimespan.Name = "tbMaxEngineOffTimespan" + Me.tbMaxEngineOffTimespan.Size = New System.Drawing.Size(52, 20) + Me.tbMaxEngineOffTimespan.TabIndex = 4 + ' + 'Label19 + ' + Me.Label19.AutoSize = true + Me.Label19.Location = New System.Drawing.Point(7, 46) + Me.Label19.Name = "Label19" + Me.Label19.Size = New System.Drawing.Size(105, 13) + Me.Label19.TabIndex = 3 + Me.Label19.Text = "Max. engine-off time:" + ' + 'Label17 + ' + Me.Label17.AutoSize = true + Me.Label17.Location = New System.Drawing.Point(305, 20) + Me.Label17.Name = "Label17" + Me.Label17.Size = New System.Drawing.Size(18, 13) + Me.Label17.TabIndex = 2 + Me.Label17.Text = "[s]" + ' + 'tbEngineStopStartActivationDelay + ' + Me.tbEngineStopStartActivationDelay.Location = New System.Drawing.Point(247, 17) + Me.tbEngineStopStartActivationDelay.Name = "tbEngineStopStartActivationDelay" + Me.tbEngineStopStartActivationDelay.Size = New System.Drawing.Size(52, 20) + Me.tbEngineStopStartActivationDelay.TabIndex = 1 + ' + 'Label16 + ' + Me.Label16.AutoSize = true + Me.Label16.Location = New System.Drawing.Point(7, 20) + Me.Label16.Name = "Label16" + Me.Label16.Size = New System.Drawing.Size(87, 13) + Me.Label16.TabIndex = 0 + Me.Label16.Text = "Delay engine-off:" + ' 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabelGEN}) @@ -1130,192 +1340,205 @@ Partial Class VectoJobForm Me.lblEngineCharacteristics.Size = New System.Drawing.Size(0, 13) Me.lblEngineCharacteristics.TabIndex = 37 ' - 'TabPgADAS - ' - Me.TabPgADAS.Controls.Add(Me.GroupBox4) - Me.TabPgADAS.Controls.Add(Me.GroupBox3) - Me.TabPgADAS.Location = New System.Drawing.Point(4, 22) - Me.TabPgADAS.Name = "TabPgADAS" - Me.TabPgADAS.Size = New System.Drawing.Size(527, 487) - Me.TabPgADAS.TabIndex = 8 - Me.TabPgADAS.Text = "ADAS Parameters" - Me.TabPgADAS.UseVisualStyleBackColor = true - ' - 'GroupBox3 - ' - Me.GroupBox3.Controls.Add(Me.tbEssUtility) - Me.GroupBox3.Controls.Add(Me.Label24) - Me.GroupBox3.Controls.Add(Me.Label18) - Me.GroupBox3.Controls.Add(Me.tbMaxEngineOffTimespan) - Me.GroupBox3.Controls.Add(Me.Label19) - Me.GroupBox3.Controls.Add(Me.Label17) - Me.GroupBox3.Controls.Add(Me.tbEngineStopStartActivationDelay) - Me.GroupBox3.Controls.Add(Me.Label16) - Me.GroupBox3.Location = New System.Drawing.Point(7, 9) - Me.GroupBox3.Name = "GroupBox3" - Me.GroupBox3.Size = New System.Drawing.Size(515, 100) - Me.GroupBox3.TabIndex = 5 - Me.GroupBox3.TabStop = false - Me.GroupBox3.Text = "Engine Stop/Start" - ' - 'tbEssUtility - ' - Me.tbEssUtility.Location = New System.Drawing.Point(247, 69) - Me.tbEssUtility.Name = "tbEssUtility" - Me.tbEssUtility.Size = New System.Drawing.Size(52, 20) - Me.tbEssUtility.TabIndex = 7 - ' - 'Label24 - ' - Me.Label24.AutoSize = true - Me.Label24.Location = New System.Drawing.Point(7, 72) - Me.Label24.Name = "Label24" - Me.Label24.Size = New System.Drawing.Size(141, 13) - Me.Label24.TabIndex = 6 - Me.Label24.Text = "Engie stop/start utility factor:" - ' - 'Label18 - ' - Me.Label18.AutoSize = true - Me.Label18.Location = New System.Drawing.Point(305, 46) - Me.Label18.Name = "Label18" - Me.Label18.Size = New System.Drawing.Size(18, 13) - Me.Label18.TabIndex = 5 - Me.Label18.Text = "[s]" - ' - 'tbEngineOffThreshold - ' - Me.tbMaxEngineOffTimespan.Location = New System.Drawing.Point(247, 43) - Me.tbMaxEngineOffTimespan.Name = "tbMaxEngineOffTimespan" - Me.tbMaxEngineOffTimespan.Size = New System.Drawing.Size(52, 20) - Me.tbMaxEngineOffTimespan.TabIndex = 4 - ' - 'Label19 - ' - Me.Label19.AutoSize = true - Me.Label19.Location = New System.Drawing.Point(7, 46) - Me.Label19.Name = "Label19" - Me.Label19.Size = New System.Drawing.Size(105, 13) - Me.Label19.TabIndex = 3 - Me.Label19.Text = "Max. engine-off time:" - ' - 'Label17 - ' - Me.Label17.AutoSize = true - Me.Label17.Location = New System.Drawing.Point(305, 20) - Me.Label17.Name = "Label17" - Me.Label17.Size = New System.Drawing.Size(18, 13) - Me.Label17.TabIndex = 2 - Me.Label17.Text = "[s]" - ' - 'tbEngineStopStartThreshold - ' - Me.tbEngineStopStartActivationDelay.Location = New System.Drawing.Point(247, 17) - Me.tbEngineStopStartActivationDelay.Name = "tbEngineStopStartActivationDelay" - Me.tbEngineStopStartActivationDelay.Size = New System.Drawing.Size(52, 20) - Me.tbEngineStopStartActivationDelay.TabIndex = 1 - ' - 'Label16 - ' - Me.Label16.AutoSize = true - Me.Label16.Location = New System.Drawing.Point(7, 20) - Me.Label16.Name = "Label16" - Me.Label16.Size = New System.Drawing.Size(87, 13) - Me.Label16.TabIndex = 0 - Me.Label16.Text = "Delay engine-off:" - ' - 'GroupBox4 - ' - Me.GroupBox4.Controls.Add(Me.Label29) - Me.GroupBox4.Controls.Add(Me.Label30) - Me.GroupBox4.Controls.Add(Me.TextBox1) - Me.GroupBox4.Controls.Add(Me.Label27) - Me.GroupBox4.Controls.Add(Me.Label28) - Me.GroupBox4.Controls.Add(Me.tbEcoRollActivationDelay) - Me.GroupBox4.Controls.Add(Me.Label25) - Me.GroupBox4.Controls.Add(Me.Label26) - Me.GroupBox4.Controls.Add(Me.tbEcoRollMinSpeed) - Me.GroupBox4.Location = New System.Drawing.Point(7, 115) - Me.GroupBox4.Name = "GroupBox4" - Me.GroupBox4.Size = New System.Drawing.Size(515, 100) - Me.GroupBox4.TabIndex = 6 - Me.GroupBox4.TabStop = false - Me.GroupBox4.Text = "Eco-Roll" - ' - 'Label25 - ' - Me.Label25.AutoSize = true - Me.Label25.Location = New System.Drawing.Point(305, 22) - Me.Label25.Name = "Label25" - Me.Label25.Size = New System.Drawing.Size(38, 13) - Me.Label25.TabIndex = 10 - Me.Label25.Text = "[km/h]" - ' - 'tbEcoRollMinSpeed - ' - Me.tbEcoRollMinSpeed.Location = New System.Drawing.Point(247, 19) - Me.tbEcoRollMinSpeed.Name = "tbEcoRollMinSpeed" - Me.tbEcoRollMinSpeed.Size = New System.Drawing.Size(52, 20) - Me.tbEcoRollMinSpeed.TabIndex = 9 - ' - 'Label26 - ' - Me.Label26.AutoSize = true - Me.Label26.Location = New System.Drawing.Point(7, 22) - Me.Label26.Name = "Label26" - Me.Label26.Size = New System.Drawing.Size(83, 13) - Me.Label26.TabIndex = 8 - Me.Label26.Text = "Minimum speed:" - ' - 'Label27 - ' - Me.Label27.AutoSize = true - Me.Label27.Location = New System.Drawing.Point(305, 48) - Me.Label27.Name = "Label27" - Me.Label27.Size = New System.Drawing.Size(18, 13) - Me.Label27.TabIndex = 13 - Me.Label27.Text = "[s]" - ' - 'Label28 - ' - Me.Label28.AutoSize = true - Me.Label28.Location = New System.Drawing.Point(7, 48) - Me.Label28.Name = "Label28" - Me.Label28.Size = New System.Drawing.Size(85, 13) - Me.Label28.TabIndex = 11 - Me.Label28.Text = "Activation delay:" - ' - 'tbEcoRollActivationDelay - ' - Me.tbEcoRollActivationDelay.Location = New System.Drawing.Point(247, 45) - Me.tbEcoRollActivationDelay.Name = "tbEcoRollActivationDelay" - Me.tbEcoRollActivationDelay.Size = New System.Drawing.Size(52, 20) - Me.tbEcoRollActivationDelay.TabIndex = 12 - ' - 'Label29 - ' - Me.Label29.AutoSize = true - Me.Label29.Location = New System.Drawing.Point(305, 74) - Me.Label29.Name = "Label29" - Me.Label29.Size = New System.Drawing.Size(38, 13) - Me.Label29.TabIndex = 16 - Me.Label29.Text = "[km/h]" - ' - 'Label30 - ' - Me.Label30.AutoSize = true - Me.Label30.Location = New System.Drawing.Point(7, 74) - Me.Label30.Name = "Label30" - Me.Label30.Size = New System.Drawing.Size(114, 13) - Me.Label30.TabIndex = 14 - Me.Label30.Text = "Underspeed threshold:" - ' - 'TextBox1 - ' - Me.TextBox1.Location = New System.Drawing.Point(247, 71) - Me.TextBox1.Name = "TextBox1" - Me.TextBox1.Size = New System.Drawing.Size(52, 20) - Me.TextBox1.TabIndex = 15 + 'gbPCC + ' + Me.gbPCC.Controls.Add(Me.Label43) + Me.gbPCC.Controls.Add(Me.Label42) + Me.gbPCC.Controls.Add(Me.Label40) + Me.gbPCC.Controls.Add(Me.Label41) + Me.gbPCC.Controls.Add(Me.tbPCCPreviewUseCase2) + Me.gbPCC.Controls.Add(Me.Label38) + Me.gbPCC.Controls.Add(Me.Label39) + Me.gbPCC.Controls.Add(Me.tbPCCPreviewUseCase1) + Me.gbPCC.Controls.Add(Me.Label36) + Me.gbPCC.Controls.Add(Me.Label37) + Me.gbPCC.Controls.Add(Me.tbPCCMinSpeed) + Me.gbPCC.Controls.Add(Me.Label34) + Me.gbPCC.Controls.Add(Me.Label35) + Me.gbPCC.Controls.Add(Me.tbPCCEnableSpeed) + Me.gbPCC.Controls.Add(Me.Label31) + Me.gbPCC.Controls.Add(Me.Label33) + Me.gbPCC.Controls.Add(Me.tbPCCOverspeed) + Me.gbPCC.Controls.Add(Me.Label20) + Me.gbPCC.Controls.Add(Me.Label22) + Me.gbPCC.Controls.Add(Me.tbPCCUnderspeed) + Me.gbPCC.Location = New System.Drawing.Point(7, 221) + Me.gbPCC.Name = "gbPCC" + Me.gbPCC.Size = New System.Drawing.Size(515, 228) + Me.gbPCC.TabIndex = 7 + Me.gbPCC.TabStop = false + Me.gbPCC.Text = "Predictive Cruise Control" + ' + 'Label20 + ' + Me.Label20.AutoSize = true + Me.Label20.Location = New System.Drawing.Point(305, 22) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(38, 13) + Me.Label20.TabIndex = 13 + Me.Label20.Text = "[km/h]" + ' + 'Label22 + ' + Me.Label22.AutoSize = true + Me.Label22.Location = New System.Drawing.Point(7, 22) + Me.Label22.Name = "Label22" + Me.Label22.Size = New System.Drawing.Size(106, 13) + Me.Label22.TabIndex = 11 + Me.Label22.Text = "Allowed underspeed:" + ' + 'tbPCCUnderspeed + ' + Me.tbPCCUnderspeed.Location = New System.Drawing.Point(247, 19) + Me.tbPCCUnderspeed.Name = "tbPCCUnderspeed" + Me.tbPCCUnderspeed.Size = New System.Drawing.Size(52, 20) + Me.tbPCCUnderspeed.TabIndex = 12 + ' + 'Label31 + ' + Me.Label31.AutoSize = true + Me.Label31.Location = New System.Drawing.Point(305, 48) + Me.Label31.Name = "Label31" + Me.Label31.Size = New System.Drawing.Size(38, 13) + Me.Label31.TabIndex = 16 + Me.Label31.Text = "[km/h]" + ' + 'Label33 + ' + Me.Label33.AutoSize = true + Me.Label33.Location = New System.Drawing.Point(7, 48) + Me.Label33.Name = "Label33" + Me.Label33.Size = New System.Drawing.Size(100, 13) + Me.Label33.TabIndex = 14 + Me.Label33.Text = "Allowed overspeed:" + ' + 'tbPCCOverspeed + ' + Me.tbPCCOverspeed.Location = New System.Drawing.Point(247, 45) + Me.tbPCCOverspeed.Name = "tbPCCOverspeed" + Me.tbPCCOverspeed.Size = New System.Drawing.Size(52, 20) + Me.tbPCCOverspeed.TabIndex = 15 + ' + 'Label34 + ' + Me.Label34.AutoSize = true + Me.Label34.Location = New System.Drawing.Point(305, 74) + Me.Label34.Name = "Label34" + Me.Label34.Size = New System.Drawing.Size(38, 13) + Me.Label34.TabIndex = 19 + Me.Label34.Text = "[km/h]" + ' + 'Label35 + ' + Me.Label35.AutoSize = true + Me.Label35.Location = New System.Drawing.Point(7, 74) + Me.Label35.Name = "Label35" + Me.Label35.Size = New System.Drawing.Size(113, 13) + Me.Label35.TabIndex = 17 + Me.Label35.Text = "PCC enabling velocity:" + ' + 'tbPCCEnableSpeed + ' + Me.tbPCCEnableSpeed.Location = New System.Drawing.Point(247, 71) + Me.tbPCCEnableSpeed.Name = "tbPCCEnableSpeed" + Me.tbPCCEnableSpeed.Size = New System.Drawing.Size(52, 20) + Me.tbPCCEnableSpeed.TabIndex = 18 + ' + 'Label36 + ' + Me.Label36.AutoSize = true + Me.Label36.Location = New System.Drawing.Point(305, 100) + Me.Label36.Name = "Label36" + Me.Label36.Size = New System.Drawing.Size(38, 13) + Me.Label36.TabIndex = 22 + Me.Label36.Text = "[km/h]" + ' + 'Label37 + ' + Me.Label37.AutoSize = true + Me.Label37.Location = New System.Drawing.Point(7, 100) + Me.Label37.Name = "Label37" + Me.Label37.Size = New System.Drawing.Size(83, 13) + Me.Label37.TabIndex = 20 + Me.Label37.Text = "Minimum speed:" + ' + 'tbPCCMinSpeed + ' + Me.tbPCCMinSpeed.Location = New System.Drawing.Point(247, 97) + Me.tbPCCMinSpeed.Name = "tbPCCMinSpeed" + Me.tbPCCMinSpeed.Size = New System.Drawing.Size(52, 20) + Me.tbPCCMinSpeed.TabIndex = 21 + ' + 'Label38 + ' + Me.Label38.AutoSize = true + Me.Label38.Location = New System.Drawing.Point(305, 126) + Me.Label38.Name = "Label38" + Me.Label38.Size = New System.Drawing.Size(21, 13) + Me.Label38.TabIndex = 25 + Me.Label38.Text = "[m]" + ' + 'Label39 + ' + Me.Label39.AutoSize = true + Me.Label39.Location = New System.Drawing.Point(7, 126) + Me.Label39.Name = "Label39" + Me.Label39.Size = New System.Drawing.Size(146, 13) + Me.Label39.TabIndex = 23 + Me.Label39.Text = "Preview distance use case 1:" + ' + 'tbPCCPreviewUseCase1 + ' + Me.tbPCCPreviewUseCase1.Location = New System.Drawing.Point(247, 123) + Me.tbPCCPreviewUseCase1.Name = "tbPCCPreviewUseCase1" + Me.tbPCCPreviewUseCase1.Size = New System.Drawing.Size(52, 20) + Me.tbPCCPreviewUseCase1.TabIndex = 24 + ' + 'Label40 + ' + Me.Label40.AutoSize = true + Me.Label40.Location = New System.Drawing.Point(305, 152) + Me.Label40.Name = "Label40" + Me.Label40.Size = New System.Drawing.Size(21, 13) + Me.Label40.TabIndex = 28 + Me.Label40.Text = "[m]" + ' + 'Label41 + ' + Me.Label41.AutoSize = true + Me.Label41.Location = New System.Drawing.Point(7, 152) + Me.Label41.Name = "Label41" + Me.Label41.Size = New System.Drawing.Size(146, 13) + Me.Label41.TabIndex = 26 + Me.Label41.Text = "Preview distance use case 2:" + ' + 'tbPCCPreviewUseCase2 + ' + Me.tbPCCPreviewUseCase2.Location = New System.Drawing.Point(247, 149) + Me.tbPCCPreviewUseCase2.Name = "tbPCCPreviewUseCase2" + Me.tbPCCPreviewUseCase2.Size = New System.Drawing.Size(52, 20) + Me.tbPCCPreviewUseCase2.TabIndex = 27 + ' + 'Label42 + ' + Me.Label42.AutoSize = true + Me.Label42.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.Label42.Location = New System.Drawing.Point(7, 181) + Me.Label42.Name = "Label42" + Me.Label42.Size = New System.Drawing.Size(400, 13) + Me.Label42.TabIndex = 29 + Me.Label42.Text = "Note: Predictive cruise conrol is only activated on highway parts of the driving "& _ + "cycle" + ' + 'Label43 + ' + Me.Label43.AutoSize = true + Me.Label43.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0,Byte)) + Me.Label43.Location = New System.Drawing.Point(39, 196) + Me.Label43.Name = "Label43" + Me.Label43.Size = New System.Drawing.Size(157, 13) + Me.Label43.TabIndex = 30 + Me.Label43.Text = "(cf. column HW in driving cycle)" ' 'VectoJobForm ' @@ -1365,6 +1588,11 @@ Partial Class VectoJobForm Me.GroupBox1.PerformLayout Me.PnEcoRoll.ResumeLayout(false) Me.PnEcoRoll.PerformLayout + Me.TabPgADAS.ResumeLayout(false) + Me.gbEcoRoll.ResumeLayout(false) + Me.gbEcoRoll.PerformLayout + Me.gbEngineStopStart.ResumeLayout(false) + Me.gbEngineStopStart.PerformLayout Me.StatusStrip1.ResumeLayout(false) Me.StatusStrip1.PerformLayout Me.ToolStrip1.ResumeLayout(false) @@ -1373,11 +1601,8 @@ Partial Class VectoJobForm Me.CmOpenFile.ResumeLayout(false) CType(Me.PicVehicle,System.ComponentModel.ISupportInitialize).EndInit CType(Me.PicBox,System.ComponentModel.ISupportInitialize).EndInit - Me.TabPgADAS.ResumeLayout(false) - Me.GroupBox3.ResumeLayout(false) - Me.GroupBox3.PerformLayout - Me.GroupBox4.ResumeLayout(false) - Me.GroupBox4.PerformLayout + Me.gbPCC.ResumeLayout(false) + Me.gbPCC.PerformLayout Me.ResumeLayout(false) Me.PerformLayout @@ -1481,17 +1706,17 @@ End Sub Friend WithEvents Label15 As System.Windows.Forms.Label Friend WithEvents lblEngineCharacteristics As System.Windows.Forms.Label Friend WithEvents TabPgADAS As TabPage - Friend WithEvents GroupBox4 As GroupBox + Friend WithEvents gbEcoRoll As GroupBox Friend WithEvents Label29 As Label Friend WithEvents Label30 As Label - Friend WithEvents TextBox1 As TextBox + Friend WithEvents tbEcoRollUnderspeed As TextBox Friend WithEvents Label27 As Label Friend WithEvents Label28 As Label Friend WithEvents tbEcoRollActivationDelay As TextBox Friend WithEvents Label25 As Label Friend WithEvents Label26 As Label Friend WithEvents tbEcoRollMinSpeed As TextBox - Friend WithEvents GroupBox3 As GroupBox + Friend WithEvents gbEngineStopStart As GroupBox Friend WithEvents tbEssUtility As TextBox Friend WithEvents Label24 As Label Friend WithEvents Label18 As Label @@ -1500,4 +1725,25 @@ End Sub Friend WithEvents Label17 As Label Friend WithEvents tbEngineStopStartActivationDelay As TextBox Friend WithEvents Label16 As Label + Friend WithEvents gbPCC As GroupBox + Friend WithEvents Label36 As Label + Friend WithEvents Label37 As Label + Friend WithEvents tbPCCMinSpeed As TextBox + Friend WithEvents Label34 As Label + Friend WithEvents Label35 As Label + Friend WithEvents tbPCCEnableSpeed As TextBox + Friend WithEvents Label31 As Label + Friend WithEvents Label33 As Label + Friend WithEvents tbPCCOverspeed As TextBox + Friend WithEvents Label20 As Label + Friend WithEvents Label22 As Label + Friend WithEvents tbPCCUnderspeed As TextBox + Friend WithEvents Label43 As Label + Friend WithEvents Label42 As Label + Friend WithEvents Label40 As Label + Friend WithEvents Label41 As Label + Friend WithEvents tbPCCPreviewUseCase2 As TextBox + Friend WithEvents Label38 As Label + Friend WithEvents Label39 As Label + Friend WithEvents tbPCCPreviewUseCase1 As TextBox End Class diff --git a/VECTO/GUI/VectoJobForm.resx b/VECTO/GUI/VectoJobForm.resx index 9a05794ea7421910e7480e535b25f789796aec1e..7e42f8f2b46fdf118f2ffe10a6b504b5911b2172 100644 --- a/VECTO/GUI/VectoJobForm.resx +++ b/VECTO/GUI/VectoJobForm.resx @@ -220,9 +220,6 @@ <metadata name="CmOpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>350, 15</value> </metadata> - <metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>468, 15</value> - </metadata> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>49</value> </metadata> diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb index 6f7177091539f1c8248728da75a0a5b05bc9ff2c..20da1b0aff3fb2760d25423c25eb3d253faa1c0f 100644 --- a/VECTO/GUI/VectoJobForm.vb +++ b/VECTO/GUI/VectoJobForm.vb @@ -87,6 +87,10 @@ Public Class VectoJobForm ButAuxRem.Enabled = Not Cfg.DeclMode PnEcoRoll.Enabled = Not Cfg.DeclMode + gbEcoRoll.Enabled = not Cfg.DeclMode + gbEngineStopStart.Enabled = not cfg.DeclMode + gbPCC.Enabled = Not Cfg.DeclMode + _changed = False 'AA-TB PopulateAdvancedAuxiliaries() @@ -531,9 +535,20 @@ Public Class VectoJobForm GetRelativePath(driver.Lookahead.CoastingDecisionFactorVelocityDropLookup.Source, _basePath)) End If - tbEngineStopStartActivationDelay.Text = If(driver.EngineStopStartData.ActivationDelay?.ToGUIFormat(), DeclarationData.Driver.EngineStopStart.ActivationDelay.ToGUIFormat()) - tbMaxEngineOffTimespan.Text = If(driver.EngineStopStartData.MaxEngineOffTimespan?.ToGUIFormat(), DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan.ToGUIFormat()) - tbEssUtility.Text = driver.EngineStopStartData.UtilityFactor.ToGUIFormat() + tbEngineStopStartActivationDelay.Text = If(driver.EngineStopStartData?.ActivationDelay?.ToGUIFormat(), DeclarationData.Driver.EngineStopStart.ActivationDelay.ToGUIFormat()) + tbMaxEngineOffTimespan.Text = If(driver.EngineStopStartData?.MaxEngineOffTimespan?.ToGUIFormat(), DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan.ToGUIFormat()) + tbEssUtility.Text = If(driver.EngineStopStartData?.UtilityFactor.ToGUIFormat(), DeclarationData.Driver.EngineStopStart.UtilityFactor.ToGUIFormat()) + + tbEcoRollActivationDelay.Text = if(driver.EcoRollData?.ActivationDelay?.ToGUIFormat(), DeclarationData.Driver.EcoRoll.ActivationDelay.ToGUIFormat()) + tbEcoRollMinSpeed.Text = if(driver.EcoRollData?.MinSpeed?.AsKmph().ToGUIFormat(), DeclarationData.Driver.EcoRoll.MinSpeed.AsKmph().ToGUIFormat()) + tbEcoRollUnderspeed.Text = if(driver.EcoRollData?.UnderspeedThreshold?.AsKmph().ToGUIFormat(), DeclarationData.Driver.EcoRoll.UnderspeedThreshold.AsKmph().ToGUIFormat()) + + tbPCCUnderspeed.Text = if(driver.PCCData?.Underspeed?.AsKmph().ToGUIFormat(), DeclarationData.Driver.PCC.Underspeed.AsKmph().ToGUIFormat()) + tbPCCOverspeed.Text = If(driver.PCCData?.OverspeedUseCase3?.AsKmph().ToGUIFormat(), DeclarationData.Driver.PCC.OverspeedUseCase3.AsKmph().ToGUIFormat()) + tbPCCEnableSpeed.Text = if(driver.PCCData?.PCCEnabledSpeed?.AsKmph().ToGUIFormat(), DeclarationData.Driver.PCC.PCCEnableSpeed.AsKmph().ToGUIFormat()) + tbPCCMinSpeed.Text = if(driver.PCCData?.MinSpeed?.AsKmph().ToGUIFormat(), DeclarationData.Driver.PCC.MinSpeed.AsKmph().ToGUIFormat()) + tbPCCPreviewUseCase1.Text = If(driver.PCCData?.PreviewDistanceUseCase1?.ToGUIFormat(), DeclarationData.Driver.PCC.PreviewDistanceUseCase1.ToGUIFormat()) + tbPCCPreviewUseCase2.Text = if(driver.PCCData?.PreviewDistanceUseCase2?.ToGUIFormat(), DeclarationData.Driver.PCC.PreviewDistanceUseCase2.ToGUIFormat()) '------------------------------------------------------------- @@ -653,6 +668,18 @@ Public Class VectoJobForm vectoJob.EngineStopStartActivationThreshold = tbEngineStopStartActivationDelay.text.ToDouble(0) vectoJob.EngineOffTimeLimit = tbMaxEngineOffTimespan.Text.ToDouble(0) vectoJob.EngineStStUtilityFactor = tbEssUtility.Text.ToDouble(0) + + vectoJob.EcoRollActivationDelay = tbEcoRollActivationDelay.Text.ToDouble(0) + vectoJob.EcoRollMinSpeed = tbEcoRollMinSpeed.Text.ToDouble(0) + vectoJob.EcoRollUnderspeedThreshold = tbEcoRollUnderspeed.Text.ToDouble(0) + + vectoJob.PCCEnableSpeedVal = tbPCCEnableSpeed.Text.ToDouble(0) + vectoJob.PCCMinSpeed = tbPCCMinSpeed.Text.ToDouble(0) + vectoJob.PCCUnderspeed = tbPCCUnderspeed.Text.ToDouble(0) + vectoJob.PCCOverspeedUseCase3 = tbPCCOverspeed.Text.ToDouble(0) + vectoJob.PCCPrevewiDistance1 = tbPCCPreviewUseCase1.Text.ToDouble(0) + vectoJob.PCCPreviewDistance2 = tbPCCPreviewUseCase2.Text.ToDouble(0) + '------------------------------------------------------------ 'SAVE diff --git a/VECTO/Input Files/VectoJob.vb b/VECTO/Input Files/VectoJob.vb index 4e43b975551c19995c3f12f50f6dfe7c39504421..420fb1caf8746e4230883027ebb84bce0a013ecb 100644 --- a/VECTO/Input Files/VectoJob.vb +++ b/VECTO/Input Files/VectoJob.vb @@ -33,7 +33,7 @@ Imports TUGraz.VectoCore.Utils Public Class VectoJob Implements IEngineeringInputDataProvider, IDeclarationInputDataProvider, IEngineeringJobInputData, IDeclarationJobInputData, IDriverEngineeringInputData, IDriverDeclarationInputData, IAuxiliariesEngineeringInputData, - IAuxiliariesDeclarationInputData, IJSONVehicleComponents, IEngineStopStartEngineeringInputData, IEcoRollEngineeringInputData + IAuxiliariesDeclarationInputData, IJSONVehicleComponents, IEngineStopStartEngineeringInputData, IEcoRollEngineeringInputData, IPCCEngineeringInputData 'AA-TB 'STORES THE Type and version of the chosen or default Auxiliary Type ( Classic/Original or other ) @@ -78,6 +78,12 @@ Public Class VectoJob Public EcoRollMinSpeed As double Public EcoRollUnderspeedThreshold As Double Public EcoRollActivationDelay as double + Public PCCEnableSpeedVal As Double + Public PCCMinSpeed As Double + Public PCCPrevewiDistance1 As Double + Public PCCPreviewDistance2 As Double + Public PCCUnderspeed As Double + Public PCCOverspeedUseCase3 As Double 'Private _vehicleInputData As JSONComponentInputData 'Private _engineInputData As JSONComponentInputData @@ -283,12 +289,49 @@ Public Class VectoJob End Property Public ReadOnly Property PCCData As IPCCEngineeringInputData Implements IDriverEngineeringInputData.PCCData + get + return me + End Get + End Property + + Public ReadOnly Property PCCEnabledSpeed As MeterPerSecond Implements IPCCEngineeringInputData.PCCEnabledSpeed + get + return PCCEnableSpeedVal.KMPHtoMeterPerSecond() + End Get + End Property + Public ReadOnly Property IPCCEngineeringInputData_MinSpeed As MeterPerSecond Implements IPCCEngineeringInputData.MinSpeed + get + return PCCMinSpeed.KMPHtoMeterPerSecond() + End Get + End Property Public ReadOnly Property MinSpeed As MeterPerSecond Implements IEcoRollEngineeringInputData.MinSpeed get Return EcoRollMinSpeed.KMPHtoMeterPerSecond() End Get End Property + + Public ReadOnly Property PreviewDistanceUseCase1 As Meter Implements IPCCEngineeringInputData.PreviewDistanceUseCase1 + get + return PCCPrevewiDistance1.SI(of Meter) + End Get + End Property + Public ReadOnly Property PreviewDistanceUseCase2 As Meter Implements IPCCEngineeringInputData.PreviewDistanceUseCase2 + get + return PCCPreviewDistance2.SI(of Meter) + End Get + End Property + Public ReadOnly Property Underspeed As MeterPerSecond Implements IPCCEngineeringInputData.Underspeed + get + return PCCUnderspeed.KMPHtoMeterPerSecond() + End Get + End Property + Public ReadOnly Property OverspeedUseCase3 As MeterPerSecond Implements IPCCEngineeringInputData.OverspeedUseCase3 + get + Return PCCOverspeedUseCase3.KMPHtoMeterPerSecond() + End Get + End Property + Public ReadOnly Property IEcoRollEngineeringInputData_ActivationDelay As Second Implements IEcoRollEngineeringInputData.ActivationDelay get Return EcoRollActivationDelay.SI(Of Second)() diff --git a/VECTO/OutputData/JSONFileWriter.vb b/VECTO/OutputData/JSONFileWriter.vb index 6fd6a51e3b8b799da011735eba189e130cba2b62..8290b58a32c05ac124eb8afe1642635ace347535 100644 --- a/VECTO/OutputData/JSONFileWriter.vb +++ b/VECTO/OutputData/JSONFileWriter.vb @@ -11,65 +11,66 @@ Imports TUGraz.VectoCore.Models.Declaration Imports TUGraz.VectoCommon.Utils Public Class JSONFileWriter - Implements IOutputFileWriter - Public Const EngineFormatVersion As Integer = 5 + Implements IOutputFileWriter + Public Const EngineFormatVersion As Integer = 5 - Public Const GearboxFormatVersion As Integer = 6 + Public Const GearboxFormatVersion As Integer = 6 - Public Const VehicleFormatVersion As Integer = 8 + Public Const VehicleFormatVersion As Integer = 8 - Private Const VectoJobFormatVersion As Integer = 5 + Private Const VectoJobFormatVersion As Integer = 5 - Private Shared _instance As JSONFileWriter + Private Shared _instance As JSONFileWriter - Public Shared ReadOnly Property Instance As JSONFileWriter - Get - If _instance Is Nothing Then _instance = New JSONFileWriter() - Return _instance - End Get - End Property + Public Shared ReadOnly Property Instance As JSONFileWriter + Get + If _instance Is Nothing Then _instance = New JSONFileWriter() + Return _instance + End Get + End Property - Public Sub SaveEngine(eng As IEngineEngineeringInputData, filename As String) _ - Implements IOutputFileWriter.SaveEngine + Public Sub SaveEngine(eng As IEngineEngineeringInputData, filename As String) _ + Implements IOutputFileWriter.SaveEngine - 'Header - Dim header As Dictionary(Of String, Object) = GetHeader(EngineFormatVersion) + 'Header + Dim header As Dictionary(Of String, Object) = GetHeader(EngineFormatVersion) - 'Body - Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + 'Body + Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - body.Add("SavedInDeclMode", Cfg.DeclMode) + body.Add("SavedInDeclMode", Cfg.DeclMode) - body.Add("ModelName", eng.Model) + body.Add("ModelName", eng.Model) - body.Add("Displacement", eng.Displacement.ConvertToCubicCentiMeter().ToString()) - body.Add("IdlingSpeed", eng.EngineModes.First().IdleSpeed.AsRPM) - body.Add("Inertia", eng.Inertia.Value()) + body.Add("Displacement", eng.Displacement.ConvertToCubicCentiMeter().ToString()) + body.Add("IdlingSpeed", eng.EngineModes.First().IdleSpeed.AsRPM) + body.Add("Inertia", eng.Inertia.Value()) Dim fuels As List(Of Object) = New List(Of Object)() - For Each fuel As IEngineFuelEngineeringInputData In eng.EngineModes.First().Fuels - Dim entry as Dictionary(Of string, object) = New Dictionary(Of String,Object)() - entry.Add("WHTC-Urban", fuel.WHTCUrban) - entry.Add("WHTC-Rural", fuel.WHTCRural) - entry.Add("WHTC-Motorway", fuel.WHTCMotorway) - entry.Add("WHTC-Engineering", fuel.WHTCEngineering) - entry.Add("ColdHotBalancingFactor", fuel.ColdHotBalancingFactor) - entry.Add("CFRegPer", fuel.CorrectionFactorRegPer) - entry.Add("FuelMap", GetRelativePath(fuel.FuelConsumptionMap.Source, Path.GetDirectoryName(filename))) - entry.Add("FuelType", fuel.FuelType.ToString()) + For Each fuel As IEngineFuelEngineeringInputData In eng.EngineModes.First().Fuels + Dim entry as Dictionary(Of string, object) = New Dictionary(Of String,Object)() + entry.Add("WHTC-Urban", fuel.WHTCUrban) + entry.Add("WHTC-Rural", fuel.WHTCRural) + entry.Add("WHTC-Motorway", fuel.WHTCMotorway) + entry.Add("WHTC-Engineering", fuel.WHTCEngineering) + entry.Add("ColdHotBalancingFactor", fuel.ColdHotBalancingFactor) + entry.Add("CFRegPer", fuel.CorrectionFactorRegPer) + entry.Add("FuelMap", GetRelativePath(fuel.FuelConsumptionMap.Source, Path.GetDirectoryName(filename))) + entry.Add("FuelType", fuel.FuelType.ToString()) fuels.Add(entry) - Next + Next body.Add("Fuels", fuels) - - body.Add("RatedPower", eng.RatedPowerDeclared.Value()) - body.Add("RatedSpeed", eng.RatedSpeedDeclared.AsRPM) - body.Add("MaxTorque", eng.MaxTorqueDeclared.Value()) - - body.Add("FullLoadCurve", GetRelativePath(eng.EngineModes.First().FullLoadCurve.Source, Path.GetDirectoryName(filename))) + body.Add("RatedPower", eng.RatedPowerDeclared.Value()) + body.Add("RatedSpeed", eng.RatedSpeedDeclared.AsRPM) + body.Add("MaxTorque", eng.MaxTorqueDeclared.Value()) + + + body.Add("FullLoadCurve", + GetRelativePath(eng.EngineModes.First().FullLoadCurve.Source, Path.GetDirectoryName(filename))) body.add("WHRType", eng.WHRType.ToString()) @@ -86,376 +87,412 @@ Public Class JSONFileWriter body.Add("WHRCorrectionFactors", whr) End If - WriteFile(header, body, filename) - End Sub - - Protected Function GetHeader(fileVersion As Integer) As Dictionary(Of String, Object) - Dim header As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - - header.Add("CreatedBy", "") - header.Add("Date", Now.ToUniversalTime().ToString("o")) - header.Add("AppVersion", VECTOvers) - header.Add("FileVersion", fileVersion) - Return header - End Function - - Public Sub SaveGearbox(gbx As IGearboxEngineeringInputData, axl As IAxleGearInputData, torqueConverter As ITorqueConverterEngineeringInputData, gshift As IGearshiftEngineeringInputData, filename As String) _ - Implements IOutputFileWriter.SaveGearbox - - 'Header - Dim header As Dictionary(Of String, Object) = GetHeader(GearboxFormatVersion) - - - 'Body - Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - - body.Add(JsonKeys.SavedInDeclMode, Cfg.DeclMode) - body.Add(JsonKeys.Gearbox_ModelName, gbx.Model) - body.Add(JsonKeys.Gearbox_Inertia, gbx.Inertia.Value()) - body.Add(JsonKeys.Gearbox_TractionInterruption, gbx.TractionInterruption.Value()) - - Dim ls As New List(Of Dictionary(Of String, Object)) - Dim axlgDict As New Dictionary(Of String, Object) - axlgDict.Add(JsonKeys.Gearbox_Gear_Ratio, axl.Ratio) - If axl.LossMap Is Nothing Then - axlgDict.Add(JsonKeys.Gearbox_Gear_Efficiency, axl.Efficiency) - Else - axlgDict.Add(JsonKeys.Gearbox_Gear_LossMapFile, GetRelativePath(axl.LossMap.Source, Path.GetDirectoryName(filename))) - End If - ls.Add(axlgDict) - - For Each gear As ITransmissionInputData In gbx.Gears - Dim gearDict As New Dictionary(Of String, Object) - gearDict.Add(JsonKeys.Gearbox_Gear_Ratio, gear.Ratio) - If gear.LossMap Is Nothing Then - gearDict.Add(JsonKeys.Gearbox_Gear_Efficiency, gear.Efficiency) - Else - gearDict.Add(JsonKeys.Gearbox_Gear_LossMapFile, - GetRelativePath(gear.LossMap.Source, Path.GetDirectoryName(filename))) - End If - gearDict.Add(JsonKeys.Gearbox_Gear_ShiftPolygonFile, If _ - (Not gbx.SavedInDeclarationMode AndAlso Not gear.ShiftPolygon Is Nothing, - GetRelativePath(gear.ShiftPolygon.Source, Path.GetDirectoryName(filename)), "")) - gearDict.Add("MaxTorque", If(gear.MaxTorque Is Nothing, "", gear.MaxTorque.Value().ToString())) - gearDict.Add("MaxSpeed", If(gear.MaxInputSpeed Is Nothing, "", gear.MaxInputSpeed.AsRPM.ToString())) - - ls.Add(gearDict) - Next - body.Add(JsonKeys.Gearbox_Gears, ls) - body.Add(JsonKeys.Gearbox_TorqueReserve, gshift.TorqueReserve*100) - body.Add(JsonKeys.Gearbox_ShiftTime, gshift.MinTimeBetweenGearshift.Value()) - body.Add(JsonKeys.Gearbox_StartTorqueReserve, gshift.StartTorqueReserve*100) - body.Add(JsonKeys.Gearbox_StartSpeed, gshift.StartSpeed.Value()) - body.Add(JsonKeys.Gearbox_StartAcceleration, gshift.StartAcceleration.Value()) - body.Add(JsonKeys.Gearbox_GearboxType, gbx.Type.ToString()) - - - Dim torqueConverterDict As New Dictionary(Of String, Object) - torqueConverterDict.Add("Enabled", Not torqueConverter Is Nothing AndAlso gbx.Type.AutomaticTransmission()) - If gbx.Type.AutomaticTransmission() AndAlso Not torqueConverter Is Nothing Then - torqueConverterDict.Add("File", GetRelativePath(torqueConverter.TCData.Source, Path.GetDirectoryName(filename))) - torqueConverterDict.Add(JsonKeys.Gearbox_TorqueConverter_ReferenceRPM, torqueConverter.ReferenceRPM.AsRPM) - torqueConverterDict.Add(JsonKeys.Gearbox_TorqueConverter_Inertia, torqueConverter.Inertia.Value()) - torqueConverterDict.Add("MaxTCSpeed", torqueConverter.MaxInputSpeed.AsRPM) - torqueConverterDict.Add("ShiftPolygon", - If (Not gbx.SavedInDeclarationMode AndAlso Not torqueConverter.ShiftPolygon Is Nothing, - GetRelativePath(torqueConverter.ShiftPolygon.Source, Path.GetDirectoryName(filename)), "")) - torqueConverterDict.Add("CLUpshiftMinAcceleration", gshift.CLUpshiftMinAcceleration.Value()) - torqueConverterDict.Add("CCUpshiftMinAcceleration", gshift.CCUpshiftMinAcceleration.Value()) - End If - body.Add(JsonKeys.Gearbox_TorqueConverter, torqueConverterDict) - - body.Add("DownshiftAfterUpshiftDelay", gshift.DownshiftAfterUpshiftDelay.Value()) - body.Add("UpshiftAfterDownshiftDelay", gshift.UpshiftAfterDownshiftDelay.Value()) - body.Add("UpshiftMinAcceleration", gshift.UpshiftMinAcceleration.Value()) - - body.Add("PowershiftShiftTime", gbx.PowershiftShiftTime.Value()) - - WriteFile(header, body, filename) - End Sub - - Public Sub SaveVehicle(vehicle As IVehicleEngineeringInputData, airdrag As IAirdragEngineeringInputData, - retarder As IRetarderInputData, - pto As IPTOTransmissionInputData, angledrive As IAngledriveInputData, filename As String) _ - Implements IOutputFileWriter.SaveVehicle - Dim basePath As String = Path.GetDirectoryName(filename) - - 'Header - Dim header As Dictionary(Of String, Object) = GetHeader(VehicleFormatVersion) - - 'Body - Dim retarderOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() - If retarder Is Nothing Then - retarderOut.Add("Type", RetarderType.None.GetName()) - Else - retarderOut.Add("Type", retarder.Type.GetName()) - retarderOut.Add("Ratio", retarder.Ratio) - retarderOut.Add("File", - If _ - (retarder.Type.IsDedicatedComponent AndAlso Not retarder.LossMap Is Nothing, - GetRelativePath(retarder.LossMap.Source, basePath), "")) - End If - - Dim ptoOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - If pto Is Nothing Then - ptoOut.Add("Type", "None") - Else - ptoOut.Add("Type", pto.PTOTransmissionType) - ptoOut.Add("LossMap", - If _ - (pto.PTOTransmissionType <> "None" AndAlso Not pto.PTOLossMap Is Nothing, - GetRelativePath(pto.PTOLossMap.Source, basePath), "")) - ptoOut.Add("Cycle", - If _ - (pto.PTOTransmissionType <> "None" AndAlso Not pto.PTOCycle Is Nothing, - GetRelativePath(pto.PTOCycle.Source, basePath), "")) - End If - - Dim angledriveOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object) From { - {"Type", angledrive.Type.ToString()}, - {"Ratio", angledrive.Ratio}, - {"LossMap", - If _ - (angledrive.Type = AngledriveType.SeparateAngledrive AndAlso Not angledrive.LossMap Is Nothing, - GetRelativePath(angledrive.LossMap.Source, basePath), "")}} - - Dim torqueLimits As Dictionary(Of String, String) = New Dictionary(Of String, String) - For Each entry As ITorqueLimitInputData In vehicle.TorqueLimits - torqueLimits.Add(entry.Gear().ToString(), entry.MaxTorque.Value().ToString()) - Next - - Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) From { - {"SavedInDeclMode", Cfg.DeclMode}, - {"VehCat", vehicle.VehicleCategory.ToString()}, - {"LegislativeClass", vehicle.LegislativeClass.ToString()}, - {"CurbWeight", vehicle.CurbMassChassis.Value()}, - {"CurbWeightExtra", vehicle.CurbMassExtra.Value()}, - {"Loading", vehicle.Loading.Value()}, - {"MassMax", vehicle.GrossVehicleMassRating.ConvertToTon().Value}, - {"rdyn", vehicle.DynamicTyreRadius.ConvertToMilliMeter().Value}, - {"CdCorrMode", airdrag.CrossWindCorrectionMode.GetName()}, - {"CdCorrFile", - If((airdrag.CrossWindCorrectionMode = CrossWindCorrectionMode.SpeedDependentCorrectionFactor OrElse - airdrag.CrossWindCorrectionMode = CrossWindCorrectionMode.VAirBetaLookupTable) AndAlso - Not airdrag.CrosswindCorrectionMap Is Nothing, GetRelativePath(airdrag.CrosswindCorrectionMap.Source, basePath), - "") - }, - {"Retarder", retarderOut}, - {"Angledrive", angledriveOut}, - {"PTO", ptoOut}, - {"TorqueLimits", torqueLimits}, - {"IdlingSpeed", vehicle.EngineIdleSpeed.AsRPM}, - {"AxleConfig", New Dictionary(Of String, Object) From { - {"Type", vehicle.AxleConfiguration.GetName()}, - {"Axles", From axle In vehicle.Components.AxleWheels.AxlesEngineering Select New Dictionary(Of String, Object) From { - {"Inertia", axle.Tyre.Inertia.Value()}, - {"Wheels", axle.Tyre.Dimension}, - {"AxleWeightShare", axle.AxleWeightShare}, - {"TwinTyres", axle.TwinTyres}, - {"RRCISO", axle.Tyre.RollResistanceCoefficient}, - {"FzISO", axle.Tyre.TyreTestLoad.Value()}, - {"Type", axle.AxleType.ToString()} - }}}}} - If (vehicle.TankSystem.HasValue) Then - body("TankSystem") = vehicle.TankSystem.Value.ToString() - End If - - body("EngineStopStart") = vehicle.ADAS.EngineStopStart - body("EcoRoll") = vehicle.ADAS.EcoRoll.ToString() - body("PredictiveCruiseControl") = vehicle.ADAS.PredictiveCruiseControl.ToString() - - If (Not IsNothing(airdrag.AirDragArea)) Then - body("CdA") = airdrag.AirDragArea.Value() - End If - If (Not IsNothing(vehicle.Height)) Then - body("VehicleHeight") = vehicle.Height.Value() - End If - WriteFile(header, body, filename) - End Sub - - Public Sub SaveJob(input As IEngineeringInputDataProvider, filename As String) _ - Implements IOutputFileWriter.SaveJob - Dim basePath As String = Path.GetDirectoryName(filename) - 'Header - Dim header As Dictionary(Of String, Object) = GetHeader(VectoJobFormatVersion) - - 'Body - Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - - 'SavedInDeclMode = Cfg.DeclMode - - Dim job As IEngineeringJobInputData = input.JobInputData() - - body.Add("SavedInDeclMode", job.SavedInDeclarationMode) - body.Add("EngineOnlyMode", job.EngineOnlyMode) - - If job.EngineOnlyMode Then - body.Add("EngineFile", GetRelativePath(job.EngineOnly.DataSource.SourceFile, basePath)) - body.Add("Cycles", - job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))).ToArray()) - WriteFile(header, body, filename) - Return - End If - - 'Main Files - body.Add("VehicleFile", GetRelativePath(job.Vehicle.DataSource.SourceFile, basePath)) - body.Add("EngineFile", GetRelativePath(input.JobInputData.Vehicle.Components.EngineInputData.DataSource.SourceFile, basePath)) - body.Add("GearboxFile", GetRelativePath(input.JobInputData.Vehicle.Components.GearboxInputData.DataSource.SourceFile, basePath)) - - - Dim aux As IAuxiliariesEngineeringInputData = job.Vehicle.Components.AuxiliaryInputData - 'AA-TB - 'ADVANCED AUXILIARIES - body.Add("AuxiliaryAssembly", aux.AuxiliaryAssembly.GetName()) - body.Add("AuxiliaryVersion", aux.AuxiliaryVersion) - body.Add("AdvancedAuxiliaryFilePath", GetRelativePath(aux.AdvancedAuxiliaryFilePath, basePath)) - - Dim pAdd As Double = 0.0 - Dim auxList As List(Of Object) = New List(Of Object) - For Each auxEntry As IAuxiliaryEngineeringInputData In aux.Auxiliaries - If auxEntry.AuxiliaryType = AuxiliaryDemandType.Constant Then - pAdd += auxEntry.ConstantPowerDemand.Value() - Continue For - End If - Dim auxOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - Dim engineeringAuxEntry As IAuxiliaryDeclarationInputData = TryCast(auxEntry, IAuxiliaryDeclarationInputData) - If Not job.SavedInDeclarationMode Then - auxOut.Add("ID", auxEntry.ID) - auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()) - auxOut.Add("Path", GetRelativePath(auxEntry.DemandMap.Source, basePath)) - auxOut.Add("Technology", New String() {}) - Else - auxOut.Add("ID", auxEntry.ID) - auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()) - auxOut.Add("Technology", engineeringAuxEntry.Technology) - End If - auxList.Add(auxOut) - Next - - body.Add("Aux", auxList) - If Not job.SavedInDeclarationMode Then - body.Add("Padd", pAdd) - End If - - Dim driver As IDriverEngineeringInputData = input.DriverInputData - - If Not job.SavedInDeclarationMode Then - body.Add("VACC", GetRelativePath(driver.AccelerationCurve.AccelerationCurve.Source, basePath)) - body.Add("EngineStopStartAtVehicleStopThreshold", driver.EngineStopStartData.ActivationDelay.Value()) - body.Add("EngineStopStartMaxOffTimespan", driver.EngineStopStartData.MaxEngineOffTimespan.Value()) - body.Add("EngineStopStartUtilityFactor", driver.EngineStopStartData.UtilityFactor) - - body.Add("EcoRollMinSpeed", driver.EcoRollData.MinSpeed) - body.Add("EcoRollActivationDelay", driver.EcoRollData.ActivationDelay) - body.Add("EcoRollUnderspeedThreshold", driver.EcoRollData.UnderspeedThreshold) - - End If - 'body.Add("StartStop", New Dictionary(Of String, Object) From { - ' {"Enabled", driver.StartStop.Enabled}, - ' {"MaxSpeed", driver.StartStop.MaxSpeed.AsKmph}, - ' {"MinTime", driver.StartStop.MinTime.Value()}, - ' {"Delay", driver.StartStop.Delay.Value()}}) - If Not job.SavedInDeclarationMode Then - Dim dfTargetSpeed As String = If( - Not driver.Lookahead.CoastingDecisionFactorTargetSpeedLookup Is Nothing AndAlso - File.Exists(driver.Lookahead.CoastingDecisionFactorTargetSpeedLookup.Source), - GetRelativePath(driver.Lookahead.CoastingDecisionFactorTargetSpeedLookup.Source, basePath), "") - Dim dfVelocityDrop As String = If( - Not driver.Lookahead.CoastingDecisionFactorVelocityDropLookup Is Nothing AndAlso - File.Exists(driver.Lookahead.CoastingDecisionFactorVelocityDropLookup.Source), - GetRelativePath(driver.Lookahead.CoastingDecisionFactorVelocityDropLookup.Source, basePath), "") - body.Add("LAC", New Dictionary(Of String, Object) From { - {"Enabled", driver.Lookahead.Enabled}, - {"PreviewDistanceFactor", driver.Lookahead.LookaheadDistanceFactor}, - {"DF_offset", driver.Lookahead.CoastingDecisionFactorOffset}, - {"DF_scaling", driver.Lookahead.CoastingDecisionFactorScaling}, - {"DF_targetSpeedLookup", dfTargetSpeed}, - {"Df_velocityDropLookup", dfVelocityDrop}, - {"MinSpeed", driver.Lookahead.MinSpeed.AsKmph}}) - End If - - 'Overspeed / EcoRoll - Dim overspeedDic As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - - overspeedDic.Add("Mode", If(driver.OverSpeedData.Enabled, "Overspeed" ,"Off")) - - overspeedDic.Add("MinSpeed", driver.OverSpeedData.MinSpeed.AsKmph) - overspeedDic.Add("OverSpeed", driver.OverSpeedData.OverSpeed.AsKmph) - body.Add("OverSpeedEcoRoll", overspeedDic) - - 'Cycles - If Not job.SavedInDeclarationMode Then - body.Add("Cycles", - job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))).ToArray()) - End If - - WriteFile(header, body, filename) - End Sub - - Public Sub SaveJob(input As IVTPDeclarationInputDataProvider, filename As String) Implements IOutputFileWriter.SaveJob - Dim header As Dictionary(Of String, Object) = GetHeader(VectoJobFormatVersion) - Dim body As Dictionary(Of string, Object) = SaveVTPJob(input.JobInputData, filename, true) - WriteFile(header, body, filename) - end Sub - Public Sub SaveJob(input As IVTPEngineeringInputDataProvider, filename As String) Implements IOutputFileWriter.SaveJob - Dim header As Dictionary(Of String, Object) = GetHeader(VectoJobFormatVersion) - Dim body As Dictionary(Of string, Object) = SaveVTPJob(input.JobInputData, filename, False) - WriteFile(header, body, filename) - End Sub - - Private Function SaveVTPJob(job As IVTPDeclarationJobInputData, filename As String, declarationmode As Boolean) As Dictionary(Of String,Object) - - 'Body - Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) - body.Add("SavedInDeclMode", declarationmode) - body.Add("DeclarationVehicle", GetRelativePath(job.Vehicle.DataSource.SourceFile, Path.GetDirectoryName(filename))) - if declarationmode Then - body.add("ManufacturerRecord", GetRelativePath(job.ManufacturerReportInputData.Source, Path.GetDirectoryName(filename))) - body.Add("Mileage", job.Mileage.ConvertToKiloMeter().Value) - End If - body.Add("FanPowerCoefficients", job.FanPowerCoefficents) - body.Add("FanDiameter", job.FanDiameter.Value()) - body.Add("Cycles", - job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))).ToArray()) - return body - End Function - - Public Sub ExportJob(input As IEngineeringInputDataProvider, filename As String, separateFiles As Boolean) _ - Implements IOutputFileWriter.ExportJob - Throw New NotImplementedException - End Sub - - ''' <summary> - ''' Writes the Content variable into a JSON file. - ''' </summary> - ''' <param name="path"></param> - ''' <remarks></remarks> - Public Shared Sub WriteFile(content As JToken, path As String) - Dim file As StreamWriter - Dim str As String - - If content.Count = 0 Then - Return - End If - - Try - str = JsonConvert.SerializeObject(content, Formatting.Indented) - file = My.Computer.FileSystem.OpenTextFileWriter(path, False) - Catch ex As Exception - Throw - End Try - - file.Write(str) - file.Close() - End Sub - - Public Shared Sub WriteFile(content As Dictionary(Of String, Object), path As String) - WriteFile(JToken.FromObject(content), path) - End Sub - - Protected Shared Sub WriteFile(header As Dictionary(Of String, Object), body As Dictionary(Of String, Object), - path As String) - WriteFile(JToken.FromObject(New Dictionary(Of String, Object) From {{"Header", header}, {"Body", body}}), path) - End Sub + WriteFile(header, body, filename) + End Sub + + Protected Function GetHeader(fileVersion As Integer) As Dictionary(Of String, Object) + Dim header As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + + header.Add("CreatedBy", "") + header.Add("Date", Now.ToUniversalTime().ToString("o")) + header.Add("AppVersion", VECTOvers) + header.Add("FileVersion", fileVersion) + Return header + End Function + + Public Sub SaveGearbox(gbx As IGearboxEngineeringInputData, axl As IAxleGearInputData, + torqueConverter As ITorqueConverterEngineeringInputData, + gshift As IGearshiftEngineeringInputData, filename As String) _ + Implements IOutputFileWriter.SaveGearbox + + 'Header + Dim header As Dictionary(Of String, Object) = GetHeader(GearboxFormatVersion) + + + 'Body + Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + + body.Add(JsonKeys.SavedInDeclMode, Cfg.DeclMode) + body.Add(JsonKeys.Gearbox_ModelName, gbx.Model) + body.Add(JsonKeys.Gearbox_Inertia, gbx.Inertia.Value()) + body.Add(JsonKeys.Gearbox_TractionInterruption, gbx.TractionInterruption.Value()) + + Dim ls As New List(Of Dictionary(Of String, Object)) + Dim axlgDict As New Dictionary(Of String, Object) + axlgDict.Add(JsonKeys.Gearbox_Gear_Ratio, axl.Ratio) + If axl.LossMap Is Nothing Then + axlgDict.Add(JsonKeys.Gearbox_Gear_Efficiency, axl.Efficiency) + Else + axlgDict.Add(JsonKeys.Gearbox_Gear_LossMapFile, + GetRelativePath(axl.LossMap.Source, Path.GetDirectoryName(filename))) + End If + ls.Add(axlgDict) + + For Each gear As ITransmissionInputData In gbx.Gears + Dim gearDict As New Dictionary(Of String, Object) + gearDict.Add(JsonKeys.Gearbox_Gear_Ratio, gear.Ratio) + If gear.LossMap Is Nothing Then + gearDict.Add(JsonKeys.Gearbox_Gear_Efficiency, gear.Efficiency) + Else + gearDict.Add(JsonKeys.Gearbox_Gear_LossMapFile, + GetRelativePath(gear.LossMap.Source, Path.GetDirectoryName(filename))) + End If + gearDict.Add(JsonKeys.Gearbox_Gear_ShiftPolygonFile, If _ + (Not gbx.SavedInDeclarationMode AndAlso Not gear.ShiftPolygon Is Nothing, + GetRelativePath(gear.ShiftPolygon.Source, Path.GetDirectoryName(filename)), "")) + gearDict.Add("MaxTorque", If(gear.MaxTorque Is Nothing, "", gear.MaxTorque.Value().ToString())) + gearDict.Add("MaxSpeed", If(gear.MaxInputSpeed Is Nothing, "", gear.MaxInputSpeed.AsRPM.ToString())) + + ls.Add(gearDict) + Next + body.Add(JsonKeys.Gearbox_Gears, ls) + body.Add(JsonKeys.Gearbox_TorqueReserve, gshift.TorqueReserve*100) + body.Add(JsonKeys.Gearbox_ShiftTime, gshift.MinTimeBetweenGearshift.Value()) + body.Add(JsonKeys.Gearbox_StartTorqueReserve, gshift.StartTorqueReserve*100) + body.Add(JsonKeys.Gearbox_StartSpeed, gshift.StartSpeed.Value()) + body.Add(JsonKeys.Gearbox_StartAcceleration, gshift.StartAcceleration.Value()) + body.Add(JsonKeys.Gearbox_GearboxType, gbx.Type.ToString()) + + + Dim torqueConverterDict As New Dictionary(Of String, Object) + torqueConverterDict.Add("Enabled", Not torqueConverter Is Nothing AndAlso gbx.Type.AutomaticTransmission()) + If gbx.Type.AutomaticTransmission() AndAlso Not torqueConverter Is Nothing Then + torqueConverterDict.Add("File", + GetRelativePath(torqueConverter.TCData.Source, Path.GetDirectoryName(filename))) + torqueConverterDict.Add(JsonKeys.Gearbox_TorqueConverter_ReferenceRPM, torqueConverter.ReferenceRPM.AsRPM) + torqueConverterDict.Add(JsonKeys.Gearbox_TorqueConverter_Inertia, torqueConverter.Inertia.Value()) + torqueConverterDict.Add("MaxTCSpeed", torqueConverter.MaxInputSpeed.AsRPM) + torqueConverterDict.Add("ShiftPolygon", + If _ + ( + Not gbx.SavedInDeclarationMode AndAlso + Not torqueConverter.ShiftPolygon Is Nothing, + GetRelativePath(torqueConverter.ShiftPolygon.Source, + Path.GetDirectoryName(filename)), "")) + torqueConverterDict.Add("CLUpshiftMinAcceleration", gshift.CLUpshiftMinAcceleration.Value()) + torqueConverterDict.Add("CCUpshiftMinAcceleration", gshift.CCUpshiftMinAcceleration.Value()) + End If + body.Add(JsonKeys.Gearbox_TorqueConverter, torqueConverterDict) + + body.Add("DownshiftAfterUpshiftDelay", gshift.DownshiftAfterUpshiftDelay.Value()) + body.Add("UpshiftAfterDownshiftDelay", gshift.UpshiftAfterDownshiftDelay.Value()) + body.Add("UpshiftMinAcceleration", gshift.UpshiftMinAcceleration.Value()) + + body.Add("PowershiftShiftTime", gbx.PowershiftShiftTime.Value()) + + WriteFile(header, body, filename) + End Sub + + Public Sub SaveVehicle(vehicle As IVehicleEngineeringInputData, airdrag As IAirdragEngineeringInputData, + retarder As IRetarderInputData, + pto As IPTOTransmissionInputData, angledrive As IAngledriveInputData, filename As String) _ + Implements IOutputFileWriter.SaveVehicle + Dim basePath As String = Path.GetDirectoryName(filename) + + 'Header + Dim header As Dictionary(Of String, Object) = GetHeader(VehicleFormatVersion) + + 'Body + Dim retarderOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() + If retarder Is Nothing Then + retarderOut.Add("Type", RetarderType.None.GetName()) + Else + retarderOut.Add("Type", retarder.Type.GetName()) + retarderOut.Add("Ratio", retarder.Ratio) + retarderOut.Add("File", + If _ + (retarder.Type.IsDedicatedComponent AndAlso Not retarder.LossMap Is Nothing, + GetRelativePath(retarder.LossMap.Source, basePath), "")) + End If + + Dim ptoOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + If pto Is Nothing Then + ptoOut.Add("Type", "None") + Else + ptoOut.Add("Type", pto.PTOTransmissionType) + ptoOut.Add("LossMap", + If _ + (pto.PTOTransmissionType <> "None" AndAlso Not pto.PTOLossMap Is Nothing, + GetRelativePath(pto.PTOLossMap.Source, basePath), "")) + ptoOut.Add("Cycle", + If _ + (pto.PTOTransmissionType <> "None" AndAlso Not pto.PTOCycle Is Nothing, + GetRelativePath(pto.PTOCycle.Source, basePath), "")) + End If + + Dim angledriveOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object) From { + {"Type", angledrive.Type.ToString()}, + {"Ratio", angledrive.Ratio}, + {"LossMap", + If _ + (angledrive.Type = AngledriveType.SeparateAngledrive AndAlso Not angledrive.LossMap Is Nothing, + GetRelativePath(angledrive.LossMap.Source, basePath), "")}} + + Dim torqueLimits As Dictionary(Of String, String) = New Dictionary(Of String, String) + For Each entry As ITorqueLimitInputData In vehicle.TorqueLimits + torqueLimits.Add(entry.Gear().ToString(), entry.MaxTorque.Value().ToString()) + Next + + Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) From { + {"SavedInDeclMode", Cfg.DeclMode}, + {"VehCat", vehicle.VehicleCategory.ToString()}, + {"LegislativeClass", vehicle.LegislativeClass.ToString()}, + {"CurbWeight", vehicle.CurbMassChassis.Value()}, + {"CurbWeightExtra", vehicle.CurbMassExtra.Value()}, + {"Loading", vehicle.Loading.Value()}, + {"MassMax", vehicle.GrossVehicleMassRating.ConvertToTon().Value}, + {"rdyn", vehicle.DynamicTyreRadius.ConvertToMilliMeter().Value}, + {"CdCorrMode", airdrag.CrossWindCorrectionMode.GetName()}, + {"CdCorrFile", + If((airdrag.CrossWindCorrectionMode = CrossWindCorrectionMode.SpeedDependentCorrectionFactor OrElse + airdrag.CrossWindCorrectionMode = CrossWindCorrectionMode.VAirBetaLookupTable) AndAlso + Not airdrag.CrosswindCorrectionMap Is Nothing, + GetRelativePath(airdrag.CrosswindCorrectionMap.Source, basePath), + "") + }, + {"Retarder", retarderOut}, + {"Angledrive", angledriveOut}, + {"PTO", ptoOut}, + {"TorqueLimits", torqueLimits}, + {"IdlingSpeed", vehicle.EngineIdleSpeed.AsRPM}, + {"AxleConfig", New Dictionary(Of String, Object) From { + {"Type", vehicle.AxleConfiguration.GetName()}, + {"Axles", + From axle In vehicle.Components.AxleWheels.AxlesEngineering + Select New Dictionary(Of String, Object) From { + {"Inertia", axle.Tyre.Inertia.Value()}, + {"Wheels", axle.Tyre.Dimension}, + {"AxleWeightShare", axle.AxleWeightShare}, + {"TwinTyres", axle.TwinTyres}, + {"RRCISO", axle.Tyre.RollResistanceCoefficient}, + {"FzISO", axle.Tyre.TyreTestLoad.Value()}, + {"Type", axle.AxleType.ToString()} + }}}}} + If (vehicle.TankSystem.HasValue) Then + body("TankSystem") = vehicle.TankSystem.Value.ToString() + End If + + body("EngineStopStart") = vehicle.ADAS.EngineStopStart + body("EcoRoll") = vehicle.ADAS.EcoRoll.ToString() + body("PredictiveCruiseControl") = vehicle.ADAS.PredictiveCruiseControl.ToString() + + If (Not IsNothing(airdrag.AirDragArea)) Then + body("CdA") = airdrag.AirDragArea.Value() + End If + If (Not IsNothing(vehicle.Height)) Then + body("VehicleHeight") = vehicle.Height.Value() + End If + WriteFile(header, body, filename) + End Sub + + Public Sub SaveJob(input As IEngineeringInputDataProvider, filename As String) _ + Implements IOutputFileWriter.SaveJob + Dim basePath As String = Path.GetDirectoryName(filename) + 'Header + Dim header As Dictionary(Of String, Object) = GetHeader(VectoJobFormatVersion) + + 'Body + Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + + 'SavedInDeclMode = Cfg.DeclMode + + Dim job As IEngineeringJobInputData = input.JobInputData() + + body.Add("SavedInDeclMode", job.SavedInDeclarationMode) + body.Add("EngineOnlyMode", job.EngineOnlyMode) + + If job.EngineOnlyMode Then + body.Add("EngineFile", GetRelativePath(job.EngineOnly.DataSource.SourceFile, basePath)) + body.Add("Cycles", + job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))) _ + .ToArray()) + WriteFile(header, body, filename) + Return + End If + + 'Main Files + body.Add("VehicleFile", GetRelativePath(job.Vehicle.DataSource.SourceFile, basePath)) + body.Add("EngineFile", + GetRelativePath(input.JobInputData.Vehicle.Components.EngineInputData.DataSource.SourceFile, basePath)) + body.Add("GearboxFile", + GetRelativePath(input.JobInputData.Vehicle.Components.GearboxInputData.DataSource.SourceFile, basePath)) + + + Dim aux As IAuxiliariesEngineeringInputData = job.Vehicle.Components.AuxiliaryInputData + 'AA-TB + 'ADVANCED AUXILIARIES + body.Add("AuxiliaryAssembly", aux.AuxiliaryAssembly.GetName()) + body.Add("AuxiliaryVersion", aux.AuxiliaryVersion) + body.Add("AdvancedAuxiliaryFilePath", GetRelativePath(aux.AdvancedAuxiliaryFilePath, basePath)) + + Dim pAdd As Double = 0.0 + Dim auxList As List(Of Object) = New List(Of Object) + For Each auxEntry As IAuxiliaryEngineeringInputData In aux.Auxiliaries + If auxEntry.AuxiliaryType = AuxiliaryDemandType.Constant Then + pAdd += auxEntry.ConstantPowerDemand.Value() + Continue For + End If + Dim auxOut As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + Dim engineeringAuxEntry As IAuxiliaryDeclarationInputData = TryCast(auxEntry, IAuxiliaryDeclarationInputData) + If Not job.SavedInDeclarationMode Then + auxOut.Add("ID", auxEntry.ID) + auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()) + auxOut.Add("Path", GetRelativePath(auxEntry.DemandMap.Source, basePath)) + auxOut.Add("Technology", New String() {}) + Else + auxOut.Add("ID", auxEntry.ID) + auxOut.Add("Type", AuxiliaryTypeHelper.ParseKey(auxEntry.ID).Name()) + auxOut.Add("Technology", engineeringAuxEntry.Technology) + End If + auxList.Add(auxOut) + Next + + body.Add("Aux", auxList) + If Not job.SavedInDeclarationMode Then + body.Add("Padd", pAdd) + End If + + Dim driver As IDriverEngineeringInputData = input.DriverInputData + + If Not job.SavedInDeclarationMode Then + body.Add("VACC", GetRelativePath(driver.AccelerationCurve.AccelerationCurve.Source, basePath)) + + if not(driver.EngineStopStartData Is nothing) then + body.Add("EngineStopStartAtVehicleStopThreshold", driver.EngineStopStartData.ActivationDelay.Value()) + body.Add("EngineStopStartMaxOffTimespan", driver.EngineStopStartData.MaxEngineOffTimespan.Value()) + body.Add("EngineStopStartUtilityFactor", driver.EngineStopStartData.UtilityFactor) + End if + + if not(driver.EcoRollData Is Nothing) then + body.Add("EcoRollMinSpeed", driver.EcoRollData.MinSpeed.AsKmph) + body.Add("EcoRollActivationDelay", driver.EcoRollData.ActivationDelay.Value()) + body.Add("EcoRollUnderspeedThreshold", driver.EcoRollData.UnderspeedThreshold.AsKmph) + End If + + if not (driver.PCCData is Nothing) then + body.Add("PCCEnableSpeed", driver.PCCData.PCCEnabledSpeed.AsKmph) + body.add("PCCMinSpeed", driver.PCCData.MinSpeed.AsKmph) + body.add("PCCUnderspeed", driver.PCCData.Underspeed.AsKmph) + body.Add("PCCOverSpeed", driver.PCCData.OverspeedUseCase3.AsKmph) + body.Add("PCCPreviewDistanceUC1", driver.PCCData.PreviewDistanceUseCase1.Value()) + body.add("PCCPreviewDistanceUC2", driver.PCCData.PreviewDistanceUseCase2.Value()) + end if + + End If + 'body.Add("StartStop", New Dictionary(Of String, Object) From { + ' {"Enabled", driver.StartStop.Enabled}, + ' {"MaxSpeed", driver.StartStop.MaxSpeed.AsKmph}, + ' {"MinTime", driver.StartStop.MinTime.Value()}, + ' {"Delay", driver.StartStop.Delay.Value()}}) + If Not job.SavedInDeclarationMode Then + Dim dfTargetSpeed As String = If( + Not driver.Lookahead.CoastingDecisionFactorTargetSpeedLookup Is Nothing AndAlso + File.Exists(driver.Lookahead.CoastingDecisionFactorTargetSpeedLookup.Source), + GetRelativePath(driver.Lookahead.CoastingDecisionFactorTargetSpeedLookup.Source, basePath), "") + Dim dfVelocityDrop As String = If( + Not driver.Lookahead.CoastingDecisionFactorVelocityDropLookup Is Nothing AndAlso + File.Exists(driver.Lookahead.CoastingDecisionFactorVelocityDropLookup.Source), + GetRelativePath(driver.Lookahead.CoastingDecisionFactorVelocityDropLookup.Source, basePath), "") + body.Add("LAC", New Dictionary(Of String, Object) From { + {"Enabled", driver.Lookahead.Enabled}, + {"PreviewDistanceFactor", driver.Lookahead.LookaheadDistanceFactor}, + {"DF_offset", driver.Lookahead.CoastingDecisionFactorOffset}, + {"DF_scaling", driver.Lookahead.CoastingDecisionFactorScaling}, + {"DF_targetSpeedLookup", dfTargetSpeed}, + {"Df_velocityDropLookup", dfVelocityDrop}, + {"MinSpeed", driver.Lookahead.MinSpeed.AsKmph}}) + End If + + 'Overspeed / EcoRoll + Dim overspeedDic As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + + overspeedDic.Add("Mode", If(driver.OverSpeedData.Enabled, "Overspeed", "Off")) + + overspeedDic.Add("MinSpeed", driver.OverSpeedData.MinSpeed.AsKmph) + overspeedDic.Add("OverSpeed", driver.OverSpeedData.OverSpeed.AsKmph) + body.Add("OverSpeedEcoRoll", overspeedDic) + + 'Cycles + If Not job.SavedInDeclarationMode Then + body.Add("Cycles", + job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))) _ + .ToArray()) + End If + + WriteFile(header, body, filename) + End Sub + + Public Sub SaveJob(input As IVTPDeclarationInputDataProvider, filename As String) _ + Implements IOutputFileWriter.SaveJob + Dim header As Dictionary(Of String, Object) = GetHeader(VectoJobFormatVersion) + Dim body As Dictionary(Of string, Object) = SaveVTPJob(input.JobInputData, filename, true) + WriteFile(header, body, filename) + end Sub + + Public Sub SaveJob(input As IVTPEngineeringInputDataProvider, filename As String) _ + Implements IOutputFileWriter.SaveJob + Dim header As Dictionary(Of String, Object) = GetHeader(VectoJobFormatVersion) + Dim body As Dictionary(Of string, Object) = SaveVTPJob(input.JobInputData, filename, False) + WriteFile(header, body, filename) + End Sub + + Private Function SaveVTPJob(job As IVTPDeclarationJobInputData, filename As String, declarationmode As Boolean) _ + As Dictionary(Of String,Object) + + 'Body + Dim body As Dictionary(Of String, Object) = New Dictionary(Of String, Object) + body.Add("SavedInDeclMode", declarationmode) + body.Add("DeclarationVehicle", + GetRelativePath(job.Vehicle.DataSource.SourceFile, Path.GetDirectoryName(filename))) + if declarationmode Then + body.add("ManufacturerRecord", + GetRelativePath(job.ManufacturerReportInputData.Source, Path.GetDirectoryName(filename))) + body.Add("Mileage", job.Mileage.ConvertToKiloMeter().Value) + End If + body.Add("FanPowerCoefficients", job.FanPowerCoefficents) + body.Add("FanDiameter", job.FanDiameter.Value()) + body.Add("Cycles", + job.Cycles.Select(Function(x) GetRelativePath(x.CycleData.Source, Path.GetDirectoryName(filename))). + ToArray()) + return body + End Function + + Public Sub ExportJob(input As IEngineeringInputDataProvider, filename As String, separateFiles As Boolean) _ + Implements IOutputFileWriter.ExportJob + Throw New NotImplementedException + End Sub + + ''' <summary> + ''' Writes the Content variable into a JSON file. + ''' </summary> + ''' <param name="path"></param> + ''' <remarks></remarks> + Public Shared Sub WriteFile(content As JToken, path As String) + Dim file As StreamWriter + Dim str As String + + If content.Count = 0 Then + Return + End If + + Try + str = JsonConvert.SerializeObject(content, Formatting.Indented) + file = My.Computer.FileSystem.OpenTextFileWriter(path, False) + Catch ex As Exception + Throw + End Try + + file.Write(str) + file.Close() + End Sub + + Public Shared Sub WriteFile(content As Dictionary(Of String, Object), path As String) + WriteFile(JToken.FromObject(content), path) + End Sub + + Protected Shared Sub WriteFile(header As Dictionary(Of String, Object), body As Dictionary(Of String, Object), + path As String) + WriteFile(JToken.FromObject(New Dictionary(Of String, Object) From {{"Header", header}, {"Body", body}}), path) + End Sub End Class diff --git a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs index d2717e38c8b08a94f6ed3d4b1852bec5631e410a..0b39e1745b09388ba39bf84238eaa91ed2afc517 100644 --- a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs +++ b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs @@ -371,8 +371,6 @@ namespace TUGraz.VectoCommon.InputData MeterPerSecond MinSpeed { get; } - MeterPerSecond MaxSpeed { get; } - Meter PreviewDistanceUseCase1 { get; } Meter PreviewDistanceUseCase2 { get; } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 1d8190289861404e970327c277281071fc98c878..dcfa07b86f67c326f890c024b2f56d2d26e1b14d 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -67,7 +67,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON protected JSONFile(JObject data, string filename, bool tolerateMissing = false) { var header = (JObject)data.GetEx(JsonKeys.JsonHeader); - Version = header[JsonKeys.JsonHeader_FileVersion] != null ? header.GetEx<string>(JsonKeys.JsonHeader_FileVersion) : string.Empty; + Version = header[JsonKeys.JsonHeader_FileVersion] != null + ? header.GetEx<string>(JsonKeys.JsonHeader_FileVersion) + : string.Empty; Body = (JObject)data.GetEx(JsonKeys.JsonBody); _sourceFile = Path.GetFullPath(filename); TolerateMissing = tolerateMissing; @@ -77,7 +79,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public DataSource DataSource { - get { return new DataSource { SourceType = DataSourceType.JSONFile, SourceFile = _sourceFile, SourceVersion = Version }; } + get { + return new DataSource { SourceType = DataSourceType.JSONFile, SourceFile = _sourceFile, SourceVersion = Version }; + } } public string Source @@ -171,7 +175,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return null; } } - public IPCCEngineeringInputData PCCData { get; } + public virtual IPCCEngineeringInputData PCCData + { + get { return null; } + } public IAxleGearInputData AxleGear { get; internal set; } @@ -518,7 +525,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON } } - #endregion #region IAuxiliariesEngineeringInputData @@ -697,8 +703,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON { VectoJobHash = VectoHash.Load( Path.Combine(Path.GetFullPath(BasePath), Body["DeclarationVehicle"].Value<string>())); - VectoManufacturerReportHash = Body["ManufacturerRecord"] != null ? VectoHash.Load( - Path.Combine(Path.GetFullPath(BasePath), Body["ManufacturerRecord"].Value<string>())) : null; + VectoManufacturerReportHash = Body["ManufacturerRecord"] != null + ? VectoHash.Load( + Path.Combine(Path.GetFullPath(BasePath), Body["ManufacturerRecord"].Value<string>())) + : null; var kernel = new StandardKernel(new VectoNinjectModule()); _inputReader = kernel.Get<IXMLInputDataReader>(); @@ -731,7 +739,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Body.GetEx<double>("Mileage").SI(Unit.SI.Kilo.Meter).Cast<Meter>(); } } - string IManufacturerReport.Source { get { return Body["ManufacturerRecord"].Value<string>(); } } + string IManufacturerReport.Source + { + get { return Body["ManufacturerRecord"].Value<string>(); } + } public IList<ICycleData> Cycles { @@ -827,7 +838,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON try { _jobDigest = new DigestData(xmlDoc.SelectSingleNode("//*[local-name()='InputDataSignature']")); } catch (Exception) { - _jobDigest = new DigestData("", new string[] {},"","" ); + _jobDigest = new DigestData("", new string[] { }, "", ""); } } } @@ -835,14 +846,19 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON public class JSONInputDataV5 : JSONInputDataV4 { - public JSONInputDataV5(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { } + protected IEngineStopStartEngineeringInputData engineStopStartData; + protected IEcoRollEngineeringInputData ecoRollData; + protected IPCCEngineeringInputData pccData; + + public JSONInputDataV5(JObject data, string filename, bool tolerateMissing = false) : base( + data, filename, tolerateMissing) { } #region Overrides of JSONInputDataV2 public override IEngineStopStartEngineeringInputData EngineStopStartData { get { - return new EngineStopStartInputData { + return engineStopStartData ?? (engineStopStartData = new EngineStopStartInputData { MaxEngineOffTimespan = Body["EngineStopStartMaxOffTimespan"] == null ? null : Body.GetEx<double>("EngineStopStartMaxOffTimespan").SI<Second>(), @@ -852,31 +868,45 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ActivationDelay = Body["EngineStopStartAtVehicleStopThreshold"] == null ? null : Body.GetEx<double>("EngineStopStartAtVehicleStopThreshold").SI<Second>() - }; + }); } } - + public override IEcoRollEngineeringInputData EcoRollData { - get { return new EcoRollInputData { - UnderspeedThreshold = Body["EcoRollUnderspeedThreshold"] == null - ? null - : Body.GetEx<double>("EcoRollUnderspeedThreshold").KMPHtoMeterPerSecond(), - MinSpeed = Body["EcoRollMinSpeed"] == null - ? null - : Body.GetEx<double>("EcoRollMinSpeed").KMPHtoMeterPerSecond(), - ActivationDelay = Body["EcoRollActivationDelay"] == null - ? null - : Body.GetEx<double>("EcoRollActivationDelay").SI<Second>() - }; } + get { + return ecoRollData ?? (ecoRollData = new EcoRollInputData { + UnderspeedThreshold = Body["EcoRollUnderspeedThreshold"] == null + ? null + : Body.GetEx<double>("EcoRollUnderspeedThreshold").KMPHtoMeterPerSecond(), + MinSpeed = Body["EcoRollMinSpeed"] == null + ? null + : Body.GetEx<double>("EcoRollMinSpeed").KMPHtoMeterPerSecond(), + ActivationDelay = Body["EcoRollActivationDelay"] == null + ? null + : Body.GetEx<double>("EcoRollActivationDelay").SI<Second>() + }); + } + } + + public override IPCCEngineeringInputData PCCData + { + get { return pccData ?? (pccData = new PCCInputData() { + PCCEnabledSpeed = Body["PCCEnableSpeed"] == null ? null : Body.GetEx<double>("PCCEnableSpeed").KMPHtoMeterPerSecond(), + MinSpeed = Body["PCCMinSpeed"] == null ? null : Body.GetEx<double>("PCCMinSpeed").KMPHtoMeterPerSecond(), + Underspeed = Body["PCCUnderspeed"] == null ? null : Body.GetEx<double>("PCCUnderspeed").KMPHtoMeterPerSecond(), + OverspeedUseCase3 = Body["PCCOverspeed"] == null ? null : Body.GetEx<double>("PCCOverspeed").KMPHtoMeterPerSecond(), + PreviewDistanceUseCase1 = Body["PCCPreviewDistanceUC1"] == null ? null : Body.GetEx<double>("PCCPreviewDistanceUC1").SI<Meter>(), + PreviewDistanceUseCase2 = Body["PCCPreviewDistanceUC2"] == null ? null : Body.GetEx<double>("PCCPreviewDistanceUC2").SI<Meter>() + }); } } #endregion - } - public class EcoRollInputData : IEcoRollEngineeringInputData { + public class EcoRollInputData : IEcoRollEngineeringInputData + { #region Implementation of IEcoRollEngineeringInputData public MeterPerSecond MinSpeed { get; set; } @@ -886,7 +916,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion } - public class EngineStopStartInputData : IEngineStopStartEngineeringInputData { + public class EngineStopStartInputData : IEngineStopStartEngineeringInputData + { #region Implementation of IEngineStopStartEngineeringInputData public Second ActivationDelay { get; set; } @@ -897,4 +928,18 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion } + + public class PCCInputData : IPCCEngineeringInputData + { + #region Implementation of IPCCEngineeringInputData + + public MeterPerSecond PCCEnabledSpeed { get; set; } + public MeterPerSecond MinSpeed { get; set; } + public Meter PreviewDistanceUseCase1 { get; set; } + public Meter PreviewDistanceUseCase2 { get; set; } + public MeterPerSecond Underspeed { get; set; } + public MeterPerSecond OverspeedUseCase3 { get; set; } + + #endregion + } } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 69b7a4db5eb5aaca342502b4ed0a5ca7fc7ead5d..77ef483d51bd6189f9e7b031a9b7c23a66c9bf33 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -87,7 +87,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter PCC = new DriverData.PCCData() { PCCEnableSpeed = DeclarationData.Driver.PCC.PCCEnableSpeed, MinSpeed = DeclarationData.Driver.PCC.MinSpeed, - MaxSpeed = DeclarationData.Driver.PCC.MaxSpeed, PreviewDistanceUseCase1 = DeclarationData.Driver.PCC.PreviewDistanceUseCase1, PreviewDistanceUseCase2 = DeclarationData.Driver.PCC.PreviewDistanceUseCase2, UnderSpeed = DeclarationData.Driver.PCC.Underspeed, diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index afb02dacac36a79567aa85d0f334530254ef1586..701456f22dae7993f07549296eb0c3986d220913 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -89,9 +89,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter PredictiveCruiseControl = PredictiveCruiseControlType.None }: new VehicleData.ADASData { - EngineStopStart = adas.EngineStopStart, - EcoRoll = adas.EcoRoll, - PredictiveCruiseControl = adas.PredictiveCruiseControl + EngineStopStart = adas.EngineStopStart, + EcoRoll = adas.EcoRoll, + PredictiveCruiseControl = adas.PredictiveCruiseControl }; } @@ -473,7 +473,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter PCC = new DriverData.PCCData() { PCCEnableSpeed = driver.PCCData?.PCCEnabledSpeed ?? DeclarationData.Driver.PCC.PCCEnableSpeed, MinSpeed = driver.PCCData?.MinSpeed ?? DeclarationData.Driver.PCC.MinSpeed, - MaxSpeed = driver.PCCData?.MaxSpeed ?? DeclarationData.Driver.PCC.MaxSpeed, PreviewDistanceUseCase1 = driver.PCCData?.PreviewDistanceUseCase1 ?? DeclarationData.Driver.PCC.PreviewDistanceUseCase1, PreviewDistanceUseCase2 = driver.PCCData?.PreviewDistanceUseCase2 ?? DeclarationData.Driver.PCC.PreviewDistanceUseCase2, UnderSpeed = driver.PCCData?.Underspeed ?? DeclarationData.Driver.PCC.Underspeed, diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index 827a7ec57092ad6bb011c25c8aa47dcf217eb533..5d341f9ea999ee134fba1bf29c7e3722494c3726 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -155,7 +155,6 @@ namespace TUGraz.VectoCore.Models.Declaration { public static readonly MeterPerSecond PCCEnableSpeed = 80.KMPHtoMeterPerSecond(); public static readonly MeterPerSecond MinSpeed = 50.KMPHtoMeterPerSecond(); - public static readonly MeterPerSecond MaxSpeed = 100.KMPHtoMeterPerSecond(); public static readonly Meter PreviewDistanceUseCase1 = 1500.SI<Meter>(); public static readonly Meter PreviewDistanceUseCase2 = 1000.SI<Meter>(); public static readonly MeterPerSecond Underspeed = 8.KMPHtoMeterPerSecond(); diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs index 535ae786475f5570a08034f4f78f575209d879ab..ea14021eaed5e3a7110c83937dfe7d34e965c6bf 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PCCSegmentPreprocessor.cs @@ -27,7 +27,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl { { var slopes = new Dictionary<MeterPerSecond, Radian>(); new PCCEcoRollEngineStopPreprocessor( - Container, slopes, PCCDriverData.MinSpeed, PCCDriverData.MaxSpeed).RunPreprocessing(); + Container, slopes, PCCDriverData.MinSpeed, + VectoMath.Min(Container.MaxVehicleSpeed, Container.RunData.Cycle.Entries.Max(x => x.VehicleTargetSpeed))) + .RunPreprocessing(); var runData = Container.RunData; var engineDrag = runData.EngineData.FullLoadCurves[0].FullLoadEntries diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs index 65d9701944e5be14805caa1b528d2dc4d4497930..50b87c46e0d3d4d3873961451b3fc56e9ede051f 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/DriverData.cs @@ -122,8 +122,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { public MeterPerSecond MinSpeed; - public MeterPerSecond MaxSpeed; - public Meter PreviewDistanceUseCase1; public Meter PreviewDistanceUseCase2; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 9cda67acd9707af82f12e22632e1b04d8797c24f..bce65bd6bb0758f67a798b05844fff40dc33c9f1 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -106,7 +106,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl PCCSegments = new PCCSegments(); - if (data?.VehicleData.ADAS.PredictiveCruiseControl != PredictiveCruiseControlType.None) { + if (data?.VehicleData?.ADAS?.PredictiveCruiseControl != PredictiveCruiseControlType.None) { // create a dummy powertrain for pre-processing and estimatins var modData = new ModalDataContainer(data, null, new[] { FuelData.Diesel }, null, false); var builder = new PowertrainBuilder(modData);