Skip to content

Commit

Permalink
HSPEXP -- updates for coding conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDudaRESPEC committed Jan 21, 2021
1 parent c3f829e commit 35ae999
Show file tree
Hide file tree
Showing 6 changed files with 1,148 additions and 1,153 deletions.
182 changes: 91 additions & 91 deletions HSPEXP/BATHTUB.vb

Large diffs are not rendered by default.

164 changes: 82 additions & 82 deletions HSPEXP/CookieCutterGraphs.vb

Large diffs are not rendered by default.

895 changes: 448 additions & 447 deletions HSPEXP/HSPFOutputReports.vb

Large diffs are not rendered by default.

962 changes: 480 additions & 482 deletions HSPEXP/MultiSimulatioManager.vb

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions HSPEXP/StartUp.vb
Original file line number Diff line number Diff line change
Expand Up @@ -212,28 +212,28 @@ Public Class StartUp

Private Sub StartUp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim WinHspfLtDir As String = PathNameOnly(Reflection.Assembly.GetEntryAssembly.Location) & g_PathChar & "WinHSPFLt"
Logger.Dbg("Located WinHSPFLt at " & WinHspfLtDir)
Dim lWinHspfLtDir As String = PathNameOnly(Reflection.Assembly.GetEntryAssembly.Location) & g_PathChar & "WinHSPFLt"
Logger.Dbg("Located WinHSPFLt at " & lWinHspfLtDir)
Try
'Set Environmental Variable
Dim lEnvPath As String = Environment.GetEnvironmentVariable("PATH")
If Not lEnvPath.ToLowerInvariant.Contains(WinHspfLtDir.ToLowerInvariant) Then
System.Environment.SetEnvironmentVariable("PATH", WinHspfLtDir & ";" & lEnvPath)
If Not lEnvPath.ToLowerInvariant.Contains(lWinHspfLtDir.ToLowerInvariant) Then
System.Environment.SetEnvironmentVariable("PATH", lWinHspfLtDir & ";" & lEnvPath)
End If
Catch exSetEnv As Exception
Logger.Dbg("Could not add WinHspfLtDir to PATH " & exSetEnv.Message)
End Try
Try
Dim lHassentPath As String = IO.Path.Combine(WinHspfLtDir, "hass_ent.dll")
Dim lHassentPath As String = IO.Path.Combine(lWinHspfLtDir, "hass_ent.dll")
If LoadLibraryEx(lHassentPath, IntPtr.Zero, LoadLibraryFlags.LOAD_WITH_ALTERED_SEARCH_PATH) = 0 Then
Logger.Msg("Missing HSPF Library at install location:" & vbCrLf & lHassentPath)
End
End If
Catch ex As Exception
End Try

HSPFOutputReports.pHSPFExe = IO.Path.Combine(WinHspfLtDir, "WinHspfLt.exe")
atcWDM.atcDataSourceWDM.HSPFMsgFilename = IO.Path.Combine(WinHspfLtDir, "hspfmsg.wdm")
HSPFOutputReports.pHSPFExe = IO.Path.Combine(lWinHspfLtDir, "WinHspfLt.exe")
atcWDM.atcDataSourceWDM.HSPFMsgFilename = IO.Path.Combine(lWinHspfLtDir, "hspfmsg.wdm")

Logger.Dbg(Now & " Attempting to open hspfmsg.wdm")
pHspfMsg = New atcUCI.HspfMsg
Expand Down Expand Up @@ -347,9 +347,6 @@ Public Class StartUp
chkWASP.Enabled = True
chkBathtub.Enabled = True
End If



End Sub

