Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

Dashboard - Electricals Complete, Pneumatics Complete, HVAC SSM OutputValues...

Dashboard - Electricals Complete, Pneumatics Complete, HVAC SSM OutputValues Complete. Now need to work on 1. File Browsing and Persistance.

git-tfs-id: [http://tfs00.element.root.com:8080/tfs/TFSCollection]$/VECTO;C1652
parent 0f0bf1df
No related branches found
No related tags found
No related merge requests found
Showing
with 864 additions and 702 deletions
......@@ -75,12 +75,6 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsumerList.Designer.vb">
<DependentUpon>ConsumerList.vb</DependentUpon>
</Compile>
<Compile Include="ConsumerList.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dashboard.Designer.vb">
<DependentUpon>Dashboard.vb</DependentUpon>
</Compile>
......@@ -104,9 +98,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ConsumerList.resx">
<DependentUpon>ConsumerList.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dashboard.resx">
<DependentUpon>Dashboard.vb</DependentUpon>
</EmbeddedResource>
......
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ConsumerList
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.DataGridView1 = New System.Windows.Forms.DataGridView()
Me.Button1 = New System.Windows.Forms.Button()
CType(Me.DataGridView1,System.ComponentModel.ISupportInitialize).BeginInit
Me.SuspendLayout
'
'DataGridView1
'
Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.DataGridView1.Location = New System.Drawing.Point(46, 193)
Me.DataGridView1.Name = "DataGridView1"
Me.DataGridView1.Size = New System.Drawing.Size(516, 150)
Me.DataGridView1.TabIndex = 0
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(46, 60)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Button1"
Me.Button1.UseVisualStyleBackColor = true
'
'ConsumerList
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(622, 447)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.DataGridView1)
Me.Name = "ConsumerList"
Me.Text = "ConsumerList"
CType(Me.DataGridView1,System.ComponentModel.ISupportInitialize).EndInit
Me.ResumeLayout(false)
End Sub
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
Friend WithEvents Button1 As System.Windows.Forms.Button
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
imports VectoAuxiliaries.Electrics
Public Class ConsumerList
Friend ConsumerList As List(Of IElectricalConsumer)
Private Sub ConsumerList_Load( sender As Object, e As EventArgs) Handles MyBase.Load
ConsumerList = New List(Of IElectricalConsumer)
End Sub
Private sub AddConsumer( consumer as IElectricalConsumer)
If Not ConsumerList.Contains( consumer ) then
ConsumerList.Add(consumer)
Else
MessageBox.Show("Already Exists")
End If
End Sub
Private Sub Button1_Click( sender As Object, e As EventArgs) Handles Button1.Click
AddConsumer( New ElectricalConsumer(False,"Test","Test1",2.2,.5,26.3,1))
End Sub
End Class
\ No newline at end of file
This diff is collapsed.
......@@ -120,13 +120,13 @@
<metadata name="brcElecConsumers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="resultCardContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>362, 19</value>
</metadata>
<metadata name="ErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>168, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>82</value>
</metadata>
<metadata name="resultCardContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>362, 19</value>
</metadata>
</root>
\ No newline at end of file
This diff is collapsed.
......@@ -52,9 +52,11 @@ Private Sub setDefaults()
.ResultCardIdle= New List(Of SmartResult),
.ResultCardOverrun= New List(Of SmartResult),
.ResultCardTraction=New List(Of SmartResult),
.SmartElectrical=True}
.SmartElectrical=True,
.AlternatorMap="C:\Users\tb28\Source\Workspaces\VECVECTOAux\VectoAuxiliariesTests\TestFiles\testAlternatorMap.csv"
}
HvacUserInputsConfig = New HVACUserInputsConfig(1,1,New HVACInputs(),"HVACMAPPATHGOESHERE.CSV")
HvacUserInputsConfig = New HVACUserInputsConfig(1,1,New HVACInputs(),"HVACMAPPATHGOESHERE.CSV", New HVACSteadyStateModel())
End Sub
......
......@@ -16,7 +16,10 @@ Private _signals As ISignals
Public Function SmartIdleCurrent() As single
Return _resultCardIdle.GetSmartCurrentResult(HvacPlusNonBaseCurrents())
Dim hvac_Plus_None_Base As Single = HvacPlusNonBaseCurrents()
Dim smart_idle_current As Single = _resultCardIdle.GetSmartCurrentResult(hvac_Plus_None_Base)
Return smart_idle_current
end Function
......
......@@ -9,16 +9,17 @@ Public Class M0_NonSmart_AlternatorsSetEfficiency
Private _electricalConsumersList As IElectricalConsumerList
Private _hvacInputs As IHVACInputs
Private _alternatorEfficiencyMap As IAlternatorMap
Private _hvacMap As IHVACMap
Private _powernetVoltage As Single
Private _signals As ISignals
Private _steadyStateModelHVAC As IHVACSteadyStateModel
Public Sub New(electricalConsumers As IElectricalConsumerList, hvacInputs As IHVACInputs, hvacMap As IHVACMap, alternatorEfficiencyMap As IAlternatorMap, powernetVoltage As Single, signals As ISignals)
Public Sub New(electricalConsumers As IElectricalConsumerList, hvacInputs As IHVACInputs, alternatorEfficiencyMap As IAlternatorMap, powernetVoltage As Single, signals As ISignals, ssmHvac As IHVACSteadyStateModel)
If electricalConsumers Is Nothing Then Throw New ArgumentException("No ElectricalConsumersList Supplied")
If hvacInputs Is Nothing Then Throw New ArgumentException("No hvac inputs supplied")
If hvacMap Is Nothing Then Throw New ArgumentException("No HVAC Map supplied")
If alternatorEfficiencyMap Is Nothing Then Throw New ArgumentException("No Alternator Efficiency Map Supplied")
If (powernetVoltage < ElectricConstants.PowenetVoltageMin Or powernetVoltage > ElectricConstants.PowenetVoltageMax) Then Throw New ArgumentException("Powernet Voltage out of range")
If signals is Nothing then Throw New ArgumentException("No Signals reference was supplied.")
......@@ -27,9 +28,10 @@ Public Class M0_NonSmart_AlternatorsSetEfficiency
Me._hvacInputs = hvacInputs
Me._alternatorEfficiencyMap = alternatorEfficiencyMap
Me._hvacMap = hvacMap
Me._powernetVoltage = powernetVoltage
Me._signals = signals
Me._steadyStateModelHVAC = ssmHvac
End Sub
......@@ -38,13 +40,11 @@ Public Class M0_NonSmart_AlternatorsSetEfficiency
Public Function GetEfficiency() As Single Implements IM0_NonSmart_AlternatorsSetEfficiency.GetEfficiency
'Sanity Check.
If _signals.EngineSpeed < 1 Then Throw New ArgumentException("CrankRPM must be greater than zero")
If _signals.EngineSpeed < 1 Then Return 0
Dim rotationalSpeed As Single = _signals.EngineSpeed
Dim currentHVACDemandAmps As Single = _hvacMap.GetElectricalDemand(_hvacInputs.Region, _hvacInputs.Season)
Dim currentElectricalConsumerDemandAmp As Single = _electricalConsumersList.GetTotalAverageDemandAmps(True)
Dim baseCurrentDemandAmps As Single = _electricalConsumersList.GetTotalAverageDemandAmps(True)
Dim totalDemandAmps As Single = currentHVACDemandAmps + currentElectricalConsumerDemandAmp
Dim totalDemandAmps As Single = baseCurrentDemandAmps + GetHVACElectricalPowerDemandAmps
Return _alternatorEfficiencyMap.GetEfficiency(_signals.EngineSpeed, totalDemandAmps).Efficiency
......@@ -52,7 +52,7 @@ Public Class M0_NonSmart_AlternatorsSetEfficiency
Public Function GetHVACElectricalPowerDemandAmps() As Single Implements IM0_NonSmart_AlternatorsSetEfficiency.GetHVACElectricalPowerDemandAmps
Return _hvacMap.GetElectricalDemand(_hvacInputs.Region, _hvacInputs.Season) / _powernetVoltage
Return _steadyStateModelHVAC.HVACElectricalLoadPowerWatts / _powernetVoltage
End Function
......

Namespace Hvac
Public Class HVACSteadyStateModel
implements IHVACSteadyStateModel
Public Property HVACElectricalLoadPowerWatts As Single Implements IHVACSteadyStateModel.HVACElectricalLoadPowerWatts
Public Property HVACFuellingLitresPerHour As Single Implements IHVACSteadyStateModel.HVACFuellingLitresPerHour
Public Property HVACMechanicalLoadPowerWatts As Single Implements IHVACSteadyStateModel.HVACMechanicalLoadPowerWatts
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
End Class
End Namespace
......@@ -8,13 +8,14 @@ Namespace Hvac
Public Class HVACUserInputsConfig
Implements IHVACUserInputsConfig
Public Property _compressorGearEfficiency As Single Implements IHVACUserInputsConfig._compressorGearEfficiency
Public Property _compressorGearRatio As Single Implements IHVACUserInputsConfig._compressorGearRatio
Public Property _hvacInputs As IHVACInputs Implements IHVACUserInputsConfig._hvacInputs
Public Property _hvacMapPath As String Implements IHVACUserInputsConfig._hvacMapPath
Public Property _steadyStateModel As IHVACSteadyStateModel Implements IHVACUserInputsConfig._steadyStateModel
Public Sub new (compressorGearEfficiency As single,compressorGearRatio As Single ,hvacInputs as IHVACInputs ,hvacMapPath As string)
Public Sub new (compressorGearEfficiency As single,compressorGearRatio As Single ,hvacInputs as IHVACInputs ,hvacMapPath As string, ssm As IHVACSteadyStateModel)
'Sanity Check
if hvacMapPath.Trim().Length=0 then Throw New ArgumentException("hvacMap Path must have a string to represent the csv file location")
......@@ -24,9 +25,11 @@ Implements IHVACUserInputsConfig
_compressorGearRatio = compressorGearRatio
_hvacInputs = hvacInputs
_hvacMapPath = hvacMapPath
_steadyStateModel = ssm
End Sub
End Class
End Namespace
......

