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

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

Extended IsInputDataComplete to support Exempted Vehicles

parent 305db920
No related branches found
No related tags found
No related merge requests found
......@@ -57,12 +57,12 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Common
if (_parent.CanBeSimulated) {
return;
}
//if (_parent.ManufacturingStageViewModel.VehicleViewModel.VehicleDeclarationType ==
// VehicleDeclarationType.interim) {
// ErrorInfo = "Only Jobs with the declaration type \"final\" can be simulated";
// return;
//}
if(_parent.JobInputData?.ConsolidateManufacturingStage?.Vehicle?.VehicleDeclarationType !=
VehicleDeclarationType.final && !_parent.Exempted)
{
ErrorInfo = "Job is not declared as \"final\"";
}
if (_parent.InvalidEntries != null && _parent.InvalidEntries.Count != 0) {
......
......@@ -306,8 +306,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
{
get
{
return InputComplete && _inputData.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleDeclarationType ==
VehicleDeclarationType.final;
return (InputComplete && _inputData.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleDeclarationType ==
VehicleDeclarationType.final) || (InputComplete && Exempted);
}
set => throw new NotImplementedException();
}
......
......@@ -153,24 +153,6 @@ namespace Vecto3GUI2020Test.ViewModelTests
}
[Test]
public void CreateVifWrongDecimal()
{
var multistagevm = loadFile(primary_vehicle_only).MultiStageJobViewModel as MultiStageJobViewModel_v0_1;
//Set Necessary Fields
var vehicle =
multistagevm.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8;
vehicle.ManufacturerAddress = "Address";
vehicle.Manufacturer = "Manufacturer";
vehicle.VIN = "VIN12345678";
vehicle.Model = "Model";
//vehicle.MultistageAuxiliariesViewModel.
}
[Test]
public void TestAirdragLoadAndSave()
......
......@@ -658,8 +658,41 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl
return validAirdragEntries;
}
private bool IsInputDataCompleteExempted(VectoSimulationJobType jobType, bool fullCheck)
{
if (fullCheck)
{
//use Binary AND to execute all Statements and gather information about missing parameters.
return InputComplete(Model, nameof(Model))
& InputComplete(LegislativeClass, nameof(LegislativeClass))
& InputComplete(CurbMassChassis, nameof(CurbMassChassis))
& InputComplete(GrossVehicleMassRating, nameof(GrossVehicleMassRating))
& InputComplete(RegisteredClass, nameof(RegisteredClass))
& InputComplete(NumberPassengerSeatsLowerDeck, nameof(NumberPassengerSeatsLowerDeck))
& InputComplete(NumberPassengerSeatsUpperDeck, nameof(NumberPassengerSeatsUpperDeck))
& InputComplete(VehicleCode, nameof(VehicleCode))
& InputComplete(LowEntry, nameof(LowEntry))
& InputComplete(Height, nameof(Height));
}
return InputComplete(Model, nameof(Model))
&& InputComplete(LegislativeClass, nameof(LegislativeClass))
&& InputComplete(CurbMassChassis, nameof(CurbMassChassis))
&& InputComplete(GrossVehicleMassRating, nameof(GrossVehicleMassRating))
&& InputComplete(RegisteredClass, nameof(RegisteredClass))
&& InputComplete(NumberPassengerSeatsLowerDeck, nameof(NumberPassengerSeatsLowerDeck))
&& InputComplete(NumberPassengerSeatsUpperDeck, nameof(NumberPassengerSeatsUpperDeck))
&& InputComplete(VehicleCode, nameof(VehicleCode))
&& InputComplete(LowEntry, nameof(LowEntry)) && InputComplete(Height, nameof(Height));
}
protected override bool IsInputDataCompleteTemplate(VectoSimulationJobType jobType, bool fullCheck)
{
if (ExemptedVehicle) {
return IsInputDataCompleteExempted(jobType, fullCheck);
}
GetADAS();
GetComponents();
if (fullCheck) {
......
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