Skip to content

Commit

Permalink
Merge pull request #21 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed Jan 17, 2016
2 parents 6867480 + 700e6e6 commit 06e7e83
Show file tree
Hide file tree
Showing 22 changed files with 1,103 additions and 101 deletions.
26 changes: 26 additions & 0 deletions instat/clsDistribution.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Public Class Distribution
Public strNameTag As String
Public strRFunctionName As String = ""
Public strPFunctionName As String = ""
Public strQFunctionName As String = ""
Public strDFunctionName As String = ""
Public strGLMFunctionName As String = ""
Public clsParameters As New List(Of DistributionParameter)

Public Sub SetNameTag(strTemp As String)
strNameTag = strTemp
End Sub

Public Sub AddParameter(strArgumentName, strNameTag)
Dim NewParameter As New DistributionParameter
NewParameter.strArgumentName = strArgumentName
NewParameter.strNameTag = strNameTag
clsParameters.Add(NewParameter)
End Sub
End Class

Public Class DistributionParameter
Public strArgumentName As String
Public strNameTag As String

End Class
25 changes: 24 additions & 1 deletion instat/clsRLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Public Class RLink
bLog = True
End Sub

Public Sub FillComboDataFrames(cboDataFrames As ComboBox)
Public Sub FillComboDataFrames(ByRef cboDataFrames As ComboBox)
Dim lstAvailableDataFrames As GenericVector
Dim i As Integer

Expand All @@ -58,6 +58,28 @@ Public Class RLink
cboDataFrames.Text = frmEditor.grdData.CurrentWorksheet.Name
End Sub

Public Sub FillComboColumnNames(ByRef cboColumns As ComboBox, strDataFrame As String)
Dim lstColumns As GenericVector
Dim i As Integer

If bInstatObjectExists Then
lstColumns = clsEngine.Evaluate(strInstatDataObject & "$get_column_names(" & Chr(34) & strDataFrame & Chr(34) & ")").AsList
cboColumns.Items.Clear()
For i = 0 To lstColumns.Length - 1
cboColumns.Items.Add(lstColumns.AsCharacter(i))
Next
End If
End Sub

Public Function GetDefaultNames(strPrefix As String)
Dim lstNextDefaults As GenericVector = Nothing

If bInstatObjectExists Then
lstNextDefaults = clsEngine.Evaluate(strInstatDataObject & "$get_next_default_column_name(prefix = " & Chr(34) & strPrefix & Chr(34) & ")").AsList
End If
Return lstNextDefaults
End Function

Public Sub RunScript(strScript As String, Optional bReturnOutput As Integer = 0)
Dim strCapturedScript As String
Dim temp As RDotNet.SymbolicExpression
Expand Down Expand Up @@ -87,6 +109,7 @@ Public Class RLink
Catch
MsgBox(strOutput)
End Try
frmMain.clsGrids.UpdateGrids()
End Sub

Public Function GetData(strLabel As String) As DataFrame
Expand Down
141 changes: 64 additions & 77 deletions instat/dlgRegularSequence.designer.vb

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

18 changes: 13 additions & 5 deletions instat/dlgRegularSequence.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ Public Class dlgRegularSequence
grpSequence2.Hide()
grpRepeatSingle.Hide()
ucrBase.clsRsyntax.SetFunction("seq")
ucrBase.clsRsyntax.iCallType = 0
'ucrBase.clsRsyntax.SetAssignTo("x")
autoTranslate(Me)
ucrSelectDataFrame.SetColumnList(ucrColName)
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrColName.cboColumnName.Text, strTempDataframe:=ucrSelectDataFrame.cboAvailableDataFrames.Text, strTempColumn:=ucrColName.cboColumnName.Text)
End Sub

Private Sub rdSIngleValue_Click(sender As Object, e As EventArgs) Handles rdSIngleValue.Click
Private Sub rdoSingleValue_Click(sender As Object, e As EventArgs) Handles rdoSingleValue.Click
grpSequence.Hide()
grpSequence2.Hide()
grpRepeatSingle.Visible = True
End Sub

Private Sub rdDates_Click(sender As Object, e As EventArgs) Handles rdDates.Click
Private Sub rdDates_Click(sender As Object, e As EventArgs) Handles rdoDates.Click
grpSequence.Hide()
grpRepeatSingle.Hide()
grpSequence2.Visible = True
End Sub

Private Sub rdSequence_Click(sender As Object, e As EventArgs) Handles rdSequence.Click
Private Sub rdSequence_Click(sender As Object, e As EventArgs) Handles rdoSequence.Click
grpRepeatSingle.Hide()
grpSequence2.Hide()
grpSequence.Visible = True
Expand Down Expand Up @@ -76,4 +76,12 @@ Public Class dlgRegularSequence
Private Sub txtRepeatTimes_TextChanged(sender As Object, e As EventArgs) Handles txtRepeatTimes.Leave
ucrBase.clsRsyntax.AddParameter("length.out", txtRepeatTimes.Text)
End Sub

Private Sub ucrSelectDataFrame_LostFocus(sender As Object, e As EventArgs) Handles ucrSelectDataFrame.LostFocus
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrColName.cboColumnName.Text, strTempDataframe:=ucrSelectDataFrame.cboAvailableDataFrames.Text, strTempColumn:=ucrColName.cboColumnName.Text)
End Sub

Private Sub ucrColName_LostFocus(sender As Object, e As EventArgs) Handles ucrColName.LostFocus
ucrBase.clsRsyntax.SetAssignTo(strAssignToName:=ucrColName.cboColumnName.Text, strTempDataframe:=ucrSelectDataFrame.cboAvailableDataFrames.Text, strTempColumn:=ucrColName.cboColumnName.Text)
End Sub
End Class
Loading

0 comments on commit 06e7e83

Please sign in to comment.