Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 79ced18e authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

renaming property engine stop/start activation delay, separate reader and class for ESS driver data

parent 3ced47c2
Branches
Tags
No related merge requests found
Showing
with 117 additions and 23 deletions
......@@ -536,7 +536,7 @@ Public Class VectoJobForm
GetRelativePath(driver.Lookahead.CoastingDecisionFactorVelocityDropLookup.Source, _basePath))
End If
tbEngineStopStartThreshold.Text = If(driver.EngineOffStandStillThreshold?.ToGUIFormat(), DeclarationData.Driver.MaxEngineOffTimespan.ToGUIFormat())
tbEngineStopStartThreshold.Text = If(driver.EngineOffStandStillActivationDelay?.ToGUIFormat(), DeclarationData.Driver.MaxEngineOffTimespan.ToGUIFormat())
tbEngineOffThreshold.Text = If(driver.MaxEngineOffTimespan?.ToGUIFormat(), DeclarationData.Driver.MaxEngineOffTimespan.ToGUIFormat())
tbEssUtility.Text = driver.EngineStopStartUtilityFactor.ToGUIFormat()
......
......@@ -279,7 +279,7 @@ Public Class VectoJob
End Get
End Property
Public ReadOnly Property EngineOffStandStillThreshold As Second Implements IDriverEngineeringInputData.EngineOffStandStillThreshold
Public ReadOnly Property EngineOffStandStillActivationDelay As Second Implements IDriverEngineeringInputData.EngineOffStandStillActivationDelay
Get
return EngineStopStartThreshold.SI(Of Second)()
End Get
......
......@@ -341,7 +341,7 @@ Public Class JSONFileWriter
If Not job.SavedInDeclarationMode Then
body.Add("VACC", GetRelativePath(driver.AccelerationCurve.AccelerationCurve.Source, basePath))
body.Add("EngineStopStartAtVehicleStopThreshold", driver.EngineOffStandStillThreshold.Value())
body.Add("EngineStopStartAtVehicleStopThreshold", driver.EngineOffStandStillActivationDelay.Value())
body.Add("EngineStopStartMaxOffTimespan", driver.MaxEngineOffTimespan.Value())
body.Add("EngineStopStartUtilityFactor", driver.EngineStopStartUtilityFactor)
End If
......
......@@ -349,7 +349,7 @@ namespace TUGraz.VectoCommon.InputData
ILookaheadCoastingInputData Lookahead { get; }
IGearshiftEngineeringInputData GearshiftInputData { get; }
Second EngineOffStandStillThreshold { get; }
Second EngineOffStandStillActivationDelay { get; }
Second MaxEngineOffTimespan { get; }
double EngineStopStartUtilityFactor { get; }
}
......
......@@ -735,6 +735,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to EngineStopStartParameters.
/// </summary>
public static string DriverModel_EngineStopStartParameters {
get {
return ResourceManager.GetString("DriverModel_EngineStopStartParameters", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to LookAheadCoasting.
/// </summary>
......
......@@ -1116,4 +1116,7 @@
<data name="Engine_WHRMap" xml:space="preserve">
<value>WHRMap</value>
</data>
<data name="DriverModel_EngineStopStartParameters" xml:space="preserve">
<value>EngineStopStartParameters</value>
</data>
</root>
\ No newline at end of file
......@@ -508,7 +508,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
}
}
public virtual Second EngineOffStandStillThreshold
public virtual Second EngineOffStandStillActivationDelay
{
get { return null; }
}
......@@ -841,7 +841,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
public JSONInputDataV5(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { }
public override Second EngineOffStandStillThreshold
public override Second EngineOffStandStillActivationDelay
{
get {
return Body["EngineStopStartAtVehicleStopThreshold"] == null
......
......@@ -2,6 +2,7 @@ using System.Xml;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.XML.Common;
using TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Interfaces;
using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Utils;
......@@ -26,7 +27,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider
XmlNode driverDataNode, string fsBasePath)
: base(driverDataNode, fsBasePath)
{
SourceType = (inputData as IXMLResource).DataSource.SourceFile == fsBasePath ? DataSourceType.XMLEmbedded : DataSourceType.XMLFile;
SourceType = (inputData as IXMLResource).DataSource.SourceFile == fsBasePath
? DataSourceType.XMLEmbedded
: DataSourceType.XMLFile;
}
public IXMLDriverDataReader Reader { protected get; set; }
......@@ -46,7 +49,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider
get { return _shiftParameters ?? (_shiftParameters = Reader.ShiftParameters); }
}
public virtual Second EngineOffStandStillThreshold
public virtual Second EngineOffStandStillActivationDelay
{
get { return null; }
}
......@@ -68,7 +71,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider
#region Overrides of AbstractXMLResource
protected override XNamespace SchemaNamespace { get { return NAMESPACE_URI; } }
protected override XNamespace SchemaNamespace
{
get { return NAMESPACE_URI; }
}
protected override DataSourceType SourceType { get; }
......@@ -83,25 +89,71 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, XSD_TYPE);
protected IXMLEngineStopStartDriverData _engineStopStart;
public XMLEngineeringDriverDataProviderV10(
IXMLEngineeringInputData inputData, XmlNode driverDataNode, string fsBasePath) : base(
inputData, driverDataNode, fsBasePath) { }
#region Overrides of XMLEngineeringDriverDataProviderV07
protected override XNamespace SchemaNamespace { get { return NAMESPACE_URI; } }
protected override XNamespace SchemaNamespace
{
get { return NAMESPACE_URI; }
}
public override Second EngineOffStandStillThreshold
public override Second EngineOffStandStillActivationDelay
{
get { return GetDouble("EngineStopStartThreshold", DeclarationData.Driver.EngineOffStandStillThreshold.Value()).SI<Second>(); }
get {
return (_engineStopStart ?? (_engineStopStart = Reader.EngineStopStartData))?.EngineOffStandStillActivationDelay;
}
}
public override Second MaxEngineOffTimespan
{
get { return GetDouble("MaxEngineStopStartTimespan", DeclarationData.Driver.EngineOffStandStillThreshold.Value()).SI<Second>(); }
get { return (_engineStopStart ?? (_engineStopStart = Reader.EngineStopStartData))?.MaxEngineOffTimespan; }
}
public override double EngineStopStartUtilityFactor
{
get {
return (_engineStopStart ?? (_engineStopStart = Reader.EngineStopStartData))?.EngineStopStartUtilityFactor ??
DeclarationData.Driver.EngineStopStartUtilityFactor;
}
}
#endregion
}
internal class XMLEngineStopStartDriverDataV10 : AbstractXMLType, IXMLEngineStopStartDriverData
{
public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.ENGINEERING_DEFINITONS_NAMESPACE_V10;
public const string XSD_TYPE = "EngineStartStopParametersEngineeringType";
public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, XSD_TYPE);
public XMLEngineStopStartDriverDataV10(IXMLEngineeringDriverData driverData, XmlNode node) : base(node) { }
#region Implementation of IXMLEngineStopStartDriverData
public Second EngineOffStandStillActivationDelay
{
get {
return GetDouble("ActivationDelay", DeclarationData.Driver.EngineOffStandStillActivationDelay.Value()).SI<Second>();
}
}
public Second MaxEngineOffTimespan
{
get {
return GetDouble(
"MaxEngineStopStartTimespan",
DeclarationData.Driver.EngineOffStandStillActivationDelay.Value()).SI<Second>();
}
}
public double EngineStopStartUtilityFactor
{
get {
return ElementExists("EngineStopStartUtilityFactor")
......
......@@ -76,5 +76,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Factory
IXMLAuxiliaryReader CreatAuxiliariesReader(string version, IXMLEngineeringVehicleData vehicle, XmlNode componentsNode);
IXMLAxlesReader CreateAxlesReader(string version, IXMLEngineeringVehicleData vehicle, XmlNode componentsNode);
IXMLGearboxReader CreateGearboxReader(string version, IXMLEngineeringVehicleData vehicle, XmlNode componentsNode);
IXMLEngineStopStartDriverData CreateEngineStopStartData(string version, IXMLEngineeringDriverData driverData, XmlNode node);
}
}
......@@ -89,6 +89,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.NinjectModules
Bind<IXMLDriverAcceleration>().To<XMLDriverAccelerationV10>()
.Named(XMLDriverAccelerationV10.QUALIFIED_XSD_TYPE);
Bind<IXMLEngineStopStartDriverData>().To<XMLEngineStopStartDriverDataV10>()
.Named(XMLEngineStopStartDriverDataV10.QUALIFIED_XSD_TYPE);
}
#endregion
......
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Interfaces;
namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering
......@@ -12,5 +13,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering
IXMLDriverAcceleration AccelerationCurveData { get; }
IGearshiftEngineeringInputData ShiftParameters { get; }
IXMLEngineStopStartDriverData EngineStopStartData { get; }
}
public interface IXMLEngineStopStartDriverData
{
Second EngineOffStandStillActivationDelay { get; }
Second MaxEngineOffTimespan { get; }
double EngineStopStartUtilityFactor { get; }
}
}
\ No newline at end of file
......@@ -67,6 +67,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Reader {
}
}
public IXMLEngineStopStartDriverData EngineStopStartData
{
get {
return CreateData(
XMLNames.DriverModel_EngineStopStartParameters,
(version, node) => version == null ? null : Factory.CreateEngineStopStartData(version, DriverData, node), false);
}
}
private IGearshiftEngineeringInputData ShiftParametersCreator(string version, XmlNode node)
{
if (version == null) {
......@@ -123,7 +132,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Reader {
{
public new const string NAMESPACE_URI = XMLDefinitions.ENGINEERING_DEFINITONS_NAMESPACE_V10;
public new const string XSD_TYPE = "DriverModelType";
public new const string XSD_TYPE = "DriverModelEngineeringType";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, XSD_TYPE);
......
......@@ -79,7 +79,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
LookAheadCoasting = lookAheadData,
OverSpeedEcoRoll = overspeedData,
EngineStopStart = new DriverData.EngineStopStartData() {
EngineOffStandStillThreshold = DeclarationData.Driver.EngineOffStandStillThreshold,
EngineOffStandStillActivationDelay = DeclarationData.Driver.EngineOffStandStillActivationDelay,
MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan,
UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor,
},
......
......@@ -458,8 +458,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
LookAheadCoasting = lookAheadData,
OverSpeedEcoRoll = overspeedData,
EngineStopStart = new DriverData.EngineStopStartData() {
EngineOffStandStillThreshold =
driver.EngineOffStandStillThreshold ?? DeclarationData.Driver.EngineOffStandStillThreshold,
EngineOffStandStillActivationDelay =
driver.EngineOffStandStillActivationDelay ?? DeclarationData.Driver.EngineOffStandStillActivationDelay,
MaxEngineOffTimespan = driver.MaxEngineOffTimespan ?? DeclarationData.Driver.MaxEngineOffTimespan,
UtilityFactor = driver.EngineStopStartUtilityFactor,
}
......
......@@ -117,7 +117,7 @@ namespace TUGraz.VectoCore.Models.Declaration
public static class Driver
{
public static readonly Second EngineOffStandStillThreshold = 2.SI<Second>();
public static readonly Second EngineOffStandStillActivationDelay = 2.SI<Second>();
public static readonly Second MaxEngineOffTimespan = 120.SI<Second>();
public const double EngineStopStartUtilityFactor = 0.8;
......
......@@ -79,7 +79,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data
public class EngineStopStartData
{
[Required, SIRange(0, Double.MaxValue)] public Second EngineOffStandStillThreshold;
[Required, SIRange(0, Double.MaxValue)] public Second EngineOffStandStillActivationDelay;
[Required, SIRange(0, double.MaxValue)] public Second MaxEngineOffTimespan;
......
......@@ -158,7 +158,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
if ((absTime - VehicleHaltTimestamp).IsGreaterOrEqual(
Driver.DriverData.EngineStopStart.EngineOffStandStillThreshold)) {
Driver.DriverData.EngineStopStart.EngineOffStandStillActivationDelay)) {
if (EngineOffTimestamp == null) {
EngineOffTimestamp = absTime;
Driver.DataBus.IgnitionOn = false;
......
......@@ -266,7 +266,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
DriverData = new DriverData() {
EngineStopStart = new DriverData.EngineStopStartData() {
UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor,
EngineOffStandStillThreshold = DeclarationData.Driver.EngineOffStandStillThreshold,
EngineOffStandStillActivationDelay = DeclarationData.Driver.EngineOffStandStillActivationDelay,
MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan
}
}
......@@ -348,7 +348,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
Retarder = new RetarderData(),
DriverData = new DriverData() {
EngineStopStart = new DriverData.EngineStopStartData() {
EngineOffStandStillThreshold = DeclarationData.Driver.EngineOffStandStillThreshold,
EngineOffStandStillActivationDelay = DeclarationData.Driver.EngineOffStandStillActivationDelay,
UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor,
MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan,
}
......
......@@ -170,7 +170,7 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
DriverData = new DriverData() {
EngineStopStart = new DriverData.EngineStopStartData() {
UtilityFactor = DeclarationData.Driver.EngineStopStartUtilityFactor,
EngineOffStandStillThreshold = DeclarationData.Driver.EngineOffStandStillThreshold,
EngineOffStandStillActivationDelay = DeclarationData.Driver.EngineOffStandStillActivationDelay,
MaxEngineOffTimespan = DeclarationData.Driver.MaxEngineOffTimespan
}
}
......
......@@ -33,6 +33,11 @@
<Entry vehicleSpeed="0" maxAcceleration="1" maxDeceleration="-1"/>
<Entry vehicleSpeed="100" maxAcceleration="1" maxDeceleration="-1"/>
</DriverAccelerationCurve>
<!--<EngineStopStartParameters xsi:type="EngineStartStopParametersEngineeringType">
<ActivationDelay>2</ActivationDelay>
<MaxEngineOffTime>120</MaxEngineOffTime>
<UtilityFactor>0.8</UtilityFactor>
</EngineStopStartParameters>-->
</DriverModel>
<MissionCycles>
<Cycle type="csv" file="Long_Haul+FAN+ES.vdri"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment