Skip to content

Commit

Permalink
Merge pull request #45 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed Feb 10, 2016
2 parents 0b01cc5 + 3e87364 commit 519f982
Show file tree
Hide file tree
Showing 119 changed files with 11,757 additions and 415 deletions.
63 changes: 63 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.

21 changes: 21 additions & 0 deletions instat/My Project/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1288,4 +1288,25 @@
<data name="Timeseries" xml:space="preserve">
<value>Timeseries</value>
</data>
<data name="Categorical" xml:space="preserve">
<value>Categorical</value>
</data>
<data name="Gamma_With_Shape_and_Mean" xml:space="preserve">
<value>Gamma With Shape and Mean</value>
</data>
<data name="Gamma_With_Shape_and_Rate" xml:space="preserve">
<value>Gamma With Shape and Rate</value>
</data>
<data name="Gamma_With_Shape_and_Scale" xml:space="preserve">
<value>Gamma With Shape and Scale</value>
</data>
<data name="Gamma_With_Zeros" xml:space="preserve">
<value>Gamma With Zeros</value>
</data>
<data name="Number_of_Samples" xml:space="preserve">
<value>Number of Samples</value>
</data>
<data name="Rate" xml:space="preserve">
<value>rate</value>
</data>
</root>
3 changes: 2 additions & 1 deletion instat/clsGridLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Public Class clsGridLink
For i = 0 To lstDataNames.Length - 1
strDataName = lstDataNames.AsCharacter(i)
If (bGrdDataExists And frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_data_changed(data_name = " & Chr(34) & strDataName & Chr(34) & ")").AsLogical(0)) Then
dfTemp = frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_data_frame(" & Chr(34) & strDataName & Chr(34) & ")").AsDataFrame
frmMain.clsRLink.clsEngine.Evaluate(strDataName & "<-" & frmMain.clsRLink.strInstatDataObject & "$get_data_frame(" & Chr(34) & strDataName & Chr(34) & ")")
dfTemp = frmMain.clsRLink.clsEngine.GetSymbol(strDataName).AsDataFrame
FillSheet(dfTemp, strDataName, grdData)
frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$set_data_frames_changed(" & Chr(34) & strDataName & Chr(34) & ", FALSE)")
End If
Expand Down
12 changes: 6 additions & 6 deletions instat/clsRLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

Imports RDotNet

Public Class RLink
' R interface class. Each instance of the class has its own REngine instance
Dim strClimateObjectPath As String = "C:\\ClimateObject\\R"
Public Class RLink
' R interface class. Each instance of the class has its own REngine instance
Dim strClimateObjectPath As String = "/ClimateObject/R" 'new climateobject path
Public strClimateObject As String = "ClimateObject"
Dim strInstatObjectPath As String = "static/InstatObject/R" 'path to the Instat object
Dim strInstatObjectPath As String = "/InstatObject/R" 'path to the Instat object
Public strInstatDataObject As String = "InstatDataObject"
Public clsEngine As REngine
Dim txtOutput As New RichTextBox
Expand Down Expand Up @@ -152,7 +152,7 @@ Public Class RLink

Public Sub CreateNewClimateObject() 'creates an instance of the climate object
If Not bClimateObjectExists Then
RunScript("setwd('" & strClimateObjectPath & "')")
RunScript("setwd('" & frmMain.strStaticPath.Replace("\", "/") & strClimateObjectPath & "')")
RunScript("source(" & Chr(34) & "SourcingScript.R" & Chr(34) & ")")
RunScript(strClimateObject & "<-climate$new()")
bClimateObjectExists = True
Expand All @@ -161,7 +161,7 @@ Public Class RLink

Public Sub RSetup()
'run script to load libraries
RunScript("setwd('" & strInstatObjectPath & "')") 'This is bad the wd should be flexible and not automatically set to the instat object directory
RunScript("setwd('" & frmMain.strStaticPath.Replace("\", "/") & strInstatObjectPath & "')") 'This is bad the wd should be flexible and not automatically set to the instat object directory
RunScript("source(" & Chr(34) & "data_object.R" & Chr(34) & ")")
RunScript("source(" & Chr(34) & "instat_object.R" & Chr(34) & ")")
RunScript("source(" & Chr(34) & "Rsetup.R" & Chr(34) & ")")
Expand Down
1 change: 1 addition & 0 deletions instat/dlgCalculator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Public Class dlgCalculator
ucrBase.OKEnabled(False)
cmdBackSpace.Enabled = True
txtCalcLine.Select()
ucrBase.iHelpTopicID = 14
End Sub

Private Sub AddText(strVar As String, Optional intStepsBack As Integer = 0, Optional bolInsertSelected As Boolean = False)
Expand Down
2 changes: 0 additions & 2 deletions instat/dlgCreateClimateObject.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
Imports instat.Translations
Public Class dlgCreateClimateObject

Dim newdataframe As String = UcrDataFrame.Text

Private Sub dlgCreateClimateObject_Load(sender As Object, e As EventArgs) Handles Me.Load
autoTranslate(Me)
frmMain.clsRLink.CreateNewClimateObject()
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgCumulativeExceedance.vb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Public Class dlgCumulativeExceedance

Private Sub dlgCumulativeExceedance_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
ucrBase.clsRsyntax.SetFunction("climate_obj$cumulative_exceedance_graphs")
ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strClimateObject & "$cumulative_exceedance_graphs")
ucrBase.clsRsyntax.iCallType = 0
End Sub

Expand Down
1 change: 1 addition & 0 deletions instat/dlgImportDataset.Designer.vb

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

3 changes: 3 additions & 0 deletions instat/dlgImportDataset.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
' 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.Translations
Imports System.IO

Public Class dlgImportDataset

Expand Down Expand Up @@ -49,7 +50,9 @@ Public Class dlgImportDataset
End Sub

Public Sub SetFilePath(strFilePath As String)
Dim sReader As New StreamReader(strFilePath)
ucrBase.clsRsyntax.AddParameter("file", Chr(34) & strFilePath & Chr(34))
txtInputFile.Text = sReader.ReadToEnd
End Sub

Private Sub txtName_Leave(sender As Object, e As EventArgs) Handles txtName.Leave
Expand Down
8 changes: 2 additions & 6 deletions instat/dlgOneSample.vb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Public Class dlgOneSample

Private Sub dlgOneSample_Load(sender As Object, e As EventArgs) Handles MyBase.Load
OneSampleDefaultSettings()
ucrBase.clsRsyntax.iCallType = 1
End Sub

Private Sub chkSignificanceTest_CheckedChanged(sender As Object, e As EventArgs) Handles chkSignificanceTest.CheckedChanged
Expand Down Expand Up @@ -70,12 +71,7 @@ Public Class dlgOneSample
lblValue.Visible = True
End If
End Sub

Private Sub txtValue_TextChanged(sender As Object, e As EventArgs) Handles txtValue.TextChanged

End Sub

Private Sub txtValue_Leave(sender As Object, e As EventArgs) Handles txtValue.Leave
ucrBase.clsRsyntax.AddParameter("", txtValue.Text)
ucrBase.clsRsyntax.AddParameter("mu", txtValue.Text)
End Sub
End Class
Loading

0 comments on commit 519f982

Please sign in to comment.