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

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

Merge pull request #641 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:bugfix/VECTO-713-missing-fields-in-mrf to master

* commit 'b60a0c9a':
  adding missing fields to MRF: vehicle model, name and address of manufacturer; torque limits in percent new testcase adapting output schema
parents d4eb34b2 b60a0c9a
Branches
Tags
No related merge requests found
/*
* This file is part of VECTO.
*
* Copyright © 2012-2017 European Union
*
* Developed by Graz University of Technology,
* Institute of Internal Combustion Engines and Thermodynamics,
* Institute of Technical Informatics
*
* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use VECTO except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/community/eupl/og_page/eupl
*
* Unless required by applicable law or agreed to in writing, VECTO
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* Authors:
* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
...@@ -2025,6 +1995,15 @@ namespace TUGraz.VectoCommon.Resources { ...@@ -2025,6 +1995,15 @@ namespace TUGraz.VectoCommon.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Nm.
/// </summary>
public static string Unit_Nm {
get {
return ResourceManager.GetString("Unit_Nm", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to rpm. /// Looks up a localized string similar to rpm.
/// </summary> /// </summary>
...@@ -2043,6 +2022,15 @@ namespace TUGraz.VectoCommon.Resources { ...@@ -2043,6 +2022,15 @@ namespace TUGraz.VectoCommon.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to %.
/// </summary>
public static string UnitPercent {
get {
return ResourceManager.GetString("UnitPercent", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to VectoComponentEngineering. /// Looks up a localized string similar to VectoComponentEngineering.
/// </summary> /// </summary>
...@@ -2555,5 +2543,23 @@ namespace TUGraz.VectoCommon.Resources { ...@@ -2555,5 +2543,23 @@ namespace TUGraz.VectoCommon.Resources {
return ResourceManager.GetString("Vehicle_VIN", resourceCulture); return ResourceManager.GetString("Vehicle_VIN", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to torqueLimit.
/// </summary>
public static string XMLManufacturerReport_torqueLimit {
get {
return ResourceManager.GetString("XMLManufacturerReport_torqueLimit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to torqueLimitPercent.
/// </summary>
public static string XMLManufacturerReport_torqueLimitPercent {
get {
return ResourceManager.GetString("XMLManufacturerReport_torqueLimitPercent", resourceCulture);
}
}
} }
} }
...@@ -939,4 +939,16 @@ ...@@ -939,4 +939,16 @@
<data name="Unit_ltr" xml:space="preserve"> <data name="Unit_ltr" xml:space="preserve">
<value>ltr</value> <value>ltr</value>
</data> </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> </root>
\ No newline at end of file
...@@ -75,6 +75,9 @@ namespace TUGraz.VectoCore.OutputData.XML ...@@ -75,6 +75,9 @@ namespace TUGraz.VectoCore.OutputData.XML
public void Initialize(VectoRunData modelData) public void Initialize(VectoRunData modelData)
{ {
VehiclePart.Add( 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_VIN, modelData.VehicleData.VIN),
new XElement(tns + XMLNames.Vehicle_LegislativeClass, modelData.VehicleData.LegislativeClass.ToXMLFormat()), new XElement(tns + XMLNames.Vehicle_LegislativeClass, modelData.VehicleData.LegislativeClass.ToXMLFormat()),
new XElement(tns + XMLNames.Report_Vehicle_VehicleGroup, modelData.VehicleData.VehicleClass.GetClassNumber()), new XElement(tns + XMLNames.Report_Vehicle_VehicleGroup, modelData.VehicleData.VehicleClass.GetClassNumber()),
...@@ -114,10 +117,17 @@ namespace TUGraz.VectoCore.OutputData.XML ...@@ -114,10 +117,17 @@ namespace TUGraz.VectoCore.OutputData.XML
var maxTorque = modelData.FullLoadCurves[0].MaxTorque; var maxTorque = modelData.FullLoadCurves[0].MaxTorque;
for (uint i = 1; i < modelData.FullLoadCurves.Count; i++) { for (uint i = 1; i < modelData.FullLoadCurves.Count; i++) {
if (!maxTorque.IsEqual(modelData.FullLoadCurves[i].MaxTorque, 1e-3.SI<NewtonMeter>())) { if (!maxTorque.IsEqual(modelData.FullLoadCurves[i].MaxTorque, 1e-3.SI<NewtonMeter>())) {
limits.Add(new XElement(tns + XMLNames.Vehicle_TorqueLimits_Entry, limits.Add(
new XElement(
tns + XMLNames.Vehicle_TorqueLimits_Entry,
new XAttribute(XMLNames.Vehicle_TorqueLimits_Entry_Gear_Attr, i), new XAttribute(XMLNames.Vehicle_TorqueLimits_Entry_Gear_Attr, i),
new XAttribute(XMLNames.Vehicle_TorqueLimits_Entry_MaxTorque_Attr, new XAttribute(
modelData.FullLoadCurves[i].MaxTorque.ToXMLFormat(0)))); 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 @@ ...@@ -358,10 +358,31 @@
<xs:documentation>P197 / P194</xs:documentation> <xs:documentation>P197 / P194</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </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>
<xs:complexType name="TorqueLimitsType"> <xs:complexType name="TorqueLimitsType">
<xs:sequence> <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:sequence>
</xs:complexType> </xs:complexType>
<xs:complexType name="VectoOutputDataType"> <xs:complexType name="VectoOutputDataType">
...@@ -495,6 +516,9 @@ ...@@ -495,6 +516,9 @@
</xs:complexType> </xs:complexType>
<xs:complexType name="VehicleType"> <xs:complexType name="VehicleType">
<xs:sequence> <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:element name="VIN">
<xs:annotation> <xs:annotation>
<xs:documentation>P238</xs:documentation> <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 @@ ...@@ -2721,6 +2721,9 @@
</Content> </Content>
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_engine-sample.xml" /> <Content Include="TestData\XML\XMLReaderDeclaration\vecto_engine-sample.xml" />
<Content Include="TestData\XML\XMLReaderDeclaration\vecto_gearbox-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"> <Content Include="TestData\XML\XMLReaderDeclaration\vecto_vehicle-sample_AT.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
......
...@@ -46,6 +46,7 @@ namespace TUGraz.VectoCore.Tests.XML ...@@ -46,6 +46,7 @@ namespace TUGraz.VectoCore.Tests.XML
public class XMLReportTest public class XMLReportTest
{ {
const string SampleVehicleDecl = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample.xml"; 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"; const string SampleVehicleDeclAT = "TestData/XML/XMLReaderDeclaration/vecto_vehicle-sample_AT.xml";
...@@ -56,6 +57,7 @@ namespace TUGraz.VectoCore.Tests.XML ...@@ -56,6 +57,7 @@ namespace TUGraz.VectoCore.Tests.XML
} }
[TestCase(SampleVehicleDecl), [TestCase(SampleVehicleDecl),
TestCase(SampleVehicleDeclTqLimits),
TestCase(SampleVehicleDeclAT)] TestCase(SampleVehicleDeclAT)]
public void RunDeclarationJob(string filename) public void RunDeclarationJob(string filename)
{ {
...@@ -77,10 +79,10 @@ namespace TUGraz.VectoCore.Tests.XML ...@@ -77,10 +79,10 @@ namespace TUGraz.VectoCore.Tests.XML
var manufacturerRecord = fileWriter.XMLFullReportName; var manufacturerRecord = fileWriter.XMLFullReportName;
var validator1 = new XMLValidator(XmlReader.Create(customerRecord)); 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)); 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.
Please register or to comment