Skip to content

Commit

Permalink
Merge pull request #38 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Merge from Master Copy
  • Loading branch information
lilyclements authored Oct 14, 2016
2 parents e713ce6 + 84b86f5 commit d34a805
Show file tree
Hide file tree
Showing 14 changed files with 593 additions and 112 deletions.
81 changes: 81 additions & 0 deletions instat/My Project/Resources.Designer.vb

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

27 changes: 27 additions & 0 deletions instat/My Project/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1522,4 +1522,31 @@
<data name="Students_t" xml:space="preserve">
<value>Students t</value>
</data>
<data name="b" xml:space="preserve">
<value>b</value>
</data>
<data name="Cauchy" xml:space="preserve">
<value>Cauchy</value>
</data>
<data name="Chi_Square" xml:space="preserve">
<value>Chi-Square</value>
</data>
<data name="DF" xml:space="preserve">
<value>DF</value>
</data>
<data name="F" xml:space="preserve">
<value>F</value>
</data>
<data name="Hypergeometric" xml:space="preserve">
<value>Hypergeometric</value>
</data>
<data name="Lognormal" xml:space="preserve">
<value>Lognormal</value>
</data>
<data name="Meanlog" xml:space="preserve">
<value>Meanlog</value>
</data>
<data name="SDlog" xml:space="preserve">
<value>SDlog</value>
</data>
</root>
25 changes: 21 additions & 4 deletions instat/clsInstatOptions.vb
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
Imports System.Threading
Imports System.Globalization
Imports unvell.ReoGrid
Public Class InstatOptions

<Serializable()> Public Class InstatOptions
Public bIncludeRDefaultParameters As Boolean
Public fntOutput, fntScript, fntComment, fntEditor As Font
Public clrOutput, clrScript, clrComment, clrEditor As Color
Public strComment, strLanguageCultureCode As String
Public strWorkingDirectory As String
Public iPreviewRows As Integer
Public iMaxRows As Integer
Public lstColourPalette As List(Of Color)

Public lstColourPalette As List(Of Color)

Public Sub New()
'TODO Is this sensible to do in constructor?
bIncludeRDefaultParameters = False
SetFormatOutput(New Font(FontFamily.GenericMonospace, 8, FontStyle.Regular), Color.Blue)
SetFormatComment(New Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular), Color.Green)
SetFormatCommand(New Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular), Color.Black)
SetEditorFormat(New Font(FontFamily.GenericSansSerif, 10, FontStyle.Regular), Color.Black)
SetPreviewRows(10)
SetMaxRows(1000)
SetComment("code generated by the dialog")
'TODO is this sensible?
SetLanguageCultureCode(Thread.CurrentThread.CurrentCulture.Name)
SetWorkingDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
SetColorPalette(({Color.Aqua, Color.Gray, Color.LightGreen, Color.AliceBlue, Color.Maroon, Color.Green, Color.LightPink, Color.LightSkyBlue, Color.Brown, Color.MediumPurple, Color.White}).ToList)
End Sub

Public Sub SetMaxRows(iRows As Integer)
iMaxRows = iRows
frmMain.clsGrids.SetMaxRows(iMaxRows)
Expand Down Expand Up @@ -78,4 +95,4 @@ Public Class InstatOptions
Public Sub SetColorPalette(lstColours As List(Of Color))
lstColourPalette = lstColours
End Sub
End Class
End Class
2 changes: 1 addition & 1 deletion instat/dlgOneVariableGraph.vb
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ Public Class dlgOneVariableGraph
rdoCombineGraph.Enabled = False
End If
End Sub
End Class
End Class
17 changes: 13 additions & 4 deletions instat/dlgRandomSample.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Imports instat.Translations
Public Class dlgRandomSample
Public bFirstLoad As Boolean = True
Private clsMultipleSamplesFunction As New RFunction
Public clsCurrentDistribution As New Distribution
Private clsDistribtionFunction As New RFunction
Private clsSetSeed As New RFunction

Expand Down Expand Up @@ -53,7 +54,7 @@ Public Class dlgRandomSample

Private Sub SetDefaults()
ucrPrefixNewColumns.SetName("Rand")
SetDataFrameParameters()
SetDataFrameandDistributionParameters()
nudNumberOfSamples.Value = 1
SetNumberOfSamplesParameters()
chkSetSeed.Checked = False
Expand All @@ -66,7 +67,7 @@ Public Class dlgRandomSample
End Sub

Private Sub ucrDataFrameSelector_DataFrameChanged(sender As Object, e As EventArgs, strPrevDataFrame As String) Handles ucrSelectorRandomSamples.DataFrameChanged
SetDataFrameParameters()
SetDataFrameandDistributionParameters()
TestOKEnabled()
End Sub

Expand All @@ -84,8 +85,13 @@ Public Class dlgRandomSample
End If
End Sub

Private Sub SetDataFrameParameters()
clsDistribtionFunction.AddParameter("n", ucrSelectorRandomSamples.iDataFrameLength)
Private Sub SetDataFrameandDistributionParameters()
If ucrDistWithParameters.clsCurrDistribution.strRName = "hyper" Then
clsDistribtionFunction.AddParameter("nn", ucrSelectorRandomSamples.iDataFrameLength)
Else
clsDistribtionFunction.RemoveParameterByName("nn")
clsDistribtionFunction.AddParameter("n", ucrSelectorRandomSamples.iDataFrameLength)
End If
SetAssignTo()
TestOKEnabled()
End Sub
Expand Down Expand Up @@ -172,4 +178,7 @@ Public Class dlgRandomSample
TestOKEnabled()
End Sub

Private Sub ucrDistWithParameters_cboDistributionsIndexChanged(sender As Object, e As EventArgs) Handles ucrDistWithParameters.cboDistributionsIndexChanged
SetDataFrameandDistributionParameters()
End Sub
End Class
Loading

0 comments on commit d34a805

Please sign in to comment.