Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 51d9a3f3 authored by Harald Martini's avatar Harald Martini
Browse files

Primary Vehicle ADAS are now used in consolidated input Data

parent 77fdb79c
Branches
Tags
No related merge requests found
......@@ -216,6 +216,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
foreach (var multistageParameterViewModel in _parameterViewModels.Values)
{
//TODO: Nullable values getting enabled on loading a file.
multistageParameterViewModel.UpdateEditingEnabled();
}
OnPropertyChanged(String.Empty);
......
......@@ -542,11 +542,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
private IAdvancedDriverAssistantSystemDeclarationInputData GetADAS()
{
if (GetVehiclePropertyValue<IAdvancedDriverAssistantSystemDeclarationInputData>(nameof(ADAS)) == null)
return null;
return _consolidatedADAS
?? (_consolidatedADAS = new ConsolidatedADASData(_manufacturingStages));
?? (_consolidatedADAS = new ConsolidatedADASData(
manufacturingStages: _manufacturingStages,
primaryVehicleData: _primaryVehicle.Vehicle,
usePrimaryData: GetVehiclePropertyValue<IAdvancedDriverAssistantSystemDeclarationInputData>(nameof(ADAS)) == null));
}
......@@ -777,8 +777,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
public class ConsolidatedADASData : ConsolidatedDataBase, IAdvancedDriverAssistantSystemDeclarationInputData
{
public ConsolidatedADASData(IEnumerable<IManufacturingStageInputData> manufacturingStages)
: base(manufacturingStages) { }
private readonly bool _usePrimaryData;
private readonly IAdvancedDriverAssistantSystemDeclarationInputData _primaryAdas;
public ConsolidatedADASData(IEnumerable<IManufacturingStageInputData> manufacturingStages,
IVehicleDeclarationInputData primaryVehicleData, bool usePrimaryData)
: base(manufacturingStages)
{
_usePrimaryData = usePrimaryData;
_primaryAdas = primaryVehicleData.ADAS;
}
public bool EngineStopStart => GetADASPropertyValue<bool>(nameof(EngineStopStart));
......@@ -793,6 +801,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
private T GetADASPropertyValue<T>(string propertyName)
{
if (_usePrimaryData) {
return GetPropertyValue<T>(_primaryAdas, propertyName);
}
foreach (var manufacturingStage in _manufacturingStages) {
var adas = manufacturingStage.Vehicle.ADAS;
if (adas == null)
......
......@@ -24,6 +24,8 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
private const string CompletedDiesel = TestDataDir + "newVifCompletedConventional.vecto";
private const string CompletedExempted = TestDataDir + "newVifExempted.vecto";
private const string CompletedExemptedWithoutTPMLM = TestDataDir + "newVifExempted-noTPMLM.vecto";
private string CompletedWithoutADAS = TestDataDir + "newVifCompletedConventional-noADAS.vecto";
......@@ -141,6 +143,21 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
}
[Test]
public void PrimaryAndCompletedWithoutADAS()
{
StartSimulation(CompletedWithoutADAS);
var writtenFiles = GetWrittenFiles();
ShowWrittenFiles(writtenFiles);
Assert.IsTrue(writtenFiles.Contains(_tempFileOutputWriter.XMLFullReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLFullReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLCustomerReportName));
Assert.IsTrue(writtenFiles.Contains(_fileoutputWriter.XMLMultistageReportFileName));
}
//SpecialCase I
[Test, Timeout(1000 * 10 * 60)]
public void PrimaryAndInterimTest()
......
{
"Header": {
"CreatedBy": "Harry",
"Date": "2021-09-20T00:00:00+02:00",
"AppVersion": "Vecto3GUI2020",
"FileVersion": 10
},
"Body": {
"PrimaryVehicle": "..\\..\\XML\\XMLReaderDeclaration\\SchemaVersion2.10\\vecto_vehicle-primary_heavyBus-sample.xml",
"InterimStage": "..\\..\\XML\\XMLReaderDeclaration\\SchemaVersion2.10\\vecto_vehicle-stage_input_full-sample-final-noADAS.xml",
"Completed": false
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<tns:VectoInputDeclaration xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD\VectoDeclarationJob.xsd">
<v2.0:Vehicle id="VEH-1234567890" xsi:type="Vehicle_Conventional_CompletedBusDeclarationType">
<Manufacturer>Some Manufacturer</Manufacturer>
<ManufacturerAddress>Some Manufacturer Address</ManufacturerAddress>
<VIN>VEH-1234567890</VIN>
<Date>2021-09-19T22:00:00Z</Date>
<Model>Sample Bus Model</Model>
<LegislativeCategory>M3</LegislativeCategory>
<CorrectedActualMass>500</CorrectedActualMass>
<TechnicalPermissibleMaximumLadenMass>3500</TechnicalPermissibleMaximumLadenMass>
<AirdragModifiedMultistage>true</AirdragModifiedMultistage>
<ClassBus>II+III</ClassBus>
<NgTankSystem>Compressed</NgTankSystem>
<NumberPassengerSeatsLowerDeck>1</NumberPassengerSeatsLowerDeck>
<NumberPassengersStandingLowerDeck>10</NumberPassengersStandingLowerDeck>
<NumberPassengerSeatsUpperDeck>11</NumberPassengerSeatsUpperDeck>
<NumberPassengersStandingUpperDeck>2</NumberPassengersStandingUpperDeck>
<BodyworkCode>CB</BodyworkCode>
<LowEntry>false</LowEntry>
<HeightIntegratedBody>2500</HeightIntegratedBody>
<VehicleLength>9500</VehicleLength>
<VehicleWidth>2500</VehicleWidth>
<EntranceHeight>2000</EntranceHeight>
<DoorDriveTechnology>electric</DoorDriveTechnology>
<VehicleDeclarationType>final</VehicleDeclarationType>
<VehicleTypeApprovalNumber>123456789</VehicleTypeApprovalNumber>
<Components xsi:type="Components_Conventional_CompletedBusType">
<AirDrag>
<v2.0:Data id="CabinX23h" xsi:type="v2.0:AirDragDataDeclarationType">
<v2.0:Manufacturer>Generic Manufacturer</v2.0:Manufacturer>
<v2.0:Model>Generic Model</v2.0:Model>
<v2.0:CertificationNumber>e12*0815/8051*2017/05E0000*00</v2.0:CertificationNumber>
<v2.0:Date>2017-03-24T15:00:00Z</v2.0:Date>
<v2.0:AppVersion>Vecto AirDrag x.y</v2.0:AppVersion>
<v2.0:CdxA_0>6.31</v2.0:CdxA_0>
<v2.0:TransferredCdxA>6.32</v2.0:TransferredCdxA>
<v2.0:DeclaredCdxA>6.34</v2.0:DeclaredCdxA>
</v2.0:Data>
<v2.0:Signature>
<di:Reference URI="#CabinX23h">
<di:Transforms>
<di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" />
<di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</di:Transforms>
<di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<di:DigestValue>b9SHCfOoVrBxFQ8wwDK32OO+9bd85DuaUdgs6j/29N8=</di:DigestValue>
</di:Reference>
</v2.0:Signature>
</AirDrag>
<Auxiliaries>
<Data xsi:type="AUX_Conventional_CompletedBusType">
<ElectricSystem>
<LEDLights>
<Interiorlights>false</Interiorlights>
<Dayrunninglights>true</Dayrunninglights>
<Positionlights>true</Positionlights>
<Brakelights>true</Brakelights>
<Headlights>false</Headlights>
</LEDLights>
</ElectricSystem>
<HVAC>
<SystemConfiguration>6</SystemConfiguration>
<HeatPumpTypeDriverCompartment>
<Cooling>none</Cooling>
<Heating>non R-744 3-stage</Heating>
</HeatPumpTypeDriverCompartment>
<HeatPumpTypePassengerCompartment>
<Cooling>non R-744 2-stage</Cooling>
<Heating>non R-744 4-stage</Heating>
</HeatPumpTypePassengerCompartment>
<AuxiliaryHeaterPower>50</AuxiliaryHeaterPower>
<DoubleGlazing>false</DoubleGlazing>
<AdjustableAuxiliaryHeater>true</AdjustableAuxiliaryHeater>
<SeparateAirDistributionDucts>true</SeparateAirDistributionDucts>
</HVAC>
</Data>
</Auxiliaries>
</Components>
</v2.0:Vehicle>
</tns:VectoInputDeclaration>
\ No newline at end of file
......@@ -2359,6 +2359,9 @@
<None Include="TestData\Integration\Buses\SingleBus.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\Multistage\newVifCompletedConventional-noADAS.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestData\Integration\Multistage\newVifCompletedConventional.vecto">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......@@ -6041,6 +6044,9 @@
<Content Include="TestData\XML\XMLReaderDeclaration\SchemaVersion2.10\vecto_vehicle-exempted_input_interim-sample.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\SchemaVersion2.10\vecto_vehicle-stage_input_full-sample-final-noADAS.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestData\XML\XMLReaderDeclaration\SchemaVersion2.10\vecto_vehicle-stage_input_full-sample-final.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment