Skip to content

Commit

Permalink
Merge pull request #260 from lilyclements/summary_table_dates
Browse files Browse the repository at this point in the history
Summary table dates
  • Loading branch information
Ivanluv authored Mar 9, 2022
2 parents 0ac73de + 1f7aac6 commit 7ca6f38
Show file tree
Hide file tree
Showing 17 changed files with 175 additions and 93 deletions.
22 changes: 11 additions & 11 deletions instat/Model/DataFrame/clsDataFramePage.vb
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@ Public Class clsDataFramePage
End Function

Private Function GetDataFrameFromRCommand() As DataFrame
Dim clsRFunction As New RFunction
Dim clsGetDataFrameRFunction As New RFunction
Dim expTemp As SymbolicExpression
_hasChanged = True
clsRFunction.SetRCommand(_clsRLink.strInstatDataObject & "$get_data_frame")
clsRFunction.AddParameter("convert_to_character", "TRUE")
clsRFunction.AddParameter("include_hidden_columns", "FALSE")
clsRFunction.AddParameter("use_current_filter", "TRUE")
clsRFunction.AddParameter("max_cols", iColumnIncrements)
clsRFunction.AddParameter("max_rows", intRowIncrements)
clsRFunction.AddParameter("start_row", _iRowStart)
clsRFunction.AddParameter("start_col", _iColumnStart)
clsRFunction.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34))
expTemp = _clsRLink.RunInternalScriptGetValue(clsRFunction.ToScript(), bSilent:=True)
clsGetDataFrameRFunction.SetRCommand(_clsRLink.strInstatDataObject & "$get_data_frame")
clsGetDataFrameRFunction.AddParameter("convert_to_character", "TRUE")
clsGetDataFrameRFunction.AddParameter("use_current_filter", "TRUE")
clsGetDataFrameRFunction.AddParameter("use_column_selection", "TRUE")
clsGetDataFrameRFunction.AddParameter("max_cols", iColumnIncrements)
clsGetDataFrameRFunction.AddParameter("max_rows", intRowIncrements)
clsGetDataFrameRFunction.AddParameter("start_row", _iRowStart)
clsGetDataFrameRFunction.AddParameter("start_col", _iColumnStart)
clsGetDataFrameRFunction.AddParameter("data_name", Chr(34) & _strDataFrameName & Chr(34))
expTemp = _clsRLink.RunInternalScriptGetValue(clsGetDataFrameRFunction.ToScript(), bSilent:=True)
If expTemp IsNot Nothing AndAlso expTemp.Type <> Internals.SymbolicExpressionType.Null Then
Return expTemp.AsDataFrame
Else
Expand Down
2 changes: 1 addition & 1 deletion instat/My Project/Application.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/My Project/Application.myapp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>frmMain</MainForm>
<SingleInstance>true</SingleInstance>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
Expand Down
1 change: 1 addition & 0 deletions instat/UserControls/DataGrid/ReoGrid/ucrReoGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Public MustInherit Class ucrReoGrid
fillWorkSheet.SelectionForwardDirection = unvell.ReoGrid.SelectionForwardDirection.Down
fillWorkSheet.SetSettings(unvell.ReoGrid.WorksheetSettings.Edit_DragSelectionToMoveCells, False)
fillWorkSheet.SetSettings(unvell.ReoGrid.WorksheetSettings.Edit_DragSelectionToFillSerial, False)
fillWorkSheet.SetSettings(unvell.ReoGrid.WorksheetSettings.View_AllowCellTextOverflow, False)
AttachEventsToWorksheet(fillWorkSheet)
Return New clsWorksheetAdapter(fillWorkSheet)
End Function
Expand Down
13 changes: 8 additions & 5 deletions instat/clsRecentFiles.vb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ Public Class clsRecentFiles
'read file contents
Dim arrStrPaths() As String = File.ReadAllLines(strRecentFilesPath)
For Each strPath As String In arrStrPaths
If Not String.IsNullOrEmpty(strPath) Then
lstRecentOpenedFiles.Add(strPath.Replace("\", "/"))
If String.IsNullOrEmpty(strPath) Then
Continue For
End If
Dim strNewPath As String = strPath.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
If Not lstRecentOpenedFiles.Contains(strNewPath) Then
lstRecentOpenedFiles.Add(strNewPath)
End If
Next
'display the recently opened files if there are any items to display in the file
Expand Down Expand Up @@ -106,10 +110,10 @@ Public Class clsRecentFiles
''' </summary>
''' <param name="strFilePath">file path to add to menu items</param>
Public Sub addToMenu(strFilePath As String)
'remove file if it exists(helps with making sure displayed file names are rearranged)
strFilePath = strFilePath.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
'remove file if already in lists(helps with making sure displayed file names are rearranged)
lstRecentOpenedFiles.Remove(strFilePath)
'add to recent opened files list..
strFilePath = strFilePath.Replace("\", "/")
lstRecentOpenedFiles.Add(strFilePath)
'make sure there are only ever 30 items...
'todo. add this to the general options on the number of recently files to show
Expand Down Expand Up @@ -187,7 +191,6 @@ Public Class clsRecentFiles
End If

Dim strFilePathTmp As String = strFilePath.Replace("MRU:", "")
strFilePathTmp = strFilePathTmp.Replace("\", "/")
If File.Exists(strFilePathTmp) Then
dlgImportDataset.strFileToOpenOn = strFilePathTmp
dlgImportDataset.ShowDialog()
Expand Down
14 changes: 1 addition & 13 deletions instat/dlgCompareColumns.Designer.vb

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

7 changes: 1 addition & 6 deletions instat/dlgCompareColumns.vb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Public Class dlgCompareColumns
ucrPnlOptions.AddRadioButton(rdoByRow)
ucrPnlOptions.AddRadioButton(rdoByValue)

ucrPnlOptions.AddToLinkedControls({ucrChkUnique, ucrChkSort, ucrChkFirstNotSecond}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlOptions.AddToLinkedControls({ucrChkSort, ucrChkFirstNotSecond}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrChkFirstNotSecond.SetLinkedDisplayControl(grpComparisions)

ucrReceiverFirst.SetParameter(New RParameter("x", 0))
Expand All @@ -78,10 +78,6 @@ Public Class dlgCompareColumns
ucrInputTolerance.SetLinkedDisplayControl(lblTolerance)
ucrInputTolerance.bAllowNonConditionValues = True

ucrChkUnique.SetParameter(New RParameter("use_unique", 2), bNewChangeParameterValue:=True)
ucrChkUnique.SetText("Use unique values for comparison")
ucrChkUnique.SetRDefault("TRUE")

ucrChkSort.SetParameter(New RParameter("sort_values", 3), bNewChangeParameterValue:=True)
ucrChkSort.SetText("Sort values")
ucrChkSort.SetRDefault("TRUE")
Expand Down Expand Up @@ -171,7 +167,6 @@ Public Class dlgCompareColumns

ucrReceiverFirst.SetRCode(clsCompareColumnsFunction, bReset)
ucrReceiverSecond.SetRCode(clsCompareColumnsFunction, bReset)
ucrChkUnique.SetRCode(clsCompareColumnsFunction, bReset)
ucrChkSort.SetRCode(clsCompareColumnsFunction, bReset)
ucrChkFirstNotSecond.SetRCode(clsCompareColumnsFunction, bReset)
ucrChkSecondNotFirst.SetRCode(clsCompareColumnsFunction, bReset)
Expand Down
4 changes: 2 additions & 2 deletions instat/dlgDuplicateColumns.vb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ Public Class dlgDuplicateColumns
ucrPnlConvertTo.AddRadioButton(rdoConvertToCharacter, Chr(34) & "character" & Chr(34))
ucrPnlConvertTo.AddRadioButton(rdoConvertToInteger, Chr(34) & "integer" & Chr(34))
ucrPnlConvertTo.AddRadioButton(rdoConvertToLogical, Chr(34) & "logical" & Chr(34))
ucrPnlConvertTo.AddToLinkedControls(ucrChkConvertSpecifyDecimalsToDisplay, {rdoConvertToFactor, rdoConvertToOrderedFactor}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlConvertTo.AddToLinkedControls(ucrPnlConvertFactorToNumericOptions, {rdoConvertToNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=rdoConvertDefault)
ucrPnlConvertTo.AddToLinkedControls(ucrPnlConvertFactorToNumericOptions, {rdoConvertToFactor, rdoConvertToOrderedFactor}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlConvertTo.AddToLinkedControls(ucrChkConvertSpecifyDecimalsToDisplay, {rdoConvertToNumeric}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True)

ucrPnlConvertFactorToNumericOptions.SetParameter(New RParameter("factor_values", 3))
ucrPnlConvertFactorToNumericOptions.AddRadioButton(rdoConvertDefault, "NULL")
Expand Down
8 changes: 4 additions & 4 deletions instat/dlgInsertColumn.Designer.vb

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

12 changes: 10 additions & 2 deletions instat/dlgInsertColumn.vb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Public Class dlgInsertColumn

Private Sub InitialiseDialog()
Dim dctBeforeAfter As New Dictionary(Of String, String)
Dim dctDefaultValue As New Dictionary(Of String, String)

ucrBase.iHelpTopicID = 164

ucrSelectorInsertColumns.SetParameter(New RParameter("data_name", 0))
Expand Down Expand Up @@ -75,8 +77,14 @@ Public Class dlgInsertColumn
ucrNudNumberOfColumns.SetMinMax(1, Integer.MaxValue)

ucrInputDefaultValue.SetParameter(New RParameter("col_data", 5))
ucrInputDefaultValue.SetItems({"NA", "NA_real_", " NA_integer_", " NA_complex_", "NA_character_"})
ucrInputDefaultValue.AddQuotesIfUnrecognised = False
dctDefaultValue.Add("NA", "NA")
dctDefaultValue.Add("0", "0")
dctDefaultValue.Add("Kisumu", Chr(34) & "Kisumu" & Chr(34))
dctDefaultValue.Add("New Zealand", Chr(34) & "New Zealand" & Chr(34))
dctDefaultValue.Add("True", Chr(34) & "True" & Chr(34))
dctDefaultValue.Add("False", Chr(34) & "False" & Chr(34))
ucrInputDefaultValue.SetItems(dctDefaultValue)
ucrInputDefaultValue.AddQuotesIfUnrecognised = True
ucrInputDefaultValue.bAllowNonConditionValues = True

ucrPnlInsertColumns.SetParameter(New RParameter("before", 3))
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgSelect.Designer.vb

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

Loading

0 comments on commit 7ca6f38

Please sign in to comment.