@@ -41,8 +41,7 @@ Public Module CookieCutterGraphs
4141 Dim lLocations As New atcCollection
4242 Dim lScenarioResults As New atcDataSource
4343
44- Dim lWDMDataSource As atcDataSource
45-
44+ Dim lWDMDataSource As New atcDataSource
4645
4746 For i As Integer = 0 To aHSPFUCI.FilesBlock.Count
4847 If aHSPFUCI.FilesBlock.Value(i).Typ = "BINO" Then
@@ -80,7 +79,7 @@ Public Module CookieCutterGraphs
8079 Dim lTimeSeries As atcTimeseries = Nothing
8180 Dim lFoundTheTimeSeriesinWDMFile As Boolean = False
8281
83- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "PLANK" , "BALCLA" , 4 , 1 , lFoundTheTimeSeriesinWDMFile)
82+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "PLANK" , "BALCLA" , 4 , 1 , lFoundTheTimeSeriesinWDMFile)
8483
8584 If lFoundTheTimeSeriesinWDMFile = False Then
8685 'Reading the required time series from Binary file and resetting the flag to false
@@ -97,7 +96,7 @@ Public Module CookieCutterGraphs
9796 lTimeseriesGroup.Add(lTimeSeries)
9897 End If
9998
100- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "PLANK" , "PHYCLA" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
99+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "PLANK" , "PHYCLA" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
101100
102101 If lFoundTheTimeSeriesinWDMFile = False Then
103102 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "PHYCLA" )( 0 )
@@ -112,7 +111,7 @@ Public Module CookieCutterGraphs
112111 lTimeseriesGroup.Add(lTimeSeries)
113112 End If
114113
115- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "NUTRX" , "DNUST" , 4 , 1 , lFoundTheTimeSeriesinWDMFile)
114+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "NUTRX" , "DNUST" , 4 , 1 , lFoundTheTimeSeriesinWDMFile)
116115 If lFoundTheTimeSeriesinWDMFile = False Then
117116 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "PO4-CONCDIS" )( 0 )
118117
@@ -127,7 +126,7 @@ Public Module CookieCutterGraphs
127126 lTimeseriesGroup.Add(lTimeSeries)
128127 End If
129128
130- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "NUTRX" , "DNUST" , 2 , 1 , lFoundTheTimeSeriesinWDMFile)
129+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "NUTRX" , "DNUST" , 2 , 1 , lFoundTheTimeSeriesinWDMFile)
131130 If lFoundTheTimeSeriesinWDMFile = False Then
132131 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "TAM-CONCDIS" )( 0 )
133132 End If
@@ -141,7 +140,7 @@ Public Module CookieCutterGraphs
141140 lTimeseriesGroup.Add(lTimeSeries)
142141 End If
143142
144- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "NUTRX" , "DNUST" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
143+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "NUTRX" , "DNUST" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
145144 If lFoundTheTimeSeriesinWDMFile = False Then
146145 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "NO3-CONCDIS" )( 0 )
147146 End If
@@ -215,7 +214,7 @@ Public Module CookieCutterGraphs
215214# Region "Plotting TSS Curve"
216215
217216 lTimeseriesGroup = New atcTimeseriesGroup
218- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "HYDR" , "RO" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
217+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "HYDR" , "RO" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
219218 If lFoundTheTimeSeriesinWDMFile = False Then
220219 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "RO" )( 0 )
221220 End If
@@ -229,7 +228,7 @@ Public Module CookieCutterGraphs
229228 lTimeseriesGroup.Add(lTimeSeries)
230229 End If
231230
232- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "SEDTRN" , "SSED" , 4 , 1 , lFoundTheTimeSeriesinWDMFile)
231+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "SEDTRN" , "SSED" , 4 , 1 , lFoundTheTimeSeriesinWDMFile)
233232
234233 If lFoundTheTimeSeriesinWDMFile = False Then
235234 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "SSED-TOT" )( 0 )
@@ -244,7 +243,7 @@ Public Module CookieCutterGraphs
244243 lTimeSeries.Attributes.SetValue( "YAxis" , "Left" )
245244 lTimeseriesGroup.Add(lTimeSeries)
246245 End If
247- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "SEDTRN" , "BEDDEP" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
246+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "SEDTRN" , "BEDDEP" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
248247 If lFoundTheTimeSeriesinWDMFile = False Then
249248 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "BEDDEP" )( 0 )
250249 End If
@@ -299,7 +298,7 @@ Public Module CookieCutterGraphs
299298 Dim lTimeseriesGroupDO As New atcTimeseriesGroup
300299 Dim lTimeSeriesDO As New atcTimeseries( Nothing )
301300 Dim lTimeSeriesTimeUnit As Integer
302- lTimeSeriesDO = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "OXRX" , "DOX" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
301+ lTimeSeriesDO = LocateTheTimeSeries(aHSPFUCI, lRchId, "OXRX" , "DOX" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
303302
304303 If lFoundTheTimeSeriesinWDMFile = False OrElse lTimeSeriesTimeUnit < 3 Then
305304 lTimeSeriesDO = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "DOXCONC" )( 0 )
@@ -404,7 +403,7 @@ Public Module CookieCutterGraphs
404403
405404
406405 lTimeseriesGroup = New atcTimeseriesGroup
407- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "HYDR" , "IVOL" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
406+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "HYDR" , "IVOL" , 1 , 1 , lFoundTheTimeSeriesinWDMFile)
408407 If lFoundTheTimeSeriesinWDMFile = False Then
409408 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "IVOL" )( 0 )
410409 End If
@@ -418,7 +417,7 @@ Public Module CookieCutterGraphs
418417 lTimeseriesGroup.Add(lTimeSeries)
419418 End If
420419 End If
421- lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "PLANK" , "TPKIF" , 5 , 1 , lFoundTheTimeSeriesinWDMFile)
420+ lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "PLANK" , "TPKIF" , 5 , 1 , lFoundTheTimeSeriesinWDMFile)
422421 If lFoundTheTimeSeriesinWDMFile = False Then
423422 lTimeSeries = lScenarioResults.DataSets.FindData( "Location" , RCHRES).FindData( "Constituent" , "P-TOT-IN" )( 0 )
424423 End If
@@ -460,7 +459,7 @@ Public Module CookieCutterGraphs
460459 Logger.Dbg( "Generated graph " & lOutputFolder & "LoadDurationTP_RCHRES_" & lRchId & ".png" )
461460 End If
462461
463- End If
462+ End If
464463
465464
466465
@@ -482,10 +481,11 @@ Public Module CookieCutterGraphs
482481 'Dim lRCH As HspfOperation
483482
484483 End Sub
485- Private Function LocateTheTimeSeries( ByRef aDataSource As atcDataSource, ByVal aHSPFUCI As HspfUci,
484+ Friend Function LocateTheTimeSeries( ByVal aHSPFUCI As HspfUci,
486485 ByVal aRCHId As Integer , ByVal aGroupName As String ,
487486 ByVal aMemberName As String , ByVal aMemSub1 As Integer ,
488- ByVal aMemSub2 As Integer , ByRef aFoundTheTS As Boolean )
487+ ByVal aMemSub2 As Integer , ByRef aFoundTheTS As Boolean ) As atcTimeseries
488+ Dim lDataSource As New atcDataSource
489489 Dim aTimeSeries As atcTimeseries = Nothing
490490 aFoundTheTS = False
491491 Dim lDataID As Integer = 0
@@ -498,10 +498,10 @@ Public Module CookieCutterGraphs
498498 For i As Integer = 0 To aHSPFUCI.FilesBlock.Count
499499 If aHSPFUCI.FilesBlock.Value(i).Typ = lconnection.Target.VolName Then
500500 Dim lFileName As String = AbsolutePath(aHSPFUCI.FilesBlock.Value(i).Name.Trim, CurDir())
501- aDataSource = atcDataManager.DataSourceBySpecification(lFileName)
502- If aDataSource Is Nothing Then
501+ lDataSource = atcDataManager.DataSourceBySpecification(lFileName)
502+ If lDataSource Is Nothing Then
503503 If atcDataManager.OpenDataSource(lFileName) Then
504- aDataSource = atcDataManager.DataSourceBySpecification(lFileName)
504+ lDataSource = atcDataManager.DataSourceBySpecification(lFileName)
505505 End If
506506 End If
507507 Exit For
@@ -512,7 +512,7 @@ Public Module CookieCutterGraphs
512512 End If
513513 Next lconnection
514514 If lDataID > 0 Then
515- aTimeSeries = aDataSource .DataSets.FindData("ID" , lDataID)( 0 )
515+ aTimeSeries = lDataSource .DataSets.FindData("ID" , lDataID)( 0 )
516516 aFoundTheTS = True
517517 End If
518518
0 commit comments