Skip to content

Commit

Permalink
Merge pull request #161 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating Master
  • Loading branch information
Muthenya authored Sep 19, 2018
2 parents 3c980ff + 1c116a9 commit 987f62c
Show file tree
Hide file tree
Showing 5 changed files with 516 additions and 37 deletions.
1 change: 0 additions & 1 deletion instat/dlgClimaticMaps.Designer.vb

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

67 changes: 43 additions & 24 deletions instat/dlgClimaticMaps.vb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Public Class dlgClimaticMaps
Private clsYlabFunction As New RFunction
Private clsXScaleContinuousFunction As New RFunction
Private clsYScaleContinuousFunction As New RFunction
Private clsXlimFunction, clsYlimFunction As New RFunction
Private clsRFacetFunction As New RFunction
Private clsThemeFunction As New RFunction
Private dctThemeFunctions As Dictionary(Of String, RFunction)
Expand All @@ -34,6 +35,8 @@ Public Class dlgClimaticMaps
Private bResetSFLayerSubdialog As Boolean = True




Private Sub dlgClimaticMaps_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
InitialiseDialog()
Expand All @@ -59,29 +62,34 @@ Public Class dlgClimaticMaps
ucrSelectorStation.SetParameter(New RParameter("data", 0))
ucrSelectorStation.SetParameterIsrfunction()

ucrReceiverFill.SetParameter(New RParameter("fill", 0))
ucrReceiverFill.Selector = ucrSelectorOutline
ucrReceiverFill.SetParameterIsRFunction()

ucrReceiverLongitude.SetParameter(New RParameter("x", 0))
ucrReceiverLongitude.Selector = ucrSelectorStation
ucrReceiverLongitude.SetIncludedDataTypes({"numeric"})
ucrReceiverLongitude.strSelectorHeading = "Numerics"
ucrReceiverLongitude.SetParameterIsRFunction()

ucrReceiverLatitude.SetParameter(New RParameter("y", 1))
ucrReceiverLatitude.Selector = ucrSelectorStation
ucrReceiverLatitude.SetIncludedDataTypes({"numeric"})
ucrReceiverLatitude.strSelectorHeading = "Numerics"
ucrReceiverLatitude.SetParameterIsRFunction()

ucrReceiverShape.SetParameter(New RParameter("shape", 2))
ucrReceiverShape.Selector = ucrSelectorStation
ucrReceiverShape.SetParameterIsRFunction()

ucrReceiverColor.SetParameter(New RParameter("color", 3))
ucrReceiverColor.Selector = ucrSelectorStation
ucrReceiverColor.SetParameterIsRFunction()
ucrReceiverFill.SetParameter(New RParameter("fill", 0))
ucrReceiverFill.Selector = ucrSelectorOutline
ucrReceiverFill.SetParameterIsString()
ucrReceiverFill.bWithQuotes = False

ucrReceiverLongitude.SetParameter(New RParameter("x", 0))
ucrReceiverLongitude.Selector = ucrSelectorStation
ucrReceiverLongitude.SetIncludedDataTypes({"numeric"})
ucrReceiverLongitude.strSelectorHeading = "Numerics"
ucrReceiverLongitude.SetParameterIsString()
ucrReceiverLongitude.bWithQuotes = False

ucrReceiverLatitude.SetParameter(New RParameter("y", 1))
ucrReceiverLatitude.Selector = ucrSelectorStation
ucrReceiverLatitude.SetIncludedDataTypes({"numeric"})
ucrReceiverLatitude.strSelectorHeading = "Numerics"
ucrReceiverLatitude.SetParameterIsString()
ucrReceiverLatitude.bWithQuotes = False

ucrReceiverShape.SetParameter(New RParameter("shape", 2))
ucrReceiverShape.Selector = ucrSelectorStation
ucrReceiverShape.SetParameterIsString()
ucrReceiverShape.bWithQuotes = False

ucrReceiverColor.SetParameter(New RParameter("color", 3))
ucrReceiverColor.Selector = ucrSelectorStation
ucrReceiverColor.SetParameterIsString()
ucrReceiverColor.bWithQuotes = False

ucrSaveMap.SetPrefix("Map")
ucrSaveMap.SetSaveTypeAsGraph()
Expand All @@ -100,6 +108,8 @@ Public Class dlgClimaticMaps
clsGeomPointAesFunction = New RFunction

clsGGplotOperator = New ROperator
clsXlimFunction = New RFunction
clsYlimFunction = New RFunction

ucrSelectorOutline.Reset()
ucrReceiverFill.SetMeAsReceiver()
Expand Down Expand Up @@ -141,12 +151,15 @@ Public Class dlgClimaticMaps
dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions)
clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone()

clsXlimFunction.SetRCommand("xlim")
clsYlimFunction.SetRCommand("ylim")

clsGGplotOperator.SetAssignTo("last_map", strTempDataframe:=ucrSelectorOutline.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_map")
ucrBase.clsRsyntax.SetBaseROperator(clsGGplotOperator)
End Sub

Private Sub cmdPlotOptions_Click(sender As Object, e As EventArgs) Handles cmdPlotOptions.Click
sdgPlots.SetRCode(clsGGplotOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsSfAesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrSelectorOutline, bReset:=bResetSubdialog)
sdgPlots.SetRCode(clsGGplotOperator, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsSfAesFunction, clsNewXScalecontinuousFunction:=clsXScaleContinuousFunction, clsNewYScalecontinuousFunction:=clsYScaleContinuousFunction, clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, ucrNewBaseSelector:=ucrSelectorStation, bReset:=bResetSubdialog)
sdgPlots.ShowDialog()
bResetSubdialog = False
End Sub
Expand All @@ -173,6 +186,12 @@ Public Class dlgClimaticMaps
'Next
End Sub

Private Sub cmdMapOptions_Click_1(sender As Object, e As EventArgs) Handles cmdMapOptions.Click
sdgMapOption.SetRCode(clsBaseOperator:=clsGGplotOperator, clsXlim:=clsXlimFunction, clsylim:=clsYlimFunction, bReset:=bResetSubdialog)
sdgMapOption.ShowDialog()
bResetSubdialog = False
End Sub

Private Sub TestOkEnabled()
Dim bOkEnabled As Boolean
If Not ucrReceiverFill.IsEmpty AndAlso ucrSaveMap.IsComplete Then
Expand Down
94 changes: 93 additions & 1 deletion instat/sdgMapOption.Designer.vb

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

Loading

0 comments on commit 987f62c

Please sign in to comment.