Skip to content

Commit

Permalink
Merge pull request #23 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
fetching latest copy
  • Loading branch information
maxwellfundi committed May 12, 2016
2 parents 2435bb2 + 9dc7aab commit 813a155
Show file tree
Hide file tree
Showing 29 changed files with 781 additions and 475 deletions.
13 changes: 11 additions & 2 deletions instat/UcrGeomListWithAes.vb
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,24 @@ Public Class UcrGeomListWithParameters
If clsCurrGeom IsNot Nothing Then
lstCurrArguments.Clear()
For i = 0 To (clsCurrGeom.clsGgParameters.Count - 1)
lstGgParameterLabels(i).Text = clsCurrGeom.clsGgParameters(i).strGgParameterName
lstCurrArguments.Add(clsCurrGeom.clsGgParameters(i).strGgParameterName)
If Not clsCurrGeom.clsGgParameters(i).bIsMandatory Then
lstGgParameterLabels(i).Text = clsCurrGeom.clsGgParameters(i).strGgParameterName
lstCurrArguments.Add(clsCurrGeom.clsGgParameters(i).strGgParameterName)
Else
'make them uppercase
lstGgParameterLabels(i).Text = (clsCurrGeom.clsGgParameters(i).strGgParameterName)
lstGgParameterLabels(i).Font = New Font(lstGgParameterLabels(i).Font, FontStyle.Bold)
lstCurrArguments.Add(clsCurrGeom.clsGgParameters(i).strGgParameterName)
End If

If clsCurrGeom.clsGgParameters(i).strIncludedDataTypes IsNot Nothing Then
lstGgParameterUcr(i).SetIncludedDataTypes(clsCurrGeom.clsGgParameters(i).strIncludedDataTypes)

ElseIf clsCurrGeom.clsGgParameters(i).strExcludedDataTypes IsNot Nothing Then
lstGgParameterUcr(i).SetExcludedDataTypes(clsCurrGeom.clsGgParameters(i).strExcludedDataTypes)
End If


Next

End If
Expand Down
5 changes: 3 additions & 2 deletions instat/clsGeom.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ Public Class Geoms



Public Sub AddGgParameter(strGgParameterName As String, Optional strGgParameterValue As String = Nothing, Optional strIncludedDataTypes As String() = Nothing, Optional strExcludedDataTypes As String() = Nothing)
Public Sub AddGgParameter(strGgParameterName As String, Optional strGgParameterValue As String = Nothing, Optional strIncludedDataTypes As String() = Nothing, Optional strExcludedDataTypes As String() = Nothing, Optional bIsMandatory As Boolean = False)
'will be adding parameters to the geom as well as the value of the parameter.
Dim NewGgParameter As New GgParameters
NewGgParameter.strGgParameterName = strGgParameterName
NewGgParameter.strGgParameterValue = strGgParameterValue
NewGgParameter.strIncludedDataTypes = strIncludedDataTypes
NewGgParameter.strExcludedDataTypes = strExcludedDataTypes
NewGgParameter.bIsMandatory = bIsMandatory
clsGgParameters.Add(NewGgParameter)
End Sub
End Class
Expand All @@ -37,7 +38,7 @@ Public Class GgParameters
Public strIncludedDataTypes As String()
Public strExcludedDataTypes As String()
Public strGgParameterValue As String

Public bIsMandatory As Boolean
End Class


Expand Down
25 changes: 21 additions & 4 deletions instat/clsGridLink.vb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Public Class clsGridLink
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
frmMain.clsRLink.clsEngine.Evaluate(strDataName & "<-" & frmMain.clsRLink.strInstatDataObject & "$get_data_frame(" & Chr(34) & strDataName & Chr(34) & ", convert_to_character = TRUE, include_hidden_columns = FALSE)")
dfTemp = frmMain.clsRLink.clsEngine.GetSymbol(strDataName).AsCharacterMatrix
dfTemp = frmMain.clsRLink.clsEngine.GetSymbol(strDataName).AsCharacterMatrix()
FillSheet(dfTemp, strDataName, grdData, bInstatObjectDataFrame:=True, bIncludeDataTypes:=True, iNewPosition:=i)
frmEditor.lstColumnNames = dfTemp.ColumnNames()
frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$set_data_frames_changed(" & Chr(34) & strDataName & Chr(34) & ", FALSE)")
End If
If (bGrdVariablesMetadataExists And frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_variables_metadata_changed(" & Chr(34) & strDataName & Chr(34) & ")").AsLogical(0)) Then
dfTemp = frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_variables_metadata(" & Chr(34) & strDataName & Chr(34) & ", convert_to_character = TRUE)").AsCharacterMatrix
dfTemp = frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_variables_metadata(" & Chr(34) & strDataName & Chr(34) & ", convert_to_character = TRUE)").AsCharacterMatrix()
FillSheet(dfTemp, strDataName, grdVariablesMetadata)
frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$set_variables_metadata_changed(" & Chr(34) & strDataName & Chr(34) & ", FALSE)")
End If
Expand Down Expand Up @@ -107,7 +107,7 @@ Public Class clsGridLink
End If

If bGrdMetadataExists And (bGrdMetadataChanged Or bRMetadataChanged) Then
dfTemp = frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_combined_metadata(convert_to_character = TRUE)").AsCharacterMatrix
dfTemp = frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$get_combined_metadata(convert_to_character = TRUE)").AsCharacterMatrix()
FillSheet(dfTemp, "metadata", grdMetadata)
frmMain.clsRLink.clsEngine.Evaluate(frmMain.clsRLink.strInstatDataObject & "$set_metadata_changed(new_val = FALSE)")
End If
Expand Down Expand Up @@ -177,12 +177,12 @@ Public Class clsGridLink
If iNewPosition <> -1 AndAlso iNewPosition <> iCurrPosition AndAlso iNewPosition < grdCurr.Worksheets.Count Then
grdCurr.MoveWorksheet(fillWorkSheet, iNewPosition)
End If

fillWorkSheet.Rows = dfTemp.RowCount
fillWorkSheet.Columns = dfTemp.ColumnCount
rngDataRange = New RangePosition(0, 0, dfTemp.RowCount, dfTemp.ColumnCount)
fillWorkSheet.SetRangeDataFormat(rngDataRange, DataFormat.CellDataFormatFlag.Text)
For i As Integer = 0 To dfTemp.RowCount - 1
fillWorkSheet.RowHeaders.Item(i).Text = dfTemp.RowNames(i)
For j As Integer = 0 To dfTemp.ColumnCount - 1
fillWorkSheet(row:=i, col:=j) = dfTemp(i, j)
Next
Expand All @@ -194,6 +194,7 @@ Public Class clsGridLink
clsGetVarMetaFunc.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_variables_metadata")
clsGetVarMetaFunc.AddParameter("data_name", Chr(34) & strName & Chr(34))
clsGetVarMetaFunc.AddParameter("property", "data_type_label")
clsGetVarMetaFunc.AddParameter("column", ListAsRString(dfTemp.ColumnNames()))
Else
clsGetVarMetaFunc.SetRCommand("sapply")
clsGetVarMetaFunc.AddParameter("X", strName)
Expand Down Expand Up @@ -226,5 +227,21 @@ Public Class clsGridLink

End Sub

Private Function ListAsRString(strValues As String(), Optional bWithQuotes As Boolean = True) As String
Dim strTemp As String
strTemp = "c("
For i = 0 To strValues.Count - 1
If i > 0 Then
strTemp = strTemp & ","
End If
If bWithQuotes Then
strTemp = strTemp & Chr(34) & strValues(i) & Chr(34)
Else
strTemp = strTemp & strValues(i)
End If
Next
strTemp = strTemp & ")"
Return strTemp
End Function

End Class
18 changes: 9 additions & 9 deletions instat/dlgBarAndPieChart.Designer.vb

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

6 changes: 3 additions & 3 deletions instat/dlgCumulativeDistribution.Designer.vb

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

2 changes: 1 addition & 1 deletion instat/dlgGeneralForGraphics.vb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ Public Class dlgGeneralForGraphics
End Sub

Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click
sdgLayers.ShowDialog()
sdgLayerOptions.ShowDialog()
End Sub
End Class
12 changes: 6 additions & 6 deletions instat/dlgHistogram.designer.vb

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

20 changes: 10 additions & 10 deletions instat/dlgPlot.designer.vb

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

Loading

0 comments on commit 813a155

Please sign in to comment.