Skip to content

Commit

Permalink
Merge pull request #482 from IDEMSInternational/master
Browse files Browse the repository at this point in the history
Updated my master
  • Loading branch information
conlooptechnologies authored May 7, 2024
2 parents 01452f3 + 79c0c21 commit 9ad3532
Show file tree
Hide file tree
Showing 7 changed files with 955 additions and 938 deletions.
4 changes: 2 additions & 2 deletions instat/dlgEvapotranspiration.vb
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ Public Class dlgEvapotranspiration
clsListFunction.AddParameter("sigma", 4.903 * 10 ^ -9, iPosition:=5)
clsListFunction.AddParameter("z", 2, iPosition:=4)
clsListFunction.AddParameter("G", 0, iPosition:=6)
clsListFunction.AddParameter("as", 0.25, iPosition:=7)
clsListFunction.AddParameter("as", 0.23, iPosition:=7)
clsListFunction.AddParameter("bs", 0.5, iPosition:=8)
clsListFunction.AddParameter("lambda", 2.45, iPosition:=1)
clsListFunction.AddParameter("Gsc", 0.082, iPosition:=3)
Expand All @@ -522,7 +522,7 @@ Public Class dlgEvapotranspiration
clsListFunction.AddParameter("Gsc", 0.082, iPosition:=3)
clsListFunction.AddParameter("sigma", 4.903 * 10 ^ -9, iPosition:=5)
clsListFunction.AddParameter("G", 0, iPosition:=6)
clsListFunction.AddParameter("as", 0.25, iPosition:=7)
clsListFunction.AddParameter("as", 0.23, iPosition:=7)
clsListFunction.AddParameter("bs", 0.5, iPosition:=8)
clsListFunction.AddParameter("alphaPT", 1.26, iPosition:=9)
clsListFunction.RemoveParameterByName("z")
Expand Down
35 changes: 24 additions & 11 deletions instat/dlgRandomSplit.vb
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ Public Class dlgRandomSplit
clsTesting.SetPackageName("rsample")
clsTesting.SetRCommand("testing")
ucrBase.clsRsyntax.SetBaseRFunction(clsInitialSplit)
ucrBase.clsRsyntax.AddToAfterCodes(clsTesting, 0)
ucrBase.clsRsyntax.AddToAfterCodes(clsTraining, 1)

End Sub

Private Sub SetRCodeForControls(bReset As Boolean)
Expand All @@ -153,7 +152,7 @@ Public Class dlgRandomSplit
ucrChkStratifyingFactor.SetRCode(clsInitialSplit, bReset)

If bReset Then
ucrChkTest.SetRCode(clsInitialSplit, bReset)
ucrChkTest.SetRCode(clsTesting, bReset)
End If
End Sub

Expand Down Expand Up @@ -190,24 +189,35 @@ Public Class dlgRandomSplit
Private Sub SetBaseFunction()
ucrBase.clsRsyntax.ClearCodes()
If rdoSample.Checked Then
If ucrSaveTestingData.IsComplete Then
clsTesting.AddParameter("x", clsRFunctionParameter:=clsInitialSplit)
If ucrChkTest.Checked AndAlso ucrSaveTestingData.IsComplete Then
clsTesting.AddParameter("x", "rsample")
ucrBase.clsRsyntax.AddToAfterCodes(clsTesting, 0)
Else
ucrBase.clsRsyntax.RemoveFromAfterCodes(clsTesting)
End If
If ucrSaveTrainingData.IsComplete Then
clsTraining.AddParameter("x", clsRFunctionParameter:=clsInitialSplit)
clsTraining.AddParameter("x", "rsample")
ucrBase.clsRsyntax.AddToAfterCodes(clsTraining, 1)
Else
ucrBase.clsRsyntax.RemoveFromAfterCodes(clsTraining)
End If
ucrBase.clsRsyntax.SetBaseRFunction(clsInitialSplit)
Else
If ucrSaveTestingData.IsComplete Then
clsTesting.AddParameter("x", clsRFunctionParameter:=clsInitialTimeSplit)
If ucrChkTest.Checked AndAlso ucrSaveTestingData.IsComplete Then
clsTesting.AddParameter("x", "rsample")
ucrBase.clsRsyntax.AddToAfterCodes(clsTesting, 0)
Else
ucrBase.clsRsyntax.RemoveFromAfterCodes(clsTesting)
End If
If ucrSaveTrainingData.IsComplete Then
clsTraining.AddParameter("x", clsRFunctionParameter:=clsInitialTimeSplit)
clsTraining.AddParameter("x", "rsample")
ucrBase.clsRsyntax.AddToAfterCodes(clsTraining, 1)
Else
ucrBase.clsRsyntax.RemoveFromAfterCodes(clsTraining)
End If
ucrBase.clsRsyntax.SetBaseRFunction(clsInitialTimeSplit)
End If
ucrBase.clsRsyntax.AddToAfterCodes(clsTesting, 0)
ucrBase.clsRsyntax.AddToAfterCodes(clsTraining, 1)

End Sub

Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset
Expand All @@ -233,4 +243,7 @@ Public Class dlgRandomSplit
SetBaseFunction()
End Sub

Private Sub ucrChkTest_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTest.ControlValueChanged
SetBaseFunction()
End Sub
End Class
19 changes: 4 additions & 15 deletions instat/frmMain.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,6 @@ Public Class frmMain
mnuIncludeComments.Checked = dlgOptions.ucrChkIncludeCommentsbyDefault.chkCheck.Checked
End Sub

Private Sub mnuOrganiseDataFrameHideColumns_Click(sender As Object, e As EventArgs) Handles mnuPrepareDataFrameHideColumns.Click
dlgHideShowColumns.ShowDialog()
End Sub

Private Sub mnuModelProbabilityDistributionsRandomSamplesUseModel_Click(sender As Object, e As EventArgs) Handles mnuModelProbabilityDistributionsRandomSamplesUseModel.Click
dlgRandomSample.enumRandomsampleMode = dlgRandomSample.RandomsampleMode.Model
dlgRandomSample.ShowDialog()
Expand Down
17 changes: 15 additions & 2 deletions instat/sdgLocation.vb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Public Class sdgLocation
ucrInputLatitude.SetParameter(New RParameter("lat_rad", 2))
ucrInputLatitude.AddQuotesIfUnrecognised = False
ucrInputLatitude.SetLinkedDisplayControl(lblLatitude)
ucrInputLatitude.SetValidationTypeAsNumeric()
ucrInputLatitude.SetRDefault("0")

ucrReceiverLongitude.SetParameter(New RParameter("lon", 3))
Expand All @@ -60,7 +61,8 @@ Public Class sdgLocation
ucrInputLongitude.SetParameter(New RParameter("lon", 3))
ucrInputLongitude.AddQuotesIfUnrecognised = False
ucrInputLongitude.SetLinkedDisplayControl(lblLongitude)
ucrInputLongitude.SetRDefault(0)
ucrInputLongitude.SetValidationTypeAsNumeric()
ucrInputLongitude.SetRDefault("0")

ucrReceiverAltitude.SetParameter(New RParameter("Elev", 4))
ucrReceiverAltitude.SetParameterIsRFunction()
Expand All @@ -71,6 +73,7 @@ Public Class sdgLocation
ucrInputElevation.SetParameter(New RParameter("Elev", 4))
ucrInputElevation.AddQuotesIfUnrecognised = False
ucrInputElevation.SetLinkedDisplayControl(lblLatitude)
ucrInputElevation.SetValidationTypeAsNumeric()
ucrInputElevation.SetRDefault("0")

bControlsInitialised = True
Expand Down Expand Up @@ -117,6 +120,11 @@ Public Class sdgLocation

Private Sub ucrInputElevation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputElevation.ControlValueChanged
EnableDesableSelector()
If Not ucrInputElevation.IsEmpty Then
clsListFunction.AddParameter("Elev", ucrInputElevation.GetText(), iPosition:=4)
Else
clsListFunction.RemoveParameterByName("Elev")
End If
End Sub

Private Sub ucrSelectorLocation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorLocation.ControlValueChanged
Expand All @@ -125,9 +133,14 @@ Public Class sdgLocation

Private Sub ucrInputLatitude_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputLatitude.ControlValueChanged
EnableDesableSelector()
If Not ucrInputLatitude.IsEmpty Then
clsListFunction.AddParameter("lat_rad", ucrInputLatitude.GetText(), iPosition:=1)
Else
clsListFunction.RemoveParameterByName("lat_rad")
End If
End Sub

Private Sub ucrInputLongitude_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputLongitude.ControlValueChanged
Private Sub ucrReceiverLatitude_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLatitude.ControlValueChanged
EnableDesableSelector()
End Sub
End Class
Loading

0 comments on commit 9ad3532

Please sign in to comment.