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 ffb105ae authored by Harald Martini's avatar Harald Martini
Browse files

use component data adapter for validations in VECTO GUI

parent 79b62c6f
Branches
Tags
No related merge requests found
......@@ -12,9 +12,11 @@
Imports System.IO
Imports System.Linq
Imports Ninject
Imports TUGraz.VectoCommon.InputData
Imports TUGraz.VectoCommon.Models
Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore
Imports TUGraz.VectoCore.InputData.FileIO.JSON
Imports TUGraz.VectoCore.InputData.Impl
Imports TUGraz.VectoCore.Models.Declaration
......@@ -65,6 +67,16 @@ Public Class VehicleForm
Private _reessPackDlg As REESSPackDialog
Friend VehicleType As VectoSimulationJobType
Public Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
'Close - Check for unsaved changes
Private Sub VehicleFormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
If e.CloseReason <> CloseReason.ApplicationExitCall And e.CloseReason <> CloseReason.WindowsShutDown Then
......
......@@ -20,6 +20,7 @@ Imports TUGraz.VectoCommon.InputData
Imports TUGraz.VectoCommon.Models
Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents
Imports TUGraz.VectoCore.Models.Declaration
Imports TUGraz.VectoCore.Models.SimulationComponent.Data
Imports TUGraz.VectoCore.Models.SimulationComponent.Impl
......@@ -225,7 +226,7 @@ Public Class Engine
.EngineInputData = engine,
.TankSystem = TankSystem.Compressed
}
engineData = doa.CreateEngineData(dummyVehicle, engine.EngineModes.First(), New Mission() With {.MissionType = MissionType.LongHaul})
engineData = New CombustionEngineComponentDataAdapter().CreateEngineData(dummyVehicle, engine.EngineModes.First(), New Mission() With {.MissionType = MissionType.LongHaul})
Else
Dim doa As EngineeringDataAdapter = New EngineeringDataAdapter()
Dim dummyVehicle As IVehicleEngineeringInputData = New DummyVehicle() With {
......
......@@ -22,6 +22,7 @@ Imports TUGraz.VectoCore.InputData.FileIO.JSON
Imports TUGraz.VectoCore.InputData.Impl
Imports TUGraz.VectoCore.InputData.Reader.ComponentData
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents
Imports TUGraz.VectoCore.Models.Declaration
Imports TUGraz.VectoCore.Models.Simulation.Data
Imports TUGraz.VectoCore.Models.SimulationComponent.Data
......@@ -198,8 +199,8 @@ Public Class Gearbox
VectoValidationModeServiceContainer)
Dim mode As ExecutionMode = If(modeService Is Nothing, ExecutionMode.Declaration, modeService.Mode)
Dim emsCycle As Boolean = (modeService IsNot Nothing) AndAlso modeService.IsEMSCycle
Dim jobType as VectoSimulationJobType = If(modeService Is Nothing, VectoSimulationJobType.ConventionalVehicle, modeService.JobType)
Dim emPos as PowertrainPosition? = If(modeService Is Nothing, PowertrainPosition.HybridPositionNotSet, modeService.EMPowertrainPosition)
Dim jobType As VectoSimulationJobType = If(modeService Is Nothing, VectoSimulationJobType.ConventionalVehicle, modeService.JobType)
Dim emPos As PowertrainPosition? = If(modeService Is Nothing, PowertrainPosition.HybridPositionNotSet, modeService.EMPowertrainPosition)
Dim axlegearData As AxleGearData
......@@ -218,23 +219,23 @@ Public Class Gearbox
Try
vehiclecategory = inputData.JobInputData.Vehicle.VehicleCategory
Catch ex As Exception
vehiclecategory = vehiclecategory.RigidTruck
vehiclecategory = VehicleCategory.RigidTruck
End Try
If mode = ExecutionMode.Declaration Then
Dim doa As DeclarationDataAdapterHeavyLorry = New DeclarationDataAdapterHeavyLorry()
Try
engine = doa.CreateEngineData(inputData.JobInputData.Vehicle,
engine = New CombustionEngineComponentDataAdapter().CreateEngineData(inputData.JobInputData.Vehicle,
inputData.JobInputData.Vehicle.Components.EngineInputData.EngineModes.
First(), New Mission() With {.MissionType = MissionType.LongHaul})
Catch
engine = GetDefaultEngine(gearbox.Gears)
End Try
axlegearData = doa.CreateAxleGearData(gearbox)
gearboxData = doa.CreateGearboxData(
new MockVehicleInputData() _
With { _
axlegearData = New AxleGearDataAdapter().CreateAxleGearData(gearbox)
gearboxData = New GearboxDataAdapter(New TorqueConverterDataAdapter()).CreateGearboxData(
New MockVehicleInputData() _
With {
.Components =
New MockComponents() _
With {.GearboxInputData = gearbox,
......@@ -244,7 +245,8 @@ Public Class Gearbox
.VehicleData =
New VehicleData() _
With {.DynamicTyreRadius = rdyn,
.VehicleCategory = vehiclecategory}}, Nothing)
.VehicleCategory = vehiclecategory}},
Nothing, DeclarationDataAdapterHeavyLorry.Conventional.SupportedGearboxTypes)
Else
Dim doa As EngineeringDataAdapter = New EngineeringDataAdapter()
......
......@@ -16,11 +16,14 @@ Imports System.ComponentModel.DataAnnotations
Imports System.IO
Imports System.Linq
Imports System.Xml.Linq
Imports Ninject
Imports TUGraz.VECTO.Input_Files
Imports TUGraz.VectoCommon.Exceptions
Imports TUGraz.VectoCommon.InputData
Imports TUGraz.VectoCommon.Models
Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore
Imports TUGraz.VectoCore.InputData
Imports TUGraz.VectoCore.InputData.FileIO.JSON
Imports TUGraz.VectoCore.InputData.Impl
Imports TUGraz.VectoCore.InputData.Reader.Impl
......@@ -48,13 +51,13 @@ Public Class VectoJob
Private ReadOnly _busAuxFile As SubPath
Private ReadOnly _lacDfTargetSpeedFile As SubPath
Private ReadOnly _lacDfVelocityDropFile as SubPath
Private ReadOnly _ptoCycleWhileDriveFile as SubPath
Private ReadOnly _lacDfVelocityDropFile As SubPath
Private ReadOnly _ptoCycleWhileDriveFile As SubPath
Private _startStop As Boolean
Public StartStopDelay As Double
public UseBusAux as Boolean
Public UseBusAux As Boolean
Private ReadOnly _driverAccelerationFile As SubPath
......@@ -72,14 +75,14 @@ Public Class VectoJob
Public LookAheadMinSpeed As Double
Public EngineStopStartActivationThreshold As Double
public EngineOffTimeLimit As double
public EngineStStUtilityFactor As Double
public EngineStStUtilityFactorDriving as Double
Public EngineOffTimeLimit As Double
Public EngineStStUtilityFactor As Double
Public EngineStStUtilityFactorDriving As Double
Public EcoRollMinSpeed As double
Public EcoRollMinSpeed As Double
Public EcoRollUnderspeedThreshold As Double
Public EcoRollActivationDelay as double
public EcoRollMaxAcceleration as Double
Public EcoRollActivationDelay As Double
Public EcoRollMaxAcceleration As Double
Public PCCEnableSpeedVal As Double
Public PCCMinSpeed As Double
......@@ -93,6 +96,7 @@ Public Class VectoJob
Public AuxPwrStandstillICEOff As Double
Public AuxEntries As Dictionary(Of String, AuxEntry)
Private Shared _kernel As Lazy(Of IKernel) = New Lazy(Of IKernel)(Function() New StandardKernel(New VectoNinjectModule))
'Private _vehicleInputData As JSONComponentInputData
'Private _engineInputData As JSONComponentInputData
......@@ -119,25 +123,25 @@ Public Class VectoJob
_gearboxFile = New SubPath
_tcuFile = New SubPath
_hcuFile = New SubPath()
_busAuxFile = new SubPath()
_busAuxFile = New SubPath()
_lacDfTargetSpeedFile = New SubPath()
_lacDfVelocityDropFile = New SubPath()
_ptoCycleWhileDriveFile = new SubPath()
_ptoCycleWhileDriveFile = New SubPath()
_driverAccelerationFile = New SubPath
CycleFiles = New List(Of SubPath)
AuxEntries = new Dictionary(Of String,AuxEntry)
AuxEntries = New Dictionary(Of String, AuxEntry)
End Sub
Public Function SaveFile() As Boolean
dim emPos As PowertrainPosition? = Nothing
if (IEngineeringJobInputData_Vehicle?.VehicleType <> VectoSimulationJobType.ConventionalVehicle) then
if (IEngineeringJobInputData_Vehicle.VehicleType <> VectoSimulationJobType.IEPC_E) Then
Dim emPos As PowertrainPosition? = Nothing
If (IEngineeringJobInputData_Vehicle?.VehicleType <> VectoSimulationJobType.ConventionalVehicle) Then
If (IEngineeringJobInputData_Vehicle.VehicleType <> VectoSimulationJobType.IEPC_E) Then
emPos = IEngineeringJobInputData_Vehicle?.Components.ElectricMachines?.Entries.FirstOrDefault()?.Position
End If
end if
End If
Dim validationResults As IList(Of ValidationResult) =
Validate(If(Cfg.DeclMode, ExecutionMode.Declaration, ExecutionMode.Engineering), JobType, emPos, Nothing, False)
......@@ -152,7 +156,7 @@ Public Class VectoJob
Try
Dim writer As JSONFileWriter = JSONFileWriter.Instance
writer.SaveJob(Me, _sFilePath, cfg.DeclMode)
writer.SaveJob(Me, _sFilePath, Cfg.DeclMode)
Catch ex As Exception
MsgBox("Failed to save Job file: " + ex.Message)
Return False
......@@ -330,87 +334,87 @@ Public Class VectoJob
Public ReadOnly Property IDriverEngineeringInputData_GearshiftInputData As IGearshiftEngineeringInputData Implements IDriverEngineeringInputData.GearshiftInputData
Get
return new JSONComponentInputData(_tcuFile.FullPath, Me).DriverInputData.GearshiftInputData
Return New JSONComponentInputData(_tcuFile.FullPath, Me).DriverInputData.GearshiftInputData
End Get
End Property
Public ReadOnly Property EngineStopStartData As IEngineStopStartEngineeringInputData Implements IDriverEngineeringInputData.EngineStopStartData
Get
Return me
Return Me
End Get
End Property
Public ReadOnly Property EcoRollData As IEcoRollEngineeringInputData Implements IDriverEngineeringInputData.EcoRollData
Get
Return me
Return Me
End Get
End Property
Public ReadOnly Property PCCData As IPCCEngineeringInputData Implements IDriverEngineeringInputData.PCCData
get
return me
Get
Return Me
End Get
End Property
Public ReadOnly Property PCCEnabledSpeed As MeterPerSecond Implements IPCCEngineeringInputData.PCCEnabledSpeed
get
return PCCEnableSpeedVal.KMPHtoMeterPerSecond()
Get
Return PCCEnableSpeedVal.KMPHtoMeterPerSecond()
End Get
End Property
Public ReadOnly Property IPCCEngineeringInputData_MinSpeed As MeterPerSecond Implements IPCCEngineeringInputData.MinSpeed
get
return PCCMinSpeed.KMPHtoMeterPerSecond()
Get
Return PCCMinSpeed.KMPHtoMeterPerSecond()
End Get
End Property
Public ReadOnly Property MinSpeed As MeterPerSecond Implements IEcoRollEngineeringInputData.MinSpeed
get
Get
Return EcoRollMinSpeed.KMPHtoMeterPerSecond()
End Get
End Property
Public ReadOnly Property PreviewDistanceUseCase1 As Meter Implements IPCCEngineeringInputData.PreviewDistanceUseCase1
get
return PCCPrevewiDistance1.SI(of Meter)
Get
Return PCCPrevewiDistance1.SI(Of Meter)
End Get
End Property
Public ReadOnly Property PreviewDistanceUseCase2 As Meter Implements IPCCEngineeringInputData.PreviewDistanceUseCase2
get
return PCCPreviewDistance2.SI(of Meter)
Get
Return PCCPreviewDistance2.SI(Of Meter)
End Get
End Property
Public ReadOnly Property Underspeed As MeterPerSecond Implements IPCCEngineeringInputData.Underspeed
get
return PCCUnderspeed.KMPHtoMeterPerSecond()
Get
Return PCCUnderspeed.KMPHtoMeterPerSecond()
End Get
End Property
Public ReadOnly Property OverspeedUseCase3 As MeterPerSecond Implements IPCCEngineeringInputData.OverspeedUseCase3
get
Get
Return PCCOverspeedUseCase3.KMPHtoMeterPerSecond()
End Get
End Property
Public ReadOnly Property IEcoRollEngineeringInputData_ActivationDelay As Second Implements IEcoRollEngineeringInputData.ActivationDelay
get
Get
Return EcoRollActivationDelay.SI(Of Second)()
End Get
End Property
Public ReadOnly Property ActivationDelay As Second Implements IEngineStopStartEngineeringInputData.ActivationDelay
Get
return EngineStopStartActivationThreshold.SI(Of Second)()
Return EngineStopStartActivationThreshold.SI(Of Second)()
End Get
End Property
Public ReadOnly Property UnderspeedThreshold As MeterPerSecond Implements IEcoRollEngineeringInputData.UnderspeedThreshold
get
Get
Return EcoRollUnderspeedThreshold.KMPHtoMeterPerSecond()
End Get
End Property
Public ReadOnly Property AccelerationUpperLimit As MeterPerSquareSecond Implements IEcoRollEngineeringInputData.AccelerationUpperLimit
Get
Return EcoRollMaxAcceleration.SI(of MeterPerSquareSecond)
Return EcoRollMaxAcceleration.SI(Of MeterPerSquareSecond)
End Get
End Property
......@@ -427,7 +431,7 @@ Public Class VectoJob
End Property
Public ReadOnly Property UtilityFactorDriving As Double Implements IEngineStopStartEngineeringInputData.UtilityFactorDriving
get
Get
Return EngineStStUtilityFactorDriving
End Get
End Property
......@@ -448,24 +452,24 @@ Public Class VectoJob
Public Property LacPreviewFactor As Double
Public Property LacDfOffset As Double
Public Property LacDfScale As Double
Public Property LacDfTargetSpeedFile(Optional ByVal original As Boolean = false) As String
Public Property LacDfTargetSpeedFile(Optional ByVal original As Boolean = False) As String
Get
If original Then
Return _lacDfTargetSpeedFile.OriginalPath
Else
return _lacDfTargetSpeedFile.FullPath
Return _lacDfTargetSpeedFile.FullPath
End If
End Get
Set(value As String)
_lacDfTargetSpeedFile.Init(_myPath, value)
End Set
End Property
Public Property LacDfVelocityDropFile(optional ByVal original As Boolean = false) As String
Public Property LacDfVelocityDropFile(Optional ByVal original As Boolean = False) As String
Get
If original Then
Return _lacDfVelocityDropFile.OriginalPath
Else
return _lacDfVelocityDropFile.FullPath
Return _lacDfVelocityDropFile.FullPath
End If
End Get
Set(value As String)
......@@ -533,7 +537,7 @@ Public Class VectoJob
If (vectoJob.JobType = VectoSimulationJobType.ConventionalVehicle OrElse vectoJob.JobType = VectoSimulationJobType.ParallelHybridVehicle) _
AndAlso gearboxInputData Is Nothing Then _
result.Add(New ValidationResult("Gearbox File is missing or invalid"))
If (mode = ExecutionMode.Engineering andalso vectoJob.JobType = VectoSimulationJobType.ConventionalVehicle OrElse vectoJob.JobType = VectoSimulationJobType.ParallelHybridVehicle) _
If (mode = ExecutionMode.Engineering AndAlso vectoJob.JobType = VectoSimulationJobType.ConventionalVehicle OrElse vectoJob.JobType = VectoSimulationJobType.ParallelHybridVehicle) _
AndAlso gearshiftInputData Is Nothing Then _
result.Add(New ValidationResult("Gearshift File is missing or invalid"))
......@@ -557,8 +561,9 @@ Public Class VectoJob
New ValidationResult("Vecto Job Configuration is invalid. ", result.Select(Function(r) r.ErrorMessage).ToList())
End If
Dim dataFactory As DeclarationModeTruckVectoRunDataFactory = New DeclarationModeTruckVectoRunDataFactory(vectoJob, Nothing)
'Dim dataFactory As DeclarationModeTruckVectoRunDataFactory = New DeclarationModeTruckVectoRunDataFactory(vectoJob, Nothing)
Dim dataFactory = _kernel.Value.Get(Of IVectoRunDataFactoryFactory).CreateDeclarationRunDataFactory(vectoJob, Nothing, Nothing)
jobData = dataFactory.NextRun().First()
Else
If vehicleInputData.SavedInDeclarationMode Then
......
......@@ -15,17 +15,21 @@ Imports System.ComponentModel.DataAnnotations
Imports System.IO
Imports System.Linq
Imports System.Xml
Imports Ninject
Imports TUGraz.VECTO.Input_Files
Imports TUGraz.VectoCommon.BusAuxiliaries
Imports TUGraz.VectoCommon.InputData
Imports TUGraz.VectoCommon.Models
Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore
Imports TUGraz.VectoCore.InputData.Impl
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents
Imports TUGraz.VectoCore.Models.Declaration
Imports TUGraz.VectoCore.Models.SimulationComponent.Data
Imports TUGraz.VectoCore.Models.SimulationComponent.Impl
Imports TUGraz.VectoCore.Utils
Imports TUGraz.VectoCore.Utils.Ninject
Imports DeclarationDataAdapterHeavyLorry = TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.HeavyLorry.DeclarationDataAdapterHeavyLorry
<CustomValidation(GetType(Vehicle), "ValidateVehicle")>
......@@ -49,7 +53,7 @@ Public Class Vehicle
Public RetarderRatio As Double = 0
Public ReadOnly RetarderLossMapFile As SubPath
Public ReadOnly EmTorqueLimitsFile As SubPath
public ReadOnly PropulsionTorqueFile as SubPath
Public ReadOnly PropulsionTorqueFile As SubPath
Public DynamicTyreRadius As Double
Public ReadOnly Axles As List(Of AxleInputData)
......@@ -74,16 +78,16 @@ Public Class Vehicle
Public legClass As LegislativeClass
Public VehicleHeight As Double
public EcoRolltype as EcoRollType
public PCC as PredictiveCruiseControlType
public EngineStop as Boolean
Public EcoRolltype As EcoRollType
Public PCC As PredictiveCruiseControlType
Public EngineStop As Boolean
Public VehicleTankSystem As TankSystem?
Public ReadOnly ElectricMotorFile As SubPath
Public ReadOnly GenSetEMFile As SubPath
public ReadOnly ReessPacks As List(Of Tuple(Of String, Integer, Integer))
Public ReadOnly ReessPacks As List(Of Tuple(Of String, Integer, Integer))
Public ElectricMotorPosition As PowertrainPosition
Public ElectricMotorCount As Integer
......@@ -98,7 +102,7 @@ Public Class Vehicle
'Public ElectricMotorMechEff As Double
Public GenSetLossMap As SubPath
public GearDuringPTODrive As UInteger?
Public GearDuringPTODrive As UInteger?
Public EngineSpeedDuringPTODrive As PerSecond
Public ElectricMotorPerGearRatios As Double()
Public IEPCFile As SubPath
......@@ -110,20 +114,20 @@ Public Class Vehicle
RetarderLossMapFile = New SubPath
AngledriveLossMapFile = New SubPath()
EmTorqueLimitsFile = new SubPath()
EmTorqueLimitsFile = New SubPath()
PropulsionTorqueFile = New SubPath()
IEPCFile = new SubPath()
IEPCFile = New SubPath()
Axles = New List(Of AxleInputData)
torqueLimitsList = New List(Of ITorqueLimitInputData)
ReessPacks = new List(Of Tuple(Of String,Integer,Integer))
ReessPacks = New List(Of Tuple(Of String, Integer, Integer))
PtoLossMap = New SubPath()
PtoCycleStandstill = New SubPath()
PtoCycleDriving = new SubPath()
PtoCycleDriving = New SubPath()
ElectricMotorFile = New SubPath()
ElectricMotorMechLossMap = new SubPath()
GenSetEMFile = new SubPath()
GenSetMechLossMap = new SubPath()
ElectricMotorMechLossMap = New SubPath()
GenSetEMFile = New SubPath()
GenSetMechLossMap = New SubPath()
SetDefault()
End Sub
......@@ -149,15 +153,16 @@ Public Class Vehicle
Try
If mode = ExecutionMode.Declaration Then
Dim doa As DeclarationDataAdapterHeavyLorry = New DeclarationDataAdapterHeavyLorry()
'Dim doa As ILorryDeclarationDataAdapter = CType(_kernel.Value.Get(Of IDeclarationDataAdapterFactory).CreateDataAdapter(New VehicleTypeAndArchitectureStringHelperRundata.VehicleClassification(vehicle)), ILorryDeclarationDataAdapter)
Dim segment As Segment = DeclarationData.TruckSegments.Lookup(vehicle.VehicleCategory, vehicle.AxleConfiguration,
vehicle.GrossVehicleMassRating, vehicle.CurbMassChassis, False)
vehicleData = doa.CreateVehicleData(vehicle, segment, segment.Missions.First(),
segment.Missions.First().Loadings.First(), true)
airdragData = doa.CreateAirdragData(vehicle, segment.Missions.First(), segment)
retarderData = doa.CreateRetarderData(vehicle)
angledriveData = doa.CreateAngledriveData(vehicle)
ptoData = doa.CreatePTOTransmissionData(vehicle)
vehicleData = New LorryVehicleDataAdapter().CreateVehicleData(vehicle, segment, segment.Missions.First(),
segment.Missions.First().Loadings.First(), True)
airdragData = New AirdragDataAdapter().CreateAirdragData(vehicle, segment.Missions.First(), segment)
retarderData = New RetarderDataAdapter().CreateRetarderData(vehicle)
angledriveData = New AngledriveDataAdapter().CreateAngledriveData(vehicle)
ptoData = New PTODataAdapterLorry().CreatePTOTransmissionData(vehicle)
Else
Dim doa As EngineeringDataAdapter = New EngineeringDataAdapter()
vehicleData = doa.CreateVehicleData(vehicle)
......
......@@ -6,6 +6,8 @@ Imports TUGraz.VectoCommon.Models
Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore.InputData.Reader.ComponentData
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.CompletedBus.Generic
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents
Imports TUGraz.VectoCore.Models.BusAuxiliaries
Imports TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.Pneumatics
Imports TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces
......@@ -29,6 +31,8 @@ Namespace UnitTests
Private _defaultInputConfig As PneumaticUserInputsConfig
Private _Signals As ISignals = New Signals
<OneTimeSetUp>
Public Sub RunBeforeAnyTests()
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory)
......@@ -48,7 +52,7 @@ Namespace UnitTests
_defaultInputConfig.CompressorGearEfficiency = 0.8
_defaultInputConfig.SmartRegeneration = True
'_defaultInputConfig.RetarderBrake = True
_defaultInputConfig.KneelingHeight = 80.SI(Unit.SI.Milli.Meter).Cast (of Meter)
_defaultInputConfig.KneelingHeight = 80.SI(Unit.SI.Milli.Meter).Cast(Of Meter)
_defaultInputConfig.AirSuspensionControl = ConsumerTechnology.Electrically ' "Electrically"
_defaultInputConfig.AdBlueDosing = ConsumerTechnology.Pneumatically ' "Pneumatic"
_defaultInputConfig.Doors = ConsumerTechnology.Pneumatically ' "Pneumatic"
......@@ -68,7 +72,8 @@ Namespace UnitTests
psUserInputsConfig.Doors = ConsumerTechnology.Pneumatically '"Pneumatic"
psUserInputsConfig.AdBlueDosing = ConsumerTechnology.Pneumatically ' "Pneumatic"
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -89,7 +94,7 @@ Namespace UnitTests
initialise()
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -113,7 +118,7 @@ Namespace UnitTests
initialise()
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap =CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -140,7 +145,7 @@ Namespace UnitTests
_defaultInputConfig.CompressorGearEfficiency = 0.8
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -162,7 +167,7 @@ Namespace UnitTests
initialise()
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -191,7 +196,7 @@ Namespace UnitTests
_defaultInputConfig.SmartRegeneration = False
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -218,7 +223,7 @@ Namespace UnitTests
'_defaultInputConfig.RetarderBrake = False
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.None)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.None)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -246,7 +251,7 @@ Namespace UnitTests
_defaultInputConfig.KneelingHeight = 100.SI(Unit.si.Milli.Meter).Cast (Of Meter)
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -271,7 +276,7 @@ Namespace UnitTests
_defaultInputConfig.AirSuspensionControl = ConsumerTechnology.Mechanically
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -298,7 +303,7 @@ Namespace UnitTests
_defaultInputConfig.AdBlueDosing = ConsumerTechnology.Pneumatically
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
......@@ -325,7 +330,7 @@ Namespace UnitTests
_defaultInputConfig.Doors = ConsumerTechnology.Electrically
Dim psAuxConfig = New DeclarationDataAdapterCompletedBusGeneric().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psAuxConfig = New GenericCompletedBusAuxiliaryDataAdapter().CreatePneumaticAuxConfig(RetarderType.LossesIncludedInTransmission)
Dim psCompressorMap = CompressorMapReader.ReadFile(_compressorMapPath, 1.0, "")
Dim auxConfig As IAuxiliaryConfig = GetAuxConfig(psAuxConfig)
......
......@@ -6,6 +6,7 @@ Imports TUGraz.VectoCommon.Models
Imports TUGraz.VectoCommon.Utils
Imports TUGraz.VectoCore.InputData.FileIO.JSON
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
Imports TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponents
Imports TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
Imports TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces.DownstreamModules.HVAC
Imports TUGraz.VectoCore.Models.Declaration
......@@ -88,9 +89,9 @@ Namespace UnitTests
.MissionType = MissionType.Urban
}
Dim auxInput as IBusAuxiliariesDeclarationData = nothing
Dim auxInput as IBusAuxiliariesDeclarationData = Nothing
Dim dao = New DeclarationDataAdapterCompletedBusGeneric()
Dim dao = New GenericCompletedBusAuxiliaryDataAdapter()
Dim target As ISSMDeclarationInputs = dao.CreateSSMModelParameters(auxInput, mission, FuelData.Diesel, LoadingType.ReferenceLoad)
If section = "BusParameterisation" Then
......@@ -595,9 +596,9 @@ Namespace UnitTests
}
}
Dim auxInput as IBusAuxiliariesDeclarationData = nothing
Dim auxInput as IBusAuxiliariesDeclarationData = Nothing
Dim dao = New DeclarationDataAdapterCompletedBusGeneric()
Dim dao = New GenericCompletedBusAuxiliaryDataAdapter()
Dim target As SSMTOOL = New SSMTOOL(dao.CreateSSMModelParameters(auxInput, mission,
FuelData.Diesel, LoadingType.ReferenceLoad))
......
......@@ -53,10 +53,10 @@ namespace TUGraz.VectoCommon.Models
{
public static string PrimaryBus = "PrimaryBus";
public static string Lorry = "Lorry";
public static string CompletedBus = "CompletedBus";
public static string Van = "Van";
public const string PrimaryBus = "PrimaryBus";
public const string Lorry = "Lorry";
public const string CompletedBus = "CompletedBus";
public const string Van = "Van";
public static HashSet<string> SuperCategories { get; } = new HashSet<string>() {
PrimaryBus,
Lorry,
......
......@@ -17,111 +17,114 @@ namespace TUGraz.VectoMockup.Simulation.RundataFactories
{
internal class MockupMultistageCompletedBusRunDataFactory
{
// DeclarationModeCompletedMultistageBusVectoRunDataFactory
// {
//public MockupMultistageCompletedBusRunDataFactory(IMultistepBusInputDataProvider dataProvider,
// IDeclarationReport report) : base(dataProvider, report)
//{
DeclarationModeCompletedMultistageBusVectoRunDataFactory
{
public MockupMultistageCompletedBusRunDataFactory(IMultistepBusInputDataProvider dataProvider,
IDeclarationReport report) : base(dataProvider, report)
{
//}
}
//#region Overrides of DeclarationModeCompletedMultistageBusVectoRunDataFactory
#region Overrides of DeclarationModeCompletedMultistageBusVectoRunDataFactory
//protected override void Initialize()
//{
protected override void Initialize()
{
// _segmentCompletedBus = GetCompletedSegment(CompletedVehicle, PrimaryVehicle.AxleConfiguration);
_segmentCompletedBus = GetCompletedSegment(CompletedVehicle, PrimaryVehicle.AxleConfiguration);
// //base.Initialize();
//}
//base.Initialize();
}
//protected override IEnumerable<VectoRunData> VectoRunDataHeavyBusCompleted()
//{
protected override IEnumerable<VectoRunData> VectoRunDataHeavyBusCompleted()
{
// return base.VectoRunDataHeavyBusCompleted();
//}
return base.VectoRunDataHeavyBusCompleted();
}
//protected override VectoRunData CreateVectoRunDataSpecific(Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading, int modeIdx)
//{
// var cycle = DeclarationData.CyclesCache.GetOrAdd(mission.MissionType, _ => DrivingCycleDataReader.ReadFromStream(mission.CycleFile, CycleType.DistanceBased, "", false));
protected override VectoRunData CreateVectoRunDataSpecific(Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading, int modeIdx)
{
var cycle = DeclarationData.CyclesCache.GetOrAdd(mission.MissionType, _ => DrivingCycleDataReader.ReadFromStream(mission.CycleFile, CycleType.DistanceBased, "", false));
// var simulationRunData = new VectoRunData
// {
// Loading = loading.Key,
// VehicleData = DataAdapterSpecific.CreateVehicleData(PrimaryVehicle, CompletedVehicle, _segmentCompletedBus,
// mission, loading),
// Retarder = PrimaryBusMockupRunDataFactory.CreateMockupRetarder(PrimaryVehicle),
// AirdragData = PrimaryBusMockupRunDataFactory.CreateMockupAirdragData(CompletedVehicle),
// EngineData = PrimaryBusMockupRunDataFactory.CreateMockupEngineData(PrimaryVehicle, modeIdx, CompletedVehicle.TankSystem),
// //ElectricMachinesData = PrimaryBusMockupRunDataFactory.CreateMockupElectricMachineData()
// AngledriveData = PrimaryBusMockupRunDataFactory.CreateMockupAngleDriveData(PrimaryVehicle),
// AxleGearData = PrimaryBusMockupRunDataFactory.CreateMockupAxleGearData(PrimaryVehicle),
var simulationRunData = new VectoRunData
{
Loading = loading.Key,
VehicleData = DataAdapterSpecific.CreateVehicleData(PrimaryVehicle, CompletedVehicle, _segmentCompletedBus,
mission, loading),
Retarder = PrimaryBusMockupRunDataFactory.CreateMockupRetarder(PrimaryVehicle),
AirdragData = PrimaryBusMockupRunDataFactory.CreateMockupAirdragData(CompletedVehicle),
EngineData = PrimaryBusMockupRunDataFactory.CreateMockupEngineData(PrimaryVehicle, modeIdx, CompletedVehicle.TankSystem),
//ElectricMachinesData = PrimaryBusMockupRunDataFactory.CreateMockupElectricMachineData()
AngledriveData = PrimaryBusMockupRunDataFactory.CreateMockupAngleDriveData(PrimaryVehicle),
AxleGearData = PrimaryBusMockupRunDataFactory.CreateMockupAxleGearData(PrimaryVehicle),
Cycle = new DrivingCycleProxy(cycle, mission.MissionType.ToString()),
Mission = mission,
GearboxData = PrimaryBusMockupRunDataFactory.CreateMockupGearboxData(PrimaryVehicle),
InputData = InputDataProvider,
SimulationType = SimulationType.DistanceCycle,
ExecutionMode = ExecutionMode.Declaration,
JobName = InputDataProvider.JobInputData.ManufacturingStages.Last().Vehicle.Identifier,
Report = Report,
//Aux = PrimaryBusMockupRunDataFactory.CreateMockupBusAux(CompletedVehicle),
// //AirdragData = DataAdapterSpecific.CreateAirdragData(CompletedVehicle, mission),
// //EngineData = DataAdapterSpecific.CreateEngineData(PrimaryVehicle, modeIdx, mission),
// //ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>(),
// //GearboxData = _gearboxData,
// //AxleGearData = _axlegearData,
// //AngledriveData = _angledriveData,
// Aux = DataAdapterSpecific.CreateAuxiliaryData(PrimaryVehicle.Components.AuxiliaryInputData,
// PrimaryVehicle.Components.BusAuxiliaries, mission.MissionType, _segmentCompletedBus.VehicleClass, CompletedVehicle.Length,
// PrimaryVehicle.Components.AxleWheels.NumSteeredAxles),
//Cycle = new DrivingCycleProxy(cycle, mission.MissionType.ToString()),
// Mission = mission,
// GearboxData = PrimaryBusMockupRunDataFactory.CreateMockupGearboxData(PrimaryVehicle),
// InputData = InputDataProvider,
// SimulationType = SimulationType.DistanceCycle,
//Retarder = _retarderData,
////DriverData = _driverData,
//ExecutionMode = ExecutionMode.Declaration,
// JobName = InputDataProvider.JobInputData.ManufacturingStages.Last().Vehicle.Identifier,
//JobName = InputDataProvider.JobInputData.ManufacturingStages.Last().Vehicle.Identifier,//?!? Jobname
ModFileSuffix = $"_{_segmentCompletedBus.VehicleClass.GetClassNumber()}-Specific_{loading.Key}",
//Report = Report,
// //Aux = PrimaryBusMockupRunDataFactory.CreateMockupBusAux(CompletedVehicle),
// // //AirdragData = DataAdapterSpecific.CreateAirdragData(CompletedVehicle, mission),
// // //EngineData = DataAdapterSpecific.CreateEngineData(PrimaryVehicle, modeIdx, mission),
// // //ElectricMachinesData = new List<Tuple<PowertrainPosition, ElectricMotorData>>(),
// // //GearboxData = _gearboxData,
// // //AxleGearData = _axlegearData,
// // //AngledriveData = _angledriveData,
// // Aux = DataAdapterSpecific.CreateAuxiliaryData(PrimaryVehicle.Components.AuxiliaryInputData,
// // PrimaryVehicle.Components.BusAuxiliaries, mission.MissionType, _segmentCompletedBus.VehicleClass, CompletedVehicle.Length,
// // PrimaryVehicle.Components.AxleWheels.NumSteeredAxles),
// //Cycle = new DrivingCycleProxy(cycle, mission.MissionType.ToString()),
// //Retarder = _retarderData,
// ////DriverData = _driverData,
// //ExecutionMode = ExecutionMode.Declaration,
// //JobName = InputDataProvider.JobInputData.ManufacturingStages.Last().Vehicle.Identifier,//?!? Jobname
// ModFileSuffix = $"_{_segmentCompletedBus.VehicleClass.GetClassNumber()}-Specific_{loading.Key}",
// //Report = Report,
// //Mission = mission,
// //InputDataHash = InputDataProvider.XMLHash,// right hash?!?
// //SimulationType = SimulationType.DistanceCycle,
// //VehicleDesignSpeed = _segmentCompletedBus.DesignSpeed,
// //GearshiftParameters = _gearshiftData,
// };
// if (simulationRunData.EngineData != null) {
// simulationRunData.EngineData.FuelMode = 0;
// }
// simulationRunData.VehicleData.VehicleClass = _segmentCompletedBus.VehicleClass;
// simulationRunData.BusAuxiliaries = DataAdapterSpecific.CreateBusAuxiliariesData(mission, PrimaryVehicle, CompletedVehicle, simulationRunData);
// return simulationRunData;
// //return base.CreateVectoRunDataSpecific(mission, loading, modeIdx);
//}
//protected override VectoRunData CreateVectoRunDataGeneric(Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading, Segment primarySegment, int modeIdx)
//{
// var cycle = DeclarationData.CyclesCache.GetOrAdd(mission.MissionType, _ => DrivingCycleDataReader.ReadFromStream(mission.CycleFile, CycleType.DistanceBased, "", false));
// return new VectoRunData() {
//Mission = mission,
// Loading = loading.Key,
// VehicleData = new VehicleData() {
// Loading = loading.Value.Item1,
// },
// EngineData = PrimaryBusMockupRunDataFactory.CreateMockupEngineData(PrimaryVehicle, modeIdx, CompletedVehicle.TankSystem),
// JobName = InputDataProvider.JobInputData.ManufacturingStages.Last().Vehicle.Identifier,
// ExecutionMode = ExecutionMode.Declaration,
//InputDataHash = InputDataProvider.XMLHash,// right hash?!?
//SimulationType = SimulationType.DistanceCycle,
// Cycle = new DrivingCycleProxy(cycle, mission.MissionType.ToString()),
// Report = Report,
// ModFileSuffix = $"_{_segmentCompletedBus.VehicleClass.GetClassNumber()}-Generic_{loading.Key}",
// };
// return base.CreateVectoRunDataGeneric(mission, loading, primarySegment, modeIdx);
//}
//VehicleDesignSpeed = _segmentCompletedBus.DesignSpeed,
//GearshiftParameters = _gearshiftData,
};
if (simulationRunData.EngineData != null)
{
simulationRunData.EngineData.FuelMode = 0;
}
simulationRunData.VehicleData.VehicleClass = _segmentCompletedBus.VehicleClass;
simulationRunData.BusAuxiliaries = DataAdapterSpecific.CreateBusAuxiliariesData(mission, PrimaryVehicle, CompletedVehicle, simulationRunData);
return simulationRunData;
//return base.CreateVectoRunDataSpecific(mission, loading, modeIdx);
}
// //#endregion
//}
protected override VectoRunData CreateVectoRunDataGeneric(Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading, Segment primarySegment, int modeIdx)
{
var cycle = DeclarationData.CyclesCache.GetOrAdd(mission.MissionType, _ => DrivingCycleDataReader.ReadFromStream(mission.CycleFile, CycleType.DistanceBased, "", false));
return new VectoRunData()
{
Mission = mission,
Loading = loading.Key,
VehicleData = new VehicleData()
{
Loading = loading.Value.Item1,
},
EngineData = PrimaryBusMockupRunDataFactory.CreateMockupEngineData(PrimaryVehicle, modeIdx, CompletedVehicle.TankSystem),
JobName = InputDataProvider.JobInputData.ManufacturingStages.Last().Vehicle.Identifier,
ExecutionMode = ExecutionMode.Declaration,
SimulationType = SimulationType.DistanceCycle,
Cycle = new DrivingCycleProxy(cycle, mission.MissionType.ToString()),
Report = Report,
ModFileSuffix = $"_{_segmentCompletedBus.VehicleClass.GetClassNumber()}-Generic_{loading.Key}",
};
return base.CreateVectoRunDataGeneric(mission, loading, primarySegment, modeIdx);
}
//#endregion
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment