Skip to content

Commit

Permalink
Merge pull request #80 from lilyclements/JohnLabels
Browse files Browse the repository at this point in the history
John labels
  • Loading branch information
Lunalo authored Apr 13, 2017
2 parents 0196824 + 08b0c93 commit 3ef52cd
Show file tree
Hide file tree
Showing 56 changed files with 2,572 additions and 1,165 deletions.
12 changes: 7 additions & 5 deletions instat/UcrPanel.vb
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ Public Class UcrPanel
AddRadioButtonRange({rdoTemp})
If strValue <> "" Then
dctRadioButtonValues.Add(rdoTemp, strValue)
AddParameterValuesCondition(rdoTemp, clsParameter.strArgumentName, strValue)
AddParameterValuesCondition(rdoTemp, GetParameter().strArgumentName, strValue)
End If
End Sub

Public Sub RadioButtons_CheckedChanged()
OnControlValueChanged()
End Sub

Protected Overrides Sub UpdateParameter(clsTempParam As RParameter)
Dim strNewValue As String = ""
Dim rdoTemp As RadioButton

If bChangeParameterValue AndAlso clsParameter IsNot Nothing Then
If bChangeParameterValue AndAlso clsTempParam IsNot Nothing Then
For Each ctrTemp As Control In pnlRadios.Controls
If TypeOf ctrTemp Is RadioButton Then
rdoTemp = CType(ctrTemp, RadioButton)
Expand All @@ -64,13 +68,11 @@ Public Class UcrPanel
End If
Next
If strNewValue <> "" Then
clsParameter.SetArgumentValue(strNewValue)
clsTempParam.SetArgumentValue(strNewValue)
Else
MsgBox("Developer error: No parameter value is associated to the currently checked radio button. Cannot update parameter.")
End If
End If
UpdateRCode()
OnControlValueChanged()
End Sub

Protected Overrides Sub SetToValue(objTemp As Object)
Expand Down
10 changes: 9 additions & 1 deletion instat/clsRFunction.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Public Class RFunction
Inherits RCodeStructure

Public strRCommand As String
Private strPackageName As String = ""

Public Sub New()
OnParametersChanged()
Expand All @@ -28,14 +29,21 @@ Public Class RFunction
bIsAssigned = False
End Sub

Public Sub SetPackageName(strName As String)
strPackageName = strName
End Sub

Public Overrides Function ToScript(Optional ByRef strScript As String = "", Optional strTemp As String = "") As String
'Converting the RFunction into a string that when run in R gives the appropriate output
Dim i As Integer
'For method with OrderedIndices, replace clsParameters.count by Mybase.OrderedIndices.count and i by Mybase.OrderedIndices(i)

'Parameters are sorted in the appropriate order and then the script is built.
SortParameters()
strTemp = strRCommand & "("
If strPackageName <> "" Then
strTemp = strPackageName & "::"
End If
strTemp = strTemp & strRCommand & "("
For i = 0 To clsParameters.Count - 1
If i > 0 Then
strTemp = strTemp & ", "
Expand Down
11 changes: 11 additions & 0 deletions instat/clsRSyntax.vb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ Public Class RSyntax
bUseCommandString = False
End Sub

Public Sub SetPackageName(strName As String)
If clsBaseFunction Is Nothing Then
MsgBox("Developer error: base function must be set before package name is set.")
Else
clsBaseFunction.SetPackageName(strName)
bUseBaseFunction = True
bUseBaseOperator = False
bUseCommandString = False
End If
End Sub

Public Sub SetBaseRFunction(clsFunction As RFunction)
clsBaseFunction = clsFunction
bUseBaseFunction = True
Expand Down
5 changes: 2 additions & 3 deletions instat/dlgBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Public Class dlgBoxplot
clsRgeom_boxplotFunction.ClearParameters()
ucrSelectorBoxPlot.Reset()
ucrSelectorBoxPlot.Focus()
ucrVariablesAsFactorForBoxplot.ResetControl()
ucrSaveBoxplot.strPrefix = "Boxplot"
chkHorizontalBoxplot.Checked = False
chkVarwidth.Checked = False
Expand Down Expand Up @@ -83,8 +82,8 @@ Public Class dlgBoxplot
sdgPlots.SetGgplotFunction(clsRggplotFunction)

ucrVariablesAsFactorForBoxplot.SetFactorReceiver(ucrByFactorsReceiver)
ucrVariablesAsFactorForBoxplot.SetSelector(ucrSelectorBoxPlot)
ucrVariablesAsFactorForBoxplot.SetIncludedDataType({"numeric"})
ucrVariablesAsFactorForBoxplot.Selector = ucrSelectorBoxPlot
ucrVariablesAsFactorForBoxplot.SetIncludedDataTypes({"numeric"})


ucrSaveBoxplot.SetDataFrameSelector(ucrSelectorBoxPlot.ucrAvailableDataFrames)
Expand Down
5 changes: 2 additions & 3 deletions instat/dlgCumulativeDistribution.vb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Public Class dlgCumulativeDistribution


ucrVariablesAsFactorforCumDist.SetFactorReceiver(ucrFactorReceiver)
ucrVariablesAsFactorforCumDist.SetSelector(ucrCumDistSelector)
ucrVariablesAsFactorforCumDist.SetIncludedDataType({"numeric"})
ucrVariablesAsFactorforCumDist.Selector = ucrCumDistSelector
ucrVariablesAsFactorforCumDist.SetIncludedDataTypes({"numeric"})


ucrSaveCumDist.SetDataFrameSelector(ucrCumDistSelector.ucrAvailableDataFrames)
Expand All @@ -62,7 +62,6 @@ Public Class dlgCumulativeDistribution
ucrSaveCumDist.strPrefix = "Graph"
ucrCumDistSelector.Reset()
ucrCumDistSelector.Focus()
ucrVariablesAsFactorforCumDist.ResetControl()
chkCountsOnYAxis.Checked = False
chkExceedancePlots.Checked = True
chkIncludePoints.Checked = False
Expand Down
28 changes: 14 additions & 14 deletions instat/dlgDescribeOneVariable.Designer.vb

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

5 changes: 1 addition & 4 deletions instat/dlgDescribeOneVariable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'
' You should have received a copy of the GNU General Public License k
' along with this program. If not, see <http://www.gnu.org/licenses/>.
Imports instat
Imports instat.Translations

Public Class dlgDescribeOneVariable
Expand All @@ -29,7 +28,6 @@ Public Class dlgDescribeOneVariable
InitialiseDialog()
bFirstLoad = False
End If

If bReset Then
SetDefaults()
End If
Expand Down Expand Up @@ -100,6 +98,7 @@ Public Class dlgDescribeOneVariable
ucrChkCustomise.AddFunctionNamesCondition(False, "summary")

ucrChkSaveResult.SetText("Save Result") 'this is disabled in the initial implementation
ucrChkSaveResult.Enabled = False
'ucrChkSaveResult.SetParameter(New RParameter("store_results"))
'ucrChkSaveResult.SetValuesCheckedAndUnchecked("TRUE", "FALSE")
'ucrChkSaveResult.SetRDefault("FALSE")
Expand Down Expand Up @@ -128,13 +127,11 @@ Public Class dlgDescribeOneVariable
ucrReceiverDescribeOneVar.SetParameterIsString()
'For the checkbox we just change the parameter name, because we want to keep the same value in the control for the new function.
'Changing the parameter name should be used very cautiously. Normally it is safer to set a new parameter.
ucrChkOmitMissing.ChangeParameterName("drop")
cmdSummaries.Enabled = True
Else
ucrBaseDescribeOneVar.clsRsyntax.SetBaseRFunction(clsSummaryFunction)
ucrReceiverDescribeOneVar.SetParameter(New RParameter("object", 0))
ucrReceiverDescribeOneVar.SetParameterIsRFunction()
ucrChkOmitMissing.ChangeParameterName("na.rm")
cmdSummaries.Enabled = False
End If
'We need to update the base function to include the
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgDescribeTwoVarGraph.vb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Public Class dlgDescribeTwoVarGraph
ucrBase.clsRsyntax.SetOperation("+")
clsRGGplotFunction.SetRCommand("ggplot")
ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRGGplotFunction)
ucrReceiverMultipleTwoVar.SetSelector(ucrSelectorTwoVarGraph)
ucrReceiverMultipleTwoVar.Selector = ucrSelectorTwoVarGraph
ucrReceiverMultipleTwoVar.SetSingleTypeStatus(True)
ucrReceiverMultipleTwoVar.SetMultipleOnlyStatus(True)
ucrSecondVariableReceiver.Selector = ucrSelectorTwoVarGraph
Expand Down
5 changes: 2 additions & 3 deletions instat/dlgDotPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Public Class dlgDotPlot
'The ucrVariablesAsFactorDotPlot could be called the ucrBinAxis in spirit.
'On the next line, the ucrOtherAxisReceiver receiver is used as the aesthetics to factor by when different variables are grouped into a single column in the multiple variables method.
ucrVariablesAsFactorDotPlot.SetFactorReceiver(ucrOtherAxisReceiver) 'Could choose the ucrFactorReceiver for this purpose...
ucrVariablesAsFactorDotPlot.SetSelector(ucrDotPlotSelector)
ucrVariablesAsFactorDotPlot.SetIncludedDataType({"numeric", "factor"})
ucrVariablesAsFactorDotPlot.Selector = ucrDotPlotSelector
ucrVariablesAsFactorDotPlot.SetIncludedDataTypes({"numeric", "factor"})
ucrBase.iHelpTopicID = 437

ucrSaveDotPlot.SetDataFrameSelector(ucrDotPlotSelector.ucrAvailableDataFrames)
Expand All @@ -79,7 +79,6 @@ Public Class dlgDotPlot
clsRgeom_dotplot.ClearParameters()
ucrDotPlotSelector.Reset()
ucrSaveDotPlot.strPrefix = "Dotplot"
ucrVariablesAsFactorDotPlot.ResetControl()
ucrSaveDotPlot.Reset()
sdgPlots.Reset()
rdoXBinAxis.Checked = True 'If it was already True, no need to change anything, else it will raise event rdoBinAxis_CheckChanged
Expand Down
5 changes: 2 additions & 3 deletions instat/dlgHistogram.vb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Public Class dlgHistogram


ucrVariablesAsFactorforHist.SetFactorReceiver(ucrFactorReceiver)
ucrVariablesAsFactorforHist.SetSelector(ucrHistogramSelector)
ucrVariablesAsFactorforHist.SetIncludedDataType({"numeric"})
ucrVariablesAsFactorforHist.Selector = ucrHistogramSelector
ucrVariablesAsFactorforHist.SetIncludedDataTypes({"numeric"})

ucrSaveHist.SetDataFrameSelector(ucrHistogramSelector.ucrAvailableDataFrames)
ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False
Expand Down Expand Up @@ -133,7 +133,6 @@ Public Class dlgHistogram
clsRgeom_FPolygon.ClearParameters()
clsRgeom_histogramFunction.ClearParameters()
ucrHistogramSelector.Reset()
ucrVariablesAsFactorforHist.ResetControl()
rdoHistogram.Checked = True
cmdHistogramOptions.Visible = True
cmdDensityOptions.Visible = False
Expand Down
25 changes: 13 additions & 12 deletions instat/dlgName.Designer.vb

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

Loading

0 comments on commit 3ef52cd

Please sign in to comment.