Skip to content

Commit

Permalink
Merge pull request #31 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
updating master
  • Loading branch information
Vitalis95 authored Jan 24, 2022
2 parents 3576756 + 6e7fa40 commit d63a4e2
Show file tree
Hide file tree
Showing 31 changed files with 622 additions and 440 deletions.
4 changes: 2 additions & 2 deletions instat/Model/DataFrame/clsDataFrame.vb
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ Public Class clsDataFrame
End Function

''' <summary>
''' Updates datframe where data has changed
''' Updates dataframe where data has changed
''' </summary>
Public Sub RefreshData()
If HasDataChanged() Then
If _clsVisiblePage.RefreshData() Then
_iTotalRowCount = _RLink.GetDataFrameLength(_strName, False)
_iTotalColumnCount = _RLink.GetDataFrameColumnCount(_strName)
_clsFilter.RefreshData()
If _clsFilter.bApplied Then
If _clsFilter.bFilterApplied Then
_clsVisiblePage.SetTotalRowAndColumnCounts(_iTotalColumnCount, _clsFilter.iFilteredRowCount)
Else
_clsVisiblePage.SetTotalRowAndColumnCounts(_iTotalColumnCount, _iTotalRowCount)
Expand Down
23 changes: 19 additions & 4 deletions instat/Model/DataFrame/clsDataFrameFilter.vb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Public Class clsDataFrameFilter
Protected _strDataFrameName As String
Protected _RLink As RLink

Protected _bApplied As Boolean
Protected _bFilterApplied As Boolean
Protected _bColumnSelectionApplied As Boolean
Protected _iFilteredRowCount As Integer
Protected _strFilterName As String

Expand All @@ -39,9 +40,15 @@ Public Class clsDataFrameFilter
End Get
End Property

Public ReadOnly Property bApplied() As Boolean
Public ReadOnly Property bFilterApplied() As Boolean
Get
Return _bApplied
Return _bFilterApplied
End Get
End Property

Public ReadOnly Property bColumnSelectionApplied() As Boolean
Get
Return _bColumnSelectionApplied
End Get
End Property

Expand All @@ -64,9 +71,17 @@ Public Class clsDataFrameFilter
Return _RLink.RunInternalScriptGetValue(clsFilterApplied.ToScript()).AsLogical(0)
End Function

Private Function GetColumnSelectionAppliedFromRCommand() As Boolean
Dim clsColumnSelectionApplied As New RFunction
clsColumnSelectionApplied.SetRCommand(_RLink.strInstatDataObject & "$column_selection_applied")
clsColumnSelectionApplied.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34))
Return _RLink.RunInternalScriptGetValue(clsColumnSelectionApplied.ToScript()).AsLogical(0)
End Function

Public Sub RefreshData()
_iFilteredRowCount = _RLink.GetDataFrameLength(_strDataFrameName, True)
_bApplied = GetFilterAppliedFromRCommand()
_bFilterApplied = GetFilterAppliedFromRCommand()
_bColumnSelectionApplied = GetColumnSelectionAppliedFromRCommand()
_strFilterName = GetFilterNameFromRCommand()
End Sub

Expand Down
9 changes: 9 additions & 0 deletions instat/Model/RCommand/clsPrepareFunctionsForGrids.vb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ Public Class clsPrepareFunctionsForGrids
_RLink.RunScript(clsRemoveFilter.ToScript(), strComment:="Right click menu: Remove Current Filter")
End Sub
''' <summary>
''' Removes current column selection
''' </summary>
Public Sub RemoveCurrentColumnSelection()
Dim clsRemoveCurrentColumnSelection As New RFunction
clsRemoveCurrentColumnSelection.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_current_column_selection")
clsRemoveCurrentColumnSelection.AddParameter("data_name", Chr(34) & _strDataFrame & Chr(34), iPosition:=0)
_RLink.RunScript(clsRemoveCurrentColumnSelection.ToScript(), strComment:="Right click menu: Remove Current Column Selection")
End Sub
''' <summary>
''' Freeze selected columns
''' </summary>
''' <param name="strLastSelectedColumn"></param>
Expand Down
2 changes: 1 addition & 1 deletion instat/UserControls/DataGrid/Linux/ucrDataViewLinuxGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Public Class ucrDataViewLinuxGrid
Public Sub AddRowData(dataFrame As clsDataFrame) Implements IDataViewGrid.AddRowData
Dim dataGrid = GetDataGridFromSelectedTab()

If dataFrame.clsFilter.bApplied Then
If dataFrame.clsFilter.bFilterApplied Then
dataGrid.RowHeadersDefaultCellStyle.ForeColor = Color.Red
Else
dataGrid.RowHeadersDefaultCellStyle.ForeColor = Color.DarkBlue
Expand Down
2 changes: 1 addition & 1 deletion instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Public Class ucrDataViewReoGrid
grdData.CurrentWorksheet.Rows = dataFrame.iDisplayedRowCount
UpdateWorksheetSettings(grdData.CurrentWorksheet)

If dataFrame.clsFilter.bApplied Then
If dataFrame.clsFilter.bFilterApplied Then
textColour = Color.Red
Else
textColour = Color.DarkBlue
Expand Down
1 change: 1 addition & 0 deletions instat/dlgClimaticBoxPlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ Public Class dlgClimaticBoxPlot
clsRaesFunction.AddParameter("x", Chr(34) & Chr(34))

clsAsFactorFunction.SetRCommand("make_factor")
clsAsFactorFunction.AddParameter("x", Chr(34) & Chr(34), bIncludeArgumentName:=False)

clsRgeomPlotFunction.SetPackageName("ggplot2")
clsRgeomPlotFunction.SetRCommand("geom_boxplot")
Expand Down
4 changes: 2 additions & 2 deletions instat/dlgClimdexIndices.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/dlgInventoryPlot.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/dlgMerge.Designer.vb

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

4 changes: 2 additions & 2 deletions instat/dlgPermuteColumn.Designer.vb

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

Loading

0 comments on commit d63a4e2

Please sign in to comment.