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

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

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

Merge pull request #567 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:feature/VECTO-618-add-hash-value-of-tyres-to-manufacturer-s to develop

* commit 'c2355b51':
  Hashing Tool: include tyres in integrity checks
  read in digest value
  adding digest value of tyres to manufacturer report
  extend testcase to check for digest value of tyres
  adapt xml schema
parents d8e29361 c2355b51
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,6 @@ namespace HashingTool.ViewModel.UserControl ...@@ -103,7 +103,6 @@ namespace HashingTool.ViewModel.UserControl
if (entry.Component.StartsWith("Axle ")) { if (entry.Component.StartsWith("Axle ")) {
entry.Component = entry.Component.Replace("Axle", "Tyre"); entry.Component = entry.Component.Replace("Axle", "Tyre");
entry.CertificationNumber = ReadElementValue(node, XMLNames.Report_Tyre_TyreCertificationNumber); entry.CertificationNumber = ReadElementValue(node, XMLNames.Report_Tyre_TyreCertificationNumber);
entry.DigestValue = "Not Available";
} else { } else {
entry.CertificationNumber = ReadElementValue(node, XMLNames.Report_Component_CertificationNumber) ?? entry.CertificationNumber = ReadElementValue(node, XMLNames.Report_Component_CertificationNumber) ??
ReadElementValue(node, XMLNames.Report_Component_CertificationMethod); ReadElementValue(node, XMLNames.Report_Component_CertificationMethod);
...@@ -116,9 +115,7 @@ namespace HashingTool.ViewModel.UserControl ...@@ -116,9 +115,7 @@ namespace HashingTool.ViewModel.UserControl
if (!jobComponent.Any()) { if (!jobComponent.Any()) {
continue; continue;
} }
entry.DigestValueMatchesJobComponent = entry.Component.StartsWith("Tyre ") entry.DigestValueMatchesJobComponent = jobComponent.First().DigestValueComputed == entry.DigestValue;
? (bool?)null
: (jobComponent.First().DigestValueComputed == entry.DigestValue);
entry.DigestValueExpected = jobComponent.First().DigestValueComputed; entry.DigestValueExpected = jobComponent.First().DigestValueComputed;
if (entry.CertificationMethod == CertificationMethod.StandardValues.ToXMLFormat()) { if (entry.CertificationMethod == CertificationMethod.StandardValues.ToXMLFormat()) {
...@@ -134,9 +131,7 @@ namespace HashingTool.ViewModel.UserControl ...@@ -134,9 +131,7 @@ namespace HashingTool.ViewModel.UserControl
var certificationNumberMismatch = var certificationNumberMismatch =
componentData.Where( componentData.Where(
x => x.CertificationNumberMatchesJobComponent != null && !x.CertificationNumberMatchesJobComponent.Value).ToArray(); x => x.CertificationNumberMatchesJobComponent != null && !x.CertificationNumberMatchesJobComponent.Value).ToArray();
var digestMismatch = var digestMismatch = componentData.Where(x => x.DigestValueMatchesJobComponent == null || !x.DigestValueMatchesJobComponent.Value).ToArray();
componentData.Where(x => !x.Component.StartsWith("Tyre "))
.Where(x => x.DigestValueMatchesJobComponent == null || !x.DigestValueMatchesJobComponent.Value).ToArray();
if (jobComponents.Any()) { if (jobComponents.Any()) {
foreach (var entry in certificationNumberMismatch) { foreach (var entry in certificationNumberMismatch) {
_validationErrors.Add( _validationErrors.Add(
......
...@@ -29,100 +29,100 @@ ...@@ -29,100 +29,100 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/ */
using TUGraz.IVT.VectoXML; using TUGraz.IVT.VectoXML;
using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Resources;
using TUGraz.VectoCommon.Utils; using TUGraz.VectoCommon.Utils;
namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
{ {
public class XMLDeclarationEngineDataProvider : AbstractDeclarationXMLComponentDataProvider, public class XMLDeclarationEngineDataProvider : AbstractDeclarationXMLComponentDataProvider,
IEngineDeclarationInputData IEngineDeclarationInputData
{ {
public XMLDeclarationEngineDataProvider(XMLDeclarationInputDataProvider xmlInputDataProvider) public XMLDeclarationEngineDataProvider(XMLDeclarationInputDataProvider xmlInputDataProvider)
: base(xmlInputDataProvider) : base(xmlInputDataProvider)
{ {
XBasePath = Helper.Query(VehiclePath, XBasePath = Helper.Query(VehiclePath,
XMLNames.Vehicle_Components, XMLNames.Vehicle_Components,
XMLNames.Component_Engine, XMLNames.Component_Engine,
XMLNames.ComponentDataWrapper); XMLNames.ComponentDataWrapper);
} }
public CubicMeter Displacement public CubicMeter Displacement
{ {
get { return GetDoubleElementValue(XMLNames.Engine_Displacement).SI(Unit.SI.Cubic.Centi.Meter).Cast<CubicMeter>(); } get { return GetDoubleElementValue(XMLNames.Engine_Displacement).SI(Unit.SI.Cubic.Centi.Meter).Cast<CubicMeter>(); }
} }
public PerSecond IdleSpeed public PerSecond IdleSpeed
{ {
get { return GetDoubleElementValue(XMLNames.Engine_IdlingSpeed).RPMtoRad(); } get { return GetDoubleElementValue(XMLNames.Engine_IdlingSpeed).RPMtoRad(); }
} }
public FuelType FuelType public FuelType FuelType
{ {
get { return GetElementValue(XMLNames.Engine_FuelType).ParseEnum<FuelType>(); } get { return GetElementValue(XMLNames.Engine_FuelType).ParseEnum<FuelType>(); }
} }
public TableData FuelConsumptionMap public TableData FuelConsumptionMap
{ {
get { get {
return ReadTableData(AttributeMappings.FuelConsumptionMapMapping, return ReadTableData(AttributeMappings.FuelConsumptionMapMapping,
Helper.Query(XMLNames.Engine_FuelConsumptionMap, XMLNames.Engine_FuelConsumptionMap_Entry)); Helper.Query(XMLNames.Engine_FuelConsumptionMap, XMLNames.Engine_FuelConsumptionMap_Entry));
} }
} }
public TableData FullLoadCurve public TableData FullLoadCurve
{ {
get { get {
return ReadTableData(AttributeMappings.EngineFullLoadCurveMapping, return ReadTableData(AttributeMappings.EngineFullLoadCurveMapping,
Helper.Query(XMLNames.Engine_FullLoadAndDragCurve, XMLNames.Engine_FullLoadCurve_Entry)); Helper.Query(XMLNames.Engine_FullLoadAndDragCurve, XMLNames.Engine_FullLoadCurve_Entry));
} }
} }
public Watt RatedPowerDeclared public Watt RatedPowerDeclared
{ {
get { return GetDoubleElementValue(XMLNames.Engine_RatedPower).SI<Watt>(); } get { return GetDoubleElementValue(XMLNames.Engine_RatedPower).SI<Watt>(); }
} }
public PerSecond RatedSpeedDeclared public PerSecond RatedSpeedDeclared
{ {
get { return GetDoubleElementValue(XMLNames.Engine_RatedSpeed).RPMtoRad(); } get { return GetDoubleElementValue(XMLNames.Engine_RatedSpeed).RPMtoRad(); }
} }
public NewtonMeter MaxTorqueDeclared public NewtonMeter MaxTorqueDeclared
{ {
get { return GetDoubleElementValue(XMLNames.Engine_MaxTorque).SI<NewtonMeter>(); } get { return GetDoubleElementValue(XMLNames.Engine_MaxTorque).SI<NewtonMeter>(); }
} }
public double WHTCMotorway public double WHTCMotorway
{ {
get { return GetDoubleElementValue(XMLNames.Engine_WHTCMotorway); } get { return GetDoubleElementValue(XMLNames.Engine_WHTCMotorway); }
} }
public double WHTCRural public double WHTCRural
{ {
get { return GetDoubleElementValue(XMLNames.Engine_WHTCRural); } get { return GetDoubleElementValue(XMLNames.Engine_WHTCRural); }
} }
public double WHTCUrban public double WHTCUrban
{ {
get { return GetDoubleElementValue(XMLNames.Engine_WHTCUrban); } get { return GetDoubleElementValue(XMLNames.Engine_WHTCUrban); }
} }
public double ColdHotBalancingFactor public double ColdHotBalancingFactor
{ {
get { return GetDoubleElementValue(XMLNames.Engine_ColdHotBalancingFactor); } get { return GetDoubleElementValue(XMLNames.Engine_ColdHotBalancingFactor); }
} }
public double CorrectionFactorRegPer public double CorrectionFactorRegPer
{ {
get { return GetDoubleElementValue(XMLNames.Engine_CorrectionFactor_RegPer); } get { return GetDoubleElementValue(XMLNames.Engine_CorrectionFactor_RegPer); }
} }
public double CorrectionFactorNCV public double CorrectionFactorNCV
{ {
get { return GetDoubleElementValue(XMLNames.Engine_CorrecionFactor_NCV); } get { return GetDoubleElementValue(XMLNames.Engine_CorrecionFactor_NCV); }
} }
} }
} }
\ No newline at end of file
...@@ -139,6 +139,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration ...@@ -139,6 +139,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
var rollResistance = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.AxleWheels_Axles_Axle_RRCDeclared), Manager); var rollResistance = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.AxleWheels_Axles_Axle_RRCDeclared), Manager);
var tyreTestLoad = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.AxleWheels_Axles_Axle_FzISO), Manager); var tyreTestLoad = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.AxleWheels_Axles_Axle_FzISO), Manager);
var certirficationNumber = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.Component_CertificationNumber), Manager); var certirficationNumber = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.Component_CertificationNumber), Manager);
var digestValue = tyre.SelectSingleNode(Helper.Query("..//*[local-name()='DigestValue']"), Manager);
retVal[axleNumber - 1] = new AxleInputData { retVal[axleNumber - 1] = new AxleInputData {
AxleType = axleType == null ? AxleType.VehicleNonDriven : axleType.Value.ParseEnum<AxleType>(), AxleType = axleType == null ? AxleType.VehicleNonDriven : axleType.Value.ParseEnum<AxleType>(),
TwinTyres = twinTyres != null && XmlConvert.ToBoolean(twinTyres.Value), TwinTyres = twinTyres != null && XmlConvert.ToBoolean(twinTyres.Value),
...@@ -148,7 +149,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration ...@@ -148,7 +149,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
RollResistanceCoefficient = rollResistance == null ? double.NaN : rollResistance.Value.ToDouble(), RollResistanceCoefficient = rollResistance == null ? double.NaN : rollResistance.Value.ToDouble(),
Dimension = dimension == null ? null : dimension.Value, Dimension = dimension == null ? null : dimension.Value,
CertificationNumber = certirficationNumber == null ? null : certirficationNumber.Value, CertificationNumber = certirficationNumber == null ? null : certirficationNumber.Value,
CertificationMethod = CertificationMethod.Measured CertificationMethod = CertificationMethod.Measured,
DigestValue = digestValue == null ? "" : digestValue.Value
} }
}; };
} }
......
...@@ -119,7 +119,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter ...@@ -119,7 +119,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
RollResistanceCoefficient = axleInput.Tyre.RollResistanceCoefficient, RollResistanceCoefficient = axleInput.Tyre.RollResistanceCoefficient,
TyreTestLoad = axleInput.Tyre.TyreTestLoad, TyreTestLoad = axleInput.Tyre.TyreTestLoad,
Inertia = DeclarationData.Wheels.Lookup(axleInput.Tyre.Dimension.RemoveWhitespace()).Inertia, Inertia = DeclarationData.Wheels.Lookup(axleInput.Tyre.Dimension.RemoveWhitespace()).Inertia,
CertificationNumber = axleInput.Tyre.CertificationNumber CertificationNumber = axleInput.Tyre.CertificationNumber,
DigestValueInput = axleInput.Tyre.DigestValue,
}; };
axleData.Add(axle); axleData.Add(axle);
} }
......
...@@ -221,6 +221,7 @@ namespace TUGraz.VectoCore.OutputData.XML ...@@ -221,6 +221,7 @@ namespace TUGraz.VectoCore.OutputData.XML
new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, i), new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, i),
new XElement(tns + XMLNames.Report_Tyre_TyreDimension, axle.WheelsDimension), new XElement(tns + XMLNames.Report_Tyre_TyreDimension, axle.WheelsDimension),
new XElement(tns + XMLNames.Report_Tyre_TyreCertificationNumber, axle.CertificationNumber), new XElement(tns + XMLNames.Report_Tyre_TyreCertificationNumber, axle.CertificationNumber),
new XElement(tns+XMLNames.DI_Signature_Reference_DigestValue, axle.DigestValueInput),
new XElement(tns + XMLNames.Report_Tyre_TyreRRCDeclared, axle.RollResistanceCoefficient.ToXMLFormat(4)), new XElement(tns + XMLNames.Report_Tyre_TyreRRCDeclared, axle.RollResistanceCoefficient.ToXMLFormat(4)),
new XElement(tns + XMLNames.AxleWheels_Axles_Axle_TwinTyres, axle.TwinTyres)); new XElement(tns + XMLNames.AxleWheels_Axles_Axle_TwinTyres, axle.TwinTyres));
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2016 rel. 2 (x64) (http://www.altova.com) by Helmut Eichlseder (TU Graz/Inst. f. VKM und THD) --> <!-- edited with XMLSpy v2016 rel. 2 sp1 (x64) (http://www.altova.com) by Helmut Eichlseder (TU Graz/Inst. f. VKM und THD) -->
<!--W3C XML Schema generated by XMLSpy vXMLSpy Professional Edition v2016 rel. 2 (x64) (http://www.altova.com)--> <!--W3C XML Schema generated by XMLSpy vXMLSpy Professional Edition v2016 rel. 2 (x64) (http://www.altova.com)-->
<xs:schema xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vdecdef="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" targetNamespace="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.4"> <xs:schema xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vdecdef="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" targetNamespace="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.4">
<xs:import namespace="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" schemaLocation="VectoDeclarationDefinitions.1.0.xsd"/> <xs:import namespace="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" schemaLocation="VectoDeclarationDefinitions.1.0.xsd"/>
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
<xs:documentation>P267</xs:documentation> <xs:documentation>P267</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:element name="DigestValue" type="xs:token"/>
<xs:element name="TyreRRCDeclared" type="vdecdef:TyreRRCISOType"> <xs:element name="TyreRRCDeclared" type="vdecdef:TyreRRCISOType">
<xs:annotation> <xs:annotation>
<xs:documentation>P046</xs:documentation> <xs:documentation>P046</xs:documentation>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2016 rel. 2 (x64) (http://www.altova.com) by Helmut Eichlseder (TU Graz/Inst. f. VKM und THD) --> <!-- edited with XMLSpy v2016 rel. 2 sp1 (x64) (http://www.altova.com) by Helmut Eichlseder (TU Graz/Inst. f. VKM und THD) -->
<!--W3C XML Schema generated by XMLSpy vXMLSpy Professional Edition v2016 rel. 2 (x64) (http://www.altova.com)--> <!--W3C XML Schema generated by XMLSpy vXMLSpy Professional Edition v2016 rel. 2 (x64) (http://www.altova.com)-->
<xs:schema xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vdecdef="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" targetNamespace="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.4"> <xs:schema xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vdecdef="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" targetNamespace="urn:tugraz:ivt:VectoAPI:DeclarationOutput:v0.4" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.4">
<xs:import namespace="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" schemaLocation="VectoDeclarationDefinitions.1.0.xsd"/> <xs:import namespace="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" schemaLocation="VectoDeclarationDefinitions.1.0.xsd"/>
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
<xs:documentation>P267</xs:documentation> <xs:documentation>P267</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:element name="DigestValue" type="xs:token"/>
<xs:element name="TyreRRCDeclared" type="vdecdef:TyreRRCISOType"> <xs:element name="TyreRRCDeclared" type="vdecdef:TyreRRCISOType">
<xs:annotation> <xs:annotation>
<xs:documentation>P046</xs:documentation> <xs:documentation>P046</xs:documentation>
......
...@@ -86,6 +86,13 @@ namespace TUGraz.VectoCore.Tests.Integration ...@@ -86,6 +86,13 @@ namespace TUGraz.VectoCore.Tests.Integration
foreach (var axleDeclarationInputData in dataProvider.JobInputData.Vehicle.Axles) { foreach (var axleDeclarationInputData in dataProvider.JobInputData.Vehicle.Axles) {
Assert.AreEqual(axleDeclarationInputData.Tyre.CertificationNumber, reportWheels[i++].Value); Assert.AreEqual(axleDeclarationInputData.Tyre.CertificationNumber, reportWheels[i++].Value);
} }
var digestWheels = manufacturerReport.XPathSelectElements("//*[local-name()='Axle']/*[local-name()='DigestValue']").ToArray();
Assert.NotNull(digestWheels);
Assert.AreEqual(2, digestWheels.Count());
foreach (var digestWheel in digestWheels) {
Assert.IsFalse(string.IsNullOrWhiteSpace(digestWheel.Value));
}
} }
} }
} }
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