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

Skip to content
Snippets Groups Projects
Commit e01fa87a authored by Terry Burns's avatar Terry Burns Committed by Kostis ANAGNOSTOPOULOS
Browse files
parent bd2889ed
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\tb28\Documents\Deploy\</PublishUrl>
<PublishUrl>C:\Users\tb28\Documents\SSMDEPLOY\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
......@@ -27,7 +27,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
......
......@@ -8,6 +8,8 @@ Sub main()
frm.ShowDialog()
frm.Dispose
End Sub
......
......@@ -75,15 +75,21 @@ Implements ISSMTOOL
For Each line As TechListBenefitLine In DirectCast(from, SSMTOOL).TechList.TechLines
TechList.Add(line, feedback)
Dim newLine As New TechListBenefitLine(Me.GenInputs)
newLine.InjectFrom()
newLine.InjectFrom( line )
TechList.Add( newLine , feedback)
Next
End Sub
'Persistance Functions
Public Function Save(filePath As String) As Boolean Implements ISSMTOOL.Save
Dim returnValue As Boolean = True
Dim settings As JsonSerializerSettings = New JsonSerializerSettings()
settings.TypeNameHandling = TypeNameHandling.Objects
......@@ -196,7 +202,9 @@ End Function
'check are equal
If Not src.TechList.TechLines.First(Function(w) w.BenefitName = tl.BenefitName AndAlso w.Category = tl.Category).IsEqualTo(tl) Then
Dim testLine As ITechListBenefitLine = src.TechList.TechLines.First(Function(w) w.BenefitName = tl.BenefitName AndAlso w.Category = tl.Category)
If Not testLine.IsEqualTo(tl) Then
Return False
End If
......
This diff is collapsed.
......@@ -1036,10 +1036,7 @@ Private Sub btnSSMBSource_Click( sender As Object, e As EventArgs) Handles btnS
End If
frm.Dispose()
......
......@@ -2271,6 +2271,7 @@ Partial Class frmHVACTool
'Timer1
'
Me.Timer1.Enabled = true
Me.Timer1.Interval = 1000
'
'lblElectricalBaseW
'
......
......@@ -19,6 +19,8 @@ Public Class frmHVACTool
Private vectoFile As String = String.Empty
Private vectoPath As String = String.Empty
Private UserHitCancel As Boolean = false
Private UserHitSave As Boolean = false
'Helpers
......@@ -91,8 +93,8 @@ End Function
ssmTOOL = New SSMTOOL(ahsmFilePath,useDefaults)
originalssmTOOL = New SSMTOOL( ahsmFilePath, useDefaults)
Dim result1 As Boolean = ssmTOOL.Load(ahsmFilePath)
originalssmTOOL.Clone( ssmTOOL)
ssmTOOL.Load(ahsmFilePath)
originalssmTOOL.Load( ahsmFilePath)
setupBuses()
setupControls()
......@@ -608,6 +610,14 @@ End Function
End Function
Private Function ValidateAll() as boolean
Return Validate_GeneralInputsBC AndAlso
Validate_GeneralInputsBP AndAlso
Validate_GeneralInputsOther
End Function
'Tab Colors
Private Sub UpdateTabStatus(pageName As String, resultGood As Boolean)
......@@ -683,18 +693,39 @@ End Function
End Sub
Private Sub frmHVACTool_FormClosing( sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If UserHitCancel then return
Dim result As DialogResult
'If UserHitCancel then bail
If UserHitCancel then
DialogResult= Windows.Forms.DialogResult.Cancel
UserHitCancel=false
return
End If
'UserHitSave
If UserHitSave then
DialogResult= Windows.Forms.DialogResult.Cancel
If NOT ssmTOOL.Save(ahsmFilePath) then
MessageBox.Show("Unable to save file, aborting.")
e.Cancel=true
End If
UserHitSave=false
return
End If
'This must be a close box event. If nothing changed, then bail, otherwise ask user if they wanna save
If Not ssmTOOL.IsEqualTo( originalssmTOOL )
If Not ssmTOOL.IsEqualTo( originalssmTOOL )
result = (MessageBox.Show("Would you like to save changes before closing?","Save Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
result = (MessageBox.Show("Would you like to save changes before closing?","Save Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
Select Case result
case DialogResult.Yes:
'save
If NOT ssmTOOL.Save(ahsmFilePath) then
e.Cancel=true
End If
......@@ -703,18 +734,21 @@ End Function
'just allow the form to close
'without saving
Me.DialogResult=Windows.Forms.DialogResult.Cancel
case DialogResult.Cancel:
'cancel the close
e.Cancel = true
Me.DialogResult=Windows.Forms.DialogResult.Cancel
end select
End If
UserHitCancel=false
UserHitSave=false
End Sub
......@@ -774,7 +808,10 @@ End Function
Case "OnVehicle"
Dim onVehicle as Boolean = NOT gvTechBenefitLines.Rows( e.RowIndex).Cells( e.ColumnIndex).Value
ssmTOOL.TechList.TechLines.First( Function(x) x.BenefitName= benefit AndAlso x.Category=category).OnVehicle=onVehicle
Dim fi As TechListBenefitLine = ssmTOOL.TechList.TechLines.Find( Function(f) (f.Category= Category) AndAlso f.BenefitName= Benefit )
fi.OnVehicle= onVehicle
' ssmTOOL.TechList.TechLines.First( Function(x) x.BenefitName= benefit AndAlso x.Category=category).OnVehicle=onVehicle
BindGrid
gvTechBenefitLines.Refresh
......@@ -787,6 +824,17 @@ End Function
End If
End Sub
Private Sub gvTechBenefitLines_CurrentCellDirtyStateChanged( sender As Object, e As EventArgs) Handles gvTechBenefitLines.CurrentCellDirtyStateChanged
If gvTechBenefitLines.IsCurrentCellDirty Then
gvTechBenefitLines.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
End Sub
'Button Event Handlers
Private Sub btnUpdate_Click( sender As Object, e As EventArgs) Handles btnUpdate.Click
......@@ -824,13 +872,17 @@ End Sub
End Sub
Private Sub btnSave_Click( sender As Object, e As EventArgs) Handles btnSave.Click
If( ssmTOOL.Save( ahsmFilePath )) then
If Not ValidateAll then Return
UserHitSave=true
Me.DialogResult=Windows.Forms.DialogResult.OK
Me.Close
End If
' End If
End Sub
Private Sub btnClearForm_Click( sender As Object, e As EventArgs) Handles btnClearForm.Click
......@@ -948,6 +1000,8 @@ End Sub
'results are also available, this is mainly used for testing but could also
'be used as supporting documentation.
try
If Not ssmTOOL is nothing then
txtBasElectrical.Text = ssmTOOL.ElectricalWBase
......@@ -968,49 +1022,21 @@ End Sub
End If
End Sub
Catch Ex As SystemException
MessageBox.Show( "An unexpected error occured during the timer click recalculation.")
Private Sub gvTechBenefitLines_CurrentCellDirtyStateChanged( sender As Object, e As EventArgs) Handles gvTechBenefitLines.CurrentCellDirtyStateChanged
End Try
'If gvTechBenefitLines.SelectedRows.Count<>1 then Return
If gvTechBenefitLines.IsCurrentCellDirty Then
gvTechBenefitLines.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
End Sub
Private Sub gvTechBenefitLines_CellValueChanged( sender As Object, e As DataGridViewCellEventArgs) Handles gvTechBenefitLines.CellValueChanged
End Sub
If gvTechBenefitLines.SelectedRows.Count<>1 then Return
Dim benefit As String = gvTechBenefitLines.SelectedRows(0).Cells(1).Value
Dim category As String = gvTechBenefitLines.SelectedRows(0).Cells(0).Value
Dim feedback As String = String.Empty
Select "kkk"
Case "OnVehicle"
'Dim onVehicle as Boolean = DirectCast(gvTechBenefitLines.Rows( e.RowIndex).Cells( e.ColumnIndex).Value, DataGridViewCheckBoxCell).Value
'If ssmTOOL.TechList.TechLines.First( Function(x) x.BenefitName= benefit AndAlso x.Category=category).OnVehicle=onVehicle then
' BindGrid
'End If
end Select
End Sub
End Class
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