Skip to content

Commit ffd51e8

Browse files
HSPEXP/HSPFOutputReports.vb, StartUp.vb
atcHspfSupport/atcHspfConstituentBudget.vb draft enhancement to allow reports for only specified months
1 parent faa0a5f commit ffd51e8

4 files changed

Lines changed: 162 additions & 44 deletions

File tree

HSPEXP/HSPFOutputReports.vb

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Module HSPFOutputReports
2727
Private pRunUci As Boolean = False 'Anurag added this option if the user wants this program to run the uci as well
2828
Private pModelQAQC As Boolean = False
2929
Private pSDateJ, pEDateJ As Double
30+
Private pSeasonStartMonth, pSeasonEndMonth As Integer 'for load allocation reports
3031
Private pOutFolderName As String
3132
Private pMultiSimulation As Boolean = False
3233
Private pAdditionalGraphs As Boolean = False
@@ -158,6 +159,8 @@ Module HSPFOutputReports
158159
Using lProgress As New ProgressLevel
159160
pSDateJ = StartUp.DateTimePicker1.Value.ToOADate()
160161
pEDateJ = StartUp.DateTimePicker2.Value.ToOADate() + 1
162+
pSeasonStartMonth = StartUp.cboStartMonth.SelectedIndex + 1 'for load allocation reports
163+
pSeasonEndMonth = StartUp.cboEndMonth.SelectedIndex + 1
161164

162165
'get echo file name from files block
163166
Dim lHspfEchoFileName As String = pTestPath & "hspfecho.out" 'Get the default name of echo file
@@ -683,8 +686,33 @@ Module HSPFOutputReports
683686
Dim lReport7LoadingRates As New atcReport.ReportText
684687
Dim lDataForBarGraphs As New atcCollection
685688

689+
'pbd season handling here
690+
Dim lSeasonStartMonth As Integer = pSeasonStartMonth
691+
Dim lSeasonEndMonth As Integer = pSeasonEndMonth
692+
Dim lSeasonsLabel As String = ""
693+
Dim lSeasonScenarioResults As New atcDataSource
694+
Dim lSeasons As New atcSeasonsYearSubset(lSeasonStartMonth, 1, lSeasonEndMonth, 31)
695+
Dim lSeasonsMonth As New atcSeasonsMonth()
696+
Dim lSeasonFrac As Double = 0.0
697+
For lMon As Integer = lSeasonStartMonth To lSeasonEndMonth
698+
lSeasonFrac += lSeasonsMonth.SeasonYearFraction(lMon)
699+
Next
700+
lSeasons.SeasonSelected(0) = False 'outside
701+
lSeasons.SeasonSelected(1) = True 'inside
702+
If lSeasonStartMonth <> 1 Or lSeasonEndMonth <> 12 Then
703+
lSeasonsLabel = "for months " & MonthName(lSeasonStartMonth) & " thru " & MonthName(lSeasonEndMonth)
704+
For Each lTimeseries As atcTimeseries In lScenarioResults.DataSets
705+
Dim lSplitTS As atcTimeseriesGroup = lSeasons.Split(lTimeseries, Nothing)
706+
lSplitTS(1) = lSplitTS(1) * lSeasonFrac
707+
lSeasonScenarioResults.AddDataSet(lSplitTS(1))
708+
Next
709+
Else
710+
lSeasonScenarioResults = lScenarioResults
711+
End If
712+
686713
HspfSupport.ConstituentBudget.Report(aHspfUci, lConstituent, aOperationTypes, pBaseName,
687-
lScenarioResults, pOutputLocations, aRunMade, pSDateJ, pEDateJ, lConstProperties,
714+
lSeasonScenarioResults, pOutputLocations, aRunMade,
715+
pSDateJ, pEDateJ, lConstProperties, lSeasonsLabel,
688716
lReport1ReachBudget,
689717
lReport2NPSLoads,
690718
lReport3LoadAllocationAll,

HSPEXP/StartUp.Designer.vb

Lines changed: 81 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HSPEXP/StartUp.vb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ Public Class StartUp
259259
cmbUCIPath.Items.Add(lUCI)
260260
cmbUCIPath.SelectedIndex = 0
261261
End If
262+
cboStartMonth.SelectedIndex = 0
263+
cboEndMonth.SelectedIndex = 11
262264
'UciChanged()
263265
End Sub
264266

@@ -481,4 +483,5 @@ Public Class StartUp
481483
Private Sub chkAreaReports_CheckedChanged(sender As Object, e As EventArgs)
482484

483485
End Sub
486+
484487
End Class

0 commit comments

Comments
 (0)