Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from MC #88

Merged
merged 72 commits into from
Jan 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
3750375
Merge pull request #213 from africanmathsinitiative/master
maxwellfundi Jan 6, 2017
8003c02
Merge pull request #73 from africanmathsinitiative/master
stevenndungu Jan 6, 2017
ee4c36d
Merge pull request #214 from africanmathsinitiative/master
maxwellfundi Jan 6, 2017
a5839af
Merge pull request #451 from africanmathsinitiative/master
dannyparsons Jan 6, 2017
2e0c2ef
Merge pull request #16 from africanmathsinitiative/master
Lunalo Jan 6, 2017
72c8b30
Merge pull request #74 from africanmathsinitiative/master
stevenndungu Jan 6, 2017
b9bc136
Adding vbcode for dlgInfill
maxwellfundi Jan 6, 2017
ec1dbc2
Adding the design Structure
Lunalo Jan 6, 2017
534292a
Adding Help Ids
stevenndungu Jan 6, 2017
fe4896a
Merge pull request #2476 from Lunalo/AddKeyAndLinks
dannyparsons Jan 6, 2017
1969fc5
Removing the R viewer from infill method
maxwellfundi Jan 6, 2017
40c307b
Creating DlgClimSoft
stevenndungu Jan 6, 2017
6f018ff
DlgClimSoftAdding helpd ID
stevenndungu Jan 6, 2017
6085f5b
Merge pull request #2477 from maxwellfundi/Infill
dannyparsons Jan 6, 2017
90d84d2
Creating DlgCliData
stevenndungu Jan 6, 2017
6d7fd0b
DlgCliData- Adding HelpID
stevenndungu Jan 6, 2017
1b61469
Creating DlgClimaticSummaries
stevenndungu Jan 6, 2017
09830c5
DlgClimaticSummaries- Adding HelpId
stevenndungu Jan 6, 2017
35d2af5
Creating Dlg QCProcedure
stevenndungu Jan 6, 2017
8bd81c1
DllgQCProcedures- Adding Help ID
stevenndungu Jan 6, 2017
a68157f
Creating DlgRainfall
stevenndungu Jan 6, 2017
fc44e2e
DlgRainfall- Added HelpID
stevenndungu Jan 6, 2017
9df07bd
Creating DlgTemperature
stevenndungu Jan 6, 2017
c5f2659
DlgTemperature- Addition of help ID
stevenndungu Jan 6, 2017
833aa76
DlgWindSpeed
stevenndungu Jan 6, 2017
bdb3173
minor edit
stevenndungu Jan 6, 2017
da45722
Adding HelpID
stevenndungu Jan 6, 2017
f3b51d5
DlgSunshine
stevenndungu Jan 6, 2017
48b4aa4
DlgSunshine- Adding HelpID
stevenndungu Jan 6, 2017
1810f04
DlgGeneral
stevenndungu Jan 6, 2017
13d1770
DlgGeneral- Adding Help ID
stevenndungu Jan 6, 2017
ddfe7c0
DlgPICSARainfall
stevenndungu Jan 6, 2017
c0fa85c
Adding HelpID
stevenndungu Jan 6, 2017
cc9e510
DlgPICSATemperature
stevenndungu Jan 6, 2017
93724fa
Addition of HelpID
stevenndungu Jan 6, 2017
564ea6a
minor edit
stevenndungu Jan 6, 2017
d699cbc
Merge pull request #2479 from stevenndungu/HelpIDs
dannyparsons Jan 6, 2017
2a3021e
working markov dialog and updates to summaries
dannyparsons Jan 6, 2017
937f103
DlgPICSACrops
stevenndungu Jan 7, 2017
252c8e0
DlgCircular
stevenndungu Jan 7, 2017
5c667ce
Resourcefile DlgPICSATemperature
stevenndungu Jan 7, 2017
ac31303
addition of HelpID
stevenndungu Jan 7, 2017
062ce8d
Adding HelpID
stevenndungu Jan 7, 2017
76fd897
Addition of HelpID
stevenndungu Jan 7, 2017
e3fcc25
Adding HelpID
stevenndungu Jan 7, 2017
8004a5d
Changing HelpID
stevenndungu Jan 7, 2017
2beab16
Adding HelpID
stevenndungu Jan 7, 2017
af91416
Connecting to frmMain
stevenndungu Jan 7, 2017
691d428
Changing HelpID
stevenndungu Jan 7, 2017
2ce649f
Connecting Dlgs to frmMain
stevenndungu Jan 7, 2017
f4b4209
Merge pull request #215 from africanmathsinitiative/master
maxwellfundi Jan 7, 2017
3b78ed7
Adding options for output window
maxwellfundi Jan 7, 2017
aadeda6
Merge pull request #2480 from stevenndungu/HelpIDs
dannyparsons Jan 7, 2017
c0f67dd
Merge pull request #452 from africanmathsinitiative/master
dannyparsons Jan 7, 2017
4195301
fixed conflict
dannyparsons Jan 7, 2017
64c21e4
Merge pull request #2484 from dannyparsons/dannyparsons-markovdialog
dannyparsons Jan 7, 2017
d70ab2c
Merge pull request #453 from africanmathsinitiative/master
dannyparsons Jan 7, 2017
fc1dcbe
Adding checkboxes for options on output window
maxwellfundi Jan 7, 2017
9061c98
RLink and ucrButtons changes to allow options
dannyparsons Jan 7, 2017
7aa8363
Merge pull request #2485 from dannyparsons/graphdisplay
dannyparsons Jan 7, 2017
9be3ac8
Adding booleans for display in output window
maxwellfundi Jan 7, 2017
75afb2b
Adding comment for bDefaultOption
maxwellfundi Jan 7, 2017
ed378ae
Editing bDefaultsforComments
maxwellfundi Jan 7, 2017
ca13cec
removing checked changed event for checkboxes
maxwellfundi Jan 7, 2017
8a976fa
Merge pull request #2482 from maxwellfundi/MoreOptions
dannyparsons Jan 7, 2017
a1d2272
Merge pull request #217 from africanmathsinitiative/master
maxwellfundi Jan 7, 2017
12c235c
Working on options dialog
maxwellfundi Jan 8, 2017
56dc975
Adding default comments and commands to output
maxwellfundi Jan 8, 2017
a59f7b7
Merge pull request #2486 from maxwellfundi/optionslinking
dannyparsons Jan 8, 2017
ae6a8e4
Merge pull request #454 from africanmathsinitiative/master
dannyparsons Jan 8, 2017
c5294f5
fixed bug with pie chart in one var graph
dannyparsons Jan 8, 2017
7187f13
Merge pull request #2487 from dannyparsons/tidying
dannyparsons Jan 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions instat/DlgDefineClimaticData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Public Class DlgDefineClimaticData
End Sub

Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 328
ucrBase.clsRsyntax.SetFunction(frmMain.clsRLink.strInstatDataObject & "$define_as_climatic")
clsTypesFunction.SetRCommand("c")
ucrBase.clsRsyntax.AddParameter("types", clsRFunctionParameter:=clsTypesFunction)
Expand Down
16 changes: 15 additions & 1 deletion instat/clsInstatOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ Imports unvell.ReoGrid
Public iMaxRows As Integer
Public lstColourPalette As List(Of Color)
Public strGraphDisplayOption As String
Public bCommandsinOutput As Boolean
Public bIncludeCommentDefault As Boolean 'sets the default for comments on the dialog

Public Sub New()
'TODO Is this sensible to do in constructor?
bIncludeRDefaultParameters = False
bCommandsinOutput = True
bIncludeCommentDefault = True
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)
SetCommentsInOutput(True)
SetCommandInOutpt(True)
SetComment("code generated by the dialog")
'set the deault option here
SetGraphDisplayOption("view_output_window")
'TODO is this sensible?
SetLanguageCultureCode(Thread.CurrentThread.CurrentCulture.Name)
Expand Down Expand Up @@ -102,6 +107,15 @@ Imports unvell.ReoGrid
Public Sub SetGraphDisplayOption(strGraphOption As String)
strGraphDisplayOption = strGraphOption
'setting the string for graphs display
frmMain.clsRLink.strGraphDisplayOption = strGraphDisplayOption
End Sub

Public Sub SetCommandInOutpt(bCommand As Boolean)
bCommandsinOutput = bCommand
frmMain.clsRLink.bShowCommands = bCommandsinOutput
End Sub

Public Sub SetCommentsInOutput(bComment As Boolean)
bCommandsinOutput = bComment
End Sub
End Class
51 changes: 32 additions & 19 deletions instat/clsRLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Public Class RLink
Public bInstatObjectExists As Boolean = False
Public bClimsoftLinkExists As Boolean = False
'sets the default fonts and colors

Public bShowCommands As Boolean = True
Public fScript As Font = New Font("Microsoft Sans Serif", 8, FontStyle.Regular)
Public clrScript As Color = Color.Black
'
Expand All @@ -40,6 +42,8 @@ Public Class RLink
Public fComments As Font = New Font("Microsoft Sans Serif", 8, FontStyle.Regular)
Public clrComments As Color = Color.Green

Public strGraphDisplayOption As String = "view_output_window"

Public Sub New(Optional bWithInstatObj As Boolean = False, Optional bWithClimsoft As Boolean = False)

End Sub
Expand Down Expand Up @@ -242,33 +246,42 @@ Public Class RLink
txtLog.Text = txtLog.Text & strScriptWithComment & Environment.NewLine
End If
If bOutput Then
If strComment <> "" Then
rtbOutput.AppendText(clrComments, fComments, strComment & Environment.NewLine, clrScript, fScript, strScript & Environment.NewLine) 'TEST temporary
If strComment <> "" AndAlso bShowCommands Then
rtbOutput.AppendText(clrComments, fComments, strComment & Environment.NewLine, clrScript, fScript, strScript & Environment.NewLine)
Else
rtbOutput.AppendText(clrScript, fScript, strScript & Environment.NewLine) 'TEST temporary
If strComment <> "" Then
rtbOutput.AppendText(clrComments, fComments, strComment & Environment.NewLine, clrScript)
End If
If bShowCommands Then
rtbOutput.AppendText(clrScript, fScript, strScript & Environment.NewLine)
End If
End If
End If

