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

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

adding missing fields to MRF: vehicle model, name and address of manufacturer;...

adding missing fields to MRF: vehicle model, name and address of manufacturer; torque limits in percent
new testcase
adapting output schema
parent d4eb34b2
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -939,4 +939,16 @@
<data name="Unit_ltr" xml:space="preserve">
<value>ltr</value>
</data>
<data name="UnitPercent" xml:space="preserve">
<value>%</value>
</data>
<data name="Unit_Nm" xml:space="preserve">
<value>Nm</value>
</data>
<data name="XMLManufacturerReport_torqueLimit" xml:space="preserve">
<value>torqueLimit</value>
</data>
<data name="XMLManufacturerReport_torqueLimitPercent" xml:space="preserve">
<value>torqueLimitPercent</value>
</data>
</root>
\ No newline at end of file
......@@ -75,6 +75,9 @@ namespace TUGraz.VectoCore.OutputData.XML
public void Initialize(VectoRunData modelData)
{
VehiclePart.Add(
new XElement(tns + XMLNames.Component_Model, modelData.VehicleData.ModelName),
new XElement(tns + XMLNames.Component_Manufacturer, modelData.VehicleData.Manufacturer),
new XElement(tns + XMLNames.Component_ManufacturerAddress, modelData.VehicleData.ManufacturerAddress),
new XElement(tns + XMLNames.Vehicle_VIN, modelData.VehicleData.VIN),
new XElement(tns + XMLNames.Vehicle_LegislativeClass, modelData.VehicleData.LegislativeClass.ToXMLFormat()),
new XElement(tns + XMLNames.Report_Vehicle_VehicleGroup, modelData.VehicleData.VehicleClass.GetClassNumber()),
......@@ -114,10 +117,17 @@ namespace TUGraz.VectoCore.OutputData.XML
var maxTorque = modelData.FullLoadCurves[0].MaxTorque;
for (uint i = 1; i < modelData.FullLoadCurves.Count; i++) {
if (!maxTorque.IsEqual(modelData.FullLoadCurves[i].MaxTorque, 1e-3.SI<NewtonMeter>())) {
limits.Add(new XElement(tns + XMLNames.Vehicle_TorqueLimits_Entry,
new XAttribute(XMLNames.Vehicle_TorqueLimits_Entry_Gear_Attr, i),
new XAttribute(XMLNames.Vehicle_TorqueLimits_Entry_MaxTorque_Attr,
modelData.FullLoadCurves[i].MaxTorque.ToXMLFormat(0))));
limits.Add(
new XElement(
tns + XMLNames.Vehicle_TorqueLimits_Entry,
new XAttribute(XMLNames.Vehicle_TorqueLimits_Entry_Gear_Attr, i),
new XAttribute(
XMLNames.XMLManufacturerReport_torqueLimit,
modelData.FullLoadCurves[i].MaxTorque.ToXMLFormat(0)),
new XAttribute(XMLNames.Report_Results_Unit_Attr, XMLNames.Unit_Nm),
new XAttribute(
XMLNames.XMLManufacturerReport_torqueLimitPercent,
(modelData.FullLoadCurves[i].MaxTorque / maxTorque * 100).ToXMLFormat(1))));
}
}
......
......@@ -358,10 +358,31 @@
<xs:documentation>P197 / P194</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="unit" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Nm"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="torqueLimitPercent" use="required">
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="100.0"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TorqueLimitsType">
<xs:sequence>
<xs:element name="Entry" type="TorqueLimitsEntryType"/>
<xs:element name="Entry">
<xs:complexType>
<xs:complexContent>
<xs:extension base="TorqueLimitsEntryType"/>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="VectoOutputDataType">
......@@ -495,6 +516,9 @@
</xs:complexType>
<xs:complexType name="VehicleType">
<xs:sequence>
<xs:element name="Model" type="vdecdef:ModelType"/>
<xs:element name="Manufacturer" type="vdecdef:ManufacturerType"/>
<xs:element name="ManufacturerAddress" type="vdecdef:ManufacturerAddressType"/>
<xs:element name="VIN">
<xs:annotation>
<xs:documentation>P238</xs:documentation>
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -2721,6 +2721,9 @@
</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_torqueLimits.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_vehicle-sample_AT.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
......@@ -46,6 +46,7 @@ namespace TUGraz.VectoCore.Tests.XML
public class XMLReportTest
{
const string SampleVehicleDecl = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample.xml";
const string SampleVehicleDeclTqLimits = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_torqueLimits.xml";
const string SampleVehicleDeclAT = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_AT.xml";
......@@ -56,6 +57,7 @@ namespace TUGraz.VectoCore.Tests.XML
}
[TestCase(SampleVehicleDecl),
TestCase(SampleVehicleDeclTqLimits),
TestCase(SampleVehicleDeclAT)]
public void RunDeclarationJob(string filename)
{
......@@ -75,12 +77,12 @@ namespace TUGraz.VectoCore.Tests.XML
var customerRecord = fileWriter.XMLCustomerReportName;
var manufacturerRecord = fileWriter.XMLFullReportName;
var validator1 = new XMLValidator(XmlReader.Create(customerRecord));
Assert.IsTrue(validator1.ValidateXML(XMLValidator.XmlDocumentType.CustomerReport));
Assert.IsTrue(validator1.ValidateXML(XMLValidator.XmlDocumentType.CustomerReport), customerRecord);
var validator2 = new XMLValidator(XmlReader.Create(manufacturerRecord));
Assert.IsTrue(validator2.ValidateXML(XMLValidator.XmlDocumentType.ManufacturerReport));
Assert.IsTrue(validator2.ValidateXML(XMLValidator.XmlDocumentType.ManufacturerReport), manufacturerRecord);
}
}
}
\ No newline at end of file
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