Skip to content

Commit

Permalink
Merge pull request #45 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Updating master
  • Loading branch information
anastasia-mbithe authored Mar 31, 2022
2 parents 7a259a2 + 902c71a commit 8b4feca
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 60 deletions.
23 changes: 23 additions & 0 deletions instat/Model/DataFrame/clsDataFrameFilter.vb
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,34 @@ Public Class clsDataFrameFilterOrColumnSelection
Protected _bFilterApplied As Boolean
Protected _bColumnSelectionApplied As Boolean
Protected _iFilteredRowCount As Integer
Protected _iSelectedColumnCount As Integer
Protected _strFilterName As String
Protected _strSelectionName As String

Public ReadOnly Property iFilteredRowCount As Integer
Get
Return _iFilteredRowCount
End Get
End Property

Public ReadOnly Property iSelectedColumnCount As Integer
Get
Return _iSelectedColumnCount
End Get
End Property

Public ReadOnly Property strName As String
Get
Return _strFilterName
End Get
End Property

Public ReadOnly Property strSelectionName As String
Get
Return _strSelectionName
End Get
End Property

Public ReadOnly Property bFilterApplied() As Boolean
Get
Return _bFilterApplied
Expand All @@ -64,6 +78,13 @@ Public Class clsDataFrameFilterOrColumnSelection
Return _RLink.RunInternalScriptGetValue(clsGetCurrentFilterName.ToScript(), bSilent:=True).AsCharacter(0)
End Function

Private Function GetSelectionNameFromRCommand() As String
Dim clsGetCurrentFilterName As New RFunction
clsGetCurrentFilterName.SetRCommand(_RLink.strInstatDataObject & "$get_current_column_selection")
clsGetCurrentFilterName.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34), iPosition:=0)
Return _RLink.RunInternalScriptGetValue(clsGetCurrentFilterName.ToScript(), bSilent:=True).AsCharacter(0)
End Function

Private Function GetFilterAppliedFromRCommand() As Boolean
Dim clsFilterApplied As New RFunction
clsFilterApplied.SetRCommand(_RLink.strInstatDataObject & "$filter_applied")
Expand All @@ -80,9 +101,11 @@ Public Class clsDataFrameFilterOrColumnSelection

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

End Class
51 changes: 25 additions & 26 deletions instat/dlgBarAndPieChart.Designer.vb

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

Loading

0 comments on commit 8b4feca

Please sign in to comment.