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 5c4843c5 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

separate ADAS input data and BusAux Input data for Conventional, HEV, PEV,...

separate ADAS input data and BusAux Input data for Conventional, HEV, PEV, IEPC into separate classes as different inputs are available
parent 5fb7a74d
Branches
Tags
No related merge requests found
Showing
with 329 additions and 97 deletions
......@@ -300,7 +300,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter
aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_EcoRollWithEngineStopStart, ecoRollWithEngineStop));
aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_PCC,
_inputData.ADAS.PredictiveCruiseControl.ToXMLFormat()));
aDASElement.Add(new XElement(adasNamespace + XMLNames.Bus_ADAS_APTEcoRollReleaseLockupClutch, _inputData.ADAS?.ATEcoRollReleaseLockupClutch ));
aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch, _inputData.ADAS?.ATEcoRollReleaseLockupClutch ));
}
_Xelement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove();
......
......@@ -100,47 +100,117 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
// ---------------------------------------------------------------------------------------
public class XMLDeclarationADASDataProviderV24 : XMLDeclarationADASDataProviderV21
public class XMLDeclarationADASDataConventionalProviderV24 : XMLDeclarationADASDataProviderV21
{
/*
* new field added in version 2.3
* new field added in version 2.4
*/
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public new const string XSD_TYPE = "ADAS_Conventional_Type";
public const string XSD_TYPE_HEV = "ADAS_HEV_Type";
public const string XSD_TYPE_PEV = "ADAS_PEV_Type";
public const string XSD_TYPE_IEPC = "ADAS_IEPC_Type";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public static readonly string QUALIFIED_XSD_HEV_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE_HEV);
public static readonly string QUALIFIED_XSD_PEV_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE_PEV);
public static readonly string QUALIFIED_XSD_IEPC_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE_IEPC);
public XMLDeclarationADASDataProviderV24(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
public XMLDeclarationADASDataConventionalProviderV24(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) { }
#region Overrides of XMLDeclarationADASDataProviderV10
public override bool? ATEcoRollReleaseLockupClutch {
get {
var node = GetNode(XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch, required: false);
var busNode = GetNode(XMLNames.Bus_ADAS_APTEcoRollReleaseLockupClutch, required: false);
if (node == null && busNode == null) {
return null;
public override bool? ATEcoRollReleaseLockupClutch =>
ElementExists(XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch)
? XmlConvert.ToBoolean(GetString(XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch))
: (bool?)null;
#endregion
protected override XNamespace SchemaNamespace => NAMESPACE_URI;
}
var innerText = node == null ? busNode.InnerText : node.InnerText;
return XmlConvert.ToBoolean(innerText);
// ---------------------------------------------------------------------------------------
public class XMLDeclarationADASDataHEVProviderV24 : XMLDeclarationADASDataProviderV21
{
/*
* new field added in version 2.3
*/
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public new const string XSD_TYPE = "ADAS_HEV_Type";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationADASDataHEVProviderV24(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) { }
#region Overrides of XMLDeclarationADASDataProviderV10
public override bool? ATEcoRollReleaseLockupClutch => null;
public override EcoRollType EcoRoll => EcoRollType.WithEngineStop;
#endregion
protected override XNamespace SchemaNamespace => NAMESPACE_URI;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationADASDataPEVProviderV24 : XMLDeclarationADASDataProviderV21
{
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public new const string XSD_TYPE = "ADAS_PEV_Type";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationADASDataPEVProviderV24(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) { }
#region Overrides of XMLDeclarationADASDataProviderV10
public override bool? ATEcoRollReleaseLockupClutch => null;
public override EcoRollType EcoRoll => EcoRollType.None;
public override bool EngineStopStart => false;
#endregion
protected override XNamespace SchemaNamespace => NAMESPACE_URI;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationADASDataIEPCProviderV24 : XMLDeclarationADASDataProviderV21
{
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public new const string XSD_TYPE = "ADAS_IEPC_Type";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationADASDataIEPCProviderV24(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) { }
#region Overrides of XMLDeclarationADASDataProviderV10
public override bool? ATEcoRollReleaseLockupClutch => null;
public override EcoRollType EcoRoll => EcoRollType.None;
public override bool EngineStopStart => false;
#endregion
protected override XNamespace SchemaNamespace => NAMESPACE_URI;
}
// ---------------------------------------------------------------------------------------
public static class ADASDataProviderExtensions
{
public static bool EcoRollWithEngineStop(this IAdvancedDriverAssistantSystemDeclarationInputData adas)
......
......@@ -15,26 +15,14 @@ using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
{
public class XMLDeclarationPrimaryBusAuxiliariesDataProviderV24 : AbstractXMLType, IXMLBusAuxiliariesDeclarationData,
public abstract class AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24 : AbstractXMLType, IXMLBusAuxiliariesDeclarationData,
IElectricSupplyDeclarationData, IPneumaticConsumersDeclarationData,
IPneumaticSupplyDeclarationData, IHVACBusAuxiliariesDeclarationData
{
public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
public const string XSD_TYPE = "AUX_Conventional_PrimaryBusType";
public const string XSD_HEV_P_TYPE = "AUX_HEV-P_PrimaryBusType";
public const string XSD_HEV_S_TYPE = "AUX_HEV-S_PrimaryBusType";
public const string XSD_PEV_E2_TYPE = "AUX_PEV_PrimaryBusType";
public const string XSD_IEPC_PRIMARY_BUS_TYPE = "AUX_IEPC_PrimaryBusType";
public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public static readonly string QUALIFIED_XSD_HEV_P_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_HEV_P_TYPE);
public static readonly string QUALIFIED_XSD_HEV_S_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_HEV_S_TYPE);
public static readonly string QUALIFIED_XSD_PEV_E2_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_PEV_E2_TYPE);
public static readonly string QUALIFIED_XSD_IEPC_PRIMARY_BUS_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_IEPC_PRIMARY_BUS_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesDataProviderV24(
IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { }
public AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24(
XmlNode componentNode) : base(componentNode) { }
#region Implementation of IBusAuxiliariesDeclarationData
......@@ -92,6 +80,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
}
}
public virtual bool ESSupplyFromHEVREESS => ElementExists("SupplyFromHEVPossible")
? XmlConvert.ToBoolean(GetString("SupplyFromHEVPossible"))
: false;
public IList<IBusAuxElectricStorageDeclarationInputData> ElectricStorage
{
get
......@@ -224,23 +216,128 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
#endregion
}
public class XMLDeclarationPrimaryBusAuxiliariesDataProviderV01 : XMLDeclarationPrimaryBusAuxiliariesDataProviderV24
// ---------------------------------------------------------------------------------------
public class XMLDeclarationPrimaryBusAuxiliariesConventionalDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24
{
public const string XSD_TYPE = "AUX_Conventional_PrimaryBusType";
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesConventionalDataProviderV24(
IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { }
public override bool ESSupplyFromHEVREESS => false;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationPrimaryBusAuxiliariesHEVPDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24
{
public const string XSD_TYPE = "AUX_HEV-P_PrimaryBusType";
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesHEVPDataProviderV24(
IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { }
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationPrimaryBusAuxiliariesHEVSDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24
{
public const string XSD_TYPE = "AUX_HEV-S_PrimaryBusType";
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesHEVSDataProviderV24(
IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { }
public override bool SmartElectrics => false;
public override bool SmartAirCompression => false;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationPrimaryBusAuxiliariesPEVDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24
{
public const string XSD_TYPE = "AUX_PEV_PrimaryBusType";
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesPEVDataProviderV24(
IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { }
public override string FanTechnology => null;
public override bool ESSupplyFromHEVREESS => true;
public override bool SmartElectrics => false;
public override bool SmartAirCompression => false;
public override string CompressorSize => null;
public override string Clutch => null;
public override double Ratio => double.NaN;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationPrimaryBusAuxiliariesIEPCDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24
{
public const string XSD_TYPE = "AUX_IEPC_PrimaryBusType";
public static readonly string QUALIFIED_XSD_TYPE =
XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesIEPCDataProviderV24(
IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { }
public override string FanTechnology => null;
public override bool ESSupplyFromHEVREESS => true;
public override bool SmartElectrics => false;
public override bool SmartAirCompression => false;
public override string CompressorSize => null;
public override string Clutch => null;
public override double Ratio => double.NaN;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationPrimaryBusAuxiliariesDataProviderV01 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24
{
public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1;
public new const string XSD_TYPE = "AuxiliaryDataPIFType";
public const string XSD_TYPE = "AuxiliaryDataPIFType";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationPrimaryBusAuxiliariesDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) { }
: base(componentNode) { }
public override XmlNode XMLSource => BaseNode;
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationCompletedBusAuxiliariesDataProviderV24 : XMLDeclarationPrimaryBusAuxiliariesDataProviderV24, IElectricConsumersDeclarationData
public class XMLDeclarationCompletedBusAuxiliariesDataProviderV24 : AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24, IElectricConsumersDeclarationData
{
public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
......@@ -253,7 +350,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public XMLDeclarationCompletedBusAuxiliariesDataProviderV24(IXMLDeclarationVehicleData vehicle,
XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) {}
: base(componentNode) {}
private bool IsBusHVACTagEmpty()
{
......
......@@ -655,6 +655,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
{
public virtual string PowertrainPositionPrefix => "P";
protected IAdvancedDriverAssistantSystemDeclarationInputData _adas;
protected AbstractXMLVehicleDataProviderV24(IXMLDeclarationJobInputData jobData, XmlNode xmlNode, string sourceFile)
: base(jobData, xmlNode, sourceFile) { }
......@@ -686,6 +688,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public override bool? SleeperCab => GetBool(XMLNames.Vehicle_SleeperCab);
public override IAdvancedDriverAssistantSystemDeclarationInputData ADAS {
get {
if (ADASNode == null)
return null;
return _adas ?? (_adas = ADASReader.ADASInputData);
}
}
#endregion
public override Dictionary<PowertrainPosition, List<Tuple<Volt, TableData>>> ElectricMotorTorqueLimits
......
......@@ -16,8 +16,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
{
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24;
private IAdvancedDriverAssistantSystemDeclarationInputData _adas;
public AbstractXMLDeclarationCompletedBusDataProviderV24(
IXMLDeclarationJobInputData jobData, XmlNode xmlNode, string sourceFile)
: base(jobData, xmlNode, sourceFile) { }
......@@ -152,16 +150,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
}
public override IAdvancedDriverAssistantSystemDeclarationInputData ADAS {
get {
if (ADASNode == null)
return null;
return _adas ?? (_adas = ADASReader.ADASInputData);
}
}
public override IVehicleComponentsDeclaration Components {
get {
if (ComponentNode == null)
......
......@@ -32,11 +32,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
#region Overrides of XMLDeclarationVehicleDataProviderV10
public override IAdvancedDriverAssistantSystemDeclarationInputData ADAS => ADASReader.ADASInputData;
public override IList<ITorqueLimitInputData> TorqueLimits =>
ElementExists(XMLNames.Vehicle_TorqueLimits) ? base.TorqueLimits : null;
public override TankSystem? TankSystem =>
ElementExists(XMLNames.Vehicle_NgTankSystem)
? EnumHelper.ParseEnum<TankSystem>(GetString(XMLNames.Vehicle_NgTankSystem))
......@@ -76,10 +71,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
#region Overrides of XMLDeclarationVehicleDataProviderV10
public override IList<ITorqueLimitInputData> TorqueLimits =>
ElementExists(XMLNames.Vehicle_TorqueLimits) ? base.TorqueLimits : null;
public override TableData BoostingLimitations
=> ElementExists(XMLNames.Vehicle_BoostingLimitation)
? ReadTableData(XMLNames.Vehicle_BoostingLimitation, XMLNames.BoostingLimitation_Entry,
......
......@@ -18,9 +18,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
#region Overrides of XMLDeclarationVehicleDataProviderV10
public override IList<ITorqueLimitInputData> TorqueLimits =>
ElementExists(XMLNames.Vehicle_TorqueLimits) ? base.TorqueLimits : null;
public override VehicleCategory VehicleCategory => VehicleCategoryHelper.Parse(GetString(XMLNames.ChassisConfiguration));
public override LegislativeClass? LegislativeClass => GetString(XMLNames.Vehicle_LegislativeCategory)?.ParseEnum<LegislativeClass>();
......@@ -92,6 +89,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
public override string PowertrainPositionPrefix => "P";
public override TableData BoostingLimitations
=> ElementExists(XMLNames.Vehicle_BoostingLimitation)
? ReadTableData(XMLNames.Vehicle_BoostingLimitation, XMLNames.BoostingLimitation_Entry,
new Dictionary<string, string> {
{XMLNames.BoostingLimitation_RotationalSpeed, XMLNames.BoostingLimitation_RotationalSpeed},
{XMLNames.BoostingLimitation_BoostingTorque, XMLNames.BoostingLimitation_BoostingTorque}
})
: null;
#endregion
......@@ -120,6 +126,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
public XMLDeclarationHevSxMediumLorryDataProviderV24(IXMLDeclarationJobInputData jobData, XmlNode xmlNode, string sourceFile)
: base(jobData, xmlNode, sourceFile) { }
public override IList<ITorqueLimitInputData> TorqueLimits => null;
#region Overrides of XMLDeclarationVehicleDataProviderV10
......@@ -212,6 +219,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
ElementExists(XMLNames.Vehicle_CargoVolume)
? GetDouble(XMLNames.Vehicle_CargoVolume).SI<CubicMeter>() : null;
public override IList<ITorqueLimitInputData> TorqueLimits => null;
public override IPTOTransmissionInputData PTOTransmissionInputData => null;
public override XmlElement PTONode => null;
......
......@@ -25,8 +25,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
public override bool? SleeperCab => false;
public override IAdvancedDriverAssistantSystemDeclarationInputData ADAS => ADASReader.ADASInputData;
public override CubicMeter CargoVolume => null;
public override XmlElement PTONode => null;
public override IPTOTransmissionInputData PTOTransmissionInputData => null;
......@@ -43,8 +42,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
public override Meter EntranceHeight => null;
public override IList<ITorqueLimitInputData> TorqueLimits =>
ElementExists(XMLNames.Vehicle_TorqueLimits) ? base.TorqueLimits : null;
public override TankSystem? TankSystem => VectoCommon.InputData.TankSystem.Compressed;
public override bool VocationalVehicle => false;
......@@ -99,6 +97,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
public override string PowertrainPositionPrefix => "P";
public override TableData BoostingLimitations
=> ElementExists(XMLNames.Vehicle_BoostingLimitation)
? ReadTableData(XMLNames.Vehicle_BoostingLimitation, XMLNames.BoostingLimitation_Entry,
new Dictionary<string, string> {
{XMLNames.BoostingLimitation_RotationalSpeed, XMLNames.BoostingLimitation_RotationalSpeed},
{XMLNames.BoostingLimitation_BoostingTorque, XMLNames.BoostingLimitation_BoostingTorque}
})
: null;
#endregion
public XMLDeclarationHevPxPrimaryBusDataProviderV24(IXMLDeclarationJobInputData jobData, XmlNode xmlNode, string sourceFile)
......@@ -122,6 +129,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
public XMLDeclarationHevSxPrimaryBusDataProviderV24(IXMLDeclarationJobInputData jobData, XmlNode xmlNode, string sourceFile)
: base(jobData, xmlNode, sourceFile) { }
public override IList<ITorqueLimitInputData> TorqueLimits => null;
}
// ---------------------------------------------------------------------------------------
......@@ -143,7 +151,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
#region Overrides of XMLDeclarationVehicleDataProviderV10
public override CubicMeter CargoVolume => null;
#endregion
}
......@@ -163,7 +171,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
#region Overrides of XMLDeclarationVehicleDataProviderV10
public override CubicMeter CargoVolume => null;
public override IList<ITorqueLimitInputData> TorqueLimits => null;
public override bool Articulated => GetBool(XMLNames.Vehicle_Articulated);
......@@ -189,9 +197,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24
#region Overrides of XMLDeclarationVehicleDataProviderV10
public override IPTOTransmissionInputData PTOTransmissionInputData => null;
public override IList<ITorqueLimitInputData> TorqueLimits => null;
public override XmlElement PTONode => null;
#endregion
}
......
......@@ -249,13 +249,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules
.Named(XMLAuxiliaryDeclarationDataProviderV24_Lorry.QUALIFIED_XSD_IEPC_TYPE);
Bind<IXMLAdvancedDriverAssistantSystemDeclarationInputData>()
.To<XMLDeclarationADASDataProviderV24>().Named(XMLDeclarationADASDataProviderV24.QUALIFIED_XSD_TYPE);
.To<XMLDeclarationADASDataConventionalProviderV24>().Named(XMLDeclarationADASDataConventionalProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLAdvancedDriverAssistantSystemDeclarationInputData>()
.To<XMLDeclarationADASDataProviderV24>().Named(XMLDeclarationADASDataProviderV24.QUALIFIED_XSD_HEV_TYPE);
.To<XMLDeclarationADASDataHEVProviderV24>().Named(XMLDeclarationADASDataHEVProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLAdvancedDriverAssistantSystemDeclarationInputData>()
.To<XMLDeclarationADASDataProviderV24>().Named(XMLDeclarationADASDataProviderV24.QUALIFIED_XSD_PEV_TYPE);
.To<XMLDeclarationADASDataPEVProviderV24>().Named(XMLDeclarationADASDataPEVProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLAdvancedDriverAssistantSystemDeclarationInputData>()
.To<XMLDeclarationADASDataProviderV24>().Named(XMLDeclarationADASDataProviderV24.QUALIFIED_XSD_IEPC_TYPE);
.To<XMLDeclarationADASDataIEPCProviderV24>().Named(XMLDeclarationADASDataIEPCProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLPTOTransmissionInputData>()
.To<XMLDeclarationPTODataProviderV24>().Named(XMLDeclarationPTODataProviderV24.QUALIFIED_XSD_TYPE);
......@@ -276,20 +276,20 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules
Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationPrimaryBusComponentsDataProviderV24>()
.Named(XMLDeclarationPrimaryBusComponentsDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesConventionalDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesConventionalDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV24.QUALIFIED_XSD_HEV_P_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesHEVPDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesHEVPDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV24.QUALIFIED_XSD_HEV_S_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesHEVSDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesHEVSDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV24.QUALIFIED_XSD_PEV_E2_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesPEVDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesPEVDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesDataProviderV24.QUALIFIED_XSD_IEPC_PRIMARY_BUS_TYPE);
Bind<IXMLBusAuxiliariesDeclarationData>().To<XMLDeclarationPrimaryBusAuxiliariesIEPCDataProviderV24>()
.Named(XMLDeclarationPrimaryBusAuxiliariesIEPCDataProviderV24.QUALIFIED_XSD_TYPE);
Bind<IXMLDeclarationVehicleData>().To<XMLDeclarationConventionalMediumLorryVehicleDataProviderV24>()
.Named(XMLDeclarationConventionalMediumLorryVehicleDataProviderV24.QUALIFIED_XSD_TYPE);
......
......@@ -238,7 +238,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
retVal.Inertia = DeclarationData.Engine.EngineInertia(retVal.Displacement, gearbox.Type);
retVal.EngineStartTime = DeclarationData.Engine.DefaultEngineStartTime;
var limits = vehicle.TorqueLimits.ToDictionary(e => e.Gear);
var limits = vehicle.TorqueLimits?.ToDictionary(e => e.Gear) ?? new Dictionary<int, ITorqueLimitInputData>();
var numGears = gearbox.Gears.Count;
var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(numGears + 1);
fullLoadCurves[0] = FullLoadCurveReader.Create(mode.FullLoadCurve, true);
......@@ -265,7 +265,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
return retVal;
}
private static WHRData CreateWHRData(IWHRData whrInputData, MissionType missionType, WHRType type)
protected static WHRData CreateWHRData(IWHRData whrInputData, MissionType missionType, WHRType type)
{
if (whrInputData == null || whrInputData.GeneratedPower == null) {
throw new VectoException("Missing WHR Data");
......@@ -342,14 +342,14 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
var retVal = SetCommonGearboxData(gearbox);
if (adas != null && retVal.Type.AutomaticTransmission() && adas.EcoRoll != EcoRollType.None &&
!adas.ATEcoRollReleaseLockupClutch.HasValue) {
throw new VectoException("Input parameter ATEcoRollReleaseLockupClutch required for AT transmission");
}
//if (adas != null && retVal.Type.AutomaticTransmission() && adas.EcoRoll != EcoRollType.None &&
// !adas.ATEcoRollReleaseLockupClutch.HasValue) {
// throw new VectoException("Input parameter ATEcoRollReleaseLockupClutch required for AT transmission");
//}
retVal.ATEcoRollReleaseLockupClutch =
adas != null && adas.EcoRoll != EcoRollType.None && retVal.Type.AutomaticTransmission()
? adas.ATEcoRollReleaseLockupClutch.Value
? (adas.ATEcoRollReleaseLockupClutch.HasValue ? adas.ATEcoRollReleaseLockupClutch.Value : false)
: false;
if (!SupportedGearboxTypes.Contains(gearbox.Type)) {
......@@ -560,7 +560,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
};
}
private void WarnDeclarationMode(string inputData)
protected void WarnDeclarationMode(string inputData)
{
Log.Warn("{0} not in Declaration Mode!", inputData);
}
......
......@@ -16,6 +16,7 @@ using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Models.SimulationComponent;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Engine;
using TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox;
namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
......@@ -57,6 +58,65 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
#endregion
public override CombustionEngineData CreateEngineData(
IVehicleDeclarationInputData vehicle, IEngineModeDeclarationInputData mode, Mission mission)
{
var engine = vehicle.Components.EngineInputData;
var gearbox = vehicle.Components.GearboxInputData;
if (!engine.SavedInDeclarationMode) {
WarnDeclarationMode("EngineData");
}
var retVal = SetCommonCombustionEngineData(engine, SingleBusInputData.CompletedVehicle.TankSystem);
retVal.IdleSpeed = VectoMath.Max(mode.IdleSpeed, vehicle.EngineIdleSpeed);
retVal.Fuels = new List<CombustionEngineFuelData>();
foreach (var fuel in mode.Fuels) {
retVal.Fuels.Add(
new CombustionEngineFuelData() {
WHTCUrban = fuel.WHTCUrban,
WHTCRural = fuel.WHTCRural,
WHTCMotorway = fuel.WHTCMotorway,
ColdHotCorrectionFactor = fuel.ColdHotBalancingFactor,
CorrectionFactorRegPer = fuel.CorrectionFactorRegPer,
FuelData = DeclarationData.FuelData.Lookup(fuel.FuelType, SingleBusInputData.CompletedVehicle.TankSystem),
ConsumptionMap = FuelConsumptionMapReader.Create(fuel.FuelConsumptionMap),
FuelConsumptionCorrectionFactor = DeclarationData.WHTCCorrection.Lookup(
mission.MissionType.GetNonEMSMissionType(), fuel.WHTCRural, fuel.WHTCUrban,
fuel.WHTCMotorway) * fuel.ColdHotBalancingFactor * fuel.CorrectionFactorRegPer,
});
}
retVal.Inertia = DeclarationData.Engine.EngineInertia(retVal.Displacement, gearbox.Type);
retVal.EngineStartTime = DeclarationData.Engine.DefaultEngineStartTime;
var limits = vehicle.TorqueLimits.ToDictionary(e => e.Gear);
var numGears = gearbox.Gears.Count;
var fullLoadCurves = new Dictionary<uint, EngineFullLoadCurve>(numGears + 1);
fullLoadCurves[0] = FullLoadCurveReader.Create(mode.FullLoadCurve, true);
fullLoadCurves[0].EngineData = retVal;
foreach (var gear in gearbox.Gears) {
var maxTorque = VectoMath.Min(
GbxMaxTorque(gear, numGears, fullLoadCurves[0].MaxTorque),
VehMaxTorque(gear, numGears, limits, fullLoadCurves[0].MaxTorque));
fullLoadCurves[(uint)gear.Gear] = IntersectFullLoadCurves(fullLoadCurves[0], maxTorque);
}
retVal.FullLoadCurves = fullLoadCurves;
retVal.WHRType = engine.WHRType;
if ((retVal.WHRType & WHRType.ElectricalOutput) != 0) {
retVal.ElectricalWHR = CreateWHRData(
mode.WasteHeatRecoveryDataElectrical, mission.MissionType, WHRType.ElectricalOutput);
}
if ((retVal.WHRType & WHRType.MechanicalOutputDrivetrain) != 0) {
retVal.MechanicalWHR = CreateWHRData(
mode.WasteHeatRecoveryDataMechanical, mission.MissionType, WHRType.MechanicalOutputDrivetrain);
}
return retVal;
}
protected override TransmissionLossMap CreateGearLossMap(ITransmissionInputData gear, uint i, bool useEfficiencyFallback, VehicleCategory vehicleCategory, GearboxType gearboxType)
{
return TransmissionLossMapReader.Create(gear.LossMap, gear.Ratio, $"Gear {i + 1}", true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment