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

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

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 4ec39b25
No related branches found
No related tags found
No related merge requests found
Showing
with 3391 additions and 4 deletions
<?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
......@@ -178,6 +178,9 @@
<Content Include="Testdata\XML\ToHash\multiple_components.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\ToHash\Tyre_v25.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Testdata\XML\ToHash\vecto_engine-input_emptyDate.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
......@@ -144,4 +144,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
......@@ -54,6 +54,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration
new XMLDeclarationInputDataV22InjectModule(),
new XMLDeclarationInputDataV221InjectModule(),
new XMLDeclarationInputDataV23InjectModule(),
new XMLDeclarationInputDataV25InjectModule(),
});
#endregion
......
......@@ -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>
......@@ -82,6 +82,8 @@ namespace TUGraz.VectoCore.Utils
public const string DECLARATION_DEFINITIONS_NAMESPACE_URI_V23 = DECLARATION_NAMESPACE + ":v2.3";
public const string DECLARATION_DEFINITIONS_NAMESPACE_URI_V25 = DECLARATION_NAMESPACE + ":v2.5";
public const string DECLARATION_INPUT_NAMESPACE = "urn:tugraz:ivt:VectoAPI:DeclarationInput";
public const string DECLARATION_INPUT_NAMESPACE_URI_V10 = DECLARATION_INPUT_NAMESPACE + ":v1.0";
......
......@@ -179,6 +179,7 @@
<Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV221InjectModule.cs" />
<Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV22InjectModule.cs" />
<Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV23InjectModule.cs" />
<Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV25InjectModule.cs" />
<Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\AbstractComponentReader.cs" />
<Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\XMLADASReader.cs" />
<Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\XMLComponentReader.cs" />
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -3878,6 +3878,9 @@
<Content Include="TestData\XML\XMLReaderDeclaration\SchemaVersion2.1\vecto_vehicle-exempted-sample.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\SchemaVersion2.1\vecto_vehicle-tyre25.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\SchemaVersion2.1\vecto_vehicle-new_parameters-sample.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
......@@ -105,6 +105,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