diff --git a/Generic Vehicles/Declaration Mode/Class9_RigidTruck_AT_6x2/TorqueConverter_Serial_TqMax1200.vtcc b/Generic Vehicles/Declaration Mode/Class9_RigidTruck_AT_6x2/TorqueConverter_Serial_TqMax1200.vtcc index e96d65d4c14370fdda7fb7f432bd1400685cb056..5c62f0ee149b2154fb161421c23b09360589164d 100644 --- a/Generic Vehicles/Declaration Mode/Class9_RigidTruck_AT_6x2/TorqueConverter_Serial_TqMax1200.vtcc +++ b/Generic Vehicles/Declaration Mode/Class9_RigidTruck_AT_6x2/TorqueConverter_Serial_TqMax1200.vtcc @@ -1,4 +1,4 @@ -Speed Ratio, Torque Ratio, Input Torque at reference rpm +Speed Ratio, Torque Ratio, MP1000 0,1.8,404.790015179626 0.1,1.70555555555556,391.297014673638 0.2,1.61111111111111,377.804014167651 diff --git a/HashingCmd/HashingCmd.csproj b/HashingCmd/HashingCmd.csproj index 7ee07480a160366124db4c0ab30057e323729952..003cb1038cfd65d10a8afd81d22223ce5f598c07 100644 --- a/HashingCmd/HashingCmd.csproj +++ b/HashingCmd/HashingCmd.csproj @@ -30,6 +30,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <ItemGroup> <Reference Include="System" /> diff --git a/HashingTool/HashingTool.csproj b/HashingTool/HashingTool.csproj index 541983d2e930ee1319da3b8cc99b95ec63591c2b..5e81b9514a845a0c63450b4c7bd4a46d2f3d6c72 100644 --- a/HashingTool/HashingTool.csproj +++ b/HashingTool/HashingTool.csproj @@ -32,6 +32,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup> <ApplicationIcon>HashingIcon.ico</ApplicationIcon> diff --git a/VECTO.sln.DotSettings b/VECTO.sln.DotSettings index 147e42b1e5859ecd5ecf48f31543c2ebf6b31b8f..1f889a17ccd10ca88071a8b3f024ffc25316a7a0 100644 --- a/VECTO.sln.DotSettings +++ b/VECTO.sln.DotSettings @@ -114,4 +114,7 @@ <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean> - <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EFormat_002ESettingsUpgrade_002EAlignmentTabFillStyleMigration/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> + <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EFormat_002ESettingsUpgrade_002EAlignmentTabFillStyleMigration/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsParsFormattingSettingsUpgrader/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EXml_002ECodeStyle_002EFormatSettingsUpgrade_002EXmlMoveToCommonFormatterSettingsUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> diff --git a/VECTO/Input Files/Vehicle.vb b/VECTO/Input Files/Vehicle.vb index 90a9f182aaec69ef17dfad73bc48f7dfe439c486..dde47c8190239717692b5e9a747dbd7fcdb90db0 100644 --- a/VECTO/Input Files/Vehicle.vb +++ b/VECTO/Input Files/Vehicle.vb @@ -112,7 +112,7 @@ Public Class Vehicle Dim segment As Segment = DeclarationData.Segments.Lookup(vehicle.VehicleCategory, vehicle.AxleConfiguration, vehicle.GrossVehicleMassRating, vehicle.CurbMassChassis, false) vehicleData = doa.CreateVehicleData(vehicle, segment.Missions.First(), - segment.Missions.First().Loadings.First().Value) + segment.Missions.First().Loadings.First().Value, true) airdragData = doa.CreateAirdragData(vehicle, segment.Missions.First(), segment) retarderData = doa.CreateRetarderData(vehicle) angledriveData = doa.CreateAngledriveData(vehicle) diff --git a/VECTO/VECTO.vbproj b/VECTO/VECTO.vbproj index 0419bbdd9af104ab3478828b243cef72a25fb81e..2d2c4f2909e3858a79adbc431f4b314a0276cc92 100644 --- a/VECTO/VECTO.vbproj +++ b/VECTO/VECTO.vbproj @@ -142,6 +142,7 @@ <WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <DefineConstants>CERTIFICATION_RELEASE</DefineConstants> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deploy|x86'"> <DefineTrace>true</DefineTrace> diff --git a/VECTOAux/VectoAuxiliaries/Hvac/HVACSteadyStateModel.vb b/VECTOAux/VectoAuxiliaries/Hvac/HVACSteadyStateModel.vb index fe840ffd87027d89646c98b9178957cc78bd5eb0..afd05b6439507490fea686aa83295ff2bbcaf7f2 100644 --- a/VECTOAux/VectoAuxiliaries/Hvac/HVACSteadyStateModel.vb +++ b/VECTOAux/VectoAuxiliaries/Hvac/HVACSteadyStateModel.vb @@ -23,13 +23,7 @@ Namespace Hvac Public Sub New() End Sub - Public Sub New(elecPowerW As Single, mechPowerW As Single, fuellingLPH As Single) - - HVACElectricalLoadPowerWatts = elecPowerW - HVACFuellingLitresPerHour = mechPowerW - HVACMechanicalLoadPowerWatts = fuellingLPH - End Sub - + 'Implementation Public Function SetValuesFromMap(ByVal filePath As String, byref message As String) As Boolean _ Implements IHVACSteadyStateModel.SetValuesFromMap diff --git a/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb b/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb index 12b5ac6feaba175e3b03d1099b9cad394e8b699b..c91fb69fb780f8cded4affb91272d5ecd76f6547 100644 --- a/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb +++ b/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb @@ -3,793 +3,864 @@ Imports Microsoft.VisualBasic Imports VectoAuxiliaries.Hvac Namespace Hvac - 'Modeling SSHVAC V07 - Public Class SSMCalculate - Implements ISSMCalculate + 'Modeling SSHVAC V07 + Public Class SSMCalculate + Implements ISSMCalculate - Private ssmTOOL As ISSMTOOL - Private Property Run1 As ISSMRun Implements ISSMCalculate.Run1 - Private Property Run2 As ISSMRun Implements ISSMCalculate.Run2 + Private ssmTOOL As ISSMTOOL + Private Property Run1 As ISSMRun Implements ISSMCalculate.Run1 + Private Property Run2 As ISSMRun Implements ISSMCalculate.Run2 - 'Constructor - Sub New(ssmTool As ISSMTOOL) + 'Constructor + Sub New(ssmTool As ISSMTOOL) - Me.ssmTOOL = ssmTool - Run1 = New SSMRun(Me.ssmTOOL, 1) - Run2 = New SSMRun(Me.ssmTOOL, 2) - End Sub + Me.ssmTOOL = ssmTool + Run1 = New SSMRun(Me.ssmTOOL, 1) + Run2 = New SSMRun(Me.ssmTOOL, 2) + End Sub #Region "Main Outputs" - 'BASE RESULTS - Public ReadOnly Property ElectricalWBase As Double Implements ISSMCalculate.ElectricalWBase - Get - - Dim ElectricalWBaseWeightedAverage As Double - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature - Dim EC_SolarBefore As Double = gen.EC_Solar - - 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. - 'Else if batch is enable calculate the ElectricalWBase for each input in the AENV file and then calculate the weighted average - If Not gen.EC_EnviromentalConditions_BatchEnabled Then - ElectricalWBaseWeightedAverage = CalculateElectricalWBase(gen, gen.EC_EnviromentalTemperature, gen.EC_Solar, 1) - Else - For Each envCondition As IEnvironmentalCondition In gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() - ElectricalWBaseWeightedAverage += CalculateElectricalWBase(gen, envCondition.GetTemperature(), - envCondition.GetSolar(), - envCondition.GetNormalisedWeighting(gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions())) - Next - gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore - gen.EC_Solar = EC_SolarBefore - End If - - Return ElectricalWBaseWeightedAverage - End Get - End Property - - Public ReadOnly Property MechanicalWBase As Double Implements ISSMCalculate.MechanicalWBase - Get - - Dim MechanicalWBaseWeightedAverage As Double - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature - Dim EC_SolarBefore As Double = gen.EC_Solar - - 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. - 'Else if batch is enable calculate the MechanicalWBase for each input in the AENV file and then calculate the weighted average - If Not gen.EC_EnviromentalConditions_BatchEnabled Then - MechanicalWBaseWeightedAverage = CalculateMechanicalWBase(gen, gen.EC_EnviromentalTemperature, gen.EC_Solar, 1) - Else - For Each envCondition As IEnvironmentalCondition In gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() - MechanicalWBaseWeightedAverage += CalculateMechanicalWBase(gen, envCondition.GetTemperature(), - envCondition.GetSolar(), - envCondition.GetNormalisedWeighting(gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions())) - Next - gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore - gen.EC_Solar = EC_SolarBefore - End If - - Return MechanicalWBaseWeightedAverage - End Get - End Property - - Public ReadOnly Property FuelPerHBase As Double Implements ISSMCalculate.FuelPerHBase - Get - - Dim FuelLPerHBaseWeightedAverage As Double - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature - Dim EC_SolarBefore As Double = gen.EC_Solar - - 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. - 'Else if batch is enable calculate the FuelLPerHBase for each input in the AENV file and then calculate the weighted average - If Not gen.EC_EnviromentalConditions_BatchEnabled Then - FuelLPerHBaseWeightedAverage = CalculateFuelLPerHBase(gen, gen.EC_EnviromentalTemperature, gen.EC_Solar, 1) - Else - For Each envCondition As IEnvironmentalCondition In gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() - FuelLPerHBaseWeightedAverage += CalculateFuelLPerHBase(gen, envCondition.GetTemperature(), envCondition.GetSolar(), - envCondition.GetNormalisedWeighting(gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions())) - Next - gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore - gen.EC_Solar = EC_SolarBefore - End If - - Return FuelLPerHBaseWeightedAverage - End Get - End Property - - 'ADJUSTED RESULTS - Public ReadOnly Property ElectricalWAdjusted As Double Implements ISSMCalculate.ElectricalWAdjusted - Get - Dim ElectricalWAdjustedAverage As Double - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature - Dim EC_SolarBefore As Double = gen.EC_Solar - - 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. - 'Else if batch is enable calculate the ElectricalWAdjusted for each input in the AENV file and then calculate the weighted average - If Not gen.EC_EnviromentalConditions_BatchEnabled Then - ElectricalWAdjustedAverage = CalculateElectricalWAdjusted(gen, tl, gen.EC_EnviromentalTemperature, gen.EC_Solar, 1) - Else - For Each envCondition As IEnvironmentalCondition In gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() - ElectricalWAdjustedAverage += CalculateElectricalWAdjusted(gen, tl, envCondition.GetTemperature(), - envCondition.GetSolar(), - envCondition.GetNormalisedWeighting(gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions())) - Next - gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore - gen.EC_Solar = EC_SolarBefore - End If - - Return ElectricalWAdjustedAverage - End Get - End Property - - Public ReadOnly Property MechanicalWBaseAdjusted As Double Implements ISSMCalculate.MechanicalWBaseAdjusted - Get - - Dim MechanicalWBaseAdjustedAverage As Double - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature - Dim EC_SolarBefore As Double = gen.EC_Solar - - 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. - 'Else if batch is enable calculate the MechanicalWBaseAdjusted for each input in the AENV file and then calculate the weighted average - If Not gen.EC_EnviromentalConditions_BatchEnabled Then - MechanicalWBaseAdjustedAverage = CalculateMechanicalWBaseAdjusted(gen, tl, gen.EC_EnviromentalTemperature, - gen.EC_Solar, 1) - Else - For Each envCondition As IEnvironmentalCondition In gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() - MechanicalWBaseAdjustedAverage += CalculateMechanicalWBaseAdjusted(gen, tl, envCondition.GetTemperature(), - envCondition.GetSolar(), - envCondition.GetNormalisedWeighting( - gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions())) - Next - gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore - gen.EC_Solar = EC_SolarBefore - End If - - Return MechanicalWBaseAdjustedAverage - End Get - End Property - - Public ReadOnly Property FuelPerHBaseAdjusted As Double Implements ISSMCalculate.FuelPerHBaseAdjusted - Get - Dim FuelLPerHBaseAdjustedAverage As Double - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature - Dim EC_SolarBefore As Double = gen.EC_Solar - - 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. - 'Else if batch is enable calculate the FuelLPerHBaseAdjusted for each input in the AENV file and then calculate the weighted average - If Not gen.EC_EnviromentalConditions_BatchEnabled Then - FuelLPerHBaseAdjustedAverage = CalculateFuelLPerHBaseAdjusted(gen, tl, gen.EC_EnviromentalTemperature, gen.EC_Solar, - 1) - Else - For Each envCondition As IEnvironmentalCondition In gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() - FuelLPerHBaseAdjustedAverage += CalculateFuelLPerHBaseAdjusted(gen, tl, envCondition.GetTemperature(), - envCondition.GetSolar(), - envCondition.GetNormalisedWeighting(gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions())) - Next - gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore - gen.EC_Solar = EC_SolarBefore - End If - - Return FuelLPerHBaseAdjustedAverage - End Get - End Property + 'BASE RESULTS + Public ReadOnly Property ElectricalWBase As Double Implements ISSMCalculate.ElectricalWBase + Get + + Dim ElectricalWBaseWeightedAverage As Double + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature + Dim EC_SolarBefore As Double = gen.EC_Solar + + 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. + 'Else if batch is enable calculate the ElectricalWBase for each input in the AENV file and then calculate the weighted average + If Not gen.EC_EnviromentalConditions_BatchEnabled Then + ElectricalWBaseWeightedAverage = CalculateElectricalWBase(gen, gen.EC_EnviromentalTemperature, + gen.EC_Solar, 1) + Else + For Each envCondition As IEnvironmentalCondition In _ + gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() + ElectricalWBaseWeightedAverage += CalculateElectricalWBase(gen, envCondition.GetTemperature(), + envCondition.GetSolar(), + envCondition.GetNormalisedWeighting( + gen.EC_EnvironmentalConditionsMap _ + . + GetEnvironmentalConditions())) + Next + gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore + gen.EC_Solar = EC_SolarBefore + End If + + Return ElectricalWBaseWeightedAverage + End Get + End Property + + Public ReadOnly Property MechanicalWBase As Double Implements ISSMCalculate.MechanicalWBase + Get + + Dim MechanicalWBaseWeightedAverage As Double + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature + Dim EC_SolarBefore As Double = gen.EC_Solar + + 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. + 'Else if batch is enable calculate the MechanicalWBase for each input in the AENV file and then calculate the weighted average + If Not gen.EC_EnviromentalConditions_BatchEnabled Then + MechanicalWBaseWeightedAverage = CalculateMechanicalWBase(gen, gen.EC_EnviromentalTemperature, + gen.EC_Solar, 1) + Else + For Each envCondition As IEnvironmentalCondition In _ + gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() + MechanicalWBaseWeightedAverage += CalculateMechanicalWBase(gen, envCondition.GetTemperature(), + envCondition.GetSolar(), + envCondition.GetNormalisedWeighting( + gen.EC_EnvironmentalConditionsMap _ + . + GetEnvironmentalConditions())) + Next + gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore + gen.EC_Solar = EC_SolarBefore + End If + + Return MechanicalWBaseWeightedAverage + End Get + End Property + + Public ReadOnly Property FuelPerHBase As Double Implements ISSMCalculate.FuelPerHBase + Get + + Dim FuelLPerHBaseWeightedAverage As Double + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature + Dim EC_SolarBefore As Double = gen.EC_Solar + + 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. + 'Else if batch is enable calculate the FuelLPerHBase for each input in the AENV file and then calculate the weighted average + If Not gen.EC_EnviromentalConditions_BatchEnabled Then + FuelLPerHBaseWeightedAverage = CalculateFuelLPerHBase(gen, gen.EC_EnviromentalTemperature, + gen.EC_Solar, 1) + Else + For Each envCondition As IEnvironmentalCondition In _ + gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() + FuelLPerHBaseWeightedAverage += CalculateFuelLPerHBase(gen, envCondition.GetTemperature(), + envCondition.GetSolar(), + envCondition.GetNormalisedWeighting( + gen.EC_EnvironmentalConditionsMap. + GetEnvironmentalConditions())) + Next + gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore + gen.EC_Solar = EC_SolarBefore + End If + + Return FuelLPerHBaseWeightedAverage + End Get + End Property + + 'ADJUSTED RESULTS + Public ReadOnly Property ElectricalWAdjusted As Double Implements ISSMCalculate.ElectricalWAdjusted + Get + Dim ElectricalWAdjustedAverage As Double + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature + Dim EC_SolarBefore As Double = gen.EC_Solar + + 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. + 'Else if batch is enable calculate the ElectricalWAdjusted for each input in the AENV file and then calculate the weighted average + If Not gen.EC_EnviromentalConditions_BatchEnabled Then + ElectricalWAdjustedAverage = CalculateElectricalWAdjusted(gen, tl, gen.EC_EnviromentalTemperature, + gen.EC_Solar, 1) + Else + For Each envCondition As IEnvironmentalCondition In _ + gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() + ElectricalWAdjustedAverage += CalculateElectricalWAdjusted(gen, tl, + envCondition.GetTemperature(), + envCondition.GetSolar(), + envCondition.GetNormalisedWeighting( + gen.EC_EnvironmentalConditionsMap _ + . + GetEnvironmentalConditions())) + Next + gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore + gen.EC_Solar = EC_SolarBefore + End If + + Return ElectricalWAdjustedAverage + End Get + End Property + + Public ReadOnly Property MechanicalWBaseAdjusted As Double Implements ISSMCalculate.MechanicalWBaseAdjusted + Get + + Dim MechanicalWBaseAdjustedAverage As Double + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature + Dim EC_SolarBefore As Double = gen.EC_Solar + + 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. + 'Else if batch is enable calculate the MechanicalWBaseAdjusted for each input in the AENV file and then calculate the weighted average + If Not gen.EC_EnviromentalConditions_BatchEnabled Then + MechanicalWBaseAdjustedAverage = CalculateMechanicalWBaseAdjusted(gen, tl, + gen.EC_EnviromentalTemperature, + gen.EC_Solar, 1) + Else + For Each envCondition As IEnvironmentalCondition In _ + gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() + MechanicalWBaseAdjustedAverage += CalculateMechanicalWBaseAdjusted(gen, tl, + envCondition.GetTemperature(), + envCondition.GetSolar(), + envCondition. + GetNormalisedWeighting( + gen. + EC_EnvironmentalConditionsMap _ + . + GetEnvironmentalConditions())) + Next + gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore + gen.EC_Solar = EC_SolarBefore + End If + + Return MechanicalWBaseAdjustedAverage + End Get + End Property + + Public ReadOnly Property FuelPerHBaseAdjusted As Double Implements ISSMCalculate.FuelPerHBaseAdjusted + Get + Dim FuelLPerHBaseAdjustedAverage As Double + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + Dim EC_EnviromentalTemperatureBefore As Double = gen.EC_EnviromentalTemperature + Dim EC_SolarBefore As Double = gen.EC_Solar + + 'If batch mode is disabled use the EC_EnviromentalTemperature and EC_Solar variables. + 'Else if batch is enable calculate the FuelLPerHBaseAdjusted for each input in the AENV file and then calculate the weighted average + If Not gen.EC_EnviromentalConditions_BatchEnabled Then + FuelLPerHBaseAdjustedAverage = CalculateFuelLPerHBaseAdjusted(gen, tl, + gen.EC_EnviromentalTemperature, + gen.EC_Solar, + 1) + Else + For Each envCondition As IEnvironmentalCondition In _ + gen.EC_EnvironmentalConditionsMap.GetEnvironmentalConditions() + FuelLPerHBaseAdjustedAverage += CalculateFuelLPerHBaseAdjusted(gen, tl, + envCondition.GetTemperature(), + envCondition.GetSolar(), + envCondition. + GetNormalisedWeighting( + gen. + EC_EnvironmentalConditionsMap _ + . + GetEnvironmentalConditions())) + Next + gen.EC_EnviromentalTemperature = EC_EnviromentalTemperatureBefore + gen.EC_Solar = EC_SolarBefore + End If + + Return FuelLPerHBaseAdjustedAverage + End Get + End Property #End Region #Region "Staging Calculations" - 'Base Values - Public ReadOnly Property BaseHeatingW_Mechanical As Double Implements ISSMCalculate.BaseHeatingW_Mechanical - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property BaseHeatingW_ElectricalCoolingHeating As Double _ - Implements ISSMCalculate.BaseHeatingW_ElectricalCoolingHeating - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property BaseHeatingW_ElectricalVentilation As Double _ - Implements ISSMCalculate.BaseHeatingW_ElectricalVentilation - Get - '=IF(AND(M89<0,M90<0),IF(AND(C62="yes",C66="high"),C33,IF(AND(C62="yes",C66="low"),C34,0)),0) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - - 'Dim C33 = gen.BC_HighVentPowerW - 'Dim C34 = gen.BC_LowVentPowerW - 'Dim C62 = gen.VEN_VentilationONDuringHeating - 'Dim C66 = gen.VEN_VentilationDuringHeating - 'Dim M89 = Me.Run1.TotalW - 'Dim M90 = Me.Run2.TotalW - - Dim res As Double - - res = If(Run1.TotalW < 0 AndAlso Run2.TotalW < 0, - If(gen.VEN_VentilationOnDuringHeating AndAlso gen.VEN_VentilationDuringHeating.ToLower() = "high", - gen.BC_HighVentPowerW, - If _ - (gen.VEN_VentilationOnDuringHeating AndAlso gen.VEN_VentilationDuringHeating.ToLower() = "low", - gen.BC_LowVentPowerW, 0)), 0) - - - Return res - End Get - End Property - - Public ReadOnly Property BaseHeatingW_FuelFiredHeating As Double _ - Implements ISSMCalculate.BaseHeatingW_FuelFiredHeating - - Get - '=IF(AND(M89<0,M90<0),VLOOKUP(MAX(M89:M90),M89:O90,3),0) - - 'Dim M89 = Me.Run1.TotalW - 'Dim M90 = Me.Run2.TotalW - 'VLOOKUP(MAX(M89:M90),M89:O90 => VLOOKUP ( lookupValue, tableArray, colIndex, rangeLookup ) - - 'If both Run TotalW values are >=0 then return FuelW from Run with largest TotalW value, else return 0 - If (Run1.TotalW < 0 AndAlso Run2.TotalW < 0) Then - - Return If(Run1.TotalW > Run2.TotalW, Run1.FuelW, Run2.FuelW) - - Else - - Return 0 - - End If - End Get - End Property - - Public ReadOnly Property BaseCoolingW_Mechanical As Double Implements ISSMCalculate.BaseCoolingW_Mechanical - Get - '=IF(C46<C28,0,IF(C53="electrical", 0, IF(AND(M89>0,M90>0),MIN(M89:M90),0))) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - - 'Dim C46 = gen.EC_EnviromentalTemperature - 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff - 'Dim C53 = gen.AC_CompressorTypeDerived - 'Dim M89 = Run1.TotalW - 'Dim M90 = Run2.TotalW - - Return _ - If _ - (gen.EC_EnviromentalTemperature < gen.BC_TemperatureCoolingTurnsOff, 0, - If _ - (gen.AC_CompressorTypeDerived.ToLower() = "electrical", 0, - If(Run1.TotalW > 0 AndAlso Run2.TotalW > 0, Math.Min(Run1.TotalW, Run2.TotalW), 0))) - End Get - End Property - - Public ReadOnly Property BaseCoolingW_ElectricalCoolingHeating As Double _ - Implements ISSMCalculate.BaseCoolingW_ElectricalCoolingHeating - Get - '=IF(C46<C28,0,IF(C53="electrical",IF(AND(M89>0,M90>0),MIN(M89:M90),0),0)) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - - 'Dim C46 = gen.EC_EnviromentalTemperature - 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff - 'Dim C53 = gen.AC_CompressorTypeDerived - 'Dim M89 = Run1.TotalW - 'Dim M90 = Run2.TotalW - - Return _ - If _ - (gen.EC_EnviromentalTemperature < gen.BC_TemperatureCoolingTurnsOff, 0, - If _ - (gen.AC_CompressorTypeDerived.ToLower() = "electrical", - If(Run1.TotalW > 0 AndAlso Run2.TotalW > 0, Math.Min(Run1.TotalW, Run2.TotalW), 0), 0)) - End Get - End Property - - Public ReadOnly Property BaseCoolingW_ElectricalVentilation As Double _ - Implements ISSMCalculate.BaseCoolingW_ElectricalVentilation - Get - '=IF(AND(C46>=C28,M89>0,M90>0),IF(AND(C64="yes",C67="high"),C33,IF(AND(C64="yes",C67="low"),C34,0)),0) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - - 'Dim C46 = gen.EC_EnviromentalTemperature - 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff - 'Dim M89 = Run1.TotalW - 'Dim M90 = Run2.TotalW - 'Dim C64 = gen.VEN_VentilationDuringAC - 'Dim C67 = gen.VEN_VentilationDuringCooling - 'Dim C33 = gen.BC_HighVentPowerW - 'Dim C34 = gen.BC_LowVentPowerW - - Return _ - If _ - ( - gen.EC_EnviromentalTemperature >= gen.BC_TemperatureCoolingTurnsOff AndAlso Run1.TotalW > 0 AndAlso - Run2.TotalW > 0, - If _ - (gen.VEN_VentilationDuringAC AndAlso gen.VEN_VentilationDuringCooling.ToLower() = "high", gen.BC_HighVentPowerW, - If _ - (gen.VEN_VentilationDuringAC AndAlso gen.VEN_VentilationDuringCooling.ToLower() = "low", gen.BC_LowVentPowerW, 0)) _ - , 0) - End Get - End Property - - Public ReadOnly Property BaseCoolingW_FuelFiredHeating As Double _ - Implements ISSMCalculate.BaseCoolingW_FuelFiredHeating - Get - Return 0 - End Get - End Property - - Public ReadOnly Property BaseVentilationW_Mechanical As Double Implements ISSMCalculate.BaseVentilationW_Mechanical - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property BaseVentilationW_ElectricalCoolingHeating As Double _ - Implements ISSMCalculate.BaseVentilationW_ElectricalCoolingHeating - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property BaseVentilationW_ElectricalVentilation As Double _ - Implements ISSMCalculate.BaseVentilationW_ElectricalVentilation - Get - '=IF(OR(AND(C46<C28,M89>0,M90>0),AND(M89>0,M90<0)),IF(AND(C63="yes",C65="high"),C33,IF(AND(C63="yes",C65="low"),C34,0)),0) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - - 'Dim C46 = gen.EC_EnviromentalTemperature - 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff - 'Dim M89 = Run1.TotalW - 'Dim M90 = Run2.TotalW - 'Dim C63 = gen.VEN_VentilationWhenBothHeatingAndACInactive - 'Dim C65 = gen.VEN_VentilationFlowSettingWhenHeatingAndACInactive - 'Dim C33 = gen.BC_HighVentPowerW - 'Dim C34 = gen.BC_LowVentPowerW - - Return _ - If _ - ( - (gen.EC_EnviromentalTemperature < gen.BC_TemperatureCoolingTurnsOff AndAlso Run1.TotalW > 0 AndAlso - Run2.TotalW > 0) OrElse (Run1.TotalW > 0 AndAlso Run2.TotalW < 0), - If _ - ( - gen.VEN_VentilationWhenBothHeatingAndACInactive AndAlso - gen.VEN_VentilationFlowSettingWhenHeatingAndACInactive.ToLower() = "high", gen.BC_HighVentPowerW, - If _ - ( - gen.VEN_VentilationWhenBothHeatingAndACInactive AndAlso - gen.VEN_VentilationFlowSettingWhenHeatingAndACInactive.ToLower() = "low", gen.BC_LowVentPowerW, 0)), 0) - End Get - End Property - - Public ReadOnly Property BaseVentilationW_FuelFiredHeating As Double _ - Implements ISSMCalculate.BaseVentilationW_FuelFiredHeating - Get - Return 0 - End Get - End Property - - 'Adjusted Values - Public ReadOnly Property TechListAdjustedHeatingW_Mechanical As Double _ - Implements ISSMCalculate.TechListAdjustedHeatingW_Mechanical - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property TechListAdjustedHeatingW_ElectricalCoolingHeating As Double _ - Implements ISSMCalculate.TechListAdjustedHeatingW_ElectricalCoolingHeating - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property TechListAdjustedHeatingW_ElectricalVentilation As Double _ - Implements ISSMCalculate.TechListAdjustedHeatingW_ElectricalVentilation - Get - '=IF('TECH LIST INPUT'!O92>0,MIN('TECH LIST INPUT'!O92,C43),MAX('TECH LIST INPUT'!O92,-C43)) - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - - 'TECH LIST INPUT'!O92 - 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList - 'Dim TLO92 As Double = tl.VHValueVariation - - - Return _ - If _ - (tl.VHValueVariation > 0, Math.Min(tl.VHValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), - Math.Max(tl.VHValueVariation, -gen.BC_MaxPossibleBenefitFromTechnologyList)) - End Get - End Property - - Public ReadOnly Property TechListAdjustedHeatingW_FuelFiredHeating As Double _ - Implements ISSMCalculate.TechListAdjustedHeatingW_FuelFiredHeating - Get - '=IF('TECH LIST INPUT'!N92>0,MIN('TECH LIST INPUT'!N92,C43),MAX('TECH LIST INPUT'!N92,-C43)) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - - 'TECH LIST INPUT'!N92 - 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList - 'Dim TLN92 As Double = tl.HValueVariation - - - Return _ - If _ - (tl.HValueVariation > 0, Math.Min(tl.HValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), - Math.Max(tl.HValueVariation, -gen.BC_MaxPossibleBenefitFromTechnologyList)) - End Get - End Property - - Public ReadOnly Property TechListAdjustedCoolingW_Mechanical As Double _ - Implements ISSMCalculate.TechListAdjustedCoolingW_Mechanical - Get - '=IF(IF(C53="mechanical",'TECH LIST INPUT'!R92,0)>0,MIN(IF(C53="mechanical",'TECH LIST INPUT'!R92,0),C43),MAX(IF(C53="mechanical",'TECH LIST INPUT'!R92,0),-C43)) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - Dim result As Double - 'Dim TLR92 As Double = tl.CValueVariation 'TECH LIST INPUT'!R92 - 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList - 'Dim C53 As string = gen.AC_CompressorType - - result = If(If(gen.AC_CompressorType.ToLower() = "mechanical", tl.CValueVariation, 0) > 0, - Math.Min(If(gen.AC_CompressorType.ToLower() = "mechanical", tl.CValueVariation, 0), - gen.BC_MaxPossibleBenefitFromTechnologyList), - Math.Max(If(gen.AC_CompressorType.ToLower() = "mechanical", tl.CValueVariation, 0), - -gen.BC_MaxPossibleBenefitFromTechnologyList)) - - Return result - End Get - End Property - - Public ReadOnly Property TechListAdjustedCoolingW_ElectricalCoolingHeating As Double _ - Implements ISSMCalculate.TechListAdjustedCoolingW_ElectricalCoolingHeating - Get - '=IF(IF(C53="mechanical",0,'TECH LIST INPUT'!R92)>0,MIN(IF(C53="mechanical",0,'TECH LIST INPUT'!R92),C43),MAX(IF(C53="mechanical",0,'TECH LIST INPUT'!R92),-C43)) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - Dim result As Double - - 'Dim TLR92 As Double = tl.CValueVariation 'TECH LIST INPUT'!R92 - 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList - 'Dim C53 As string = gen.AC_CompressorType - - result = If(If(gen.AC_CompressorType.ToLower() = "mechanical", 0, tl.CValueVariation) > 0, - Math.Min(If(gen.AC_CompressorType.ToLower() = "mechanical", 0, tl.CValueVariation), - gen.BC_MaxPossibleBenefitFromTechnologyList), - Math.Max(If(gen.AC_CompressorType.ToLower() = "mechanical", 0, tl.CValueVariation), - -gen.BC_MaxPossibleBenefitFromTechnologyList)) - - Return result - End Get - End Property - - Public ReadOnly Property TechListAdjustedCoolingW_ElectricalVentilation As Double _ - Implements ISSMCalculate.TechListAdjustedCoolingW_ElectricalVentilation - Get - '=IF('TECH LIST INPUT'!Q92>0,MIN('TECH LIST INPUT'!Q92,C43),MAX('TECH LIST INPUT'!Q92,-C43)) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - - 'Dim TLQ92 As Double = tl.VCValueVariation'TECH LIST INPUT'!Q92 - 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList - - Return If(tl.VCValueVariation > 0, - Math.Min(tl.VCValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), - Math.Max(tl.VCValueVariation, -gen.BC_MaxPossibleBenefitFromTechnologyList)) - End Get - End Property - - Public ReadOnly Property TechListAdjustedCoolingW_FuelFiredHeating As Double _ - Implements ISSMCalculate.TechListAdjustedCoolingW_FuelFiredHeating - Get - Return 0 - End Get - End Property - - Public ReadOnly Property TechListAdjustedVentilationW_Mechanical As Double _ - Implements ISSMCalculate.TechListAdjustedVentilationW_Mechanical - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property TechListAdjustedVentilationW_ElectricalCoolingHeating As Double _ - Implements ISSMCalculate.TechListAdjustedVentilationW_ElectricalCoolingHeating - Get - Return Nothing - End Get - End Property - - Public ReadOnly Property TechListAdjustedVentilationW_ElectricalVentilation As Double _ - Implements ISSMCalculate.TechListAdjustedVentilationW_ElectricalVentilation - Get - '=IF('TECH LIST INPUT'!P92>0,MIN('TECH LIST INPUT'!P92,C43),MAX('TECH LIST INPUT'!P92,-C43)) - - Dim gen As ISSMGenInputs = ssmTOOL.GenInputs - Dim tl As ISSMTechList = ssmTOOL.TechList - - 'Dim TLP92 As Double = tl.VVValueVariation 'TECH LIST INPUT'!P92 - 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList - - - Return _ - If _ - (tl.VVValueVariation > 0, Math.Min(tl.VVValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), - Math.Max(tl.VVValueVariation, -gen.BC_MaxPossibleBenefitFromTechnologyList)) - End Get - End Property - - Public ReadOnly Property TechListAdjustedVentilationW_FuelFiredHeating As Double _ - Implements ISSMCalculate.TechListAdjustedVentilationW_FuelFiredHeating - Get - Return 0 - End Get - End Property + 'Base Values + Public ReadOnly Property BaseHeatingW_Mechanical As Double Implements ISSMCalculate.BaseHeatingW_Mechanical + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property BaseHeatingW_ElectricalCoolingHeating As Double _ + Implements ISSMCalculate.BaseHeatingW_ElectricalCoolingHeating + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property BaseHeatingW_ElectricalVentilation As Double _ + Implements ISSMCalculate.BaseHeatingW_ElectricalVentilation + Get + '=IF(AND(M89<0,M90<0),IF(AND(C62="yes",C66="high"),C33,IF(AND(C62="yes",C66="low"),C34,0)),0) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + + 'Dim C33 = gen.BC_HighVentPowerW + 'Dim C34 = gen.BC_LowVentPowerW + 'Dim C62 = gen.VEN_VentilationONDuringHeating + 'Dim C66 = gen.VEN_VentilationDuringHeating + 'Dim M89 = Me.Run1.TotalW + 'Dim M90 = Me.Run2.TotalW + + Dim res As Double + + res = If(Run1.TotalW < 0 AndAlso Run2.TotalW < 0, + If _ + ( + gen.VEN_VentilationOnDuringHeating AndAlso + gen.VEN_VentilationDuringHeating.ToLower() = "high", + gen.BC_HighVentPowerW, + If _ + ( + gen.VEN_VentilationOnDuringHeating AndAlso + gen.VEN_VentilationDuringHeating.ToLower() = "low", + gen.BC_LowVentPowerW, 0)), 0) + + + Return res + End Get + End Property + + Public ReadOnly Property BaseHeatingW_FuelFiredHeating As Double _ + Implements ISSMCalculate.BaseHeatingW_FuelFiredHeating + + Get + '=IF(AND(M89<0,M90<0),VLOOKUP(MAX(M89:M90),M89:O90,3),0) + + 'Dim M89 = Me.Run1.TotalW + 'Dim M90 = Me.Run2.TotalW + 'VLOOKUP(MAX(M89:M90),M89:O90 => VLOOKUP ( lookupValue, tableArray, colIndex, rangeLookup ) + + 'If both Run TotalW values are >=0 then return FuelW from Run with largest TotalW value, else return 0 + If (Run1.TotalW < 0 AndAlso Run2.TotalW < 0) Then + + Return If(Run1.TotalW > Run2.TotalW, Run1.FuelW, Run2.FuelW) + + Else + + Return 0 + + End If + End Get + End Property + + Public ReadOnly Property BaseCoolingW_Mechanical As Double Implements ISSMCalculate.BaseCoolingW_Mechanical + Get + '=IF(C46<C28,0,IF(C53="electrical", 0, IF(AND(M89>0,M90>0),MIN(M89:M90),0))) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + + 'Dim C46 = gen.EC_EnviromentalTemperature + 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff + 'Dim C53 = gen.AC_CompressorTypeDerived + 'Dim M89 = Run1.TotalW + 'Dim M90 = Run2.TotalW + + Return _ + If _ + (gen.EC_EnviromentalTemperature < gen.BC_TemperatureCoolingTurnsOff, 0, + If _ + (gen.AC_CompressorTypeDerived.ToLower() = "electrical", 0, + If(Run1.TotalW > 0 AndAlso Run2.TotalW > 0, Math.Min(Run1.TotalW, Run2.TotalW), 0))) + End Get + End Property + + Public ReadOnly Property BaseCoolingW_ElectricalCoolingHeating As Double _ + Implements ISSMCalculate.BaseCoolingW_ElectricalCoolingHeating + Get + '=IF(C46<C28,0,IF(C53="electrical",IF(AND(M89>0,M90>0),MIN(M89:M90),0),0)) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + + 'Dim C46 = gen.EC_EnviromentalTemperature + 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff + 'Dim C53 = gen.AC_CompressorTypeDerived + 'Dim M89 = Run1.TotalW + 'Dim M90 = Run2.TotalW + + Return _ + If _ + (gen.EC_EnviromentalTemperature < gen.BC_TemperatureCoolingTurnsOff, 0, + If _ + (gen.AC_CompressorTypeDerived.ToLower() = "electrical", + If(Run1.TotalW > 0 AndAlso Run2.TotalW > 0, Math.Min(Run1.TotalW, Run2.TotalW), 0), 0)) + End Get + End Property + + Public ReadOnly Property BaseCoolingW_ElectricalVentilation As Double _ + Implements ISSMCalculate.BaseCoolingW_ElectricalVentilation + Get + '=IF(AND(C46>=C28,M89>0,M90>0),IF(AND(C64="yes",C67="high"),C33,IF(AND(C64="yes",C67="low"),C34,0)),0) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + + 'Dim C46 = gen.EC_EnviromentalTemperature + 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff + 'Dim M89 = Run1.TotalW + 'Dim M90 = Run2.TotalW + 'Dim C64 = gen.VEN_VentilationDuringAC + 'Dim C67 = gen.VEN_VentilationDuringCooling + 'Dim C33 = gen.BC_HighVentPowerW + 'Dim C34 = gen.BC_LowVentPowerW + + Return _ + If _ + ( + gen.EC_EnviromentalTemperature >= gen.BC_TemperatureCoolingTurnsOff AndAlso Run1.TotalW > 0 AndAlso + Run2.TotalW > 0, + If _ + (gen.VEN_VentilationDuringAC AndAlso gen.VEN_VentilationDuringCooling.ToLower() = "high", + gen.BC_HighVentPowerW, + If _ + (gen.VEN_VentilationDuringAC AndAlso gen.VEN_VentilationDuringCooling.ToLower() = "low", + gen.BC_LowVentPowerW, 0)) _ + , 0) + End Get + End Property + + Public ReadOnly Property BaseCoolingW_FuelFiredHeating As Double _ + Implements ISSMCalculate.BaseCoolingW_FuelFiredHeating + Get + Return 0 + End Get + End Property + + Public ReadOnly Property BaseVentilationW_Mechanical As Double _ + Implements ISSMCalculate.BaseVentilationW_Mechanical + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property BaseVentilationW_ElectricalCoolingHeating As Double _ + Implements ISSMCalculate.BaseVentilationW_ElectricalCoolingHeating + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property BaseVentilationW_ElectricalVentilation As Double _ + Implements ISSMCalculate.BaseVentilationW_ElectricalVentilation + Get + '=IF(OR(AND(C46<C28,M89>0,M90>0),AND(M89>0,M90<0)),IF(AND(C63="yes",C65="high"),C33,IF(AND(C63="yes",C65="low"),C34,0)),0) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + + 'Dim C46 = gen.EC_EnviromentalTemperature + 'Dim C28 = gen.BC_TemperatureCoolingTurnsOff + 'Dim M89 = Run1.TotalW + 'Dim M90 = Run2.TotalW + 'Dim C63 = gen.VEN_VentilationWhenBothHeatingAndACInactive + 'Dim C65 = gen.VEN_VentilationFlowSettingWhenHeatingAndACInactive + 'Dim C33 = gen.BC_HighVentPowerW + 'Dim C34 = gen.BC_LowVentPowerW + + Return _ + If _ + ( + (gen.EC_EnviromentalTemperature < gen.BC_TemperatureCoolingTurnsOff AndAlso Run1.TotalW > 0 AndAlso + Run2.TotalW > 0) OrElse (Run1.TotalW > 0 AndAlso Run2.TotalW < 0), + If _ + ( + gen.VEN_VentilationWhenBothHeatingAndACInactive AndAlso + gen.VEN_VentilationFlowSettingWhenHeatingAndACInactive.ToLower() = "high", + gen.BC_HighVentPowerW, + If _ + ( + gen.VEN_VentilationWhenBothHeatingAndACInactive AndAlso + gen.VEN_VentilationFlowSettingWhenHeatingAndACInactive.ToLower() = "low", + gen.BC_LowVentPowerW, 0)), 0) + End Get + End Property + + Public ReadOnly Property BaseVentilationW_FuelFiredHeating As Double _ + Implements ISSMCalculate.BaseVentilationW_FuelFiredHeating + Get + Return 0 + End Get + End Property + + 'Adjusted Values + Public ReadOnly Property TechListAdjustedHeatingW_Mechanical As Double _ + Implements ISSMCalculate.TechListAdjustedHeatingW_Mechanical + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property TechListAdjustedHeatingW_ElectricalCoolingHeating As Double _ + Implements ISSMCalculate.TechListAdjustedHeatingW_ElectricalCoolingHeating + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property TechListAdjustedHeatingW_ElectricalVentilation As Double _ + Implements ISSMCalculate.TechListAdjustedHeatingW_ElectricalVentilation + Get + '=IF('TECH LIST INPUT'!O92>0,MIN('TECH LIST INPUT'!O92,C43),MAX('TECH LIST INPUT'!O92,-C43)) + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + + 'TECH LIST INPUT'!O92 + 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList + 'Dim TLO92 As Double = tl.VHValueVariation + + + Return _ + If _ + (tl.VHValueVariation > 0, + Math.Min(tl.VHValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), + Math.Max(tl.VHValueVariation, - gen.BC_MaxPossibleBenefitFromTechnologyList)) + End Get + End Property + + Public ReadOnly Property TechListAdjustedHeatingW_FuelFiredHeating As Double _ + Implements ISSMCalculate.TechListAdjustedHeatingW_FuelFiredHeating + Get + '=IF('TECH LIST INPUT'!N92>0,MIN('TECH LIST INPUT'!N92,C43),MAX('TECH LIST INPUT'!N92,-C43)) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + + 'TECH LIST INPUT'!N92 + 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList + 'Dim TLN92 As Double = tl.HValueVariation + + + Return _ + If _ + (tl.HValueVariation > 0, + Math.Min(tl.HValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), + Math.Max(tl.HValueVariation, - gen.BC_MaxPossibleBenefitFromTechnologyList)) + End Get + End Property + + Public ReadOnly Property TechListAdjustedCoolingW_Mechanical As Double _ + Implements ISSMCalculate.TechListAdjustedCoolingW_Mechanical + Get + '=IF(IF(C53="mechanical",'TECH LIST INPUT'!R92,0)>0,MIN(IF(C53="mechanical",'TECH LIST INPUT'!R92,0),C43),MAX(IF(C53="mechanical",'TECH LIST INPUT'!R92,0),-C43)) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + Dim result As Double + 'Dim TLR92 As Double = tl.CValueVariation 'TECH LIST INPUT'!R92 + 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList + 'Dim C53 As string = gen.AC_CompressorType + + result = If(If(gen.AC_CompressorType.ToLower() = "mechanical", tl.CValueVariation, 0) > 0, + Math.Min(If(gen.AC_CompressorType.ToLower() = "mechanical", tl.CValueVariation, 0), + gen.BC_MaxPossibleBenefitFromTechnologyList), + Math.Max(If(gen.AC_CompressorType.ToLower() = "mechanical", tl.CValueVariation, 0), + - gen.BC_MaxPossibleBenefitFromTechnologyList)) + + Return result + End Get + End Property + + Public ReadOnly Property TechListAdjustedCoolingW_ElectricalCoolingHeating As Double _ + Implements ISSMCalculate.TechListAdjustedCoolingW_ElectricalCoolingHeating + Get + '=IF(IF(C53="mechanical",0,'TECH LIST INPUT'!R92)>0,MIN(IF(C53="mechanical",0,'TECH LIST INPUT'!R92),C43),MAX(IF(C53="mechanical",0,'TECH LIST INPUT'!R92),-C43)) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + Dim result As Double + + 'Dim TLR92 As Double = tl.CValueVariation 'TECH LIST INPUT'!R92 + 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList + 'Dim C53 As string = gen.AC_CompressorType + + result = If(If(gen.AC_CompressorType.ToLower() = "mechanical", 0, tl.CValueVariation) > 0, + Math.Min(If(gen.AC_CompressorType.ToLower() = "mechanical", 0, tl.CValueVariation), + gen.BC_MaxPossibleBenefitFromTechnologyList), + Math.Max(If(gen.AC_CompressorType.ToLower() = "mechanical", 0, tl.CValueVariation), + - gen.BC_MaxPossibleBenefitFromTechnologyList)) + + Return result + End Get + End Property + + Public ReadOnly Property TechListAdjustedCoolingW_ElectricalVentilation As Double _ + Implements ISSMCalculate.TechListAdjustedCoolingW_ElectricalVentilation + Get + '=IF('TECH LIST INPUT'!Q92>0,MIN('TECH LIST INPUT'!Q92,C43),MAX('TECH LIST INPUT'!Q92,-C43)) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + + 'Dim TLQ92 As Double = tl.VCValueVariation'TECH LIST INPUT'!Q92 + 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList + + Return If(tl.VCValueVariation > 0, + Math.Min(tl.VCValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), + Math.Max(tl.VCValueVariation, - gen.BC_MaxPossibleBenefitFromTechnologyList)) + End Get + End Property + + Public ReadOnly Property TechListAdjustedCoolingW_FuelFiredHeating As Double _ + Implements ISSMCalculate.TechListAdjustedCoolingW_FuelFiredHeating + Get + Return 0 + End Get + End Property + + Public ReadOnly Property TechListAdjustedVentilationW_Mechanical As Double _ + Implements ISSMCalculate.TechListAdjustedVentilationW_Mechanical + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property TechListAdjustedVentilationW_ElectricalCoolingHeating As Double _ + Implements ISSMCalculate.TechListAdjustedVentilationW_ElectricalCoolingHeating + Get + Return Nothing + End Get + End Property + + Public ReadOnly Property TechListAdjustedVentilationW_ElectricalVentilation As Double _ + Implements ISSMCalculate.TechListAdjustedVentilationW_ElectricalVentilation + Get + '=IF('TECH LIST INPUT'!P92>0,MIN('TECH LIST INPUT'!P92,C43),MAX('TECH LIST INPUT'!P92,-C43)) + + Dim gen As ISSMGenInputs = ssmTOOL.GenInputs + Dim tl As ISSMTechList = ssmTOOL.TechList + + 'Dim TLP92 As Double = tl.VVValueVariation 'TECH LIST INPUT'!P92 + 'Dim C43 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList + + + Return _ + If _ + (tl.VVValueVariation > 0, + Math.Min(tl.VVValueVariation, gen.BC_MaxPossibleBenefitFromTechnologyList), + Math.Max(tl.VVValueVariation, - gen.BC_MaxPossibleBenefitFromTechnologyList)) + End Get + End Property + + Public ReadOnly Property TechListAdjustedVentilationW_FuelFiredHeating As Double _ + Implements ISSMCalculate.TechListAdjustedVentilationW_FuelFiredHeating + Get + Return 0 + End Get + End Property #End Region - 'Provides Diagnostic Information for the user which can be displayed on the form. - 'Based on the inputs generated, can be used to cross reference the Excel Model with the - 'Outputs generated here. - Public Overrides Function ToString() As String + 'Provides Diagnostic Information for the user which can be displayed on the form. + 'Based on the inputs generated, can be used to cross reference the Excel Model with the + 'Outputs generated here. + Public Overrides Function ToString() As String + + Dim sb As New StringBuilder() + + sb.AppendLine("") + sb.AppendLine("TechList Detail") + sb.AppendLine("***********************") + + Dim nameLength As Integer = 40 + Dim catLength As Integer = 15 + Dim unitLength As Integer = 15 + Dim firstValuePos As Integer = nameLength + catLength + unitLength + 2 + Dim cat As String + Dim name As String + Dim units As String + + sb.AppendLine(String.Format(Space(firstValuePos) + "H{0}VH{0}VV{0}VC{0}C{0}", vbtab)) + + + For Each line As ITechListBenefitLine In ssmTOOL.TechList.TechLines + + With line + + Dim extraNameSpaces, extraCatSpaces, extraUnitSpaces As Integer + + extraNameSpaces = nameLength - .BenefitName.Length + extraCatSpaces = catLength - .Category.Length + extraUnitSpaces = unitLength - .Units.Length + + cat = line.Category.Substring(0, Math.Min(line.Category.Length, catLength)) + + Space(If(extraCatSpaces < 0, 0, extraCatSpaces)).Replace(" ", ".") + name = line.BenefitName.Substring(0, Math.Min(line.BenefitName.Length, nameLength)) + + Space(If(extraNameSpaces < 0, 0, extraNameSpaces)).Replace(" ", ".") + units = line.Units.Substring(0, Math.Min(line.Units.Length, unitLength)) + + Space(If(extraUnitSpaces < 0, 0, extraUnitSpaces)).Replace(" ", ".") + + sb.AppendLine(String.Format(units + cat + name + " {0}{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbTab, + .H().ToString("0.000"), + .VH().ToString("0.000"), .VV().ToString("0.000"), + .VC().ToString("0.000"), .C().ToString("0.000"))) + + End With + + Next + + sb.AppendLine("") + sb.AppendLine("TechList Totals") + sb.AppendLine("***********************") + + With ssmTOOL.TechList + + sb.AppendLine(vbTab + vbTab + "H" + vbTab + "VH" + vbTab + "VV" + vbTab + "VC" + vbTab + "C") + sb.AppendLine(String.Format("Base Var % {0}{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbtab, + .HValueVariation.ToString("0.000"), + .VHValueVariation.ToString("0.000"), .VVValueVariation.ToString("0.000"), + .VCValueVariation.ToString("0.000"), + .CValueVariation.ToString("0.000"))) + sb.AppendLine(String.Format("Base Var KW {0}{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbtab, + .HValueVariationKW.ToString("0.000"), .VHValueVariationKW.ToString("0.000"), + .VVValueVariationKW.ToString("0.000"), .VCValueVariationKW.ToString("0.000"), + .CValueVariationKW.ToString("0.000"))) + + End With + + + 'Runs + sb.AppendLine(Run1.ToString()) + sb.AppendLine(Run2.ToString()) + + 'Staging Calcs + sb.AppendLine("Staging Base Values") + sb.AppendLine("*******************") + sb.AppendLine( + vbTab + vbTab + vbTab + "Mechanical" + vbTab + "Elec Cool/Heat" + vbTab + "Elec Vent" + vbTab + + "Fuel Fired Heating") + + sb.AppendLine(String.Format("Heating {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, + BaseHeatingW_Mechanical.ToString("0.00"), + BaseHeatingW_ElectricalCoolingHeating.ToString("0.00"), + BaseHeatingW_ElectricalVentilation.ToString("0.00"), + BaseHeatingW_FuelFiredHeating.ToString("0.00"))) + sb.AppendLine(String.Format("Cooling {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, + BaseCoolingW_Mechanical.ToString("0.00"), + BaseCoolingW_ElectricalCoolingHeating.ToString("0.00"), + BaseCoolingW_ElectricalVentilation.ToString("0.00"), + BaseCoolingW_FuelFiredHeating.ToString("0.00"))) + sb.AppendLine(String.Format("Ventilate {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, + BaseVentilationW_Mechanical.ToString("0.00"), + BaseVentilationW_ElectricalCoolingHeating.ToString("0.00"), + BaseVentilationW_ElectricalVentilation.ToString("0.00"), + BaseVentilationW_FuelFiredHeating.ToString("0.00"))) + + sb.AppendLine("") + sb.AppendLine("Staging Adjusted Values") + sb.AppendLine("***********************") + + sb.AppendLine(String.Format("Heating {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, + TechListAdjustedHeatingW_Mechanical.ToString("0.00"), + TechListAdjustedHeatingW_ElectricalCoolingHeating.ToString("0.00"), + TechListAdjustedHeatingW_ElectricalVentilation.ToString("0.00"), + TechListAdjustedHeatingW_FuelFiredHeating.ToString("0.00"))) + sb.AppendLine(String.Format("Cooling {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, + TechListAdjustedCoolingW_Mechanical.ToString("0.00"), + TechListAdjustedCoolingW_ElectricalCoolingHeating.ToString("0.00"), + TechListAdjustedCoolingW_ElectricalVentilation.ToString("0.00"), + TechListAdjustedCoolingW_FuelFiredHeating.ToString("0.00"))) + sb.AppendLine(String.Format("Ventilate {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, + TechListAdjustedVentilationW_Mechanical.ToString("0.00"), + TechListAdjustedVentilationW_ElectricalCoolingHeating.ToString("0.00"), + TechListAdjustedVentilationW_ElectricalVentilation.ToString("0.00"), + TechListAdjustedVentilationW_FuelFiredHeating.ToString("0.00"))) + + + Return sb.ToString() + End Function - Dim sb As New StringBuilder() - - sb.AppendLine("") - sb.AppendLine("TechList Detail") - sb.AppendLine("***********************") + Private Function CalculateElectricalWBase(genInputs As ISSMGenInputs, EnviromentalTemperature As Double, + Solar As Double, Weight As Double) As Double + + 'MIN(SUM(H94),C54*1000)/C59+SUM(I93:I95) + + genInputs.EC_EnviromentalTemperature = EnviromentalTemperature + genInputs.EC_Solar = Solar + + 'Dim H94 = BaseCoolingW_ElectricalCoolingHeating + 'Dim C54 = genInputs.AC_CompressorCapacitykW + 'Dim C59 = genInputs.AC_COP + 'Dim I93 = BaseHeatingW_ElectricalVentilation + 'Dim I94 = BaseCoolingW_ElectricalVentilation + 'Dim I95 = BaseVentilationW_ElectricalVentilation + + Dim ElectricalWBaseCurrentResult As Double = + Math.Min(BaseCoolingW_ElectricalCoolingHeating, genInputs.AC_CompressorCapacitykW*1000)/ + genInputs.AC_COP + + BaseHeatingW_ElectricalVentilation + BaseCoolingW_ElectricalVentilation + + BaseVentilationW_ElectricalVentilation + + Return ElectricalWBaseCurrentResult*Weight + End Function + + Private Function CalculateMechanicalWBase(genInputs As ISSMGenInputs, EnviromentalTemperature As Double, + Solar As Double, Weight As Double) As Double + + '=MIN(F94,C54*1000)/C59 + + genInputs.EC_EnviromentalTemperature = EnviromentalTemperature + genInputs.EC_Solar = Solar + + 'Dim F94 = BaseCoolingW_Mechanical + 'Dim C54 = genInputs.AC_CompressorCapacitykW + 'Dim C59 = genInputs.AC_COP + + Dim MechanicalWBaseCurrentResult As Double = + Math.Min(BaseCoolingW_Mechanical, genInputs.AC_CompressorCapacitykW*1000)/genInputs.AC_COP + + Return MechanicalWBaseCurrentResult*Weight + End Function + + Private Function CalculateFuelLPerHBase(genInputs As ISSMGenInputs, EnviromentalTemperature As Double, + Solar As Double, + Weight As Double) As Double + + '=(MIN(ABS(J93/1000),C71)/C37)*(1/(C39*C38)) + + genInputs.EC_EnviromentalTemperature = EnviromentalTemperature + genInputs.EC_Solar = Solar + + 'Dim J93 = BaseHeatingW_FuelFiredHeating + 'Dim C71 = genInputs.AH_FuelFiredHeaterkW + 'Dim C37 = genInputs.BC_AuxHeaterEfficiency + 'Dim C39 = ssmTOOL.HVACConstants.FuelDensity + 'Dim C38 = genInputs.BC_GCVDieselOrHeatingOil + + Dim FuelLPerHBaseCurrentResult As Double = + (Math.Min(Math.Abs(BaseHeatingW_FuelFiredHeating/1000), genInputs.AH_FuelFiredHeaterkW)/ + genInputs.BC_AuxHeaterEfficiency)* + (1/(genInputs.BC_GCVDieselOrHeatingOil*ssmTOOL.HVACConstants.FuelDensityAsGramPerLiter)) + + Return FuelLPerHBaseCurrentResult*Weight + End Function + + Private Function CalculateElectricalWAdjusted(genInputs As ISSMGenInputs, tecList As ISSMTechList, + EnviromentalTemperature As Double, Solar As Double, + Weight As Double) As Double + + '=(MIN((H94*(1-H100)),C54*1000)/C59)+(I93*(1-I99))+(I94*(1-I100))+(I95*(1-I101)) - Dim nameLength As Integer = 40 - Dim catLength As Integer = 15 - Dim unitLength As Integer = 15 - Dim firstValuePos As Integer = nameLength + catLength + unitLength + 2 - Dim cat As String - Dim name As String - Dim units As String + genInputs.EC_EnviromentalTemperature = EnviromentalTemperature + genInputs.EC_Solar = Solar - sb.AppendLine(String.Format(Space(firstValuePos) + "H{0}VH{0}VV{0}VC{0}C{0}", vbtab)) + Dim H94 As Double = BaseCoolingW_ElectricalCoolingHeating + Dim H100 As Double = TechListAdjustedCoolingW_ElectricalCoolingHeating + Dim C54 As Double = genInputs.AC_CompressorCapacitykW + Dim C59 As Double = genInputs.AC_COP + Dim I93 As Double = BaseHeatingW_ElectricalVentilation + Dim I94 As Double = BaseCoolingW_ElectricalVentilation + Dim I95 As Double = BaseVentilationW_ElectricalVentilation + Dim I99 As Double = TechListAdjustedHeatingW_ElectricalVentilation + Dim I100 As Double = TechListAdjustedCoolingW_ElectricalVentilation + Dim I101 As Double = TechListAdjustedVentilationW_ElectricalVentilation - For Each line As ITechListBenefitLine In ssmTOOL.TechList.TechLines + Dim ElectricalWAdjusted As Double = (Math.Min((H94*(1 - H100)), C54*1000)/C59) + (I93*(1 - I99)) + + (I94*(1 - I100)) + + (I95*(1 - I101)) - With line + Return ElectricalWAdjusted*Weight + End Function - Dim extraNameSpaces, extraCatSpaces, extraUnitSpaces As Integer + Private Function CalculateMechanicalWBaseAdjusted(genInputs As ISSMGenInputs, tecList As ISSMTechList, + EnviromentalTemperature As Double, Solar As Double, + Weight As Double) As Double - extraNameSpaces = nameLength - .BenefitName.Length - extraCatSpaces = catLength - .Category.Length - extraUnitSpaces = unitLength - .Units.Length + '=(MIN((F94*(1-F100)),C54*1000)/C59) - cat = line.Category.Substring(0, Math.Min(line.Category.Length, catLength)) + - Space(If(extraCatSpaces < 0, 0, extraCatSpaces)).Replace(" ", ".") - name = line.BenefitName.Substring(0, Math.Min(line.BenefitName.Length, nameLength)) + - Space(If(extraNameSpaces < 0, 0, extraNameSpaces)).Replace(" ", ".") - units = line.Units.Substring(0, Math.Min(line.Units.Length, unitLength)) + - Space(If(extraUnitSpaces < 0, 0, extraUnitSpaces)).Replace(" ", ".") + genInputs.EC_EnviromentalTemperature = EnviromentalTemperature + genInputs.EC_Solar = Solar - sb.AppendLine(String.Format(units + cat + name + " {0}{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbTab, .H().ToString("0.000"), - .VH().ToString("0.000"), .VV().ToString("0.000"), .VC().ToString("0.000"), .C().ToString("0.000"))) + Dim F94 As Double = BaseCoolingW_Mechanical + Dim F100 As Double = TechListAdjustedCoolingW_Mechanical + Dim C54 As Double = genInputs.AC_CompressorCapacitykW + Dim C59 As Double = genInputs.AC_COP - End With + Dim MechanicalWBaseAdjusted As Double = (Math.Min((F94*(1 - F100)), C54*1000)/C59) - Next + Return MechanicalWBaseAdjusted*Weight + End Function - sb.AppendLine("") - sb.AppendLine("TechList Totals") - sb.AppendLine("***********************") + Private Function CalculateFuelLPerHBaseAdjusted(genInputs As ISSMGenInputs, tecList As ISSMTechList, + EnviromentalTemperature As Double, Solar As Double, + Weight As Double) As Double - With ssmTOOL.TechList + '=MIN(ABS(IF(AND(M89<0,M90<0),VLOOKUP(MAX(M89:M90),M89:P90,4),0)/1000),C71)/C37*(1/(C39*C38)) - sb.AppendLine(vbTab + vbTab + "H" + vbTab + "VH" + vbTab + "VV" + vbTab + "VC" + vbTab + "C") - sb.AppendLine(String.Format("Base Var % {0}{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbtab, .HValueVariation.ToString("0.000"), - .VHValueVariation.ToString("0.000"), .VVValueVariation.ToString("0.000"), .VCValueVariation.ToString("0.000"), - .CValueVariation.ToString("0.000"))) - sb.AppendLine(String.Format("Base Var KW {0}{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbtab, - .HValueVariationKW.ToString("0.000"), .VHValueVariationKW.ToString("0.000"), - .VVValueVariationKW.ToString("0.000"), .VCValueVariationKW.ToString("0.000"), - .CValueVariationKW.ToString("0.000"))) + genInputs.EC_EnviromentalTemperature = EnviromentalTemperature + genInputs.EC_Solar = Solar - End With + 'Dim M89 = Run1.TotalW + 'Dim M90 = genInputs.BC_GCVDieselOrHeatingOil + 'Dim C71 = genInputs.AH_FuelFiredHeaterkW + 'Dim C37 = genInputs.BC_AuxHeaterEfficiency + 'Dim C38 = genInputs.BC_GCVDieselOrHeatingOil + 'Dim C39 = ssmTOOL.HVACConstants.FuelDensity + Dim result As Double = 0 - 'Runs - sb.AppendLine(Run1.ToString()) - sb.AppendLine(Run2.ToString()) + If Run1.TotalW < 0 AndAlso Run2.TotalW < 0 Then + result = + Math.Abs(If(Run1.TotalW > Run2.TotalW, Run1.TechListAmendedFuelW, Run2.TechListAmendedFuelW)/1000) + End If - 'Staging Calcs - sb.AppendLine("Staging Base Values") - sb.AppendLine("*******************") - sb.AppendLine( - vbTab + vbTab + vbTab + "Mechanical" + vbTab + "Elec Cool/Heat" + vbTab + "Elec Vent" + vbTab + "Fuel Fired Heating") + Dim FuelLPerHBaseAdjusted As Double = Math.Min(result, genInputs.AH_FuelFiredHeaterkW)/ + genInputs.BC_AuxHeaterEfficiency* + (1/ + (genInputs.BC_GCVDieselOrHeatingOil* + ssmTOOL.HVACConstants.FuelDensityAsGramPerLiter)) - sb.AppendLine(String.Format("Heating {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, - BaseHeatingW_Mechanical.ToString("0.00"), BaseHeatingW_ElectricalCoolingHeating.ToString("0.00"), - BaseHeatingW_ElectricalVentilation.ToString("0.00"), BaseHeatingW_FuelFiredHeating.ToString("0.00"))) - sb.AppendLine(String.Format("Cooling {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, - BaseCoolingW_Mechanical.ToString("0.00"), BaseCoolingW_ElectricalCoolingHeating.ToString("0.00"), - BaseCoolingW_ElectricalVentilation.ToString("0.00"), BaseCoolingW_FuelFiredHeating.ToString("0.00"))) - sb.AppendLine(String.Format("Ventilate {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, - BaseVentilationW_Mechanical.ToString("0.00"), BaseVentilationW_ElectricalCoolingHeating.ToString("0.00"), - BaseVentilationW_ElectricalVentilation.ToString("0.00"), BaseVentilationW_FuelFiredHeating.ToString("0.00"))) - - sb.AppendLine("") - sb.AppendLine("Staging Adjusted Values") - sb.AppendLine("***********************") - - sb.AppendLine(String.Format("Heating {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, - TechListAdjustedHeatingW_Mechanical.ToString("0.00"), - TechListAdjustedHeatingW_ElectricalCoolingHeating.ToString("0.00"), - TechListAdjustedHeatingW_ElectricalVentilation.ToString("0.00"), - TechListAdjustedHeatingW_FuelFiredHeating.ToString("0.00"))) - sb.AppendLine(String.Format("Cooling {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, - TechListAdjustedCoolingW_Mechanical.ToString("0.00"), - TechListAdjustedCoolingW_ElectricalCoolingHeating.ToString("0.00"), - TechListAdjustedCoolingW_ElectricalVentilation.ToString("0.00"), - TechListAdjustedCoolingW_FuelFiredHeating.ToString("0.00"))) - sb.AppendLine(String.Format("Ventilate {0}{1}{0}{2}{0}{3}{0}{4}", vbTab + vbtab, - TechListAdjustedVentilationW_Mechanical.ToString("0.00"), - TechListAdjustedVentilationW_ElectricalCoolingHeating.ToString("0.00"), - TechListAdjustedVentilationW_ElectricalVentilation.ToString("0.00"), - TechListAdjustedVentilationW_FuelFiredHeating.ToString("0.00"))) - - - Return sb.ToString() - End Function - - Private Function CalculateElectricalWBase(genInputs As ISSMGenInputs, EnviromentalTemperature As Double, - Solar As Double, Weight As Double) As Double - - 'MIN(SUM(H94),C54*1000)/C59+SUM(I93:I95) - - genInputs.EC_EnviromentalTemperature = EnviromentalTemperature - genInputs.EC_Solar = Solar - - 'Dim H94 = BaseCoolingW_ElectricalCoolingHeating - 'Dim C54 = genInputs.AC_CompressorCapacitykW - 'Dim C59 = genInputs.AC_COP - 'Dim I93 = BaseHeatingW_ElectricalVentilation - 'Dim I94 = BaseCoolingW_ElectricalVentilation - 'Dim I95 = BaseVentilationW_ElectricalVentilation - - Dim ElectricalWBaseCurrentResult As Double = - Math.Min(BaseCoolingW_ElectricalCoolingHeating, genInputs.AC_CompressorCapacitykW * 1000) / genInputs.AC_COP + - BaseHeatingW_ElectricalVentilation + BaseCoolingW_ElectricalVentilation + BaseVentilationW_ElectricalVentilation - - Return ElectricalWBaseCurrentResult * Weight - End Function - - Private Function CalculateMechanicalWBase(genInputs As ISSMGenInputs, EnviromentalTemperature As Double, - Solar As Double, Weight As Double) As Double - - '=MIN(F94,C54*1000)/C59 - - genInputs.EC_EnviromentalTemperature = EnviromentalTemperature - genInputs.EC_Solar = Solar - - 'Dim F94 = BaseCoolingW_Mechanical - 'Dim C54 = genInputs.AC_CompressorCapacitykW - 'Dim C59 = genInputs.AC_COP - - Dim MechanicalWBaseCurrentResult As Double = - Math.Min(BaseCoolingW_Mechanical, genInputs.AC_CompressorCapacitykW * 1000) / genInputs.AC_COP - - Return MechanicalWBaseCurrentResult * Weight - End Function - - Private Function CalculateFuelLPerHBase(genInputs As ISSMGenInputs, EnviromentalTemperature As Double, Solar As Double, - Weight As Double) As Double - - '=(MIN(ABS(J93/1000),C71)/C37)*(1/(C39*C38)) - - genInputs.EC_EnviromentalTemperature = EnviromentalTemperature - genInputs.EC_Solar = Solar - - 'Dim J93 = BaseHeatingW_FuelFiredHeating - 'Dim C71 = genInputs.AH_FuelFiredHeaterkW - 'Dim C37 = genInputs.BC_AuxHeaterEfficiency - 'Dim C39 = ssmTOOL.HVACConstants.FuelDensity - 'Dim C38 = genInputs.BC_GCVDieselOrHeatingOil - - Dim FuelLPerHBaseCurrentResult As Double = - (Math.Min(Math.Abs(BaseHeatingW_FuelFiredHeating / 1000), genInputs.AH_FuelFiredHeaterkW) / - genInputs.BC_AuxHeaterEfficiency) * - (1 / (genInputs.BC_GCVDieselOrHeatingOil * ssmTOOL.HVACConstants.FuelDensityAsGramPerLiter)) - - Return FuelLPerHBaseCurrentResult * Weight - End Function - - Private Function CalculateElectricalWAdjusted(genInputs As ISSMGenInputs, tecList As ISSMTechList, - EnviromentalTemperature As Double, Solar As Double, Weight As Double) As Double - - '=(MIN((H94*(1-H100)),C54*1000)/C59)+(I93*(1-I99))+(I94*(1-I100))+(I95*(1-I101)) - - genInputs.EC_EnviromentalTemperature = EnviromentalTemperature - genInputs.EC_Solar = Solar - - Dim H94 As Double = BaseCoolingW_ElectricalCoolingHeating - Dim H100 As Double = TechListAdjustedCoolingW_ElectricalCoolingHeating - Dim C54 As Double = genInputs.AC_CompressorCapacitykW - Dim C59 As Double = genInputs.AC_COP - - Dim I93 As Double = BaseHeatingW_ElectricalVentilation - Dim I94 As Double = BaseCoolingW_ElectricalVentilation - Dim I95 As Double = BaseVentilationW_ElectricalVentilation - Dim I99 As Double = TechListAdjustedHeatingW_ElectricalVentilation - Dim I100 As Double = TechListAdjustedCoolingW_ElectricalVentilation - Dim I101 As Double = TechListAdjustedVentilationW_ElectricalVentilation - - Dim ElectricalWAdjusted As Double = (Math.Min((H94 * (1 - H100)), C54 * 1000) / C59) + (I93 * (1 - I99)) + (I94 * (1 - I100)) + - (I95 * (1 - I101)) - - Return ElectricalWAdjusted * Weight - End Function - - Private Function CalculateMechanicalWBaseAdjusted(genInputs As ISSMGenInputs, tecList As ISSMTechList, - EnviromentalTemperature As Double, Solar As Double, Weight As Double) As Double - - '=(MIN((F94*(1-F100)),C54*1000)/C59) - - genInputs.EC_EnviromentalTemperature = EnviromentalTemperature - genInputs.EC_Solar = Solar - - Dim F94 As Double = BaseCoolingW_Mechanical - Dim F100 As Double = TechListAdjustedCoolingW_Mechanical - Dim C54 As Double = genInputs.AC_CompressorCapacitykW - Dim C59 As Double = genInputs.AC_COP - - Dim MechanicalWBaseAdjusted As Double = (Math.Min((F94 * (1 - F100)), C54 * 1000) / C59) - - Return MechanicalWBaseAdjusted * Weight - End Function - - Private Function CalculateFuelLPerHBaseAdjusted(genInputs As ISSMGenInputs, tecList As ISSMTechList, - EnviromentalTemperature As Double, Solar As Double, Weight As Double) As Double - - '=MIN(ABS(IF(AND(M89<0,M90<0),VLOOKUP(MAX(M89:M90),M89:P90,4),0)/1000),C71)/C37*(1/(C39*C38)) - - genInputs.EC_EnviromentalTemperature = EnviromentalTemperature - genInputs.EC_Solar = Solar - - 'Dim M89 = Run1.TotalW - 'Dim M90 = genInputs.BC_GCVDieselOrHeatingOil - 'Dim C71 = genInputs.AH_FuelFiredHeaterkW - 'Dim C37 = genInputs.BC_AuxHeaterEfficiency - 'Dim C38 = genInputs.BC_GCVDieselOrHeatingOil - 'Dim C39 = ssmTOOL.HVACConstants.FuelDensity - - Dim result As Double = 0 - - If Run1.TotalW < 0 AndAlso Run2.TotalW < 0 Then - result = Math.Abs(If(Run1.TotalW > Run2.TotalW, Run1.TechListAmendedFuelW, Run2.TechListAmendedFuelW) / 1000) - End If - - Dim FuelLPerHBaseAdjusted As Double = Math.Min(result, genInputs.AH_FuelFiredHeaterkW) / - genInputs.BC_AuxHeaterEfficiency * - (1 / (genInputs.BC_GCVDieselOrHeatingOil * ssmTOOL.HVACConstants.FuelDensityAsGramPerLiter)) - - Return FuelLPerHBaseAdjusted * Weight - End Function - End Class + Return FuelLPerHBaseAdjusted*Weight + End Function + End Class End Namespace diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/AuxiliaryEnvironmentPersistanceTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/AuxiliaryEnvironmentPersistanceTests.vb index 9c5ee5828b132c42c63a184441dbb544689ddc58..e3a3f8f8879ca5d7d4ea8a3f2903182667851a64 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/AuxiliaryEnvironmentPersistanceTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/AuxiliaryEnvironmentPersistanceTests.vb @@ -1,4 +1,5 @@ -Imports System.Text +Imports System.IO +Imports System.Text Imports NUnit.Framework Imports NUnit Imports VectoAuxiliaries @@ -16,6 +17,10 @@ Public Class AuxiliaryPersistanceTests 'We load the previously saved config into the Emptu Aux 'We then compare the two Aux's, if they are the same persistance has worked and they are the same. + <OneTimeSetUp> + Public Sub RunBeforeAnyTests() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) + End Sub Public Sub SaveDefaultFile() diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/AveragePneumaticLoadDemandTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/AveragePneumaticLoadDemandTests.vb index f21248343a08496c1201f51952d344b8ba921688..7e50f6c2b043ddc081646036bd0dac9349742b8c 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/AveragePneumaticLoadDemandTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/AveragePneumaticLoadDemandTests.vb @@ -1,4 +1,5 @@  +Imports System.IO Imports VectoAuxiliaries.Pneumatics Imports NUnit.Framework Imports TUGraz.VectoCommon.Utils @@ -24,6 +25,10 @@ Namespace UnitTests Private _defaultInputConfig As IPneumaticUserInputsConfig Private _Signals As ISignals = New Signals + <OneTimeSetUp> + Public Sub RunBeforeAnyTests() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) + End Sub 'Constructors Public Sub New() diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_5_SmartAlternatorSetEfficiencyTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_5_SmartAlternatorSetEfficiencyTests.vb index c8bb4610d3731cae15c7d1756ffd1ad56faf3c03..2fbe17bf994010b1f065d22a458222427a1262bf 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_5_SmartAlternatorSetEfficiencyTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_5_SmartAlternatorSetEfficiencyTests.vb @@ -1,4 +1,5 @@ -Imports VectoAuxiliaries.Electrics +Imports System.IO +Imports VectoAuxiliaries.Electrics Imports VectoAuxiliaries.Hvac Imports VectoAuxiliaries Imports NUnit.Framework @@ -8,10 +9,15 @@ Namespace UnitTests <TestFixture()> Public Class M0_5_SmartAlternatorSetEfficiencyTests Private target As M0_5_SmartAlternatorSetEfficiency - Private signals = New Signals + 'Private signals = New Signals - Public Sub New() + <OneTimeSetUp> + Public Sub RunBeforeAnyTests() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) + End Sub + Public Sub New() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) Initialise() End Sub diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_NonSmart_AlternatorsSetEfficiencyTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_NonSmart_AlternatorsSetEfficiencyTests.vb index 5edaabf086cbc5256535df17cac5202947137ff0..f18a50b750f11230390331c7363e02000fe939b1 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_NonSmart_AlternatorsSetEfficiencyTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M0_NonSmart_AlternatorsSetEfficiencyTests.vb @@ -19,7 +19,6 @@ Namespace UnitTests Private alternatorMap As IAlternatorMap Private signals As Signals = New Signals Private powernetVoltage As Volt = 26.3.SI(Of Volt)() - Private ssm As IHVACSteadyStateModel = New HVACSteadyStateModel(100, 100, 100) Private Function GetSSM() As ISSMTOOL @@ -74,7 +73,7 @@ Namespace UnitTests <Test()> Public Sub EfficiencyValueTest() - Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, + Dim target = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, alternatorMap, powernetVoltage, signals, GetSSM()) Dim actual As Single = target.AlternatorsEfficiency diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M1_AverageHVACLoadDemandTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M1_AverageHVACLoadDemandTests.vb index 02251b0ee0c4d5e00c763385c5da3df17519c670..5cb29bc551421735261f4696567d198c33c81a1b 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M1_AverageHVACLoadDemandTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M1_AverageHVACLoadDemandTests.vb @@ -1,4 +1,5 @@ -Imports NUnit.Framework +Imports System.IO +Imports NUnit.Framework Imports TUGraz.VectoCommon.Utils Imports VectoAuxiliaries Imports VectoAuxiliaries.Electrics @@ -19,13 +20,20 @@ Namespace UnitTests Private m0 As IM0_NonSmart_AlternatorsSetEfficiency - Private alternatorMap As IAlternatorMap = New AlternatorMap(_GOODMAP) + Private alternatorMap As IAlternatorMap Private alternatorGearEfficiency As Single = 0.8 Private compressorGrearEfficiency As Single = 0.8 + <OneTimeSetUp> + Public Sub RunBeforeAnyTests() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) + End Sub Public Sub New() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) + + alternatorMap = New AlternatorMap(_GOODMAP) alternatorMap.Initialise() ssm.Load(_SSMMAP) diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M2_AverageElectricalLoadTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M2_AverageElectricalLoadTests.vb index 4aba3ace562def96f5a1c8d23dc12f7eafe5e290..c91e13753a58a5a63572c1f6c2f4f8cf6412c068 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M2_AverageElectricalLoadTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M2_AverageElectricalLoadTests.vb @@ -12,7 +12,6 @@ Namespace UnitTests Private Const csngDoorDutyCycleZeroToOne As Single = 0.0963391136801541 Private Const csngPowernetVoltage As Single = 26.3 - Private ssmHVac As IHVACSteadyStateModel = New HVACSteadyStateModel(100, 100, 100) Private Function GetSSM() As ISSMTOOL diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M5_SmartAlternatorSetGenerationTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M5_SmartAlternatorSetGenerationTests.vb index 42fe64dcda9c37dd5e04504b1aef96ddf016d2e7..fab7c3c86a8d1ca47e1c1fd1b655dcb8476f39d6 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M5_SmartAlternatorSetGenerationTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M5_SmartAlternatorSetGenerationTests.vb @@ -20,7 +20,6 @@ Namespace UnitTests Private _m05 As M0_5_SmartAlternatorSetEfficiency Private _target As M5__SmartAlternatorSetGeneration Private _signals As ISignals = New Signals - Private ssmHVac As IHVACSteadyStateModel = New HVACSteadyStateModel(100, 100, 100) Private Function GetSSM() As ISSMTOOL diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/SSMTOOLTests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/SSMTOOLTests.vb index 568ab56168241e1d61e2458d3992c5e595cf835d..8d3a448356993a4e9cd40748f02c0da12d9264ea 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/SSMTOOLTests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/SSMTOOLTests.vb @@ -1,4 +1,5 @@ -Imports NUnit.Framework +Imports System.IO +Imports NUnit.Framework Imports VectoAuxiliaries.Pneumatics Imports VectoAuxiliariesTests.Mocks Imports VectoAuxiliaries @@ -13,6 +14,11 @@ Namespace UnitTests Private Const GOODTechListALLOFF As String = "TestFiles\testSSMTechBenefitsALLOFF.csv" Private Const GOODTechListEMPTYLIST As String = "TestFiles\testSSMTechBenefitsEMPTYLIST.csv" + <OneTimeSetUp> + Public Sub RunBeforeAnyTests() + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory) + End Sub + 'Helpers Private Sub AddDefaultTechLine(source As ISSMTOOL) diff --git a/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj b/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj index 6867dba58e26c439576cb42816a723c308805370..030e1dc54bb8c33bf598459d5c085ea8a3ef2821 100644 --- a/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj +++ b/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" /> <Import Project="..\..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" /> - <Import Project="..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -428,8 +428,8 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props'))" /> <Error Condition="!Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.11.0\build\NUnit.props'))" /> + <Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/VECTOAux/VectoAuxiliariesTests/packages.config b/VECTOAux/VectoAuxiliariesTests/packages.config index 8ef7c1d6c4490154e875662734de86b5bca8d8cd..18654e00009b72436be8a2a50e64646934b4697f 100644 --- a/VECTOAux/VectoAuxiliariesTests/packages.config +++ b/VECTOAux/VectoAuxiliariesTests/packages.config @@ -3,5 +3,5 @@ <package id="Moq" version="4.2.1510.2205" targetFramework="net40" /> <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net40" requireReinstallation="True" /> <package id="NUnit" version="3.11.0" targetFramework="net45" /> - <package id="NUnit3TestAdapter" version="3.12.0" targetFramework="net45" /> + <package id="NUnit3TestAdapter" version="3.11.2" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/VectoCommon/VectoCommon/Models/OperatingPoint.cs b/VectoCommon/VectoCommon/Models/OperatingPoint.cs index 639ce72bbfeb3f9b971572b46e8aeec07692759f..884afd5d7ac3da7244e05adc78bc5fe4dea8c38c 100644 --- a/VectoCommon/VectoCommon/Models/OperatingPoint.cs +++ b/VectoCommon/VectoCommon/Models/OperatingPoint.cs @@ -45,5 +45,14 @@ namespace TUGraz.VectoCommon.Models { return string.Format("a: {0}, dt: {1}, ds: {2}", Acceleration, SimulationInterval, SimulationDistance); } + + public OperatingPoint Clone() + { + return new OperatingPoint() { + Acceleration = Acceleration, + SimulationDistance = SimulationDistance, + SimulationInterval = SimulationInterval + }; + } } } \ No newline at end of file diff --git a/VectoCommon/VectoHashingTest/VectoHashingTest.csproj b/VectoCommon/VectoHashingTest/VectoHashingTest.csproj index bdadbe799ba320d8ef6283dba505f9a90d7d189f..e4e95d277e8a925b206295ccecd8e5a3eab4e42b 100644 --- a/VectoCommon/VectoHashingTest/VectoHashingTest.csproj +++ b/VectoCommon/VectoHashingTest/VectoHashingTest.csproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" /> <Import Project="..\..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" /> - <Import Project="..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -208,8 +208,8 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props'))" /> <Error Condition="!Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.11.0\build\NUnit.props'))" /> + <Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/VectoCommon/VectoHashingTest/packages.config b/VectoCommon/VectoHashingTest/packages.config index 1e0c6fdebf02a2f5376c8f45ffb8f2cc206f47b0..e3afc87f5e3af45e5596a5ddf7ed6f959d586d47 100644 --- a/VectoCommon/VectoHashingTest/packages.config +++ b/VectoCommon/VectoHashingTest/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="NUnit" version="3.11.0" targetFramework="net45" /> - <package id="NUnit3TestAdapter" version="3.12.0" targetFramework="net45" /> + <package id="NUnit3TestAdapter" version="3.11.2" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/VectoConsole/VectoConsole.csproj b/VectoConsole/VectoConsole.csproj index dd4704ae2a946f9b5000af727aa282fc1f4a4985..0cbf4af1ae4c63f2c6fe2af2041e9a0725dbe693 100644 --- a/VectoConsole/VectoConsole.csproj +++ b/VectoConsole/VectoConsole.csproj @@ -45,6 +45,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <PropertyGroup> <StartupObject>VectoConsole.Program</StartupObject> diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs index 098b5d1e511a1c205ee0f9f451b71860c4147928..addf852baa6a28db2dceb8f3190acf07d52f3761 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapter.cs @@ -79,18 +79,18 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter return retVal; } - internal VehicleData CreateVehicleData(IVehicleDeclarationInputData data, Mission mission, Kilogram loading) + internal VehicleData CreateVehicleData(IVehicleDeclarationInputData data, Mission mission, Kilogram loading, bool allowVocational) { if (!data.SavedInDeclarationMode) { WarnDeclarationMode("VehicleData"); } return data.ExemptedVehicle ? CreateExemptedVehicleData(data) - : CreateNonExemptedVehicleData(data, mission, loading); + : CreateNonExemptedVehicleData(data, mission, loading, allowVocational); } private VehicleData CreateNonExemptedVehicleData( - IVehicleDeclarationInputData data, Mission mission, Kilogram loading) + IVehicleDeclarationInputData data, Mission mission, Kilogram loading, bool allowVocational) { var retVal = SetCommonVehicleData(data); retVal.AxleConfiguration = data.AxleConfiguration; @@ -111,7 +111,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter .Average(); retVal.CargoVolume = mission.MissionType != MissionType.Construction ? mission.TotalCargoVolume : 0.SI<CubicMeter>(); - retVal.VocationalVehicle = data.VocationalVehicle; + retVal.VocationalVehicle = allowVocational && data.VocationalVehicle; retVal.ADAS = CreateADAS(data.ADAS); var axles = data.Components.AxleWheels.AxlesDeclaration; diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs index 041f8e37e0f3aef2f7f65ae5d3f59b054c279273..eba281e270f221d52660d8d17a374bb018339e69 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeVectoRunDataFactory.cs @@ -59,6 +59,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl protected IDeclarationReport Report; private DeclarationDataAdapter _dao; private Segment _segment; + private bool allowVocational; private DriverData _driverdata; private AirdragData _airdragData; private CombustionEngineData _engineData; @@ -74,7 +75,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl { InputDataProvider = dataProvider; Report = report; - + allowVocational = true; try { Initialize(); if (Report != null) { @@ -92,11 +93,23 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl if (vehicle.ExemptedVehicle) { return; } - _segment = GetVehicleClassification(vehicle.VehicleCategory, - vehicle.AxleConfiguration, - vehicle.GrossVehicleMassRating, - vehicle.CurbMassChassis, - vehicle.VocationalVehicle); + + try { + _segment = GetVehicleClassification( + vehicle.VehicleCategory, + vehicle.AxleConfiguration, + vehicle.GrossVehicleMassRating, + vehicle.CurbMassChassis, + vehicle.VocationalVehicle); + } catch (VectoException) { + allowVocational = false; + _segment = GetVehicleClassification( + vehicle.VehicleCategory, + vehicle.AxleConfiguration, + vehicle.GrossVehicleMassRating, + vehicle.CurbMassChassis, + false); + } if (!_segment.Found) { throw new VectoException( "no segment found for vehicle configruation: vehicle category: {0}, axle configuration: {1}, GVMR: {2}", @@ -106,7 +119,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl _driverdata = _dao.CreateDriverData(); _driverdata.AccelerationCurve = AccelerationCurveReader.ReadFromStream(_segment.AccelerationFile); var tempVehicle = _dao.CreateVehicleData(vehicle, _segment.Missions.First(), - _segment.Missions.First().Loadings.First().Value); + _segment.Missions.First().Loadings.First().Value, allowVocational); _airdragData = _dao.CreateAirdragData(vehicle.Components.AirdragInputData, _segment.Missions.First(), _segment); _engineData = _dao.CreateEngineData(vehicle.Components.EngineInputData, @@ -130,7 +143,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl if (InputDataProvider.JobInputData.Vehicle.ExemptedVehicle) { powertrainConfig = new VectoRunData() { Exempted = true, - VehicleData = _dao.CreateVehicleData(InputDataProvider.JobInputData.Vehicle, null, null), + VehicleData = _dao.CreateVehicleData(InputDataProvider.JobInputData.Vehicle, null, null, allowVocational), InputDataHash = InputDataProvider.XMLHash }; } else { @@ -138,7 +151,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl VehicleData = _dao.CreateVehicleData( InputDataProvider.JobInputData.Vehicle, _segment.Missions.First(), - _segment.Missions.First().Loadings.First().Value), + _segment.Missions.First().Loadings.First().Value, allowVocational), AirdragData = _airdragData, EngineData = _engineData, GearboxData = _gearboxData, @@ -168,7 +181,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl Exempted = true, Report = Report, Mission = new Mission() { MissionType = MissionType.ExemptedMission}, - VehicleData = _dao.CreateVehicleData(InputDataProvider.JobInputData.Vehicle, null, null), + VehicleData = _dao.CreateVehicleData(InputDataProvider.JobInputData.Vehicle, null, null, allowVocational), InputDataHash = InputDataProvider.XMLHash }; } else { @@ -201,7 +214,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl var simulationRunData = new VectoRunData { Loading = loading.Key, VehicleDesignSpeed = _segment.DesignSpeed, - VehicleData = _dao.CreateVehicleData(vehicle, mission, loading.Value), + VehicleData = _dao.CreateVehicleData(vehicle, mission, loading.Value, allowVocational), AirdragData = _dao.CreateAirdragData(vehicle.Components.AirdragInputData, mission, _segment), EngineData = _engineData.Copy(), // a copy is necessary because every run has a different correction factor! GearboxData = _gearboxData, diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs index b89cbc6dc7c188fdd546e048f542d9b9505972b6..5f812b4ddead01e1d581a3cc9d3666ae4db08784 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactory.cs @@ -59,6 +59,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl protected PTOData PTOTransmissionData; protected List<VectoRunData.AuxData> AuxVTP; protected Segment Segment; + protected bool allowVocational; protected DeclarationDataAdapter Dao; protected Exception InitException; @@ -71,6 +72,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl { JobInputData = job; Report = report; + allowVocational = true; try { Initialize(); if (Report != null) { @@ -87,7 +89,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl VehicleData = Dao.CreateVehicleData( JobInputData.Vehicle, Segment.Missions.First(), - Segment.Missions.First().Loadings.First().Value), + Segment.Missions.First().Loadings.First().Value, allowVocational), AirdragData = AirdragData, EngineData = EngineData, GearboxData = GearboxData, @@ -111,17 +113,27 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl { Dao = new DeclarationDataAdapter(); var vehicle = JobInputData.Vehicle; - Segment = DeclarationData.Segments.Lookup( - vehicle.VehicleCategory, - vehicle.AxleConfiguration, - vehicle.GrossVehicleMassRating, - vehicle.CurbMassChassis, - vehicle.VocationalVehicle); + try { + Segment = DeclarationData.Segments.Lookup( + vehicle.VehicleCategory, + vehicle.AxleConfiguration, + vehicle.GrossVehicleMassRating, + vehicle.CurbMassChassis, + vehicle.VocationalVehicle); + } catch (VectoException) { + allowVocational = false; + Segment = DeclarationData.Segments.Lookup( + vehicle.VehicleCategory, + vehicle.AxleConfiguration, + vehicle.GrossVehicleMassRating, + vehicle.CurbMassChassis, + false); + } Driverdata = Dao.CreateDriverData(); Driverdata.AccelerationCurve = AccelerationCurveReader.ReadFromStream(Segment.AccelerationFile); var tempVehicle = Dao.CreateVehicleData( vehicle, Segment.Missions.First(), - Segment.Missions.First().Loadings.First().Value); + Segment.Missions.First().Loadings.First().Value, allowVocational); AirdragData = Dao.CreateAirdragData( vehicle.Components.AirdragInputData, Segment.Missions.First(), Segment); @@ -226,7 +238,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl AngledriveData = AngledriveData, VehicleData = Dao.CreateVehicleData( JobInputData.Vehicle, mission, - loading), + loading, allowVocational), AirdragData = AirdragData, DriverData = null, AdvancedAux = null, diff --git a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs index e20a5645884e841aedecff317af4f19dd7b32738..109bbdc78022c0c9e7edfbbd08cbd62e873aba00 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs @@ -183,9 +183,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Data } foreach (var gear in gearboxData.Gears) { + var maxEngineSpeed = VectoMath.Min(engineData.FullLoadCurves[gear.Key].RatedSpeed, gear.Value.MaxSpeed); for (var angularVelocity = engineData.IdleSpeed; - angularVelocity < engineData.FullLoadCurves[gear.Key].RatedSpeed; - angularVelocity += 2.0 / 3.0 * (engineData.FullLoadCurves[gear.Key].RatedSpeed - engineData.IdleSpeed) / 10.0) { + angularVelocity < maxEngineSpeed; + angularVelocity += 2.0 / 3.0 * (maxEngineSpeed - engineData.IdleSpeed) / 10.0) { if (!gear.Value.HasLockedGear) { continue; } @@ -209,39 +210,43 @@ namespace TUGraz.VectoCore.Models.Simulation.Data return null; } - private static ValidationResult CheckLossMapsEntries(KeyValuePair<uint, GearData> gear, PerSecond angularVelocity, + private static ValidationResult CheckLossMapsEntries(KeyValuePair<uint, GearData> gear, PerSecond engineSpeed, NewtonMeter inTorque, AngledriveData angledriveData, AxleGearData axleGearData, MeterPerSecond velocity) { var hasAngleDrive = angledriveData != null && angledriveData.Angledrive != null; var angledriveRatio = hasAngleDrive && angledriveData.Type == AngledriveType.SeparateAngledrive ? angledriveData.Angledrive.Ratio : 1.0; - NewtonMeter angledriveTorque; - try { - angledriveTorque = gear.Value.LossMap.GetOutTorque(angularVelocity, inTorque); - } catch (VectoException) { + + var tqLoss = gear.Value.LossMap.GetTorqueLoss(engineSpeed / gear.Value.Ratio, inTorque * gear.Value.Ratio); + if (tqLoss.Extrapolated) { return new ValidationResult( string.Format("Interpolation of Gear-{0}-LossMap failed with torque={1} and angularSpeed={2}", gear.Key, - inTorque, angularVelocity.ConvertToRoundsPerMinute())); + inTorque, engineSpeed.ConvertToRoundsPerMinute())); + } + var angledriveTorque = (inTorque - tqLoss.Value) / gear.Value.Ratio; + + var axlegearTorque = angledriveTorque; - try { - if (hasAngleDrive) { - axlegearTorque = angledriveData.Angledrive.LossMap.GetOutTorque(angularVelocity / gear.Value.Ratio, - angledriveTorque); + if (hasAngleDrive) { + var anglTqLoss = angledriveData.Angledrive.LossMap.GetTorqueLoss( + engineSpeed / gear.Value.Ratio / angledriveRatio, + angledriveTorque * angledriveRatio); + if (anglTqLoss.Extrapolated) { + return new ValidationResult( + string.Format( + "Interpolation of Angledrive-LossMap failed with torque={0} and angularSpeed={1}", + angledriveTorque, (engineSpeed / gear.Value.Ratio).ConvertToRoundsPerMinute())); } - } catch (VectoException) { - return new ValidationResult( - string.Format("Interpolation of Angledrive-LossMap failed with torque={0} and angularSpeed={1}", - angledriveTorque, (angularVelocity / gear.Value.Ratio).ConvertToRoundsPerMinute())); } if (axleGearData != null) { - var axleAngularVelocity = angularVelocity / gear.Value.Ratio / angledriveRatio; - try { - axleGearData.AxleGear.LossMap.GetOutTorque(axleAngularVelocity, axlegearTorque); - } catch (VectoException) { - return + var axleAngularVelocity = engineSpeed / gear.Value.Ratio / angledriveRatio / axleGearData.AxleGear.Ratio; + + var axlTqLoss = axleGearData.AxleGear.LossMap.GetTorqueLoss(axleAngularVelocity, axlegearTorque * axleGearData.AxleGear.Ratio); + if (axlTqLoss.Extrapolated) { + return new ValidationResult( string.Format( "Interpolation of AxleGear-LossMap failed with torque={0} and angularSpeed={1} (gear={2}, velocity={3})", diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs index 7d1e6f7890b42086a7b1da50287136ca20a656e2..2d4ed2d8069f432e840150c346a4524247845d65 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Gearbox/TransmissionLossMap.cs @@ -51,11 +51,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox /// </summary> private readonly DelaunayMap _lossMap; - /// <summary> - /// The inverted loss map for range sanity checks. [X=Input EngineSpeed, Y=Input Torque] => Z=Output Torque - /// </summary> - private readonly DelaunayMap _invertedLossMap; - public string GearName { get; private set; } public TransmissionLossMap(IReadOnlyList<GearLossMapEntry> entries, double gearRatio, string gearName) @@ -64,14 +59,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox _ratio = gearRatio; _entries = entries; _lossMap = new DelaunayMap("TransmissionLossMap " + GearName); - _invertedLossMap = new DelaunayMap("TransmissionLossMapInv. " + GearName); foreach (var entry in _entries) { _lossMap.AddPoint(entry.InputSpeed.Value(), (entry.InputTorque - entry.TorqueLoss).Value(), entry.TorqueLoss.Value()); - _invertedLossMap.AddPoint(entry.InputSpeed.Value(), entry.InputTorque.Value(), entry.TorqueLoss.Value()); } _lossMap.Triangulate(); - _invertedLossMap.Triangulate(); } /// <summary> @@ -104,30 +96,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox public NewtonMeter Value; } - /// <summary> - /// Computes the OUTPUT torque given by the input engineSpeed and the input torque. - /// </summary> - /// <param name="inAngularVelocity">Angular speed at input side.</param> - /// <param name="inTorque">Torque at input side.</param> - /// <param name="allowExtrapolation"></param> - /// <returns>Torque needed at output side (towards the wheels).</returns> - public NewtonMeter GetOutTorque(PerSecond inAngularVelocity, NewtonMeter inTorque, bool allowExtrapolation = false) - { - var torqueLoss = _invertedLossMap.Interpolate(inAngularVelocity.Value(), inTorque.Value()); - if (torqueLoss.HasValue) { - return (inTorque - torqueLoss.Value.SI<NewtonMeter>()) / _ratio; - } - - if (allowExtrapolation) { - torqueLoss = _invertedLossMap.Extrapolate(inAngularVelocity.Value(), inTorque.Value()); - return (inTorque - torqueLoss.Value.SI<NewtonMeter>()) / _ratio; - } - - throw new VectoException("TransmissionLossMap {0}: Interpolation failed. inTorque: {1}, inAngularVelocity: {2}", - GearName, inTorque, - inAngularVelocity.AsRPM); - } - + public GearLossMapEntry this[int i] { get { return _entries[i]; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 610bdc57baa2c2479f122c0fa95fedccee3cc4ce..d3243fd6d8d2884d020f62be1baae4252ee7eb7c 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -606,7 +606,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl criterion: result => ((ResponseDryRun)result).DeltaFullLoad.Value()); Log.Debug("Found operating point for idling. absTime: {0}, dt: {1}, torque: {2}, angularSpeed: {3}", absTime, dt, 0.SI<NewtonMeter>(), angularSpeed); - angularSpeed = angularSpeed.LimitTo(_engine.ModelData.IdleSpeed, _engine.EngineRatedSpeed); + angularSpeed = angularSpeed.LimitTo(_engine.ModelData.IdleSpeed, engineMaxSpeed); retVal = RequestPort.Request(absTime, dt, 0.SI<NewtonMeter>(), angularSpeed); }). Default(r => { throw new UnexpectedResponseException("searching Idling point", r); }); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index fab8b3f7e9d612b4248807cc6137b415a4cdbc51..b031b44a6dbec2877974eac47a8efc207ec2b9f1 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -98,7 +98,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ((NextDrivingAction.TriggerDistance - NextDrivingAction.ActionDistance) / Driver.DataBus.VehicleSpeed) .IsSmaller( Constants.SimulationSettings.LowerBoundTimeInterval / 20) && !Driver.DataBus.ClutchClosed(absTime); - if ( atTriggerTistance || closeBeforeBraking || brakingIntervalTooShort) { + var brakingIntervalShort = NextDrivingAction.Action == DrivingBehavior.Braking && + ((NextDrivingAction.TriggerDistance - NextDrivingAction.ActionDistance) / Driver.DataBus.VehicleSpeed) + .IsSmaller( + Constants.SimulationSettings.LowerBoundTimeInterval / 2) && !Driver.DataBus.ClutchClosed(absTime); + if (brakingIntervalShort && remainingDistance.IsEqual(ds)) { + return new ResponseDrivingCycleDistanceExceeded() + { + Source = this, + MaxDistance = ds / 2 + }; + } + if ( atTriggerTistance || closeBeforeBraking || brakingIntervalTooShort) { CurrentDrivingMode = DrivingMode.DrivingModeBrake; DrivingModes[CurrentDrivingMode].ResetMode(); Log.Debug("Switching to DrivingMode BRAKE"); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index e81b35851d9f756f2954e1b2fab2854eed91c707..2bb060fe7225b78b0d3c9a2987454ee75b359404 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -699,31 +699,32 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private OperatingPoint LimitAccelerationByDriverModel(OperatingPoint operatingPoint, LimitationMode limits) { + var retVal = operatingPoint.Clone(); var limitApplied = false; - var originalAcceleration = operatingPoint.Acceleration; + //if (((limits & LimitationMode.LimitDecelerationLookahead) != 0) && // operatingPoint.Acceleration < DriverData.LookAheadCoasting.Deceleration) { // operatingPoint.Acceleration = DriverData.LookAheadCoasting.Deceleration; // limitApplied = true; //} var accelerationLimits = DriverData.AccelerationCurve.Lookup(DataBus.VehicleSpeed); - if (operatingPoint.Acceleration > accelerationLimits.Acceleration) { - operatingPoint.Acceleration = accelerationLimits.Acceleration; + if (limits != LimitationMode.NoLimitation && operatingPoint.Acceleration > accelerationLimits.Acceleration) { + retVal.Acceleration = accelerationLimits.Acceleration; limitApplied = true; } if (((limits & LimitationMode.LimitDecelerationDriver) != 0) && operatingPoint.Acceleration < accelerationLimits.Deceleration) { - operatingPoint.Acceleration = accelerationLimits.Deceleration; + retVal.Acceleration = accelerationLimits.Deceleration; limitApplied = true; } if (limitApplied) { - operatingPoint.SimulationInterval = - ComputeTimeInterval(operatingPoint.Acceleration, operatingPoint.SimulationDistance) + retVal.SimulationInterval = + ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance) .SimulationInterval; - Log.Debug("Limiting acceleration from {0} to {1}, dt: {2}", originalAcceleration, - operatingPoint.Acceleration, operatingPoint.SimulationInterval); + Log.Debug("Limiting acceleration from {0} to {1}, dt: {2}", operatingPoint.Acceleration, + retVal.Acceleration, retVal.SimulationInterval); } - return operatingPoint; + return retVal; } /// <summary> diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs index aca76e1cf836955fa35085aef54c4279e39c26f8..f4374c57cc4f5011ace6ead489fdd4d7c3a8f4ef 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/TorqueConverter.cs @@ -323,7 +323,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var operatingPointList = ModelData.FindOperatingPoint(outTorque, outAngularVelocity, DataBus.EngineIdleSpeed); if (operatingPointList.Count == 0) { Log.Debug("TorqueConverter: Failed to find torque converter operating point, fallback: creeping"); - var tqOperatingPoint = ModelData.FindOperatingPoint(DataBus.EngineIdleSpeed, outAngularVelocity); + var tqOperatingPoint = ModelData.FindOperatingPoint(DataBus.EngineIdleSpeed * 1.00, outAngularVelocity); var engineResponse = (ResponseDryRun) NextComponent.Request(absTime, dt, tqOperatingPoint.InTorque, tqOperatingPoint.InAngularVelocity, true); diff --git a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.xsd b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.xsd index ce4445daf29f983ec72df2cce34fff9cdcf86552..87aaa30b5f06b7fc9bd7c979cdb41f1e8d270711 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoOutputManufacturer.0.7.xsd @@ -19,7 +19,7 @@ <xs:sequence> <xs:element name="Model" minOccurs="0"> <xs:annotation> - <xs:documentation>P241 / I.1.8.1</xs:documentation> + <xs:documentation>P241 / I.1.8.1 / #96</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationMethod" type="AirdragCertificationOptionType"> @@ -48,7 +48,7 @@ <xs:sequence> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P221 / I.1.6.1</xs:documentation> + <xs:documentation>P221 / I.1.6.1 / #93</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationMethod" type="vdecdef:AngledriveCertificationOptionType"> @@ -58,7 +58,7 @@ </xs:element> <xs:element name="CertificationNumber" type="vdecdef:CertificationNumberType" minOccurs="0"> <xs:annotation> - <xs:documentation>P265 / I.1.6.2</xs:documentation> + <xs:documentation>P265 / I.1.6.2 / #94</xs:documentation> </xs:annotation> </xs:element> <xs:element name="DigestValue" type="xs:token"> @@ -111,7 +111,7 @@ <xs:sequence> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P216 / I.1.7.1</xs:documentation> + <xs:documentation>P216 / I.1.7.1 / #95</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationMethod" type="vdecdef:AxlegearCertificationOptionType"> @@ -201,7 +201,7 @@ <xs:sequence> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P201 / I.1.2.1</xs:documentation> + <xs:documentation>P201 / I.1.2.1 / #85</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationNumber" type="vdecdef:CertificationNumberType"> @@ -280,7 +280,7 @@ <xs:sequence> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P205 / I.1.3.1</xs:documentation> + <xs:documentation>P205 / I.1.3.1 / #86</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationMethod" type="vdecdef:GearboxCertificationOptionType"> @@ -379,17 +379,17 @@ <xs:sequence minOccurs="0"> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P226 / I.1.4.1</xs:documentation> + <xs:documentation>P226 / I.1.4.1 / #87</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationMethod" type="vdecdef:RetarderCertificationOptionType"> <xs:annotation> - <xs:documentation>P255 / I.1.4.3</xs:documentation> + <xs:documentation>P255 / I.1.4.3 / #89</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationNumber" type="vdecdef:CertificationNumberType" minOccurs="0"> <xs:annotation> - <xs:documentation>P266 / I.1.4.2</xs:documentation> + <xs:documentation>P266 / I.1.4.2 / #88</xs:documentation> </xs:annotation> </xs:element> <xs:element name="DigestValue" type="xs:token"> @@ -437,17 +437,17 @@ <xs:sequence> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P211 / I.1.5.1</xs:documentation> + <xs:documentation>P211 / I.1.5.1 / #90</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationMethod" type="vdecdef:TorqueConverterCertificationOptionType"> <xs:annotation> - <xs:documentation>P257 / I.1.5.3</xs:documentation> + <xs:documentation>P257 / I.1.5.3 / #92</xs:documentation> </xs:annotation> </xs:element> <xs:element name="CertificationNumber" type="vdecdef:CertificationNumberType" minOccurs="0"> <xs:annotation> - <xs:documentation>P263 / I.1.5.2</xs:documentation> + <xs:documentation>P263 / I.1.5.2 / #91</xs:documentation> </xs:annotation> </xs:element> <xs:element name="DigestValue" type="xs:token"> @@ -654,7 +654,7 @@ <xs:sequence> <xs:element name="Model" type="vdecdef:ModelType"> <xs:annotation> - <xs:documentation>P236 / I.1.1.2</xs:documentation> + <xs:documentation>P236 / I.1.1.2 / #79</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Manufacturer" type="vdecdef:ManufacturerType"> @@ -704,17 +704,17 @@ </xs:element> <xs:element name="ZeroEmissionVehicle" type="xs:boolean"> <xs:annotation> - <xs:documentation>P269 / I.1.1.10</xs:documentation> + <xs:documentation>P269 / I.1.1.10 / #81</xs:documentation> </xs:annotation> </xs:element> <xs:element name="HybridElectricHDV" type="xs:boolean"> <xs:annotation> - <xs:documentation>P279 / I.1.1.11</xs:documentation> + <xs:documentation>P279 / I.1.1.11 / #82</xs:documentation> </xs:annotation> </xs:element> <xs:element name="DualFuelVehicle" type="xs:boolean"> <xs:annotation> - <xs:documentation>P280 / I.1.1.12</xs:documentation> + <xs:documentation>P280 / I.1.1.12 / #83</xs:documentation> </xs:annotation> </xs:element> <xs:choice> @@ -731,12 +731,12 @@ </xs:element> <xs:element name="VocationalVehicle" type="xs:boolean"> <xs:annotation> - <xs:documentation>P270 / I.1.1.9</xs:documentation> + <xs:documentation>P270 / I.1.1.9 / #80</xs:documentation> </xs:annotation> </xs:element> <xs:element name="SleeperCab" type="xs:boolean"> <xs:annotation> - <xs:documentation>P276 / I.1.1.13</xs:documentation> + <xs:documentation>P276 / I.1.1.13 / #84</xs:documentation> </xs:annotation> </xs:element> <xs:element name="PTO" type="xs:boolean"> @@ -904,22 +904,22 @@ <xs:sequence> <xs:element name="EngineStopStart" type="xs:boolean"> <xs:annotation> - <xs:documentation>P271 / I.1.12.1</xs:documentation> + <xs:documentation>P271 / I.1.12.1 / #97</xs:documentation> </xs:annotation> </xs:element> <xs:element name="EcoRollWithoutEngineStop" type="xs:boolean"> <xs:annotation> - <xs:documentation>P272 / I.1.12.2</xs:documentation> + <xs:documentation>P272 / I.1.12.2 / #98</xs:documentation> </xs:annotation> </xs:element> <xs:element name="EcoRollWithEngineStop" type="xs:boolean"> <xs:annotation> - <xs:documentation>P273 / I.1.12.3</xs:documentation> + <xs:documentation>P273 / I.1.12.3 / #99</xs:documentation> </xs:annotation> </xs:element> <xs:element name="PredictiveCruiseControl" type="xs:boolean"> <xs:annotation> - <xs:documentation>P274 / I.1.12.4</xs:documentation> + <xs:documentation>P274 / I.1.12.4 / #100</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> diff --git a/VectoCore/VectoCore/Utils/DelaunayMap.cs b/VectoCore/VectoCore/Utils/DelaunayMap.cs index d147ce127b3290631e61f660e299a029a75d3b7e..c6627825952edefe825b3d8deb53518ec9f9a3d6 100644 --- a/VectoCore/VectoCore/Utils/DelaunayMap.cs +++ b/VectoCore/VectoCore/Utils/DelaunayMap.cs @@ -139,7 +139,7 @@ namespace TUGraz.VectoCore.Utils // k...points on convex hull (exactly 3 --> supertriangle) if (triangles.Count != 2 * (pointCount + 3) - 2 - 3) { throw new VectoException( - "Delaunay-Triangulation invariant violated! Triangle count and point count doesn't fit together."); + "{0} Delaunay-Triangulation invariant violated! Triangle count and point count doesn't fit together.", _mapName); } } diff --git a/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs b/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs index cc746a7f1b51e757ca4874c5288e23636504d232..664595a25e8a8cba17cbd9566b3c58dc004036f5 100644 --- a/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs +++ b/VectoCore/VectoCoreTest/Integration/TorqueLimitsTest.cs @@ -268,7 +268,7 @@ namespace TUGraz.VectoCore.Tests.Integration Assert.AreEqual(170.18354, view.Rows[2][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); Assert.AreEqual(183.06159, view.Rows[3][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); Assert.AreEqual(224.78226, view.Rows[4][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); - Assert.AreEqual(255.02202, view.Rows[5][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); + Assert.AreEqual(255.02087, view.Rows[5][SummaryDataContainer.FCMAP_KM].ToString().ToDouble(), 1e-3); } [TestCase(EngineSpeedLimitJobATDecl)] diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterCreateVocationalVehicleTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterCreateVocationalVehicleTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..d92baf5baa086683727dbca381366e4524c74bf2 --- /dev/null +++ b/VectoCore/VectoCoreTest/Models/Declaration/DataAdapter/DeclarationAdapterCreateVocationalVehicleTest.cs @@ -0,0 +1,82 @@ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.XPath; +using Ninject; +using NUnit.Framework; +using NUnit.Framework.Internal; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Configuration; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter; +using TUGraz.VectoCore.Models.Simulation.Impl; +using TUGraz.VectoCore.OutputData; +using TUGraz.VectoCore.OutputData.FileIO; +using TUGraz.VectoCore.OutputData.XML; +using TUGraz.VectoCore.Utils; + +namespace TUGraz.VectoCore.Tests.Models.Declaration.DataAdapter +{ + [TestFixture()] + public class DeclarationAdapterCreateVocationalVehicleTest + { + protected IXMLInputDataReader xmlInputReader; + private IKernel _kernel; + + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); + + _kernel = new StandardKernel(new VectoNinjectModule()); + xmlInputReader = _kernel.Get<IXMLInputDataReader>(); + } + + [TestCase(@"Rigid Truck_4x2_vehicle-class-1_EURO6_2018.xml"), + TestCase(@"Rigid Truck_4x2_vehicle-class-2_EURO6_2018.xml"), + TestCase(@"Rigid Truck_4x2_vehicle-class-3_EURO6_2018.xml"), + TestCase(@"Rigid Truck_6x4_vehicle-class-11_EURO6_2018.xml"), + TestCase(@"Rigid Truck_8x4_vehicle-class-16_EURO6_2018.xml"), + TestCase(@"Tractor_6x4_vehicle-class-12_EURO6_2018.xml"), + + ] + public void TestCreateDeclarationVocationalVehicle(string jobfile) + { + var reader = XmlReader.Create(Path.Combine(@"TestData/XML/XMLReaderDeclaration/GroupTest", jobfile)); + + var doc = new XmlDocument(); + doc.Load(reader); + var nav = doc.CreateNavigator(); + var manager = new XmlNamespaceManager(nav.NameTable); + var helper = new XPathHelper(ExecutionMode.Declaration); + helper.AddNamespaces(manager); + + var vocational = nav.SelectSingleNode(XMLHelper.QueryLocalName(XMLNames.Component_Vehicle, XMLNames.Vehicle_VocationalVehicle)); + vocational.SetValue(true.ToString().ToLower()); + var modified = XmlReader.Create(new StringReader(nav.OuterXml)); + + var dataProvider = xmlInputReader.CreateDeclaration(modified); + + var xmlReport = new XMLDeclarationReport(); + var sumData = new SummaryDataContainer(null); + var jobContainer = new JobContainer(sumData); + + var runsFactory = new SimulatorFactory(ExecutionMode.Declaration, dataProvider, null, xmlReport) { + WriteModalResults = false, + Validate = false, + }; + jobContainer.AddRuns(runsFactory); + + // no need to run the simulation, we only check whether the meta-data is correct, no results are considered + //jobContainer.Execute(); + //jobContainer.WaitFinished(); + xmlReport.DoWriteReport(); + + var manufacturerReport = xmlReport.FullReport; + + Assert.IsFalse(XmlConvert.ToBoolean(manufacturerReport.XPathSelectElement(XMLHelper.QueryLocalName(XMLNames.Vehicle_VocationalVehicle))?.Value ?? "")); + } + } +} diff --git a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs index 73ee6dfb09fcd741b13630e662597bfcf7b8c602..f05a4a2d23d72cffbcaf00db301fab2885ebd5c4 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/DeclarationDataTest.cs @@ -590,46 +590,56 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 7500.01, 0, false, VehicleClass.Class1), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 10000, 0, false, VehicleClass.Class1), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 10000, 0, false, VehicleClass.Class1), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 10001, 0, false, VehicleClass.Class2), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 10001, 0, false, VehicleClass.Class2), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 12000, 0, false, VehicleClass.Class2), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 12000, 0, false, VehicleClass.Class2), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 12001, 0, false, VehicleClass.Class3), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 12001, 0, false, VehicleClass.Class3), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 16000, 0, false, VehicleClass.Class3), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 16000, 0, false, VehicleClass.Class3), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 16001, 0, false, VehicleClass.Class4), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 99000, 0, false, VehicleClass.Class4), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 16001, 0, true, VehicleClass.Class4), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x2, 99000, 0, true, VehicleClass.Class4), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 16001, 0, false, VehicleClass.Class5), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 99000, 0, false, VehicleClass.Class5), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 16001, 0, true, VehicleClass.Class5), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x2, 99000, 0, true, VehicleClass.Class5), + //TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x4, 7500, 0, VehicleClass.Class6), //TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x4, 16000, 0, VehicleClass.Class6), //TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x4, 16001, 0, VehicleClass.Class7), //TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_4x4, 99000, 0, VehicleClass.Class7), //TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x4, 16000, 0, VehicleClass.Class8), //TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_4x4, 99000, 0, VehicleClass.Class8), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 7500, 0, false, VehicleClass.Class9), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 16000, 0, false, VehicleClass.Class9), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 40000, 0, false, VehicleClass.Class9), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 99000, 0, false, VehicleClass.Class9), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 7500, 0, true, VehicleClass.Class9), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x2, 99000, 0, true, VehicleClass.Class9), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 7500, 0, false, VehicleClass.Class10), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 16000, 0, false, VehicleClass.Class10), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 40000, 0, false, VehicleClass.Class10), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 99000, 0, false, VehicleClass.Class10), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 7500, 0, true, VehicleClass.Class10), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x2, 99000, 0, true, VehicleClass.Class10), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x4, 7500, 0, false, VehicleClass.Class11), TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_6x4, 40000, 0, false, VehicleClass.Class11), + TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x4, 7500, 0, false, VehicleClass.Class12), TestCase(VehicleCategory.Tractor, AxleConfiguration.AxleConfig_6x4, 99000, 0, false, VehicleClass.Class12), + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_8x4, 7500, 0, false, VehicleClass.Class16), - TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_8x4, 99000, 0, false, VehicleClass.Class16) + TestCase(VehicleCategory.RigidTruck, AxleConfiguration.AxleConfig_8x4, 99000, 0, false, VehicleClass.Class16), ] public void SegmentLookupTest(VehicleCategory category, AxleConfiguration axleConfiguration, double grossWeight, double curbWeight, bool vocational, VehicleClass expectedClass) diff --git a/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs index 15407f73662ef2c8d33d2f13ee5a74c0ad024e6f..390ea45158c37115efdc708d1a68a1765e5e576c 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/ShiftPolygonTest.cs @@ -879,7 +879,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration var segment = DeclarationData.Segments.Lookup( vehicle.VehicleCategory, vehicle.AxleConfiguration, vehicle.GrossVehicleMassRating, vehicle.CurbMassChassis, false); - var vehicleData = dao.CreateVehicleData(inputData.JobInputData.Vehicle, segment.Missions.First(), 0.SI<Kilogram>()); + var vehicleData = dao.CreateVehicleData(inputData.JobInputData.Vehicle, segment.Missions.First(), 0.SI<Kilogram>(), true); var rdyn = vehicleData.DynamicTyreRadius; var shiftPolygons = new List<ShiftPolygon>(); diff --git a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs index 5e810dde26983d5816664b7ac7410d926cd6a2ed..18de49f5895fe520715d0d77b63423c147130596 100644 --- a/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs +++ b/VectoCore/VectoCoreTest/Models/SimulationComponentData/GearboxDataTest.cs @@ -167,49 +167,49 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData AssertHelper.AreRelativeEqual(10, map.GetTorqueLoss(120.RPMtoRad(), 50.SI<NewtonMeter>()).Value); } - [TestCase] - public void TestLossMap_OUT_10_CONST_Interpolation_Extrapolation() - { - var data = new DataTable(); - data.Columns.Add(""); - data.Columns.Add(""); - data.Columns.Add(""); - data.Rows.Add("0", "0", "10"); // (0,100):10 -- (100,100):10 - data.Rows.Add("0", "100", "10"); // | \ | - data.Rows.Add("100", "0", "10"); // | \ | - data.Rows.Add("100", "100", "10"); // (0,0):10 ----- (100,10):10 - - var map = TransmissionLossMapReader.Create(data, 1.0, "1"); - - // test inside the triangles - AssertHelper.AreRelativeEqual(15, map.GetOutTorque(25.RPMtoRad(), 25.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(40, map.GetOutTorque(75.RPMtoRad(), 50.SI<NewtonMeter>(), true)); - - // test interpolation on edges - AssertHelper.AreRelativeEqual(-15, map.GetOutTorque(50.RPMtoRad(), -5.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(35, map.GetOutTorque(0.RPMtoRad(), 45.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(30, map.GetOutTorque(50.RPMtoRad(), 40.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(65, map.GetOutTorque(50.RPMtoRad(), 75.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(15, map.GetOutTorque(100.RPMtoRad(), 25.SI<NewtonMeter>(), true)); - - // test interpolation on corner points - AssertHelper.AreRelativeEqual(-10, map.GetOutTorque(0.RPMtoRad(), 0.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(80, map.GetOutTorque(0.RPMtoRad(), 90.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(-20, map.GetOutTorque(100.RPMtoRad(), -10.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(50, map.GetOutTorque(100.RPMtoRad(), 60.SI<NewtonMeter>(), true)); - - // test outside the corners - AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(-20.RPMtoRad(), -20.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(110, map.GetOutTorque(-20.RPMtoRad(), 120.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(120.RPMtoRad(), -20.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(110, map.GetOutTorque(120.RPMtoRad(), 120.SI<NewtonMeter>(), true)); - - // test outside the edges - AssertHelper.AreRelativeEqual(40, map.GetOutTorque(-20.RPMtoRad(), 50.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(110, map.GetOutTorque(50.RPMtoRad(), 120.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(50.RPMtoRad(), -20.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(40, map.GetOutTorque(120.RPMtoRad(), 50.SI<NewtonMeter>(), true)); - } + //[TestCase] + //public void TestLossMap_OUT_10_CONST_Interpolation_Extrapolation() + //{ + // var data = new DataTable(); + // data.Columns.Add(""); + // data.Columns.Add(""); + // data.Columns.Add(""); + // data.Rows.Add("0", "0", "10"); // (0,100):10 -- (100,100):10 + // data.Rows.Add("0", "100", "10"); // | \ | + // data.Rows.Add("100", "0", "10"); // | \ | + // data.Rows.Add("100", "100", "10"); // (0,0):10 ----- (100,10):10 + + // var map = TransmissionLossMapReader.Create(data, 1.0, "1"); + + // // test inside the triangles + // AssertHelper.AreRelativeEqual(15, map.GetOutTorque(25.RPMtoRad(), 25.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(40, map.GetOutTorque(75.RPMtoRad(), 50.SI<NewtonMeter>(), true)); + + // // test interpolation on edges + // AssertHelper.AreRelativeEqual(-15, map.GetOutTorque(50.RPMtoRad(), -5.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(35, map.GetOutTorque(0.RPMtoRad(), 45.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(30, map.GetOutTorque(50.RPMtoRad(), 40.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(65, map.GetOutTorque(50.RPMtoRad(), 75.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(15, map.GetOutTorque(100.RPMtoRad(), 25.SI<NewtonMeter>(), true)); + + // // test interpolation on corner points + // AssertHelper.AreRelativeEqual(-10, map.GetOutTorque(0.RPMtoRad(), 0.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(80, map.GetOutTorque(0.RPMtoRad(), 90.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(-20, map.GetOutTorque(100.RPMtoRad(), -10.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(50, map.GetOutTorque(100.RPMtoRad(), 60.SI<NewtonMeter>(), true)); + + // // test outside the corners + // AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(-20.RPMtoRad(), -20.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(110, map.GetOutTorque(-20.RPMtoRad(), 120.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(120.RPMtoRad(), -20.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(110, map.GetOutTorque(120.RPMtoRad(), 120.SI<NewtonMeter>(), true)); + + // // test outside the edges + // AssertHelper.AreRelativeEqual(40, map.GetOutTorque(-20.RPMtoRad(), 50.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(110, map.GetOutTorque(50.RPMtoRad(), 120.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(50.RPMtoRad(), -20.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(40, map.GetOutTorque(120.RPMtoRad(), 50.SI<NewtonMeter>(), true)); + //} [TestCase] public void TestLossMap_IN_Interpolation_Extrapolation() @@ -255,52 +255,52 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData AssertHelper.AreRelativeEqual(25, map.GetTorqueLoss(120.RPMtoRad(), 50.SI<NewtonMeter>()).Value); } - [TestCase] - public void TestLossMap_OUT_Interpolation_Extrapolation() - { - var data = new DataTable(); - data.Columns.Add(""); - data.Columns.Add(""); - data.Columns.Add(""); - data.Rows.Add("0", "0", "0"); // (0,100):10 -- (100,100):40 - data.Rows.Add("0", "100", "10"); // | \ | - data.Rows.Add("100", "0", "10"); // | \ | - data.Rows.Add("100", "100", "40"); // (0,0):0 ----- (100,0):10 - - var map = TransmissionLossMapReader.Create(data, 1.0, "1"); - - // test inside the triangles - AssertHelper.AreRelativeEqual(20, map.GetOutTorque(25.RPMtoRad(), 25.SI<NewtonMeter>())); - AssertHelper.AreRelativeEqual(32.5, map.GetOutTorque(75.RPMtoRad(), 50.SI<NewtonMeter>())); - - // test interpolation on edges - AssertHelper.AreRelativeEqual(-5, map.GetOutTorque(50.RPMtoRad(), 0.SI<NewtonMeter>())); - AssertHelper.AreRelativeEqual(40.5, map.GetOutTorque(0.RPMtoRad(), 45.SI<NewtonMeter>())); - AssertHelper.AreRelativeEqual(31, map.GetOutTorque(50.RPMtoRad(), 40.SI<NewtonMeter>())); - AssertHelper.AreRelativeEqual(57.5, map.GetOutTorque(50.RPMtoRad(), 75.SI<NewtonMeter>())); - AssertHelper.AreRelativeEqual(7.5, map.GetOutTorque(100.RPMtoRad(), 25.SI<NewtonMeter>())); - - // test interpolation on corner points - AssertHelper.AreRelativeEqual(0, map.GetTorqueLoss(0.RPMtoRad(), 0.SI<NewtonMeter>()).Value); - AssertHelper.AreRelativeEqual(10, map.GetTorqueLoss(0.RPMtoRad(), 90.SI<NewtonMeter>()).Value); - AssertHelper.AreRelativeEqual(10, map.GetTorqueLoss(100.RPMtoRad(), -10.SI<NewtonMeter>()).Value); - AssertHelper.AreRelativeEqual(40, map.GetTorqueLoss(100.RPMtoRad(), 60.SI<NewtonMeter>()).Value); - - // test outside the corners - AssertHelper.AreRelativeEqual(-20, map.GetOutTorque(-20.RPMtoRad(), -20.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(110, map.GetOutTorque(-20.RPMtoRad(), 120.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(120.RPMtoRad(), -20.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(80, map.GetOutTorque(120.RPMtoRad(), 120.SI<NewtonMeter>(), true)); - - // test outside the edges - AssertHelper.AreRelativeEqual(45, map.GetOutTorque(-20.RPMtoRad(), 50.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(95, map.GetOutTorque(50.RPMtoRad(), 120.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(-25, map.GetOutTorque(50.RPMtoRad(), -20.SI<NewtonMeter>(), true)); - AssertHelper.AreRelativeEqual(25, map.GetOutTorque(120.RPMtoRad(), 50.SI<NewtonMeter>(), true)); - - // test extrapolation not allowed - AssertHelper.Exception<VectoException>(() => { map.GetOutTorque(120.RPMtoRad(), 50.SI<NewtonMeter>()); }); - } + //[TestCase] + //public void TestLossMap_OUT_Interpolation_Extrapolation() + //{ + // var data = new DataTable(); + // data.Columns.Add(""); + // data.Columns.Add(""); + // data.Columns.Add(""); + // data.Rows.Add("0", "0", "0"); // (0,100):10 -- (100,100):40 + // data.Rows.Add("0", "100", "10"); // | \ | + // data.Rows.Add("100", "0", "10"); // | \ | + // data.Rows.Add("100", "100", "40"); // (0,0):0 ----- (100,0):10 + + // var map = TransmissionLossMapReader.Create(data, 1.0, "1"); + + // // test inside the triangles + // AssertHelper.AreRelativeEqual(20, map.GetOutTorque(25.RPMtoRad(), 25.SI<NewtonMeter>())); + // AssertHelper.AreRelativeEqual(32.5, map.GetOutTorque(75.RPMtoRad(), 50.SI<NewtonMeter>())); + + // // test interpolation on edges + // AssertHelper.AreRelativeEqual(-5, map.GetOutTorque(50.RPMtoRad(), 0.SI<NewtonMeter>())); + // AssertHelper.AreRelativeEqual(40.5, map.GetOutTorque(0.RPMtoRad(), 45.SI<NewtonMeter>())); + // AssertHelper.AreRelativeEqual(31, map.GetOutTorque(50.RPMtoRad(), 40.SI<NewtonMeter>())); + // AssertHelper.AreRelativeEqual(57.5, map.GetOutTorque(50.RPMtoRad(), 75.SI<NewtonMeter>())); + // AssertHelper.AreRelativeEqual(7.5, map.GetOutTorque(100.RPMtoRad(), 25.SI<NewtonMeter>())); + + // // test interpolation on corner points + // AssertHelper.AreRelativeEqual(0, map.GetTorqueLoss(0.RPMtoRad(), 0.SI<NewtonMeter>()).Value); + // AssertHelper.AreRelativeEqual(10, map.GetTorqueLoss(0.RPMtoRad(), 90.SI<NewtonMeter>()).Value); + // AssertHelper.AreRelativeEqual(10, map.GetTorqueLoss(100.RPMtoRad(), -10.SI<NewtonMeter>()).Value); + // AssertHelper.AreRelativeEqual(40, map.GetTorqueLoss(100.RPMtoRad(), 60.SI<NewtonMeter>()).Value); + + // // test outside the corners + // AssertHelper.AreRelativeEqual(-20, map.GetOutTorque(-20.RPMtoRad(), -20.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(110, map.GetOutTorque(-20.RPMtoRad(), 120.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(-30, map.GetOutTorque(120.RPMtoRad(), -20.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(80, map.GetOutTorque(120.RPMtoRad(), 120.SI<NewtonMeter>(), true)); + + // // test outside the edges + // AssertHelper.AreRelativeEqual(45, map.GetOutTorque(-20.RPMtoRad(), 50.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(95, map.GetOutTorque(50.RPMtoRad(), 120.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(-25, map.GetOutTorque(50.RPMtoRad(), -20.SI<NewtonMeter>(), true)); + // AssertHelper.AreRelativeEqual(25, map.GetOutTorque(120.RPMtoRad(), 50.SI<NewtonMeter>(), true)); + + // // test extrapolation not allowed + // AssertHelper.Exception<VectoException>(() => { map.GetOutTorque(120.RPMtoRad(), 50.SI<NewtonMeter>()); }); + //} [TestCase] public void TestFullLoadCurveIntersection() diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 6d6a9b68fd988202e8074e4f6c7c89e77563b30b..e42c9e0937d7ec2a8c4882ca57f016f8a8b0b3df 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props')" /> + <Import Project="..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" /> <Import Project="..\..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -117,6 +117,7 @@ <Compile Include="Integration\TorqueLimitsTest.cs" /> <Compile Include="Integration\XMLReportTest.cs" /> <Compile Include="Models\Declaration\AirdragDefaultValuesTest.cs" /> + <Compile Include="Models\Declaration\DataAdapter\DeclarationAdapterCreateVocationalVehicleTest.cs" /> <Compile Include="Models\Declaration\DataAdapter\DeclarationAdapterTestHelper.cs" /> <Compile Include="Models\Declaration\DataAdapter\DeclarationDataAdapterTest_Class5.cs" /> <Compile Include="Models\Declaration\DataAdapter\DeclarationDataAdapterTest_Class2.cs" /> @@ -3032,7 +3033,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.11.0\build\NUnit.props'))" /> - <Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.12.0\build\net35\NUnit3TestAdapter.props'))" /> + <Error Condition="!Exists('..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/VectoCore/VectoCoreTest/packages.config b/VectoCore/VectoCoreTest/packages.config index 495af7c4142c5c9559d34f9732758fe66dce3c03..b879abef8381c88d96fc0a2b2b981fb402784183 100644 --- a/VectoCore/VectoCoreTest/packages.config +++ b/VectoCore/VectoCoreTest/packages.config @@ -5,5 +5,5 @@ <package id="Ninject" version="3.3.4" targetFramework="net45" /> <package id="NLog" version="4.5.11" targetFramework="net45" /> <package id="NUnit" version="3.11.0" targetFramework="net45" /> - <package id="NUnit3TestAdapter" version="3.12.0" targetFramework="net45" /> + <package id="NUnit3TestAdapter" version="3.11.2" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/packages/NUnit3TestAdapter.3.12.0/.signature.p7s b/packages/NUnit3TestAdapter.3.12.0/.signature.p7s deleted file mode 100644 index c4d5a2b97c6c29d1c29025203feb3eb281c1f236..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/.signature.p7s and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/LICENSE.txt b/packages/NUnit3TestAdapter.3.12.0/LICENSE.txt deleted file mode 100644 index 210c64746b842ac76d0f5d68f2d1136c9adbe1ff..0000000000000000000000000000000000000000 --- a/packages/NUnit3TestAdapter.3.12.0/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2011-2017 Charlie Poole, 2014-2017 Terje Sandstrom - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/packages/NUnit3TestAdapter.3.12.0/NUnit3TestAdapter.3.12.0.nupkg b/packages/NUnit3TestAdapter.3.12.0/NUnit3TestAdapter.3.12.0.nupkg deleted file mode 100644 index 8b5057fd79230d29b463e14f734d8b8337d38c6e..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/NUnit3TestAdapter.3.12.0.nupkg and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.dll b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.dll deleted file mode 100644 index 97907257342fd5a225fc11996b6efa0b6a573ddf..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.dll and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.pdb b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.pdb deleted file mode 100644 index 5cada9f75d7387efb71250e15b10971c43b78976..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3.TestAdapter.pdb and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3TestAdapter.props b/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3TestAdapter.props deleted file mode 100644 index 9cbeed67fb65c94ff2504293d1b168ef06ffda03..0000000000000000000000000000000000000000 --- a/packages/NUnit3TestAdapter.3.12.0/build/net35/NUnit3TestAdapter.props +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Content Include="$(MSBuildThisFileDirectory)NUnit3.TestAdapter.dll"> - <Link>NUnit3.TestAdapter.dll</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - <Content Include="$(MSBuildThisFileDirectory)NUnit3.TestAdapter.pdb" Condition="Exists('$(MSBuildThisFileDirectory)NUnit3.TestAdapter.pdb')"> - <Link>NUnit3.TestAdapter.pdb</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - <Content Include="$(MSBuildThisFileDirectory)nunit.engine.dll"> - <Link>nunit.engine.dll</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - <Content Include="$(MSBuildThisFileDirectory)nunit.engine.api.dll"> - <Link>nunit.engine.api.dll</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - </ItemGroup> -</Project> diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.api.dll b/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.api.dll deleted file mode 100644 index 724a7a2e0ea050fdfb25991cbc2e73d0608f88d0..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.api.dll and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.dll b/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.dll deleted file mode 100644 index ca53afacfe4ced6e1468af6096301861e1568388..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/net35/nunit.engine.dll and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll deleted file mode 100644 index 53ad88912fd42bcea59bc036332f2d816dc6a7af..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb deleted file mode 100644 index ea8b2b25362c608f3ac866385f9742d969f7b429..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb and /dev/null differ diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3TestAdapter.props b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3TestAdapter.props deleted file mode 100644 index 3016fb1b2a294d2b695e78ffaf5935fd228dae32..0000000000000000000000000000000000000000 --- a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/NUnit3TestAdapter.props +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Content Include="$(MSBuildThisFileDirectory)NUnit3.TestAdapter.dll"> - <Link>NUnit3.TestAdapter.dll</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - <Content Include="$(MSBuildThisFileDirectory)NUnit3.TestAdapter.pdb" Condition="Exists('$(MSBuildThisFileDirectory)NUnit3.TestAdapter.pdb')"> - <Link>NUnit3.TestAdapter.pdb</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - <Content Include="$(MSBuildThisFileDirectory)nunit.engine.netstandard.dll"> - <Link>nunit.engine.netstandard.dll</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <Visible>False</Visible> - </Content> - </ItemGroup> -</Project> diff --git a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/nunit.engine.netstandard.dll b/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/nunit.engine.netstandard.dll deleted file mode 100644 index ab0c005375c8dbfa56a86cf08cd01e3f64c9bae6..0000000000000000000000000000000000000000 Binary files a/packages/NUnit3TestAdapter.3.12.0/build/netcoreapp1.0/nunit.engine.netstandard.dll and /dev/null differ