Skip to content

Commit

Permalink
Merge pull request #98 from IDEMSInternational/master
Browse files Browse the repository at this point in the history
Updating my master
  • Loading branch information
berylwaswa authored Aug 1, 2024
2 parents f5be8fd + ca752bd commit 0e56318
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 197 deletions.
10 changes: 4 additions & 6 deletions instat/dlgCalculator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Public Class dlgCalculator
SetDefaults()
bFirstLoad = False
End If
SetHelpOptions()
SetStructuredMenu()
ReopenDialog()
TestOKEnabled()
autoTranslate(Me)
Expand Down Expand Up @@ -75,7 +75,7 @@ Public Class dlgCalculator
bInsertColumnBefore:=ucrBase.clsRsyntax.clsBaseCommandString.bInsertColumnBefore,
bRequireCorrectLength:=ucrBase.clsRsyntax.clsBaseCommandString.bRequireCorrectLength)
ucrBase.Visible = True
SetHelpOptions()
SetStructuredMenu()
End Sub

Private Sub ReopenDialog()
Expand Down Expand Up @@ -261,10 +261,8 @@ Public Class dlgCalculator
End If
End Sub

Private Sub SetHelpOptions()
Private Sub SetStructuredMenu()
Select Case enumCalculatorMode
Case CalculatorMode.Prepare
ucrBase.iHelpTopicID = 14
Case CalculatorMode.Structured
ucrCalc.ucrInputCalOptions.SetName("Circular")
ucrBase.iHelpTopicID = 677
Expand Down Expand Up @@ -324,7 +322,7 @@ Public Class dlgCalculator
Case "Symbols"
Me.Width = iBasicWidth * 2.56
Case "Goodness of Fit"
Me.Width = iBasicWidth * 1.27
Me.Width = iBasicWidth * 1.25
ucrBase.iHelpTopicID = 717
Case "Integer"
Me.Width = iBasicWidth * 1.5
Expand Down
154 changes: 63 additions & 91 deletions instat/dlgExportClimaticDefinitions.Designer.vb

Large diffs are not rendered by default.

42 changes: 18 additions & 24 deletions instat/dlgExportClimaticDefinitions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ Public Class dlgExportClimaticDefinitions
End Sub

Private Sub InitialiseDialog()

ucrReceiverData.SetParameter(New RParameter("data", 0))
ucrReceiverData.Selector = ucrSelectorExportDefinitions
ucrReceiverData.SetParameterIsString()
ucrReceiverData.SetMeAsReceiver()
ucrReceiverData.SetItemType("dataframe")
ucrReceiverData.strSelectorHeading = "Data Sets"
ucrReceiverStation.SetParameter(New RParameter("station", 0))
ucrReceiverStation.Selector = ucrSelectorExportDefinitions
ucrReceiverStation.SetParameterIsString()
ucrReceiverStation.SetMeAsReceiver()
ucrReceiverStation.SetClimaticType("station")
ucrReceiverStation.bAutoFill = True

ucrReceiverDataYear.SetParameter(New RParameter("data_by_year", 1))
ucrReceiverDataYear.Selector = ucrSelectorExportDefinitions
Expand All @@ -71,16 +70,22 @@ Public Class dlgExportClimaticDefinitions
ucrReceiverRain.SetParameter(New RParameter("rain", 6))
ucrReceiverRain.Selector = ucrSelectorExportDefinitions
ucrReceiverRain.SetParameterIsString()
ucrReceiverRain.SetClimaticType("rain")
ucrReceiverRain.bAutoFill = True
ucrReceiverRain.SetLinkedDisplayControl(lblRain)

ucrReceiverYear.SetParameter(New RParameter("year", 7))
ucrReceiverYear.Selector = ucrSelectorExportDefinitions
ucrReceiverYear.SetParameterIsString()
ucrReceiverYear.SetClimaticType("year")
ucrReceiverYear.bAutoFill = True
ucrReceiverYear.SetLinkedDisplayControl(lblYear)

ucrReceiverMonth.SetParameter(New RParameter("month", 8))
ucrReceiverMonth.Selector = ucrSelectorExportDefinitions
ucrReceiverMonth.SetParameterIsString()
ucrReceiverMonth.SetClimaticType("month")
ucrReceiverMonth.bAutoFill = True
ucrReceiverMonth.SetLinkedDisplayControl(lblMonth)

ucrChkAnnualRainfall.SetText("Annual Rainfall")
Expand Down Expand Up @@ -112,7 +117,6 @@ Public Class dlgExportClimaticDefinitions
ucrChkIncludeSummaryData.SetValuesCheckedAndUnchecked("TRUE", "FALSE")
ucrChkIncludeSummaryData.SetRDefault("FALSE")

ucrInputStationID.SetParameter(New RParameter("station_id", 18))
ucrInputDefinitionsID.SetParameter(New RParameter("definitions_id", 19))
ucrInputCountry.SetParameter(New RParameter("country", 20))

Expand Down Expand Up @@ -176,7 +180,7 @@ Public Class dlgExportClimaticDefinitions

Private Sub SetRCodeForControls(bReset As Boolean)
ucrReceiverCropData.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrReceiverData.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrReceiverStation.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrReceiverDataYear.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrReceiverDataYearMonth.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrReceiverMonth.SetRCode(clsExportRinstatToBucketFunction, bReset)
Expand All @@ -185,7 +189,6 @@ Public Class dlgExportClimaticDefinitions
ucrSelectorExportDefinitions.SetRCode(clsExportRinstatToBucketFunction)
ucrInputTokenPath.SetRCode(ClsGcsAuthFileFunction, bReset)

