diff --git a/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb b/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb index fcc8be163d6611bff7a133e26cce4d30bc63832e..fc5b378cef8e04eb221d6c3b7867ef9e092d53fb 100644 --- a/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb +++ b/VECTOAux/VectoAuxiliaries/Hvac/SSMCalculate.vb @@ -77,8 +77,9 @@ Public Class SSMCalculate Dim gen As ISSMGenInputs = ssmTOOL.GenInputs Dim tl As ISSMTechList = ssmTOOL.TechList + Dim cnt As Integer = tl.TechLines.Where( Function(f) f.LineType= TechLineType.DriverACElectrical).Count() Dim DACElectrical As Boolean = tl.TechLines.Where( Function(f) f.LineType= TechLineType.DriverACElectrical).Count()=1 - Dim AdjustedAddition As Double = If( Not DACElectrical,0, tl.CValueVariationKW*1000) + Dim AdjustedAddition As Double = If( Not DACElectrical,0,- tl.CValueVariationKW*1000) 'Dim H84 As Double = BaseHeatingW_ElectricalCoolingHeating 'Dim H90 As Double = TechListAdjustedCoolingW_ElectricalCoolingHeating @@ -112,11 +113,11 @@ Public Class SSMCalculate Dim DACMechanical As Boolean = tl.TechLines.Where( Function(f) f.LineType= TechLineType.DriverACMechanical).Count()=1 Dim AdjustedAddition As Double = If( Not DACMechanical,0, tl.CValueVariationKW*1000) - Dim F84 As Double = BaseCoolingW_Mechanical - Dim F90 As Double = TechListAdjustedCoolingW_Mechanical - Dim C33 As Double = gen.BC_COP + 'Dim F84 As Double = BaseCoolingW_Mechanical + 'Dim F90 As Double = TechListAdjustedCoolingW_Mechanical + 'Dim C33 As Double = gen.BC_COP - Return (F84*(1-F90)/C33) + AdjustedAddition + Return (BaseCoolingW_Mechanical*(1-TechListAdjustedCoolingW_Mechanical)/gen.BC_COP) + AdjustedAddition End Get @@ -359,15 +360,17 @@ Public Class SSMCalculate 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 C40 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList 'Dim C48 As string = gen.AC_CompressorType - Return IF( IF(gen.AC_CompressorType.ToLower="mechanical",tl.CValueVariation,0)>0, _ + result= IF( IF(gen.AC_CompressorType.ToLower="mechanical",tl.CValueVariation,0)>0, _ Math.MIN(IF(gen.AC_CompressorType="mechanical",tl.CValueVariation,0),gen.BC_MaxPossibleBenefitFromTechnologyList), _ Math.MAX(IF(gen.AC_CompressorType="mechanical",tl.CValueVariation,0),-gen.BC_MaxPossibleBenefitFromTechnologyList)) + Return result + End Get End Property Public ReadOnly Property TechListAdjustedCoolingW_ElectricalCoolingHeating As Double Implements ISSMCalculate.TechListAdjustedCoolingW_ElectricalCoolingHeating @@ -377,15 +380,17 @@ Public Class SSMCalculate 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 C40 As Double = gen.BC_MaxPossibleBenefitFromTechnologyList 'Dim C48 As string = gen.AC_CompressorType - Return IF(IF(gen.AC_CompressorType.ToLower="mechanical",0,tl.CValueVariation)>0, _ + 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 diff --git a/VECTOAux/VectoAuxiliaries/Hvac/SSMRun.vb b/VECTOAux/VectoAuxiliaries/Hvac/SSMRun.vb index fb54427b59696f4548a5c1aea45e4007a21e15dd..f8bd1e625df894aafa1b3e53961c799d0f8367c6 100644 --- a/VECTOAux/VectoAuxiliaries/Hvac/SSMRun.vb +++ b/VECTOAux/VectoAuxiliaries/Hvac/SSMRun.vb @@ -14,6 +14,8 @@ Public Class SSMRun If runNumber<>1 AndAlso runNumber<>2 then Throw New ArgumentException("Run number must be either 1 or 2") + ssmTOOL=ssm + End Sub diff --git a/VECTOAux/VectoAuxiliaries/Hvac/SSMTOOL.vb b/VECTOAux/VectoAuxiliaries/Hvac/SSMTOOL.vb index 93a0e6c49117bf34118f1a43bf3ba8445788c474..1df9a58bc923c9d2ee3a7bf2fd466e28690fce40 100644 --- a/VECTOAux/VectoAuxiliaries/Hvac/SSMTOOL.vb +++ b/VECTOAux/VectoAuxiliaries/Hvac/SSMTOOL.vb @@ -11,50 +11,43 @@ Public Class SSMTOOL Implements ISSMTOOL - - - - - - Private filePath As String Public Property GenInputs As ISSMGenInputs Implements ISSMTOOL.GenInputs - Public Property TechList As ISSMTechList Implements ISSMTOOL.TechList + Public Property TechList As ISSMTechList Implements ISSMTOOL.TechList Public Property Calculate As ISSMCalculate Implements ISSMTOOL.Calculate - 'Public facing properties, final results from calculations. - Public ReadOnly Property ElectricalWAdjusted As Single Implements ISSMTOOL.ElectricalWAdjusted - Get - - End Get - End Property + 'Base Values Public ReadOnly Property ElectricalWBase As Single Implements ISSMTOOL.ElectricalWBase Get - - End Get + Return Calculate.ElectricalWBase + End Get End Property - Public ReadOnly Property FuelLPerHBase As Single Implements ISSMTOOL.FuelLPerHBase + Public ReadOnly Property MechanicalWBase As Single Implements ISSMTOOL.MechanicalWBase Get - - End Get + Return Calculate.MechanicalWBase + End Get End Property - - Public ReadOnly Property FuelLPerHBaseAdjusted As Single Implements ISSMTOOL.FuelLPerHBaseAdjusted + Public ReadOnly Property FuelLPerHBase As Single Implements ISSMTOOL.FuelLPerHBase Get - - End Get + Return Calculate.FuelLPerHBase + End Get End Property - Public ReadOnly Property MechanicalWBase As Single Implements ISSMTOOL.MechanicalWBase - Get - - End Get + 'Adjusted Values + Public ReadOnly Property ElectricalWAdjusted As Single Implements ISSMTOOL.ElectricalWAdjusted + Get + Return Calculate.ElectricalWAdjusted + End Get End Property Public ReadOnly Property MechanicalWBaseAdjusted As Single Implements ISSMTOOL.MechanicalWBaseAdjusted Get - - End Get + Return Calculate.MechanicalWBaseAdjusted + End Get + End Property + Public ReadOnly Property FuelLPerHBaseAdjusted As Single Implements ISSMTOOL.FuelLPerHBaseAdjusted + Get + Return Calculate.FuelLPerHBaseAdjusted + End Get End Property - 'Constructors Sub New() @@ -218,11 +211,6 @@ End Function End Function - - - - - End Class diff --git a/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.Designer.vb b/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.Designer.vb index 23f88ba56eef9083a81360445d96e6ceb9d4da48..efda3147a15b2b8e7a261cfd7265100d8ca88160 100644 --- a/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.Designer.vb +++ b/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.Designer.vb @@ -201,6 +201,13 @@ Partial Class frmHVACTool Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider(Me.components) Me.btnSave = New System.Windows.Forms.Button() Me.btnCancel = New System.Windows.Forms.Button() + Me.txtBasElectrical = New System.Windows.Forms.TextBox() + Me.txtBaseMechanical = New System.Windows.Forms.TextBox() + Me.txtBaseFuel = New System.Windows.Forms.TextBox() + Me.txtAdjFuel = New System.Windows.Forms.TextBox() + Me.txtAdjMechanical = New System.Windows.Forms.TextBox() + Me.txtAdjElectrical = New System.Windows.Forms.TextBox() + Me.Timer1 = New System.Windows.Forms.Timer(Me.components) Me.tabMain.SuspendLayout Me.tabGeneralInputsBP.SuspendLayout Me.GroupBox1.SuspendLayout @@ -226,10 +233,10 @@ Partial Class frmHVACTool Me.tabMain.Controls.Add(Me.tabGeneralInputsOther) Me.tabMain.Controls.Add(Me.tabTechBenefits) Me.tabMain.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed - Me.tabMain.Location = New System.Drawing.Point(8, 33) + Me.tabMain.Location = New System.Drawing.Point(8, 81) Me.tabMain.Name = "tabMain" Me.tabMain.SelectedIndex = 0 - Me.tabMain.Size = New System.Drawing.Size(945, 643) + Me.tabMain.Size = New System.Drawing.Size(945, 644) Me.tabMain.TabIndex = 0 ' 'tabGeneralInputsBP @@ -240,7 +247,7 @@ Partial Class frmHVACTool Me.tabGeneralInputsBP.Location = New System.Drawing.Point(4, 22) Me.tabGeneralInputsBP.Name = "tabGeneralInputsBP" Me.tabGeneralInputsBP.Padding = New System.Windows.Forms.Padding(3) - Me.tabGeneralInputsBP.Size = New System.Drawing.Size(937, 617) + Me.tabGeneralInputsBP.Size = New System.Drawing.Size(937, 618) Me.tabGeneralInputsBP.TabIndex = 0 Me.tabGeneralInputsBP.Text = " INP - BusParameters " Me.tabGeneralInputsBP.UseVisualStyleBackColor = true @@ -534,7 +541,7 @@ Partial Class frmHVACTool Me.tabGeneralInputsBC.Controls.Add(Me.GroupBox2) Me.tabGeneralInputsBC.Location = New System.Drawing.Point(4, 22) Me.tabGeneralInputsBC.Name = "tabGeneralInputsBC" - Me.tabGeneralInputsBC.Size = New System.Drawing.Size(937, 617) + Me.tabGeneralInputsBC.Size = New System.Drawing.Size(937, 618) Me.tabGeneralInputsBC.TabIndex = 2 Me.tabGeneralInputsBC.Text = " INP - Boundary Conditions " Me.tabGeneralInputsBC.UseVisualStyleBackColor = true @@ -1378,7 +1385,7 @@ Partial Class frmHVACTool Me.tabGeneralInputsOther.Controls.Add(Me.grpEnvironmentConditions) Me.tabGeneralInputsOther.Location = New System.Drawing.Point(4, 22) Me.tabGeneralInputsOther.Name = "tabGeneralInputsOther" - Me.tabGeneralInputsOther.Size = New System.Drawing.Size(937, 617) + Me.tabGeneralInputsOther.Size = New System.Drawing.Size(937, 618) Me.tabGeneralInputsOther.TabIndex = 3 Me.tabGeneralInputsOther.Text = " INP - Other " Me.tabGeneralInputsOther.UseVisualStyleBackColor = true @@ -1786,7 +1793,7 @@ Partial Class frmHVACTool Me.tabTechBenefits.Location = New System.Drawing.Point(4, 22) Me.tabTechBenefits.Name = "tabTechBenefits" Me.tabTechBenefits.Padding = New System.Windows.Forms.Padding(3) - Me.tabTechBenefits.Size = New System.Drawing.Size(937, 617) + Me.tabTechBenefits.Size = New System.Drawing.Size(937, 618) Me.tabTechBenefits.TabIndex = 5 Me.tabTechBenefits.Text = " Tech List Input " Me.tabTechBenefits.UseVisualStyleBackColor = true @@ -2113,7 +2120,7 @@ Partial Class frmHVACTool ' 'btnSave ' - Me.btnSave.Location = New System.Drawing.Point(721, 694) + Me.btnSave.Location = New System.Drawing.Point(767, 734) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) Me.btnSave.TabIndex = 1 @@ -2122,19 +2129,71 @@ Partial Class frmHVACTool ' 'btnCancel ' - Me.btnCancel.Location = New System.Drawing.Point(826, 694) + Me.btnCancel.Location = New System.Drawing.Point(872, 734) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.TabIndex = 2 Me.btnCancel.Text = "Cancel" Me.btnCancel.UseVisualStyleBackColor = true ' + 'txtBasElectrical + ' + Me.txtBasElectrical.Location = New System.Drawing.Point(520, 4) + Me.txtBasElectrical.Name = "txtBasElectrical" + Me.txtBasElectrical.Size = New System.Drawing.Size(100, 20) + Me.txtBasElectrical.TabIndex = 3 + ' + 'txtBaseMechanical + ' + Me.txtBaseMechanical.Location = New System.Drawing.Point(520, 31) + Me.txtBaseMechanical.Name = "txtBaseMechanical" + Me.txtBaseMechanical.Size = New System.Drawing.Size(100, 20) + Me.txtBaseMechanical.TabIndex = 4 + ' + 'txtBaseFuel + ' + Me.txtBaseFuel.Location = New System.Drawing.Point(521, 58) + Me.txtBaseFuel.Name = "txtBaseFuel" + Me.txtBaseFuel.Size = New System.Drawing.Size(98, 20) + Me.txtBaseFuel.TabIndex = 5 + ' + 'txtAdjFuel + ' + Me.txtAdjFuel.Location = New System.Drawing.Point(734, 58) + Me.txtAdjFuel.Name = "txtAdjFuel" + Me.txtAdjFuel.Size = New System.Drawing.Size(98, 20) + Me.txtAdjFuel.TabIndex = 8 + ' + 'txtAdjMechanical + ' + Me.txtAdjMechanical.Location = New System.Drawing.Point(733, 31) + Me.txtAdjMechanical.Name = "txtAdjMechanical" + Me.txtAdjMechanical.Size = New System.Drawing.Size(100, 20) + Me.txtAdjMechanical.TabIndex = 7 + ' + 'txtAdjElectrical + ' + Me.txtAdjElectrical.Location = New System.Drawing.Point(733, 4) + Me.txtAdjElectrical.Name = "txtAdjElectrical" + Me.txtAdjElectrical.Size = New System.Drawing.Size(100, 20) + Me.txtAdjElectrical.TabIndex = 6 + ' + 'Timer1 + ' + Me.Timer1.Enabled = true + ' 'frmHVACTool ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange - Me.ClientSize = New System.Drawing.Size(965, 729) + Me.ClientSize = New System.Drawing.Size(965, 766) + Me.Controls.Add(Me.txtAdjFuel) + Me.Controls.Add(Me.txtAdjMechanical) + Me.Controls.Add(Me.txtAdjElectrical) + Me.Controls.Add(Me.txtBaseFuel) + Me.Controls.Add(Me.txtBaseMechanical) + Me.Controls.Add(Me.txtBasElectrical) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.tabMain) @@ -2167,6 +2226,7 @@ Partial Class frmHVACTool CType(Me.gvTechBenefitLines,System.ComponentModel.ISupportInitialize).EndInit CType(Me.ErrorProvider1,System.ComponentModel.ISupportInitialize).EndInit Me.ResumeLayout(false) + Me.PerformLayout End Sub Friend WithEvents tabMain As System.Windows.Forms.TabControl @@ -2347,4 +2407,11 @@ End Sub Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents btnClearForm As System.Windows.Forms.Button + Friend WithEvents txtAdjFuel As System.Windows.Forms.TextBox + Friend WithEvents txtAdjMechanical As System.Windows.Forms.TextBox + Friend WithEvents txtAdjElectrical As System.Windows.Forms.TextBox + Friend WithEvents txtBaseFuel As System.Windows.Forms.TextBox + Friend WithEvents txtBaseMechanical As System.Windows.Forms.TextBox + Friend WithEvents txtBasElectrical As System.Windows.Forms.TextBox + Friend WithEvents Timer1 As System.Windows.Forms.Timer End Class diff --git a/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.resx b/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.resx index 8c7b6fddb3d03b338f5442fdf458c56d29dcd719..86f7d05916bb2c27a387987745ffbbb805cbbec7 100644 --- a/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.resx +++ b/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.resx @@ -129,4 +129,7 @@ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>25</value> </metadata> + <metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>246, 17</value> + </metadata> </root> \ No newline at end of file diff --git a/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.vb b/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.vb index 205f15d6156dca3fcec99e1cd793eed2f36d0c53..58787612f36ccca16badb7dbe2f61eea8dfc4c02 100644 --- a/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.vb +++ b/VECTOAux/VectoAuxiliaries/UI/frmHVACTool.vb @@ -944,4 +944,30 @@ End Sub +Private Sub Timer1_Tick( sender As Object, e As EventArgs) Handles Timer1.Tick + + If Not ssmTOOL is nothing then + + txtBasElectrical.Text = ssmTOOL.ElectricalWBase + txtBaseMechanical.Text = ssmTOOL.MechanicalWBase + txtBaseFuel.Text = ssmTOOL.FuelLPerHBase + + txtAdjElectrical.Text = ssmTOOL.ElectricalWAdjusted + txtAdjMechanical.Text = ssmTOOL.MechanicalWBaseAdjusted + txtAdjFuel.Text = ssmTOOL.FuelLPerHBaseAdjusted + + + + End If + + + +End Sub + + + + +Private Sub Validating_GeneralInputsBP( sender As Object, e As EventArgs) + +End Sub End Class