Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 63ae89e0 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

Minor change at xml component reader to make RetarderType and RetarderRatio...

Minor change at  xml component reader to make RetarderType and RetarderRatio accessible over components.RetarderInputData interface, change related test accordingly
parent 4430d9ad
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
using System.Xml;
using System.Xml.Linq;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader;
using TUGraz.VectoCore.Utils;
......@@ -234,7 +235,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
// ---------------------------------------------------------------------------------------
public class XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01 : XMLDeclarationComponentsDataProviderV10, IXMLVehicleComponentsDeclaration
public class XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01 : XMLDeclarationComponentsDataProviderV10, IXMLVehicleComponentsDeclaration,
IRetarderInputData
{
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01;
......@@ -244,13 +247,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
private IBusAuxiliariesDeclarationData _busAuxiliaries;
public XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode,
string sourceFile) : base(vehicle, componentNode, sourceFile) { }
public XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01(IXMLDeclarationVehicleData vehicle,
XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { }
IRetarderInputData IVehicleComponentsDeclaration.RetarderInputData
{
get { return null; }
get { return this; }
}
ITorqueConverterDeclarationInputData IVehicleComponentsDeclaration.TorqueConverterInputData
......@@ -277,5 +281,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
{
get { return NAMESPACE_URI; }
}
#region IRetarderInputData Interface Implementation
public RetarderType Type { get{ return _vehicle.RetarderType; }}
public double Ratio { get { return _vehicle.RetarderRatio; }}
public TableData LossMap { get; }
#endregion
}
}
\ No newline at end of file
......@@ -61,9 +61,9 @@ namespace TUGraz.VectoCore.Tests.XML
Assert.AreEqual(false, vehicle.Articulated);
Assert.AreEqual(25000, vehicle.GrossVehicleMassRating.Value());
Assert.AreEqual(600, vehicle.EngineIdleSpeed.Value());
Assert.AreEqual("Transmission Output Retarder", ((XMLDeclarationPrimaryVehicleBusDataProviderV01)vehicle).RetarderType.ToXMLFormat());
Assert.AreEqual(1.000, ((XMLDeclarationPrimaryVehicleBusDataProviderV01)vehicle).RetarderRatio);
Assert.AreEqual("None", ((XMLDeclarationPrimaryVehicleBusDataProviderV01)vehicle).AngledriveType.ToXMLFormat());
Assert.AreEqual("Transmission Output Retarder", vehicle.Components.RetarderInputData.Type.ToXMLFormat());
Assert.AreEqual(1.000, vehicle.Components.RetarderInputData.Ratio);
Assert.AreEqual("None", vehicle.Components.AngledriveInputData.Type.ToXMLFormat());
Assert.IsFalse(vehicle.ZeroEmissionVehicle);
Assert.IsFalse(vehicle.ADAS.EngineStopStart);
......@@ -89,7 +89,7 @@ namespace TUGraz.VectoCore.Tests.XML
TestAngledrive(components.AngledriveInputData);
Assert.IsNull(components.RetarderInputData);
TestRetarderInputData(components.RetarderInputData);
TestAxlegear(components.AxleGearInputData);
......@@ -199,6 +199,14 @@ namespace TUGraz.VectoCore.Tests.XML
Assert.That(() => angeldrive.Efficiency, Throws.TypeOf<VectoException>());
}
private void TestRetarderInputData(IRetarderInputData retarder)
{
Assert.IsNotNull(retarder);
Assert.IsNull(retarder.LossMap);
Assert.AreEqual("Transmission Output Retarder", retarder.Type.ToXMLFormat());
Assert.AreEqual(1.000, retarder.Ratio);
}
private void TestAxlegear(IAxleGearInputData axelGear)
{
Assert.AreEqual("Generic Gearbox Manufacturer", axelGear.Manufacturer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment