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

Skip to content
Snippets Groups Projects
Commit cd503bbf authored by Terry Burns's avatar Terry Burns Committed by Kostis ANAGNOSTOPOULOS
Browse files

Before Refactoring CycleTime and VehicleMass => Signals

git-tfs-id: [http://tfs00.element.root.com:8080/tfs/TFSCollection]$/VECTO;C1662
parent 488a769a
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationRevision>7</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
......
This diff is collapsed.
......@@ -107,6 +107,7 @@ End Sub
#Region "Binding Control"
Private Sub CreateBindings()
'AuxEnvironment.Vecto Bindings
......@@ -121,9 +122,11 @@ Private Sub CreateBindings()
chkSmartElectricals.DataBindings.Add("Checked", auxEnvironment.ElectricalUserInputsConfig, "SmartElectrical")
'Electrical ConsumablesGrid
Dim electricalConsumerBinding As New BindingList(Of IElectricalConsumer)(auxEnvironment.ElectricalUserInputsConfig.ElectricalConsumers.Items )
Dim electricalConsumerBinding As New BindingList(Of IElectricalConsumer)(auxEnvironment.ElectricalUserInputsConfig.ElectricalConsumers.Items )
gvElectricalConsumables.DataSource = electricalConsumerBinding
'ResultCards
'IDLE
......@@ -863,6 +866,7 @@ Private sub RefreshDisplays()
txtM05_out_AlternatorsEfficiencyTraction.Text=auxEnvironment.M05.AlternatorsEfficiencyTractionOnResultCard
txtM05_out_SmartOverrunCurrent.Text= auxEnvironment.M05.SmartOverrunCurrent
txtM05_out_AlternatorsEfficiencyOverrun.Text = auxEnvironment.M05.AlternatorsEfficiencyOverrunResultCard
'M1
txtM1_out_AvgPowerDemandAtAlternatorHvacElectrics.Text= auxEnvironment.M1.AveragePowerDemandAtAlternatorFromHVACElectricsWatts
txtM1_out_AvgPowerDemandAtCrankMech.Text= auxEnvironment.M1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts
......@@ -932,7 +936,7 @@ End Sub
'Form Overrides
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, keyData As Keys) As Boolean
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, keyData As Keys) As Boolean
if keyData = Keys.Enter andalso me.AcceptButton is nothing then
dim box As TextBoxBase = CType( me.ActiveControl ,TextBoxBase)
......@@ -1063,4 +1067,41 @@ Private Sub Button2_Click( sender As Object, e As EventArgs) Handles Button2.Cl
End Sub
Private Sub gvElectricalConsumables_CellFormatting( sender As Object, e As DataGridViewCellFormattingEventArgs) Handles gvElectricalConsumables.CellFormatting
If e.ColumnIndex=4 andalso e.RowIndex=0 then
e.CellStyle.BackColor = Color.LightGray
e.CellStyle.ForeColor=color.LightGray
End If
End Sub
Private Sub gvElectricalConsumables_CellBeginEdit( sender As Object, e As DataGridViewCellCancelEventArgs) Handles gvElectricalConsumables.CellBeginEdit
If e.ColumnIndex=4 andalso e.RowIndex=0 then
MessageBox.Show("This cell is calculated and cannot be edited")
e.Cancel=true
End If
End Sub
End Class
\ No newline at end of file
......@@ -69,7 +69,7 @@ M05 = New M0_5_SmartAlternatorSetEfficiency(M0,
alternatoMap,
ElectricalUserInputsConfig.ResultCardIdle,
ElectricalUserInputsConfig.ResultCardTraction,
ElectricalUserInputsConfig.ResultCardTraction,Signals)
ElectricalUserInputsConfig.ResultCardOverrun,Signals)
M1 = New M1_AverageHVACLoadDemand(M0,
......
......@@ -65,7 +65,7 @@ Namespace Hvac
Public Function AveragePowerDemandAtCrankFromHVACElectricsWatts() As Single Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtCrankFromHVACElectricsWatts
Return _steadyStateModel.HVACElectricalLoadPowerWatts / _m0.AlternatorsEfficiency()
Return _steadyStateModel.HVACElectricalLoadPowerWatts / _m0.AlternatorsEfficiency() / _alternatorGearEfficiency
End Function
......
......@@ -46,7 +46,7 @@ Namespace Pneumatics
'Total up the blow demands from compressor map
_averagePowerDemandPerCompressorUnitFlowRateInKWPerLitresPerSecond = _pneumaticsCompressorFlowRateMap.GetAveragePowerDemandPerCompressorUnitFlowRate()
_averagePowerDemandPerCompressorUnitFlowRateInKWPerLitresPerSecond = _pneumaticsCompressorFlowRateMap.GetAveragePowerDemandPerCompressorUnitFlowRate() /60
'Calculate the Total Required Air Delivery Rate L / S
_totalAirDemand = TotalAirDemandCalculation()
......
......@@ -43,7 +43,8 @@ End Sub
'OP2 OP2 :Smart Electrical & Pneumatic Aux : Air comp power gen @ Crank
'OP3 OP3 :Smart Electrical Aux : Alternator Power Gen @ Crank
'OP4 OP4 :Smart Electrical Aux : Ait Compressor Power Gen @ Crank
<Test()>
<Test()> _
<TestCase(100,200,false,0,false,true,300,400,500,600,700,1000,2000,3000,4000)> _
Public Sub InputOutputTests(IP1 As Single, _
IP2 As Single, _
IP3 As Boolean, _
......
......@@ -80,23 +80,35 @@ Public Sub EmptyCycleNameTest()
End Sub
<Test()>
Public Sub ValueLookupTest()
<TestCase("Brakes","Heavy urban",191)> _
<TestCase("Brakes","Urban",153)> _
<TestCase("Brakes","Suburban",49)> _
<TestCase("Brakes","Interurban",190)> _
<TestCase("Brakes","Coach",27)> _
<TestCase("Park brake + 2 doors","Heavy urban",82)> _
<TestCase("Park brake + 2 doors","Urban",75)> _
<TestCase("Park brake + 2 doors","Suburban",25)> _
<TestCase("Park brake + 2 doors","Interurban",9)> _
<TestCase("Park brake + 2 doors","Coach",6)> _
<TestCase("Kneeling","Heavy urban",27)> _
<TestCase("Kneeling","Urban",25)> _
<TestCase("Kneeling","Suburban",6)> _
<TestCase("Kneeling","Interurban",0)> _
<TestCase("Kneeling","Coach",0)> _
Public Sub ValueLookupTest(key As String, cycle As String, expected As integer)
Dim target As New PneumaticActuationsMAP(cstrPneumaticActuationsMapPath_GOODMAP)
target.Initialise()
Dim actual As Integer
'Brakes,Coach,27
Dim actual As Integer = target.GetNumActuations(New ActuationsKey("Brakes", "Urban"))
Dim expected As Integer = 153
try
actual = target.GetNumActuations(New ActuationsKey(key, cycle))
Catch ex As Exception
end try
Assert.AreEqual(expected, actual)
End Sub
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment