diff --git a/HashingTool/ViewModel/UserControl/ManufacturerReportXMLFile.cs b/HashingTool/ViewModel/UserControl/ManufacturerReportXMLFile.cs index b1dcad74f18fca55a3d0af8478d5bdba11a78dc6..d6adf8d54833c391facafe6eb6e52afd8b023bb1 100644 --- a/HashingTool/ViewModel/UserControl/ManufacturerReportXMLFile.cs +++ b/HashingTool/ViewModel/UserControl/ManufacturerReportXMLFile.cs @@ -103,7 +103,6 @@ namespace HashingTool.ViewModel.UserControl if (entry.Component.StartsWith("Axle ")) { entry.Component = entry.Component.Replace("Axle", "Tyre"); entry.CertificationNumber = ReadElementValue(node, XMLNames.Report_Tyre_TyreCertificationNumber); - entry.DigestValue = "Not Available"; } else { entry.CertificationNumber = ReadElementValue(node, XMLNames.Report_Component_CertificationNumber) ?? ReadElementValue(node, XMLNames.Report_Component_CertificationMethod); @@ -116,9 +115,7 @@ namespace HashingTool.ViewModel.UserControl if (!jobComponent.Any()) { continue; } - entry.DigestValueMatchesJobComponent = entry.Component.StartsWith("Tyre ") - ? (bool?)null - : (jobComponent.First().DigestValueComputed == entry.DigestValue); + entry.DigestValueMatchesJobComponent = jobComponent.First().DigestValueComputed == entry.DigestValue; entry.DigestValueExpected = jobComponent.First().DigestValueComputed; if (entry.CertificationMethod == CertificationMethod.StandardValues.ToXMLFormat()) { @@ -134,9 +131,7 @@ namespace HashingTool.ViewModel.UserControl var certificationNumberMismatch = componentData.Where( x => x.CertificationNumberMatchesJobComponent != null && !x.CertificationNumberMatchesJobComponent.Value).ToArray(); - var digestMismatch = - componentData.Where(x => !x.Component.StartsWith("Tyre ")) - .Where(x => x.DigestValueMatchesJobComponent == null || !x.DigestValueMatchesJobComponent.Value).ToArray(); + var digestMismatch = componentData.Where(x => x.DigestValueMatchesJobComponent == null || !x.DigestValueMatchesJobComponent.Value).ToArray(); if (jobComponents.Any()) { foreach (var entry in certificationNumberMismatch) { _validationErrors.Add( diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs index fecfe5799402fcfe825ea32f3286c681c49ee2ca..7c48145fe1f7a0a884d49a3dea401950155618e9 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationEngineDataProvider.cs @@ -29,100 +29,100 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ -using TUGraz.IVT.VectoXML; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; - -namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration -{ - public class XMLDeclarationEngineDataProvider : AbstractDeclarationXMLComponentDataProvider, - IEngineDeclarationInputData - { - public XMLDeclarationEngineDataProvider(XMLDeclarationInputDataProvider xmlInputDataProvider) - : base(xmlInputDataProvider) - { - XBasePath = Helper.Query(VehiclePath, - XMLNames.Vehicle_Components, - XMLNames.Component_Engine, - XMLNames.ComponentDataWrapper); - } - +using TUGraz.IVT.VectoXML; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; + +namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration +{ + public class XMLDeclarationEngineDataProvider : AbstractDeclarationXMLComponentDataProvider, + IEngineDeclarationInputData + { + public XMLDeclarationEngineDataProvider(XMLDeclarationInputDataProvider xmlInputDataProvider) + : base(xmlInputDataProvider) + { + XBasePath = Helper.Query(VehiclePath, + XMLNames.Vehicle_Components, + XMLNames.Component_Engine, + XMLNames.ComponentDataWrapper); + } + public CubicMeter Displacement { get { return GetDoubleElementValue(XMLNames.Engine_Displacement).SI(Unit.SI.Cubic.Centi.Meter).Cast<CubicMeter>(); } - } - - public PerSecond IdleSpeed - { - get { return GetDoubleElementValue(XMLNames.Engine_IdlingSpeed).RPMtoRad(); } - } - - public FuelType FuelType - { - get { return GetElementValue(XMLNames.Engine_FuelType).ParseEnum<FuelType>(); } - } - - public TableData FuelConsumptionMap - { - get { - return ReadTableData(AttributeMappings.FuelConsumptionMapMapping, - Helper.Query(XMLNames.Engine_FuelConsumptionMap, XMLNames.Engine_FuelConsumptionMap_Entry)); - } - } - - public TableData FullLoadCurve - { - get { - return ReadTableData(AttributeMappings.EngineFullLoadCurveMapping, - Helper.Query(XMLNames.Engine_FullLoadAndDragCurve, XMLNames.Engine_FullLoadCurve_Entry)); - } - } - - public Watt RatedPowerDeclared - { - get { return GetDoubleElementValue(XMLNames.Engine_RatedPower).SI<Watt>(); } - } - - public PerSecond RatedSpeedDeclared - { - get { return GetDoubleElementValue(XMLNames.Engine_RatedSpeed).RPMtoRad(); } - } - - public NewtonMeter MaxTorqueDeclared - { - get { return GetDoubleElementValue(XMLNames.Engine_MaxTorque).SI<NewtonMeter>(); } - } - - public double WHTCMotorway - { - get { return GetDoubleElementValue(XMLNames.Engine_WHTCMotorway); } - } - - public double WHTCRural - { - get { return GetDoubleElementValue(XMLNames.Engine_WHTCRural); } - } - - public double WHTCUrban - { - get { return GetDoubleElementValue(XMLNames.Engine_WHTCUrban); } - } - - public double ColdHotBalancingFactor - { - get { return GetDoubleElementValue(XMLNames.Engine_ColdHotBalancingFactor); } - } - - public double CorrectionFactorRegPer - { - get { return GetDoubleElementValue(XMLNames.Engine_CorrectionFactor_RegPer); } - } - - public double CorrectionFactorNCV - { - get { return GetDoubleElementValue(XMLNames.Engine_CorrecionFactor_NCV); } - } - } + } + + public PerSecond IdleSpeed + { + get { return GetDoubleElementValue(XMLNames.Engine_IdlingSpeed).RPMtoRad(); } + } + + public FuelType FuelType + { + get { return GetElementValue(XMLNames.Engine_FuelType).ParseEnum<FuelType>(); } + } + + public TableData FuelConsumptionMap + { + get { + return ReadTableData(AttributeMappings.FuelConsumptionMapMapping, + Helper.Query(XMLNames.Engine_FuelConsumptionMap, XMLNames.Engine_FuelConsumptionMap_Entry)); + } + } + + public TableData FullLoadCurve + { + get { + return ReadTableData(AttributeMappings.EngineFullLoadCurveMapping, + Helper.Query(XMLNames.Engine_FullLoadAndDragCurve, XMLNames.Engine_FullLoadCurve_Entry)); + } + } + + public Watt RatedPowerDeclared + { + get { return GetDoubleElementValue(XMLNames.Engine_RatedPower).SI<Watt>(); } + } + + public PerSecond RatedSpeedDeclared + { + get { return GetDoubleElementValue(XMLNames.Engine_RatedSpeed).RPMtoRad(); } + } + + public NewtonMeter MaxTorqueDeclared + { + get { return GetDoubleElementValue(XMLNames.Engine_MaxTorque).SI<NewtonMeter>(); } + } + + public double WHTCMotorway + { + get { return GetDoubleElementValue(XMLNames.Engine_WHTCMotorway); } + } + + public double WHTCRural + { + get { return GetDoubleElementValue(XMLNames.Engine_WHTCRural); } + } + + public double WHTCUrban + { + get { return GetDoubleElementValue(XMLNames.Engine_WHTCUrban); } + } + + public double ColdHotBalancingFactor + { + get { return GetDoubleElementValue(XMLNames.Engine_ColdHotBalancingFactor); } + } + + public double CorrectionFactorRegPer + { + get { return GetDoubleElementValue(XMLNames.Engine_CorrectionFactor_RegPer); } + } + + public double CorrectionFactorNCV + { + get { return GetDoubleElementValue(XMLNames.Engine_CorrecionFactor_NCV); } + } + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs index 1fadee42c387e8536c84b15d1bd79557baeaa94e..c4a8d1c726e8bfbf3aadc5337de42958a141b363 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/XMLDeclarationVehicleDataProvider.cs @@ -139,6 +139,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration 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 certirficationNumber = tyre.SelectSingleNode(Helper.NSPrefix(XMLNames.Component_CertificationNumber), Manager); + var digestValue = tyre.SelectSingleNode(Helper.Query("..//*[local-name()='DigestValue']"), Manager); retVal[axleNumber - 1] = new AxleInputData { AxleType = axleType == null ? AxleType.VehicleNonDriven : axleType.Value.ParseEnum<AxleType>(), TwinTyres = twinTyres != null && XmlConvert.ToBoolean(twinTyres.Value), @@ -148,7 +149,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration RollResistanceCoefficient = rollResistance == null ? double.NaN : rollResistance.Value.ToDouble(), Dimension = dimension == null ? null : dimension.Value, CertificationNumber = certirficationNumber == null ? null : certirficationNumber.Value, - CertificationMethod = CertificationMethod.Measured + CertificationMethod = CertificationMethod.Measured, + DigestValue = digestValue == null ? "" : digestValue.Value } }; } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index f5066419c2287d25bd536ca81c17af65d4030b53..c5803432b4a36e04193e76f99a2b533b6a533ae1 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -119,7 +119,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter RollResistanceCoefficient = axleInput.Tyre.RollResistanceCoefficient, TyreTestLoad = axleInput.Tyre.TyreTestLoad, Inertia = DeclarationData.Wheels.Lookup(axleInput.Tyre.Dimension.RemoveWhitespace()).Inertia, - CertificationNumber = axleInput.Tyre.CertificationNumber + CertificationNumber = axleInput.Tyre.CertificationNumber, + DigestValueInput = axleInput.Tyre.DigestValue, }; axleData.Add(axle); } diff --git a/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs index e6cabff5b6376f20211488eaac59f0d60cef6a40..65cf2403e73f05e7da0ff5310bec03a57a990722 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLManufacturerReport.cs @@ -221,6 +221,7 @@ namespace TUGraz.VectoCore.OutputData.XML new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, i), new XElement(tns + XMLNames.Report_Tyre_TyreDimension, axle.WheelsDimension), 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.AxleWheels_Axles_Axle_TwinTyres, axle.TwinTyres)); } diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.4.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.4.xsd index 2efd70f2fc1146a9ebf12e46faaf3220aa667a05..22abd15020cf4d935675ef3b7b2e2c517c6fcc47 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.4.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.4.xsd @@ -1,5 +1,5 @@ <?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)--> <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"/> @@ -119,6 +119,7 @@ <xs:documentation>P267</xs:documentation> </xs:annotation> </xs:element> + <xs:element name="DigestValue" type="xs:token"/> <xs:element name="TyreRRCDeclared" type="vdecdef:TyreRRCISOType"> <xs:annotation> <xs:documentation>P046</xs:documentation> diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.xsd index 2efd70f2fc1146a9ebf12e46faaf3220aa667a05..22abd15020cf4d935675ef3b7b2e2c517c6fcc47 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.xsd @@ -1,5 +1,5 @@ <?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)--> <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"/> @@ -119,6 +119,7 @@ <xs:documentation>P267</xs:documentation> </xs:annotation> </xs:element> + <xs:element name="DigestValue" type="xs:token"/> <xs:element name="TyreRRCDeclared" type="vdecdef:TyreRRCISOType"> <xs:annotation> <xs:documentation>P046</xs:documentation> diff --git a/VectoCore/VectoCoreTest/Integration/XMLReportTest.cs b/VectoCore/VectoCoreTest/Integration/XMLReportTest.cs index 16efba12c17b746b63a5c7adcc7a269292417e5d..ebddab88bad7fc96d8ab90b3e5b8cb1516efb6b0 100644 --- a/VectoCore/VectoCoreTest/Integration/XMLReportTest.cs +++ b/VectoCore/VectoCoreTest/Integration/XMLReportTest.cs @@ -86,6 +86,13 @@ namespace TUGraz.VectoCore.Tests.Integration foreach (var axleDeclarationInputData in dataProvider.JobInputData.Vehicle.Axles) { 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)); + } } } }