Skip to content

Commit

Permalink
Merge pull request #29 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating Master
  • Loading branch information
Vitalis95 authored Jan 14, 2022
2 parents 2471623 + f05ad8a commit 3576756
Show file tree
Hide file tree
Showing 12 changed files with 626 additions and 173 deletions.
16 changes: 8 additions & 8 deletions instat/dlgRandomSubsets.Designer.vb

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

2 changes: 1 addition & 1 deletion instat/dlgRandomSubsets.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Public Class dlgRandomSubsets
ucrNudSampleSize.SetParameter(New RParameter("size", 2))

'Set Seed
ucrChkSetSeed.SetText("Seed")
ucrChkSetSeed.SetText("Set Seed")
ucrChkSetSeed.AddFunctionNamesCondition(False, "set.seed")
ucrNudSetSeed.SetParameter(New RParameter("seed", 0))
ucrNudSetSeed.SetMinMax(1, Integer.MaxValue)
Expand Down
6 changes: 3 additions & 3 deletions instat/dlgSeasonalPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Public Class dlgSeasonalPlot
ucrInputSmoothing.AddRCodeIsRFunctionCondition("Periodic Splines", bNewIsPositive:=False)
ucrInputSmoothing.AddParameterValueFunctionNamesCondition("Periodic Splines", strParameterName:="1", strFunctionName:="pbs")
ucrInputSmoothing.AddRCodeIsRFunctionCondition("Natural Splines", bNewIsPositive:=False)
ucrInputSmoothing.AddParameterValueFunctionNamesCondition("Natural Splines", strParameterName:="1", strFunctionName:="ns")
ucrInputSmoothing.AddParameterValueFunctionNamesCondition("Natural Splines", strParameterName:="1", strFunctionName:="naturalSpline")
ucrInputSmoothing.AddRCodeIsRFunctionCondition("LOESS", bNewIsPositive:=False)
ucrInputSmoothing.AddParameterIsStringCondition("LOESS", "1")

Expand Down Expand Up @@ -450,8 +450,8 @@ Public Class dlgSeasonalPlot
clsPbsFunction.AddParameter("x", "x", bIncludeArgumentName:=False, iPosition:=0)
clsPbsFunction.AddParameter("df", 6, iPosition:=1)

clsNsFunction.SetPackageName("splines")
clsNsFunction.SetRCommand("ns")
clsNsFunction.SetPackageName("splines2")
clsNsFunction.SetRCommand("naturalSpline")
clsNsFunction.AddParameter("x", "x", bIncludeArgumentName:=False, iPosition:=0)
clsNsFunction.AddParameter("df", 6, iPosition:=1)

Expand Down
38 changes: 26 additions & 12 deletions instat/dlgSplitText.Designer.vb

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

41 changes: 31 additions & 10 deletions instat/dlgSplitText.vb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Public Class dlgSplitText
ucrPnlSplitText.AddToLinkedControls(ucrSaveColumn, {rdoTextComponents}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlSplitText.AddToLinkedControls(ucrChkIncludeRegularExpressions, {rdoTextComponents}, bNewLinkedHideIfParameterMissing:=True)
ucrPnlSplitText.AddToLinkedControls(ucrPnlTextComponents, {rdoTextComponents}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=rdoFixedNumberOfComponents)
ucrChkIncludeRegularExpressions.AddToLinkedControls(ucrInputRegexPattern, {True}, bNewLinkedHideIfParameterMissing:=True)
ucrNudPieces.SetLinkedDisplayControl(lblNumberofPiecesToReturn)

ucrReceiverSplitTextColumn.SetParameter(New RParameter("string", 0))
Expand All @@ -74,20 +75,16 @@ Public Class dlgSplitText
dctPatternPairs.Add("Hyphen -", Chr(34) & "-" & Chr(34))
dctPatternPairs.Add("Underscore _", Chr(34) & "_" & Chr(34))
ucrInputPattern.SetItems(dctPatternPairs)
ucrInputPattern.SetRDefault(Chr(34) & "," & Chr(34))
ucrInputPattern.bAllowNonConditionValues = True

ucrNudPieces.SetParameter(New RParameter("n", 2))
ucrNudPieces.SetMinMax(2, Integer.MaxValue)

ucrChkIncludeRegularExpressions.SetText("Include Regular Expressions")
ucrChkIncludeRegularExpressions.SetParameter(New RParameter("checked", 0))
ucrChkIncludeRegularExpressions.SetValuesCheckedAndUnchecked("TRUE", "FALSE")
ucrChkIncludeRegularExpressions.SetValuesCheckedAndUnchecked(True, False)
ucrChkIncludeRegularExpressions.SetRDefault("FALSE")

'This is not yet implemented
ucrChkAddKeyboard.SetText("Add keyboard")
ucrChkAddKeyboard.Enabled = False
ucrChkAddKeyboard.Visible = False

ucrSaveColumn.SetSaveTypeAsColumn()
ucrSaveColumn.SetDataFrameSelector(ucrSelectorSplitTextColumn.ucrAvailableDataFrames)
Expand All @@ -107,6 +104,12 @@ Public Class dlgSplitText

ucrSelectorSplitTextColumn.Reset()

ucrInputRegexPattern.SetName("")

clsSplitDummyFunction.AddParameter("checked", False, iPosition:=0)

clsPatternDummyFunction.AddParameter("pattern", Chr(34) & "," & Chr(34), iPosition:=1)

clsStringCollFunction.SetPackageName("stringr")
clsStringCollFunction.SetRCommand("coll")
clsStringCollFunction.AddParameter("pattern", Chr(34) & "," & Chr(34), iPosition:=0)
Expand Down Expand Up @@ -156,14 +159,23 @@ Public Class dlgSplitText
SetDefaults()
SetRCodeForControls(True)
TestOKEnabled()
sdgConstructRegexExpression.ucrReceiverForRegex.Clear()
End Sub

Private Sub cmdAddkeyboard_Click(sender As Object, e As EventArgs) Handles cmdAddkeyboard.Click
sdgConstructRegexExpression.ShowDialog()
ucrInputRegexPattern.SetName(sdgConstructRegexExpression.ucrReceiverForRegex.GetText())
End Sub

Private Sub ucrPnlSplitText_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlSplitText.ControlValueChanged
If rdoBinaryColumns.Checked Then
cmdAddkeyboard.Visible = False
ucrBase.clsRsyntax.SetBaseRFunction(clsBinaryColumns)
ElseIf rdoTextComponents.Checked Then
SplitTextOptions()
End If

SetVisibleAddKeyboardButton()
ChangeParametersValues()
End Sub

Expand All @@ -172,6 +184,14 @@ Public Class dlgSplitText
ChangeParametersValues()
End Sub

Private Sub SetVisibleAddKeyboardButton()
If rdoBinaryColumns.Checked Then
cmdAddkeyboard.Visible = False
Else
cmdAddkeyboard.Visible = If(ucrChkIncludeRegularExpressions.Checked, True, False)
End If
End Sub

Private Sub ChangeParametersValues()
Dim strPattern As String

Expand All @@ -184,8 +204,8 @@ Public Class dlgSplitText
clsTextComponentsMaximum.RemoveParameterByName("pattern")
clsBinaryColumns.AddParameter("split.char", strPattern, iPosition:=1)
If ucrChkIncludeRegularExpressions.Checked Then
clsTextComponentsFixed.AddParameter("pattern", strPattern, iPosition:=1)
clsTextComponentsMaximum.AddParameter("pattern", strPattern, iPosition:=1)
clsTextComponentsFixed.AddParameter("pattern", Chr(34) & ucrInputRegexPattern.GetText & Chr(34), iPosition:=1)
clsTextComponentsMaximum.AddParameter("pattern", Chr(34) & ucrInputRegexPattern.GetText & Chr(34), iPosition:=1)
Else
clsStringCollFunction.AddParameter("pattern", strPattern, iPosition:=0)
clsTextComponentsFixed.AddParameter("pattern", clsRFunctionParameter:=clsStringCollFunction, iPosition:=1)
Expand All @@ -201,11 +221,12 @@ Public Class dlgSplitText
End If
End Sub

Private Sub ucrChkIncludeRegularExpressions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkIncludeRegularExpressions.ControlValueChanged, ucrReceiverSplitTextColumn.ControlValueChanged, ucrInputPattern.ControlValueChanged
Private Sub ucrChkIncludeRegularExpressions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkIncludeRegularExpressions.ControlValueChanged, ucrReceiverSplitTextColumn.ControlValueChanged, ucrInputPattern.ControlValueChanged, ucrInputRegexPattern.ControlValueChanged
ChangeParametersValues()
SetVisibleAddKeyboardButton()
End Sub

Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputPattern.ControlContentsChanged, ucrReceiverSplitTextColumn.ControlContentsChanged, ucrNudPieces.ControlContentsChanged, ucrSaveColumn.ControlContentsChanged, ucrPnlSplitText.ControlContentsChanged
Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSplitTextColumn.ControlContentsChanged, ucrNudPieces.ControlContentsChanged, ucrSaveColumn.ControlContentsChanged, ucrPnlSplitText.ControlContentsChanged
TestOKEnabled()
End Sub
End Class
Loading

0 comments on commit 3576756

Please sign in to comment.