Skip to content

Commit

Permalink
Merge pull request #300 from IDEMSInternational/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Vitalis95 authored Nov 14, 2024
2 parents f84cd04 + 1131867 commit fb71452
Show file tree
Hide file tree
Showing 23 changed files with 1,186 additions and 973 deletions.
12 changes: 4 additions & 8 deletions instat/UserTables/sdgTableOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ Public Class sdgTableOptions
End Sub

''' <summary>
''' An R operateor that has a parameter named "gt" set up.
''' The parameter should be an R Function that generates script "gt:gt()" as part of the last script statement.
''' Sets up the sub dialog.
''' Expected to be called before showing the dialog.
''' </summary>
''' <param name="clsNewOperator"></param>
''' <param name="strDataFrameName">Name of the data frame contained in the data book</param>
''' <param name="clsNewOperator">R operator that has a 'gt' parameter that produces a 'gt' object.</param>
Public Sub Setup(strDataFrameName As String, clsNewOperator As ROperator)
If clsTablesUtils.FindRFunctionsParamsWithRCommand({"gt"}, clsNewOperator).Count = 0 Then
MsgBox("Developer Error: Parameter with 'gt' as name MUST be set up before using this subdialog")
Exit Sub
End If

clsOperator = clsNewOperator

ucrHeader.Setup(clsOperator)
Expand Down
3 changes: 1 addition & 2 deletions instat/dlgClimaticSummary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ Public Class dlgClimaticSummary

'TODO: what defaults do we want?
clsSummariesList.SetRCommand("c")
clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=3)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False, iPosition:=11)

clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$calculate_summary")
Expand Down
33 changes: 23 additions & 10 deletions instat/dlgColumnStats.vb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Public Class dlgColumnStats
clsConcFunction.SetRCommand("c")

clsSummariesList.SetRCommand("c")
clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False, iPosition:=1)
clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False, iPosition:=11)

clsDefaultFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$calculate_summary")
Expand Down Expand Up @@ -220,19 +220,32 @@ Public Class dlgColumnStats
sdgMissingOptions.ShowDialog()
End Sub

Private Sub ucrReceiverByFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverByFactor.ControlValueChanged, ucrChkStoreResults.ControlValueChanged, ucrChkPrintOutput.ControlValueChanged
If ucrReceiverByFactor.IsEmpty Then
clsDefaultFunction.AddParameter("store_results", "FALSE", iPosition:=3)
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
ucrBase.clsRsyntax.iCallType = 2
Else
clsDefaultFunction.RemoveParameterByName("return_output")
If ucrChkStoreResults.Checked Then
clsDefaultFunction.AddParameter("store_results", "TRUE", iPosition:=3)
Private Sub ucrReceiverByFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverByFactor.ControlValueChanged, ucrChkStoreResults.ControlValueChanged, ucrChkPrintOutput.ControlValueChanged, ucrReceiverSelectedVariables.ControlValueChanged, ucrChkOriginalLevel.ControlValueChanged
If Not ucrChkOriginalLevel.Checked Then
If ucrReceiverByFactor.IsEmpty AndAlso Not ucrReceiverSelectedVariables.IsEmpty Then
clsDefaultFunction.AddParameter("store_results", "FALSE", iPosition:=3)
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
ucrBase.clsRsyntax.iCallType = 2
Else
clsDefaultFunction.RemoveParameterByName("return_output")
If ucrChkStoreResults.Checked Then
clsDefaultFunction.AddParameter("store_results", "TRUE", iPosition:=3)
Else
clsDefaultFunction.AddParameter("store_results", "FALSE", iPosition:=3)
End If
If ucrChkPrintOutput.Checked Then
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
Else
clsDefaultFunction.AddParameter("return_output", "FALSE", iPosition:=4)
End If
End If
Else
If ucrChkPrintOutput.Checked Then
clsDefaultFunction.AddParameter("return_output", "TRUE", iPosition:=4)
Else
clsDefaultFunction.RemoveParameterByName("return_output")
End If
clsDefaultFunction.AddParameter("store_results", "TRUE", iPosition:=3)
End If
End Sub

Expand Down
2 changes: 1 addition & 1 deletion instat/dlgDisplayDailyData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Public Class dlgDisplayDailyData
ucrChkIQR.SetParameter(New RParameter("IQR", 5), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "IQR" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34))
ucrChkIQR.SetText("IQR")

ucrChkSumMissing.SetParameter(New RParameter("summary_count_missing", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "summary_count_missing" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34))
ucrChkSumMissing.SetParameter(New RParameter("summary_count_miss", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "summary_count_miss" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34))
ucrChkSumMissing.SetText("N Missing")

ucrNudNumberOfColumns.SetParameter(New RParameter("ncol", 1))
Expand Down
1 change: 1 addition & 0 deletions instat/dlgDistances.vb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Public Class dlgDistances
autoTranslate(Me)
End Sub
Private Sub InitialiseDialog()
ucrBase.iHelpTopicID = 145

ucrSelectorDistance.SetParameter(New RParameter("df", 0))
ucrSelectorDistance.SetParameterIsrfunction()
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgExtremesClimatic.vb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ Public Class dlgExtremesClimatic
clsNSummary.AddParameter("save", "2", iPosition:=4)
clsNSummary.SetAssignTo("n_dates_summary")

clsNFunction.SetRCommand("summary_count")
clsNFunction.SetRCommand("summary_count_all")
clsNFunction.bToScriptAsRString = True

clsFilterExtremeCalc.SetRCommand("instat_calculation$new")
Expand Down
2 changes: 1 addition & 1 deletion instat/dlgOneVariableSummarise.vb
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ Public Class dlgOneVariableSummarise
strObjectName:="last_table")

clsSummariesList.SetRCommand("c")
clsSummariesList.AddParameter("summary_count_non_missing", Chr(34) & "summary_count_non_missing" & Chr(34), bIncludeArgumentName:=False)
clsSummariesList.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), bIncludeArgumentName:=False)
clsSummariesList.AddParameter("summary_count_all", Chr(34) & "summary_count_all" & Chr(34), bIncludeArgumentName:=False)
clsSummariesList.AddParameter("summary_sum", Chr(34) & "summary_sum" & Chr(34), bIncludeArgumentName:=False)

clsSummaryFunction.SetRCommand("summary")
Expand Down
Loading

0 comments on commit fb71452

Please sign in to comment.