diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 3d515a4b8ec3e8b6fd1a95f55382d5ad2c96b3bd..c7252cc8ec66a50cad65a5ff881522dd204ff9b8 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -288,6 +288,11 @@ namespace TUGraz.VectoCommon.InputData default: throw new ArgumentOutOfRangeException(nameof(ecoRoll), ecoRoll, null); } } + + public static string ToXMLFormat(this EcoRollType ecoRoll) + { + return GetName(ecoRoll).ToLowerInvariant(); + } } public enum TankSystem diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs index ce02aa990aa8f1280e6503aa647f902b607fd12f..437a42f6367d9fc742f1ebf4d3d3c52aa59a7bdf 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs +++ b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs @@ -2472,6 +2472,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to EcoRoll. + /// </summary> + public static string Vehicle_ADAS_EcoRoll { + get { + return ResourceManager.GetString("Vehicle_ADAS_EcoRoll", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to EcoRollWithEngineStop. /// </summary> diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.resx b/VectoCommon/VectoCommon/Resources/XMLNames.resx index 60c69fa80335c79c6b3fef30a8736dde37908459..41fb2b04a85e84b5b3ca9f8de367501161935d46 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.resx +++ b/VectoCommon/VectoCommon/Resources/XMLNames.resx @@ -1104,4 +1104,7 @@ <data name="Engine_WHRType" xml:space="preserve"> <value>WHRType</value> </data> + <data name="Vehicle_ADAS_EcoRoll" xml:space="preserve"> + <value>EcoRoll</value> + </data> </root> \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index ccca196d8fbd03704aaf1611a71412ef1e5fe3a3..2efaddd96759ec6282c767803382953568b9dc6f 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -81,7 +81,13 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter private VehicleData.ADASData CreateADAS(IAdvancedDriverAssistantSystemsEngineering adas) { - return new VehicleData.ADASData { + return adas == null ? + new VehicleData.ADASData() { + EngineStopStart = false, + EcoRoll = EcoRollType.None, + PredictiveCruiseControl = PredictiveCruiseControlType.None + }: + new VehicleData.ADASData { EngineStopStart = adas.EngineStopStart, EcoRoll = adas.EcoRoll, PredictiveCruiseControl = adas.PredictiveCruiseControl diff --git a/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringADASWriterV10.cs b/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringADASWriterV10.cs index 406041579b55020111dcd4a89f435b2c9c11f9b6..50323733ca7d30c88d4fec9aa7c4dfb14b46ac88 100644 --- a/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringADASWriterV10.cs +++ b/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringADASWriterV10.cs @@ -1,5 +1,6 @@ using System.Xml.Linq; using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.OutputData.XML.Engineering.Interfaces; using TUGraz.VectoCore.Utils; @@ -20,8 +21,12 @@ namespace TUGraz.VectoCore.OutputData.XML.Engineering.Writer { if (adas == null) { return null; } - // todo: write different ADAS options - return null; + + var ns = ComponentDataNamespace; + return new object[] { new XElement(ns + XMLNames.Vehicle_AdvancedDriverAssist, + new XElement(ns + XMLNames.Vehicle_ADAS_EngineStopStart, adas.EngineStopStart), + new XElement(ns + XMLNames.Vehicle_ADAS_EcoRoll, adas.EcoRoll.ToXMLFormat()), + new XElement(ns + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat()))}; } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringVehicleDataWriter.cs b/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringVehicleDataWriter.cs index bf18416897062c5c4c2ba7669dc7d1a446c98c78..1bb5f282e0bf94d28ce609191e2a90c2abb02dbc 100644 --- a/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringVehicleDataWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/Engineering/Writer/XMLEngineeringVehicleDataWriter.cs @@ -64,14 +64,11 @@ namespace TUGraz.VectoCore.OutputData.XML.Engineering.Writer CreateTorqueLimits(ns, vehicle), new XElement(ns + XMLNames.Vehicle_CurbMassExtra, vehicle.CurbMassExtra.Value()), new XElement(ns + XMLNames.Vehicle_Loading, vehicle.Loading.Value()), + Factory.GetWriter(vehicle.ADAS, Writer, vehicle.ADAS.DataSource).WriteXML(vehicle), new XElement( ns + XMLNames.Vehicle_Components, componentsWriter.WriteXML(vehicle) - ), - vehicle.ADAS == null ? null : - new XElement(ns + XMLNames.Vehicle_AdvancedDriverAssist, - Factory.GetWriter(vehicle.ADAS, Writer, vehicle.ADAS.DataSource).WriteXML(vehicle) - ), + ) }; return retVal; }