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

Skip to content
Snippets Groups Projects
Commit d7b83f4e authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

cherry pick aa6d2d5f

updating xml schema version 2.5: remove restrictions for tyre dimension
adding xml reader for tyre in version 2.5
adding testcase to read vehicle with 2.5 tyres
adding tyre xml version 2.5
parent 9d827315
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.1"
xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3"
xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD\VectoDeclarationComponent.xsd">
<tns:Tyre xmlns:v2.5="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.5">
<v2.0:Data xsi:type="TyreDataDeclarationType" id="TYR-123" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.5">
<Manufacturer>Generic Vendor</Manufacturer>
<Model>ADC 20</Model>
<CertificationNumber>xyz-abc-def</CertificationNumber>
<Date>2021-11-18T14:09:17.2810263Z</Date>
<AppVersion>Some Application v1.0</AppVersion>
<Dimension>###SOME_DIMENSION###</Dimension>
<TyreClass>C1</TyreClass>
<FuelEfficiencyClass>A</FuelEfficiencyClass>
<RRCDeclared>0.0055</RRCDeclared>
<FzISO>33500</FzISO>
</v2.0:Data>
</tns:Tyre>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -135,4 +135,21 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public override string FuelEfficiencyClass => GetString("FuelEfficiencyClass");
}
// ---------------------------------------------------------------------------------------
public class XMLDeclarationTyreDataProviderV25 : XMLDeclarationTyreDataProviderV23
{
public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V25;
//public new const string XSD_TYPE = "TyreComponentDeclarationType";
public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE);
public XMLDeclarationTyreDataProviderV25(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile)
: base(vehicle, componentNode, sourceFile) { }
protected override XNamespace SchemaNamespace => NAMESPACE_URI;
}
}
using Ninject.Modules;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces;
namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules
{
public class XMLDeclarationInputDataV25InjectModule : NinjectModule
{
public override void Load()
{
Bind<IXMLTyreDeclarationInputData>().To<XMLDeclarationTyreDataProviderV25>().Named(
XMLDeclarationTyreDataProviderV25.QUALIFIED_XSD_TYPE);
}
}
}
\ No newline at end of file
......@@ -53,6 +53,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
new XMLDeclarationInputDataV221InjectModule(),
new XMLDeclarationInputDataV23InjectModule(),
new XMLDeclarationInputDataV24InjectModule(),
new XMLDeclarationInputDataV25InjectModule(),
new XMLDeclarationInputDataMultistageV01InjectModule(),
});
......
......@@ -97,9 +97,6 @@
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="TyreDimensionType">
<xs:restriction base="xs:token">
<xs:pattern value="(PT|LT|ST|T|)\d{3}/\d{2,3} (B|D|R)[\d.]{2,4}[A-Z]?"/>
<xs:pattern value="[\d.]{1,5} R[\d.]{1,4}[A-Z]?"/>
</xs:restriction>
<xs:restriction base="xs:token"/>
</xs:simpleType>
</xs:schema>
......@@ -101,6 +101,8 @@ namespace TUGraz.VectoCore.Utils
public const string DECLARATION_DEFINITIONS_NAMESPACE_URI_V24 = DECLARATION_NAMESPACE + ":v2.4";
public const string DECLARATION_DEFINITIONS_NAMESPACE_URI_V25 = DECLARATION_NAMESPACE + ":v2.5";
public const string DECLARATION_INPUT_NAMESPACE = "urn:tugraz:ivt:VectoAPI:DeclarationInput";
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -103,6 +103,12 @@ namespace TUGraz.VectoCore.Tests.XML
ReadDeclarationJob(jobFile);
}
[TestCase(@"SchemaVersion2.1\vecto_vehicle-tyre25.xml")]
public void TestReadingJobVersion_V21_Tyre25(string jobFile)
{
ReadDeclarationJob(jobFile);
}
[TestCase(@"SchemaVersion2.2\Tractor_4x2_vehicle-class-5_5_t_0.xml")]
public void TestReadingJobVersion_V22(string jobFile)
{
......
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