'If strScript.Length > 2000 Then
' MsgBox("The following command cannot be run because it exceeds the character limit of 2000 characters for a command in R-Instat." & vbNewLine & strScript & vbNewLine & vbNewLine & "It may be possible to run the command directly in R.", MsgBoxStyle.Critical, "Cannot run command")
If iCallType = 0 OrElse iCallType = 3 Then
'If strScript.Length > 2000 Then
' MsgBox("The following command cannot be run because it exceeds the character limit of 2000 characters for a command in R-Instat." & vbNewLine & strScript & vbNewLine & vbNewLine & "It may be possible to run the command directly in R.", MsgBoxStyle.Critical, "Cannot run command")
If iCallType = 0 OrElse iCallType = 3 Then
Try
If iCallType = 3 Then
clsPNGFunction.SetRCommand("png")
clsPNGFunction.AddParameter("filename", Chr(34) & IO.Path.Combine(strTempGraphsDirectory & "/Graph.png").Replace("\", "/") & Chr(34))
clsPNGFunction.AddParameter("width", 4000)
clsPNGFunction.AddParameter("height", 4000)
clsPNGFunction.AddParameter("res", 500)
clsEngine.Evaluate(clsPNGFunction.ToScript())
'need to boost resolution of the devices, it's not as good as with ggsave.
If strGraphDisplayOption = "view_output_window" OrElse strGraphDisplayOption = "view_separate_window" Then
clsPNGFunction.SetRCommand("png")
clsPNGFunction.AddParameter("filename", Chr(34) & IO.Path.Combine(strTempGraphsDirectory & "/Graph.png").Replace("\", "/") & Chr(34))
clsPNGFunction.AddParameter("width", 4000)
clsPNGFunction.AddParameter("height", 4000)
clsPNGFunction.AddParameter("res", 500)
clsEngine.Evaluate(clsPNGFunction.ToScript())
'need to boost resolution of the devices, it's not as good as with ggsave.
End If
End If
clsEngine.Evaluate(strScript)
clsEngine.Evaluate(strScript)
If iCallType = 3 Then
'add an R script (maybe in the form of one of our methods) that copies divices to the temp directory, using the default device production... use dev.list() and dev.copy() with arguments device = the devices in the list and which = jpeg devices with different paths leading to the temp directory, using a paste() method to find different names for the files
clsEngine.Evaluate("graphics.off()") 'not quite sure if this would work, otherwise find the right way to close the appropriate devices.
'clsEngine.Evaluate("ggsave(" & Chr(34) & strTempGraphsDirectory.Replace("\", "/") & "Graph.jpg" & Chr(34) & ")")
'This sub is used to display graphics in the output window when necessary.
rtbOutput.TestForGraphics()
If strGraphDisplayOption = "view_output_window" OrElse strGraphDisplayOption = "view_separate_window" Then
'add an R script (maybe in the form of one of our methods) that copies divices to the temp directory, using the default device production... use dev.list() and dev.copy() with arguments device = the devices in the list and which = jpeg devices with different paths leading to the temp directory, using a paste() method to find different names for the files
clsEngine.Evaluate("graphics.off()") 'not quite sure if this would work, otherwise find the right way to close the appropriate devices.
'clsEngine.Evaluate("ggsave(" & Chr(34) & strTempGraphsDirectory.Replace("\", "/") & "Graph.jpg" & Chr(34) & ")")
'This sub is used to display graphics in the output window when necessary.
rtbOutput.TestForGraphics()
End If
End If
Catch e As Exception
MsgBox(e.Message & vbNewLine & "The error occurred in attempting to run the following R command(s):" & vbNewLine & strScript, MsgBoxStyle.Critical, "Error running R command(s)")
Expand Down
10 changes: 7 additions & 3 deletions instat/dlgCalculationsSummary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Public Class dlgCalculationsSummary
End Sub

Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 513
cmdEdit.Enabled = False
cmdDuplicate.Enabled = False
clsApplyCalculation.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$run_instat_calculation")
Expand Down Expand Up @@ -91,9 +92,12 @@ Public Class dlgCalculationsSummary
End Sub

Private Sub cmdDelete_Click(sender As Object, e As EventArgs) Handles cmdDelete.Click
For Each iTemp As Integer In lstLayers.SelectedIndices
lstLayers.Items.RemoveAt(iTemp)
lstCalculations.RemoveAt(iTemp)
Dim iIndex As Integer

For Each lviTemp As ListViewItem In lstLayers.SelectedItems
iIndex = lstLayers.Items.IndexOf(lviTemp)
lstLayers.Items.Remove(lviTemp)
lstCalculations.RemoveAt(iIndex)
Next
End Sub

Expand Down
52 changes: 52 additions & 0 deletions instat/dlgCircular.Designer.vb

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

120 changes: 120 additions & 0 deletions instat/dlgCircular.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
40 changes: 40 additions & 0 deletions instat/dlgCircular.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
' Instat-R
' Copyright (C) 2015
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' 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
Public Class dlgCircular
Public bFirstLoad As Boolean = True
Private Sub dlgCircular_Load(sender As Object, e As EventArgs) Handles MyBase.Load
autoTranslate(Me)
If bFirstLoad Then
InitialiseDialog()
SetDefaults()
bFirstLoad = False
End If
TestOKEnabled()
End Sub
Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 489
End Sub

Private Sub TestOKEnabled()

End Sub

Private Sub SetDefaults()
TestOKEnabled()
End Sub
End Class
Loading