Skip to content

Commit

Permalink
Merge pull request #153 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed May 6, 2016
2 parents 9e5661a + a92df97 commit ca309f0
Show file tree
Hide file tree
Showing 17 changed files with 345 additions and 139 deletions.
88 changes: 49 additions & 39 deletions instat/UcrGeomListWithAes.designer.vb

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

15 changes: 15 additions & 0 deletions instat/UcrGeomListWithAes.vb
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@ Public Class UcrGeomListWithParameters
clsRaesFunction.RemoveParameterByName(lstCurrArguments(6))
End If
End Sub
Private Sub ucrReceiverParam8_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverParam8.SelectionChanged, ucrReceiverParam9.SelectionChanged, ucrReceiverParam8.SelectionChanged
If Not ucrReceiverParam8.IsEmpty Then
clsRaesFunction.AddParameter(lstCurrArguments(7), ucrReceiverParam8.GetVariableNames(False))
Else
clsRaesFunction.RemoveParameterByName(lstCurrArguments(7))
End If
End Sub

Private Sub ucrReceiverParam9_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverParam9.SelectionChanged, ucrReceiverParam9.SelectionChanged, ucrReceiverParam8.SelectionChanged
If Not ucrReceiverParam9.IsEmpty Then
clsRaesFunction.AddParameter(lstCurrArguments(8), ucrReceiverParam9.GetVariableNames(False))
Else
clsRaesFunction.RemoveParameterByName(lstCurrArguments(8))
End If
End Sub

Private Sub UcrSelector_DataFrameChanged() Handles UcrSelector.DataFrameChanged
clsGeomFunction.AddParameter("data", clsRFunctionParameter:=UcrSelector.ucrAvailableDataFrames.clsCurrDataFrame)
Expand Down
35 changes: 18 additions & 17 deletions instat/clsRLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -317,33 +317,34 @@ Public Class RLink
bInstatObjectExists = True
End Sub

Public Sub FillListView(lstView As ListView, Optional lstIncludedDataTypes As List(Of String) = Nothing, Optional lstExcludedDataTypes As List(Of String) = Nothing, Optional strDataFrameName As String = "", Optional strHeading As String = "Variables")
Public Sub FillListView(lstView As ListView, Optional lstIncludedDataTypes As List(Of String) = Nothing, Optional lstExcludedDataTypes As List(Of String) = Nothing, Optional strDataFrameName As String = "", Optional strHeading As String = "Variables", Optional bIncludeHiddenColumns As Boolean = False)
Dim vecColumns As GenericVector
Dim chrCurrColumns As CharacterVector
Dim i As Integer
Dim grps As New ListViewGroup
Dim clsGetColumns As New RFunction

If bInstatObjectExists Then
clsGetColumns.SetRCommand(strInstatDataObject & "$get_column_names")
clsGetColumns.AddParameter("as_list", "TRUE")
If bIncludeHiddenColumns Then
clsGetColumns.AddParameter("include_hidden", "TRUE")
Else
clsGetColumns.AddParameter("include_hidden", "FALSE")
End If
lstView.Clear()
lstView.Groups.Clear()
lstView.Columns.Add(strHeading)
If strDataFrameName = "" Then
If lstIncludedDataTypes IsNot Nothing Then
vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(include_type = " & GetListAsRString(lstIncludedDataTypes) & ", as_list = TRUE)").AsList
ElseIf lstExcludedDataTypes IsNot Nothing Then
vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(exclude_type = " & GetListAsRString(lstExcludedDataTypes) & ", as_list = TRUE)").AsList
Else
vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(as_list = TRUE)").AsList
End If
Else
If lstIncludedDataTypes IsNot Nothing Then
vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(data_name = " & Chr(34) & strDataFrameName & Chr(34) & ", include_type = " & GetListAsRString(lstIncludedDataTypes) & ", as_list = TRUE)").AsList
ElseIf lstExcludedDataTypes IsNot Nothing Then
vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(data_name = " & Chr(34) & strDataFrameName & Chr(34) & ", exclude_type = " & GetListAsRString(lstExcludedDataTypes) & ", as_list = TRUE)").AsList
Else
vecColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(data_name = " & Chr(34) & strDataFrameName & Chr(34) & ", as_list = TRUE)").AsList
End If

If lstIncludedDataTypes.Count > 0 Then
clsGetColumns.AddParameter("include_type", GetListAsRString(lstIncludedDataTypes))
ElseIf lstExcludedDataTypes.Count > 0 Then
clsGetColumns.AddParameter("exclude_type", GetListAsRString(lstExcludedDataTypes))
End If
If strDataFrameName <> "" Then
clsGetColumns.AddParameter("data_name", Chr(34) & strDataFrameName & Chr(34))
End If
vecColumns = RunInternalScriptGetValue(clsGetColumns.ToScript()).AsList

For i = 0 To vecColumns.Count - 1
If vecColumns.Count > 1 Then
Expand Down
82 changes: 71 additions & 11 deletions instat/dlgGeneralForGraphics.Designer.vb

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

20 changes: 9 additions & 11 deletions instat/dlgGeneralForGraphics.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,27 @@ Public Class dlgGeneralForGraphics
'setting the base ggplot functions
ucrBase.clsRsyntax.SetOperation("+")
clsRggplotFunction.SetRCommand("ggplot")
'this sets the geoms andthe command to be used
ucrGeomListWithParameters1.SetGeoms()
ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction)
ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=ucrGeomListWithParameters1.clsGeomFunction)
End Sub

End Sub
Private Sub SetDefaults()
ucrGeomListWithParameters1.UcrSelector.Reset()
cmdDelete.Enabled = False
cmdEdit.Enabled = False
TestOkEnabled()
End Sub

Private Sub ReopenDialog()

End Sub
Public Sub TestOkEnabled()
If Not ucrGeomListWithParameters1.ucrReceiverParam1.IsEmpty Then
ucrBase.OKEnabled(True)
Else
ucrBase.OKEnabled(False)
End If
Public Sub TestOkEnabled()

End Sub

Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset
SetDefaults()
End Sub

Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click
sdgLayers.ShowDialog()
End Sub
End Class
Loading

0 comments on commit ca309f0

Please sign in to comment.