' Reset all the controls to the user's default Control color.
Expand Down
81 changes: 40 additions & 41 deletions HSPEXP/modListUCIParameters.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,114 +8,113 @@ Public Module modListUCIParameters
Private pIMPLND As atcCollection
Private pRCHRES As atcCollection
Private pBlockDefs As HspfBlockDefs
Sub ListReachParameters(ByVal aHSPFUCI As HspfUci, ByVal lOutputFolder As String)
Sub ListReachParameters(ByVal aHSPFUCI As HspfUci, ByVal aOutputFolder As String)
pPERLND = New atcCollection
pIMPLND = New atcCollection
pRCHRES = New atcCollection
Dim s As String = ""
Dim ModelName As String = IO.Path.GetFileNameWithoutExtension(aHSPFUCI.Name)
Dim ParameterList As System.IO.StreamWriter
Dim NumberOfReaches As Integer = 0
ParameterList = My.Computer.FileSystem.OpenTextFileWriter(lOutputFolder & "\" & ModelName & "_RCHRES_ParameterList.txt", False)
ParameterList.WriteLine("Parameter list for " & ModelName)

Dim lModelName As String = IO.Path.GetFileNameWithoutExtension(aHSPFUCI.Name)
Dim lParameterList As System.IO.StreamWriter
Dim lNumberOfReaches As Integer = 0
lParameterList = My.Computer.FileSystem.OpenTextFileWriter(aOutputFolder & "\" & lModelName & "_RCHRES_ParameterList.txt", False)
lParameterList.WriteLine("Parameter list for " & lModelName)

For Each lOperation As HspfOperation In aHSPFUCI.OpnSeqBlock.Opns
If lOperation.Name = "RCHRES" AndAlso Not pRCHRES.Contains(lOperation.Id) Then
pRCHRES.Add(lOperation.Id)
NumberOfReaches += 1
lNumberOfReaches += 1
End If
Next

ParameterList.WriteLine("Number Of Reaches in the UCI File = " & NumberOfReaches)
ParameterList.WriteLine("OperationType, OperationID, TableName, TableOccurrence, PrameterName, ParameterValue")
lParameterList.WriteLine("Number Of Reaches in the UCI File = " & lNumberOfReaches)
lParameterList.WriteLine("OperationType, OperationID, TableName, TableOccurrence, PrameterName, ParameterValue")

For Each lOperation As HspfOperation In aHSPFUCI.OpnSeqBlock.Opns
If lOperation.Name = "RCHRES" Then
For Each lTable As HspfTable In lOperation.Tables
For Each lparm As HspfParm In lTable.Parms
ParameterList.WriteLine(lOperation.Name & ", " & lOperation.Id & ", " & lTable.Name & ", " &
lParameterList.WriteLine(lOperation.Name & ", " & lOperation.Id & ", " & lTable.Name & ", " &
lTable.OccurIndex & ", " & lparm.Name & ", " & lparm.Value)
Next
Next
End If
Next

ParameterList.Close()

lParameterList.Close()

End Sub
Sub ListPERLNDParameters(ByVal aHSPFUCI As HspfUci, ByVal lOutputFolder As String)

Sub ListPERLNDParameters(ByVal aHSPFUCI As HspfUci, ByVal aOutputFolder As String)
pPERLND = New atcCollection
pIMPLND = New atcCollection
pRCHRES = New atcCollection
Dim s As String = ""
Dim ModelName As String = IO.Path.GetFileNameWithoutExtension(aHSPFUCI.Name)
Dim ParameterList As System.IO.StreamWriter
Dim NumberOfPERLNDOperations As Integer = 0
ParameterList = My.Computer.FileSystem.OpenTextFileWriter(lOutputFolder & "\" & ModelName & "_PERLND_ParameterList.txt", False)
ParameterList.WriteLine("Parameter list for " & ModelName)

Dim lModelName As String = IO.Path.GetFileNameWithoutExtension(aHSPFUCI.Name)
Dim lParameterList As System.IO.StreamWriter
Dim lNumberOfPERLNDOperations As Integer = 0
lParameterList = My.Computer.FileSystem.OpenTextFileWriter(aOutputFolder & "\" & lModelName & "_PERLND_ParameterList.txt", False)
lParameterList.WriteLine("Parameter list for " & lModelName)

For Each lOperation As HspfOperation In aHSPFUCI.OpnSeqBlock.Opns
If lOperation.Name = "PERLND" AndAlso Not pRCHRES.Contains(lOperation.Id) Then
pRCHRES.Add(lOperation.Id)
NumberOfPERLNDOperations += 1
lNumberOfPERLNDOperations += 1
End If
Next

ParameterList.WriteLine("Number Of PERLND Operations in the UCI File = " & NumberOfPERLNDOperations)
ParameterList.WriteLine("OperationType, OperationID, TableName, Table Occurrence Number, Table Occurrence Count, ParameterName, ParameterValue")
lParameterList.WriteLine("Number Of PERLND Operations in the UCI File = " & lNumberOfPERLNDOperations)
lParameterList.WriteLine("OperationType, OperationID, TableName, Table Occurrence Number, Table Occurrence Count, ParameterName, ParameterValue")

For Each lOperation As HspfOperation In aHSPFUCI.OpnSeqBlock.Opns
If lOperation.Name = "PERLND" Then
For Each lTable As HspfTable In lOperation.Tables
For Each lparm As HspfParm In lTable.Parms
For Each lParm As HspfParm In lTable.Parms
'If lparm.Value.Contains("ORTHO") Then Stop
'If lTable.OccurIndex > 1 Then Stop
ParameterList.WriteLine(lOperation.Name & ", " & lOperation.Id & ", " &
lTable.Name & "," & lTable.OccurNum & ", " & lTable.OccurCount & ", " & lparm.Name & ", " & lparm.Value)
lParameterList.WriteLine(lOperation.Name & ", " & lOperation.Id & ", " &
lTable.Name & "," & lTable.OccurNum & ", " & lTable.OccurCount & ", " & lParm.Name & ", " & lParm.Value)
Next
Next
End If
Next

ParameterList.Close()

lParameterList.Close()

End Sub
Sub ListIMPLNDParameters(ByVal aHSPFUCI As HspfUci, ByVal lOutputFolder As String)

Sub ListIMPLNDParameters(ByVal aHSPFUCI As HspfUci, ByVal aOutputFolder As String)
pPERLND = New atcCollection
pIMPLND = New atcCollection
pRCHRES = New atcCollection
Dim s As String = ""
Dim ModelName As String = IO.Path.GetFileNameWithoutExtension(aHSPFUCI.Name)
Dim ParameterList As System.IO.StreamWriter
Dim NumberOfReaches As Integer = 0
ParameterList = My.Computer.FileSystem.OpenTextFileWriter(lOutputFolder & "\" & ModelName & "_IMPLND_ParameterList.txt", False)
ParameterList.WriteLine("Parameter list for " & ModelName)

Dim lModelName As String = IO.Path.GetFileNameWithoutExtension(aHSPFUCI.Name)
Dim lParameterList As System.IO.StreamWriter
Dim lNumberOfReaches As Integer = 0
lParameterList = My.Computer.FileSystem.OpenTextFileWriter(aOutputFolder & "\" & lModelName & "_IMPLND_ParameterList.txt", False)
lParameterList.WriteLine("Parameter list for " & lModelName)

For Each lOperation As HspfOperation In aHSPFUCI.OpnSeqBlock.Opns
If lOperation.Name = "IMPLND" AndAlso Not pRCHRES.Contains(lOperation.Id) Then
pRCHRES.Add(lOperation.Id)
NumberOfReaches += 1
lNumberOfReaches += 1
End If
Next

ParameterList.WriteLine("Number Of IMPLND Operations in the UCI File = " & NumberOfReaches)
ParameterList.WriteLine("OperationType, OperationID, TableName, Table Occurrence Number, Table Occurrence Count, ParameterName, ParameterValue")
lParameterList.WriteLine("Number Of IMPLND Operations in the UCI File = " & lNumberOfReaches)
lParameterList.WriteLine("OperationType, OperationID, TableName, Table Occurrence Number, Table Occurrence Count, ParameterName, ParameterValue")

For Each lOperation As HspfOperation In aHSPFUCI.OpnSeqBlock.Opns
If lOperation.Name = "IMPLND" Then
For Each lTable As HspfTable In lOperation.Tables
For Each lparm As HspfParm In lTable.Parms
ParameterList.WriteLine(lOperation.Name & ", " & lOperation.Id & ", " &
lParameterList.WriteLine(lOperation.Name & ", " & lOperation.Id & ", " &
lTable.Name & "," & lTable.OccurNum & ", " & lTable.OccurCount & ", " & lparm.Name & ", " & lparm.Value)
Next
Next
End If
Next

ParameterList.Close()

lParameterList.Close()

End Sub

Expand Down

0 comments on commit 35ae999

Please sign in to comment.