diff --git a/VECTO/GUI/VectoJobForm.vb b/VECTO/GUI/VectoJobForm.vb index 8f69165843d93d5e7241dc8ee3ce5e58ee1c0581..deec436512221bf79ece82640708f5d25f7fe6a7 100644 --- a/VECTO/GUI/VectoJobForm.vb +++ b/VECTO/GUI/VectoJobForm.vb @@ -119,10 +119,10 @@ Public Class VectoJobForm tbLacDfTargetSpeedFile.Text = "" tbLacDfVelocityDropFile.Text = "" - TbOverspeed.Text = DeclarationData.Driver.OverSpeedEcoRoll.OverSpeed.AsKmph.ToGUIFormat() 'cDeclaration.Overspeed - TbUnderSpeed.Text = DeclarationData.Driver.OverSpeedEcoRoll.UnderSpeed.AsKmph.ToGUIFormat() _ + TbOverspeed.Text = DeclarationData.Driver.OverSpeed.AllowedOverSpeed.AsKmph.ToGUIFormat() 'cDeclaration.Overspeed + TbUnderSpeed.Text = DeclarationData.Driver.OverSpeed.UnderSpeed.AsKmph.ToGUIFormat() _ ' cDeclaration.Underspeed - TbVmin.Text = DeclarationData.Driver.OverSpeedEcoRoll.MinSpeed.AsKmph.ToGUIFormat() 'cDeclaration.ECvmin + TbVmin.Text = DeclarationData.Driver.OverSpeed.MinSpeed.AsKmph.ToGUIFormat() 'cDeclaration.ECvmin TbAuxPAdd.Text = "" If _ LvAux.Items.Count <> 5 OrElse @@ -540,7 +540,7 @@ Public Class VectoJobForm End If tbEngineStopStartThreshold.Text = driver.EngineStopStartData.ActivationDelay.ToGUIFormat() - tbEngineOffThreshold.Text = If(driver.EngineStopStartData.MaxEngineOffTimespan?.ToGUIFormat(), DeclarationData.Driver.MaxEngineOffTimespan.ToGUIFormat()) + tbEngineOffThreshold.Text = If(driver.EngineStopStartData.MaxEngineOffTimespan?.ToGUIFormat(), DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan.ToGUIFormat()) tbEssUtility.Text = driver.EngineStopStartData.UtilityFactor.ToGUIFormat() '------------------------------------------------------------- @@ -705,9 +705,9 @@ Public Class VectoJobForm RdOverspeed.Checked = True CbLookAhead.Checked = True 'TbAlookahead.Text = "-0.5" - TbOverspeed.Text = DeclarationData.Driver.OverSpeedEcoRoll.OverSpeed.AsKmph.ToGUIFormat() - TbUnderSpeed.Text = DeclarationData.Driver.OverSpeedEcoRoll.UnderSpeed.AsKmph.ToGUIFormat() - TbVmin.Text = DeclarationData.Driver.OverSpeedEcoRoll.MinSpeed.AsKmph.ToGUIFormat() + TbOverspeed.Text = DeclarationData.Driver.OverSpeed.AllowedOverSpeed.AsKmph.ToGUIFormat() + TbUnderSpeed.Text = DeclarationData.Driver.OverSpeed.UnderSpeed.AsKmph.ToGUIFormat() + TbVmin.Text = DeclarationData.Driver.OverSpeed.MinSpeed.AsKmph.ToGUIFormat() 'TbVminLA.Text = "50" tbLacMinSpeed.Text = DeclarationData.Driver.LookAhead.MinimumSpeed.AsKmph.ToGUIFormat() diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index ee40ad4bc2e707d939be907e1d29edea47064fc0..4224708ebfa7d134a0b634c26fb236c0f116c0bc 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -847,7 +847,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ? null : Body.GetEx<double>("EngineStopStartMaxOffTimespan").SI<Second>(), UtilityFactor = Body["EngineStopStartUtilityFactor"] == null - ? DeclarationData.Driver.EngineStopStartUtilityFactor + ? DeclarationData.Driver.EngineStopStart.UtilityFactor : Body.GetEx<double>("EngineStopStartUtilityFactor"), ActivationDelay = Body["EngineStopStartAtVehicleStopThreshold"] == null ? null diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEcoRollDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEcoRollDataProvider.cs index e63df5dd1e03dbc93031e2b63429e0d593508dfc..efbeb8b4d07f3214d791dda9d9f5568df8634519 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEcoRollDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEcoRollDataProvider.cs @@ -20,17 +20,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider { public MeterPerSecond MinSpeed { - get { return GetDouble("MinSpeed", DeclarationData.Driver.EcoRollMinSpeed.AsKmph).KMPHtoMeterPerSecond(); } + get { return GetDouble("MinSpeed", DeclarationData.Driver.EcoRoll.MinSpeed.AsKmph).KMPHtoMeterPerSecond(); } } public Second ActivationDelay { - get { return GetDouble("ActivationDelay", DeclarationData.Driver.EcoRollActivationDelay.Value()).SI<Second>(); } + get { return GetDouble("ActivationDelay", DeclarationData.Driver.EcoRoll.ActivationDelay.Value()).SI<Second>(); } } public MeterPerSecond UnderspeedThreshold { - get { return GetDouble("UnderspeedThreshold", DeclarationData.Driver.EcoRollUnderspeedThreshold.AsKmph).KMPHtoMeterPerSecond(); } + get { return GetDouble("UnderspeedThreshold", DeclarationData.Driver.EcoRoll.UnderspeedThreshold.AsKmph).KMPHtoMeterPerSecond(); } } #endregion diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineStopStartDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineStopStartDataProvider.cs index b7100f499b92dd601b0391be99ad1e319049e145..b4e8f1f19396c5d5d253e0f1a88ccc860377cb22 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineStopStartDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineStopStartDataProvider.cs @@ -18,18 +18,18 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider { public virtual Second ActivationDelay { - get { return GetDouble("ActivationDelay", DeclarationData.Driver.EngineStopStartActivationDelay.Value()).SI<Second>(); } + get { return GetDouble("ActivationDelay", DeclarationData.Driver.EngineStopStart.ActivationDelay.Value()).SI<Second>(); } } public virtual Second MaxEngineOffTimespan { - get { return GetDouble("MaxEngineStopStartTimespan", DeclarationData.Driver.MaxEngineOffTimespan.Value()).SI<Second>(); } + get { return GetDouble("MaxEngineStopStartTimespan", DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan.Value()).SI<Second>(); } } public virtual double UtilityFactor { get { - return GetDouble("UtilityFactor", DeclarationData.Driver.EngineStopStartUtilityFactor); + return GetDouble("UtilityFactor", DeclarationData.Driver.EngineStopStart.UtilityFactor); } } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 28a9b6d2adc06abc6b9e7ac5efde4924de8e5ee7..d395a74496ea3333b3f6ea7b14323668ad1ce063 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -65,11 +65,11 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter }; var overspeedData = new DriverData.OverSpeedData { Mode = DriverMode.Overspeed, - MinSpeed = DeclarationData.Driver.OverSpeedEcoRoll.MinSpeed, - OverSpeed = DeclarationData.Driver.OverSpeedEcoRoll.OverSpeed, - UnderSpeed = DeclarationData.Driver.OverSpeedEcoRoll.UnderSpeed + MinSpeed = DeclarationData.Driver.OverSpeed.MinSpeed, + OverSpeed = DeclarationData.Driver.OverSpeed.AllowedOverSpeed, + UnderSpeed = DeclarationData.Driver.OverSpeed.UnderSpeed }; - if (!DeclarationData.Driver.OverSpeedEcoRoll.AllowedModes.Contains(overspeedData.Mode)) { + if (!DeclarationData.Driver.OverSpeed.AllowedModes.Contains(overspeedData.Mode)) { throw new VectoSimulationException( "Specified Overspeed/EcoRoll Mode not allowed in declaration mode! {0}", overspeedData.Mode); @@ -79,9 +79,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter LookAheadCoasting = lookAheadData, OverSpeed = overspeedData, EngineStopStart = new DriverData.EngineStopStartData() { - EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStartActivationDelay, - MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan, - UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor, + EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStart.ActivationDelay, + MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan, + UtilityFactor = DeclarationData.Driver.EngineStopStart.UtilityFactor, }, }; return retVal; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 0c99e47f861959483af9077e8fa83b70f515c499..8a2975ebae0189b04c736c3f0d2246a05b8ee38c 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -374,8 +374,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter OverSpeed = overspeedData, EngineStopStart = new DriverData.EngineStopStartData() { EngineOffStandStillThreshold = - driver.EngineStopStartData.ActivationDelay ?? DeclarationData.Driver.EngineStopStartActivationDelay, - MaxEngineOffTimespan = driver.EngineStopStartData.MaxEngineOffTimespan ?? DeclarationData.Driver.MaxEngineOffTimespan, + driver.EngineStopStartData.ActivationDelay ?? DeclarationData.Driver.EngineStopStart.ActivationDelay, + MaxEngineOffTimespan = driver.EngineStopStartData.MaxEngineOffTimespan ?? DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan, UtilityFactor = driver.EngineStopStartData.UtilityFactor, } }; diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index c1436a2cd72a0d7fb8648986e886b21f93416bea..29f5895aa85bcc6e28c990ac93ab0a985a578c1d 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -117,14 +117,6 @@ namespace TUGraz.VectoCore.Models.Declaration public static class Driver { - public static readonly Second EngineStopStartActivationDelay = 2.SI<Second>(); - public static readonly Second MaxEngineOffTimespan = 120.SI<Second>(); - public const double EngineStopStartUtilityFactor = 0.8; - - public static readonly MeterPerSecond EcoRollMinSpeed = 60.KMPHtoMeterPerSecond(); - public static readonly Second EcoRollActivationDelay = 2.SI<Second>(); - public static readonly MeterPerSecond EcoRollUnderspeedThreshold = 2.5.KMPHtoMeterPerSecond(); - public static class LookAhead { public const bool Enabled = true; @@ -135,7 +127,7 @@ namespace TUGraz.VectoCore.Models.Declaration public static readonly MeterPerSecond MinimumSpeed = 50.KMPHtoMeterPerSecond(); } - public static class OverSpeedEcoRoll + public static class OverSpeed { public static readonly IList<DriverMode> AllowedModes = new List<DriverMode> { DriverMode.EcoRoll, @@ -143,16 +135,24 @@ namespace TUGraz.VectoCore.Models.Declaration }; public static readonly MeterPerSecond MinSpeed = 50.KMPHtoMeterPerSecond(); - public static readonly MeterPerSecond OverSpeed = 2.5.KMPHtoMeterPerSecond(); + public static readonly MeterPerSecond AllowedOverSpeed = 2.5.KMPHtoMeterPerSecond(); public static readonly MeterPerSecond UnderSpeed = 5.KMPHtoMeterPerSecond(); } - //public static class StartStop - //{ - // public static readonly MeterPerSecond MaxSpeed = 5.KMPHtoMeterPerSecond(); - // public static readonly Second Delay = 5.SI<Second>(); - // public static readonly Second MinTime = 5.SI<Second>(); - //} + public static class EngineStopStart + { + public static readonly Second ActivationDelay = 2.SI<Second>(); + public static readonly Second MaxEngineOffTimespan = 120.SI<Second>(); + public const double UtilityFactor = 0.8; + } + + public static class EcoRoll + { + public static readonly MeterPerSecond MinSpeed = 60.KMPHtoMeterPerSecond(); + public static readonly Second ActivationDelay = 2.SI<Second>(); + public static readonly MeterPerSecond UnderspeedThreshold = 2.5.KMPHtoMeterPerSecond(); + } + } public static class Trailer diff --git a/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs b/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs index cdf2a7702d066d4936a10881c09c0a7cfcfb8bf2..d2f3451b6077053fde9142e4cf8b96ccee1ac4f9 100644 --- a/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/SimulationDataReaderTest.cs @@ -92,11 +92,11 @@ namespace TUGraz.VectoCore.Tests.FileIO // runData.DriverData.LookAheadCoasting.Deceleration.Value(), Tolerance); Assert.AreNotEqual(DriverMode.Off, runData.DriverData.OverSpeed.Mode); - Assert.AreEqual(DeclarationData.Driver.OverSpeedEcoRoll.MinSpeed.Value(), + Assert.AreEqual(DeclarationData.Driver.OverSpeed.MinSpeed.Value(), runData.DriverData.OverSpeed.MinSpeed.Value(), Tolerance); - Assert.AreEqual(DeclarationData.Driver.OverSpeedEcoRoll.OverSpeed.Value(), + Assert.AreEqual(DeclarationData.Driver.OverSpeed.AllowedOverSpeed.Value(), runData.DriverData.OverSpeed.OverSpeed.Value(), Tolerance); - Assert.AreEqual(DeclarationData.Driver.OverSpeedEcoRoll.UnderSpeed.Value(), + Assert.AreEqual(DeclarationData.Driver.OverSpeed.UnderSpeed.Value(), runData.DriverData.OverSpeed.UnderSpeed.Value(), Tolerance); Assert.AreEqual(3.7890, runData.EngineData.Inertia.Value(), 1e-6); diff --git a/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs b/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs index 8cc8005bc12199cc9b9e490615a7155750cd510c..2c4947cc453adc1adf4824bc0160c4aac3b3212b 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/MeasuredSpeedModeTest.cs @@ -265,9 +265,9 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation Retarder = new RetarderData(), DriverData = new DriverData() { EngineStopStart = new DriverData.EngineStopStartData() { - UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor, - EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStartActivationDelay, - MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan + UtilityFactor = DeclarationData.Driver.EngineStopStart.UtilityFactor, + EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStart.ActivationDelay, + MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan } } }; @@ -348,9 +348,9 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation Retarder = new RetarderData(), DriverData = new DriverData() { EngineStopStart = new DriverData.EngineStopStartData() { - EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStartActivationDelay, - UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor, - MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan, + EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStart.ActivationDelay, + UtilityFactor = DeclarationData.Driver.EngineStopStart.UtilityFactor, + MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan, } } }; diff --git a/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs b/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs index a2bed0887e7a836aac84f833a4522c189ee55ef8..12e1940ba81b70c5f4650a4afd879788cce54288 100644 --- a/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs +++ b/VectoCore/VectoCoreTest/Models/Simulation/PwheelModeTests.cs @@ -169,9 +169,9 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation Retarder = new RetarderData(), DriverData = new DriverData() { EngineStopStart = new DriverData.EngineStopStartData() { - UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor, - EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStartActivationDelay, - MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan + UtilityFactor = DeclarationData.Driver.EngineStopStart.UtilityFactor, + EngineOffStandStillThreshold = DeclarationData.Driver.EngineStopStart.ActivationDelay, + MaxEngineOffTimespan = DeclarationData.Driver.EngineStopStart.MaxEngineOffTimespan } } };