Skip to content

Commit

Permalink
Merge pull request #262 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons authored Aug 2, 2016
2 parents 3b4511a + f0fd7bd commit a8201ce
Show file tree
Hide file tree
Showing 29 changed files with 812 additions and 433 deletions.
9 changes: 7 additions & 2 deletions instat/clsRLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,10 @@ Public Class RLink
Dim clsGetItems As New RFunction
Dim clsIncludeList As New RFunction
Dim kvpInclude As KeyValuePair(Of String, String())
Dim lstItems As New List(Of KeyValuePair(Of String, String))

kvpInclude = New KeyValuePair(Of String, String())(strProperty, strValues)

ucrCurrentReceiver.Selector.LoadList()
If bInstatObjectExists Then
clsGetItems.SetRCommand(strInstatDataObject & "$get_column_names")
clsGetItems.AddParameter("as_list", "TRUE")
Expand All @@ -480,9 +481,13 @@ Public Class RLink
ucrCurrentReceiver.Clear()
For i = 0 To vecColumns.Count - 1
chrCurrColumns = vecColumns(i).AsCharacter
ucrCurrentReceiver.Add(chrCurrColumns.ToArray())
For Each strColumn As String In chrCurrColumns
lstItems.Add(New KeyValuePair(Of String, String)(strDataFrameName, strColumn))
Next
ucrCurrentReceiver.AddMultiple(lstItems.ToArray())
Next
End If
ucrCurrentReceiver.Selector.LoadList()
End Sub

Public Function GetListAsRString(lstStrings As List(Of String), Optional bWithQuotes As Boolean = True) As String
Expand Down
60 changes: 30 additions & 30 deletions instat/dlgColumnStructures.Designer.vb

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

44 changes: 21 additions & 23 deletions instat/dlgColumnStructures.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,61 +31,58 @@ Public Class dlgColumnStructure
End Sub

Private Sub InitialiseDialog()
ucrReceiverTreatment.Selector = ucrSelectorColumnStructure
ucrReceiverForLayout.Selector = ucrSelectorColumnStructure
ucrReceiverMeasurement.Selector = ucrSelectorColumnStructure
ucrReceiverForLayout.SetMeAsReceiver()
ucrReceiverForLayout.bExcludeFromSelector = True
ucrReceiverMeasurement.bExcludeFromSelector = True
ucrReceiverTreatment.bExcludeFromSelector = True
ucrReceiverType2.Selector = ucrSelectorColumnStructure
ucrReceiverType1.Selector = ucrSelectorColumnStructure
ucrReceiverType3.Selector = ucrSelectorColumnStructure
ucrReceiverType1.bExcludeFromSelector = True
ucrReceiverType3.bExcludeFromSelector = True
ucrReceiverType2.bExcludeFromSelector = True
ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$set_structure_columns")
End Sub

Private Sub SetDefaults()
' ucrSelectorColumnStructure.Reset()
SetColumnStructureInReceiver()
ucrReceiverType1.SetMeAsReceiver()
End Sub

Private Sub ReopenDialog()

End Sub

Private Sub SetColumnStructureInReceiver()
'ucrSelectorColumnStructure.Reset()
ucrSelectorColumnStructure.AddItemsWithMetadataProperty("Structure", {Chr(34) & "Treatment" & Chr(34), Chr(34) & "Measurement" & Chr(34), Chr(34) & "Layout" & Chr(34)})
ucrReceiverType1.AddItemsWithMetadataProperty(ucrSelectorColumnStructure.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Structure", {"structure_type_1_label"})
ucrReceiverType2.AddItemsWithMetadataProperty(ucrSelectorColumnStructure.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Structure", {"structure_type_2_label"})
ucrReceiverType3.AddItemsWithMetadataProperty(ucrSelectorColumnStructure.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Structure", {"structure_type_3_label"})
ucrReceiverType1.SetMeAsReceiver()
End Sub

Private Sub TestOKEnabled()
If ucrReceiverForLayout.IsEmpty() = False Or ucrReceiverMeasurement.IsEmpty() = False Or ucrReceiverTreatment.IsEmpty() = False Then
ucrBase.OKEnabled(True)
Else
ucrBase.OKEnabled(False)
End If
ucrBase.OKEnabled(True)
End Sub

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

Private Sub ucrReceiverForColumnStructure_SelectionChanged() Handles ucrReceiverForLayout.SelectionChanged, ucrReceiverMeasurement.SelectionChanged, ucrReceiverTreatment.SelectionChanged
Private Sub ucrReceiverForColumnStructure_SelectionChanged() Handles ucrReceiverType1.SelectionChanged, ucrReceiverType3.SelectionChanged, ucrReceiverType2.SelectionChanged
StructureParameters()
End Sub

Private Sub StructureParameters()
If ucrReceiverForLayout.IsEmpty = False Then
ucrBase.clsRsyntax.AddParameter("struc_type_2", ucrReceiverTreatment.GetVariableNames)
If ucrReceiverType1.IsEmpty = False Then
ucrBase.clsRsyntax.AddParameter("struc_type_2", ucrReceiverType2.GetVariableNames)
Else
ucrBase.clsRsyntax.RemoveParameter("struc_type_2")
End If
If ucrReceiverMeasurement.IsEmpty = False Then
ucrBase.clsRsyntax.AddParameter("struc_type_3", ucrReceiverMeasurement.GetVariableNames)
If ucrReceiverType3.IsEmpty = False Then
ucrBase.clsRsyntax.AddParameter("struc_type_3", ucrReceiverType3.GetVariableNames)
Else
ucrBase.clsRsyntax.RemoveParameter("struc_type_3")
End If

If ucrReceiverTreatment.IsEmpty = False Then
ucrBase.clsRsyntax.AddParameter("struc_type_1", ucrReceiverForLayout.GetVariableNames)
If ucrReceiverType2.IsEmpty = False Then
ucrBase.clsRsyntax.AddParameter("struc_type_1", ucrReceiverType1.GetVariableNames)
Else
ucrBase.clsRsyntax.RemoveParameter("struc_type_1")
End If
Expand All @@ -94,5 +91,6 @@ Public Class dlgColumnStructure

Private Sub ucrSelectorColumnStructure_DataFrameChanged() Handles ucrSelectorColumnStructure.DataFrameChanged
ucrBase.clsRsyntax.AddParameter("data_name", Chr(34) & ucrSelectorColumnStructure.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34))
SetColumnStructureInReceiver()
End Sub
End Class
21 changes: 10 additions & 11 deletions instat/dlgCombineforGraphics.Designer.vb

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

Loading

0 comments on commit a8201ce

Please sign in to comment.