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

Merge pull request #646 in VECTO/vecto-sim from...

Merge pull request #646 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:feature/VECTO-762-extension-of-input-interfaces to develop

* commit '298c9146':
  adding testcase for default values in case new parameters are not present
  extending vehicle declaration interface with ADAS parameters (new interface)
  testcase for reading ADAS parameters
  implementing interface
  adding new vehicle parameters to vehicle declaration input interface
  adding testcases for new parameters
  either all new fields are required or none. adding sample files
  leave axle configuration at the current position but make it optional
  adding new fields to vehicle, new fuel types
parents 1ba5f3a0 298c9146
Branches
Tags
No related merge requests found
Showing
with 4056 additions and 58 deletions
......@@ -28,7 +28,7 @@ Imports TUGraz.VectoCore.Utils
<CustomValidation(GetType(Vehicle), "ValidateVehicle")>
Public Class Vehicle
Implements IVehicleEngineeringInputData, IVehicleDeclarationInputData, IRetarderInputData, IPTOTransmissionInputData,
IAngledriveInputData, IAirdragEngineeringInputData
IAngledriveInputData, IAirdragEngineeringInputData, IAdvancedDriverAssistantSystemDeclarationInputData
Private _filePath As String
Private _path As String
......@@ -320,6 +320,12 @@ Public Class Vehicle
End Get
End Property
Public ReadOnly Property ExemptedVehicle As Boolean Implements IVehicleDeclarationInputData.ExemptedVehicle
get
Return false
End Get
End Property
Public ReadOnly Property VIN As String Implements IVehicleDeclarationInputData.VIN
Get
Return "N.A."
......@@ -645,4 +651,82 @@ Public Class Vehicle
Return Me
End Get
End Property
Public ReadOnly Property VocationalVehicle As Boolean Implements IVehicleDeclarationInputData.VocationalVehicle
get
Return DeclarationData.Vehicle.VocationalVehicleDefault
End Get
End Property
Public ReadOnly Property SleeperCab As Boolean Implements IVehicleDeclarationInputData.SleeperCab
get
Return DeclarationData.Vehicle.SleeperCabDefault
End Get
End Property
Public ReadOnly Property TankSystem As NgTankSystem Implements IVehicleDeclarationInputData.TankSystem
get
Return DeclarationData.Vehicle.NgTankSystemDefault
End Get
End Property
Public ReadOnly Property ADAS As IAdvancedDriverAssistantSystemDeclarationInputData Implements IVehicleDeclarationInputData.ADAS
get
return Me
End Get
End Property
Public ReadOnly Property ZeroEmissionVehicle As Boolean Implements IVehicleDeclarationInputData.ZeroEmissionVehicle
get
Return DeclarationData.Vehicle.ZeroEmissionVehicleDefault
End Get
End Property
Public ReadOnly Property HybridElectricHDV As Boolean Implements IVehicleDeclarationInputData.HybridElectricHDV
get
return DeclarationData.Vehicle.HybridElectricHDVDefault
End Get
End Property
Public ReadOnly Property DualFuelVehicle As Boolean Implements IVehicleDeclarationInputData.DualFuelVehicle
get
return DeclarationData.Vehicle.DualFuelVehicleDefault
End Get
End Property
Public ReadOnly Property MaxNetPower1 As Watt Implements IVehicleDeclarationInputData.MaxNetPower1
get
Return Nothing
End Get
End Property
Public ReadOnly Property MaxNetPower2 As Watt Implements IVehicleDeclarationInputData.MaxNetPower2
get
Return Nothing
End Get
End Property
Public ReadOnly Property EngineStopStart As Boolean Implements IAdvancedDriverAssistantSystemDeclarationInputData.EngineStopStart
get
return DeclarationData.Vehicle.ADAS.EngineStopStartDefault
End Get
End Property
Public ReadOnly Property EcoRollWitoutEngineStop As Boolean Implements IAdvancedDriverAssistantSystemDeclarationInputData.EcoRollWitoutEngineStop
get
return DeclarationData.Vehicle.ADAS.EcoRollWitoutEngineStop
End Get
End Property
Public ReadOnly Property EcoRollWithEngineStop As Boolean Implements IAdvancedDriverAssistantSystemDeclarationInputData.EcoRollWithEngineStop
get
Return DeclarationData.Vehicle.ADAS.EcoRollWithEngineStop
End Get
End Property
Public ReadOnly Property PredictiveCruiseControl As PredictiveCruiseControlType Implements IAdvancedDriverAssistantSystemDeclarationInputData.PredictiveCruiseControl
get
Return DeclarationData.Vehicle.ADAS.PredictiveCruiseControlDefault
End Get
End Property
End Class
......@@ -29,7 +29,9 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
using System.Collections.Generic;
using System.Net.NetworkInformation;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
......@@ -67,6 +69,8 @@ namespace TUGraz.VectoCommon.InputData
public interface IVehicleDeclarationInputData : IComponentInputData
{
bool ExemptedVehicle { get; }
string VIN { get; }
LegislativeClass LegislativeClass { get; }
......@@ -131,6 +135,68 @@ namespace TUGraz.VectoCommon.InputData
IRetarderInputData RetarderInputData { get; }
IPTOTransmissionInputData PTOTransmissionInputData { get; }
// new (optional) input fields
bool VocationalVehicle { get; }
bool SleeperCab { get; }
NgTankSystem TankSystem { get; }
IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get; }
// fields for exempted vehicles
bool ZeroEmissionVehicle { get; }
bool HybridElectricHDV { get; }
bool DualFuelVehicle { get; }
Watt MaxNetPower1 { get; }
Watt MaxNetPower2 { get; }
}
public interface IAdvancedDriverAssistantSystemDeclarationInputData
{
bool EngineStopStart { get; }
bool EcoRollWitoutEngineStop { get; }
bool EcoRollWithEngineStop { get; }
PredictiveCruiseControlType PredictiveCruiseControl { get; }
}
public enum PredictiveCruiseControlType
{
None,
Option_1_2,
Option_1_2_3
}
public static class PredictiveCruiseControlTypeHelper
{
public const string Prefix = "Option_";
public const string SeparatorXML = ",";
public const string SeparatorEnum = "_";
public static PredictiveCruiseControlType Parse(string value)
{
if (PredictiveCruiseControlType.None.ToString().Equals(value, StringComparison.InvariantCultureIgnoreCase)) {
return PredictiveCruiseControlType.None;
}
return (Prefix + value.Replace(SeparatorXML, SeparatorEnum)).ParseEnum<PredictiveCruiseControlType>();
}
}
public enum NgTankSystem
{
Liquefied,
Compressed
}
public interface IAirdragDeclarationInputData : IComponentInputData
......
......@@ -2121,6 +2121,51 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to ADAS.
/// </summary>
public static string Vehicle_ADAS {
get {
return ResourceManager.GetString("Vehicle_ADAS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to EcoRollWithEngineStop.
/// </summary>
public static string Vehicle_ADAS_EcoRollWithEngineStopStart {
get {
return ResourceManager.GetString("Vehicle_ADAS_EcoRollWithEngineStopStart", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to EcoRollWithoutEngineStop.
/// </summary>
public static string Vehicle_ADAS_EcoRollWithoutEngineStop {
get {
return ResourceManager.GetString("Vehicle_ADAS_EcoRollWithoutEngineStop", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to EngineStopStart.
/// </summary>
public static string Vehicle_ADAS_EngineStopStart {
get {
return ResourceManager.GetString("Vehicle_ADAS_EngineStopStart", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PredictiveCruiseControl.
/// </summary>
public static string Vehicle_ADAS_PCC {
get {
return ResourceManager.GetString("Vehicle_ADAS_PCC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to AdvancedDriverAssist.
/// </summary>
......@@ -2310,6 +2355,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to DualFuelVehicle.
/// </summary>
public static string Vehicle_DualFuelVehicle {
get {
return ResourceManager.GetString("Vehicle_DualFuelVehicle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GrossVehicleMass.
/// </summary>
......@@ -2319,6 +2373,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to HybridElectricHDV.
/// </summary>
public static string Vehicle_HybridElectricHDV {
get {
return ResourceManager.GetString("Vehicle_HybridElectricHDV", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to IdlingSpeed.
/// </summary>
......@@ -2346,6 +2409,33 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to MaxNetPower1.
/// </summary>
public static string Vehicle_MaxNetPower1 {
get {
return ResourceManager.GetString("Vehicle_MaxNetPower1", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MaxNetPower2.
/// </summary>
public static string Vehicle_MaxNetPower2 {
get {
return ResourceManager.GetString("Vehicle_MaxNetPower2", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to NgTankSystem.
/// </summary>
public static string Vehicle_NgTankSystem {
get {
return ResourceManager.GetString("Vehicle_NgTankSystem", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PTO.
/// </summary>
......@@ -2481,6 +2571,15 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to SleeperCab.
/// </summary>
public static string Vehicle_SleeperCab {
get {
return ResourceManager.GetString("Vehicle_SleeperCab", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SteeredAxles.
/// </summary>
......@@ -2544,6 +2643,24 @@ namespace TUGraz.VectoCommon.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to VocationalVehicle.
/// </summary>
public static string Vehicle_VocationalVehicle {
get {
return ResourceManager.GetString("Vehicle_VocationalVehicle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ZeroEmissionVehicle.
/// </summary>
public static string Vehicle_ZeroEmissionVehicle {
get {
return ResourceManager.GetString("Vehicle_ZeroEmissionVehicle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to torqueLimit.
/// </summary>
......
......@@ -951,4 +951,43 @@
<data name="XMLManufacturerReport_torqueLimitPercent" xml:space="preserve">
<value>torqueLimitPercent</value>
</data>
<data name="Vehicle_HybridElectricHDV" xml:space="preserve">
<value>HybridElectricHDV</value>
</data>
<data name="Vehicle_DualFuelVehicle" xml:space="preserve">
<value>DualFuelVehicle</value>
</data>
<data name="Vehicle_VocationalVehicle" xml:space="preserve">
<value>VocationalVehicle</value>
</data>
<data name="Vehicle_SleeperCab" xml:space="preserve">
<value>SleeperCab</value>
</data>
<data name="Vehicle_NgTankSystem" xml:space="preserve">
<value>NgTankSystem</value>
</data>
<data name="Vehicle_ZeroEmissionVehicle" xml:space="preserve">
<value>ZeroEmissionVehicle</value>
</data>
<data name="Vehicle_MaxNetPower1" xml:space="preserve">
<value>MaxNetPower1</value>
</data>
<data name="Vehicle_MaxNetPower2" xml:space="preserve">
<value>MaxNetPower2</value>
</data>
<data name="Vehicle_ADAS" xml:space="preserve">
<value>ADAS</value>
</data>
<data name="Vehicle_ADAS_PCC" xml:space="preserve">
<value>PredictiveCruiseControl</value>
</data>
<data name="Vehicle_ADAS_EcoRollWithEngineStopStart" xml:space="preserve">
<value>EcoRollWithEngineStop</value>
</data>
<data name="Vehicle_ADAS_EcoRollWithoutEngineStop" xml:space="preserve">
<value>EcoRollWithoutEngineStop</value>
</data>
<data name="Vehicle_ADAS_EngineStopStart" xml:space="preserve">
<value>EngineStopStart</value>
</data>
</root>
\ No newline at end of file
......@@ -39,12 +39,13 @@ using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
using TUGraz.VectoCore.Models.Declaration;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
public class JSONComponentInputData : IEngineeringInputDataProvider, IDeclarationInputDataProvider,
IEngineeringJobInputData, IVehicleEngineeringInputData
IEngineeringJobInputData, IVehicleEngineeringInputData, IAdvancedDriverAssistantSystemDeclarationInputData
{
protected IGearboxEngineeringInputData Gearbox;
protected IAxleGearInputData AxleGear;
......@@ -148,6 +149,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return ""; }
}
public bool ExemptedVehicle { get { return false; } }
public string VIN
{
get { return VehicleData.VIN; }
......@@ -299,6 +302,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return PTOTransmission; }
}
public bool VocationalVehicle { get { return DeclarationData.Vehicle.VocationalVehicleDefault; } }
public bool SleeperCab { get { return DeclarationData.Vehicle.SleeperCabDefault; } }
public NgTankSystem TankSystem { get { return DeclarationData.Vehicle.NgTankSystemDefault; } }
public IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get { return this; } }
public bool ZeroEmissionVehicle { get { return DeclarationData.Vehicle.ZeroEmissionVehicleDefault; } }
public bool HybridElectricHDV { get { return DeclarationData.Vehicle.HybridElectricHDVDefault; } }
public bool DualFuelVehicle { get { return DeclarationData.Vehicle.DualFuelVehicleDefault; } }
public Watt MaxNetPower1 { get { return null; } }
public Watt MaxNetPower2 { get { return null; } }
IAuxiliariesEngineeringInputData IVehicleEngineeringInputData.AuxiliaryInputData()
{
throw new NotImplementedException();
......@@ -313,5 +326,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
get { return PTOTransmission; }
}
#region Implementation of IAdvancedDriverAssistantSystemDeclarationInputData
public bool EngineStopStart { get { return DeclarationData.Vehicle.ADAS.EngineStopStartDefault; } }
public bool EcoRollWitoutEngineStop { get { return DeclarationData.Vehicle.ADAS.EcoRollWitoutEngineStop; } }
public bool EcoRollWithEngineStop { get { return DeclarationData.Vehicle.ADAS.EcoRollWithEngineStop; } }
public PredictiveCruiseControlType PredictiveCruiseControl { get {
return DeclarationData.Vehicle.ADAS.PredictiveCruiseControlDefault;
} }
#endregion
}
}
......@@ -39,11 +39,12 @@ using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.Impl;
using TUGraz.VectoCore.Models.Declaration;
namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
public class JSONVehicleDataV7 : JSONFile, IVehicleEngineeringInputData, IRetarderInputData, IAngledriveInputData,
IPTOTransmissionInputData, IAirdragEngineeringInputData
IPTOTransmissionInputData, IAirdragEngineeringInputData, IAdvancedDriverAssistantSystemDeclarationInputData
{
public JSONVehicleDataV7(JObject data, string fileName, IJSONVehicleComponents job, bool tolerateMissing = false)
: base(data, fileName, tolerateMissing)
......@@ -55,6 +56,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
#region IVehicleInputData
public bool ExemptedVehicle { get { return false; } }
public string VIN
{
get { return "N.A."; }
......@@ -253,6 +256,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get { return this; }
}
public bool VocationalVehicle { get { return DeclarationData.Vehicle.VocationalVehicleDefault; } }
public bool SleeperCab { get { return DeclarationData.Vehicle.SleeperCabDefault; } }
public NgTankSystem TankSystem { get { return DeclarationData.Vehicle.NgTankSystemDefault; } }
public IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get { return this; } }
public bool ZeroEmissionVehicle { get { return DeclarationData.Vehicle.ZeroEmissionVehicleDefault; } }
public bool HybridElectricHDV { get { return DeclarationData.Vehicle.HybridElectricHDVDefault; } }
public bool DualFuelVehicle { get { return DeclarationData.Vehicle.DualFuelVehicleDefault; } }
public Watt MaxNetPower1 { get { return null; } }
public Watt MaxNetPower2 { get { return null; } }
IAuxiliariesEngineeringInputData IVehicleEngineeringInputData.AuxiliaryInputData()
{
return Job.EngineeringAuxiliaries;
......@@ -490,5 +510,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
{
get { return null; }
}
#region Implementation of IAdvancedDriverAssistantSystemDeclarationInputData
public bool EngineStopStart { get { return DeclarationData.Vehicle.ADAS.EngineStopStartDefault; } }
public bool EcoRollWitoutEngineStop { get { return DeclarationData.Vehicle.ADAS.EcoRollWitoutEngineStop; } }
public bool EcoRollWithEngineStop { get { return DeclarationData.Vehicle.ADAS.EcoRollWithEngineStop; } }
public PredictiveCruiseControlType PredictiveCruiseControl { get {
return DeclarationData.Vehicle.ADAS.PredictiveCruiseControlDefault;
} }
#endregion
}
}
......@@ -44,7 +44,7 @@ using TUGraz.VectoCore.Models.Declaration;
namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
{
public class XMLDeclarationVehicleDataProvider : AbstractDeclarationXMLComponentDataProvider,
IVehicleDeclarationInputData, IPTOTransmissionInputData
IVehicleDeclarationInputData, IPTOTransmissionInputData, IAdvancedDriverAssistantSystemDeclarationInputData
{
private readonly IAuxiliariesDeclarationInputData XMLAuxiliaryData;
......@@ -62,6 +62,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
XMLAuxiliaryData = new XMLDeclarationAuxiliaryDataProvider(xmlInputDataProvider);
}
public bool ExemptedVehicle
{
get { return ElementExists(XMLNames.Vehicle_HybridElectricHDV) && ElementExists(XMLNames.Vehicle_DualFuelVehicle); }
}
public string VIN
{
get { return GetElementValue(XMLNames.Vehicle_VIN); }
......@@ -249,5 +254,79 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
{
get { return this; }
}
public bool VocationalVehicle { get {
return ElementExists(XMLNames.Vehicle_VocationalVehicle)
? XmlConvert.ToBoolean(GetElementValue(XMLNames.Vehicle_VocationalVehicle))
: DeclarationData.Vehicle.VocationalVehicleDefault;
} }
public bool SleeperCab { get {
return ElementExists(XMLNames.Vehicle_SleeperCab)
? XmlConvert.ToBoolean(GetElementValue(XMLNames.Vehicle_SleeperCab))
: DeclarationData.Vehicle.SleeperCabDefault;
} }
public NgTankSystem TankSystem { get {
return ElementExists(XMLNames.Vehicle_NgTankSystem)
? EnumHelper.ParseEnum<NgTankSystem>(GetElementValue(XMLNames.Vehicle_NgTankSystem))
: DeclarationData.Vehicle.NgTankSystemDefault;
} }
public IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get { return this; } }
public bool ZeroEmissionVehicle { get {
return ElementExists(XMLNames.Vehicle_ZeroEmissionVehicle)
? XmlConvert.ToBoolean(GetElementValue(XMLNames.Vehicle_ZeroEmissionVehicle))
: DeclarationData.Vehicle.ZeroEmissionVehicleDefault;
} }
public bool HybridElectricHDV { get {
return ElementExists(XMLNames.Vehicle_HybridElectricHDV)
? XmlConvert.ToBoolean(GetElementValue(XMLNames.Vehicle_HybridElectricHDV))
: DeclarationData.Vehicle.HybridElectricHDVDefault;
} }
public bool DualFuelVehicle { get {
return ElementExists(XMLNames.Vehicle_DualFuelVehicle)
? XmlConvert.ToBoolean(GetElementValue(XMLNames.Vehicle_DualFuelVehicle))
: DeclarationData.Vehicle.DualFuelVehicleDefault;
} }
public Watt MaxNetPower1 { get {
return ElementExists(XMLNames.Vehicle_MaxNetPower1)
? GetDoubleElementValue(XMLNames.Vehicle_MaxNetPower1).SI<Watt>()
: null;
} }
public Watt MaxNetPower2 { get {
return ElementExists(XMLNames.Vehicle_MaxNetPower2)
? GetDoubleElementValue(XMLNames.Vehicle_MaxNetPower2).SI<Watt>()
: null;
} }
#region Implementation of IAdvancedDriverAssistantSystemDeclarationInputData
public bool EngineStopStart { get {
return ElementExists(XMLNames.Vehicle_ADAS)
? XmlConvert.ToBoolean(GetElementValue(Helper.Query(XMLNames.Vehicle_ADAS, XMLNames.Vehicle_ADAS_EngineStopStart)))
: DeclarationData.Vehicle.ADAS.EngineStopStartDefault;
} }
public bool EcoRollWitoutEngineStop { get {
return ElementExists(XMLNames.Vehicle_ADAS)
? XmlConvert.ToBoolean(GetElementValue(Helper.Query(XMLNames.Vehicle_ADAS, XMLNames.Vehicle_ADAS_EcoRollWithoutEngineStop)))
: DeclarationData.Vehicle.ADAS.EcoRollWitoutEngineStop;
} }
public bool EcoRollWithEngineStop { get {
return ElementExists(XMLNames.Vehicle_ADAS)
? XmlConvert.ToBoolean(GetElementValue(Helper.Query(XMLNames.Vehicle_ADAS, XMLNames.Vehicle_ADAS_EcoRollWithEngineStopStart)))
: DeclarationData.Vehicle.ADAS.EcoRollWithEngineStop;
} }
public PredictiveCruiseControlType PredictiveCruiseControl
{
get {
return ElementExists(XMLNames.Vehicle_ADAS)
? PredictiveCruiseControlTypeHelper.Parse(
GetElementValue(Helper.Query(XMLNames.Vehicle_ADAS, XMLNames.Vehicle_ADAS_PCC)))
: DeclarationData.Vehicle.ADAS.PredictiveCruiseControlDefault;
}
}
#endregion
}
}
......@@ -75,6 +75,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering
get { return GetAttributeValue("", XMLNames.Component_ID_Attr); }
}
public bool ExemptedVehicle { get { return false; } }
public string VIN
{
get { return GetElementValue(XMLNames.Vehicle_VIN); }
......@@ -289,6 +291,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering
public IRetarderInputData RetarderInputData { get; private set; }
public IPTOTransmissionInputData PTOTransmissionInputData { get; private set; }
public bool VocationalVehicle { get { return false; } }
public bool SleeperCab { get { return true; } }
public NgTankSystem TankSystem { get; }
public IAdvancedDriverAssistantSystemDeclarationInputData ADAS { get { return null; } }
public bool ZeroEmissionVehicle { get { return false; } }
public bool HybridElectricHDV { get { return false; } }
public bool DualFuelVehicle { get { return false; } }
public Watt MaxNetPower1 { get { return null; } }
public Watt MaxNetPower2 { get { return null; } }
#region "FactoryMethods"
......
......@@ -528,5 +528,21 @@ namespace TUGraz.VectoCore.Models.Declaration
public static readonly SpecificFuelConsumption UpperFCThreshold = 600.SI(Unit.SI.Gramm.Per.Kilo.Watt.Hour).Cast<SpecificFuelConsumption>();
public static readonly Second FCAccumulationWindow = 10.SI(Unit.SI.Minute).Cast<Second>();
}
public static class Vehicle {
public const bool DualFuelVehicleDefault = false;
public const bool HybridElectricHDVDefault = false;
public const bool ZeroEmissionVehicleDefault = false;
public const NgTankSystem NgTankSystemDefault = NgTankSystem.Compressed;
public const bool SleeperCabDefault = true;
public const bool VocationalVehicleDefault = false;
public static class ADAS {
public const PredictiveCruiseControlType PredictiveCruiseControlDefault = PredictiveCruiseControlType.None;
public const bool EcoRollWithEngineStop = false;
public const bool EcoRollWitoutEngineStop = false;
public const bool EngineStopStartDefault = false;
}
}
}
}
\ No newline at end of file
......@@ -869,7 +869,7 @@
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="VehicleBaseType">
<xs:complexType name="VehicleDeclarationType">
<xs:complexContent>
<xs:extension base="tns:DeclarationPowertrainComponentType">
<xs:sequence>
......@@ -908,7 +908,7 @@
<xs:documentation>P036 - enum</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AxleConfiguration" type="tns:VehicleAxleConfigurationDeclarationType">
<xs:element name="AxleConfiguration" type="tns:VehicleAxleConfigurationDeclarationType" minOccurs="0">
<xs:annotation>
<xs:documentation>P037 - enum</xs:documentation>
</xs:annotation>
......@@ -923,6 +923,8 @@
<xs:documentation>P041 - [kg]</xs:documentation>
</xs:annotation>
</xs:element>
<xs:choice>
<xs:sequence>
<xs:element name="IdlingSpeed" type="tns:EngineDeclaredSpeedType">
<xs:annotation>
<xs:documentation>P198 - [1/min]</xs:documentation>
......@@ -959,13 +961,57 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:sequence minOccurs="0">
<xs:element name="ZeroEmissionVehicle" type="xs:boolean">
<xs:annotation>
<xs:documentation>P269 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="VocationalVehicle" type="xs:boolean">
<xs:annotation>
<xs:documentation>P270 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="NgTankSystem" type="tns:NgTankSystemType" minOccurs="0">
<xs:annotation>
<xs:documentation>P275 - enum</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SleeperCab" type="xs:boolean">
<xs:annotation>
<xs:documentation>P276 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ADAS">
<xs:complexType>
<xs:sequence>
<xs:element name="EngineStopStart" type="xs:boolean">
<xs:annotation>
<xs:documentation>P271 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EcoRollWithoutEngineStop" type="xs:boolean">
<xs:annotation>
<xs:documentation>P272 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EcoRollWithEngineStop" type="xs:boolean">
<xs:annotation>
<xs:documentation>P273 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PredictiveCruiseControl">
<xs:annotation>
<xs:documentation>P274 - enum</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="tns:PredictiveCruiseControlType"/>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="VehicleDeclarationType">
<xs:complexContent>
<xs:extension base="tns:VehicleBaseType">
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element name="TorqueLimits" type="tns:TorqueLimitsType" minOccurs="0"/>
<xs:element name="Components">
......@@ -983,6 +1029,36 @@
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:sequence>
<xs:sequence>
<xs:element name="ZeroEmissionVehicle" type="xs:boolean">
<xs:annotation>
<xs:documentation>P269 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MaxNetPower1" minOccurs="0">
<xs:annotation>
<xs:documentation>P277 - [W]</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MaxNetPower2" minOccurs="0">
<xs:annotation>
<xs:documentation>P278 - [W]</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="HybridElectricHDV" type="xs:boolean">
<xs:annotation>
<xs:documentation>P279 - bool</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="DualFuelVehicle" type="xs:boolean">
<xs:annotation>
<xs:documentation>P280 - bool</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:choice>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
......@@ -1734,6 +1810,12 @@ ToDo: -0.00
<xs:enumeration value="Ethanol PI"/>
<xs:enumeration value="LPG"/>
<xs:enumeration value="NG"/>
<xs:enumeration value="LPG PI"/>
<xs:enumeration value="NG PI"/>
<xs:enumeration value="NG CI"/>
<!-- == LPG PI -->
<!-- == NG PI -->
<!-- dual fuel -->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="GearboxCertificationOptionType">
......@@ -2382,6 +2464,7 @@ ToDo: -0.00
<xs:restriction base="tns:VehicleCategoryType">
<xs:enumeration value="Rigid Truck"/>
<xs:enumeration value="Tractor"/>
<xs:enumeration value="Rigid Lorry"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="VehicleCategoryType">
......@@ -2400,6 +2483,7 @@ ToDo: -0.00
<xs:enumeration value="City Bus"/>
<xs:enumeration value="Interurban Bus"/>
<xs:enumeration value="Coach"/>
<xs:enumeration value="Rigid Lorry"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="VehicleCurbMassChassisType">
......@@ -2462,4 +2546,17 @@ ToDo: -0.00
<xs:enumeration value="Multipurpose - Diagonal"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="NgTankSystemType">
<xs:restriction base="xs:string">
<xs:enumeration value="Compressed"/>
<xs:enumeration value="Liquefied"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="PredictiveCruiseControlType">
<xs:restriction base="xs:string">
<xs:enumeration value="none"/>
<xs:enumeration value="1,2"/>
<xs:enumeration value="1,2,3"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
......@@ -3,7 +3,7 @@
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0"
xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0 https://webgate.ec.europa.eu/CITnet/svn/VECTO/trunk/Share/XML/XSD/VectoInput.xsd"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0 E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoInput.xsd"
xmlns:di="http://www.w3.org/2000/09/xmldsig#">
<Vehicle id="VEH-1234567890">
<Manufacturer>Generic Truck Manufacturer</Manufacturer>
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0"
xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0 E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoInput.xsd"
xmlns:di="http://www.w3.org/2000/09/xmldsig#">
<Vehicle id="VEH-1234567890">
<Manufacturer>Generic Truck Manufacturer</Manufacturer>
<ManufacturerAddress>Street, ZIP City</ManufacturerAddress>
<Model>Generic Model</Model>
<VIN>VEH-1234567890</VIN>
<Date>2017-02-15T11:00:00Z</Date>
<LegislativeClass>N3</LegislativeClass>
<VehicleCategory>Tractor</VehicleCategory>
<CurbMassChassis>7100</CurbMassChassis>
<GrossVehicleMass>40000</GrossVehicleMass>
<ZeroEmissionVehicle>true</ZeroEmissionVehicle>
<MaxNetPower1>30000</MaxNetPower1>
<MaxNetPower2>20000</MaxNetPower2>
<HybridElectricHDV>true</HybridElectricHDV>
<DualFuelVehicle>true</DualFuelVehicle>
</Vehicle>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -2733,6 +2733,12 @@
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_engine-sample.xml" />
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_gearbox-sample.xml" />
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_vehicle-sample_exempted.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_vehicle-sample_FULL_updated.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_vehicle-sample_torqueLimits.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
......@@ -51,6 +51,7 @@ using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.Tests.Utils;
using TUGraz.VectoCore.Utils;
using NUnit.Framework;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter;
namespace TUGraz.VectoCore.Tests.XML
......@@ -61,6 +62,8 @@ namespace TUGraz.VectoCore.Tests.XML
const string SampleVehicleDecl = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample.xml";
const string SampleVehicleDeclNoAirdrag = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_noAirdrag.xml";
const string SampleVehicleFullDecl = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_FULL.xml";
const string SampleVehicleFullDeclUpdated = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_FULL_updated.xml";
const string SampleVehicleFullDeclExempted = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_exempted.xml";
const string SampleVehicleFullDeclCertificationOptions =
"TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_certificationOptions.xml";
......@@ -894,6 +897,93 @@ namespace TUGraz.VectoCore.Tests.XML
DeclarationData.HeatingVentilationAirConditioning);
}
[TestCase(SampleVehicleDecl, false),
TestCase(SampleVehicleFullDecl, false),
TestCase(SampleVehicleFullDeclUpdated, false),
TestCase(SampleVehicleFullDeclExempted, true)]
public void TestReadingExemptedVehicles(string file, bool expectedExempted)
{
var reader = XmlReader.Create(file);
var inputDataProvider = new XMLDeclarationInputDataProvider(reader, true);
var vehicle = inputDataProvider.JobInputData.Vehicle;
Assert.AreEqual(expectedExempted, vehicle.ExemptedVehicle);
}
[TestCase(SampleVehicleFullDeclExempted, true, true, true, 30000, 20000)]
public void TestReadingExemptedParameters(
string file, bool dualfuel, bool elHDV, bool zeroEmission, double maxNetPower1, double maxNetPower2)
{
var reader = XmlReader.Create(file);
var inputDataProvider = new XMLDeclarationInputDataProvider(reader, true);
var vehicle = inputDataProvider.JobInputData.Vehicle;
Assert.IsTrue(vehicle.ExemptedVehicle);
Assert.AreEqual(elHDV, vehicle.HybridElectricHDV);
Assert.AreEqual(zeroEmission, vehicle.ZeroEmissionVehicle);
Assert.AreEqual(dualfuel, vehicle.DualFuelVehicle);
Assert.AreEqual(maxNetPower1, vehicle.MaxNetPower1.Value());
Assert.AreEqual(maxNetPower2, vehicle.MaxNetPower2.Value());
}
[TestCase(SampleVehicleFullDeclUpdated, true, false, true)]
public void TestReadingNewVehicleParameters(string file, bool vocational, bool sleeperCab, bool zeroEmission)
{
var reader = XmlReader.Create(file);
var inputDataProvider = new XMLDeclarationInputDataProvider(reader, true);
var vehicle = inputDataProvider.JobInputData.Vehicle;
Assert.IsFalse(vehicle.ExemptedVehicle);
Assert.AreEqual(vocational, vehicle.VocationalVehicle);
Assert.AreEqual(sleeperCab, vehicle.SleeperCab);
Assert.AreEqual(zeroEmission, vehicle.ZeroEmissionVehicle);
}
[TestCase(SampleVehicleDecl, false, false, false, PredictiveCruiseControlType.None),
TestCase(SampleVehicleFullDeclUpdated, true, true, true, PredictiveCruiseControlType.Option_1_2)]
public void TestReadingAdasParameters(
string file, bool engineStopStart, bool ecoRollWithout, bool ecoRollWith, PredictiveCruiseControlType pcc)
{
var reader = XmlReader.Create(file);
var inputDataProvider = new XMLDeclarationInputDataProvider(reader, true);
var vehicle = inputDataProvider.JobInputData.Vehicle;
var adas = vehicle.ADAS;
Assert.IsFalse(vehicle.ExemptedVehicle);
Assert.AreEqual(engineStopStart, adas.EngineStopStart);
Assert.AreEqual(ecoRollWith, adas.EcoRollWithEngineStop);
Assert.AreEqual(ecoRollWithout, adas.EcoRollWitoutEngineStop);
Assert.AreEqual(pcc, adas.PredictiveCruiseControl);
}
[TestCase(SampleVehicleDecl)]
public void TestDefaultValuesNewParameters(string file)
{
var reader = XmlReader.Create(file);
var inputDataProvider = new XMLDeclarationInputDataProvider(reader, true);
var vehicle = inputDataProvider.JobInputData.Vehicle;
var adas = vehicle.ADAS;
Assert.IsFalse(vehicle.ExemptedVehicle);
Assert.AreEqual(false, vehicle.ZeroEmissionVehicle);
Assert.AreEqual(false, vehicle.VocationalVehicle);
Assert.AreEqual(true, vehicle.SleeperCab);
Assert.AreEqual(NgTankSystem.Compressed, vehicle.TankSystem);
Assert.AreEqual(false, adas.EngineStopStart);
Assert.AreEqual(false, adas.EcoRollWitoutEngineStop);
Assert.AreEqual(false, adas.EcoRollWithEngineStop);
Assert.AreEqual(PredictiveCruiseControlType.None, adas.PredictiveCruiseControl);
}
public static string[] GetEnumOptions(string xmlType, string schemaVersion)
{
Stream resource;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment