Skip to content

Commit

Permalink
Merge pull request #30 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating master
  • Loading branch information
jackykemboi authored Sep 28, 2018
2 parents 616b336 + 590b553 commit 3a8b914
Show file tree
Hide file tree
Showing 34 changed files with 7,370 additions and 2,142 deletions.
15 changes: 15 additions & 0 deletions instat/clsGgplotDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ Public Class GgplotDefaults

Return clsYlabScalesTempFunc
End Get
End Property

Public Shared ReadOnly Property clsYScaleDateFunction As RFunction
Get
Dim clsYlabScalesDateTempFunc As New RFunction

clsYlabScalesDateTempFunc.SetPackageName("ggplot2")
clsYlabScalesDateTempFunc.SetRCommand("scale_y_date")

Return clsYlabScalesDateTempFunc
End Get
End Property

Public Shared ReadOnly Property clsFacetFunction As RFunction
Expand Down Expand Up @@ -145,6 +156,8 @@ Public Class GgplotDefaults
dctTemp.Add("rect", clsElementRect.Clone())
dctTemp.Add("text", clsElementText.Clone())
dctTemp.Add("title", clsElementText.Clone())
dctTemp.Add("sub.title", clsElementText.Clone())
dctTemp.Add("caption", clsElementText.Clone())
'dctTemp.Add("aspect.ratio", clsElementText.Clone())
dctTemp.Add("axis.title", clsElementText.Clone())
dctTemp.Add("axis.title.x", clsElementText.Clone())
Expand Down Expand Up @@ -250,9 +263,11 @@ Public Class GgplotDefaults
Public Shared ReadOnly Property dctColour As Dictionary(Of String, String)
Get
Dim dctTempColour As New Dictionary(Of String, String)
dctTempColour.Add("White", Chr(34) & "white" & Chr(34))
dctTempColour.Add("Black", Chr(34) & "black" & Chr(34))
dctTempColour.Add("Red", Chr(34) & "red" & Chr(34))
dctTempColour.Add("Blue", Chr(34) & "blue" & Chr(34))
dctTempColour.Add("Light-Blue", Chr(34) & "lightblue" & Chr(34))
dctTempColour.Add("Grey", Chr(34) & "grey" & Chr(34))
dctTempColour.Add("Yellow", Chr(34) & "yellow" & Chr(34))
dctTempColour.Add("Yellow-Green", Chr(34) & "yellowgreen" & Chr(34))
Expand Down
48 changes: 48 additions & 0 deletions instat/clsInstatOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Imports RDotNet
Public bShowWaitDialog As Nullable(Of Boolean)
Public iWaitTimeDelaySeconds As Nullable(Of Integer)
Public iToolbarHeight As Nullable(Of Integer)
Public strClimsoftDatabaseName As String
Public strClimsoftHost As String
Public strClimsoftPort As String
Public strClimsoftUsername As String

Public Sub New(Optional bSetOptions As Boolean = True)
'TODO Is this sensible to do in constructor?
Expand Down Expand Up @@ -79,6 +83,10 @@ Imports RDotNet
bShowWaitDialog = clsInstatOptionsDefaults.DEFAULTbShowWaitDialog
iWaitTimeDelaySeconds = clsInstatOptionsDefaults.DEFAULTiWaitTimeDelaySeconds
iToolbarHeight = clsInstatOptionsDefaults.DEFAULTiToolbarHeight
strClimsoftDatabaseName = clsInstatOptionsDefaults.DEFAULTstrClimsoftDatabaseName
strClimsoftHost = clsInstatOptionsDefaults.DEFAULTstrClimsoftHost
strClimsoftPort = clsInstatOptionsDefaults.DEFAULTstrClimsoftPort
strClimsoftUsername = clsInstatOptionsDefaults.DEFAULTstrClimsoftUsername
If bSetOptions Then
SetOptions()
End If
Expand Down Expand Up @@ -240,6 +248,30 @@ Imports RDotNet
Else
SetToolbarHeight(clsInstatOptionsDefaults.DEFAULTiToolbarHeight)
End If

If strClimsoftDatabaseName IsNot Nothing Then
SetClimsoftDatabaseName(strClimsoftDatabaseName)
Else
SetClimsoftDatabaseName(clsInstatOptionsDefaults.DEFAULTstrClimsoftDatabaseName)
End If

If strClimsoftHost IsNot Nothing Then
SetClimsoftHost(strClimsoftHost)
Else
SetClimsoftHost(clsInstatOptionsDefaults.DEFAULTstrClimsoftHost)
End If

If strClimsoftPort IsNot Nothing Then
SetClimsoftPort(strClimsoftPort)
Else
SetClimsoftPort(clsInstatOptionsDefaults.DEFAULTstrClimsoftPort)
End If

If strClimsoftUsername IsNot Nothing Then
SetClimsoftUsername(strClimsoftUsername)
Else
SetClimsoftUsername(clsInstatOptionsDefaults.DEFAULTstrClimsoftUsername)
End If
End Sub

Public Sub SetMaxRows(iRows As Integer)
Expand Down Expand Up @@ -420,4 +452,20 @@ Imports RDotNet
iToolbarHeight = iNewToolbarHeight
frmMain.SetToolbarHeight(iToolbarHeight)
End Sub

Public Sub SetClimsoftDatabaseName(strNewClimsoftDatabaseName As String)
strClimsoftDatabaseName = strNewClimsoftDatabaseName
End Sub

Public Sub SetClimsoftHost(strNewClimsoftHost As String)
strClimsoftHost = strNewClimsoftHost
End Sub

Public Sub SetClimsoftPort(strNewClimsoftPort As String)
strClimsoftPort = strNewClimsoftPort
End Sub

Public Sub SetClimsoftUsername(strNewClimsoftUsername As String)
strClimsoftUsername = strNewClimsoftUsername
End Sub
End Class
4 changes: 4 additions & 0 deletions instat/clsInstatOptionsDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ Public Class clsInstatOptionsDefaults
Public Shared ReadOnly DEFAULTbShowWaitDialog As Boolean = True
Public Shared ReadOnly DEFAULTiWaitTimeDelaySeconds As Integer = 2
Public Shared ReadOnly DEFAULTiToolbarHeight As Integer = 30
Public Shared ReadOnly DEFAULTstrClimsoftDatabaseName As String = "mariadb_climsoft_db_v4"
Public Shared ReadOnly DEFAULTstrClimsoftHost As String = "127.0.0.1"
Public Shared ReadOnly DEFAULTstrClimsoftPort As String = "3308"
Public Shared ReadOnly DEFAULTstrClimsoftUsername As String = "root"
End Class
8 changes: 4 additions & 4 deletions instat/dlgClimSoft.vb
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ Public Class dlgClimSoft
ucrInputEndDate.SetName("")

clsRDatabaseConnect.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$database_connect")
clsRDatabaseConnect.AddParameter("host", "127.0.0.1")
sdgImportFromClimSoft.ucrInputDatabaseName.SetName("")
sdgImportFromClimSoft.ucrInputPort.SetName("")
sdgImportFromClimSoft.ucrInputUserName.SetName("")
clsRDatabaseConnect.AddParameter("dbname", frmMain.clsInstatOptions.strClimsoftDatabaseName, iPosition:=0)
clsRDatabaseConnect.AddParameter("host", frmMain.clsInstatOptions.strClimsoftHost, iPosition:=1)
clsRDatabaseConnect.AddParameter("port", frmMain.clsInstatOptions.strClimsoftPort, iPosition:=2)
clsRDatabaseConnect.AddParameter("user", frmMain.clsInstatOptions.strClimsoftUsername, iPosition:=3)

clsRDatabaseDisconnect.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$database_disconnect")
clsRImportFromClimsoft.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_from_climsoft")
Expand Down
67 changes: 47 additions & 20 deletions instat/dlgClimaticCheckDataRain.Designer.vb

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

Loading

0 comments on commit 3a8b914

Please sign in to comment.