Skip to content

Commit

Permalink
Merge pull request #211 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons committed Jun 8, 2016
2 parents 197c373 + c3a1de5 commit 80128ee
Show file tree
Hide file tree
Showing 12 changed files with 518 additions and 449 deletions.
4 changes: 3 additions & 1 deletion instat/clsGeom.vb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ Public Class Geoms
clsAesParameters.Add(NewAesParameter)
End Sub

Public Sub AddLayerParameter(strLayerParameterName As String, strLayerParameterDataType As String, strLayerParameterDefaultValue As String, Optional bIsDependent As Boolean = False, Optional strDependentParameter As String = "", Optional strDependantpParameterValue As String = "")
Public Sub AddLayerParameter(strLayerParameterName As String, strLayerParameterDataType As String, strLayerParameterDefaultValue As String, Optional bIsDependent As Boolean = False, Optional lstParameterStrings As String() = Nothing, Optional strDependentParameter As String = "", Optional strDependantpParameterValue As String = "")
Dim NewLayerParameter As New LayerParameters

NewLayerParameter.strLayerParameterName = strLayerParameterName
NewLayerParameter.strLayerParameterDataType = strLayerParameterDataType
NewLayerParameter.strParameterDefaultValue = strLayerParameterDefaultValue
NewLayerParameter.lstParameterStrings = lstParameterStrings
'NewLayerParameter.strDependentParameter = strDependentParameter
'NewLayerParameter.strDependantparameterValue = strDependantpParameterValue
'NewLayerParameter.bIsDependent = bIsDependent
Expand All @@ -65,4 +66,5 @@ Public Class LayerParameters
Public strDependentParameter As String
Public strDependantparameterValue As String
Public bIsDependent As Boolean
Public lstParameterStrings As String()
End Class
2 changes: 1 addition & 1 deletion instat/dlgCombineText.vb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Public Class dlgCombineText
ucrInputColumnInto.SetDataFrameSelector(ucrSelectorForCombineText.ucrAvailableDataFrames)
ucrInputColumnInto.SetPrefix("Combine")
iColumnsUsed = 0
ucrInputSeparator.AddItems({"Space", "-", "_", "."})
ucrInputSeparator.SetItems({"Space", "-", "_", "."})
ucrBase.iHelpTopicID = 345
End Sub

Expand Down
42 changes: 25 additions & 17 deletions instat/dlgImportDataset.vb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ Public Class dlgImportDataset

'csv options settings
clsReadCSV.AddParameter("check.names", "TRUE")
ucrInputEncoding.AddItems({"unknown"})
ucrInputSeparator.AddItems({"Automatic", ",", "Whitespace", ":", ";", "|", "^"})
ucrInputHeaders.AddItems({"Automatic", "Yes", "No"})
ucrInputDecimal.AddItems({"Automatic", ".", ","})
ucrInputEncoding.SetItems({"unknown"})
ucrInputSeparator.SetItems({"Automatic", ",", "Whitespace", ":", ";", "|", "^"})
ucrInputHeaders.SetItems({"Automatic", "Yes", "No"})
ucrInputDecimal.SetItems({"Automatic", ".", ","})
nudSkip.Maximum = Integer.MaxValue
End Sub

Expand Down Expand Up @@ -236,18 +236,22 @@ Public Class dlgImportDataset
#Region "File Preview options"
Public Sub RefreshFilePreview()
Dim sReader As StreamReader
Try
sReader = New StreamReader(ucrInputFilePath.GetText())
txtPreview.Text = ""
For i = 1 To intLines + nudSkip.Value + 1
txtPreview.Text = txtPreview.Text & sReader.ReadLine() & vbCrLf
If sReader.Peek() = -1 Then
Exit For
End If
Next
Catch ex As Exception
txtPreview.Text = "Cannot show text preview of file:" & ucrInputFilePath.GetText() & ". The file may be in use by another program. Close the file and select it again from the dialog to refresh the preview."
End Try
If ucrInputFilePath.GetText() <> "" Then
Try
sReader = New StreamReader(ucrInputFilePath.GetText())
txtPreview.Text = ""
For i = 1 To intLines + nudSkip.Value + 1
txtPreview.Text = txtPreview.Text & sReader.ReadLine() & vbCrLf
If sReader.Peek() = -1 Then
Exit For
End If
Next
Catch ex As Exception
txtPreview.Text = "Cannot show text preview of file:" & ucrInputFilePath.GetText() & ". The file may be in use by another program. Close the file and select it again from the dialog to refresh the preview."
End Try
Else
txtPreview.Text = ""
End If
End Sub

Private Sub RefreshFrameView()
Expand All @@ -265,7 +269,11 @@ Public Class dlgImportDataset
clsReadCSV.AddParameter("nrows", intLines)
End If
lblCannotImport.Hide()
bValid = frmMain.clsRLink.RunInternalScript(ucrBase.clsRsyntax.GetScript(), strTempDataFrameName, bSilent:=True)
If ucrInputFilePath.GetText() = "" Then
bValid = False
Else
bValid = frmMain.clsRLink.RunInternalScript(ucrBase.clsRsyntax.GetScript(), strTempDataFrameName, bSilent:=True)
End If
If bValid Then
expTemp = frmMain.clsRLink.RunInternalScriptGetValue("convert_to_character_matrix(" & strTempDataFrameName & ")", bSilent:=True)
dfTemp = Nothing
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgSplitText.vb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Public Class dlgSplitText
ucrInputColumnsIntoText.SetItemsTypeAsColumns()
ucrInputColumnsIntoText.SetDefaultTypeAsColumn()
ucrInputColumnsIntoText.SetDataFrameSelector(ucrSelectorSplitTextColumn.ucrAvailableDataFrames)
ucrInputPattern.AddItems({"Whitespace", ".", "-", "_"})
ucrInputPattern.SetItems({"Whitespace", ".", "-", "_"})
ucrBase.iHelpTopicID = 344

End Sub
Expand Down
2 changes: 1 addition & 1 deletion instat/ucrColors.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

Public Class ucrColors
Private Sub ucrColors_Load(sender As Object, e As EventArgs) Handles Me.Load
Me.AddItems({"Pick Colour", "black", "white", "blue", "red", "yellow", "purple", "green", "orange", "grey", "brown", "pink", "NULL"})
Me.SetItems({"Pick Colour", "black", "white", "blue", "red", "yellow", "purple", "green", "orange", "grey", "brown", "pink", "NULL"})
End Sub

Private Sub ucrColors_NameChanged() Handles Me.NameChanged
Expand Down
2 changes: 1 addition & 1 deletion instat/ucrFilter.vb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Public Class ucrFilter
Private Sub InitialiseControl()
ucrFilterPreview.txtInput.ReadOnly = True
ucrFilterByReceiver.Selector = ucrSelectorForFitler
ucrFilterOperation.AddItems({"==", "<", "<=", ">", ">=", "!="})
ucrFilterOperation.SetItems({"==", "<", "<=", ">", ">=", "!="})
ucrFactorLevels.SetAsMultipleSelector()
ucrFactorLevels.SetReceiver(ucrFilterByReceiver)
clsFilterView.bForceIncludeOperation = False
Expand Down
Loading

0 comments on commit 80128ee

Please sign in to comment.