Namespace Hvac
Public Interface IHVACSteadyStateModel
Property HVACMechanicalLoadPowerWatts As Single
Property HVACElectricalLoadPowerWatts As Single
Property HVACFuellingLitresPerHour As single
End Interface
End Namespace
......@@ -12,6 +12,8 @@ Public Interface IHVACUserInputsConfig
Property _hvacMapPath As string
Property _compressorGearRatio As Single
Property _compressorGearEfficiency As Single
Property _steadyStateModel As IHVACSteadyStateModel
End Interface
......
......@@ -8,13 +8,15 @@ Namespace Hvac
Private _m0 As IM0_NonSmart_AlternatorsSetEfficiency
Private _alternatorGearEfficiency As Single
Private _compressorGearEfficiency As single
Private _hvacInputs As IHVACInputs
Private _hvacMap As IHVACMap
Private _signals As ISignals
Private _powernetVoltage As single
Private _steadyStateModel As IHVACSteadyStateModel
Public Sub new ( m0 As IM0_NonSmart_AlternatorsSetEfficiency, hvacMap As IHVACMap, hvacInputs As IHVACInputs, altGearEfficiency As Single, powernetVoltage As Single, signals As ISignals )
Public Sub new ( m0 As IM0_NonSmart_AlternatorsSetEfficiency, hvacMap As IHVACMap, hvacInputs As IHVACInputs, altGearEfficiency As Single,compressorGearEfficiency As Single, powernetVoltage As Single, signals As ISignals, ssm As IHVACSteadyStateModel )
'Sanity Check - Illegal operations without all params.
If m0 is Nothing then Throw New ArgumentException("Module0 as supplied is null")
......@@ -26,6 +28,10 @@ Namespace Hvac
If signals is Nothing then Throw New Exception ("Signals object as supplied is null")
If powernetVoltage< ElectricConstants.PowenetVoltageMin orelse powernetVoltage> ElectricConstants.PowenetVoltageMax then _
Throw New ArgumentException(String.Format("PowenetVoltage supplied must be in the range {0} to {1}",ElectricConstants.PowenetVoltageMin,ElectricConstants.PowenetVoltageMax))
If ssm is Nothing then Throw New ArgumentException("Steady State model was not supplied")
If compressorGearEfficiency< 0 orelse altGearEfficiency> 1 then _
Throw New ArgumentException(String.Format("Compressor Gear efficiency must be between {0} and {1}",0,1 ))
'Assign
_m0=m0
......@@ -33,24 +39,41 @@ Namespace Hvac
_hvacInputs = hvacInputs
_alternatorGearEfficiency=altGearEfficiency
_signals = _Signals
_steadyStateModel=ssm
_compressorGearEfficiency = compressorGearEfficiency
End Sub
Public Function AveragePowerDemandAtCrankFromHVACMechanicalsWatts() As Single Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtCrankFromHVACMechanicalsWatts
Return _steadyStateModel.HVACMechanicalLoadPowerWatts / _compressorGearEfficiency
End Function
Public Function AveragePowerDemandAtAlternatorFromHVACElectricsWatts() As Single Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtAlternatorFromHVACElectricsWatts
Return 100'TODO FIX THIS
Return _steadyStateModel.HVACElectricalLoadPowerWatts
End Function
Public Function AveragePowerDemandAtCrankFromHVACElectricsWatts() As Single Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtCrankFromHVACElectricsWatts
Return 100'TODO FIX THIS
End Function
Public Function AveragePowerDemandAtCrankFromHVACMechanicalsWatts() As Single Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtCrankFromHVACMechanicalsWatts
Return 100'TODO FIX THIS
Return _steadyStateModel.HVACElectricalLoadPowerWatts/ _m0.GetEfficiency()
End Function
Public Function HVACFuelingLitresPerHour() As Single Implements IM1_AverageHVACLoadDemand.HVACFuelingLitresPerHour
Return 100'TODO FIX THI
Return _steadyStateModel.HVACFuellingLitresPerHour
End Function
......
......@@ -43,7 +43,7 @@ Public sub SetPropertiesToDefaults()
AdBlueDosing="Pneumatic"
AirSuspensionControl="Electrically"
CompressorGearEfficiency=0.8
CompressorGearRatio=0
CompressorGearRatio=0.6
CompressorMap="C:\Users\tb28\Source\Workspaces\VECVECTOAux\VectoAuxiliariesTests\TestFiles\testCompressorMap.csv"
CompressorType=""
Doors="Pneumatic"
......
......@@ -89,10 +89,12 @@
<Compile Include="Hvac\HVACConstants.vb" />
<Compile Include="Hvac\HVACInputs.vb" />
<Compile Include="Electrics\IElectricalConsumerList.vb" />
<Compile Include="Hvac\HVACSteadyStateModel.vb" />
<Compile Include="Hvac\HVACUserInputsConfig.vb" />
<Compile Include="Hvac\IHVACInputs.vb" />
<Compile Include="Hvac\HVACMapParameter.vb" />
<Compile Include="Hvac\IHVACMap.vb" />
<Compile Include="Hvac\IHVACSteadyStateModel.vb" />
<Compile Include="Hvac\IHVACUserInputsConfig.vb" />
<Compile Include="Hvac\IM1_AverageHVACLoadDemand.vb" />
<Compile Include="ISignals.vb" />
......
......@@ -19,6 +19,8 @@ End Sub
Private sub Initialise()
Dim ssm As New HVACSteadyStateModel(100,100,100)
Dim elecConsumers As New ElectricalConsumerList(26.3,0.096,True)
Dim hvacInputs As New HVACInputs(1,1)
Dim hvacMap As New HVACMap("testFiles\TestHvacMap.csv")
......@@ -29,7 +31,7 @@ alternatoMap.Initialise()
Dim signals = New Signals()
signals.EngineSpeed=2000
Dim m0 As New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers,hvacInputs,hvacMap,alternatoMap,26.3,signals)
Dim m0 As New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers,hvacInputs,alternatoMap,26.3,signals,ssm)
'Results Cards
Dim readings = new List(of SmartResult)
......@@ -74,7 +76,7 @@ End Sub
Public Sub AlternatorsEfficiencyIdle2000rpmTest()
Initialise()
Dim expected As Single = 0.618566155
Dim expected As Single = 0.573053837
Dim actual As Single = target.AlternatorsEfficiencyIdleResultCard()
Assert.AreEqual(expected, actual)
......@@ -87,7 +89,7 @@ End Sub
Public Sub AlternatorsEfficiencyTraction2000rpmTest()
Initialise()
Dim expected As Single = 0.618566155
Dim expected As Single = 0.573053837
Dim actual As Single = target.AlternatorsEfficiencyTractionOnResultCard()
Assert.AreEqual(expected, actual)
......@@ -99,7 +101,7 @@ End Sub
Public Sub AlternatorsEfficiencyOverrun2000rpmTest()
Initialise()
Dim expected As Single = 0.618566155
Dim expected As Single = 0.573053837
Dim actual As Single = target.AlternatorsEfficiencyOverrunResultCard()
Assert.AreEqual(expected, actual)
......
......@@ -22,6 +22,8 @@ Private hvacMap As IHVACMap
Private alternatorMap As IAlternatorMap
Private signals As Signals = New Signals
Private powernetVoltage As Single = 26.3
Private ssm As IHVACSteadyStateModel = New HVACSteadyStateModel(100,100,100)
......@@ -49,41 +51,41 @@ End Sub
<Test()>
Public Sub CreateNewTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, hvacMap, alternatorMap, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, alternatorMap, powernetVoltage,signals,ssm)
Assert.IsNotNull(target)
End Sub
<Test()>
<ExpectedException("System.ArgumentException")>
Public Sub CreateNew_MissingElecConsumers_ThrowArgumentExceptionTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(Nothing, hvacInputs, hvacMap, alternatorMap, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(Nothing, hvacInputs, alternatorMap, powernetVoltage,signals,ssm)
End Sub
<Test()>
<ExpectedException("System.ArgumentException")>
Public Sub CreateNew_MissingHVACInputs_ThrowArgumentExceptionTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, Nothing, hvacMap, alternatorMap, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, Nothing, alternatorMap, powernetVoltage,signals,ssm)
End Sub
<Test()>
<ExpectedException("System.ArgumentException")>
Public Sub CreateNew_MissingHVACMAP_ThrowArgumentExceptionTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, Nothing, alternatorMap, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, Nothing, alternatorMap, powernetVoltage,signals,ssm)
End Sub
<Test()>
<ExpectedException("System.ArgumentException")>
Public Sub CreateNew_MissingAlternatorMap_ThrowArgumentExceptionTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, hvacMap, Nothing, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, Nothing, powernetVoltage,signals,ssm)
End Sub
<Test()>
Public Sub EfficiencyValueTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, hvacMap, alternatorMap, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, alternatorMap, powernetVoltage,signals,ssm)
Dim actual As Single = target.GetEfficiency()
......@@ -98,12 +100,12 @@ End Sub
<Test()>
Public Sub HVAC_PowerDemandAmpsTest()
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, hvacMap, alternatorMap, powernetVoltage,signals)
Dim target As M0_NonSmart_AlternatorsSetEfficiency = New M0_NonSmart_AlternatorsSetEfficiency(elecConsumers, hvacInputs, alternatorMap, powernetVoltage,signals,ssm)
Dim actual As Single
Dim expected As Single = 152.091263F '( HVAC POWER OUTPUT IN KW not Watts )
Dim expected As Single = 3.80228149
actual = target.GetHVACElectricalPowerDemandAmps() * 1000
actual = target.GetHVACElectricalPowerDemandAmps()
Assert.AreEqual(expected, actual)
......

Namespace UnitTests
Public Class M1_HVACAverageLoadDemandTests
End Class
End Namespace
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