ucrInputStationID.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrInputDefinitionsID.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrInputCountry.SetRCode(clsExportRinstatToBucketFunction, bReset)
ucrChkIncludeSummaryData.SetRCode(clsExportRinstatToBucketFunction, bReset)
Expand All @@ -202,10 +205,9 @@ Public Class dlgExportClimaticDefinitions
End Sub

Private Sub TestOkEnabled()
If Not ucrReceiverData.IsEmpty AndAlso
If Not ucrReceiverStation.IsEmpty AndAlso
Not ucrReceiverYear.IsEmpty AndAlso
Not ucrInputCountry.IsEmpty AndAlso
Not ucrInputStationID.IsEmpty AndAlso
Not ucrInputDefinitionsID.IsEmpty AndAlso
Not ucrInputTokenPath.IsEmpty Then

Expand Down Expand Up @@ -325,14 +327,6 @@ Public Class dlgExportClimaticDefinitions
End If
End Sub

Private Sub ucrInputStationID_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputStationID.ControlValueChanged
If Not ucrInputStationID.IsEmpty Then
clsExportRinstatToBucketFunction.AddParameter("station_id", Chr(34) & ucrInputStationID.GetText & Chr(34), iPosition:=18)
Else
clsExportRinstatToBucketFunction.RemoveParameterByName("station_id")
End If
End Sub

Private Sub ucrInputDefinitionsID_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputDefinitionsID.ControlValueChanged
If Not ucrInputDefinitionsID.IsEmpty Then
clsExportRinstatToBucketFunction.AddParameter("definitions_id", Chr(34) & ucrInputDefinitionsID.GetText & Chr(34), iPosition:=19)
Expand Down Expand Up @@ -367,13 +361,13 @@ Public Class dlgExportClimaticDefinitions

End Sub

Private Sub ucrReceiverData_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverData.ControlContentsChanged, ucrReceiverRain.ControlContentsChanged, ucrReceiverCropData.ControlContentsChanged, ucrReceiverDataYearMonth.ControlContentsChanged, ucrReceiverDataYear.ControlContentsChanged,
ucrReceiverMonth.ControlContentsChanged, ucrReceiverYear.ControlContentsChanged, ucrChkSeasonStartProp.ControlContentsChanged, ucrInputCountry.ControlContentsChanged, ucrInputStationID.ControlContentsChanged, ucrInputDefinitionsID.ControlContentsChanged, ucrChkIncludeSummaryData.ControlContentsChanged,
Private Sub ucrReceiverData_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverRain.ControlContentsChanged, ucrReceiverCropData.ControlContentsChanged, ucrReceiverDataYearMonth.ControlContentsChanged, ucrReceiverDataYear.ControlContentsChanged, ucrReceiverStation.ControlContentsChanged,
ucrReceiverMonth.ControlContentsChanged, ucrReceiverYear.ControlContentsChanged, ucrChkSeasonStartProp.ControlContentsChanged, ucrInputCountry.ControlContentsChanged, ucrInputDefinitionsID.ControlContentsChanged, ucrChkIncludeSummaryData.ControlContentsChanged,
ucrChkMonthlyTemp.ControlContentsChanged, ucrChkCropSuccessProp.ControlContentsChanged, ucrChkAnnualTemp.ControlContentsChanged, ucrChkAnnualRainfall.ControlContentsChanged, ucrInputTokenPath.ControlContentsChanged, ucrSelectorExportDefinitions.ControlContentsChanged
TestOkEnabled()
End Sub

Private Sub ucrReceiverData_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverData.ControlValueChanged
ucrReceiverData.SetMeAsReceiver()
Private Sub ucrSelectorExportDefinitions_DataFrameChanged() Handles ucrSelectorExportDefinitions.DataFrameChanged
TestOkEnabled()
End Sub
End Class
12 changes: 8 additions & 4 deletions instat/dlgInventoryPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ Public Class dlgInventoryPlot
SetDefaults()
SetRCodeForControls(True)
TestOkEnabled()

End Sub

Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged
Expand All @@ -335,6 +334,7 @@ Public Class dlgInventoryPlot
clsInventoryPlot.iCallType = 3
clsInventoryPlot.bExcludeAssignedFunctionOutput = False
End If
AddClimateMissingFunction()
End Sub

Private Sub AddOrRemoveKeyFunctions()
Expand All @@ -347,13 +347,17 @@ Public Class dlgInventoryPlot
End If
End Sub

Private Sub ucrChkSummary_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSummary.ControlValueChanged
If ucrChkSummary.Checked Then
Private Sub AddClimateMissingFunction()
If rdoMissing.Checked AndAlso ucrChkSummary.Checked Then
ucrBase.clsRsyntax.AddToAfterCodes(clsClimaticMissing, iPosition:=1)
clsClimaticMissing.iCallType = 2
Else
ucrBase.clsRsyntax.RemoveFromAfterCodes(clsClimaticMissing)
End If
End If
End Sub

Private Sub ucrChkSummary_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSummary.ControlValueChanged, ucrChkOmitEnd.ControlValueChanged, ucrChkOmitStart.ControlValueChanged
AddClimateMissingFunction()
AddOrRemoveKeyFunctions()
End Sub

Expand Down
Loading

0 comments on commit 0e56318

Please sign in to comment.