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

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

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

Merge pull request #858 in VECTO/vecto-sim from VECTO/mq_vecto-sim:bugfix/VECTO-1429-error-due-to-maxnetpower1-when-running-zeroemissionvehicle-with-new-xml-schema to develop

* commit '7875c44c':
  adding testcase exempted vehicle schema version 2: non HEV and no maxNetPower in input bugfix in xmldeclarationdataprovider
parents 8b48f0e6 7875c44c
No related branches found
No related tags found
No related merge requests found
......@@ -501,12 +501,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public override Watt MaxNetPower1
{
get { return GetDouble(XMLNames.Vehicle_MaxNetPower1).SI<Watt>(); }
get { return HybridElectricHDV ? GetDouble(XMLNames.Vehicle_MaxNetPower1).SI<Watt>() : null; }
}
public override Watt MaxNetPower2
{
get { return GetDouble(XMLNames.Vehicle_MaxNetPower2).SI<Watt>(); }
get { return HybridElectricHDV ? GetDouble(XMLNames.Vehicle_MaxNetPower2).SI<Watt>() : null; }
}
public override IVehicleComponentsDeclaration Components
......
......@@ -59,6 +59,9 @@ namespace TUGraz.VectoCore.Tests.Integration
public class ExemptedVehicleTest
{
const string ExemptedVehicle = @"Testdata\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted.xml";
const string ExemptedVehicleNoHEV = @"Testdata\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted_nonHEV.xml";
const string ExemptedVehicleV2 = @"Testdata\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted_v2.xml";
const string ExemptedVehicleV2NoHEV = @"Testdata\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted_v2_nonHEV.xml";
protected IXMLInputDataReader xmlInputReader;
private IKernel _kernel;
......@@ -72,7 +75,11 @@ namespace TUGraz.VectoCore.Tests.Integration
xmlInputReader = _kernel.Get<IXMLInputDataReader>();
}
[TestCase(ExemptedVehicle, 1)]
[TestCase(ExemptedVehicle, 1),
TestCase(ExemptedVehicleNoHEV, 1),
TestCase(ExemptedVehicleV2, 1),
TestCase(ExemptedVehicleV2NoHEV, 1)
]
public void TestSimulationExemptedVehicle(string filename, int numRuns)
{
var writer = new FileOutputWriter(filename);
......
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0"
xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationInput:v1.0 E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoInput.xsd"
xmlns:di="http://www.w3.org/2000/09/xmldsig#">
<Vehicle id="VEH-1234567890">
<Manufacturer>Generic Truck Manufacturer</Manufacturer>
<ManufacturerAddress>Street, ZIP City</ManufacturerAddress>
<Model>Generic Model</Model>
<VIN>VEH-1234567890</VIN>
<Date>2017-02-15T11:00:00Z</Date>
<LegislativeClass>N3</LegislativeClass>
<VehicleCategory>Tractor</VehicleCategory>
<CurbMassChassis>7100</CurbMassChassis>
<GrossVehicleMass>40000</GrossVehicleMass>
<ZeroEmissionVehicle>false</ZeroEmissionVehicle>
<HybridElectricHDV>false</HybridElectricHDV>
<DualFuelVehicle>true</DualFuelVehicle>
</Vehicle>
</tns:VectoInputDeclaration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="2.0"
xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"
xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0"
xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"
xmlns:q1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"
xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd
urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1 E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoDeclarationDefinitions.2.1.xsd">
<v2.0:Vehicle id="VEH-1234567890" xsi:type="ExemptedVehicleDeclarationType">
<Manufacturer>Generic Truck Manufacturer</Manufacturer>
<ManufacturerAddress>Street, ZIP City</ManufacturerAddress>
<Model>Generic Model</Model>
<VIN>VEH-1234567890</VIN>
<Date>2017-02-15T11:00:00Z</Date>
<LegislativeClass>N3</LegislativeClass>
<VehicleCategory>Tractor</VehicleCategory>
<CurbMassChassis>7100</CurbMassChassis>
<GrossVehicleMass>40000</GrossVehicleMass>
<ZeroEmissionVehicle>false</ZeroEmissionVehicle>
<MaxNetPower1>30000</MaxNetPower1>
<MaxNetPower2>20000</MaxNetPower2>
<HybridElectricHDV>true</HybridElectricHDV>
<DualFuelVehicle>true</DualFuelVehicle>
</v2.0:Vehicle>
</tns:VectoInputDeclaration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<tns:VectoInputDeclaration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="2.0"
xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"
xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0"
xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"
xmlns:q1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"
xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"
xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd
urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1 E:\QUAM\Workspace\VECTO_quam\VectoCore\VectoCore\Resources\XSD/VectoDeclarationDefinitions.2.1.xsd">
<v2.0:Vehicle id="VEH-1234567890" xsi:type="ExemptedVehicleDeclarationType">
<Manufacturer>Generic Truck Manufacturer</Manufacturer>
<ManufacturerAddress>Street, ZIP City</ManufacturerAddress>
<Model>Generic Model</Model>
<VIN>VEH-1234567890</VIN>
<Date>2017-02-15T11:00:00Z</Date>
<LegislativeClass>N3</LegislativeClass>
<VehicleCategory>Tractor</VehicleCategory>
<CurbMassChassis>7100</CurbMassChassis>
<GrossVehicleMass>40000</GrossVehicleMass>
<ZeroEmissionVehicle>false</ZeroEmissionVehicle>
<HybridElectricHDV>false</HybridElectricHDV>
<DualFuelVehicle>true</DualFuelVehicle>
</v2.0:Vehicle>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -2916,6 +2916,15 @@
<Content Include="TestData\Integration\DeclarationMode\EngineSpeedTooHigh\vecto_vehicle-sample_9gears.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted_v2_nonHEV.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted_v2.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted_nonHEV.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\Integration\DeclarationMode\ExemptedVehicle\vecto_vehicle-sample_exempted.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
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