Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/respec/BASINS
Browse files Browse the repository at this point in the history
  • Loading branch information
mishranurag committed May 26, 2017
2 parents 01599f7 + 01fbac7 commit 023d8eb
Show file tree
Hide file tree
Showing 3 changed files with 343 additions and 91 deletions.
37 changes: 32 additions & 5 deletions HSPFSimulationManager/frmAddConnection.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
Imports MapWinUtility

Public Class frmAddConnection

Private pIcon As clsIcon
Friend Schematic As ctlSchematic
Private pUpUCI As atcUCI.HspfUci
Private pDownUCI As atcUCI.HspfUci

Public Sub SetUCIs(aUpUCI As atcUCI.HspfUci, aDownUCI As atcUCI.HspfUci)
pUpUCI = aUpUCI
pDownUCI = aDownUCI
lblUpstream.Text = "Upstream UCI: " & IO.Path.GetFileName(aUpUCI.Name)
lblDownstream.Text = "Downstream UCI: " & IO.Path.GetFileName(aDownUCI.Name)
cboUpstream.Items.Clear()
Expand All @@ -22,8 +23,34 @@ Public Class frmAddConnection
End Sub

Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click


'connect these 2 reaches
Dim lUp As Integer = Int(cboUpstream.SelectedItem)
Dim lDown As Integer = Int(cboDownstream.SelectedItem)
'prompt for name of transfer wdm
Dim lTransferWDMName As String = ""
Dim lFileDialog As New Windows.Forms.OpenFileDialog()
With lFileDialog
.Title = "Transfer WDM Name"
If IO.File.Exists("transfer.wdm") Then
.FileName = "transfer.wdm"
End If
.Filter = "WDM Files (*.wdm) | *.wdm"
.FilterIndex = 0
.DefaultExt = "wdm"
.CheckFileExists = False
If .ShowDialog(Me) = DialogResult.OK Then
lTransferWDMName = .FileName
End If
End With
If lTransferWDMName.Length > 0 Then
Me.Cursor = Cursors.WaitCursor
AddReachConnections(lTransferWDMName, pUpUCI, lUp, pDownUCI, lDown)
FileCopy(pUpUCI.Name, pUpUCI.Name & "Save")
pUpUCI.Save()
FileCopy(pDownUCI.Name, pDownUCI.Name & "Save")
pDownUCI.Save()
Me.Cursor = Cursors.Default
End If
Me.Close()
End Sub

Expand Down
8 changes: 6 additions & 2 deletions HSPFSimulationManager/frmHspfSimulationManager.vb
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,19 @@ Public Class frmHspfSimulationManager
End With
If lTransferWDMName.Length > 0 Then
'Change Connections To Use Transfer WDM
Me.Cursor = Cursors.WaitCursor
ConnectionsToTransferWDM(lTransferWDMName, lUCIs)
'Remove unused WDMs from Files Blocks
RemoveUnusedWDMs(lUCIs)
'Add transfer WDM to Files Blocks
AddTransferWDMtoFilesBlock(lTransferWDMName, lUCIs)
For Each lUCI As HspfUci In lUCIs
'Add transfer WDM to Files Blocks
AddTransferWDMtoFilesBlock(lUCI, lTransferWDMName)
Next
For Each lUCI As HspfUci In lUCIs
FileCopy(lUCI.Name, lUCI.Name & "Save")
lUCI.Save()
Next
Me.Cursor = Cursors.Default
End If
End If
End If
Expand Down
Loading

0 comments on commit 023d8eb

Please sign in to comment.