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

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

re-adding adas combination info to sum file

parent 9a3c513f
No related branches found
No related tags found
No related merge requests found
......@@ -185,6 +185,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
var vehicle = InputDataProvider.JobInputData.Vehicle;
// lookup adas combination here to check if it is an allowed combination...
var adasCombination = DeclarationData.ADASCombinations.Lookup(vehicle.ADAS, InputDataProvider.JobInputData.Vehicle.Components.GearboxInputData.Type);
var engine = InputDataProvider.JobInputData.Vehicle.Components.EngineInputData;
var engineModes = engine.EngineModes;
......
/*
* This file is part of VECTO.
*
* Copyright © 2012-2019 European Union
*
* Developed by Graz University of Technology,
* Institute of Internal Combustion Engines and Thermodynamics,
* Institute of Technical Informatics
*
* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use VECTO except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/community/eupl/og_page/eupl
*
* Unless required by applicable law or agreed to in writing, VECTO
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* Authors:
* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.Models.SimulationComponent.Data;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Declaration
{
public struct ADASCombination
{
public string ID;
public bool AllowedForAT;
}
public sealed class ADASCombinations : LookupData<bool, EcoRollType, PredictiveCruiseControlType, ADASCombination>
{
private readonly List<Entry> _combinations = new List<Entry>();
#region Overrides of LookupData
public override ADASCombination Lookup(bool enginestopstart, EcoRollType ecoRoll, PredictiveCruiseControlType pcc)
{
try {
var entry = _combinations.First(
x => x.EngineStopStart == enginestopstart && x.EcoRoll == ecoRoll &&
x.PCCType == pcc);
return new ADASCombination { ID = entry.ADASCombination, AllowedForAT = entry.AllowedForAT };
} catch (Exception) {
throw new VectoException(string.Format(ErrorMessage, enginestopstart, ecoRoll, pcc));
}
}
protected override string ResourceId
{
get { return DeclarationData.DeclarationDataResourcePrefix + ".ADAS.ADAS_Combinations.csv"; }
}
protected override string ErrorMessage
{
get {
return
"ADAS Combination Lookup Error: No entry found for engine stop/start: {0}, eco roll: {1}, PCC: {2}";
}
}
protected override void ParseData(DataTable table)
{
foreach (DataRow row in table.Rows) {
_combinations.Add(new Entry() {
EngineStopStart = row.ParseBoolean("enginestopstart"),
EcoRoll = EcorollTypeHelper.Get(row.ParseBoolean("ecorollwithoutenginestop"), row.ParseBoolean("ecorollwithenginestop")),
PCCType = PredictiveCruiseControlTypeHelper.Parse(row.Field<string>("predictivecruisecontrol")),
ADASCombination = row.Field<string>("adascombination"),
AllowedForAT = row.ParseBoolean("allowedat"),
});
}
}
#endregion
public struct Entry
{
public bool EngineStopStart;
public EcoRollType EcoRoll;
public PredictiveCruiseControlType PCCType;
public string ADASCombination;
public bool AllowedForAT;
}
public ADASCombination Lookup(IAdvancedDriverAssistantSystemDeclarationInputData adas, GearboxType gbxType)
{
var entry = Lookup(
adas.EngineStopStart, adas.EcoRoll, adas.PredictiveCruiseControl);
if (gbxType.AutomaticTransmission() && !entry.AllowedForAT) {
throw new VectoException("ADAS combination {0} not allowed for AT transmissions", entry.ID);
}
return entry;
}
internal ADASCombination Lookup(VehicleData.ADASData adas, GearboxType gbxType)
{
var entry = Lookup(
adas.EngineStopStart, adas.EcoRoll, adas.PredictiveCruiseControl);
if (gbxType.AutomaticTransmission() && !entry.AllowedForAT) {
throw new VectoException("ADAS combination {0} not allowed for AT transmissions", entry.ID);
}
return entry;
}
}
}
......@@ -219,7 +219,7 @@ namespace TUGraz.VectoCore.OutputData
public const string DECLARED_FZISO_AXLE3 = "Declared FzISO axle 3 [N]";
public const string DECLARED_RRC_AXLE4 = "Declared RRC axle 4 [-]";
public const string DECLARED_FZISO_AXLE4 = "Declared FzISO axle 4 [N]";
//public const string ADAS_TECHNOLOGY_COMBINATION = "ADAS technology combination [-]";
public const string ADAS_TECHNOLOGY_COMBINATION = "ADAS technology combination [-]";
public const string PTO_TECHNOLOGY = "PTOShaftsGearWheels";
......@@ -773,7 +773,7 @@ namespace TUGraz.VectoCore.OutputData
private void WriteFullPowertrain(VectoRunData runData, DataRow row)
{
WriteVehicleData(runData.VehicleData, row);
WriteVehicleData(runData.VehicleData, runData.GearboxData.Type, row);
row[PTO_TECHNOLOGY] = runData.PTO?.TransmissionType ?? "";
......@@ -795,7 +795,7 @@ namespace TUGraz.VectoCore.OutputData
}
private static void WriteVehicleData(VehicleData data, DataRow row)
private static void WriteVehicleData(VehicleData data, GearboxType gbxType, DataRow row)
{
row[VEHICLE_MANUFACTURER] = data.Manufacturer;
row[VIN_NUMBER] = data.VIN;
......@@ -819,7 +819,7 @@ namespace TUGraz.VectoCore.OutputData
row[R_DYN] = (ConvertedSI)data.DynamicTyreRadius;
//row[ADAS_TECHNOLOGY_COMBINATION] = data.ADAS != null ? DeclarationData.ADASCombinations.Lookup(data.ADAS).ID : "";
row[ADAS_TECHNOLOGY_COMBINATION] = data.ADAS != null ? DeclarationData.ADASCombinations.Lookup(data.ADAS, gbxType).ID : "";
}
private static void WriteAirdragData(AirdragData data, DataRow row)
......
ADAS Combination , Engine Stop Start , EcoRoll without Engine Stop , EcoRoll with Engine Stop , Predictive Cruise Control , Allowed AT
0 , 0 , 0 , 0 , none , 1
1 , 1 , 0 , 0 , none , 1
2 , 0 , 1 , 0 , none , 1
3 , 0 , 0 , 1 , none , 0
4/1 , 0 , 0 , 0 , "1_2" , 1
4/2 , 0 , 0 , 0 , "1_2_3" , 1
5 , 1 , 1 , 0 , none , 1
6 , 1 , 0 , 1 , none , 0
7/1 , 1 , 0 , 0 , "1_2" , 1
7/2 , 1 , 0 , 0 , "1_2_3" , 1
8/1 , 0 , 1 , 0 , "1_2" , 1
8/2 , 0 , 1 , 0 , "1_2_3" , 1
9/1 , 0 , 0 , 1 , "1_2" , 0
9/2 , 0 , 0 , 1 , "1_2_3" , 0
10/1 , 1 , 1 , 0 , "1_2" , 1
10/2 , 1 , 1 , 0 , "1_2_3" , 1
11/1 , 1 , 0 , 1 , "1_2" , 0
11/2 , 1 , 0 , 1 , "1_2_3" , 0
\ No newline at end of file
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