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 b13f5284 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

refactoring structure of input data for ssm calculation

parent ca8fd4a5
Branches
Tags
No related merge requests found
Showing
with 545 additions and 429 deletions
......@@ -223,8 +223,8 @@ Public Class frmHVACTool
cboUnits.DataSource = {"Fraction"}
cboLineType.DataSource = {"Normal", "ActiveVentilation"}
txtEC_EnvironmentConditionsFilePath.Tag = ssmTOOL.GenInputs.EC_EnviromentalConditions_BatchFile
txtEC_EnvironmentConditionsFilePath.Text = GetRelativePath(ssmTOOL.GenInputs.EC_EnviromentalConditions_BatchFile,
txtEC_EnvironmentConditionsFilePath.Tag = ssmTOOL.SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchFile
txtEC_EnvironmentConditionsFilePath.Text = GetRelativePath(ssmTOOL.SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchFile,
Path.GetDirectoryName(vectoFile))
txtEC_EnvironmentConditionsFilePath.ReadOnly = True
btnEnvironmentConditionsSource.Enabled = False
......@@ -244,207 +244,207 @@ Public Class frmHVACTool
BindGrid()
'Bus Parameterisation
txtBusModel.DataBindings.Add("Text", ssmTOOL.GenInputs, "BP_BusModel", False, DataSourceUpdateMode.OnPropertyChanged)
txtRegisteredPassengers.DataBindings.Add("Text", ssmTOOL.GenInputs, "BP_NumberOfPassengers", False,
txtBusModel.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BP_BusModel", False, DataSourceUpdateMode.OnPropertyChanged)
txtRegisteredPassengers.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BP_NumberOfPassengers", False,
DataSourceUpdateMode.OnPropertyChanged)
cmbBusFloorType.DataBindings.Add("Text", ssmTOOL.GenInputs, "BP_BusFloorType", False,
cmbBusFloorType.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BP_BusFloorType", False,
DataSourceUpdateMode.OnPropertyChanged)
chkIsDoubleDecker.DataBindings.Add("Checked", ssmTOOL.GenInputs, "BP_DoubleDecker", False,
chkIsDoubleDecker.DataBindings.Add("Checked", ssmTOOL.SSMInputs, "BP_DoubleDecker", False,
DataSourceUpdateMode.OnPropertyChanged)
dim bLength As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusLength")
dim bLength As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusLength")
AddHandler bLength.Parse, New ConvertEventHandler(AddressOf TextToSI(of Meter))
AddHandler blength.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusLength.DataBindings.Add(bLength)
dim bWidth As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusWidth")
dim bWidth As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusWidth")
AddHandler bWidth.Parse, New ConvertEventHandler(AddressOf TextToSI(of Meter))
AddHandler bWidth.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusWidth.DataBindings.Add(bWidth)
dim bHeight As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusHeight")
dim bHeight As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusHeight")
AddHandler bHeight.Parse, New ConvertEventHandler(AddressOf TextToSI(of Meter))
AddHandler bHeight.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusHeight.DataBindings.Add(bHeight)
dim bFloorSurface As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusFloorSurfaceArea", False,
dim bFloorSurface As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusFloorSurfaceArea", False,
DataSourceUpdateMode.OnPropertyChanged)
AddHandler bFloorSurface.Parse, New ConvertEventHandler(AddressOf TextToSI(of SquareMeter))
AddHandler bFloorSurface.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusFloorSurfaceArea.DataBindings.Add(bFloorSurface)
dim bWindowSF As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusWindowSurface")
dim bWindowSF As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusWindowSurface")
AddHandler bWindowSF.Parse, New ConvertEventHandler(AddressOf TextToSI(of SquareMeter))
AddHandler bWindowSF.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusWindowSurfaceArea.DataBindings.Add(bWindowSF)
dim bBusSF As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusSurfaceArea")
dim bBusSF As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusSurfaceArea")
AddHandler bBusSF.Parse, New ConvertEventHandler(AddressOf TextToSI(of SquareMeter))
AddHandler bBusSF.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusSurfaceArea.DataBindings.Add(bBusSF)
dim bBusVol As Binding = New Binding("Text", ssmTOOL.GenInputs, "BP_BusVolume")
dim bBusVol As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BP_BusVolume")
AddHandler bBusVol.Parse, New ConvertEventHandler(AddressOf TextToSI(of CubicMeter))
AddHandler bBusVol.Format , New ConvertEventHandler(AddressOf SIToText)
txtBusVolume.DataBindings.Add(bBusVol)
'Boundary Conditions
txtBC_GFactor.DataBindings.Add("Text", ssmTOOL.GenInputs, "BC_GFactor")
txtBC_SolarClouding.DataBindings.Add("Text", ssmTOOL.GenInputs, "BC_SolarClouding")
txtBC_GFactor.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BC_GFactor")
txtBC_SolarClouding.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BC_SolarClouding")
dim bPassHeat As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_HeatPerPassengerIntoCabinW")
dim bPassHeat As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_HeatPerPassengerIntoCabinW")
AddHandler bPassHeat.Parse, New ConvertEventHandler(AddressOf TextToSI(of Watt))
AddHandler bPassHeat.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_HeatPerPassengerIntoCabinW.DataBindings.Add(bPassHeat)
dim bPassBT As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_PassengerBoundaryTemperature")
dim bPassBT As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_PassengerBoundaryTemperature")
AddHandler bPassBT.Parse, New ConvertEventHandler(AddressOf TextToSIKelvin)
AddHandler bPassBT.Format , New ConvertEventHandler(AddressOf SIKelvinToText)
txtBC_PassengerBoundaryTemperature.DataBindings.Add(bPassBT)
dim bPassLowFloor As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_PassengerDensityLowFloor")
dim bPassLowFloor As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_PassengerDensityLowFloor")
AddHandler bPassLowFloor.Parse, New ConvertEventHandler(AddressOf TextToSI(of PerSquareMeter))
AddHandler bPassLowFloor.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_PassengerDensityLowFloor.DataBindings.Add(bPassLowFloor)
dim bPassSemi As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_PassengerDensitySemiLowFloor")
dim bPassSemi As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_PassengerDensitySemiLowFloor")
AddHandler bPassSemi.Parse, New ConvertEventHandler(AddressOf TextToSI(of PerSquareMeter))
AddHandler bPassSemi.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_PassengerDensitySemiLowFloor.DataBindings.Add(bPassSemi)
dim bPassRaised As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_PassengerDensityRaisedFloor")
dim bPassRaised As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_PassengerDensityRaisedFloor")
AddHandler bPassRaised.Parse, New ConvertEventHandler(AddressOf TextToSI(of PerSquareMeter))
AddHandler bPassRaised.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_PassengerDensityRaisedFloor.DataBindings.Add(bPassRaised)
txtBC_CalculatedPassengerNumber.DataBindings.Add("Text", ssmTOOL.GenInputs, "BC_CalculatedPassengerNumber")
txtBC_CalculatedPassengerNumber.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BC_CalculatedPassengerNumber")
dim bUVal As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_UValues")
dim bUVal As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_UValues")
AddHandler bUVal.Parse, New ConvertEventHandler(AddressOf TextToSI(of WattPerKelvinSquareMeter))
AddHandler bUVal.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_UValues.DataBindings.Add(bUVal)
dim bPassBdT As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_HeatingBoundaryTemperature")
dim bPassBdT As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_HeatingBoundaryTemperature")
AddHandler bPassBdT.Parse, New ConvertEventHandler(AddressOf TextToSIKelvin)
AddHandler bPassBdT.Format , New ConvertEventHandler(AddressOf SIKelvinToText)
txtBC_HeatingBoundaryTemperature.DataBindings.Add(bPassBdT)
dim bBdTCool As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_CoolingBoundaryTemperature")
dim bBdTCool As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_CoolingBoundaryTemperature")
AddHandler bBdTCool.Parse, New ConvertEventHandler(AddressOf TextToSIKelvin)
AddHandler bBdTCool.Format , New ConvertEventHandler(AddressOf SIKelvinToText)
txtBC_CoolingBoundaryTemperature.DataBindings.Add(bBdTCool)
dim bCoolingOff As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_TemperatureCoolingTurnsOff")
dim bCoolingOff As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_TemperatureCoolingTurnsOff")
AddHandler bCoolingOff.Parse, New ConvertEventHandler(AddressOf TextToSIKelvin)
AddHandler bCoolingOff.Format , New ConvertEventHandler(AddressOf SIKelvinToText)
txtBC_TemperatureCoolingOff.DataBindings.Add(bCoolingOff)
dim bVentPerHour As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_HighVentilation")
dim bVentPerHour As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_HighVentilation")
AddHandler bVentPerHour.Parse, New ConvertEventHandler(AddressOf TextToSIPerHour)
AddHandler bVentPerHour.Format , New ConvertEventHandler(AddressOf SIPerHourToText)
txtBC_HighVentilation.DataBindings.Add(bVentPerHour)
dim bVentLPerHour As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_lowVentilation")
dim bVentLPerHour As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_lowVentilation")
AddHandler bVentLPerHour.Parse, New ConvertEventHandler(AddressOf TextToSIPerHour)
AddHandler bVentLPerHour.Format , New ConvertEventHandler(AddressOf SIPerHourToText)
txtBC_lowVentilation.DataBindings.Add(bVentLPerHour)
dim bHigh As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_High")
dim bHigh As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_High")
AddHandler bHigh.Parse, New ConvertEventHandler(AddressOf TextToSICubicMeterPerHour)
AddHandler bHigh.Format , New ConvertEventHandler(AddressOf SICubicMeterPerHourToText)
txtBC_High.DataBindings.Add(bHigh)
dim bLow As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_Low")
dim bLow As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_Low")
AddHandler bLow.Parse, New ConvertEventHandler(AddressOf TextToSICubicMeterPerHour)
AddHandler bLow.Format , New ConvertEventHandler(AddressOf SICubicMeterPerHourToText)
txtBC_Low.DataBindings.Add(bLow)
dim bHiP As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_HighVentPower")
dim bHiP As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_HighVentPower")
AddHandler bHiP.Parse, New ConvertEventHandler(AddressOf TextToSI(of Watt))
AddHandler bHiP.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_HighVentPowerW.DataBindings.Add(bHiP)
dim bLoP As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_LowVentPower")
dim bLoP As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_LowVentPower")
AddHandler bLoP.Parse, New ConvertEventHandler(AddressOf TextToSI(of Watt))
AddHandler bLoP.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_LowVentPowerW.DataBindings.Add(bLoP)
dim bSpecPwr As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_SpecificVentilationPower")
dim bSpecPwr As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_SpecificVentilationPower")
AddHandler bSpecPwr.Parse, New ConvertEventHandler(AddressOf TextToSIWattHourPerCubicMeter)
AddHandler bSpecPwr.Format , New ConvertEventHandler(AddressOf SIWattHourPerCubicMeterToText)
txtBC_SpecificVentilationPower.DataBindings.Add(bSpecPwr)
txtBC_AuxHeaterEfficiency.DataBindings.Add("Text", ssmTOOL.GenInputs, "BC_AuxHeaterEfficiency")
txtBC_AuxHeaterEfficiency.DataBindings.Add("Text", ssmTOOL.SSMInputs, "BC_AuxHeaterEfficiency")
dim bGCV As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_GCVDieselOrHeatingOil")
dim bGCV As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_GCVDieselOrHeatingOil")
AddHandler bGCV.Parse, New ConvertEventHandler(AddressOf TextToSIkWhkg)
AddHandler bGCV.Format , New ConvertEventHandler(AddressOf SIWhkgToText)
txtBC_GCVDieselOrHeatingOil.DataBindings.Add(bGCV)
dim bWnd As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_WindowAreaPerUnitBusLength")
dim bWnd As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_WindowAreaPerUnitBusLength")
AddHandler bWnd.Parse, New ConvertEventHandler(AddressOf TextToSI(of SquareMeterPerMeter))
AddHandler bWnd.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_WindowAreaPerUnitBusLength.DataBindings.Add(bWnd)
dim bFrReW As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_FrontRearWindowArea")
dim bFrReW As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_FrontRearWindowArea")
AddHandler bFrReW.Parse, New ConvertEventHandler(AddressOf TextToSI(of SquareMeter))
AddHandler bFrReW.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_FrontRearWindowArea.DataBindings.Add(bFrReW)
dim bTDiff As Binding = New Binding("Text", ssmTOOL.GenInputs, "BC_MaxTemperatureDeltaForLowFloorBusses")
dim bTDiff As Binding = New Binding("Text", ssmTOOL.SSMInputs, "BC_MaxTemperatureDeltaForLowFloorBusses")
AddHandler bTDiff.Parse, New ConvertEventHandler(AddressOf TextToSI(of Kelvin))
AddHandler bTDiff.Format , New ConvertEventHandler(AddressOf SIToText)
txtBC_MaxTemperatureDeltaForLowFloorBusses.DataBindings.Add(bTDiff)
txtBC_MaxPossibleBenefitFromTechnologyList.DataBindings.Add("Text", ssmTOOL.GenInputs,
txtBC_MaxPossibleBenefitFromTechnologyList.DataBindings.Add("Text", ssmTOOL.SSMInputs,
"BC_MaxPossibleBenefitFromTechnologyList")
'EnviromentalConditions
dim bEnvT As Binding = New Binding("Text", ssmTOOL.GenInputs, "EC_EnviromentalTemperature")
dim bEnvT As Binding = New Binding("Text", ssmTOOL.SSMInputs, "EC_EnviromentalTemperature")
AddHandler bEnvT.Parse, New ConvertEventHandler(AddressOf TextToSIKelvin)
AddHandler bEnvT.Format , New ConvertEventHandler(AddressOf SIKelvinToText)
txtEC_EnviromentalTemperature.DataBindings.Add(bEnvT)
dim bSolar As Binding = New Binding("Text", ssmTOOL.GenInputs, "EC_Solar")
dim bSolar As Binding = New Binding("Text", ssmTOOL.SSMInputs, "EC_Solar")
AddHandler bSolar.Parse, New ConvertEventHandler(AddressOf TextToSI(of WattPerSquareMeter))
AddHandler bSolar.Format , New ConvertEventHandler(AddressOf SIToText)
txtEC_Solar.DataBindings.Add(bSolar)
chkEC_BatchMode.DataBindings.Add("Checked", ssmTOOL.GenInputs, "EC_EnviromentalConditions_BatchEnabled", False,
chkEC_BatchMode.DataBindings.Add("Checked", ssmTOOL.SSMInputs, "EC_EnviromentalConditions_BatchEnabled", False,
DataSourceUpdateMode.OnPropertyChanged)
'AC-system
cboAC_CompressorType.DataBindings.Add("Text", ssmTOOL.GenInputs, "AC_CompressorType", False,
cboAC_CompressorType.DataBindings.Add("Text", ssmTOOL.SSMInputs, "AC_CompressorType", False,
DataSourceUpdateMode.OnPropertyChanged)
txtAC_CompressorType.DataBindings.Add("Text", ssmTOOL.GenInputs, "AC_CompressorTypeDerived")
txtAC_CompressorType.DataBindings.Add("Text", ssmTOOL.SSMInputs, "AC_CompressorTypeDerived")
dim bAcPwr As Binding = New Binding("Text", ssmTOOL.GenInputs, "AC_CompressorCapacitykW")
dim bAcPwr As Binding = New Binding("Text", ssmTOOL.SSMInputs, "AC_CompressorCapacitykW")
AddHandler bAcPwr.Parse, New ConvertEventHandler(AddressOf TextToSIKiloWatt)
AddHandler bAcPwr.Format , New ConvertEventHandler(AddressOf SIKiloWattToText)
txtAC_CompressorCapacitykW.DataBindings.Add(bAcPwr)
txtAC_COP.DataBindings.Add("Text", ssmTOOL.GenInputs, "AC_COP")
txtAC_COP.DataBindings.Add("Text", ssmTOOL.SSMInputs, "AC_COP")
'Ventilation
chkVEN_VentilationOnDuringHeating.DataBindings.Add("Checked", ssmTOOL.GenInputs, "VEN_VentilationOnDuringHeating",
chkVEN_VentilationOnDuringHeating.DataBindings.Add("Checked", ssmTOOL.SSMInputs, "VEN_VentilationOnDuringHeating",
False, DataSourceUpdateMode.OnPropertyChanged)
chkVEN_VentilationWhenBothHeatingAndACInactive.DataBindings.Add("Checked", ssmTOOL.GenInputs,
chkVEN_VentilationWhenBothHeatingAndACInactive.DataBindings.Add("Checked", ssmTOOL.SSMInputs,
"VEN_VentilationWhenBothHeatingAndACInactive", False, DataSourceUpdateMode.OnPropertyChanged)
chkVEN_VentilationDuringAC.DataBindings.Add("Checked", ssmTOOL.GenInputs, "VEN_VentilationDuringAC", False,
chkVEN_VentilationDuringAC.DataBindings.Add("Checked", ssmTOOL.SSMInputs, "VEN_VentilationDuringAC", False,
DataSourceUpdateMode.OnPropertyChanged)
cboVEN_VentilationFlowSettingWhenHeatingAndACInactive.DataBindings.Add("Text", ssmTOOL.GenInputs,
cboVEN_VentilationFlowSettingWhenHeatingAndACInactive.DataBindings.Add("Text", ssmTOOL.SSMInputs,
"VEN_VentilationFlowSettingWhenHeatingAndACInactive")
cboVEN_VentilationDuringHeating.DataBindings.Add("Text", ssmTOOL.GenInputs, "VEN_VentilationDuringHeating")
cboVEN_VentilationDuringCooling.DataBindings.Add("Text", ssmTOOL.GenInputs, "VEN_VentilationDuringCooling")
cboVEN_VentilationDuringHeating.DataBindings.Add("Text", ssmTOOL.SSMInputs, "VEN_VentilationDuringHeating")
cboVEN_VentilationDuringCooling.DataBindings.Add("Text", ssmTOOL.SSMInputs, "VEN_VentilationDuringCooling")
'Aux. Heater
dim bHtr As Binding = New Binding("Text", ssmTOOL.GenInputs, "AH_FuelFiredHeaterkW")
dim bHtr As Binding = New Binding("Text", ssmTOOL.SSMInputs, "AH_FuelFiredHeaterkW")
AddHandler bHtr.Parse, New ConvertEventHandler(AddressOf TextToSIKiloWatt)
AddHandler bHtr.Format , New ConvertEventHandler(AddressOf SIKiloWattToText)
txtAH_FuelFiredHeaterkW.DataBindings.Add(bHtr)
txtAH_FuelEnergyHeatToCoolant.DataBindings.Add("Text", ssmTOOL.GenInputs, "AH_FuelEnergyToHeatToCoolant")
txtAH_CoolantHeatToAirCabinHeater.DataBindings.Add("Text", ssmTOOL.GenInputs,
txtAH_FuelEnergyHeatToCoolant.DataBindings.Add("Text", ssmTOOL.SSMInputs, "AH_FuelEnergyToHeatToCoolant")
txtAH_CoolantHeatToAirCabinHeater.DataBindings.Add("Text", ssmTOOL.SSMInputs,
"AH_CoolantHeatTransferredToAirCabinHeater")
End Sub
......@@ -455,13 +455,13 @@ Public Class frmHVACTool
' Dim bus As IBus = DirectCast(cboBuses.SelectedItem, IBus)
' ssmTOOL.GenInputs.BP_BusModel = bus.Model
' ssmTOOL.GenInputs.BP_NumberOfPassengers = bus.RegisteredPassengers
' ssmTOOL.GenInputs.BP_BusFloorType = bus.FloorType
' ssmTOOL.GenInputs.BP_DoubleDecker = bus.IsDoubleDecker
' ssmTOOL.GenInputs.BP_BusLength = bus.LengthInMetres
' ssmTOOL.GenInputs.BP_BusWidth = bus.WidthInMetres
' ssmTOOL.GenInputs.BP_BusHeight = bus.HeightInMetres
' ssmTOOL.SSMInputs.BP_BusModel = bus.Model
' ssmTOOL.SSMInputs.BP_NumberOfPassengers = bus.RegisteredPassengers
' ssmTOOL.SSMInputs.BP_BusFloorType = bus.FloorType
' ssmTOOL.SSMInputs.BP_DoubleDecker = bus.IsDoubleDecker
' ssmTOOL.SSMInputs.BP_BusLength = bus.LengthInMetres
' ssmTOOL.SSMInputs.BP_BusWidth = bus.WidthInMetres
' ssmTOOL.SSMInputs.BP_BusHeight = bus.HeightInMetres
' txtBusModel.Text = bus.Model
' txtRegisteredPassengers.Text = bus.RegisteredPassengers.ToString()
......@@ -471,10 +471,10 @@ Public Class frmHVACTool
' txtBusHeight.Text = bus.HeightInMetres.ToString()
' chkIsDoubleDecker.Checked = bus.IsDoubleDecker
' txtBusFloorSurfaceArea.Text = ssmTOOL.GenInputs.BP_BusFloorSurfaceArea.ToString()
' txtBusWindowSurfaceArea.Text = ssmTOOL.GenInputs.BP_BusWindowSurface.ToString()
' txtBusSurfaceArea.Text = ssmTOOL.GenInputs.BP_BusSurfaceArea.ToString()
' txtBusVolume.Text = ssmTOOL.GenInputs.BP_BusVolume.ToString()
' txtBusFloorSurfaceArea.Text = ssmTOOL.SSMInputs.BP_BusFloorSurfaceArea.ToString()
' txtBusWindowSurfaceArea.Text = ssmTOOL.SSMInputs.BP_BusWindowSurface.ToString()
' txtBusSurfaceArea.Text = ssmTOOL.SSMInputs.BP_BusSurfaceArea.ToString()
' txtBusVolume.Text = ssmTOOL.SSMInputs.BP_BusVolume.ToString()
' btnEditBus.Enabled = True
......@@ -724,7 +724,7 @@ Public Class frmHVACTool
Dim environmentalConditionsMap As IEnvironmentalConditionsMap =
New EnvironmentalConditionsMap(CType(txtEC_EnvironmentConditionsFilePath.Tag, String), Path.GetDirectoryName(vectoFile))
ErrorProvider1.SetError(txtEC_EnvironmentConditionsFilePath, String.Empty)
ssmTOOL.GenInputs.EC_EnviromentalConditions_BatchFile = CType(txtEC_EnvironmentConditionsFilePath.Tag, String)
ssmTOOL.SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchFile = CType(txtEC_EnvironmentConditionsFilePath.Tag, String)
Catch ex As Exception
ErrorProvider1.SetError(txtEC_EnvironmentConditionsFilePath,
"Error : The environment conditions file is invalid or cannot be found, please select a valid aenv file.")
......@@ -1356,7 +1356,7 @@ Public Class frmHVACTool
Private Function GetTechLineFromPanel() As ITechListBenefitLine
Dim tl As ITechListBenefitLine = New TechListBenefitLine()
tl.BusFloorType = ssmTOOL.GenInputs.BP_BusFloorType
tl.BusFloorType = ssmTOOL.SSMInputs.BusParameters.BP_BusFloorType
tl.Category = StrConv(cboCategory.Text, vbProperCase)
tl.BenefitName = txtBenefitName.Text
......
......@@ -2,7 +2,7 @@
"Header": "AHSM",
"Body": {
"SSMDisabled": false,
"GenInputs": {
"SSMInputs": {
"BC_GFactor": 0.95,
"BC_PassengerBoundaryTemperature": 12.0,
"BC_HeatingBoundaryTemperature": 18.0,
......
......@@ -2,7 +2,7 @@
"Header": "AHSM",
"Body": {
"SSMDisabled": false,
"GenInputs": {
"SSMInputs": {
"BC_GFactor": 1.0,
"BC_SolarClouding": 0.8,
"BC_HeatPerPassengerIntoCabinW": 80.0,
......
......@@ -39,7 +39,7 @@ Namespace UnitTests
'Const _BusDatabase As String ="TestFiles\BusDatabase.abdb
Dim ssm As ISSMTOOL = New SSMTOOL(_SSMMAP, New HVACConstants())
CType(ssm.GenInputs, SSMGenInputs)._vehicle.Height = 0.SI(of Meter)
CType(ssm.SSMInputs, SSMInputs)._vehicle.Height = 0.SI(of Meter)
ssm.Load(_SSMMAP)
......
......@@ -30,7 +30,7 @@ Namespace UnitTests
Const _SSMMAP As String = "TestFiles\ssm.Ahsm"
Dim ssm As SSMTOOL = New SSMTOOL(_SSMMAP, New HVACConstants())
CType(ssm.GenInputs, SSMGenInputs)._vehicle.Height = 0.SI(of Meter)
CType(ssm.SSMInputs, SSMInputs)._vehicle.Height = 0.SI(of Meter)
ssm.Load(_SSMMAP)
Return ssm
......
......@@ -55,12 +55,12 @@ Namespace UnitTests
Return (0.5 * (AverageUseableEngineWasteHeatKW.Value() * 0.835).SI(Unit.SI.Liter.Per.Hour).Value()).SI(of KilogramPerSecond)
End Function
Public Property GenInputs As ISSMGenInputs Implements ISSMTOOL.GenInputs
Public Property SSMInputs As ISSMInputs Implements ISSMTOOL.SSMInputs
Get
Return New SSMGenInputs()
Return New SSMInputs()
End Get
Set(value As ISSMGenInputs)
Set(value As ISSMInputs)
End Set
End Property
......
......@@ -36,8 +36,8 @@ Namespace UnitTests
alternatorMap = New AlternatorMap(_GOODMAP)
alternatorMap.Initialise()
CType(ssm.GenInputs, SSMGenInputs)._vehicle.Height = 0.SI(of Meter)
CType(ssm.GenInputs, SSMGenInputs)._vehicle.FloorType = FloorType.HighFloor
CType(ssm.SSMInputs, SSMInputs)._vehicle.Height = 0.SI(of Meter)
CType(ssm.SSMInputs, SSMInputs)._vehicle.FloorType = FloorType.HighFloor
ssm.Load(_SSMMAP)
For Each entry As ITechListBenefitLine In ssm.TechList.TechLines
......
......@@ -30,7 +30,7 @@ Namespace UnitTests
'Const _BusDatabase As String ="TestFiles\BusDatabase.abdb
Dim ssm As ISSMTOOL = New SSMTOOL(_SSMMAP, New HVACConstants())
CType(ssm.GenInputs, SSMGenInputs)._vehicle.Height = 0.SI(of Meter)
CType(ssm.SSMInputs, SSMInputs)._vehicle.Height = 0.SI(of Meter)
ssm.Load(_SSMMAP)
......
......@@ -40,7 +40,7 @@ Namespace UnitTests
Dim ssm As ISSMTOOL = New SSMTOOL(_SSMMAP, New HVACConstants())
CType(ssm.GenInputs, SSMGenInputs)._vehicle.Height = 0.SI(of Meter)
CType(ssm.SSMInputs,SSMInputs)._vehicle.Height = 0.SI(of Meter)
ssm.Load(_SSMMAP)
......
......@@ -22,7 +22,7 @@ Namespace UnitTests
Dim src As SSMTOOL = DirectCast(source, SSMTOOL)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = src.GenInputs.BP_BusFloorType
newItem.BusFloorType = src.SSMInputs.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
......@@ -68,84 +68,84 @@ Namespace UnitTests
<TestCase("AuxHeater")>
Public Sub InstantiateDefaultSSMGenInputsTest(section As String)
Dim target As ISSMGenInputs = New SSMGenInputs()
Dim target As ISSMInputs = New SSMInputs()
If section = "BusParameterisation" Then
'BUS Parameterisation
'********************
Assert.AreEqual(47, target.BP_NumberOfPassengers)
Assert.AreEqual(FloorType.HighFloor, target.BP_BusFloorType)
Assert.AreEqual(24.1102486R, target.BP_BusFloorSurfaceArea.Value(), 2)
Assert.AreEqual(114.42325R, target.BP_BusSurfaceArea.Value())
Assert.AreEqual(20.98R, Math.Round(target.BP_BusWindowSurface.Value(), 2))
Assert.AreEqual(61.81231875D, Math.Round(target.BP_BusVolume.Value(), 8))
Assert.AreEqual(10.655R, target.BP_BusLength.Value())
Assert.AreEqual(2.55R, target.BP_BusWidth.Value())
Assert.AreEqual(47, target.BusParameters.BP_NumberOfPassengers)
Assert.AreEqual(FloorType.HighFloor, target.BusParameters.BP_BusFloorType)
Assert.AreEqual(24.1102486R, target.BusParameters.BP_BusFloorSurfaceArea.Value(), 2)
Assert.AreEqual(114.42325R, target.BusParameters.BP_BusSurfaceArea.Value())
Assert.AreEqual(20.98R, Math.Round(target.BusParameters.BP_BusWindowSurface.Value(), 2))
Assert.AreEqual(61.81231875D, Math.Round(target.BusParameters.BP_BusVolume.Value(), 8))
Assert.AreEqual(10.655R, target.BusParameters.BP_BusLength.Value())
Assert.AreEqual(2.55R, target.BusParameters.BP_BusWidth.Value())
End If
If section = "BoundaryConditions" Then
'BOUNDRY CONDITIONS
'******************
Assert.AreEqual(0.95R, target.BC_GFactor)
Assert.AreEqual(0.8R, target.BC_SolarClouding)
Assert.AreEqual(80, target.BC_HeatPerPassengerIntoCabinW.Value())
Assert.AreEqual(12, target.BC_PassengerBoundaryTemperature.AsDegCelsius)
Assert.AreEqual(3.0R, target.BC_PassengerDensityLowFloor.Value())
Assert.AreEqual(2.2R, target.BC_PassengerDensitySemiLowFloor.Value())
Assert.AreEqual(1.4R, target.BC_PassengerDensityRaisedFloor.Value())
Assert.AreEqual(34.0R, Math.Round(target.BC_CalculatedPassengerNumber, 4))
Assert.AreEqual(3.0R, target.BC_UValues.Value())
Assert.AreEqual(18, target.BC_HeatingBoundaryTemperature.AsDegCelsius)
Assert.AreEqual(23, target.BC_CoolingBoundaryTemperature.AsDegCelsius)
Assert.AreEqual(20, target.BC_HighVentilation.Value() * 3600)
Assert.AreEqual(7, target.BC_lowVentilation.Value() * 3600)
Assert.AreEqual(1236.25, Math.Round(target.BC_High.Value() * 3600, 2))
Assert.AreEqual(432.69, Math.Round(target.BC_Low.Value() * 3600, 2))
Assert.AreEqual(692.3, Math.Round(target.BC_HighVentPower.Value(), 2))
Assert.AreEqual(242.3, Math.Round(target.BC_LowVentPower.Value(), 2))
Assert.AreEqual(0.56R, target.BC_SpecificVentilationPower.Value() / 3600)
Assert.AreEqual(0.84, target.BC_AuxHeaterEfficiency)
Assert.AreEqual(11.8, target.BC_GCVDieselOrHeatingOil.Value() / 3600.0 / 1000.0)
Assert.AreEqual(1.5R, target.BC_WindowAreaPerUnitBusLength.Value())
Assert.AreEqual(5, target.BC_FrontRearWindowArea.Value())
Assert.AreEqual(3, target.BC_MaxTemperatureDeltaForLowFloorBusses.Value())
Assert.AreEqual(0.5R, target.BC_MaxPossibleBenefitFromTechnologyList)
Assert.AreEqual(0.95R, target.BoundaryConditions.BC_GFactor)
Assert.AreEqual(0.8R, target.BoundaryConditions.BC_SolarClouding)
Assert.AreEqual(80, target.BoundaryConditions.BC_HeatPerPassengerIntoCabinW.Value())
Assert.AreEqual(12, target.BoundaryConditions.BC_PassengerBoundaryTemperature.AsDegCelsius)
Assert.AreEqual(3.0R, target.BusParameters.BC_PassengerDensityLowFloor.Value())
Assert.AreEqual(2.2R, target.BusParameters.BC_PassengerDensitySemiLowFloor.Value())
Assert.AreEqual(1.4R, target.BusParameters.BC_PassengerDensityRaisedFloor.Value())
Assert.AreEqual(34.0R, Math.Round(target.BusParameters.BC_CalculatedPassengerNumber, 4))
Assert.AreEqual(3.0R, target.BoundaryConditions.BC_UValues.Value())
Assert.AreEqual(18, target.BoundaryConditions.BC_HeatingBoundaryTemperature.AsDegCelsius)
Assert.AreEqual(23, target.BoundaryConditions.BC_CoolingBoundaryTemperature.AsDegCelsius)
Assert.AreEqual(20, target.BoundaryConditions.BC_HighVentilation.Value() * 3600)
Assert.AreEqual(7, target.BoundaryConditions.BC_lowVentilation.Value() * 3600)
Assert.AreEqual(1236.25, Math.Round(target.BoundaryConditions.BC_High.Value() * 3600, 2))
Assert.AreEqual(432.69, Math.Round(target.BoundaryConditions.BC_Low.Value() * 3600, 2))
Assert.AreEqual(692.3, Math.Round(target.BoundaryConditions.BC_HighVentPower.Value(), 2))
Assert.AreEqual(242.3, Math.Round(target.BoundaryConditions.BC_LowVentPower.Value(), 2))
Assert.AreEqual(0.56R, target.BoundaryConditions.BC_SpecificVentilationPower.Value() / 3600)
Assert.AreEqual(0.84, target.BoundaryConditions.BC_AuxHeaterEfficiency)
Assert.AreEqual(11.8, target.BoundaryConditions.BC_GCVDieselOrHeatingOil.Value() / 3600.0 / 1000.0)
Assert.AreEqual(1.5R, target.BoundaryConditions.BC_WindowAreaPerUnitBusLength.Value())
Assert.AreEqual(5, target.BoundaryConditions.BC_FrontRearWindowArea.Value())
Assert.AreEqual(3, target.BoundaryConditions.BC_MaxTemperatureDeltaForLowFloorBusses.Value())
Assert.AreEqual(0.5R, target.BoundaryConditions.BC_MaxPossibleBenefitFromTechnologyList)
End If
If section = "EnvironmentalConditions" Then
'Environmental Conditions
'************************
Assert.AreEqual(25.0, target.EC_EnviromentalTemperature.AsDegCelsius)
Assert.AreEqual(400.0, target.EC_Solar.Value())
Assert.AreEqual(25.0, target.EnvironmentalConditions.EC_EnviromentalTemperature.AsDegCelsius)
Assert.AreEqual(400.0, target.EnvironmentalConditions.EC_Solar.Value())
End If
If section = "AC-System" Then
'AC-SYSTEM
'*********
Assert.AreEqual("2-stage", target.AC_CompressorType)
Assert.AreEqual(18, target.AC_CompressorCapacitykW.Value() / 1000.0)
Assert.AreEqual(3.5, target.AC_COP)
Assert.AreEqual("2-stage", target.ACSystem.AC_CompressorType)
Assert.AreEqual(18, target.ACSystem.AC_CompressorCapacitykW.Value() / 1000.0)
Assert.AreEqual(3.5, target.ACSystem.AC_COP)
End If
If section = "Ventilation" Then
'VENTILATION
'***********
Assert.Areequal(True, target.VEN_VentilationOnDuringHeating)
Assert.Areequal(True, target.VEN_VentilationWhenBothHeatingAndACInactive)
Assert.Areequal(True, target.VEN_VentilationDuringAC)
Assert.Areequal("high", target.VEN_VentilationFlowSettingWhenHeatingAndACInactive)
Assert.Areequal("high", target.VEN_VentilationDuringHeating)
Assert.AreEqual("high", target.VEN_VentilationDuringCooling)
Assert.Areequal(True, target.Ventilation.VEN_VentilationOnDuringHeating)
Assert.Areequal(True, target.Ventilation.VEN_VentilationWhenBothHeatingAndACInactive)
Assert.Areequal(True, target.Ventilation.VEN_VentilationDuringAC)
Assert.Areequal("high", target.Ventilation.VEN_VentilationFlowSettingWhenHeatingAndACInactive)
Assert.Areequal("high", target.Ventilation.VEN_VentilationDuringHeating)
Assert.AreEqual("high", target.Ventilation.VEN_VentilationDuringCooling)
End If
If section = "AuxHeater" Then
'AUX HEATER
'**********
Assert.AreEqual(0, target.AH_EngineWasteHeatkW.ConvertToKiloWatt().Value())
Assert.AreEqual(30, target.AH_FuelFiredHeaterkW.ConvertToKiloWatt().Value())
Assert.AreEqual(0, target.AuxHeater.AH_EngineWasteHeatkW.ConvertToKiloWatt().Value())
Assert.AreEqual(30, target.AuxHeater.AH_FuelFiredHeaterkW.ConvertToKiloWatt().Value())
End If
End Sub
......@@ -154,9 +154,9 @@ Namespace UnitTests
Public Sub Instantiate_TechListTest()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList(gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList(gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechList)
......@@ -167,9 +167,9 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestALLON()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList(gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList(gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListALLON)
For Each entry As ITechListBenefitLine In target.TechLines
......@@ -195,9 +195,9 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYList()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList(gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList(gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
'Assert.IsTrue(target.Initialise())
......@@ -209,13 +209,13 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYListADD1()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList(gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList(gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = gen.BP_BusFloorType
newItem.BusFloorType = gen.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
newItem.Category = "Insulation"
......@@ -251,13 +251,13 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYListADD1Duplicate()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList(gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList(gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = gen.BP_BusFloorType
newItem.BusFloorType = gen.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
newItem.Category = "Insulation"
......@@ -293,13 +293,13 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYListADD1AndClear()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList( gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList( gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = gen.BP_BusFloorType
newItem.BusFloorType = gen.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
newItem.Category = "Insulation"
......@@ -335,13 +335,13 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYListADD1AndModify()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList( gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList( gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = gen.BP_BusFloorType
newItem.BusFloorType = gen.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
newItem.Category = "Insulation"
......@@ -379,13 +379,13 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYListADD1andDeleteIt()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList( gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList( gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = gen.BP_BusFloorType
newItem.BusFloorType = gen.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
newItem.Category = "Insulation"
......@@ -421,13 +421,13 @@ Namespace UnitTests
Public Sub Instantiate_TechListTestEMPTYListandDeleteNonExistantItem()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim target As ISSMTechList = New SSMTechList( gen.BP_BusFloorType)
Dim target As ISSMTechList = New SSMTechList( gen.BusParameters.BP_BusFloorType)
target.TechLines = HVACTechBenefitsReader.ReadFromFile(GOODTechListEMPTYLIST)
Dim newItem As ITechListBenefitLine = New TechListBenefitLine()
newItem.BusFloorType = gen.BP_BusFloorType
newItem.BusFloorType = gen.BusParameters.BP_BusFloorType
'newItem.Units = "fraction"
newItem.Category = "Insulation"
......@@ -460,10 +460,10 @@ Namespace UnitTests
<Test()>
Public Sub Instantiate_NewTechListLine()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim ttl As ITechListBenefitLine = New TechListBenefitLine()
ttl.BusFloorType = gen.BP_BusFloorType
ttl.BusFloorType = gen.BusParameters.BP_BusFloorType
Assert.IsNotNull(ttl)
End Sub
......@@ -471,13 +471,13 @@ Namespace UnitTests
<Test()>
Public Sub TechBenefitLineCompareAsEqual()
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim ttl1 As ITechListBenefitLine = New TechListBenefitLine()
ttl1.BusFloorType = gen.BP_BusFloorType
ttl1.BusFloorType = gen.BusParameters.BP_BusFloorType
Dim ttl2 As ITechListBenefitLine = New TechListBenefitLine()
ttl2.BusFloorType = gen.BP_BusFloorType
ttl2.BusFloorType = gen.BusParameters.BP_BusFloorType
Assert.IsTrue(ttl1.IsEqualTo(ttl2))
End Sub
......@@ -502,13 +502,13 @@ Namespace UnitTests
<TestCase("OnVehicle")>
Public Sub TechBenefitLineCompareAsUnequal(prop As String)
Dim gen As ISSMGenInputs = New SSMGenInputs()
Dim gen As ISSMInputs = New SSMInputs()
Dim ttl1 As ITechListBenefitLine = New TechListBenefitLine()
ttl1.BusFloorType = gen.BP_BusFloorType
ttl1.BusFloorType = gen.BusParameters.BP_BusFloorType
Dim ttl2 As ITechListBenefitLine = New TechListBenefitLine()
ttl2.BusFloorType = gen.BP_BusFloorType
ttl2.BusFloorType = gen.BusParameters.BP_BusFloorType
Select Case prop
......@@ -567,18 +567,18 @@ Namespace UnitTests
Assert.IsTrue(success)
'change something
target.GenInputs.BC_HighVentilation = 202.202.SI(Of PerSecond)
target.SSMInputs.BoundaryConditions.BC_HighVentilation = 202.202.SI(Of PerSecond)
Assert.AreEqual(202.202, target.GenInputs.BC_HighVentilation.Value(), 1e-3)
Assert.AreEqual(202.202, target.SSMInputs.BoundaryConditions.BC_HighVentilation.Value(), 1e-3)
'Retreive
success = target.Load(filePath)
Assert.IsTrue(success)
Assert.AreEqual(20.SI(Unit.SI.Per.Hour).Value(), target.GenInputs.BC_HighVentilation.Value(), 1e-3)
Assert.AreEqual(20.SI(Unit.SI.Per.Hour).Value(), target.SSMInputs.BoundaryConditions.BC_HighVentilation.Value(), 1e-3)
End Sub
'GenInputs Comparison
'SSMInputs Comparison
<Test()>
Public Sub SSMTOOL_COMPARISON_GENINPUTS_EQUAL()
......@@ -601,8 +601,8 @@ Namespace UnitTests
Dim ssmTool1 As SSMTOOL = New SSMTOOL(filePath, New HVACConstants())
'Alter somthing
'CType(ssmTool1.genInputs, SSMGenInputs)._vehicle.Length = 11.SI(Of Meter)
ssmTool1.GenInputs.BC_PassengerBoundaryTemperature = 99.0.DegCelsiusToKelvin()
'CType(ssmTool1.genInputs, IssmInputs)._vehicle.Length = 11.SI(Of Meter)
ssmTool1.SSMInputs.BoundaryConditions.BC_PassengerBoundaryTemperature = 99.0.DegCelsiusToKelvin()
Dim ssmTool2 As SSMTOOL = New SSMTOOL(filePath, New HVACConstants())
......
......@@ -190,6 +190,18 @@
<Content Include="3rdParty\DocumentFormat.OpenXml.xml" />
<Content Include="3rdParty\SpreadsheetLight.dll" />
<Content Include="3rdParty\SpreadsheetLight.xml" />
<Content Include="TestFiles\testHVACSteadyStateModelBadHeaders.ahsm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelBadValues.ahsm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelGOODMAP.ahsm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelInsufficientLines.ahsm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testPneumaticActuationsMap_GOODMAP.apac">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
......@@ -247,18 +259,6 @@
<Content Include="TestFiles\TestHvacMap - MissingHeader.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelGOODMAP.ahsm">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelBadHeaders.ahsm">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelBadValues.ahsm">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testHVACSteadyStateModelInsufficientLines.ahsm">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="TestFiles\testBusDatabase.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
......
......@@ -19,9 +19,9 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// Constructor
public HVACUserInputsConfig(string ssmFilePath, string busDatabasePath, bool isDisabled)
{
this.SSMFilePath = ssmFilePath;
this.BusDatabasePath = busDatabasePath;
this.SSMDisabled = isDisabled;
SSMFilePath = ssmFilePath;
BusDatabasePath = busDatabasePath;
SSMDisabled = isDisabled;
}
public string SSMFilePath { get; set; }
......
......@@ -7,7 +7,8 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data;
namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
{
// Used by SSMHVAC Class
public class SSMGenInputs : ISSMGenInputs
public class SSMInputs : ISSMInputs, ISSMBoundaryConditions, IEnvironmentalConditions, IACSystem, IVentilation,
IAuxHeater, ISSMBusParameters
{
private string _EC_EnviromentalConditions_BatchFile;
private IEnvironmentalConditionsMap _EC_EnvironmentalConditionsMap;
......@@ -17,7 +18,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
private string _vectoDir;
//public SSMGenInputs(bool initialiseDefaults = false, string vectoDir = "")
//public IssmInputs(bool initialiseDefaults = false, string vectoDir = "")
//{
// _vectoDir = vectoDir;
// BP_BusModel = "";
......@@ -31,13 +32,13 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// SetDefaults();
//}
public SSMGenInputs(string vectoDir = "")
public SSMInputs(string vectoDir = "")
{
_vectoDir = vectoDir;
SetDefaults();
}
public SSMGenInputs(VehicleData vehicle)
public SSMInputs(VehicleData vehicle)
{
_vehicle = vehicle;
}
......@@ -62,16 +63,28 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
}
// C10/D10
public bool BP_DoubleDecker { get { return _vehicle.DoubleDecker; } }
public bool BP_DoubleDecker
{
get { return _vehicle.DoubleDecker; }
}
// D12/C12 - ( M )
public Meter BP_BusLength { get { return _vehicle.Length; } }
public Meter BP_BusLength
{
get { return _vehicle.Length; }
}
// D13/C13 - ( M )
public Meter BP_BusWidth { get { return _vehicle.Width; } }
public Meter BP_BusWidth
{
get { return _vehicle.Width; }
}
// D14/C14 - ( M )
public Meter BP_BusHeight { get { return _vehicle.Height; } }
public Meter BP_BusHeight
{
get { return _vehicle.Height; }
}
// D7/C7 - ( M/2 )
......@@ -116,8 +129,6 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
}
// C17
public double BC_GFactor { get; set; }
......@@ -188,7 +199,8 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
{
get {
// =IF(D6="low floor",4,IF(D6="semi low floor",3.5,3))
return (BP_BusFloorType ==FloorType.LowFloor ? 4 : BP_BusFloorType == FloorType.SemiLowFloor ? 3.5 : 3).SI<WattPerKelvinSquareMeter>();
return (BP_BusFloorType == FloorType.LowFloor ? 4 : BP_BusFloorType == FloorType.SemiLowFloor ? 3.5 : 3)
.SI<WattPerKelvinSquareMeter>();
}
}
......@@ -450,5 +462,39 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
AH_CoolantHeatTransferredToAirCabinHeater = 0.75;
AH_EngineWasteHeatkW = 0.SI<Watt>();
}
#region Implementation of ISSMInputs
public ISSMBusParameters BusParameters
{
get { return this; }
}
public ISSMBoundaryConditions BoundaryConditions
{
get { return this; }
}
public IEnvironmentalConditions EnvironmentalConditions
{
get { return this; }
}
public IACSystem ACSystem
{
get { return this; }
}
public IVentilation Ventilation
{
get { return this; }
}
public IAuxHeater AuxHeater
{
get { return this; }
}
#endregion
}
}
......@@ -32,9 +32,13 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// C25 = BC_CoolingBoundary Temperature
// C24 = BC_HeatingBoundaryTemperature
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs;
return gen.EC_EnviromentalTemperature > gen.BC_CoolingBoundaryTemperature ? 3 : gen.EC_EnviromentalTemperature < gen.BC_HeatingBoundaryTemperature ? 1 : 2;
return gen.EnvironmentalConditions.EC_EnviromentalTemperature > gen.BoundaryConditions.BC_CoolingBoundaryTemperature
? 3
: gen.EnvironmentalConditions.EC_EnviromentalTemperature < gen.BoundaryConditions.BC_HeatingBoundaryTemperature
? 1
: 2;
}
}
public Kelvin TCalc
......@@ -47,17 +51,18 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// C43 = EC_Enviromental Temperature
// C39 = BC_FontAndRearWindowArea
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs;
if (runNumber == 1) {
return gen.BC_HeatingBoundaryTemperature;
return gen.BoundaryConditions.BC_HeatingBoundaryTemperature;
}
return gen.BP_BusFloorType == FloorType.LowFloor
? (gen.EC_EnviromentalTemperature - gen.BC_CoolingBoundaryTemperature) < gen.BC_MaxTemperatureDeltaForLowFloorBusses
? gen.BC_CoolingBoundaryTemperature
: gen.EC_EnviromentalTemperature - 3.SI<Kelvin>()
: gen.BC_CoolingBoundaryTemperature;
return gen.BusParameters.BP_BusFloorType == FloorType.LowFloor
? (gen.EnvironmentalConditions.EC_EnviromentalTemperature - gen.BoundaryConditions.BC_CoolingBoundaryTemperature) <
gen.BoundaryConditions.BC_MaxTemperatureDeltaForLowFloorBusses
? gen.BoundaryConditions.BC_CoolingBoundaryTemperature
: gen.EnvironmentalConditions.EC_EnviromentalTemperature - 3.SI<Kelvin>()
: gen.BoundaryConditions.BC_CoolingBoundaryTemperature;
}
}
public Kelvin TemperatureDelta
......@@ -67,7 +72,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// C43 = EC_Enviromental Temperature
// F79/80 = Me.TCalc
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs.EnvironmentalConditions;
return gen.EC_EnviromentalTemperature - TCalc;
}
}
......@@ -82,9 +87,9 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// C8 = BP_BusSurfaceArea
// I78/I80 = Me.TemperatureDelta
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs;
return TemperatureDelta * gen.BP_BusSurfaceArea * gen.BC_UValues;
return TemperatureDelta * gen.BusParameters.BP_BusSurfaceArea * gen.BoundaryConditions.BC_UValues;
}
}
public Watt WattsPerPass
......@@ -102,9 +107,10 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// C17 = BC_Heat Per Passenger into cabin
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs;
return Math.Min(gen.BP_NumberOfPassengers, gen.BC_CalculatedPassengerNumber) * gen.BC_HeatPerPassengerIntoCabinW;
return Math.Min(gen.BusParameters.BP_NumberOfPassengers, gen.BusParameters.BC_CalculatedPassengerNumber) *
gen.BoundaryConditions.BC_HeatPerPassengerIntoCabinW;
}
}
public Watt Solar
......@@ -119,10 +125,11 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
// C15 = BC_GFactor
// C16 = BC_SolarClouding
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs;
return gen.EC_Solar * gen.BP_BusWindowSurface * gen.BC_GFactor * gen.BC_SolarClouding * 0.25;
return gen.EnvironmentalConditions.EC_Solar * gen.BusParameters.BP_BusWindowSurface *
gen.BoundaryConditions.BC_GFactor * gen.BoundaryConditions.BC_SolarClouding * 0.25;
}
}
public Watt TotalW
......@@ -150,12 +157,14 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
get {
// =IF(AND(N79<0,N79<(C60*-1)),N79-(C60*-1),0)*1000
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs.AuxHeater;
// Dim N79 as Double = TotalKW
// Dim C60 As Double = gen.AH_EngineWasteHeatkW
return (TotalW < 0 && TotalW < (gen.AH_EngineWasteHeatkW * -1)) ? TotalW - (gen.AH_EngineWasteHeatkW * -1) : 0.SI<Watt>();
return (TotalW < 0 && TotalW < (gen.AH_EngineWasteHeatkW * -1))
? TotalW - (gen.AH_EngineWasteHeatkW * -1)
: 0.SI<Watt>();
}
}
public Watt TechListAmendedFuelW
......@@ -163,7 +172,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
get {
// =IF(IF(AND((N79*(1-$J$89))<0,(N79*(1-$J$89))<(C60*-1)),(N79*(1-$J$89))-(C60*-1),0)*1000<0,IF(AND((N79*(1-$J$89))<0,(N79*(1-$J$89))<(C60*-1)),(N79*(1-$J$89))-(C60*-1),0)*1000,0)
var gen = ssmTOOL.GenInputs;
var gen = ssmTOOL.SSMInputs.AuxHeater;
var TLFFH = ssmTOOL.Calculate.TechListAdjustedHeatingW_FuelFiredHeating;
// Dim C60 As Double = gen.AH_EngineWasteHeatkW
// Dim N79 As Double = Me.TotalKW
......
......@@ -22,7 +22,10 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
public class SSMTOOL : ISSMTOOL
{
private string FilePath;
public ISSMGenInputs GenInputs { get; set; }
public ISSMInputs SSMInputs { get; set; }
public ISSMBoundaryConditions BoundaryConditions { get; set; }
public ISSMTechList TechList { get; set; }
public ISSMCalculate Calculate { get; set; }
public bool SSMDisabled { get; set; }
......@@ -67,7 +70,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
get {
var mechAdjusted = SSMDisabled ? 0.SI<Watt>() : Calculate.MechanicalWBaseAdjusted;
if (CompressorCapacityInsufficientWarned == false && (mechAdjusted) / (1000 * GenInputs.AC_COP) > GenInputs.AC_CompressorCapacitykW) {
if (CompressorCapacityInsufficientWarned == false && (mechAdjusted) / (1000 * SSMInputs.ACSystem.AC_COP) > SSMInputs.ACSystem.AC_CompressorCapacitykW) {
OnMessage(this, "HVAC SSM :AC-Compressor Capacity unable to service cooling, run continues as if capacity was sufficient.", AdvancedAuxiliaryMessageType.Warning);
CompressorCapacityInsufficientWarned = true;
}
......@@ -91,8 +94,8 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
SSMDisabled = isDisabled;
HVACConstants = hvacConstants;
GenInputs = new SSMGenInputs(Path.GetDirectoryName(filePath));
TechList = new SSMTechList(GenInputs.BP_BusFloorType);
SSMInputs = new SSMInputs(Path.GetDirectoryName(filePath));
TechList = new SSMTechList(SSMInputs.BusParameters.BP_BusFloorType);
TechList.TechLines = HVACTechBenefitsReader.ReadFromStream(RessourceHelper.ReadStream(DeclarationData.DeclarationDataResourcePrefix + ".Buses." +
"HVAC_TechList.csv"));
......@@ -104,12 +107,12 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
//{
// var feedback = string.Empty;
// GenInputs.InjectFrom(((SSMTOOL)from).GenInputs);
// SSMInputs.InjectFrom(((SSMTOOL)from).SSMInputs);
// TechList.Clear();
// foreach (var line in from.TechList.TechLines) {
// var newLine = new TechListBenefitLine(this.GenInputs);
// var newLine = new TechListBenefitLine(this.SSMInputs);
// // newLine.InjectFrom()
// newLine.InjectFrom(line);
// TechList.Add(newLine, ref feedback);
......@@ -131,7 +134,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
var body = new Dictionary<string, object>();
body["SSMDisabled"] = SSMDisabled;
body["GenInputs"] = SaveGenInputs();
body["SSMInputs"] = SaveGenInputs();
body["TechList"] = SaveTechlist();
......@@ -150,33 +153,33 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
{
var retVal = new Dictionary<string, object>();
retVal["BC_GFactor"] = GenInputs.BC_GFactor;
retVal["BC_PassengerBoundaryTemperature"] = GenInputs.BC_PassengerBoundaryTemperature.AsDegCelsius;
retVal["BC_HeatingBoundaryTemperature"] = GenInputs.BC_HeatingBoundaryTemperature.AsDegCelsius;
retVal["BC_CoolingBoundaryTemperature"] = GenInputs.BC_CoolingBoundaryTemperature.AsDegCelsius;
retVal["BC_HighVentilation"] = GenInputs.BC_HighVentilation.ConvertToPerHour().Value;
retVal["BC_lowVentilation"] = GenInputs.BC_lowVentilation.ConvertToPerHour().Value;
retVal["BC_SpecificVentilationPower"] = GenInputs.BC_SpecificVentilationPower.ConvertToWattHourPerCubicMeter().Value;
retVal["BC_AuxHeaterEfficiency"] = GenInputs.BC_AuxHeaterEfficiency;
retVal["BC_GCVDieselOrHeatingOil"] = GenInputs.BC_GCVDieselOrHeatingOil.ConvertToKiloWattHourPerKilogramm().Value;
retVal["BC_MaxTemperatureDeltaForLowFloorBusses"] = GenInputs.BC_MaxTemperatureDeltaForLowFloorBusses.AsDegCelsius;
retVal["BC_MaxPossibleBenefitFromTechnologyList"] = GenInputs.BC_MaxPossibleBenefitFromTechnologyList;
retVal["EC_EnviromentalTemperature"] = GenInputs.EC_EnviromentalTemperature.AsDegCelsius;
retVal["EC_Solar"] = GenInputs.EC_Solar.Value();
retVal["EC_EnviromentalConditions_BatchFile"] = GenInputs.EC_EnviromentalConditions_BatchFile;
retVal["EC_EnviromentalConditions_BatchEnabled"] = GenInputs.EC_EnviromentalConditions_BatchEnabled;
retVal["AC_CompressorType"] = GenInputs.AC_CompressorType;
retVal["AC_CompressorCapacitykW"] = GenInputs.AC_CompressorCapacitykW.ConvertToKiloWatt().Value;
retVal["VEN_VentilationOnDuringHeating"] = GenInputs.VEN_VentilationOnDuringHeating;
retVal["VEN_VentilationWhenBothHeatingAndACInactive"] = GenInputs.VEN_VentilationWhenBothHeatingAndACInactive;
retVal["VEN_VentilationDuringAC"] = GenInputs.VEN_VentilationDuringAC;
retVal["VEN_VentilationFlowSettingWhenHeatingAndACInactive"] = GenInputs.VEN_VentilationFlowSettingWhenHeatingAndACInactive;
retVal["VEN_VentilationDuringHeating"] = GenInputs.VEN_VentilationDuringHeating;
retVal["VEN_VentilationDuringCooling"] = GenInputs.VEN_VentilationDuringCooling;
retVal["AH_EngineWasteHeatkW"] = GenInputs.AH_EngineWasteHeatkW.ConvertToKiloWatt().Value;
retVal["AH_FuelFiredHeaterkW"] = GenInputs.AH_FuelFiredHeaterkW.ConvertToKiloWatt().Value;
retVal["AH_FuelEnergyToHeatToCoolant"] = GenInputs.AH_FuelEnergyToHeatToCoolant;
retVal["AH_CoolantHeatTransferredToAirCabinHeater"] = GenInputs.AH_CoolantHeatTransferredToAirCabinHeater;
retVal["BC_GFactor"] = SSMInputs.BoundaryConditions.BC_GFactor;
retVal["BC_PassengerBoundaryTemperature"] = SSMInputs.BoundaryConditions.BC_PassengerBoundaryTemperature.AsDegCelsius;
retVal["BC_HeatingBoundaryTemperature"] = SSMInputs.BoundaryConditions.BC_HeatingBoundaryTemperature.AsDegCelsius;
retVal["BC_CoolingBoundaryTemperature"] = SSMInputs.BoundaryConditions.BC_CoolingBoundaryTemperature.AsDegCelsius;
retVal["BC_HighVentilation"] = SSMInputs.BoundaryConditions.BC_HighVentilation.ConvertToPerHour().Value;
retVal["BC_lowVentilation"] = SSMInputs.BoundaryConditions.BC_lowVentilation.ConvertToPerHour().Value;
retVal["BC_SpecificVentilationPower"] = SSMInputs.BoundaryConditions.BC_SpecificVentilationPower.ConvertToWattHourPerCubicMeter().Value;
retVal["BC_AuxHeaterEfficiency"] = SSMInputs.BoundaryConditions.BC_AuxHeaterEfficiency;
retVal["BC_GCVDieselOrHeatingOil"] = SSMInputs.BoundaryConditions.BC_GCVDieselOrHeatingOil.ConvertToKiloWattHourPerKilogramm().Value;
retVal["BC_MaxTemperatureDeltaForLowFloorBusses"] = SSMInputs.BoundaryConditions.BC_MaxTemperatureDeltaForLowFloorBusses.AsDegCelsius;
retVal["BC_MaxPossibleBenefitFromTechnologyList"] = SSMInputs.BoundaryConditions.BC_MaxPossibleBenefitFromTechnologyList;
retVal["EC_EnviromentalTemperature"] = SSMInputs.EnvironmentalConditions.EC_EnviromentalTemperature.AsDegCelsius;
retVal["EC_Solar"] = SSMInputs.EnvironmentalConditions.EC_Solar.Value();
retVal["EC_EnviromentalConditions_BatchFile"] = SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchFile;
retVal["EC_EnviromentalConditions_BatchEnabled"] = SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchEnabled;
retVal["AC_CompressorType"] = SSMInputs.ACSystem.AC_CompressorType;
retVal["AC_CompressorCapacitykW"] = SSMInputs.ACSystem.AC_CompressorCapacitykW.ConvertToKiloWatt().Value;
retVal["VEN_VentilationOnDuringHeating"] = SSMInputs.Ventilation.VEN_VentilationOnDuringHeating;
retVal["VEN_VentilationWhenBothHeatingAndACInactive"] = SSMInputs.Ventilation.VEN_VentilationWhenBothHeatingAndACInactive;
retVal["VEN_VentilationDuringAC"] = SSMInputs.Ventilation.VEN_VentilationDuringAC;
retVal["VEN_VentilationFlowSettingWhenHeatingAndACInactive"] = SSMInputs.Ventilation.VEN_VentilationFlowSettingWhenHeatingAndACInactive;
retVal["VEN_VentilationDuringHeating"] = SSMInputs.Ventilation.VEN_VentilationDuringHeating;
retVal["VEN_VentilationDuringCooling"] = SSMInputs.Ventilation.VEN_VentilationDuringCooling;
retVal["AH_EngineWasteHeatkW"] = SSMInputs.AuxHeater.AH_EngineWasteHeatkW.ConvertToKiloWatt().Value;
retVal["AH_FuelFiredHeaterkW"] = SSMInputs.AuxHeater.AH_FuelFiredHeaterkW.ConvertToKiloWatt().Value;
retVal["AH_FuelEnergyToHeatToCoolant"] = SSMInputs.AuxHeater.AH_FuelEnergyToHeatToCoolant;
retVal["AH_CoolantHeatTransferredToAirCabinHeater"] = SSMInputs.AuxHeater.AH_CoolantHeatTransferredToAirCabinHeater;
return retVal;
}
......@@ -219,7 +222,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
var body = (JObject)json["Body"];
SSMDisabled = body.GetEx<bool>("SSMDisabled");
LoadGenInputs((JObject)body["GenInputs"]);
LoadGenInputs((JObject)body["SSMInputs"]);
} catch (Exception ) {
// Nothing to do except return false.
......@@ -232,33 +235,33 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
private void LoadGenInputs(JObject genInput)
{
GenInputs.BC_GFactor = genInput.GetEx<double>("BC_GFactor");
GenInputs.BC_PassengerBoundaryTemperature = genInput.GetEx<double>("BC_PassengerBoundaryTemperature").DegCelsiusToKelvin();
GenInputs.BC_HeatingBoundaryTemperature = genInput.GetEx<double>("BC_HeatingBoundaryTemperature").DegCelsiusToKelvin();
GenInputs.BC_CoolingBoundaryTemperature = genInput.GetEx<double>("BC_CoolingBoundaryTemperature").DegCelsiusToKelvin();
GenInputs.BC_HighVentilation = genInput.GetEx<double>("BC_HighVentilation").SI(Unit.SI.Per.Hour).Cast<PerSecond>();
GenInputs.BC_lowVentilation = genInput.GetEx<double>("BC_lowVentilation").SI(Unit.SI.Per.Hour).Cast<PerSecond>();
GenInputs.BC_SpecificVentilationPower = genInput.GetEx<double>("BC_SpecificVentilationPower").SI(Unit.SI.Watt.Hour.Per.Cubic.Meter).Cast<JoulePerCubicMeter>();
GenInputs.BC_AuxHeaterEfficiency = genInput.GetEx<double>("BC_AuxHeaterEfficiency");
GenInputs.BC_GCVDieselOrHeatingOil = genInput.GetEx<double>("BC_GCVDieselOrHeatingOil").SI(Unit.SI.Kilo.Watt.Hour.Per.Kilo.Gramm).Cast<JoulePerKilogramm>();
GenInputs.BC_MaxTemperatureDeltaForLowFloorBusses = genInput.GetEx<double>("BC_MaxTemperatureDeltaForLowFloorBusses").SI<Kelvin>();
GenInputs.BC_MaxPossibleBenefitFromTechnologyList = genInput.GetEx<double>("BC_MaxPossibleBenefitFromTechnologyList");
GenInputs.EC_EnviromentalTemperature = genInput.GetEx<double>("EC_EnviromentalTemperature").DegCelsiusToKelvin();
GenInputs.EC_Solar = genInput.GetEx<double>("EC_Solar").SI<WattPerSquareMeter>();
GenInputs.EC_EnviromentalConditions_BatchFile = genInput.GetEx<string>("EC_EnviromentalConditions_BatchFile");
GenInputs.EC_EnviromentalConditions_BatchEnabled = genInput.GetEx<bool>("EC_EnviromentalConditions_BatchEnabled");
GenInputs.AC_CompressorType = genInput.GetEx<string>("AC_CompressorType");
GenInputs.AC_CompressorCapacitykW = genInput.GetEx<double>("AC_CompressorCapacitykW").SI(Unit.SI.Kilo.Watt).Cast<Watt>();
GenInputs.VEN_VentilationOnDuringHeating = genInput.GetEx<bool>("VEN_VentilationOnDuringHeating");
GenInputs.VEN_VentilationWhenBothHeatingAndACInactive = genInput.GetEx<bool>("VEN_VentilationWhenBothHeatingAndACInactive");
GenInputs.VEN_VentilationDuringAC = genInput.GetEx<bool>("VEN_VentilationDuringAC");
GenInputs.VEN_VentilationFlowSettingWhenHeatingAndACInactive = genInput.GetEx<string>("VEN_VentilationFlowSettingWhenHeatingAndACInactive");
GenInputs.VEN_VentilationDuringHeating = genInput.GetEx<string>("VEN_VentilationDuringHeating");
GenInputs.VEN_VentilationDuringCooling = genInput.GetEx<string>("VEN_VentilationDuringCooling");
GenInputs.AH_EngineWasteHeatkW = genInput.GetEx<double>("AH_EngineWasteHeatkW").SI(Unit.SI.Kilo.Watt).Cast<Watt>();
GenInputs.AH_FuelFiredHeaterkW = genInput.GetEx<double>("AH_FuelFiredHeaterkW").SI(Unit.SI.Kilo.Watt).Cast<Watt>();
GenInputs.AH_FuelEnergyToHeatToCoolant = genInput.GetEx<double>("AH_FuelEnergyToHeatToCoolant");
GenInputs.AH_CoolantHeatTransferredToAirCabinHeater = genInput.GetEx<double>("AH_CoolantHeatTransferredToAirCabinHeater");
SSMInputs.BoundaryConditions.BC_GFactor = genInput.GetEx<double>("BC_GFactor");
SSMInputs.BoundaryConditions.BC_PassengerBoundaryTemperature = genInput.GetEx<double>("BC_PassengerBoundaryTemperature").DegCelsiusToKelvin();
SSMInputs.BoundaryConditions.BC_HeatingBoundaryTemperature = genInput.GetEx<double>("BC_HeatingBoundaryTemperature").DegCelsiusToKelvin();
SSMInputs.BoundaryConditions.BC_CoolingBoundaryTemperature = genInput.GetEx<double>("BC_CoolingBoundaryTemperature").DegCelsiusToKelvin();
SSMInputs.BoundaryConditions.BC_HighVentilation = genInput.GetEx<double>("BC_HighVentilation").SI(Unit.SI.Per.Hour).Cast<PerSecond>();
SSMInputs.BoundaryConditions.BC_lowVentilation = genInput.GetEx<double>("BC_lowVentilation").SI(Unit.SI.Per.Hour).Cast<PerSecond>();
SSMInputs.BoundaryConditions.BC_SpecificVentilationPower = genInput.GetEx<double>("BC_SpecificVentilationPower").SI(Unit.SI.Watt.Hour.Per.Cubic.Meter).Cast<JoulePerCubicMeter>();
SSMInputs.BoundaryConditions.BC_AuxHeaterEfficiency = genInput.GetEx<double>("BC_AuxHeaterEfficiency");
SSMInputs.BoundaryConditions.BC_GCVDieselOrHeatingOil = genInput.GetEx<double>("BC_GCVDieselOrHeatingOil").SI(Unit.SI.Kilo.Watt.Hour.Per.Kilo.Gramm).Cast<JoulePerKilogramm>();
SSMInputs.BoundaryConditions.BC_MaxTemperatureDeltaForLowFloorBusses = genInput.GetEx<double>("BC_MaxTemperatureDeltaForLowFloorBusses").SI<Kelvin>();
SSMInputs.BoundaryConditions.BC_MaxPossibleBenefitFromTechnologyList = genInput.GetEx<double>("BC_MaxPossibleBenefitFromTechnologyList");
SSMInputs.EnvironmentalConditions.EC_EnviromentalTemperature = genInput.GetEx<double>("EC_EnviromentalTemperature").DegCelsiusToKelvin();
SSMInputs.EnvironmentalConditions.EC_Solar = genInput.GetEx<double>("EC_Solar").SI<WattPerSquareMeter>();
SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchFile = genInput.GetEx<string>("EC_EnviromentalConditions_BatchFile");
SSMInputs.EnvironmentalConditions.EC_EnviromentalConditions_BatchEnabled = genInput.GetEx<bool>("EC_EnviromentalConditions_BatchEnabled");
SSMInputs.ACSystem.AC_CompressorType = genInput.GetEx<string>("AC_CompressorType");
SSMInputs.ACSystem.AC_CompressorCapacitykW = genInput.GetEx<double>("AC_CompressorCapacitykW").SI(Unit.SI.Kilo.Watt).Cast<Watt>();
SSMInputs.Ventilation.VEN_VentilationOnDuringHeating = genInput.GetEx<bool>("VEN_VentilationOnDuringHeating");
SSMInputs.Ventilation.VEN_VentilationWhenBothHeatingAndACInactive = genInput.GetEx<bool>("VEN_VentilationWhenBothHeatingAndACInactive");
SSMInputs.Ventilation.VEN_VentilationDuringAC = genInput.GetEx<bool>("VEN_VentilationDuringAC");
SSMInputs.Ventilation.VEN_VentilationFlowSettingWhenHeatingAndACInactive = genInput.GetEx<string>("VEN_VentilationFlowSettingWhenHeatingAndACInactive");
SSMInputs.Ventilation.VEN_VentilationDuringHeating = genInput.GetEx<string>("VEN_VentilationDuringHeating");
SSMInputs.Ventilation.VEN_VentilationDuringCooling = genInput.GetEx<string>("VEN_VentilationDuringCooling");
SSMInputs.AuxHeater.AH_EngineWasteHeatkW = genInput.GetEx<double>("AH_EngineWasteHeatkW").SI(Unit.SI.Kilo.Watt).Cast<Watt>();
SSMInputs.AuxHeater.AH_FuelFiredHeaterkW = genInput.GetEx<double>("AH_FuelFiredHeaterkW").SI(Unit.SI.Kilo.Watt).Cast<Watt>();
SSMInputs.AuxHeater.AH_FuelEnergyToHeatToCoolant = genInput.GetEx<double>("AH_FuelEnergyToHeatToCoolant");
SSMInputs.AuxHeater.AH_CoolantHeatTransferredToAirCabinHeater = genInput.GetEx<double>("AH_CoolantHeatTransferredToAirCabinHeater");
}
// Comparison
......@@ -277,13 +280,13 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
var returnValue = true;
var properties = GenInputs.GetType().GetProperties();
var properties = SSMInputs.GetType().GetProperties();
foreach (var prop in properties) {
// If Not prop.GetAccessors.IsReadOnly Then
if (prop.CanWrite) {
if (!prop.GetValue(GenInputs, null/* TODO Change to default(_) if this is not a reference type */).Equals(prop.GetValue(src.GenInputs, null/* TODO Change to default(_) if this is not a reference type */)))
if (!prop.GetValue(SSMInputs, null/* TODO Change to default(_) if this is not a reference type */).Equals(prop.GetValue(src.SSMInputs, null/* TODO Change to default(_) if this is not a reference type */)))
returnValue = false;
}
}
......@@ -337,10 +340,10 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.HVAC
return 0.SI<KilogramPerSecond>();
// Set Engine Waste Heat
GenInputs.AH_EngineWasteHeatkW = AverageUseableEngineWasteHeatKW;
SSMInputs.AuxHeater.AH_EngineWasteHeatkW = AverageUseableEngineWasteHeatKW;
var fba = FuelPerHBaseAdjusted;
// Dim FuelFiredWarning As Boolean = fba * GenInputs.BC_AuxHeaterEfficiency * HVACConstants.FuelDensity * GenInputs.BC_GCVDieselOrHeatingOil * 1000 > (AverageUseableEngineWasteHeatKW + GenInputs.AH_FuelFiredHeaterkW)
// Dim FuelFiredWarning As Boolean = fba * SSMInputs.BC_AuxHeaterEfficiency * HVACConstants.FuelDensity * SSMInputs.BC_GCVDieselOrHeatingOil * 1000 > (AverageUseableEngineWasteHeatKW + SSMInputs.AH_FuelFiredHeaterkW)
// If Not FuelFiredHeaterInsufficientWarned AndAlso FuelFiredWarning Then
......
......@@ -27,8 +27,8 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl
protected override void DoCalculate()
{
var s1 = M13.WHTCTotalCycleFuelConsumption * Constants.DieselGCVJperGram;
var s2 = SSM.GenInputs.AH_FuelEnergyToHeatToCoolant * s1;
var s3 = s2 * SSM.GenInputs.AH_CoolantHeatTransferredToAirCabinHeater;
var s2 = SSM.SSMInputs.AuxHeater.AH_FuelEnergyToHeatToCoolant * s1;
var s3 = s2 * SSM.SSMInputs.AuxHeater.AH_CoolantHeatTransferredToAirCabinHeater;
var s4 = s3 / Signals.CurrentCycleTimeInSeconds.SI<Second>();
var s5 = Signals.CurrentCycleTimeInSeconds.SI<Second>(); // ' / 3600
var s6 = s5 * SSM.FuelPerHBaseAsjusted(s4); // * Constants.FuelDensity;
......
......@@ -3,11 +3,27 @@ using TUGraz.VectoCore.Models.Declaration;
namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces.DownstreamModules.HVAC
{
public interface ISSMGenInputs
public interface ISSMInputs
{
ISSMBusParameters BusParameters { get; }
ISSMBoundaryConditions BoundaryConditions { get; }
IEnvironmentalConditions EnvironmentalConditions { get; }
IACSystem ACSystem { get; }
IVentilation Ventilation { get; }
IAuxHeater AuxHeater { get; }
}
public interface ISSMBusParameters
{
// Bus Parameterisation
string BP_BusModel { get; }
double BP_NumberOfPassengers { get; }
FloorType BP_BusFloorType { get; }
bool BP_DoubleDecker { get; }
......@@ -20,15 +36,22 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces.DownstreamModules.HV
SquareMeter BP_BusSurfaceArea { get; }
CubicMeter BP_BusVolume { get; }
PerSquareMeter BC_PassengerDensityLowFloor { get; }
PerSquareMeter BC_PassengerDensitySemiLowFloor { get; }
PerSquareMeter BC_PassengerDensityRaisedFloor { get; }
double BC_CalculatedPassengerNumber { get; }
}
public interface ISSMBoundaryConditions
{
// Boundary Conditions:
double BC_GFactor { get; set; }
double BC_SolarClouding { get; }
Watt BC_HeatPerPassengerIntoCabinW { get; }
Kelvin BC_PassengerBoundaryTemperature { get; set; }
PerSquareMeter BC_PassengerDensityLowFloor { get; }
PerSquareMeter BC_PassengerDensitySemiLowFloor { get; }
PerSquareMeter BC_PassengerDensityRaisedFloor { get; }
double BC_CalculatedPassengerNumber { get; }
WattPerKelvinSquareMeter BC_UValues { get; }
Kelvin BC_HeatingBoundaryTemperature { get; set; }
Kelvin BC_CoolingBoundaryTemperature { get; set; }
......@@ -46,28 +69,49 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces.DownstreamModules.HV
SquareMeter BC_FrontRearWindowArea { get; }
Kelvin BC_MaxTemperatureDeltaForLowFloorBusses { get; set; }
double BC_MaxPossibleBenefitFromTechnologyList { get; set; }
}
public interface IEnvironmentalConditions
{
// EnviromentalConditions
Kelvin EC_EnviromentalTemperature { get; set; }
WattPerSquareMeter EC_Solar { get; set; }
IEnvironmentalConditionsMap EC_EnvironmentalConditionsMap { get; }
string EC_EnviromentalConditions_BatchFile { get; set; }
bool EC_EnviromentalConditions_BatchEnabled { get; set; }
}
public interface IACSystem
{
// AC-system
string AC_CompressorType { get; set; }
string AC_CompressorTypeDerived { get; }
Watt AC_CompressorCapacitykW { get; set; }
double AC_COP { get; }
}
public interface IVentilation
{
// Ventilation
bool VEN_VentilationOnDuringHeating { get; set; }
bool VEN_VentilationWhenBothHeatingAndACInactive { get; set; }
bool VEN_VentilationDuringAC { get; set; }
string VEN_VentilationFlowSettingWhenHeatingAndACInactive { get; set; }
string VEN_VentilationDuringHeating { get; set; }
string VEN_VentilationDuringCooling { get; set; }
}
public interface IAuxHeater
{
// Aux. Heater
Watt AH_EngineWasteHeatkW { get; set; }
Watt AH_FuelFiredHeaterkW { get; set; }
......
......@@ -3,7 +3,7 @@
namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces.DownstreamModules.HVAC {
public interface ISSMTOOL
{
ISSMGenInputs GenInputs { get; set; }
ISSMInputs SSMInputs { get; set; }
ISSMTechList TechList { get; set; }
ISSMCalculate Calculate { get; set; }
bool SSMDisabled { get; set; }
......
......@@ -12,7 +12,7 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces.DownstreamModules.HV
bool Delete(ITechListBenefitLine item, ref string feedback);
bool Modify(ITechListBenefitLine originalItem, ITechListBenefitLine modifiedItem, ref string feedback);
//void SetSSMGeneralInputs(ISSMGenInputs genInputs);
//void SetSSMGeneralInputs(ISSMInputs genInputs);
double HValueVariation { get; }
double VHValueVariation { get; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment