From f14ef36b4090d618c611c765eddb5b9e99c7062d Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:03:49 +0100 Subject: [PATCH 01/83] Implemented Describe > Three Variable Summarise --- instat/dlgDescribeTwoVariable.vb | 270 ++++++++++++++++++++++++++++--- 1 file changed, 251 insertions(+), 19 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 30e4f41a1c4..88adadb0f8b 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -20,12 +20,12 @@ Public Class dlgDescribeTwoVariable Private bReset As Boolean = True Private bRcodeSet As Boolean = True Private bResetSubdialog As Boolean = False - Public strFirstVariablesType, strSecondVariableType As String + Public strFirstVariablesType, strSecondVariableType, strThirdVariableType As String 'SUMMARY FUNCTIoNS - Private clsCombineFrequencyParametersFunction, clsCombineFunction, - clsDummyFunction, clsGroupByFunction, clsRAnovaFunction, - clsRCorrelationFunction, clsSkimrFunction, clsSummariesListFunction, + Private clsCombineFrequencyParametersFunction, clsCombineFunction, clsSummariseFunction, + clsDummyFunction, clsGroupByFunction, clsRAnovaFunction, clsCorrFunction, clsRAnovaTableFunction, + clsRCorrelationFunction, clsSkimrFunction, clsSummariesListFunction, clsCombineAnovaFunction, clsSummaryTableCombineFactorsFunction, clsSummaryTableFunction, clsThreeVariableCombineFrequencyParametersFunction, clsPivotWiderFunction As New RFunction @@ -38,7 +38,7 @@ Public Class dlgDescribeTwoVariable clsTabStyleCellTextFunction, clsTabStyleCellTitleFunction, clsTabStyleFunction, clsTabStylePxFunction, clsgtExtrasThemesFuction As New RFunction - Private clsGroupByPipeOperator, clsSummaryOperator As New ROperator + Private clsGroupByPipeOperator, clsSummaryOperator, clsGroupByPipeOperator2, clsGroupByPipeOperator3, clsGroupByPipeOperator4, clsGroupByPipeOperatorData As New ROperator Private clsFrequencyTablesFunction, clsgtFunction, clsCombineFrequencyFactorParameterFunction, clsSelectFunction, clsRenameCombineFunction As New RFunction @@ -145,7 +145,7 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddParameterValuesCondition(rdoTwoVariable, "checked", "customize") ucrPnlDescribe.AddParameterValuesCondition(rdoSkim, "checked", "skim") ucrPnlDescribe.AddParameterValuesCondition(rdoThreeVariable, "checked", "three_variable") - rdoThreeVariable.Enabled = False + 'rdoThreeVariable.Enabled = False ucrPnlDescribe.AddToLinkedControls({ucrReceiverSkimrGroupByFactor, ucrReceiverSecondSkimrGroupByFactor}, {rdoSkim}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableThirdVariable}, {rdoThreeVariable}, bNewLinkedHideIfParameterMissing:=True) @@ -155,7 +155,7 @@ Public Class dlgDescribeTwoVariable ucrReceiverThreeVariableSecondFactor.SetParameter(New RParameter("second_three_varible_factor", 0, bNewIncludeArgumentName:=False)) ucrReceiverThreeVariableSecondFactor.SetParameterIsString() ucrReceiverThreeVariableSecondFactor.Selector = ucrSelectorDescribeTwoVar - ucrReceiverThreeVariableSecondFactor.SetIncludedDataTypes({"factor"}) + 'ucrReceiverThreeVariableSecondFactor.SetIncludedDataTypes({"factor"}) ucrReceiverThreeVariableSecondFactor.SetLinkedDisplayControl(lblThreeVariableSecondFactor) ucrSaveTable.SetDataFrameSelector(ucrSelectorDescribeTwoVar.ucrAvailableDataFrames) @@ -199,8 +199,16 @@ Public Class dlgDescribeTwoVariable clsgtFunction = New RFunction clsSummaryOperator = New ROperator clsPivotWiderFunction = New RFunction + clsCombineAnovaFunction = New RFunction + clsSummariseFunction = New RFunction + clsCorrFunction = New RFunction + clsRAnovaTableFunction = New RFunction clsgtExtrasThemesFuction = New RFunction clsMutableOperator = New ROperator + clsGroupByPipeOperator2 = New ROperator + clsGroupByPipeOperator3 = New ROperator + clsGroupByPipeOperator4 = New ROperator + clsGroupByPipeOperatorData = New ROperator ucrSelectorDescribeTwoVar.Reset() ucrReceiverFirstVars.SetMeAsReceiver() @@ -234,8 +242,8 @@ Public Class dlgDescribeTwoVariable clsgtExtrasThemesFuction.SetPackageName("gtExtras") - clsGroupByFunction.SetPackageName("dplyr") - clsGroupByFunction.SetRCommand("group_by") + 'clsGroupByFunction.SetPackageName("dplyr") + 'clsGroupByFunction.SetRCommand("group_by") clsGroupByPipeOperator.SetOperation("%>%") clsGroupByPipeOperator.AddParameter("skim", clsRFunctionParameter:=clsSkimrFunction, @@ -246,11 +254,40 @@ Public Class dlgDescribeTwoVariable clsGroupByFunction.SetPackageName("dplyr") clsGroupByFunction.SetRCommand("group_by") + clsGroupByPipeOperator2.SetOperation("%>%") + clsGroupByPipeOperator2.AddParameter("left", clsROperatorParameter:=clsGroupByPipeOperatorData, iPosition:=0) + clsGroupByPipeOperator2.AddParameter("right", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) + + clsGroupByPipeOperator3.SetOperation("%>%") + clsGroupByPipeOperator3.AddParameter("left", clsROperatorParameter:=clsGroupByPipeOperator2, iPosition:=0) + clsGroupByPipeOperator3.AddParameter("right", clsRFunctionParameter:=clsSummariseFunction, iPosition:=1) + + clsGroupByPipeOperator4.SetOperation("%>%") + clsGroupByPipeOperator4.AddParameter("left", clsROperatorParameter:=clsGroupByPipeOperator3, iPosition:=0) + clsGroupByPipeOperator4.AddParameter("right", clsRFunctionParameter:=clsgtFunction, iPosition:=1) + + clsGroupByPipeOperatorData.AddParameter("data", clsRFunctionParameter:=ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) + + clsSummariseFunction.SetRCommand("summarise") + clsSummariseFunction.AddParameter("cor", clsRFunctionParameter:=clsCorrFunction, bIncludeArgumentName:=False, iPosition:=0) + + + clsCorrFunction.SetRCommand("cor") + clsSkimrFunction.SetPackageName("skimr") clsSkimrFunction.SetRCommand("skim_without_charts") + clsRAnovaTableFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables") + clsRAnovaTableFunction.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsRAnovaTableFunction.AddParameter("x_col_names", clsRFunctionParameter:=clsCombineAnovaFunction, iPosition:=1) + clsRAnovaTableFunction.AddParameter("y_col_name", clsRFunctionParameter:=clsCombineFunction, iPosition:=2) + clsRAnovaTableFunction.AddParameter("signif.stars", "FALSE", iPosition:=3) + clsRAnovaTableFunction.AddParameter("sign_level", "FALSE", iPosition:=4) + clsRAnovaTableFunction.AddParameter("means", "FALSE", iPosition:=5) + clsCombineFunction.SetRCommand("c") + clsCombineAnovaFunction.SetRCommand("c") clsPipeOperator.SetOperation("%>%") clsPipeOperator.bBrackets = False @@ -373,7 +410,8 @@ Public Class dlgDescribeTwoVariable OrElse (Not ucrReceiverThreeVariableSecondFactor.IsEmpty _ AndAlso Not ucrReceiverThreeVariableThirdVariable.IsEmpty) _ AndAlso (IsFactorByFactor() OrElse IsNumericByFactor() _ - OrElse IsFactorByNumeric() OrElse IsNumericByNumeric())) AndAlso ucrSaveTable.IsComplete) + OrElse IsFactorByNumeric() OrElse IsNumericByNumericByFactor() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFNumericByNumeric() _ + OrElse IsFactorByNumericByNumeric() OrElse IsNumericByFactorByNumeric() OrElse IsFactorByFactorByFactor() OrElse IsNumericByNumeric())) AndAlso ucrSaveTable.IsComplete) End Sub Private Function IsFactorByFactor() As Boolean @@ -392,6 +430,30 @@ Public Class dlgDescribeTwoVariable Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "numeric" End Function + Private Function IsNumericByNumericByFactor() As Boolean + Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "numeric" AndAlso strThirdVariableType = "categorical" + End Function + + Private Function IsNumericByFactorByFactor() As Boolean + Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "categorical" AndAlso strThirdVariableType = "categorical" + End Function + + Private Function IsFactorByFactorByFactor() As Boolean + Return strFirstVariablesType = "categorical" AndAlso strSecondVariableType = "categorical" AndAlso strThirdVariableType = "categorical" + End Function + + Private Function IsNumericByFactorByNumeric() As Boolean + Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "categorical" AndAlso strThirdVariableType = "numeric" + End Function + + Private Function IsNumericByFNumericByNumeric() As Boolean + Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "numeric" AndAlso strThirdVariableType = "numeric" + End Function + + Private Function IsFactorByNumericByNumeric() As Boolean + Return strFirstVariablesType = "categorical" AndAlso strSecondVariableType = "numeric" AndAlso strThirdVariableType = "numeric" + End Function + Private Sub ucrBaseDescribeTwoVar_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() SetRCodeForControls(True) @@ -404,7 +466,7 @@ Public Class dlgDescribeTwoVariable sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) End If ElseIf rdoThreeVariable.Checked Then - If IsFactorByNumeric() OrElse IsNumericByFactor() Then + If IsFactorByNumeric() Then sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) End If End If @@ -437,6 +499,12 @@ Public Class dlgDescribeTwoVariable Else ucrChkOmitMissing.Visible = False End If + If rdoThreeVariable.Checked Then + If IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + ucrReorderSummary.Visible = False + cmdSummaries.Visible = False + End If + End If cmdMissingOptions.Visible = ucrChkOmitMissing.Checked End Sub @@ -500,9 +568,36 @@ Public Class dlgDescribeTwoVariable ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetCheckBoxText("Save Table") + If IsFactorByFactorByFactor() Then + ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) + clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, + strObjectName:="last_table") + End If + If IsFactorByNumericByNumeric() Then + ucrBase.clsRsyntax.SetBaseROperator(clsGroupByPipeOperator4) + clsGroupByPipeOperator4.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, + strObjectName:="last_table") + End If + If IsNumericByNumericByFactor() Then + ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + End If + If IsNumericByFNumericByNumeric() Then + ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + End If + If IsNumericByFactorByFactor() Then + ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + End If + If IsNumericByFactorByNumeric() Then + ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + End If End If FactorColumns() - End Sub Private Sub UpdateCombineFactorParameterFunction() @@ -568,6 +663,7 @@ Public Class dlgDescribeTwoVariable ChangeFirstTypeLabel() AssignSecondVariableType() + AssignThirdVariableType() ChangeBaseRCode() ManageControlsVisibility() UpdateSummaryTableFunction() @@ -576,6 +672,12 @@ Public Class dlgDescribeTwoVariable AddRemoveNAParameter() HideFormatTableButton() FactorColumns() + AddRemoveFirstParam() + AddRemoveSecondParam() + AddRemoveThirdParam() + AddRemoveFirstAnovaParam() + AddRemoveSecondAnovaParam() + AddRemoveThirdAnovaParam() End Sub Private Sub HideFormatTableButton() @@ -611,6 +713,42 @@ Public Class dlgDescribeTwoVariable End If End Sub + Private Sub AddRemoveFirstParam() + If rdoThreeVariable.Checked Then + If IsFactorByNumericByNumeric() Then + If ucrReceiverFirstVars.IsEmpty Then + clsGroupByFunction.RemoveParameterByName("var") + Else + clsGroupByFunction.AddParameter("var", ucrReceiverFirstVars.GetVariableNames(False), iPosition:=1, bIncludeArgumentName:=False) + End If + End If + End If + End Sub + + Private Sub AddRemoveSecondParam() + If rdoThreeVariable.Checked Then + If IsFactorByNumericByNumeric() Then + If ucrReceiverThreeVariableSecondFactor.IsEmpty Then + clsCorrFunction.RemoveParameterByName("x") + Else + clsCorrFunction.AddParameter("x", ucrReceiverThreeVariableSecondFactor.GetVariableNames(False), iPosition:=1, bIncludeArgumentName:=False) + End If + End If + End If + End Sub + + Private Sub AddRemoveThirdParam() + If rdoThreeVariable.Checked Then + If IsFactorByNumericByNumeric() Then + If ucrReceiverThreeVariableThirdVariable.IsEmpty Then + clsCorrFunction.RemoveParameterByName("y") + Else + clsCorrFunction.AddParameter("y", ucrReceiverThreeVariableThirdVariable.GetVariableNames(False), iPosition:=2, bIncludeArgumentName:=False) + End If + End If + End If + End Sub + Private Sub FactorColumns() If rdoTwoVariable.Checked Then clsSummaryOperator.AddParameter("col_factor", clsRFunctionParameter:=clsPivotWiderFunction, iPosition:=1) @@ -624,6 +762,54 @@ Public Class dlgDescribeTwoVariable SummariesInRowsOrCols() End If End If + If rdoThreeVariable.Checked Then + clsSummaryOperator.AddParameter("col_factor", clsRFunctionParameter:=clsPivotWiderFunction, iPosition:=1) + If IsFactorByFactorByFactor() Then + clsSummaryTableFunction.AddParameter("factors", "c(" & Chr(34) & ucrReceiverFirstVars.lstSelectedVariables.Items(0).Text & Chr(34) & "," & ucrReceiverThreeVariableSecondFactor.GetVariableNames & "," & ucrReceiverThreeVariableThirdVariable.GetVariableNames & ")") + clsSummaryTableFunction.AddParameter("columns_to_summarise", Chr(34) & ucrReceiverFirstVars.lstSelectedVariables.Items(0).Text & Chr(34)) + clsPivotWiderFunction.AddParameter("names_from", ucrReceiverFirstVars.lstSelectedVariables.Items(0).Text, iPosition:=0) + Else + clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=0) + clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverFirstVars.GetVariableNames) + SummariesInRowsOrCols() + End If + End If + End Sub + + Private Sub AddRemoveFirstAnovaParam() + If rdoThreeVariable.Checked Then + If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If ucrReceiverFirstVars.IsEmpty Then + clsCombineAnovaFunction.RemoveParameterByName("x") + Else + clsCombineAnovaFunction.AddParameter("x", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + End If + End If + End If + End Sub + + Private Sub AddRemoveSecondAnovaParam() + If rdoThreeVariable.Checked Then + If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If ucrReceiverThreeVariableSecondFactor.IsEmpty Then + clsCombineAnovaFunction.RemoveParameterByName("y") + Else + clsCombineAnovaFunction.AddParameter("y", ucrReceiverThreeVariableSecondFactor.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + End If + End If + End If + End Sub + + Private Sub AddRemoveThirdAnovaParam() + If rdoThreeVariable.Checked Then + If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If ucrReceiverThreeVariableThirdVariable.IsEmpty Then + clsCombineFunction.RemoveParameterByName("y") + Else + clsCombineFunction.AddParameter("y", ucrReceiverThreeVariableThirdVariable.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + End If + End If + End If End Sub Private Sub AddRemoveFrequencyParameters() @@ -702,7 +888,7 @@ Public Class dlgDescribeTwoVariable End Sub Private Sub ucrReceiverNumericVariable_ControlValueAndContentChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableThirdVariable.ControlValueChanged - AssignSecondVariableType() + AssignThirdVariableType() ManageControlsVisibility() UpdateCombineFactorParameterFunction() ChangeBaseRCode() @@ -711,6 +897,12 @@ Public Class dlgDescribeTwoVariable AddRemoveFrequencyParameters() AddRemoveNAParameter() HideFormatTableButton() + AddRemoveFirstParam() + AddRemoveThirdParam() + AddRemoveSecondParam() + AddRemoveFirstAnovaParam() + AddRemoveSecondAnovaParam() + AddRemoveThirdAnovaParam() End Sub Private Sub ChangeSumaryLabelText() @@ -721,19 +913,30 @@ Public Class dlgDescribeTwoVariable If IsFactorByFactor() Then strSummaryName = "Frequency tables" - ElseIf IsNumericByFactor() Then - strSummaryName = "Summary tables" Else If rdoTwoVariable.Checked Then If IsNumericByNumeric() Then strSummaryName = "Correlations" ElseIf IsFactorByNumeric() Then strSummaryName = "ANOVA tables" + ElseIf IsNumericByFactor() Then + strSummaryName = "Summary tables" Else strSummaryName = "" End If - ElseIf rdoThreeVariable.Checked Then - strSummaryName = "Summary tables" + End If + If rdoThreeVariable.Checked Then + If IsFactorByNumericByNumeric() Then + strSummaryName = "Correlations" + ElseIf IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() Then + strSummaryName = "ANOVA tables" + ElseIf IsNumericByFactorByFactor() Then + strSummaryName = "ANOVA tables" + ElseIf IsNumericByFactorByNumeric() Then + strSummaryName = "ANOVA tables" + Else + strSummaryName = "Summary tables" + End If End If End If @@ -750,7 +953,7 @@ Public Class dlgDescribeTwoVariable Private Sub AssignSecondVariableType() If rdoTwoVariable.Checked OrElse rdoThreeVariable.Checked Then Dim ucrCurrentReceiver As ucrReceiverSingle = If(rdoTwoVariable.Checked, - ucrReceiverSecondTwoVariableFactor, ucrReceiverThreeVariableThirdVariable) + ucrReceiverSecondTwoVariableFactor, ucrReceiverThreeVariableSecondFactor) If Not ucrCurrentReceiver.IsEmpty Then strSecondVariableType = If({"factor", "character", "logical"}.Contains(ucrCurrentReceiver.strCurrDataType), "categorical", "numeric") @@ -817,6 +1020,25 @@ Public Class dlgDescribeTwoVariable End If End Sub + Private Sub AssignThirdVariableType() + If rdoThreeVariable.Checked Then + Dim ucrCurrentReceiver As ucrReceiverSingle = ucrReceiverThreeVariableThirdVariable + If Not ucrCurrentReceiver.IsEmpty Then + strThirdVariableType = If({"factor", "character", "logical"}.Contains(ucrCurrentReceiver.strCurrDataType), + "categorical", "numeric") + lblThreeVariableCategorical.Text = strThirdVariableType + lblThreeVariableCategorical.ForeColor = SystemColors.Highlight + + Else + strThirdVariableType = "" + lblThreeVariableCategorical.Text = "________" + lblThreeVariableCategorical.ForeColor = SystemColors.ControlText + End If + ChangeSumaryLabelText() + End If + ManageControlsVisibility() + End Sub + Private Sub ucrReceiverFirstVars_ControlValueAndContentChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirstVars.ControlValueChanged, ucrReceiverFirstVars.ControlContentsChanged ChangeFirstTypeLabel() @@ -830,10 +1052,19 @@ Public Class dlgDescribeTwoVariable AddRemoveNAParameter() HideFormatTableButton() FactorColumns() + AddRemoveFirstParam() + AddRemoveFirstAnovaParam() + AddRemoveSecondAnovaParam() + AddRemoveThirdAnovaParam() End Sub Private Sub ucrReceiverThreeVariableSecondFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableSecondFactor.ControlValueChanged UpdateCombineFactorParameterFunction() + AssignSecondVariableType() + AddRemoveFirstParam() + AddRemoveSecondParam() + AddRemoveFirstAnovaParam() + AddRemoveSecondAnovaParam() End Sub Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirstVars.ControlContentsChanged, @@ -873,7 +1104,7 @@ Public Class dlgDescribeTwoVariable bContainedInMultipleReceiver = lstMultipleVariables.Contains(ucrReceiverSecondTwoVariableFactor.GetVariableNames) Else bContainedInMultipleReceiver = lstMultipleVariables.Contains(ucrReceiverThreeVariableSecondFactor.GetVariableNames) OrElse ( - lstMultipleVariables.Contains(ucrReceiverThreeVariableThirdVariable.GetVariableNames) AndAlso strSecondVariableType = "categorical") + lstMultipleVariables.Contains(ucrReceiverThreeVariableThirdVariable.GetVariableNames)) End If End If @@ -958,4 +1189,5 @@ Public Class dlgDescribeTwoVariable ManageControlsVisibility() SummariesInRowsOrCols() End Sub + End Class From dbfdb7c638bdc29e51227d0301422cf3a4a62976 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 13 Dec 2023 11:41:45 +0100 Subject: [PATCH 02/83] minor change --- instat/dlgSeasonalGraph.Designer.vb | 295 +++++++++++++++++++++++++++- instat/dlgSeasonalGraph.vb | 158 ++++++++++++++- instat/frmMain.Designer.vb | 1 - 3 files changed, 451 insertions(+), 3 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index 32effdb64af..06e7c4afb75 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -22,13 +22,284 @@ Partial Class dlgSeasonalGraph 'Ne la modifiez pas à l'aide de l'éditeur de code. _ Private Sub InitializeComponent() + Me.ucrSelectorForSeasonalGraph = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() + Me.rdoBar = New System.Windows.Forms.RadioButton() + Me.rdoLine = New System.Windows.Forms.RadioButton() + Me.ucrPnlOptions = New instat.UcrPanel() + Me.ucrChkColour = New instat.ucrCheck() + Me.lblXvariable = New System.Windows.Forms.Label() + Me.ucrReceiverX = New instat.ucrReceiverSingle() + Me.ucrReceiverRibbons = New instat.ucrReceiverMultiple() + Me.lblLines = New System.Windows.Forms.Label() + Me.ucrReceiverLines = New instat.ucrReceiverMultiple() + Me.ucrSave = New instat.ucrSave() + Me.ucrChkLegend = New instat.ucrCheck() + Me.ucrChkRibbons = New instat.ucrCheck() + Me.ucrInputStation = New instat.ucrInputComboBox() + Me.ucrReceiverFacetBy = New instat.ucrReceiverSingle() + Me.lblFacetBy = New System.Windows.Forms.Label() + Me.UcrInputColour = New instat.ucrInputComboBox() + Me.UcrInputLegend = New instat.ucrInputComboBox() + Me.cmdOptions = New instat.ucrSplitButton() Me.SuspendLayout() ' + 'ucrSelectorForSeasonalGraph + ' + Me.ucrSelectorForSeasonalGraph.AutoSize = True + Me.ucrSelectorForSeasonalGraph.bDropUnusedFilterLevels = False + Me.ucrSelectorForSeasonalGraph.bShowHiddenColumns = False + Me.ucrSelectorForSeasonalGraph.bUseCurrentFilter = True + Me.ucrSelectorForSeasonalGraph.Location = New System.Drawing.Point(13, 71) + Me.ucrSelectorForSeasonalGraph.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorForSeasonalGraph.Name = "ucrSelectorForSeasonalGraph" + Me.ucrSelectorForSeasonalGraph.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorForSeasonalGraph.TabIndex = 0 + ' + 'ucrBase + ' + Me.ucrBase.AutoSize = True + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(22, 469) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.TabIndex = 19 + ' + 'rdoBar + ' + Me.rdoBar.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoBar.BackColor = System.Drawing.SystemColors.Control + Me.rdoBar.Enabled = False + Me.rdoBar.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoBar.FlatAppearance.BorderSize = 2 + Me.rdoBar.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoBar.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoBar.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoBar.Location = New System.Drawing.Point(177, 20) + Me.rdoBar.Name = "rdoBar" + Me.rdoBar.Size = New System.Drawing.Size(80, 28) + Me.rdoBar.TabIndex = 3 + Me.rdoBar.TabStop = True + Me.rdoBar.Tag = "" + Me.rdoBar.Text = "Bar" + Me.rdoBar.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoBar.UseVisualStyleBackColor = False + ' + 'rdoLine + ' + Me.rdoLine.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoLine.BackColor = System.Drawing.SystemColors.Control + Me.rdoLine.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoLine.FlatAppearance.BorderSize = 2 + Me.rdoLine.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoLine.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoLine.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoLine.Location = New System.Drawing.Point(99, 20) + Me.rdoLine.Name = "rdoLine" + Me.rdoLine.Size = New System.Drawing.Size(80, 28) + Me.rdoLine.TabIndex = 2 + Me.rdoLine.TabStop = True + Me.rdoLine.Tag = "linepathstep" + Me.rdoLine.Text = "Line" + Me.rdoLine.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoLine.UseVisualStyleBackColor = False + ' + 'ucrPnlOptions + ' + Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOptions.Location = New System.Drawing.Point(95, 12) + Me.ucrPnlOptions.Name = "ucrPnlOptions" + Me.ucrPnlOptions.Size = New System.Drawing.Size(220, 44) + Me.ucrPnlOptions.TabIndex = 1 + ' + 'ucrChkColour + ' + Me.ucrChkColour.AutoSize = True + Me.ucrChkColour.Checked = False + Me.ucrChkColour.Location = New System.Drawing.Point(13, 300) + Me.ucrChkColour.Name = "ucrChkColour" + Me.ucrChkColour.Size = New System.Drawing.Size(110, 23) + Me.ucrChkColour.TabIndex = 15 + ' + 'lblXvariable + ' + Me.lblXvariable.AutoSize = True + Me.lblXvariable.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblXvariable.Location = New System.Drawing.Point(372, 355) + Me.lblXvariable.Name = "lblXvariable" + Me.lblXvariable.Size = New System.Drawing.Size(58, 13) + Me.lblXvariable.TabIndex = 8 + Me.lblXvariable.Text = "X Variable:" + ' + 'ucrReceiverX + ' + Me.ucrReceiverX.AutoSize = True + Me.ucrReceiverX.frmParent = Me + Me.ucrReceiverX.Location = New System.Drawing.Point(369, 370) + Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverX.Name = "ucrReceiverX" + Me.ucrReceiverX.Selector = Nothing + Me.ucrReceiverX.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverX.strNcFilePath = "" + Me.ucrReceiverX.TabIndex = 9 + Me.ucrReceiverX.ucrSelector = Nothing + ' + 'ucrReceiverRibbons + ' + Me.ucrReceiverRibbons.AutoSize = True + Me.ucrReceiverRibbons.frmParent = Me + Me.ucrReceiverRibbons.Location = New System.Drawing.Point(369, 241) + Me.ucrReceiverRibbons.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverRibbons.Name = "ucrReceiverRibbons" + Me.ucrReceiverRibbons.Selector = Nothing + Me.ucrReceiverRibbons.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverRibbons.strNcFilePath = "" + Me.ucrReceiverRibbons.TabIndex = 7 + Me.ucrReceiverRibbons.ucrSelector = Nothing + ' + 'lblLines + ' + Me.lblLines.AutoSize = True + Me.lblLines.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblLines.Location = New System.Drawing.Point(371, 78) + Me.lblLines.Name = "lblLines" + Me.lblLines.Size = New System.Drawing.Size(35, 13) + Me.lblLines.TabIndex = 4 + Me.lblLines.Text = "Lines:" + ' + 'ucrReceiverLines + ' + Me.ucrReceiverLines.AutoSize = True + Me.ucrReceiverLines.frmParent = Me + Me.ucrReceiverLines.Location = New System.Drawing.Point(369, 93) + Me.ucrReceiverLines.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverLines.Name = "ucrReceiverLines" + Me.ucrReceiverLines.Selector = Nothing + Me.ucrReceiverLines.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverLines.strNcFilePath = "" + Me.ucrReceiverLines.TabIndex = 5 + Me.ucrReceiverLines.ucrSelector = Nothing + ' + 'ucrSave + ' + Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSave.Location = New System.Drawing.Point(13, 424) + Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSave.Name = "ucrSave" + Me.ucrSave.Size = New System.Drawing.Size(317, 24) + Me.ucrSave.TabIndex = 13 + ' + 'ucrChkLegend + ' + Me.ucrChkLegend.AutoSize = True + Me.ucrChkLegend.Checked = False + Me.ucrChkLegend.Location = New System.Drawing.Point(13, 343) + Me.ucrChkLegend.Name = "ucrChkLegend" + Me.ucrChkLegend.Size = New System.Drawing.Size(110, 23) + Me.ucrChkLegend.TabIndex = 17 + ' + 'ucrChkRibbons + ' + Me.ucrChkRibbons.AutoSize = True + Me.ucrChkRibbons.Checked = False + Me.ucrChkRibbons.Location = New System.Drawing.Point(369, 208) + Me.ucrChkRibbons.Name = "ucrChkRibbons" + Me.ucrChkRibbons.Size = New System.Drawing.Size(114, 23) + Me.ucrChkRibbons.TabIndex = 6 + ' + 'ucrInputStation + ' + Me.ucrInputStation.AddQuotesIfUnrecognised = True + Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputStation.GetSetSelectedIndex = -1 + Me.ucrInputStation.IsReadOnly = False + Me.ucrInputStation.Location = New System.Drawing.Point(496, 422) + Me.ucrInputStation.Name = "ucrInputStation" + Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) + Me.ucrInputStation.TabIndex = 12 + ' + 'ucrReceiverFacetBy + ' + Me.ucrReceiverFacetBy.AutoSize = True + Me.ucrReceiverFacetBy.frmParent = Me + Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(369, 422) + Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" + Me.ucrReceiverFacetBy.Selector = Nothing + Me.ucrReceiverFacetBy.Size = New System.Drawing.Size(120, 26) + Me.ucrReceiverFacetBy.strNcFilePath = "" + Me.ucrReceiverFacetBy.TabIndex = 11 + Me.ucrReceiverFacetBy.ucrSelector = Nothing + ' + 'lblFacetBy + ' + Me.lblFacetBy.AutoSize = True + Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFacetBy.Location = New System.Drawing.Point(369, 407) + Me.lblFacetBy.Name = "lblFacetBy" + Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) + Me.lblFacetBy.TabIndex = 10 + Me.lblFacetBy.Tag = "" + Me.lblFacetBy.Text = "Facet By (Optional):" + ' + 'UcrInputColour + ' + Me.UcrInputColour.AddQuotesIfUnrecognised = True + Me.UcrInputColour.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.UcrInputColour.GetSetSelectedIndex = -1 + Me.UcrInputColour.IsReadOnly = False + Me.UcrInputColour.Location = New System.Drawing.Point(119, 302) + Me.UcrInputColour.Name = "UcrInputColour" + Me.UcrInputColour.Size = New System.Drawing.Size(82, 21) + Me.UcrInputColour.TabIndex = 16 + ' + 'UcrInputLegend + ' + Me.UcrInputLegend.AddQuotesIfUnrecognised = True + Me.UcrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.UcrInputLegend.GetSetSelectedIndex = -1 + Me.UcrInputLegend.IsReadOnly = False + Me.UcrInputLegend.Location = New System.Drawing.Point(119, 347) + Me.UcrInputLegend.Name = "UcrInputLegend" + Me.UcrInputLegend.Size = New System.Drawing.Size(82, 21) + Me.UcrInputLegend.TabIndex = 18 + ' + 'cmdOptions + ' + Me.cmdOptions.AutoSize = True + Me.cmdOptions.Location = New System.Drawing.Point(13, 266) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(148, 23) + Me.cmdOptions.TabIndex = 14 + Me.cmdOptions.Tag = "Plot Options" + Me.cmdOptions.Text = "Plot Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' 'dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(600, 450) + Me.ClientSize = New System.Drawing.Size(600, 533) + Me.Controls.Add(Me.cmdOptions) + Me.Controls.Add(Me.UcrInputLegend) + Me.Controls.Add(Me.UcrInputColour) + Me.Controls.Add(Me.ucrInputStation) + Me.Controls.Add(Me.ucrReceiverFacetBy) + Me.Controls.Add(Me.lblFacetBy) + Me.Controls.Add(Me.ucrChkRibbons) + Me.Controls.Add(Me.ucrChkColour) + Me.Controls.Add(Me.lblXvariable) + Me.Controls.Add(Me.ucrReceiverX) + Me.Controls.Add(Me.ucrReceiverRibbons) + Me.Controls.Add(Me.lblLines) + Me.Controls.Add(Me.ucrReceiverLines) + Me.Controls.Add(Me.ucrSave) + Me.Controls.Add(Me.ucrChkLegend) + Me.Controls.Add(Me.rdoBar) + Me.Controls.Add(Me.rdoLine) + Me.Controls.Add(Me.ucrPnlOptions) + Me.Controls.Add(Me.ucrSelectorForSeasonalGraph) + Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -36,6 +307,28 @@ Partial Class dlgSeasonalGraph Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Seasonal Graph" Me.ResumeLayout(False) + Me.PerformLayout() End Sub + + Friend WithEvents ucrSelectorForSeasonalGraph As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents rdoBar As RadioButton + Friend WithEvents rdoLine As RadioButton + Friend WithEvents ucrPnlOptions As UcrPanel + Friend WithEvents ucrChkColour As ucrCheck + Friend WithEvents lblXvariable As Label + Friend WithEvents ucrReceiverX As ucrReceiverSingle + Friend WithEvents ucrChkRibbons As ucrCheck + Friend WithEvents ucrReceiverRibbons As ucrReceiverMultiple + Friend WithEvents lblLines As Label + Friend WithEvents ucrReceiverLines As ucrReceiverMultiple + Friend WithEvents ucrSave As ucrSave + Friend WithEvents ucrChkLegend As ucrCheck + Friend WithEvents UcrInputLegend As ucrInputComboBox + Friend WithEvents UcrInputColour As ucrInputComboBox + Friend WithEvents ucrInputStation As ucrInputComboBox + Friend WithEvents ucrReceiverFacetBy As ucrReceiverSingle + Friend WithEvents lblFacetBy As Label + Friend WithEvents cmdOptions As ucrSplitButton End Class diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 57ef68e0d9f..a1181d548e7 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -1,3 +1,159 @@ -Public Class dlgSeasonalGraph +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . +Imports instat.Translations + +Public Class dlgSeasonalGraph + Private clsRaesFunction As New RFunction + Private clsBaseOperator As New ROperator + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsGeomLineFunction As New RFunction + Private bResetSubdialog As Boolean = True + Private clsGeomRibbonFunction As New RFunction + Private clsRggplotFunction As New RFunction + 'Private clsOptionsFunction As New RFunction + + 'Parameter names for geoms + Private strFirstParameterName As String = "geomLine" + Private strgeomRibbonParameterName As String = "geom_ribbon" + Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName} + + Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) + TestOkEnabled() + End Sub + + Private Sub InitialiseDialog() + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrBase.clsRsyntax.iCallType = 3 + + ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) + ucrSelectorForSeasonalGraph.SetParameterIsrfunction() + + ucrPnlOptions.AddRadioButton(rdoLine) + ucrPnlOptions.AddRadioButton(rdoBar) + + ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoLine, strFirstParameterName, {"geom_line", "geom_ribbon"}) + ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoBar, strgeomRibbonParameterName, {"geom_Bar"}) + + ucrReceiverLines.SetParameter(New RParameter("y", 1)) + ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph + ucrReceiverLines.strSelectorHeading = "Variables" + ucrReceiverLines.SetParameterIsString() + ucrReceiverLines.SetLinkedDisplayControl(lblLines) + ucrReceiverLines.bWithQuotes = False + + ucrReceiverX.SetParameter(New RParameter("x", 3)) + ucrReceiverX.Selector = ucrSelectorForSeasonalGraph + ucrReceiverX.strSelectorHeading = "Variables" + ucrReceiverX.bWithQuotes = False + ucrReceiverX.SetParameterIsString() + 'ucrReceiverX.SetValuesToIgnore({Chr(34) & Chr(34)}) + 'ucrReceiverX.bAddParameterIfEmpty = True + ucrReceiverX.SetClimaticType("month") + ucrReceiverX.bAutoFill = True + + ' ucrChkRibbons.SetParameter(New RParameter("geom_ribbon", 2)) + ucrChkRibbons.SetText("Ribbon(s):") + ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") + ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) + ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrReceiverRibbons.SetParameter(New RParameter("y", 2)) + ucrReceiverRibbons.Selector = ucrSelectorForSeasonalGraph + ucrReceiverRibbons.strSelectorHeading = "Variables" + ucrReceiverRibbons.SetParameterIsString() + ucrReceiverRibbons.bWithQuotes = False + + ucrSave.SetPrefix("Seasonal_Graph") + ucrSave.SetIsComboBox() + ucrSave.SetSaveTypeAsGraph() + ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) + ucrSave.SetAssignToIfUncheckedValue("last_graph") + End Sub + + Private Sub SetDefaults() + clsRggplotFunction = New RFunction + clsGeomLineFunction = New RFunction + clsRaesFunction = New RFunction + clsBaseOperator = New ROperator + clsGeomLineFunction = New RFunction + clsGeomRibbonFunction = New RFunction + + ucrSelectorForSeasonalGraph.Reset() + ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) + ucrSave.Reset() + ucrReceiverLines.SetMeAsReceiver() + bResetSubdialog = True + + clsBaseOperator.SetOperation("+") + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) + + clsRggplotFunction.SetPackageName("ggplot2") + clsRggplotFunction.SetRCommand("ggplot") + clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) + + clsGeomLineFunction.SetPackageName("ggplot2") + clsGeomLineFunction.SetRCommand("geom_line") + + clsRaesFunction.SetPackageName("ggplot2") + clsRaesFunction.SetRCommand("aes") + + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + End Sub + + Private Sub SetRCodeForControls(bReset) + ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) + ucrReceiverLines.SetRCode(clsRaesFunction, bReset) + ucrReceiverRibbons.SetRCode(clsRaesFunction, bReset) + ucrReceiverX.SetRCode(clsRaesFunction, bReset) + ucrChkRibbons.SetRCode(clsBaseOperator, bReset) + ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseOperator, bReset) + + End Sub + + Private Sub TestOkEnabled() + + End Sub + + Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged + If ucrChkRibbons.Checked Then + ucrReceiverRibbons.Visible = True + ucrReceiverRibbons.SetMeAsReceiver() + If Not ucrReceiverRibbons.IsEmpty Then + clsRaesFunction.AddParameter("y", ucrReceiverRibbons.GetVariableNames(False), iPosition:=1) + End If + clsBaseOperator.AddParameter("geom_ribbon", clsRFunctionParameter:=clsGeomRibbonFunction) + Else + ucrReceiverRibbons.Visible = False + clsBaseOperator.RemoveParameterByName("geom_ribbon") + End If + End Sub End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index d5dc9e36a17..4cea771bf73 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -2183,7 +2183,6 @@ Partial Class frmMain ' 'mnuClimaticDescribeSeasonalGraph ' - Me.mnuClimaticDescribeSeasonalGraph.Enabled = False Me.mnuClimaticDescribeSeasonalGraph.Name = "mnuClimaticDescribeSeasonalGraph" Me.mnuClimaticDescribeSeasonalGraph.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeSeasonalGraph.Text = "Seasonal Graph..." From 0e22e394589a1074f23174ef85a5a3f4633891e6 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 14 Dec 2023 11:58:21 +0100 Subject: [PATCH 03/83] minor change --- instat/dlgSeasonalGraph.vb | 101 ++++++++++++++++++++++++++++++++++--- 1 file changed, 94 insertions(+), 7 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index a1181d548e7..db2eadf921d 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -18,6 +18,8 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction + Private clsRaesLineFunction As New RFunction + Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -25,7 +27,10 @@ Public Class dlgSeasonalGraph Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction - 'Private clsOptionsFunction As New RFunction + Private clsRggplotRibFunction As New RFunction + Private clsRggplotLineFunction As New RFunction + Private clsOptionsFunction As New RFunction + Private lstSelectedVariables As New List(Of ucrCore) 'Parameter names for geoms Private strFirstParameterName As String = "geomLine" @@ -97,9 +102,14 @@ Public Class dlgSeasonalGraph End Sub Private Sub SetDefaults() + clsOptionsFunction = New RFunction clsRggplotFunction = New RFunction + clsRggplotRibFunction = New RFunction + clsRggplotLineFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction + clsRaesLineFunction = New RFunction + clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction @@ -121,22 +131,48 @@ Public Class dlgSeasonalGraph clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") + clsOptionsFunction.SetPackageName("ggplot2") + clsOptionsFunction.SetRCommand("geom_line") + clsRaesFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") + clsRggplotLineFunction.SetPackageName("ggplot2") + clsRggplotLineFunction.SetRCommand("ggplot") + clsRggplotLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesLineFunction, iPosition:=1) + + clsRaesLineFunction.SetPackageName("ggplot2") + clsRaesLineFunction.SetRCommand("aes") + + clsRggplotRibFunction.SetPackageName("ggplot2") + clsRggplotRibFunction.SetRCommand("ggplot") + clsRggplotRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=0) + + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + + clsGeomRibbonFunction.SetPackageName("ggplot2") + clsGeomRibbonFunction.SetRCommand("geom_ribbon") + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset) + ucrReceiverLines.AddAdditionalCodeParameterPair(clsRaesLineFunction, New RParameter("y", iNewPosition:=1), iAdditionalPairNo:=1) + ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) - ucrReceiverLines.SetRCode(clsRaesFunction, bReset) - ucrReceiverRibbons.SetRCode(clsRaesFunction, bReset) ucrReceiverX.SetRCode(clsRaesFunction, bReset) - ucrChkRibbons.SetRCode(clsBaseOperator, bReset) ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseOperator, bReset) + ucrSave.SetRCode(clsBaseOperator, bReset) + + If bReset Then + ucrReceiverRibbons.SetRCode(clsRaesRibFunction, bReset) + ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) + ucrReceiverLines.SetRCode(clsRaesFunction, bReset) + End If End Sub Private Sub TestOkEnabled() @@ -148,12 +184,63 @@ Public Class dlgSeasonalGraph ucrReceiverRibbons.Visible = True ucrReceiverRibbons.SetMeAsReceiver() If Not ucrReceiverRibbons.IsEmpty Then - clsRaesFunction.AddParameter("y", ucrReceiverRibbons.GetVariableNames(False), iPosition:=1) + clsRaesRibFunction.AddParameter("y", ucrReceiverRibbons.GetVariableNames(False), iPosition:=1) + clsGeomRibbonFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotRibFunction, bIncludeArgumentName:=False, iPosition:=0) + Else + clsGeomRibbonFunction.RemoveParameterByName("var") End If clsBaseOperator.AddParameter("geom_ribbon", clsRFunctionParameter:=clsGeomRibbonFunction) - Else - ucrReceiverRibbons.Visible = False + Else + ucrReceiverRibbons.Visible = False clsBaseOperator.RemoveParameterByName("geom_ribbon") End If End Sub + + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged + TestOkEnabled() + End Sub + + Private Sub ListGeom() + If Not ucrReceiverLines.IsEmpty AndAlso ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then + 'clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) + 'For i = 1 To lstSelectedVariables.Count - 1 + ' Select Case i + ' Case 0 + ' clsOptionsFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) + ' 'clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) + ' clsOptionsFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotLineFunction, bIncludeArgumentName:=False, iPosition:=0) + ' clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsOptionsFunction) + + ' Case 1 + ' clsOptionsFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(1).Text) + ' 'clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(1).Text) + ' clsOptionsFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotLineFunction, bIncludeArgumentName:=False, iPosition:=0) + ' clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsOptionsFunction) + ' Case 2 + ' clsOptionsFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(2).Text) + ' 'clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(2).Text) + ' clsOptionsFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotLineFunction, bIncludeArgumentName:=False, iPosition:=0) + ' clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsOptionsFunction) + + ' End Select + 'Next + For i = 0 To lstSelectedVariables.Count - 1 + Select Case i + Case 0 + clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) + 'clsRaesLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) + Case 1 + clsRaesLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(1).Text) + + Case 2 + clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(2).Text) + End Select + Next + End If + + End Sub + + Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged + ListGeom() + End Sub End Class \ No newline at end of file From cd9162493f2242f549cffedf7410c75a5cc19820 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Fri, 15 Dec 2023 11:14:46 +0100 Subject: [PATCH 04/83] Cosmetic Changes --- instat/dlgDescribeTwoVariable.Designer.vb | 78 +++++++++++------------ instat/dlgDescribeTwoVariable.vb | 4 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index e4176b1f531..3543b422041 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,12 +60,12 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() - Me.ucrChkPercentageProportion = New instat.ucrCheck() Me.lblFactorAsPercentage = New System.Windows.Forms.Label() - Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() + Me.ucrChkPercentageProportion = New instat.ucrCheck() + Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrChkDisplayMargins = New instat.ucrCheck() @@ -161,7 +161,7 @@ Partial Class dlgDescribeTwoVariable Me.grpSummaries.Controls.Add(Me.lblSecondType) Me.grpSummaries.Location = New System.Drawing.Point(11, 219) Me.grpSummaries.Name = "grpSummaries" - Me.grpSummaries.Size = New System.Drawing.Size(210, 72) + Me.grpSummaries.Size = New System.Drawing.Size(192, 72) Me.grpSummaries.TabIndex = 39 Me.grpSummaries.TabStop = False ' @@ -178,7 +178,7 @@ Partial Class dlgDescribeTwoVariable ' Me.lblSecondBy.AutoSize = True Me.lblSecondBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondBy.Location = New System.Drawing.Point(180, 16) + Me.lblSecondBy.Location = New System.Drawing.Point(15, 32) Me.lblSecondBy.Name = "lblSecondBy" Me.lblSecondBy.Size = New System.Drawing.Size(18, 13) Me.lblSecondBy.TabIndex = 1 @@ -188,7 +188,7 @@ Partial Class dlgDescribeTwoVariable ' Me.lblThreeVariableCategorical.AutoSize = True Me.lblThreeVariableCategorical.ForeColor = System.Drawing.SystemColors.Highlight - Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(12, 33) + Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(47, 33) Me.lblThreeVariableCategorical.Name = "lblThreeVariableCategorical" Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(59, 13) Me.lblThreeVariableCategorical.TabIndex = 3 @@ -328,16 +328,6 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(143, 34) - Me.ucrChkPercentageProportion.TabIndex = 57 - ' 'lblFactorAsPercentage ' Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -348,29 +338,6 @@ Partial Class dlgDescribeTwoVariable Me.lblFactorAsPercentage.Tag = "" Me.lblFactorAsPercentage.Text = "Factor as Percentage:" ' - 'ucrReceiverPercentages - ' - Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) - Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" - Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(143, 20) - Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 55 - Me.ucrReceiverPercentages.ucrSelector = Nothing - ' - 'ucrChkDisplayAsPercentage - ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 17) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(143, 34) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 - ' 'ucrReceiverFirstVars ' Me.ucrReceiverFirstVars.AutoSize = True @@ -393,6 +360,39 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Size = New System.Drawing.Size(399, 24) Me.ucrSaveTable.TabIndex = 57 ' + 'ucrChkPercentageProportion + ' + Me.ucrChkPercentageProportion.AutoSize = True + Me.ucrChkPercentageProportion.Checked = False + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(143, 34) + Me.ucrChkPercentageProportion.TabIndex = 57 + ' + 'ucrReceiverPercentages + ' + Me.ucrReceiverPercentages.AutoSize = True + Me.ucrReceiverPercentages.frmParent = Nothing + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) + Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" + Me.ucrReceiverPercentages.Selector = Nothing + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(143, 20) + Me.ucrReceiverPercentages.strNcFilePath = "" + Me.ucrReceiverPercentages.TabIndex = 55 + Me.ucrReceiverPercentages.ucrSelector = Nothing + ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 17) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(143, 34) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 + ' 'ucrInputMarginName ' Me.ucrInputMarginName.AddQuotesIfUnrecognised = True diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 88adadb0f8b..270adc0ce77 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -650,8 +650,8 @@ Public Class dlgDescribeTwoVariable ElseIf rdoThreeVariable.Checked Then ucrReceiverFirstVars.SetSingleTypeStatus(True, bIsCategoricalNumeric:=True) lblThreeVariableCategorical.Visible = True - lblThreeVariableCategorical.Location = New Point(106, 18) - lblSecondType.Location = New Point(12, 33) + lblThreeVariableCategorical.Location = New Point(38, 33) + lblSecondType.Location = New Point(106, 18) lblSecondBy.Visible = True Else ucrReceiverFirstVars.SetSingleTypeStatus(True, bIsCategoricalNumeric:=True) From 01ec6a82e830831e5d4d24ed81fa043815666dc8 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Mon, 18 Dec 2023 08:13:25 +0100 Subject: [PATCH 05/83] minor change --- instat/dlgSeasonalGraph.vb | 481 ++++++++++++++++++------------------- 1 file changed, 235 insertions(+), 246 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index db2eadf921d..4892cebacfb 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -1,246 +1,235 @@ -' R- Instat -' Copyright (C) 2015-2017 -' -' This program is free software: you can redistribute it and/or modify -' it under the terms of the GNU General Public License as published by -' the Free Software Foundation, either version 3 of the License, or -' (at your option) any later version. -' -' This program is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU General Public License for more details. -' -' You should have received a copy of the GNU General Public License -' along with this program. If not, see . - -Imports instat.Translations - -Public Class dlgSeasonalGraph - Private clsRaesFunction As New RFunction - Private clsRaesLineFunction As New RFunction - Private clsRaesRibFunction As New RFunction - Private clsBaseOperator As New ROperator - Private bFirstLoad As Boolean = True - Private bReset As Boolean = True - Private clsGeomLineFunction As New RFunction - Private bResetSubdialog As Boolean = True - Private clsGeomRibbonFunction As New RFunction - Private clsRggplotFunction As New RFunction - Private clsRggplotRibFunction As New RFunction - Private clsRggplotLineFunction As New RFunction - Private clsOptionsFunction As New RFunction - Private lstSelectedVariables As New List(Of ucrCore) - - 'Parameter names for geoms - Private strFirstParameterName As String = "geomLine" - Private strgeomRibbonParameterName As String = "geom_ribbon" - Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName} - - Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load - If bFirstLoad Then - InitialiseDialog() - bFirstLoad = False - End If - If bReset Then - SetDefaults() - End If - SetRCodeForControls(bReset) - bReset = False - autoTranslate(Me) - TestOkEnabled() - End Sub - - Private Sub InitialiseDialog() - ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - ucrBase.clsRsyntax.iCallType = 3 - - ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) - ucrSelectorForSeasonalGraph.SetParameterIsrfunction() - - ucrPnlOptions.AddRadioButton(rdoLine) - ucrPnlOptions.AddRadioButton(rdoBar) - - ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoLine, strFirstParameterName, {"geom_line", "geom_ribbon"}) - ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoBar, strgeomRibbonParameterName, {"geom_Bar"}) - - ucrReceiverLines.SetParameter(New RParameter("y", 1)) - ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph - ucrReceiverLines.strSelectorHeading = "Variables" - ucrReceiverLines.SetParameterIsString() - ucrReceiverLines.SetLinkedDisplayControl(lblLines) - ucrReceiverLines.bWithQuotes = False - - ucrReceiverX.SetParameter(New RParameter("x", 3)) - ucrReceiverX.Selector = ucrSelectorForSeasonalGraph - ucrReceiverX.strSelectorHeading = "Variables" - ucrReceiverX.bWithQuotes = False - ucrReceiverX.SetParameterIsString() - 'ucrReceiverX.SetValuesToIgnore({Chr(34) & Chr(34)}) - 'ucrReceiverX.bAddParameterIfEmpty = True - ucrReceiverX.SetClimaticType("month") - ucrReceiverX.bAutoFill = True - - ' ucrChkRibbons.SetParameter(New RParameter("geom_ribbon", 2)) - ucrChkRibbons.SetText("Ribbon(s):") - ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") - ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) - ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - - ucrReceiverRibbons.SetParameter(New RParameter("y", 2)) - ucrReceiverRibbons.Selector = ucrSelectorForSeasonalGraph - ucrReceiverRibbons.strSelectorHeading = "Variables" - ucrReceiverRibbons.SetParameterIsString() - ucrReceiverRibbons.bWithQuotes = False - - ucrSave.SetPrefix("Seasonal_Graph") - ucrSave.SetIsComboBox() - ucrSave.SetSaveTypeAsGraph() - ucrSave.SetCheckBoxText("Save Graph") - ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) - ucrSave.SetAssignToIfUncheckedValue("last_graph") - End Sub - - Private Sub SetDefaults() - clsOptionsFunction = New RFunction - clsRggplotFunction = New RFunction - clsRggplotRibFunction = New RFunction - clsRggplotLineFunction = New RFunction - clsGeomLineFunction = New RFunction - clsRaesFunction = New RFunction - clsRaesLineFunction = New RFunction - clsRaesRibFunction = New RFunction - clsBaseOperator = New ROperator - clsGeomLineFunction = New RFunction - clsGeomRibbonFunction = New RFunction - - ucrSelectorForSeasonalGraph.Reset() - ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) - ucrSave.Reset() - ucrReceiverLines.SetMeAsReceiver() - bResetSubdialog = True - - clsBaseOperator.SetOperation("+") - clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) - clsBaseOperator.AddParameter(strFirstParameterName, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) - - clsRggplotFunction.SetPackageName("ggplot2") - clsRggplotFunction.SetRCommand("ggplot") - clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) - - clsGeomLineFunction.SetPackageName("ggplot2") - clsGeomLineFunction.SetRCommand("geom_line") - - clsOptionsFunction.SetPackageName("ggplot2") - clsOptionsFunction.SetRCommand("geom_line") - - clsRaesFunction.SetPackageName("ggplot2") - clsRaesFunction.SetRCommand("aes") - - clsRggplotLineFunction.SetPackageName("ggplot2") - clsRggplotLineFunction.SetRCommand("ggplot") - clsRggplotLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesLineFunction, iPosition:=1) - - clsRaesLineFunction.SetPackageName("ggplot2") - clsRaesLineFunction.SetRCommand("aes") - - clsRggplotRibFunction.SetPackageName("ggplot2") - clsRggplotRibFunction.SetRCommand("ggplot") - clsRggplotRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=0) - - clsRaesRibFunction.SetPackageName("ggplot2") - clsRaesRibFunction.SetRCommand("aes") - - clsGeomRibbonFunction.SetPackageName("ggplot2") - clsGeomRibbonFunction.SetRCommand("geom_ribbon") - - clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) - clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") - ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) - End Sub - - Private Sub SetRCodeForControls(bReset) - ucrReceiverLines.AddAdditionalCodeParameterPair(clsRaesLineFunction, New RParameter("y", iNewPosition:=1), iAdditionalPairNo:=1) - - ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) - ucrReceiverX.SetRCode(clsRaesFunction, bReset) - ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseOperator, bReset) - ucrSave.SetRCode(clsBaseOperator, bReset) - - If bReset Then - ucrReceiverRibbons.SetRCode(clsRaesRibFunction, bReset) - ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) - ucrReceiverLines.SetRCode(clsRaesFunction, bReset) - - End If - End Sub - - Private Sub TestOkEnabled() - - End Sub - - Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged - If ucrChkRibbons.Checked Then - ucrReceiverRibbons.Visible = True - ucrReceiverRibbons.SetMeAsReceiver() - If Not ucrReceiverRibbons.IsEmpty Then - clsRaesRibFunction.AddParameter("y", ucrReceiverRibbons.GetVariableNames(False), iPosition:=1) - clsGeomRibbonFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotRibFunction, bIncludeArgumentName:=False, iPosition:=0) - Else - clsGeomRibbonFunction.RemoveParameterByName("var") - End If - clsBaseOperator.AddParameter("geom_ribbon", clsRFunctionParameter:=clsGeomRibbonFunction) - Else - ucrReceiverRibbons.Visible = False - clsBaseOperator.RemoveParameterByName("geom_ribbon") - End If - End Sub - - Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged - TestOkEnabled() - End Sub - - Private Sub ListGeom() - If Not ucrReceiverLines.IsEmpty AndAlso ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then - 'clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) - 'For i = 1 To lstSelectedVariables.Count - 1 - ' Select Case i - ' Case 0 - ' clsOptionsFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) - ' 'clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) - ' clsOptionsFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotLineFunction, bIncludeArgumentName:=False, iPosition:=0) - ' clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsOptionsFunction) - - ' Case 1 - ' clsOptionsFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(1).Text) - ' 'clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(1).Text) - ' clsOptionsFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotLineFunction, bIncludeArgumentName:=False, iPosition:=0) - ' clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsOptionsFunction) - ' Case 2 - ' clsOptionsFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(2).Text) - ' 'clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(2).Text) - ' clsOptionsFunction.AddParameter("var", clsRFunctionParameter:=clsRggplotLineFunction, bIncludeArgumentName:=False, iPosition:=0) - ' clsBaseOperator.AddParameter("geom_line", clsRFunctionParameter:=clsOptionsFunction) - - ' End Select - 'Next - For i = 0 To lstSelectedVariables.Count - 1 - Select Case i - Case 0 - clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) - 'clsRaesLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) - Case 1 - clsRaesLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(1).Text) - - Case 2 - clsGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(2).Text) - End Select - Next - End If - - End Sub - - Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged - ListGeom() - End Sub -End Class \ No newline at end of file +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . + +Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction Private clsRaesGeomLineFunction As New RFunction Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsGeomLineFunction As New RFunction Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction Private clsRggplotRibFunction As New RFunction Private clsRggplotLineFunction As New RFunction Private clsFacetFunction As New RFunction + Private clsFacetOperator As New ROperator + Private clsFacetRowOp As New ROperator + Private clsFacetColOp As New ROperator + Private clsGroupByFunction As New RFunction + Private clsPipeOperator As New ROperator + + Private bUpdatingParameters As Boolean = False + Private ReadOnly strFacetWrap As String = "Facet Wrap" + Private ReadOnly strFacetRow As String = "Facet Row" + Private ReadOnly strFacetCol As String = "Facet Column" Private lstSelectedVariables As New List(Of ucrCore) + + 'Parameter names for geoms + Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.iCallType = 3 ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoLine, strFirstParameterName, {"geom_line", "geom_ribbon"}) ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoBar, strgeomRibbonParameterName, {"geom_Bar"}) + + 'ucrReceiverLines.SetParameter(New RParameter("y", 1)) + ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False ucrReceiverX.SetParameter(New RParameter("x", 3)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" ucrReceiverX.bWithQuotes = False ucrReceiverX.SetParameterIsString() + 'ucrReceiverX.SetValuesToIgnore({Chr(34) & Chr(34)}) + 'ucrReceiverX.bAddParameterIfEmpty = True + ucrReceiverX.SetClimaticType("month") ucrReceiverX.bAutoFill = True + + ' ucrChkRibbons.SetParameter(New RParameter("geom_ribbon", 2)) + ucrChkRibbons.SetText("Ribbon(s):") ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrReceiverRibbons.SetParameter(New RParameter("y", 2)) + ucrReceiverRibbons.Selector = ucrSelectorForSeasonalGraph ucrReceiverRibbons.strSelectorHeading = "Variables" ucrReceiverRibbons.SetParameterIsString() ucrReceiverRibbons.bWithQuotes = False + + ucrReceiverFacetBy.SetParameter(New RParameter("")) + ucrReceiverFacetBy.Selector = ucrSelectorForSeasonalGraph + ucrReceiverFacetBy.SetIncludedDataTypes({"factor"}) + ucrReceiverFacetBy.strSelectorHeading = "Factors" + ucrReceiverFacetBy.bWithQuotes = False + ucrReceiverFacetBy.SetParameterIsString() + ucrReceiverFacetBy.SetValuesToIgnore({"."}) ucrInputStation.SetItems({strFacetWrap, strFacetRow, strFacetCol, strNone}) + ucrInputStation.SetDropDownStyleAsNonEditable() ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsRggplotRibFunction = New RFunction clsRggplotLineFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction + clsFacetFunction = New RFunction + clsFacetOperator = New ROperator + clsFacetRowOp = New ROperator + clsFacetColOp = New ROperator clsPipeOperator = New ROperator ucrSelectorForSeasonalGraph.Reset() ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) ucrSave.Reset() ucrReceiverLines.SetMeAsReceiver() bResetSubdialog = True clsBaseOperator.SetOperation("+") clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) clsRggplotFunction.SetPackageName("ggplot2") clsRggplotFunction.SetRCommand("ggplot") clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) clsRaesFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") + + clsFacetFunction.SetPackageName("ggplot2") + clsFacetRowOp.SetOperation("+") + clsFacetRowOp.bBrackets = False + clsFacetColOp.SetOperation("+") + clsFacetColOp.bBrackets = False + clsFacetOperator.SetOperation("~") + clsFacetOperator.bForceIncludeOperation = True + clsFacetOperator.bBrackets = False + clsFacetFunction.AddParameter("facets", clsROperatorParameter:=clsFacetOperator, iPosition:=0) + + clsPipeOperator.SetOperation("%>%") + SetPipeAssignTo() + + ucrInputStation.SetName(strFacetWrap) + ucrInputStation.bUpdateRCodeFromControl = True + + clsGroupByFunction.SetPackageName("dplyr") + clsGroupByFunction.SetRCommand("group_by") + + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset) + ' ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseOperator, bReset) + ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) ucrReceiverX.SetRCode(clsRaesFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) + If bReset Then + ucrReceiverRibbons.SetRCode(clsRaesRibFunction, bReset) + ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) + End If + End Sub Private Sub TestOkEnabled() End Sub + + Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged If ucrChkRibbons.Checked Then ucrReceiverRibbons.Visible = True ucrReceiverRibbons.SetMeAsReceiver() + If ucrReceiverRibbons.lstSelectedVariables.Items.Count > 0 Then + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 + Dim clsRaesRibFunction As New RFunction + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + clsRaesRibFunction.AddParameter("y", ucrReceiverRibbons.lstSelectedVariables.Items(i).Text) + Dim clsGeomRibbonFunction As New RFunction + clsGeomRibbonFunction.SetPackageName("ggplot2") + clsGeomRibbonFunction.SetRCommand("geom_ribbon") + clsGeomRibbonFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) + clsBaseOperator.AddParameter(strgeomRibbonParameterName & i, clsRFunctionParameter:=clsGeomRibbonFunction, iPosition:=3) + Next + End If + Else ucrReceiverRibbons.Visible = False clsBaseOperator.RemoveParameterByName("geom_ribbon") End If End Sub Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next End If End Sub Private Sub UpdateParameters() + clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) + clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) + clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) + + clsBaseOperator.RemoveParameterByName("facets") + bUpdatingParameters = True + ucrReceiverFacetBy.SetRCode(Nothing) + Select Case ucrInputStation.GetText() + Case strFacetWrap + ucrReceiverFacetBy.ChangeParameterName("wrap" & ucrInputStation.Name) + ucrReceiverFacetBy.SetRCode(clsFacetOperator) + Case strFacetCol + ucrReceiverFacetBy.ChangeParameterName("col" & ucrInputStation.Name) + ucrReceiverFacetBy.SetRCode(clsFacetColOp) + Case strFacetRow + ucrReceiverFacetBy.ChangeParameterName("row" & ucrInputStation.Name) + ucrReceiverFacetBy.SetRCode(clsFacetRowOp) + End Select + If Not clsRaesFunction.ContainsParameter("x") Then + clsRaesFunction.AddParameter("x", Chr(34) & Chr(34)) + End If + bUpdatingParameters = False + End Sub + + Private Sub AddRemoveFacets() + Dim bWrap As Boolean = False + Dim bCol As Boolean = False + Dim bRow As Boolean = False + + If bUpdatingParameters Then + Exit Sub + End If + + clsBaseOperator.RemoveParameterByName("facets") + If Not ucrReceiverFacetBy.IsEmpty Then + Select Case ucrInputStation.GetText() + Case strFacetWrap + bWrap = True + Case strFacetCol + bCol = True + Case strFacetRow + bRow = True + End Select + End If + + If bWrap OrElse bRow OrElse bCol Then + clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction) + End If + If bWrap Then + clsFacetFunction.SetRCommand("facet_wrap") + End If + If bRow OrElse bCol Then + clsFacetFunction.SetRCommand("facet_grid") + End If + If bRow Then + clsFacetOperator.AddParameter("left", clsROperatorParameter:=clsFacetRowOp, iPosition:=0) + ElseIf bCol AndAlso bWrap = False Then + clsFacetOperator.AddParameter("left", ".", iPosition:=0) + Else + clsFacetOperator.RemoveParameterByName("left") + End If + If bCol Then + clsFacetOperator.AddParameter("right", clsROperatorParameter:=clsFacetColOp, iPosition:=1) + ElseIf bRow AndAlso bWrap = False Then + clsFacetOperator.AddParameter("right", ".", iPosition:=1) + Else + clsFacetOperator.RemoveParameterByName("right") + End If + End Sub + + Private Sub AddRemoveGroupBy() + + If clsPipeOperator.ContainsParameter("mutate") Then + clsGroupByFunction.ClearParameters() + If clsBaseOperator.ContainsParameter("facets") Then + Select Case ucrInputStation.GetText() + Case strFacetWrap + GetParameterValue(clsFacetOperator) + Case strFacetCol + GetParameterValue(clsFacetColOp) + Case strFacetRow + GetParameterValue(clsFacetRowOp) + End Select + End If + + If clsRaesFunction.ContainsParameter("colour") Then + clsGroupByFunction.AddParameter("colour", ucrReceiverColourBy.GetVariableNames(bWithQuotes:=False), bIncludeArgumentName:=False, iPosition:=0) + End If + + If clsGroupByFunction.iParameterCount > 0 Then + clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) + Else + clsPipeOperator.RemoveParameterByName("group_by") + End If + Else + clsPipeOperator.RemoveParameterByName("group_by") + End If + + SetPipeAssignTo() + End Sub + + Private Sub GetParameterValue(clsOperator As ROperator) + Dim i As Integer = 0 + For Each clsTempParam As RParameter In clsOperator.clsParameters + If clsTempParam.strArgumentValue <> "" AndAlso clsTempParam.strArgumentValue <> "." Then + clsGroupByFunction.AddParameter(i, clsTempParam.strArgumentValue, bIncludeArgumentName:=False, iPosition:=i) + i = i + 1 + End If + Next + End Sub + + Private Sub SetPipeAssignTo() + If ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso clsPipeOperator.clsParameters.Count > 1 Then + clsPipeOperator.SetAssignTo(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text) + Else + clsPipeOperator.RemoveAssignTo() + End If + End Sub + + Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged, ucrReceiverColourBy.ControlValueChanged, ucrReceiverX.ControlValueChanged + AddRemoveFacets() + AddRemoveGroupBy() + End Sub + + Private Sub AutoFacetStation() + Dim ucrCurrentReceiver As ucrReceiver = Nothing + + If ucrSelectorForSeasonalGraph.CurrentReceiver IsNot Nothing Then + ucrCurrentReceiver = ucrSelectorForSeasonalGraph.CurrentReceiver + End If + ucrReceiverFacetBy.AddItemsWithMetadataProperty(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"station_label"}) + If ucrCurrentReceiver IsNot Nothing Then + ucrCurrentReceiver.SetMeAsReceiver() + End If + AddRemoveGroupBy() + End Sub Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub End Class \ No newline at end of file From 87b66564a3f53b8336c68c68e6bf9bb7018d32af Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Mon, 18 Dec 2023 14:49:10 +0100 Subject: [PATCH 06/83] minor change --- instat/dlgSeasonalGraph.Designer.vb | 75 +++++------ instat/dlgSeasonalGraph.vb | 199 +++++++++++++++++++++++++--- 2 files changed, 219 insertions(+), 55 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index 06e7c4afb75..9b7342defe5 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -40,7 +40,7 @@ Partial Class dlgSeasonalGraph Me.ucrReceiverFacetBy = New instat.ucrReceiverSingle() Me.lblFacetBy = New System.Windows.Forms.Label() Me.UcrInputColour = New instat.ucrInputComboBox() - Me.UcrInputLegend = New instat.ucrInputComboBox() + Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.cmdOptions = New instat.ucrSplitButton() Me.SuspendLayout() ' @@ -60,7 +60,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(22, 469) + Me.ucrBase.Location = New System.Drawing.Point(22, 428) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 19 @@ -75,7 +75,7 @@ Partial Class dlgSeasonalGraph Me.rdoBar.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoBar.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoBar.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoBar.Location = New System.Drawing.Point(177, 20) + Me.rdoBar.Location = New System.Drawing.Point(204, 20) Me.rdoBar.Name = "rdoBar" Me.rdoBar.Size = New System.Drawing.Size(80, 28) Me.rdoBar.TabIndex = 3 @@ -94,7 +94,7 @@ Partial Class dlgSeasonalGraph Me.rdoLine.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoLine.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoLine.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoLine.Location = New System.Drawing.Point(99, 20) + Me.rdoLine.Location = New System.Drawing.Point(126, 20) Me.rdoLine.Name = "rdoLine" Me.rdoLine.Size = New System.Drawing.Size(80, 28) Me.rdoLine.TabIndex = 2 @@ -107,7 +107,7 @@ Partial Class dlgSeasonalGraph 'ucrPnlOptions ' Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlOptions.Location = New System.Drawing.Point(95, 12) + Me.ucrPnlOptions.Location = New System.Drawing.Point(122, 12) Me.ucrPnlOptions.Name = "ucrPnlOptions" Me.ucrPnlOptions.Size = New System.Drawing.Size(220, 44) Me.ucrPnlOptions.TabIndex = 1 @@ -116,52 +116,53 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkColour.AutoSize = True Me.ucrChkColour.Checked = False + Me.ucrChkColour.Enabled = False Me.ucrChkColour.Location = New System.Drawing.Point(13, 300) Me.ucrChkColour.Name = "ucrChkColour" - Me.ucrChkColour.Size = New System.Drawing.Size(110, 23) + Me.ucrChkColour.Size = New System.Drawing.Size(88, 23) Me.ucrChkColour.TabIndex = 15 ' 'lblXvariable ' Me.lblXvariable.AutoSize = True Me.lblXvariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblXvariable.Location = New System.Drawing.Point(372, 355) + Me.lblXvariable.Location = New System.Drawing.Point(276, 314) Me.lblXvariable.Name = "lblXvariable" Me.lblXvariable.Size = New System.Drawing.Size(58, 13) - Me.lblXvariable.TabIndex = 8 + Me.lblXvariable.TabIndex = 6 Me.lblXvariable.Text = "X Variable:" ' 'ucrReceiverX ' Me.ucrReceiverX.AutoSize = True Me.ucrReceiverX.frmParent = Me - Me.ucrReceiverX.Location = New System.Drawing.Point(369, 370) + Me.ucrReceiverX.Location = New System.Drawing.Point(273, 329) Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverX.Name = "ucrReceiverX" Me.ucrReceiverX.Selector = Nothing Me.ucrReceiverX.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverX.strNcFilePath = "" - Me.ucrReceiverX.TabIndex = 9 + Me.ucrReceiverX.TabIndex = 7 Me.ucrReceiverX.ucrSelector = Nothing ' 'ucrReceiverRibbons ' Me.ucrReceiverRibbons.AutoSize = True Me.ucrReceiverRibbons.frmParent = Me - Me.ucrReceiverRibbons.Location = New System.Drawing.Point(369, 241) + Me.ucrReceiverRibbons.Location = New System.Drawing.Point(273, 229) Me.ucrReceiverRibbons.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRibbons.Name = "ucrReceiverRibbons" Me.ucrReceiverRibbons.Selector = Nothing - Me.ucrReceiverRibbons.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverRibbons.Size = New System.Drawing.Size(120, 75) Me.ucrReceiverRibbons.strNcFilePath = "" - Me.ucrReceiverRibbons.TabIndex = 7 + Me.ucrReceiverRibbons.TabIndex = 12 Me.ucrReceiverRibbons.ucrSelector = Nothing ' 'lblLines ' Me.lblLines.AutoSize = True Me.lblLines.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblLines.Location = New System.Drawing.Point(371, 78) + Me.lblLines.Location = New System.Drawing.Point(275, 78) Me.lblLines.Name = "lblLines" Me.lblLines.Size = New System.Drawing.Size(35, 13) Me.lblLines.TabIndex = 4 @@ -171,7 +172,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverLines.AutoSize = True Me.ucrReceiverLines.frmParent = Me - Me.ucrReceiverLines.Location = New System.Drawing.Point(369, 93) + Me.ucrReceiverLines.Location = New System.Drawing.Point(273, 93) Me.ucrReceiverLines.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverLines.Name = "ucrReceiverLines" Me.ucrReceiverLines.Selector = Nothing @@ -183,7 +184,7 @@ Partial Class dlgSeasonalGraph 'ucrSave ' Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSave.Location = New System.Drawing.Point(13, 424) + Me.ucrSave.Location = New System.Drawing.Point(13, 383) Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSave.Name = "ucrSave" Me.ucrSave.Size = New System.Drawing.Size(317, 24) @@ -195,17 +196,17 @@ Partial Class dlgSeasonalGraph Me.ucrChkLegend.Checked = False Me.ucrChkLegend.Location = New System.Drawing.Point(13, 343) Me.ucrChkLegend.Name = "ucrChkLegend" - Me.ucrChkLegend.Size = New System.Drawing.Size(110, 23) + Me.ucrChkLegend.Size = New System.Drawing.Size(88, 23) Me.ucrChkLegend.TabIndex = 17 ' 'ucrChkRibbons ' Me.ucrChkRibbons.AutoSize = True Me.ucrChkRibbons.Checked = False - Me.ucrChkRibbons.Location = New System.Drawing.Point(369, 208) + Me.ucrChkRibbons.Location = New System.Drawing.Point(273, 196) Me.ucrChkRibbons.Name = "ucrChkRibbons" Me.ucrChkRibbons.Size = New System.Drawing.Size(114, 23) - Me.ucrChkRibbons.TabIndex = 6 + Me.ucrChkRibbons.TabIndex = 11 ' 'ucrInputStation ' @@ -213,32 +214,32 @@ Partial Class dlgSeasonalGraph Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputStation.GetSetSelectedIndex = -1 Me.ucrInputStation.IsReadOnly = False - Me.ucrInputStation.Location = New System.Drawing.Point(496, 422) + Me.ucrInputStation.Location = New System.Drawing.Point(400, 381) Me.ucrInputStation.Name = "ucrInputStation" Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) - Me.ucrInputStation.TabIndex = 12 + Me.ucrInputStation.TabIndex = 10 ' 'ucrReceiverFacetBy ' Me.ucrReceiverFacetBy.AutoSize = True Me.ucrReceiverFacetBy.frmParent = Me - Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(369, 422) + Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(273, 381) Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" Me.ucrReceiverFacetBy.Selector = Nothing Me.ucrReceiverFacetBy.Size = New System.Drawing.Size(120, 26) Me.ucrReceiverFacetBy.strNcFilePath = "" - Me.ucrReceiverFacetBy.TabIndex = 11 + Me.ucrReceiverFacetBy.TabIndex = 9 Me.ucrReceiverFacetBy.ucrSelector = Nothing ' 'lblFacetBy ' Me.lblFacetBy.AutoSize = True Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFacetBy.Location = New System.Drawing.Point(369, 407) + Me.lblFacetBy.Location = New System.Drawing.Point(273, 366) Me.lblFacetBy.Name = "lblFacetBy" Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) - Me.lblFacetBy.TabIndex = 10 + Me.lblFacetBy.TabIndex = 8 Me.lblFacetBy.Tag = "" Me.lblFacetBy.Text = "Facet By (Optional):" ' @@ -253,16 +254,16 @@ Partial Class dlgSeasonalGraph Me.UcrInputColour.Size = New System.Drawing.Size(82, 21) Me.UcrInputColour.TabIndex = 16 ' - 'UcrInputLegend + 'ucrInputLegendPosition ' - Me.UcrInputLegend.AddQuotesIfUnrecognised = True - Me.UcrInputLegend.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.UcrInputLegend.GetSetSelectedIndex = -1 - Me.UcrInputLegend.IsReadOnly = False - Me.UcrInputLegend.Location = New System.Drawing.Point(119, 347) - Me.UcrInputLegend.Name = "UcrInputLegend" - Me.UcrInputLegend.Size = New System.Drawing.Size(82, 21) - Me.UcrInputLegend.TabIndex = 18 + Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True + Me.ucrInputLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputLegendPosition.GetSetSelectedIndex = -1 + Me.ucrInputLegendPosition.IsReadOnly = False + Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 342) + Me.ucrInputLegendPosition.Name = "ucrInputLegendPosition" + Me.ucrInputLegendPosition.Size = New System.Drawing.Size(82, 21) + Me.ucrInputLegendPosition.TabIndex = 18 ' 'cmdOptions ' @@ -279,9 +280,9 @@ Partial Class dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(600, 533) + Me.ClientSize = New System.Drawing.Size(497, 493) Me.Controls.Add(Me.cmdOptions) - Me.Controls.Add(Me.UcrInputLegend) + Me.Controls.Add(Me.ucrInputLegendPosition) Me.Controls.Add(Me.UcrInputColour) Me.Controls.Add(Me.ucrInputStation) Me.Controls.Add(Me.ucrReceiverFacetBy) @@ -325,7 +326,7 @@ Partial Class dlgSeasonalGraph Friend WithEvents ucrReceiverLines As ucrReceiverMultiple Friend WithEvents ucrSave As ucrSave Friend WithEvents ucrChkLegend As ucrCheck - Friend WithEvents UcrInputLegend As ucrInputComboBox + Friend WithEvents ucrInputLegendPosition As ucrInputComboBox Friend WithEvents UcrInputColour As ucrInputComboBox Friend WithEvents ucrInputStation As ucrInputComboBox Friend WithEvents ucrReceiverFacetBy As ucrReceiverSingle diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 4892cebacfb..d5a8ed5a8be 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -14,28 +14,64 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . -Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction Private clsRaesGeomLineFunction As New RFunction Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsGeomLineFunction As New RFunction Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction Private clsRggplotRibFunction As New RFunction Private clsRggplotLineFunction As New RFunction Private clsFacetFunction As New RFunction +Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction Private clsRaesGeomLineFunction As New RFunction Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsGeomLineFunction As New RFunction Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction Private clsDummyFunction As New RFunction Private clsRggplotLineFunction As New RFunction Private clsFacetFunction As New RFunction Private clsFacetOperator As New ROperator Private clsFacetRowOp As New ROperator Private clsFacetColOp As New ROperator Private clsGroupByFunction As New RFunction Private clsPipeOperator As New ROperator + Private clsThemeFunction As New RFunction + + Private clsOptionsFunction As New RFunction + Private clsLabsFunction As New RFunction + Private clsXlabsFunction As New RFunction + Private clsGeomSmoothFunction As New RFunction + Private clsGeomDumbbellFunction As New RFunction + Private clsPointsFunction As New RFunction + Private clsYlabFunction As New RFunction + Private clsPathFunction As New RFunction + Private clsGeomStepFunction As New RFunction + Private clsPeakFunction As New RFunction + Private clsXScalecontinuousFunction As New RFunction + Private clsYScalecontinuousFunction As New RFunction + Private clsRFacetFunction As New RFunction + Private dctThemeFunctions As New Dictionary(Of String, RFunction) + Private clsLocalRaesFunction As New RFunction + Private bResetLineLayerSubdialog As Boolean = True + Private clsGeomSmoothFunc As New RFunction + Private clsGeomSmoothParameter As New RParameter + Private clsCoordPolarFunction As New RFunction + Private clsCoordPolarStartOperator As New ROperator + Private clsXScaleDateFunction As New RFunction + Private clsYScaleDateFunction As New RFunction + Private clsScaleFillViridisFunction As New RFunction + Private clsScaleColourViridisFunction As New RFunction + Private clsAnnotateFunction As New RFunction + Private clsListFunction As New RFunction + Private clsFormulaFunction As New RFunction + Private clsGgSlopeFunction As New RFunction + Private clsSlopeThemeFunction As New RFunction + Private clsDumbbellFunction As New RFunction + Private clsGeomAreaFunction As New RFunction + Private clsAesLinerangeFunction As New RFunction + Private clsGeomLinerangeFunction As New RFunction + Private clsGeomCrossbarFunction As New RFunction + Private clsGeomErrorbarFunction As New RFunction + Private clsGeomPointrangeFunction As New RFunction Private bUpdatingParameters As Boolean = False Private ReadOnly strFacetWrap As String = "Facet Wrap" Private ReadOnly strFacetRow As String = "Facet Row" - Private ReadOnly strFacetCol As String = "Facet Column" Private lstSelectedVariables As New List(Of ucrCore) + Private ReadOnly strFacetCol As String = "Facet Column" Private ReadOnly strNone As String = "None" Private bUpdateComboOptions As Boolean = True + Private lstSelectedVariables As New List(Of ucrCore) 'Parameter names for geoms - Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.iCallType = 3 ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoLine, strFirstParameterName, {"geom_line", "geom_ribbon"}) ucrPnlOptions.AddParameterValueFunctionNamesCondition(rdoBar, strgeomRibbonParameterName, {"geom_Bar"}) + Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() + Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.iCallType = 3 ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValuesCondition(rdoLine, "checked", "geom_line") ucrPnlOptions.AddParameterValuesCondition(rdoBar, "checked", "geom_Bar") - 'ucrReceiverLines.SetParameter(New RParameter("y", 1)) ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False ucrReceiverX.SetParameter(New RParameter("x", 3)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" ucrReceiverX.bWithQuotes = False ucrReceiverX.SetParameterIsString() - 'ucrReceiverX.SetValuesToIgnore({Chr(34) & Chr(34)}) - 'ucrReceiverX.bAddParameterIfEmpty = True ucrReceiverX.SetClimaticType("month") ucrReceiverX.bAutoFill = True - ' ucrChkRibbons.SetParameter(New RParameter("geom_ribbon", 2)) ucrChkRibbons.SetText("Ribbon(s):") ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrReceiverRibbons.SetParameter(New RParameter("y", 2)) @@ -48,11 +84,45 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrReceiverFacetBy.bWithQuotes = False ucrReceiverFacetBy.SetParameterIsString() ucrReceiverFacetBy.SetValuesToIgnore({"."}) ucrInputStation.SetItems({strFacetWrap, strFacetRow, strFacetCol, strNone}) - ucrInputStation.SetDropDownStyleAsNonEditable() ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsRggplotRibFunction = New RFunction clsRggplotLineFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction + ucrInputStation.SetDropDownStyleAsNonEditable() + + ucrChkLegend.SetText("Legend:") + ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") + ucrInputLegendPosition.SetDropDownStyleAsNonEditable() + ucrInputLegendPosition.SetParameter(New RParameter("legend.position")) + dctLegendPosition.Add("None", Chr(34) & "none" & Chr(34)) + dctLegendPosition.Add("Left", Chr(34) & "left" & Chr(34)) + dctLegendPosition.Add("Right", Chr(34) & "right" & Chr(34)) + dctLegendPosition.Add("Top", Chr(34) & "top" & Chr(34)) + dctLegendPosition.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + ucrInputLegendPosition.SetItems(dctLegendPosition) + ucrChkLegend.AddParameterPresentCondition(True, "legend.position") + ucrChkLegend.AddParameterPresentCondition(False, "legend.position", False) + + ucrChkColour.SetText("Colour") + ucrChkColour.AddParameterValuesCondition(True, "checked", "True") + ucrChkColour.AddParameterValuesCondition(False, "checked", "False") + ucrChkColour.AddToLinkedControls(UcrInputColour, {True}, bNewLinkedHideIfParameterMissing:=True) + + UcrInputColour.SetParameter(New RParameter("colour", 5)) + dctColour.Add("Black", Chr(34) & "black" & Chr(34)) + dctColour.Add("Red", Chr(34) & "red" & Chr(34)) + dctColour.Add("Blue", Chr(34) & "blue" & Chr(34)) + dctColour.Add("Yellow", Chr(34) & "yellow" & Chr(34)) + dctColour.Add("Green", Chr(34) & "green" & Chr(34)) + dctColour.Add("Violet", Chr(34) & "violet" & Chr(34)) + dctColour.Add("White", Chr(34) & "white" & Chr(34)) + dctColour.Add("None", Chr(34) & "none" & Chr(34)) + UcrInputColour.SetItems(dctColour) + UcrInputColour.bAllowNonConditionValues = True + UcrInputColour.SetRDefault(Chr(34) & "black" & Chr(34)) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsRggplotLineFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsDummyFunction = New RFunction clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction clsFacetFunction = New RFunction clsFacetOperator = New ROperator clsFacetRowOp = New ROperator - clsFacetColOp = New ROperator clsPipeOperator = New ROperator ucrSelectorForSeasonalGraph.Reset() ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) ucrSave.Reset() ucrReceiverLines.SetMeAsReceiver() bResetSubdialog = True clsBaseOperator.SetOperation("+") clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) clsRggplotFunction.SetPackageName("ggplot2") clsRggplotFunction.SetRCommand("ggplot") clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) clsRaesFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") + clsFacetColOp = New ROperator clsPipeOperator = New ROperator + + clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction + ucrSelectorForSeasonalGraph.Reset() ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) ucrSave.Reset() ucrReceiverLines.SetMeAsReceiver() bResetSubdialog = True clsDummyFunction.AddParameter("checked", "geom_line", iPosition:=0) clsBaseOperator.SetOperation("+") clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) clsRggplotFunction.SetPackageName("ggplot2") clsRggplotFunction.SetRCommand("ggplot") clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) clsRaesFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") clsFacetFunction.SetPackageName("ggplot2") clsFacetRowOp.SetOperation("+") @@ -73,14 +143,41 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu clsGroupByFunction.SetPackageName("dplyr") clsGroupByFunction.SetRCommand("group_by") - clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset) - ' ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseOperator, bReset) + clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsXlabsFunction = GgplotDefaults.clsXlabTitleFunction.Clone() + clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone + clsLabsFunction = GgplotDefaults.clsDefaultLabs.Clone() + clsXScalecontinuousFunction = GgplotDefaults.clsXScalecontinuousFunction.Clone() + clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone() + clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone() + clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone() + clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone() + dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions) + clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone() + clsXScaleDateFunction = GgplotDefaults.clsXScaleDateFunction.Clone() + clsYScaleDateFunction = GgplotDefaults.clsYScaleDateFunction.Clone() + clsScaleFillViridisFunction = GgplotDefaults.clsScaleFillViridisFunction + clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction + clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset) + ucrPnlOptions.SetRCode(clsDummyFunction, bReset) ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) ucrReceiverX.SetRCode(clsRaesFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) + ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + ucrChkColour.SetRCode(clsGeomLineFunction, bReset) + UcrInputColour.SetRCode(clsGeomLineFunction, bReset) If bReset Then ucrReceiverRibbons.SetRCode(clsRaesRibFunction, bReset) ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) + AutoFacetStation() + End If + End Sub Private Sub TestOkEnabled() If Not ucrSave.IsComplete OrElse (ucrReceiverLines.IsEmpty AndAlso ucrChkRibbons.Checked) Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) End If - End Sub Private Sub TestOkEnabled() End Sub + + End Sub Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged If ucrChkRibbons.Checked Then ucrReceiverRibbons.Visible = True ucrReceiverRibbons.SetMeAsReceiver() If ucrReceiverRibbons.lstSelectedVariables.Items.Count > 0 Then @@ -182,10 +279,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End Select End If - If clsRaesFunction.ContainsParameter("colour") Then - clsGroupByFunction.AddParameter("colour", ucrReceiverColourBy.GetVariableNames(bWithQuotes:=False), bIncludeArgumentName:=False, iPosition:=0) - End If - If clsGroupByFunction.iParameterCount > 0 Then clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) Else @@ -198,6 +291,29 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu SetPipeAssignTo() End Sub + Private Sub ucrInput_ControlValueChanged(ucrChangedControl As ucrInputComboBox) Handles ucrInputStation.ControlValueChanged + If Not bUpdateComboOptions Then + Exit Sub + End If + Dim strChangedText As String = ucrChangedControl.GetText() + If strChangedText <> strNone Then + If Not strChangedText = strFacetCol AndAlso Not strChangedText = strFacetRow AndAlso + Not ucrInputStation.Equals(ucrChangedControl) AndAlso ucrInputStation.GetText() = strChangedText Then + bUpdateComboOptions = False + ucrInputStation.SetName(strNone) + bUpdateComboOptions = True + End If + If (strChangedText = strFacetWrap AndAlso ucrInputStation.GetText = strFacetRow) OrElse (strChangedText = strFacetRow AndAlso + ucrInputStation.GetText = strFacetWrap) OrElse (strChangedText = strFacetWrap AndAlso + ucrInputStation.GetText = strFacetCol) OrElse (strChangedText = strFacetCol AndAlso ucrInputStation.GetText = strFacetWrap) Then + ucrInputStation.SetName(strNone) + End If + End If + UpdateParameters() + AddRemoveFacets() + AddRemoveGroupBy() + End Sub + Private Sub GetParameterValue(clsOperator As ROperator) Dim i As Integer = 0 For Each clsTempParam As RParameter In clsOperator.clsParameters @@ -216,7 +332,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End If End Sub - Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged, ucrReceiverColourBy.ControlValueChanged, ucrReceiverX.ControlValueChanged + Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged, ucrReceiverX.ControlValueChanged AddRemoveFacets() AddRemoveGroupBy() End Sub @@ -232,4 +348,51 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrCurrentReceiver.SetMeAsReceiver() End If AddRemoveGroupBy() - End Sub Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub End Class \ No newline at end of file + End Sub Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub + + Private Sub AddRemoveTheme() + If clsThemeFunction.iParameterCount > 0 Then + clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=15) + Else + clsBaseOperator.RemoveParameterByName("theme") + End If + End Sub + + Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged + AddRemoveTheme() + End Sub + + Private Sub ucrSelectorForSeasonalGraph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForSeasonalGraph.ControlValueChanged + AutoFacetStation() + SetPipeAssignTo() + End Sub + + Private Sub ucrChkColour_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkColour.ControlValueChanged, UcrInputColour.ControlValueChanged + If ucrChkColour.Checked Then + clsGeomLineFunction.AddParameter("colour", UcrInputColour.GetText, iPosition:=3) + Else + clsGeomLineFunction.RemoveParameterByName("colour") + End If + End Sub + + Private Sub AllControl_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSave.ControlContentsChanged, ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged + TestOkEnabled() + End Sub + + Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.Click + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click ', PlotOptionsToolStripMenuItem.Click + sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, + clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, + clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, ucrNewBaseSelector:=ucrSelectorForSeasonalGraph, + clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction, + clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, + strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) + sdgPlots.ShowDialog() + bResetSubdialog = False + End Sub +End Class \ No newline at end of file From 177b4b6aa350481037c05424d129bf872e4fc57a Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 22 Dec 2023 11:14:13 +0100 Subject: [PATCH 07/83] minor change --- instat/dlgSeasonalGraph.vb | 145 +++++++++++++++++++++++-------------- 1 file changed, 92 insertions(+), 53 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index d5a8ed5a8be..591c71dc00a 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -14,7 +14,7 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . -Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction Private clsRaesGeomLineFunction As New RFunction Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsGeomLineFunction As New RFunction Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction Private clsDummyFunction As New RFunction Private clsRggplotLineFunction As New RFunction Private clsFacetFunction As New RFunction +Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction Private clsRaesGeomLineFunction As New RFunction Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsGeomLineFunction As New RFunction Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction Private clsDummyFunction As New RFunction Private clsFacetFunction As New RFunction Private clsFacetOperator As New ROperator Private clsFacetRowOp As New ROperator Private clsFacetColOp As New ROperator @@ -22,24 +22,13 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Private clsPipeOperator As New ROperator Private clsThemeFunction As New RFunction - Private clsOptionsFunction As New RFunction Private clsLabsFunction As New RFunction Private clsXlabsFunction As New RFunction - Private clsGeomSmoothFunction As New RFunction - Private clsGeomDumbbellFunction As New RFunction - Private clsPointsFunction As New RFunction Private clsYlabFunction As New RFunction - Private clsPathFunction As New RFunction - Private clsGeomStepFunction As New RFunction - Private clsPeakFunction As New RFunction Private clsXScalecontinuousFunction As New RFunction Private clsYScalecontinuousFunction As New RFunction Private clsRFacetFunction As New RFunction Private dctThemeFunctions As New Dictionary(Of String, RFunction) - Private clsLocalRaesFunction As New RFunction - Private bResetLineLayerSubdialog As Boolean = True - Private clsGeomSmoothFunc As New RFunction - Private clsGeomSmoothParameter As New RParameter Private clsCoordPolarFunction As New RFunction Private clsCoordPolarStartOperator As New ROperator Private clsXScaleDateFunction As New RFunction @@ -47,30 +36,24 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Private clsScaleFillViridisFunction As New RFunction Private clsScaleColourViridisFunction As New RFunction Private clsAnnotateFunction As New RFunction - Private clsListFunction As New RFunction - Private clsFormulaFunction As New RFunction - Private clsGgSlopeFunction As New RFunction - Private clsSlopeThemeFunction As New RFunction - Private clsDumbbellFunction As New RFunction - Private clsGeomAreaFunction As New RFunction - Private clsAesLinerangeFunction As New RFunction - Private clsGeomLinerangeFunction As New RFunction - Private clsGeomCrossbarFunction As New RFunction - Private clsGeomErrorbarFunction As New RFunction - Private clsGeomPointrangeFunction As New RFunction Private bUpdatingParameters As Boolean = False Private ReadOnly strFacetWrap As String = "Facet Wrap" Private ReadOnly strFacetRow As String = "Facet Row" - Private ReadOnly strFacetCol As String = "Facet Column" Private ReadOnly strNone As String = "None" Private bUpdateComboOptions As Boolean = True - Private lstSelectedVariables As New List(Of ucrCore) + Private ReadOnly strFacetCol As String = "Facet Column" Private ReadOnly strNone As String = "None" Private bUpdateComboOptions As Boolean = True 'Parameter names for geoms - Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() - Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrBase.clsRsyntax.iCallType = 3 ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValuesCondition(rdoLine, "checked", "geom_line") ucrPnlOptions.AddParameterValuesCondition(rdoBar, "checked", "geom_Bar") + Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strgeomRibbonParameterName0 As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName0, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) If bReset Then + AutoFill() + End If bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() + Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) - ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False ucrReceiverX.SetParameter(New RParameter("x", 3)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" ucrReceiverX.bWithQuotes = False ucrReceiverX.SetParameterIsString() - ucrReceiverX.SetClimaticType("month") ucrReceiverX.bAutoFill = True + ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValuesCondition(rdoLine, "checked", "geom_line") ucrPnlOptions.AddParameterValuesCondition(rdoBar, "checked", "geom_Bar") + + ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False + + ucrReceiverX.SetParameterIsString() ucrReceiverX.SetParameter(New RParameter("x", 3)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" + ucrReceiverX.bWithQuotes = False ucrChkRibbons.SetText("Ribbon(s):") ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -115,7 +98,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu dctColour.Add("None", Chr(34) & "none" & Chr(34)) UcrInputColour.SetItems(dctColour) UcrInputColour.bAllowNonConditionValues = True - UcrInputColour.SetRDefault(Chr(34) & "black" & Chr(34)) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsRggplotLineFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsDummyFunction = New RFunction clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction + UcrInputColour.SetRDefault(Chr(34) & "black" & Chr(34)) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsDummyFunction = New RFunction clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction clsFacetFunction = New RFunction clsFacetOperator = New ROperator clsFacetRowOp = New ROperator @@ -154,12 +137,11 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone() clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone() dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions) - clsLocalRaesFunction = GgplotDefaults.clsAesFunction.Clone() clsXScaleDateFunction = GgplotDefaults.clsXScaleDateFunction.Clone() clsYScaleDateFunction = GgplotDefaults.clsYScaleDateFunction.Clone() clsScaleFillViridisFunction = GgplotDefaults.clsScaleFillViridisFunction clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction - clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset) + clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) ucrPnlOptions.SetRCode(clsDummyFunction, bReset) ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) ucrReceiverX.SetRCode(clsRaesFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) @@ -168,32 +150,24 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu UcrInputColour.SetRCode(clsGeomLineFunction, bReset) If bReset Then ucrReceiverRibbons.SetRCode(clsRaesRibFunction, bReset) + ucrReceiverLines.SetRCode(clsRaesGeomLineFunction, bReset) ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) AutoFacetStation() End If - End Sub Private Sub TestOkEnabled() If Not ucrSave.IsComplete OrElse (ucrReceiverLines.IsEmpty AndAlso ucrChkRibbons.Checked) Then + End Sub Private Sub TestOkEnabled() If Not ucrSave.IsComplete OrElse (ucrReceiverLines.IsEmpty AndAlso Not ucrChkRibbons.Checked) Then + ucrBase.OKEnabled(False) + ElseIf Not ucrSave.IsComplete OrElse (ucrReceiverRibbons.IsEmpty AndAlso ucrChkRibbons.Checked) Then + ucrBase.OKEnabled(False) + ElseIf ucrChkRibbons.Checked AndAlso (ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 OrElse ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3) Then ucrBase.OKEnabled(False) Else ucrBase.OKEnabled(True) End If - End Sub - Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged If ucrChkRibbons.Checked Then ucrReceiverRibbons.Visible = True ucrReceiverRibbons.SetMeAsReceiver() - If ucrReceiverRibbons.lstSelectedVariables.Items.Count > 0 Then - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 - Dim clsRaesRibFunction As New RFunction - clsRaesRibFunction.SetPackageName("ggplot2") - clsRaesRibFunction.SetRCommand("aes") - clsRaesRibFunction.AddParameter("y", ucrReceiverRibbons.lstSelectedVariables.Items(i).Text) - Dim clsGeomRibbonFunction As New RFunction - clsGeomRibbonFunction.SetPackageName("ggplot2") - clsGeomRibbonFunction.SetRCommand("geom_ribbon") - clsGeomRibbonFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) - clsBaseOperator.AddParameter(strgeomRibbonParameterName & i, clsRFunctionParameter:=clsGeomRibbonFunction, iPosition:=3) - Next - End If - Else ucrReceiverRibbons.Visible = False clsBaseOperator.RemoveParameterByName("geom_ribbon") End If End Sub Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next End If End Sub Private Sub UpdateParameters() + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next + Else + clsRaesFunction.RemoveParameterByName("y") clsBaseOperator.RemoveParameterByName(strFirstParameterName) End If End Sub Private Sub UpdateParameters() clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) @@ -265,7 +239,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End Sub Private Sub AddRemoveGroupBy() - If clsPipeOperator.ContainsParameter("mutate") Then clsGroupByFunction.ClearParameters() If clsBaseOperator.ContainsParameter("facets") Then @@ -278,7 +251,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu GetParameterValue(clsFacetRowOp) End Select End If - If clsGroupByFunction.iParameterCount > 0 Then clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) Else @@ -287,7 +259,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Else clsPipeOperator.RemoveParameterByName("group_by") End If - SetPipeAssignTo() End Sub @@ -348,6 +319,17 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrCurrentReceiver.SetMeAsReceiver() End If AddRemoveGroupBy() + End Sub + + Private Sub AutoFill() + Dim strMonthCol As String + Dim strDataFrame As String + strDataFrame = ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text + strMonthCol = frmMain.clsRLink.GetClimaticColumnOfType(strDataFrame, "month_label") + + If strMonthCol <> "" Then + ucrReceiverX.Add(strMonthCol, strDataFrame) + End If End Sub Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub Private Sub AddRemoveTheme() @@ -379,8 +361,9 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu TestOkEnabled() End Sub - Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.Click + Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() + AutoFill() SetRCodeForControls(True) TestOkEnabled() End Sub @@ -395,4 +378,60 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu sdgPlots.ShowDialog() bResetSubdialog = False End Sub + + Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() Handles ucrSelectorForSeasonalGraph.DataFrameChanged, ucrReceiverX.ControlValueChanged + AutoFill() + End Sub + + Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged + If ucrChkRibbons.Checked Then + ucrReceiverRibbons.SetMeAsReceiver() + If ucrReceiverRibbons.lstSelectedVariables.Items.Count > 0 Then + ' Determine the loop range based on the count of variables + Dim loopEnd As Integer = ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 + If loopEnd Mod 2 = 0 Then + loopEnd -= 1 ' Adjust the loop end for even count + End If + + ' Loop through pairs of variables + For i = 0 To loopEnd Step 2 + ' Get current variable + Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text + ' Get the next variable in the pair if available + Dim var2 As String = ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text + + Dim clsRaesRibFunction As New RFunction + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=i) + clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=i) + + Dim clsRibFunction As New RFunction + clsRibFunction.SetPackageName("ggplot2") + clsRibFunction.SetRCommand("geom_ribbon") + clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) + + clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) + Next + + ' Check if there is an odd number of variables and create a clsRibFunction for the last variable + If loopEnd < ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Then + Dim lastVar = ucrReceiverRibbons.lstSelectedVariables.Items(loopEnd + 1).Text + Dim clsLastRibFunction As New RFunction + clsLastRibFunction.SetPackageName("ggplot2") + clsLastRibFunction.SetRCommand("aes") + clsLastRibFunction.AddParameter("ymax", lastVar, iPosition:=loopEnd + 1) + clsLastRibFunction.AddParameter("ymin", lastVar, iPosition:=loopEnd + 1) + + Dim clsLastRib As New RFunction + clsLastRib.SetPackageName("ggplot2") + clsLastRib.SetRCommand("geom_ribbon") + clsLastRib.AddParameter("mapping", clsRFunctionParameter:=clsLastRibFunction, iPosition:=1) + + clsBaseOperator.AddParameter(strFirstParameterName & (loopEnd + 1), clsRFunctionParameter:=clsLastRib, iPosition:=1) + End If + clsBaseOperator.RemoveParameterByName(strFirstParameterName & (loopEnd + 1)) + End If + End If + End Sub End Class \ No newline at end of file From f4936d2be1072ccc9a0cae05b0237e8a62d0c358 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 22 Dec 2023 12:12:47 +0100 Subject: [PATCH 08/83] minor change --- instat/dlgSeasonalGraph.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 591c71dc00a..53324e8b380 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -403,8 +403,8 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Dim clsRaesRibFunction As New RFunction clsRaesRibFunction.SetPackageName("ggplot2") clsRaesRibFunction.SetRCommand("aes") - clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=i) - clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=i) + clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) + clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) Dim clsRibFunction As New RFunction clsRibFunction.SetPackageName("ggplot2") From 4c90e8c0e44471895ee7547da311d5e1af9c479e Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:26:25 +0100 Subject: [PATCH 09/83] Added the New Anova function to the Three variable summarise --- instat/dlgDescribeTwoVariable.vb | 80 ++++++++++++++----- instat/static/InstatObject/R/data_object_R6.R | 12 +++ .../static/InstatObject/R/instat_object_R6.R | 7 +- 3 files changed, 78 insertions(+), 21 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 270adc0ce77..4ba114258c0 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -23,11 +23,11 @@ Public Class dlgDescribeTwoVariable Public strFirstVariablesType, strSecondVariableType, strThirdVariableType As String 'SUMMARY FUNCTIoNS - Private clsCombineFrequencyParametersFunction, clsCombineFunction, clsSummariseFunction, + Private clsCombineFrequencyParametersFunction, clsCombineFunction, clsCombineAnova2Function, clsSummariseFunction, clsDummyFunction, clsGroupByFunction, clsRAnovaFunction, clsCorrFunction, clsRAnovaTableFunction, clsRCorrelationFunction, clsSkimrFunction, clsSummariesListFunction, clsCombineAnovaFunction, clsSummaryTableCombineFactorsFunction, clsSummaryTableFunction, - clsThreeVariableCombineFrequencyParametersFunction, clsPivotWiderFunction As New RFunction + clsThreeVariableCombineFrequencyParametersFunction, clsPivotWiderFunction, clsMappingFunction, clsRAnovaTable2Function As New RFunction 'FORMAT TABLE FUNCTIONS Private clsFootnoteCellBodyFunction, clsFootnoteCellFunction, @@ -49,7 +49,7 @@ Public Class dlgDescribeTwoVariable 'Format Operators Private clsPipeOperator, clsTabFootnoteOperator, - clsJoiningPipeOperator, clsMutableOperator As New ROperator + clsJoiningPipeOperator, clsMutableOperator, clsAnovaTable2Operator, clsYlistOperator As New ROperator Private iUcrBaseXLocation, iDialogueXsize As Integer Private Sub dlgDescribeTwoVariable_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -200,6 +200,7 @@ Public Class dlgDescribeTwoVariable clsSummaryOperator = New ROperator clsPivotWiderFunction = New RFunction clsCombineAnovaFunction = New RFunction + clsCombineAnova2Function = New RFunction clsSummariseFunction = New RFunction clsCorrFunction = New RFunction clsRAnovaTableFunction = New RFunction @@ -209,6 +210,10 @@ Public Class dlgDescribeTwoVariable clsGroupByPipeOperator3 = New ROperator clsGroupByPipeOperator4 = New ROperator clsGroupByPipeOperatorData = New ROperator + clsMappingFunction = New RFunction + clsAnovaTable2Operator = New ROperator + clsYlistOperator = New ROperator + clsRAnovaTable2Function = New RFunction ucrSelectorDescribeTwoVar.Reset() ucrReceiverFirstVars.SetMeAsReceiver() @@ -242,8 +247,27 @@ Public Class dlgDescribeTwoVariable clsgtExtrasThemesFuction.SetPackageName("gtExtras") - 'clsGroupByFunction.SetPackageName("dplyr") - 'clsGroupByFunction.SetRCommand("group_by") + clsCombineAnova2Function.SetRCommand("c") + + clsMappingFunction.SetPackageName("purrr") + clsMappingFunction.SetRCommand("map") + clsMappingFunction.AddParameter(".x", clsROperatorParameter:=clsYlistOperator, iPosition:=0) + clsMappingFunction.AddParameter(".f", clsROperatorParameter:=clsAnovaTable2Operator, iPosition:=1) + + clsAnovaTable2Operator.SetOperation("~") + clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) + clsAnovaTable2Operator.bForceIncludeOperation = True + + clsYlistOperator.SetOperation("", bBracketsTemp:=False) + clsYlistOperator.SetAssignTo("y_col_names_list") + + clsRAnovaTable2Function.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables2") + clsRAnovaTable2Function.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) + clsRAnovaTable2Function.AddParameter("signif.stars", "FALSE", iPosition:=3) + clsRAnovaTable2Function.AddParameter("sign_level", "FALSE", iPosition:=4) + clsRAnovaTable2Function.AddParameter("means", "FALSE", iPosition:=5) clsGroupByPipeOperator.SetOperation("%>%") clsGroupByPipeOperator.AddParameter("skim", clsRFunctionParameter:=clsSkimrFunction, @@ -585,16 +609,16 @@ Public Class dlgDescribeTwoVariable strObjectName:="last_table") End If If IsNumericByNumericByFactor() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If If IsNumericByFNumericByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If If IsNumericByFactorByFactor() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If If IsNumericByFactorByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaTableFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If End If FactorColumns() @@ -675,9 +699,10 @@ Public Class dlgDescribeTwoVariable AddRemoveFirstParam() AddRemoveSecondParam() AddRemoveThirdParam() - AddRemoveFirstAnovaParam() + 'AddRemoveFirstAnovaParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() + AddRemoveFirstAnova2Param() End Sub Private Sub HideFormatTableButton() @@ -776,25 +801,37 @@ Public Class dlgDescribeTwoVariable End If End Sub - Private Sub AddRemoveFirstAnovaParam() + Private Sub AddRemoveFirstAnova2Param() If rdoThreeVariable.Checked Then If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then If ucrReceiverFirstVars.IsEmpty Then - clsCombineAnovaFunction.RemoveParameterByName("x") + clsYlistOperator.RemoveParameterByName("cols") Else - clsCombineAnovaFunction.AddParameter("x", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) End If End If End If End Sub + 'Private Sub AddRemoveFirstAnovaParam() + ' If rdoThreeVariable.Checked Then + ' If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + ' If ucrReceiverFirstVars.IsEmpty Then + ' clsCombineAnovaFunction.RemoveParameterByName("x") + ' Else + ' clsCombineAnovaFunction.AddParameter("x", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + ' End If + ' End If + ' End If + 'End Sub + Private Sub AddRemoveSecondAnovaParam() If rdoThreeVariable.Checked Then If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then If ucrReceiverThreeVariableSecondFactor.IsEmpty Then - clsCombineAnovaFunction.RemoveParameterByName("y") + clsCombineAnova2Function.RemoveParameterByName("x") Else - clsCombineAnovaFunction.AddParameter("y", ucrReceiverThreeVariableSecondFactor.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + clsCombineAnova2Function.AddParameter("x", ucrReceiverThreeVariableSecondFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) End If End If End If @@ -804,9 +841,9 @@ Public Class dlgDescribeTwoVariable If rdoThreeVariable.Checked Then If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then If ucrReceiverThreeVariableThirdVariable.IsEmpty Then - clsCombineFunction.RemoveParameterByName("y") + clsCombineAnova2Function.RemoveParameterByName("y") Else - clsCombineFunction.AddParameter("y", ucrReceiverThreeVariableThirdVariable.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) + clsCombineAnova2Function.AddParameter("y", ucrReceiverThreeVariableThirdVariable.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) End If End If End If @@ -900,9 +937,10 @@ Public Class dlgDescribeTwoVariable AddRemoveFirstParam() AddRemoveThirdParam() AddRemoveSecondParam() - AddRemoveFirstAnovaParam() + 'AddRemoveFirstAnovaParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() + AddRemoveFirstAnova2Param() End Sub Private Sub ChangeSumaryLabelText() @@ -1053,9 +1091,10 @@ Public Class dlgDescribeTwoVariable HideFormatTableButton() FactorColumns() AddRemoveFirstParam() - AddRemoveFirstAnovaParam() + 'AddRemoveFirstAnovaParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() + AddRemoveFirstAnova2Param() End Sub Private Sub ucrReceiverThreeVariableSecondFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableSecondFactor.ControlValueChanged @@ -1063,8 +1102,9 @@ Public Class dlgDescribeTwoVariable AssignSecondVariableType() AddRemoveFirstParam() AddRemoveSecondParam() - AddRemoveFirstAnovaParam() + 'AddRemoveFirstAnovaParam() AddRemoveSecondAnovaParam() + AddRemoveFirstAnova2Param() End Sub Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirstVars.ControlContentsChanged, diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index a81b21fa1db..609b2309d02 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -4464,3 +4464,15 @@ DataSheet$set("public", "has_labels", function(col_names) { return(!is.null(attr(col_names, "labels"))) } ) + +DataSheet$set("public", "anova_tables2", function(x_col_names, y_col_name, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { + if(missing(x_col_names) || missing(y_col_name)) stop("Both x_col_names and y_col_names are required") + if(sign_level || signif.stars) message("This is no longer descriptive") + if(sign_level) end_col = 5 else end_col = 4 + mod <- lm(formula = as.formula(paste0("as.numeric(", as.name(y_col_name), ") ~ ", as.name(x_col_names[1]), " + ", as.name(x_col_names[2]))), data = self$get_data_frame()) + cat("ANOVA table: ", y_col_name, " ~ ", x_col_names[1], " + ", x_col_names[2], "\n", sep = "") + print(anova(mod)[1:end_col], signif.stars = signif.stars) + cat("\n") + if(means) (print(model.tables(aov(mod), type = "means"))) +} +) \ No newline at end of file diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 53a7c82fb5e..b2b727e1763 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2750,4 +2750,9 @@ DataBook$set("public","wrap_or_unwrap_data", function(data_name, col_name, colum self$add_columns_to_data(data_name=data_name, col_name=col_name, col_data=column_data, before=FALSE) } } -) \ No newline at end of file +) + +DataBook$set("public", "anova_tables2", function(data_name, x_col_names, y_col_name, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { + self$get_data_objects(data_name)$anova_tables2(x_col_names = x_col_names, y_col_name = y_col_name, signif.stars = signif.stars, sign_level = sign_level, means = means) +} +) From a2a6f1bcbef4b3ec06afc5a9eaed71672ff87cf1 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:01:55 +0100 Subject: [PATCH 10/83] Code Changes --- instat/dlgDescribeTwoVariable.vb | 87 ++++++++++++++------------------ 1 file changed, 38 insertions(+), 49 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 4ba114258c0..00bf7e2feb3 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -434,7 +434,7 @@ Public Class dlgDescribeTwoVariable OrElse (Not ucrReceiverThreeVariableSecondFactor.IsEmpty _ AndAlso Not ucrReceiverThreeVariableThirdVariable.IsEmpty) _ AndAlso (IsFactorByFactor() OrElse IsNumericByFactor() _ - OrElse IsFactorByNumeric() OrElse IsNumericByNumericByFactor() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFNumericByNumeric() _ + OrElse IsFactorByNumeric() OrElse IsNumericByNumericByFactor() OrElse IsNumericByFactorByFactor() OrElse IsNumericByNumericByNumeric() _ OrElse IsFactorByNumericByNumeric() OrElse IsNumericByFactorByNumeric() OrElse IsFactorByFactorByFactor() OrElse IsNumericByNumeric())) AndAlso ucrSaveTable.IsComplete) End Sub @@ -470,7 +470,7 @@ Public Class dlgDescribeTwoVariable Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "categorical" AndAlso strThirdVariableType = "numeric" End Function - Private Function IsNumericByFNumericByNumeric() As Boolean + Private Function IsNumericByNumericByNumeric() As Boolean Return strFirstVariablesType = "numeric" AndAlso strSecondVariableType = "numeric" AndAlso strThirdVariableType = "numeric" End Function @@ -489,10 +489,10 @@ Public Class dlgDescribeTwoVariable If IsNumericByFactor() Then sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) End If - ElseIf rdoThreeVariable.Checked Then - If IsFactorByNumeric() Then - sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) - End If + 'ElseIf rdoThreeVariable.Checked Then + ' 'If IsFactorByNumeric() Then + ' ' sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) + ' 'End If End If bResetSubdialog = False sdgSummaries.ShowDialog() @@ -611,7 +611,7 @@ Public Class dlgDescribeTwoVariable If IsNumericByNumericByFactor() Then ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If - If IsNumericByFNumericByNumeric() Then + If IsNumericByNumericByNumeric() Then ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If If IsNumericByFactorByFactor() Then @@ -694,26 +694,27 @@ Public Class dlgDescribeTwoVariable UpdateCombineFactorParameterFunction() ChangeLocations() AddRemoveNAParameter() - HideFormatTableButton() + ShowFormatTableButton() FactorColumns() - AddRemoveFirstParam() - AddRemoveSecondParam() - AddRemoveThirdParam() - 'AddRemoveFirstAnovaParam() + AddRemoveFirstCorrParam() + AddRemoveSecondCorrParam() + AddRemoveThirdCorrParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() End Sub - Private Sub HideFormatTableButton() - cmdFormatTable.Visible = IsNumericByFactor() _ - OrElse IsFactorByFactor() OrElse (IsFactorByNumeric() _ - AndAlso rdoThreeVariable.Checked) + Private Sub ShowFormatTableButton() + If rdoTwoVariable.Checked Then + cmdFormatTable.Visible = IsNumericByFactor() _ + OrElse IsFactorByFactor() OrElse IsFactorByNumeric() + Else + cmdFormatTable.Visible = False + End If End Sub Private Sub ChangeLocations() - If IsNumericByFactor() _ - OrElse (IsFactorByNumeric() AndAlso rdoThreeVariable.Checked) Then + If IsNumericByFactor() Then ucrBase.Location = New Point(iUcrBaseXLocation, 487) Me.Size = New Point(iDialogueXsize, 580) cmdFormatTable.Location = New Point(326, 423) @@ -724,6 +725,9 @@ Public Class dlgDescribeTwoVariable ucrBase.Location = New Point(iUcrBaseXLocation, 370) Me.Size = New Point(iDialogueXsize, 465) cmdFormatTable.Location = New Point(326, 325) + ElseIf IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 328) + Me.Size = New Point(iDialogueXsize, 425) Else ucrBase.Location = New Point(iUcrBaseXLocation, 328) Me.Size = New Point(iDialogueXsize, 425) @@ -738,7 +742,7 @@ Public Class dlgDescribeTwoVariable End If End Sub - Private Sub AddRemoveFirstParam() + Private Sub AddRemoveFirstCorrParam() If rdoThreeVariable.Checked Then If IsFactorByNumericByNumeric() Then If ucrReceiverFirstVars.IsEmpty Then @@ -750,7 +754,7 @@ Public Class dlgDescribeTwoVariable End If End Sub - Private Sub AddRemoveSecondParam() + Private Sub AddRemoveSecondCorrParam() If rdoThreeVariable.Checked Then If IsFactorByNumericByNumeric() Then If ucrReceiverThreeVariableSecondFactor.IsEmpty Then @@ -762,7 +766,7 @@ Public Class dlgDescribeTwoVariable End If End Sub - Private Sub AddRemoveThirdParam() + Private Sub AddRemoveThirdCorrParam() If rdoThreeVariable.Checked Then If IsFactorByNumericByNumeric() Then If ucrReceiverThreeVariableThirdVariable.IsEmpty Then @@ -803,7 +807,7 @@ Public Class dlgDescribeTwoVariable Private Sub AddRemoveFirstAnova2Param() If rdoThreeVariable.Checked Then - If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then If ucrReceiverFirstVars.IsEmpty Then clsYlistOperator.RemoveParameterByName("cols") Else @@ -813,21 +817,9 @@ Public Class dlgDescribeTwoVariable End If End Sub - 'Private Sub AddRemoveFirstAnovaParam() - ' If rdoThreeVariable.Checked Then - ' If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then - ' If ucrReceiverFirstVars.IsEmpty Then - ' clsCombineAnovaFunction.RemoveParameterByName("x") - ' Else - ' clsCombineAnovaFunction.AddParameter("x", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=2, bIncludeArgumentName:=False) - ' End If - ' End If - ' End If - 'End Sub - Private Sub AddRemoveSecondAnovaParam() If rdoThreeVariable.Checked Then - If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then If ucrReceiverThreeVariableSecondFactor.IsEmpty Then clsCombineAnova2Function.RemoveParameterByName("x") Else @@ -839,7 +831,7 @@ Public Class dlgDescribeTwoVariable Private Sub AddRemoveThirdAnovaParam() If rdoThreeVariable.Checked Then - If IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then If ucrReceiverThreeVariableThirdVariable.IsEmpty Then clsCombineAnova2Function.RemoveParameterByName("y") Else @@ -933,11 +925,10 @@ Public Class dlgDescribeTwoVariable UpdateSummaryTableFunction() AddRemoveFrequencyParameters() AddRemoveNAParameter() - HideFormatTableButton() - AddRemoveFirstParam() - AddRemoveThirdParam() - AddRemoveSecondParam() - 'AddRemoveFirstAnovaParam() + ShowFormatTableButton() + AddRemoveFirstCorrParam() + AddRemoveThirdCorrParam() + AddRemoveSecondCorrParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() @@ -966,7 +957,7 @@ Public Class dlgDescribeTwoVariable If rdoThreeVariable.Checked Then If IsFactorByNumericByNumeric() Then strSummaryName = "Correlations" - ElseIf IsNumericByNumericByFactor() OrElse IsNumericByFNumericByNumeric() Then + ElseIf IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() Then strSummaryName = "ANOVA tables" ElseIf IsNumericByFactorByFactor() Then strSummaryName = "ANOVA tables" @@ -1026,7 +1017,7 @@ Public Class dlgDescribeTwoVariable UpdateSummaryTableFunction() ChangeLocations() AddRemoveNAParameter() - HideFormatTableButton() + ShowFormatTableButton() ManageControlsVisibility() FactorColumns() End Sub @@ -1088,10 +1079,9 @@ Public Class dlgDescribeTwoVariable ChangeLocations() AddRemoveFrequencyParameters() AddRemoveNAParameter() - HideFormatTableButton() + ShowFormatTableButton() FactorColumns() - AddRemoveFirstParam() - 'AddRemoveFirstAnovaParam() + AddRemoveFirstCorrParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() @@ -1100,9 +1090,8 @@ Public Class dlgDescribeTwoVariable Private Sub ucrReceiverThreeVariableSecondFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableSecondFactor.ControlValueChanged UpdateCombineFactorParameterFunction() AssignSecondVariableType() - AddRemoveFirstParam() - AddRemoveSecondParam() - 'AddRemoveFirstAnovaParam() + AddRemoveFirstCorrParam() + AddRemoveSecondCorrParam() AddRemoveSecondAnovaParam() AddRemoveFirstAnova2Param() End Sub From fbdefcc2cbb6d35b62220d1a5c920f42fd34fe58 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 2 Feb 2024 08:17:23 +0100 Subject: [PATCH 11/83] added Help ID on the code --- instat/dlgSeasonalGraph.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 53324e8b380..5fb0ea4844a 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -48,6 +48,8 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End If bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) + ucrBase.iHelpTopicID = 522 + ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValuesCondition(rdoLine, "checked", "geom_line") ucrPnlOptions.AddParameterValuesCondition(rdoBar, "checked", "geom_Bar") ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False From 5dbbaea6514851b674a7ae57a24a64b518e4f883 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 6 Feb 2024 09:38:46 +0100 Subject: [PATCH 12/83] minor change made --- instat/dlgSeasonalGraph.vb | 45 +++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 5fb0ea4844a..ca931250b62 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -43,9 +43,11 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Private ReadOnly strFacetCol As String = "Facet Column" Private ReadOnly strNone As String = "None" Private bUpdateComboOptions As Boolean = True 'Parameter names for geoms - Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strgeomRibbonParameterName0 As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName0, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) If bReset Then + Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strgeomRibbonParameterName0 As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName0, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) + If bReset Then AutoFill() - End If bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() + End If + bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) ucrBase.iHelpTopicID = 522 @@ -54,12 +56,14 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False - ucrReceiverX.SetParameterIsString() ucrReceiverX.SetParameter(New RParameter("x", 3)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" + ucrReceiverX.SetParameterIsString() ucrReceiverX.SetParameter(New RParameter("x", 2)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" + ' ucrReceiverX.SetClimaticType("month") + ' ucrReceiverX.bAutoFill = True ucrReceiverX.bWithQuotes = False ucrChkRibbons.SetText("Ribbon(s):") ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrReceiverRibbons.SetParameter(New RParameter("y", 2)) + ucrReceiverRibbons.SetParameter(New RParameter("y", 1)) ucrReceiverRibbons.Selector = ucrSelectorForSeasonalGraph ucrReceiverRibbons.strSelectorHeading = "Variables" ucrReceiverRibbons.SetParameterIsString() ucrReceiverRibbons.bWithQuotes = False ucrReceiverFacetBy.SetParameter(New RParameter("")) @@ -165,9 +169,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Else ucrBase.OKEnabled(True) End If - End Sub - - Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next + End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next Else clsRaesFunction.RemoveParameterByName("y") clsBaseOperator.RemoveParameterByName(strFirstParameterName) End If End Sub Private Sub UpdateParameters() clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) @@ -305,7 +307,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End If End Sub - Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged, ucrReceiverX.ControlValueChanged + Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged AddRemoveFacets() AddRemoveGroupBy() End Sub @@ -325,14 +327,21 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Private Sub AutoFill() Dim strMonthCol As String + Dim strStationCol As String Dim strDataFrame As String strDataFrame = ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text strMonthCol = frmMain.clsRLink.GetClimaticColumnOfType(strDataFrame, "month_label") - + strStationCol = frmMain.clsRLink.GetClimaticColumnOfType(strDataFrame, "station_label") If strMonthCol <> "" Then ucrReceiverX.Add(strMonthCol, strDataFrame) End If - End Sub Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub + + If strStationCol <> "" Then + ucrReceiverFacetBy.Add(strStationCol, strDataFrame) + End If + End Sub + + Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub Private Sub AddRemoveTheme() If clsThemeFunction.iParameterCount > 0 Then @@ -359,10 +368,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End If End Sub - Private Sub AllControl_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSave.ControlContentsChanged, ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged - TestOkEnabled() - End Sub - Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() AutoFill() @@ -381,7 +386,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu bResetSubdialog = False End Sub - Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() Handles ucrSelectorForSeasonalGraph.DataFrameChanged, ucrReceiverX.ControlValueChanged + Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() Handles ucrSelectorForSeasonalGraph.DataFrameChanged AutoFill() End Sub @@ -436,4 +441,14 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu End If End If End Sub + + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub + + Private Sub ucrReceiverX_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverX.ControlValueChanged + If Not ucrReceiverX.IsEmpty AndAlso (ucrReceiverX.strCurrDataType.Contains("factor") OrElse ucrReceiverX.strCurrDataType = "ordered,factor") Then + clsRaesFunction.AddParameter("group", "1", iPosition:=3) + Else + clsRaesFunction.RemoveParameterByName("group") + End If + End Sub End Class \ No newline at end of file From 3fbbe32f1d752d6824b8da4c1a0658f6145b83fc Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 7 Feb 2024 15:13:59 +0100 Subject: [PATCH 13/83] Minor change --- instat/dlgSeasonalGraph.Designer.vb | 24 +++++++-------- instat/dlgSeasonalGraph.vb | 48 +++++++++++++---------------- 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index 9b7342defe5..255759dde3c 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -50,7 +50,7 @@ Partial Class dlgSeasonalGraph Me.ucrSelectorForSeasonalGraph.bDropUnusedFilterLevels = False Me.ucrSelectorForSeasonalGraph.bShowHiddenColumns = False Me.ucrSelectorForSeasonalGraph.bUseCurrentFilter = True - Me.ucrSelectorForSeasonalGraph.Location = New System.Drawing.Point(13, 71) + Me.ucrSelectorForSeasonalGraph.Location = New System.Drawing.Point(13, 68) Me.ucrSelectorForSeasonalGraph.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForSeasonalGraph.Name = "ucrSelectorForSeasonalGraph" Me.ucrSelectorForSeasonalGraph.Size = New System.Drawing.Size(213, 183) @@ -126,7 +126,7 @@ Partial Class dlgSeasonalGraph ' Me.lblXvariable.AutoSize = True Me.lblXvariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblXvariable.Location = New System.Drawing.Point(276, 314) + Me.lblXvariable.Location = New System.Drawing.Point(260, 285) Me.lblXvariable.Name = "lblXvariable" Me.lblXvariable.Size = New System.Drawing.Size(58, 13) Me.lblXvariable.TabIndex = 6 @@ -136,7 +136,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverX.AutoSize = True Me.ucrReceiverX.frmParent = Me - Me.ucrReceiverX.Location = New System.Drawing.Point(273, 329) + Me.ucrReceiverX.Location = New System.Drawing.Point(259, 301) Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverX.Name = "ucrReceiverX" Me.ucrReceiverX.Selector = Nothing @@ -149,7 +149,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverRibbons.AutoSize = True Me.ucrReceiverRibbons.frmParent = Me - Me.ucrReceiverRibbons.Location = New System.Drawing.Point(273, 229) + Me.ucrReceiverRibbons.Location = New System.Drawing.Point(259, 207) Me.ucrReceiverRibbons.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRibbons.Name = "ucrReceiverRibbons" Me.ucrReceiverRibbons.Selector = Nothing @@ -162,7 +162,7 @@ Partial Class dlgSeasonalGraph ' Me.lblLines.AutoSize = True Me.lblLines.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblLines.Location = New System.Drawing.Point(275, 78) + Me.lblLines.Location = New System.Drawing.Point(260, 68) Me.lblLines.Name = "lblLines" Me.lblLines.Size = New System.Drawing.Size(35, 13) Me.lblLines.TabIndex = 4 @@ -172,7 +172,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverLines.AutoSize = True Me.ucrReceiverLines.frmParent = Me - Me.ucrReceiverLines.Location = New System.Drawing.Point(273, 93) + Me.ucrReceiverLines.Location = New System.Drawing.Point(259, 82) Me.ucrReceiverLines.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverLines.Name = "ucrReceiverLines" Me.ucrReceiverLines.Selector = Nothing @@ -187,7 +187,7 @@ Partial Class dlgSeasonalGraph Me.ucrSave.Location = New System.Drawing.Point(13, 383) Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSave.Name = "ucrSave" - Me.ucrSave.Size = New System.Drawing.Size(317, 24) + Me.ucrSave.Size = New System.Drawing.Size(451, 24) Me.ucrSave.TabIndex = 13 ' 'ucrChkLegend @@ -203,7 +203,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkRibbons.AutoSize = True Me.ucrChkRibbons.Checked = False - Me.ucrChkRibbons.Location = New System.Drawing.Point(273, 196) + Me.ucrChkRibbons.Location = New System.Drawing.Point(259, 184) Me.ucrChkRibbons.Name = "ucrChkRibbons" Me.ucrChkRibbons.Size = New System.Drawing.Size(114, 23) Me.ucrChkRibbons.TabIndex = 11 @@ -214,7 +214,7 @@ Partial Class dlgSeasonalGraph Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputStation.GetSetSelectedIndex = -1 Me.ucrInputStation.IsReadOnly = False - Me.ucrInputStation.Location = New System.Drawing.Point(400, 381) + Me.ucrInputStation.Location = New System.Drawing.Point(386, 342) Me.ucrInputStation.Name = "ucrInputStation" Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) Me.ucrInputStation.TabIndex = 10 @@ -223,7 +223,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverFacetBy.AutoSize = True Me.ucrReceiverFacetBy.frmParent = Me - Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(273, 381) + Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 343) Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" Me.ucrReceiverFacetBy.Selector = Nothing @@ -236,7 +236,7 @@ Partial Class dlgSeasonalGraph ' Me.lblFacetBy.AutoSize = True Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFacetBy.Location = New System.Drawing.Point(273, 366) + Me.lblFacetBy.Location = New System.Drawing.Point(260, 328) Me.lblFacetBy.Name = "lblFacetBy" Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) Me.lblFacetBy.TabIndex = 8 @@ -280,7 +280,7 @@ Partial Class dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(497, 493) + Me.ClientSize = New System.Drawing.Size(477, 493) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.ucrInputLegendPosition) Me.Controls.Add(Me.UcrInputColour) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index ca931250b62..79941a51a6e 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -44,9 +44,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu 'Parameter names for geoms Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strgeomRibbonParameterName0 As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName0, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) - If bReset Then - AutoFill() - End If bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) @@ -56,10 +53,11 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False - ucrReceiverX.SetParameterIsString() ucrReceiverX.SetParameter(New RParameter("x", 2)) ucrReceiverX.Selector = ucrSelectorForSeasonalGraph ucrReceiverX.strSelectorHeading = "Variables" - ' ucrReceiverX.SetClimaticType("month") - ' ucrReceiverX.bAutoFill = True + ucrReceiverX.Selector = ucrSelectorForSeasonalGraph + ucrReceiverX.SetParameter(New RParameter("x", 2)) + ucrReceiverX.SetParameterIsString() ucrReceiverX.bWithQuotes = False + ucrReceiverX.strSelectorHeading = "Variables" ucrChkRibbons.SetText("Ribbon(s):") ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -104,7 +102,8 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu dctColour.Add("None", Chr(34) & "none" & Chr(34)) UcrInputColour.SetItems(dctColour) UcrInputColour.bAllowNonConditionValues = True - UcrInputColour.SetRDefault(Chr(34) & "black" & Chr(34)) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsDummyFunction = New RFunction clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction + UcrInputColour.SetRDefault(Chr(34) & "black" & Chr(34)) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") + End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsDummyFunction = New RFunction clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction clsFacetFunction = New RFunction clsFacetOperator = New ROperator clsFacetRowOp = New ROperator @@ -159,6 +158,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrReceiverLines.SetRCode(clsRaesGeomLineFunction, bReset) ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) AutoFacetStation() + AutoFillmonth() End If End Sub Private Sub TestOkEnabled() If Not ucrSave.IsComplete OrElse (ucrReceiverLines.IsEmpty AndAlso Not ucrChkRibbons.Checked) Then ucrBase.OKEnabled(False) @@ -169,7 +169,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Else ucrBase.OKEnabled(True) End If - End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next + End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text, iPosition:=0) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next Else clsRaesFunction.RemoveParameterByName("y") clsBaseOperator.RemoveParameterByName(strFirstParameterName) End If End Sub Private Sub UpdateParameters() clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) @@ -191,7 +191,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrReceiverFacetBy.SetRCode(clsFacetRowOp) End Select If Not clsRaesFunction.ContainsParameter("x") Then - clsRaesFunction.AddParameter("x", Chr(34) & Chr(34)) + clsRaesFunction.AddParameter("x", Chr(34) & Chr(34), iPosition:=1) End If bUpdatingParameters = False End Sub @@ -325,19 +325,15 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu AddRemoveGroupBy() End Sub - Private Sub AutoFill() - Dim strMonthCol As String - Dim strStationCol As String - Dim strDataFrame As String - strDataFrame = ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text - strMonthCol = frmMain.clsRLink.GetClimaticColumnOfType(strDataFrame, "month_label") - strStationCol = frmMain.clsRLink.GetClimaticColumnOfType(strDataFrame, "station_label") - If strMonthCol <> "" Then - ucrReceiverX.Add(strMonthCol, strDataFrame) - End If + Private Sub AutoFillmonth() + Dim ucrCurrentReceiver0 As ucrReceiver = Nothing - If strStationCol <> "" Then - ucrReceiverFacetBy.Add(strStationCol, strDataFrame) + If ucrSelectorForSeasonalGraph.CurrentReceiver IsNot Nothing Then + ucrCurrentReceiver0 = ucrSelectorForSeasonalGraph.CurrentReceiver + End If + ucrReceiverX.AddItemsWithMetadataProperty(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"month_label"}) + If ucrCurrentReceiver0 IsNot Nothing Then + ucrCurrentReceiver0.SetMeAsReceiver() End If End Sub @@ -358,6 +354,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Private Sub ucrSelectorForSeasonalGraph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForSeasonalGraph.ControlValueChanged AutoFacetStation() SetPipeAssignTo() + AutoFillmonth() End Sub Private Sub ucrChkColour_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkColour.ControlValueChanged, UcrInputColour.ControlValueChanged @@ -370,7 +367,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() - AutoFill() SetRCodeForControls(True) TestOkEnabled() End Sub @@ -386,10 +382,6 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu bResetSubdialog = False End Sub - Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() Handles ucrSelectorForSeasonalGraph.DataFrameChanged - AutoFill() - End Sub - Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged If ucrChkRibbons.Checked Then ucrReceiverRibbons.SetMeAsReceiver() @@ -451,4 +443,8 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu clsRaesFunction.RemoveParameterByName("group") End If End Sub + + Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() + + End Sub End Class \ No newline at end of file From ff374a791e667db2051bd313b5ff348acb24b00c Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 7 Feb 2024 15:15:20 +0100 Subject: [PATCH 14/83] minor change --- instat/dlgSeasonalGraph.vb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 79941a51a6e..632384a9d0d 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -443,8 +443,4 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu clsRaesFunction.RemoveParameterByName("group") End If End Sub - - Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() - - End Sub End Class \ No newline at end of file From d408172bc4239e1746bcdda5abe310fb6d2a892a Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 7 Feb 2024 15:23:25 +0100 Subject: [PATCH 15/83] minor change --- instat/dlgSeasonalGraph.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 632384a9d0d..c43dd1615bb 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -164,7 +164,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrBase.OKEnabled(False) ElseIf Not ucrSave.IsComplete OrElse (ucrReceiverRibbons.IsEmpty AndAlso ucrChkRibbons.Checked) Then ucrBase.OKEnabled(False) - ElseIf ucrChkRibbons.Checked AndAlso (ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 OrElse ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3) Then + ElseIf ucrChkRibbons.Checked AndAlso (ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 OrElse ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3 OrElse ucrReceiverX.IsEmpty) Then ucrBase.OKEnabled(False) Else ucrBase.OKEnabled(True) From 72fd2dbe74b2a6cd607b02459178e7b3eed80e8f Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 7 Feb 2024 15:27:17 +0100 Subject: [PATCH 16/83] minor change --- instat/dlgSeasonalGraph.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index c43dd1615bb..e902cf8ee14 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -164,7 +164,7 @@ Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFu ucrBase.OKEnabled(False) ElseIf Not ucrSave.IsComplete OrElse (ucrReceiverRibbons.IsEmpty AndAlso ucrChkRibbons.Checked) Then ucrBase.OKEnabled(False) - ElseIf ucrChkRibbons.Checked AndAlso (ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 OrElse ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3 OrElse ucrReceiverX.IsEmpty) Then + ElseIf ucrChkRibbons.Checked AndAlso ucrReceiverLines.IsEmpty AndAlso (ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 OrElse ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3 OrElse ucrReceiverX.IsEmpty) Then ucrBase.OKEnabled(False) Else ucrBase.OKEnabled(True) From 35f60e7e6eaaf3d8fbb23a4ae1e46d7ed559665c Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:11:54 +0100 Subject: [PATCH 17/83] Code Changes --- instat/dlgDescribeTwoVariable.vb | 77 ++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 00bf7e2feb3..e5a5cedefca 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -528,6 +528,9 @@ Public Class dlgDescribeTwoVariable ucrReorderSummary.Visible = False cmdSummaries.Visible = False End If + grpDisplay.Visible = IsFactorByFactorByFactor() + ucrChkDisplayMargins.Visible = IsFactorByFactorByFactor() + ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactorByFactor() End If cmdMissingOptions.Visible = ucrChkOmitMissing.Checked End Sub @@ -708,26 +711,43 @@ Public Class dlgDescribeTwoVariable If rdoTwoVariable.Checked Then cmdFormatTable.Visible = IsNumericByFactor() _ OrElse IsFactorByFactor() OrElse IsFactorByNumeric() + ElseIf rdoThreeVariable.Checked Then + cmdFormatTable.Visible = IsFactorByFactorByFactor() Else cmdFormatTable.Visible = False End If End Sub Private Sub ChangeLocations() - If IsNumericByFactor() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 487) - Me.Size = New Point(iDialogueXsize, 580) - cmdFormatTable.Location = New Point(326, 423) - ElseIf IsFactorByNumeric() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 319) - Me.Size = New Point(iDialogueXsize, 415) - ElseIf IsFactorByFactor() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 370) - Me.Size = New Point(iDialogueXsize, 465) - cmdFormatTable.Location = New Point(326, 325) - ElseIf IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 328) - Me.Size = New Point(iDialogueXsize, 425) + If rdoTwoVariable.Checked Then + If IsNumericByFactor() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 487) + Me.Size = New Point(iDialogueXsize, 580) + cmdFormatTable.Location = New Point(326, 423) + ElseIf IsFactorByNumeric() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 319) + Me.Size = New Point(iDialogueXsize, 415) + ElseIf IsFactorByFactor() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 370) + Me.Size = New Point(iDialogueXsize, 465) + cmdFormatTable.Location = New Point(326, 325) + Else + ucrBase.Location = New Point(iUcrBaseXLocation, 328) + Me.Size = New Point(iDialogueXsize, 425) + End If + ElseIf rdoThreeVariable.Checked Then + If IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() OrElse IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 328) + Me.Size = New Point(iDialogueXsize, 425) + ElseIf IsFactorByFactorByFactor() Then + ucrBase.Location = New Point(iUcrBaseXLocation, 370) + Me.Size = New Point(iDialogueXsize, 465) + cmdFormatTable.Visible = True + cmdFormatTable.Location = New Point(326, 325) + Else + ucrBase.Location = New Point(iUcrBaseXLocation, 370) + Me.Size = New Point(iDialogueXsize, 480) + End If Else ucrBase.Location = New Point(iUcrBaseXLocation, 328) Me.Size = New Point(iDialogueXsize, 425) @@ -910,8 +930,6 @@ Public Class dlgDescribeTwoVariable clsSummaryTableFunction.AddParameter("summaries", clsRFunctionParameter:=clsSummariesListFunction, iPosition:=4) ElseIf IsFactorByFactor() Then clsSummaryTableFunction.AddParameter("summaries", "count_label", iPosition:=4) - ElseIf IsNumericByFactor() Then - clsSummaryTableFunction.AddParameter("summaries", clsRFunctionParameter:=clsSummariesListFunction, iPosition:=4) End If End If End Sub @@ -954,21 +972,22 @@ Public Class dlgDescribeTwoVariable strSummaryName = "" End If End If - If rdoThreeVariable.Checked Then - If IsFactorByNumericByNumeric() Then - strSummaryName = "Correlations" - ElseIf IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() Then - strSummaryName = "ANOVA tables" - ElseIf IsNumericByFactorByFactor() Then - strSummaryName = "ANOVA tables" - ElseIf IsNumericByFactorByNumeric() Then - strSummaryName = "ANOVA tables" - Else - strSummaryName = "Summary tables" - End If + End If + If rdoThreeVariable.Checked Then + If IsFactorByNumericByNumeric() Then + strSummaryName = "Correlations" + ElseIf IsNumericByNumericByFactor() OrElse IsNumericByNumericByNumeric() Then + strSummaryName = "ANOVA tables" + ElseIf IsNumericByFactorByFactor() Then + strSummaryName = "ANOVA tables" + ElseIf IsNumericByFactorByNumeric() Then + strSummaryName = "ANOVA tables" + ElseIf IsFactorByFactorByFactor() Then + strSummaryName = "Frequency tables" + Else + strSummaryName = "Summary tables" End If End If - If strSummaryName <> "" Then lblSummaryName.Text = strSummaryName lblSummaryName.ForeColor = SystemColors.Highlight From 9b1d68ee7fe4bd14d38cac42ac86f84d719c6e81 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:40:17 +0100 Subject: [PATCH 18/83] Code Changes --- instat/dlgDescribeTwoVariable.vb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index e5a5cedefca..32da2be1e45 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -528,7 +528,6 @@ Public Class dlgDescribeTwoVariable ucrReorderSummary.Visible = False cmdSummaries.Visible = False End If - grpDisplay.Visible = IsFactorByFactorByFactor() ucrChkDisplayMargins.Visible = IsFactorByFactorByFactor() ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactorByFactor() End If @@ -745,7 +744,7 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = True cmdFormatTable.Location = New Point(326, 325) Else - ucrBase.Location = New Point(iUcrBaseXLocation, 370) + ucrBase.Location = New Point(iUcrBaseXLocation, 385) Me.Size = New Point(iDialogueXsize, 480) End If Else From eb4564dda29ffeee2c9ba44a7117c70639c3ed21 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:24:36 +0100 Subject: [PATCH 19/83] Tab order changes --- instat/dlgDescribeTwoVariable.Designer.vb | 324 +++++++++------------- 1 file changed, 126 insertions(+), 198 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 70ed4f6c1c0..0e4d5becb57 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,12 +60,12 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() - Me.lblFactorAsPercentage = New System.Windows.Forms.Label() - Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() - Me.ucrSaveTable = New instat.ucrSave() Me.ucrChkPercentageProportion = New instat.ucrCheck() + Me.lblFactorAsPercentage = New System.Windows.Forms.Label() Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() + Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() + Me.ucrSaveTable = New instat.ucrSave() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrChkDisplayMargins = New instat.ucrCheck() @@ -91,10 +91,9 @@ Partial Class dlgDescribeTwoVariable Me.rdoThreeVariable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoThreeVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoThreeVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoThreeVariable.Location = New System.Drawing.Point(432, 12) - Me.rdoThreeVariable.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoThreeVariable.Location = New System.Drawing.Point(288, 8) Me.rdoThreeVariable.Name = "rdoThreeVariable" - Me.rdoThreeVariable.Size = New System.Drawing.Size(150, 42) + Me.rdoThreeVariable.Size = New System.Drawing.Size(100, 28) Me.rdoThreeVariable.TabIndex = 3 Me.rdoThreeVariable.Text = "Three Variables" Me.rdoThreeVariable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -103,10 +102,9 @@ Partial Class dlgDescribeTwoVariable 'cmdFormatTable ' Me.cmdFormatTable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFormatTable.Location = New System.Drawing.Point(489, 634) - Me.cmdFormatTable.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdFormatTable.Location = New System.Drawing.Point(326, 423) Me.cmdFormatTable.Name = "cmdFormatTable" - Me.cmdFormatTable.Size = New System.Drawing.Size(156, 34) + Me.cmdFormatTable.Size = New System.Drawing.Size(104, 23) Me.cmdFormatTable.TabIndex = 23 Me.cmdFormatTable.Text = "Format Table..." Me.cmdFormatTable.UseVisualStyleBackColor = True @@ -114,10 +112,9 @@ Partial Class dlgDescribeTwoVariable 'lblThreeVariableSecondFactor ' Me.lblThreeVariableSecondFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblThreeVariableSecondFactor.Location = New System.Drawing.Point(472, 225) - Me.lblThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblThreeVariableSecondFactor.Location = New System.Drawing.Point(315, 150) Me.lblThreeVariableSecondFactor.Name = "lblThreeVariableSecondFactor" - Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(150, 22) + Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(100, 15) Me.lblThreeVariableSecondFactor.TabIndex = 10 Me.lblThreeVariableSecondFactor.Tag = "" Me.lblThreeVariableSecondFactor.Text = "Second Variable :" @@ -125,10 +122,9 @@ Partial Class dlgDescribeTwoVariable 'cmdMissingOptions ' Me.cmdMissingOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMissingOptions.Location = New System.Drawing.Point(250, 444) - Me.cmdMissingOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdMissingOptions.Location = New System.Drawing.Point(167, 296) Me.cmdMissingOptions.Name = "cmdMissingOptions" - Me.cmdMissingOptions.Size = New System.Drawing.Size(158, 34) + Me.cmdMissingOptions.Size = New System.Drawing.Size(105, 23) Me.cmdMissingOptions.TabIndex = 21 Me.cmdMissingOptions.Text = "Missing Options..." Me.cmdMissingOptions.UseVisualStyleBackColor = True @@ -136,10 +132,9 @@ Partial Class dlgDescribeTwoVariable 'lbSecondVariable ' Me.lbSecondVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lbSecondVariable.Location = New System.Drawing.Point(465, 225) - Me.lbSecondVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lbSecondVariable.Location = New System.Drawing.Point(310, 150) Me.lbSecondVariable.Name = "lbSecondVariable" - Me.lbSecondVariable.Size = New System.Drawing.Size(150, 22) + Me.lbSecondVariable.Size = New System.Drawing.Size(100, 15) Me.lbSecondVariable.TabIndex = 9 Me.lbSecondVariable.Tag = "" Me.lbSecondVariable.Text = "Second Variable:" @@ -148,10 +143,9 @@ Partial Class dlgDescribeTwoVariable ' Me.lblFirstVariable.AutoSize = True Me.lblFirstVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstVariable.Location = New System.Drawing.Point(465, 74) - Me.lblFirstVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblFirstVariable.Location = New System.Drawing.Point(310, 49) Me.lblFirstVariable.Name = "lblFirstVariable" - Me.lblFirstVariable.Size = New System.Drawing.Size(114, 20) + Me.lblFirstVariable.Size = New System.Drawing.Size(75, 13) Me.lblFirstVariable.TabIndex = 5 Me.lblFirstVariable.Tag = "" Me.lblFirstVariable.Text = "First Variables:" @@ -165,41 +159,28 @@ Partial Class dlgDescribeTwoVariable Me.grpSummaries.Controls.Add(Me.lblSummary) Me.grpSummaries.Controls.Add(Me.lblBy) Me.grpSummaries.Controls.Add(Me.lblSecondType) - Me.grpSummaries.Location = New System.Drawing.Point(16, 328) - Me.grpSummaries.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpSummaries.Location = New System.Drawing.Point(11, 219) Me.grpSummaries.Name = "grpSummaries" - - Me.grpSummaries.Size = New System.Drawing.Size(192, 72) - Me.grpSummaries.TabIndex = 39 - - Me.grpSummaries.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.grpSummaries.Size = New System.Drawing.Size(315, 108) + Me.grpSummaries.Size = New System.Drawing.Size(210, 72) Me.grpSummaries.TabIndex = 17 - Me.grpSummaries.TabStop = False ' 'lblFirstType ' Me.lblFirstType.AutoSize = True Me.lblFirstType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstType.Location = New System.Drawing.Point(18, 27) - Me.lblFirstType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblFirstType.Location = New System.Drawing.Point(12, 18) Me.lblFirstType.Name = "lblFirstType" - Me.lblFirstType.Size = New System.Drawing.Size(0, 20) + Me.lblFirstType.Size = New System.Drawing.Size(0, 13) Me.lblFirstType.TabIndex = 0 ' 'lblSecondBy ' Me.lblSecondBy.AutoSize = True Me.lblSecondBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - - Me.lblSecondBy.Location = New System.Drawing.Point(15, 32) - - Me.lblSecondBy.Location = New System.Drawing.Point(270, 24) - Me.lblSecondBy.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) - + Me.lblSecondBy.Location = New System.Drawing.Point(180, 16) Me.lblSecondBy.Name = "lblSecondBy" - Me.lblSecondBy.Size = New System.Drawing.Size(25, 20) + Me.lblSecondBy.Size = New System.Drawing.Size(18, 13) Me.lblSecondBy.TabIndex = 6 Me.lblSecondBy.Text = "by" ' @@ -207,14 +188,9 @@ Partial Class dlgDescribeTwoVariable ' Me.lblThreeVariableCategorical.AutoSize = True Me.lblThreeVariableCategorical.ForeColor = System.Drawing.SystemColors.Highlight - - Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(47, 33) - - Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(18, 50) - Me.lblThreeVariableCategorical.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) - + Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(12, 33) Me.lblThreeVariableCategorical.Name = "lblThreeVariableCategorical" - Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(86, 20) + Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(59, 13) Me.lblThreeVariableCategorical.TabIndex = 1 Me.lblThreeVariableCategorical.Text = "categorical" ' @@ -222,20 +198,18 @@ Partial Class dlgDescribeTwoVariable ' Me.lblSummaryName.AutoSize = True Me.lblSummaryName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSummaryName.Location = New System.Drawing.Point(105, 76) - Me.lblSummaryName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSummaryName.Location = New System.Drawing.Point(70, 51) Me.lblSummaryName.Name = "lblSummaryName" - Me.lblSummaryName.Size = New System.Drawing.Size(0, 20) + Me.lblSummaryName.Size = New System.Drawing.Size(0, 13) Me.lblSummaryName.TabIndex = 3 ' 'lblSummary ' Me.lblSummary.AutoSize = True Me.lblSummary.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSummary.Location = New System.Drawing.Point(18, 76) - Me.lblSummary.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSummary.Location = New System.Drawing.Point(12, 51) Me.lblSummary.Name = "lblSummary" - Me.lblSummary.Size = New System.Drawing.Size(80, 20) + Me.lblSummary.Size = New System.Drawing.Size(53, 13) Me.lblSummary.TabIndex = 2 Me.lblSummary.Text = "Summary:" ' @@ -243,10 +217,9 @@ Partial Class dlgDescribeTwoVariable ' Me.lblBy.AutoSize = True Me.lblBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblBy.Location = New System.Drawing.Point(123, 24) - Me.lblBy.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblBy.Location = New System.Drawing.Point(82, 16) Me.lblBy.Name = "lblBy" - Me.lblBy.Size = New System.Drawing.Size(25, 20) + Me.lblBy.Size = New System.Drawing.Size(18, 13) Me.lblBy.TabIndex = 4 Me.lblBy.Text = "by" ' @@ -254,19 +227,17 @@ Partial Class dlgDescribeTwoVariable ' Me.lblSecondType.AutoSize = True Me.lblSecondType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondType.Location = New System.Drawing.Point(159, 27) - Me.lblSecondType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSecondType.Location = New System.Drawing.Point(106, 18) Me.lblSecondType.Name = "lblSecondType" - Me.lblSecondType.Size = New System.Drawing.Size(0, 20) + Me.lblSecondType.Size = New System.Drawing.Size(0, 13) Me.lblSecondType.TabIndex = 5 ' 'lblFirstGroupByFactor ' Me.lblFirstGroupByFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstGroupByFactor.Location = New System.Drawing.Point(472, 224) - Me.lblFirstGroupByFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblFirstGroupByFactor.Location = New System.Drawing.Point(315, 149) Me.lblFirstGroupByFactor.Name = "lblFirstGroupByFactor" - Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(150, 22) + Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(100, 15) Me.lblFirstGroupByFactor.TabIndex = 7 Me.lblFirstGroupByFactor.Tag = "" Me.lblFirstGroupByFactor.Text = "Factor (Optional) :" @@ -279,10 +250,9 @@ Partial Class dlgDescribeTwoVariable Me.rdoSkim.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoSkim.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoSkim.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSkim.Location = New System.Drawing.Point(142, 12) - Me.rdoSkim.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoSkim.Location = New System.Drawing.Point(95, 8) Me.rdoSkim.Name = "rdoSkim" - Me.rdoSkim.Size = New System.Drawing.Size(150, 42) + Me.rdoSkim.Size = New System.Drawing.Size(100, 28) Me.rdoSkim.TabIndex = 1 Me.rdoSkim.Text = "Skim" Me.rdoSkim.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -291,10 +261,9 @@ Partial Class dlgDescribeTwoVariable 'lblThirdVariable ' Me.lblThirdVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblThirdVariable.Location = New System.Drawing.Point(465, 286) - Me.lblThirdVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblThirdVariable.Location = New System.Drawing.Point(310, 191) Me.lblThirdVariable.Name = "lblThirdVariable" - Me.lblThirdVariable.Size = New System.Drawing.Size(231, 22) + Me.lblThirdVariable.Size = New System.Drawing.Size(154, 15) Me.lblThirdVariable.TabIndex = 13 Me.lblThirdVariable.Tag = "" Me.lblThirdVariable.Text = "Third Variable :" @@ -302,10 +271,9 @@ Partial Class dlgDescribeTwoVariable 'lblSecondGroupByFactor ' Me.lblSecondGroupByFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondGroupByFactor.Location = New System.Drawing.Point(472, 286) - Me.lblSecondGroupByFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblSecondGroupByFactor.Location = New System.Drawing.Point(315, 191) Me.lblSecondGroupByFactor.Name = "lblSecondGroupByFactor" - Me.lblSecondGroupByFactor.Size = New System.Drawing.Size(206, 22) + Me.lblSecondGroupByFactor.Size = New System.Drawing.Size(137, 15) Me.lblSecondGroupByFactor.TabIndex = 33 Me.lblSecondGroupByFactor.Tag = "" Me.lblSecondGroupByFactor.Text = "Second Factor (Optional) :" @@ -318,10 +286,9 @@ Partial Class dlgDescribeTwoVariable Me.rdoTwoVariable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoTwoVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoTwoVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoTwoVariable.Location = New System.Drawing.Point(286, 12) - Me.rdoTwoVariable.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoTwoVariable.Location = New System.Drawing.Point(191, 8) Me.rdoTwoVariable.Name = "rdoTwoVariable" - Me.rdoTwoVariable.Size = New System.Drawing.Size(150, 42) + Me.rdoTwoVariable.Size = New System.Drawing.Size(100, 28) Me.rdoTwoVariable.TabIndex = 2 Me.rdoTwoVariable.Text = "Two Variables" Me.rdoTwoVariable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -330,10 +297,9 @@ Partial Class dlgDescribeTwoVariable 'cmdSummaries ' Me.cmdSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSummaries.Location = New System.Drawing.Point(465, 344) - Me.cmdSummaries.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdSummaries.Location = New System.Drawing.Point(310, 229) Me.cmdSummaries.Name = "cmdSummaries" - Me.cmdSummaries.Size = New System.Drawing.Size(180, 34) + Me.cmdSummaries.Size = New System.Drawing.Size(120, 23) Me.cmdSummaries.TabIndex = 1 Me.cmdSummaries.Tag = "Summaries" Me.cmdSummaries.Text = "Choose Summaries..." @@ -342,10 +308,9 @@ Partial Class dlgDescribeTwoVariable 'lblMarginName ' Me.lblMarginName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMarginName.Location = New System.Drawing.Point(22, 480) - Me.lblMarginName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblMarginName.Location = New System.Drawing.Point(15, 320) Me.lblMarginName.Name = "lblMarginName" - Me.lblMarginName.Size = New System.Drawing.Size(140, 22) + Me.lblMarginName.Size = New System.Drawing.Size(93, 15) Me.lblMarginName.TabIndex = 19 Me.lblMarginName.Tag = "" Me.lblMarginName.Text = "Margin Name:" @@ -356,113 +321,77 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.Controls.Add(Me.lblFactorAsPercentage) Me.grpDisplay.Controls.Add(Me.ucrReceiverPercentages) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) - Me.grpDisplay.Location = New System.Drawing.Point(412, 308) - Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpDisplay.Location = New System.Drawing.Point(275, 205) Me.grpDisplay.Name = "grpDisplay" - Me.grpDisplay.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.grpDisplay.Size = New System.Drawing.Size(291, 172) + Me.grpDisplay.Size = New System.Drawing.Size(194, 115) Me.grpDisplay.TabIndex = 15 Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' + 'ucrChkPercentageProportion + ' + Me.ucrChkPercentageProportion.AutoSize = True + Me.ucrChkPercentageProportion.Checked = False + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(8, 56) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(95, 23) + Me.ucrChkPercentageProportion.TabIndex = 57 + ' 'lblFactorAsPercentage ' Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFactorAsPercentage.Location = New System.Drawing.Point(14, 63) - Me.lblFactorAsPercentage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblFactorAsPercentage.Location = New System.Drawing.Point(9, 42) Me.lblFactorAsPercentage.Name = "lblFactorAsPercentage" - Me.lblFactorAsPercentage.Size = New System.Drawing.Size(231, 22) + Me.lblFactorAsPercentage.Size = New System.Drawing.Size(154, 15) Me.lblFactorAsPercentage.TabIndex = 2 Me.lblFactorAsPercentage.Tag = "" Me.lblFactorAsPercentage.Text = "Factor as Percentage:" ' - 'ucrReceiverFirstVars - ' - Me.ucrReceiverFirstVars.AutoSize = True - Me.ucrReceiverFirstVars.frmParent = Me - Me.ucrReceiverFirstVars.Location = New System.Drawing.Point(465, 96) - Me.ucrReceiverFirstVars.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverFirstVars.Name = "ucrReceiverFirstVars" - Me.ucrReceiverFirstVars.Selector = Nothing - Me.ucrReceiverFirstVars.Size = New System.Drawing.Size(180, 118) - Me.ucrReceiverFirstVars.strNcFilePath = "" - Me.ucrReceiverFirstVars.TabIndex = 6 - Me.ucrReceiverFirstVars.ucrSelector = Nothing - ' - 'ucrSaveTable - ' - Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveTable.Location = New System.Drawing.Point(22, 676) - Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) - Me.ucrSaveTable.TabIndex = 24 - ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(18, 126) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(214, 51) - Me.ucrChkPercentageProportion.TabIndex = 0 - ' 'ucrReceiverPercentages ' Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Nothing - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(18, 86) + Me.ucrReceiverPercentages.frmParent = Me + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(8, 38) Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(214, 30) + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(95, 13) Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 3 + Me.ucrReceiverPercentages.TabIndex = 55 Me.ucrReceiverPercentages.ucrSelector = Nothing ' 'ucrChkDisplayAsPercentage ' Me.ucrChkDisplayAsPercentage.AutoSize = True Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(18, 26) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(8, 11) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(214, 51) - Me.ucrChkDisplayAsPercentage.TabIndex = 1 - ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(143, 34) - Me.ucrChkPercentageProportion.TabIndex = 57 + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(95, 23) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 ' - 'ucrReceiverPercentages + 'ucrReceiverFirstVars ' - Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Nothing - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) - Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" - Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(143, 20) - Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 55 - Me.ucrReceiverPercentages.ucrSelector = Nothing + Me.ucrReceiverFirstVars.AutoSize = True + Me.ucrReceiverFirstVars.frmParent = Me + Me.ucrReceiverFirstVars.Location = New System.Drawing.Point(310, 64) + Me.ucrReceiverFirstVars.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFirstVars.Name = "ucrReceiverFirstVars" + Me.ucrReceiverFirstVars.Selector = Nothing + Me.ucrReceiverFirstVars.Size = New System.Drawing.Size(120, 79) + Me.ucrReceiverFirstVars.strNcFilePath = "" + Me.ucrReceiverFirstVars.TabIndex = 6 + Me.ucrReceiverFirstVars.ucrSelector = Nothing ' - 'ucrChkDisplayAsPercentage + 'ucrSaveTable ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 17) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(143, 34) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 + Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveTable.Location = New System.Drawing.Point(15, 451) + Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveTable.Name = "ucrSaveTable" + Me.ucrSaveTable.Size = New System.Drawing.Size(399, 24) + Me.ucrSaveTable.TabIndex = 24 ' 'ucrInputMarginName ' @@ -470,18 +399,18 @@ Partial Class dlgDescribeTwoVariable Me.ucrInputMarginName.AutoSize = True Me.ucrInputMarginName.IsMultiline = False Me.ucrInputMarginName.IsReadOnly = False - Me.ucrInputMarginName.Location = New System.Drawing.Point(171, 477) - Me.ucrInputMarginName.Margin = New System.Windows.Forms.Padding(14) + Me.ucrInputMarginName.Location = New System.Drawing.Point(114, 318) + Me.ucrInputMarginName.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputMarginName.Name = "ucrInputMarginName" - Me.ucrInputMarginName.Size = New System.Drawing.Size(206, 32) + Me.ucrInputMarginName.Size = New System.Drawing.Size(137, 21) Me.ucrInputMarginName.TabIndex = 22 ' 'ucrReorderSummary ' - Me.ucrReorderSummary.Location = New System.Drawing.Point(412, 387) - Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(9) + Me.ucrReorderSummary.Location = New System.Drawing.Point(275, 258) + Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrReorderSummary.Name = "ucrReorderSummary" - Me.ucrReorderSummary.Size = New System.Drawing.Size(291, 234) + Me.ucrReorderSummary.Size = New System.Drawing.Size(194, 156) Me.ucrReorderSummary.TabIndex = 16 Me.ucrReorderSummary.ucrDataFrameList = Nothing Me.ucrReorderSummary.ucrReceiver = Nothing @@ -490,31 +419,31 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkDisplayMargins.AutoSize = True Me.ucrChkDisplayMargins.Checked = False - Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) - Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(17, 296) + Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" - Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) + Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(143, 23) Me.ucrChkDisplayMargins.TabIndex = 18 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(22, 734) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) + Me.ucrBase.Location = New System.Drawing.Point(15, 489) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(611, 77) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 25 ' 'ucrReceiverThreeVariableThirdVariable ' Me.ucrReceiverThreeVariableThirdVariable.AutoSize = True Me.ucrReceiverThreeVariableThirdVariable.frmParent = Me - Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(465, 306) + Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(310, 204) Me.ucrReceiverThreeVariableThirdVariable.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverThreeVariableThirdVariable.Name = "ucrReceiverThreeVariableThirdVariable" Me.ucrReceiverThreeVariableThirdVariable.Selector = Nothing - Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 14 Me.ucrReceiverThreeVariableThirdVariable.ucrSelector = Nothing @@ -523,11 +452,11 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverSecondSkimrGroupByFactor.AutoSize = True Me.ucrReceiverSecondSkimrGroupByFactor.frmParent = Me - Me.ucrReceiverSecondSkimrGroupByFactor.Location = New System.Drawing.Point(465, 306) + Me.ucrReceiverSecondSkimrGroupByFactor.Location = New System.Drawing.Point(310, 204) Me.ucrReceiverSecondSkimrGroupByFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSecondSkimrGroupByFactor.Name = "ucrReceiverSecondSkimrGroupByFactor" Me.ucrReceiverSecondSkimrGroupByFactor.Selector = Nothing - Me.ucrReceiverSecondSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverSecondSkimrGroupByFactor.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverSecondSkimrGroupByFactor.strNcFilePath = "" Me.ucrReceiverSecondSkimrGroupByFactor.TabIndex = 34 Me.ucrReceiverSecondSkimrGroupByFactor.ucrSelector = Nothing @@ -536,13 +465,13 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverSecondTwoVariableFactor.AutoSize = True Me.ucrReceiverSecondTwoVariableFactor.frmParent = Me - Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(465, 246) + Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(310, 164) Me.ucrReceiverSecondTwoVariableFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSecondTwoVariableFactor.Name = "ucrReceiverSecondTwoVariableFactor" Me.ucrReceiverSecondTwoVariableFactor.Selector = Nothing - Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverSecondTwoVariableFactor.strNcFilePath = "" - Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 11 + Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 1 Me.ucrReceiverSecondTwoVariableFactor.ucrSelector = Nothing ' 'ucrSelectorDescribeTwoVar @@ -551,73 +480,76 @@ Partial Class dlgDescribeTwoVariable Me.ucrSelectorDescribeTwoVar.bDropUnusedFilterLevels = False Me.ucrSelectorDescribeTwoVar.bShowHiddenColumns = False Me.ucrSelectorDescribeTwoVar.bUseCurrentFilter = True - Me.ucrSelectorDescribeTwoVar.Location = New System.Drawing.Point(16, 54) + Me.ucrSelectorDescribeTwoVar.Location = New System.Drawing.Point(11, 36) Me.ucrSelectorDescribeTwoVar.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorDescribeTwoVar.Name = "ucrSelectorDescribeTwoVar" - Me.ucrSelectorDescribeTwoVar.Size = New System.Drawing.Size(320, 274) + Me.ucrSelectorDescribeTwoVar.Size = New System.Drawing.Size(213, 183) Me.ucrSelectorDescribeTwoVar.TabIndex = 4 ' 'ucrPnlDescribe ' Me.ucrPnlDescribe.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDescribe.Location = New System.Drawing.Point(138, 4) - Me.ucrPnlDescribe.Margin = New System.Windows.Forms.Padding(9) + Me.ucrPnlDescribe.Location = New System.Drawing.Point(92, 3) + Me.ucrPnlDescribe.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrPnlDescribe.Name = "ucrPnlDescribe" - Me.ucrPnlDescribe.Size = New System.Drawing.Size(476, 51) + Me.ucrPnlDescribe.Size = New System.Drawing.Size(317, 34) Me.ucrPnlDescribe.TabIndex = 0 ' 'ucrReceiverThreeVariableSecondFactor ' Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True Me.ucrReceiverThreeVariableSecondFactor.frmParent = Me - Me.ucrReceiverThreeVariableSecondFactor.Location = New System.Drawing.Point(465, 246) + Me.ucrReceiverThreeVariableSecondFactor.Location = New System.Drawing.Point(310, 164) Me.ucrReceiverThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverThreeVariableSecondFactor.Name = "ucrReceiverThreeVariableSecondFactor" Me.ucrReceiverThreeVariableSecondFactor.Selector = Nothing - Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverThreeVariableSecondFactor.strNcFilePath = "" - Me.ucrReceiverThreeVariableSecondFactor.TabIndex = 36 + Me.ucrReceiverThreeVariableSecondFactor.TabIndex = 12 Me.ucrReceiverThreeVariableSecondFactor.ucrSelector = Nothing ' 'ucrReceiverSkimrGroupByFactor ' Me.ucrReceiverSkimrGroupByFactor.AutoSize = True Me.ucrReceiverSkimrGroupByFactor.frmParent = Me - Me.ucrReceiverSkimrGroupByFactor.Location = New System.Drawing.Point(465, 246) + Me.ucrReceiverSkimrGroupByFactor.Location = New System.Drawing.Point(310, 164) Me.ucrReceiverSkimrGroupByFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSkimrGroupByFactor.Name = "ucrReceiverSkimrGroupByFactor" Me.ucrReceiverSkimrGroupByFactor.Selector = Nothing - Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverSkimrGroupByFactor.strNcFilePath = "" - Me.ucrReceiverSkimrGroupByFactor.TabIndex = 32 + Me.ucrReceiverSkimrGroupByFactor.TabIndex = 2 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing ' 'ucrChkOmitMissing ' Me.ucrChkOmitMissing.AutoSize = True Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(26, 444) - Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(17, 296) + Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" - Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) + Me.ucrChkOmitMissing.Size = New System.Drawing.Size(143, 23) Me.ucrChkOmitMissing.TabIndex = 0 ' 'ucrChkSummariesRowCol ' Me.ucrChkSummariesRowCol.AutoSize = True Me.ucrChkSummariesRowCol.Checked = False - Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 506) - Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(15, 337) + Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrChkSummariesRowCol.Name = "ucrChkSummariesRowCol" - Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) + Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(180, 23) Me.ucrChkSummariesRowCol.TabIndex = 20 ' 'dlgDescribeTwoVariable ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ClientSize = New System.Drawing.Size(723, 748) + Me.ClientSize = New System.Drawing.Size(482, 499) + Me.Controls.Add(Me.ucrReceiverThreeVariableSecondFactor) + Me.Controls.Add(Me.ucrReceiverSecondTwoVariableFactor) + Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) Me.Controls.Add(Me.ucrReceiverFirstVars) Me.Controls.Add(Me.ucrSaveTable) Me.Controls.Add(Me.grpDisplay) @@ -629,9 +561,7 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.cmdFormatTable) Me.Controls.Add(Me.ucrBase) - Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) Me.Controls.Add(Me.ucrReceiverSecondSkimrGroupByFactor) - Me.Controls.Add(Me.ucrReceiverSecondTwoVariableFactor) Me.Controls.Add(Me.ucrSelectorDescribeTwoVar) Me.Controls.Add(Me.lblFirstVariable) Me.Controls.Add(Me.grpSummaries) @@ -639,7 +569,6 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.rdoTwoVariable) Me.Controls.Add(Me.rdoSkim) Me.Controls.Add(Me.ucrPnlDescribe) - Me.Controls.Add(Me.ucrReceiverThreeVariableSecondFactor) Me.Controls.Add(Me.ucrReceiverSkimrGroupByFactor) Me.Controls.Add(Me.lblThirdVariable) Me.Controls.Add(Me.lblSecondGroupByFactor) @@ -649,7 +578,6 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrChkOmitMissing) Me.Controls.Add(Me.ucrChkSummariesRowCol) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgDescribeTwoVariable" From 14f1dbbc8c644bfb91da6789314a30ad783e534d Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 8 Mar 2024 14:12:51 +0100 Subject: [PATCH 20/83] Change made --- instat/dlgSeasonalGraph.Designer.vb | 357 +++++---- instat/dlgSeasonalGraph.vb | 1071 ++++++++++++++++----------- 2 files changed, 844 insertions(+), 584 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index 255759dde3c..efe86a046cf 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -22,49 +22,34 @@ Partial Class dlgSeasonalGraph 'Ne la modifiez pas à l'aide de l'éditeur de code. _ Private Sub InitializeComponent() - Me.ucrSelectorForSeasonalGraph = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrBase = New instat.ucrButtons() Me.rdoBar = New System.Windows.Forms.RadioButton() Me.rdoLine = New System.Windows.Forms.RadioButton() - Me.ucrPnlOptions = New instat.UcrPanel() - Me.ucrChkColour = New instat.ucrCheck() Me.lblXvariable = New System.Windows.Forms.Label() + Me.lblLines = New System.Windows.Forms.Label() + Me.lblFacetBy = New System.Windows.Forms.Label() + Me.ucrReceiverAddPoint = New instat.ucrReceiverMultiple() + Me.cmdOptions = New instat.ucrSplitButton() + Me.ucrInputLegendPosition = New instat.ucrInputComboBox() + Me.ucrInputStation = New instat.ucrInputComboBox() + Me.ucrReceiverFacetBy = New instat.ucrReceiverSingle() + Me.ucrChkRibbons = New instat.ucrCheck() + Me.ucrChkAddPoint = New instat.ucrCheck() Me.ucrReceiverX = New instat.ucrReceiverSingle() Me.ucrReceiverRibbons = New instat.ucrReceiverMultiple() - Me.lblLines = New System.Windows.Forms.Label() Me.ucrReceiverLines = New instat.ucrReceiverMultiple() Me.ucrSave = New instat.ucrSave() Me.ucrChkLegend = New instat.ucrCheck() - Me.ucrChkRibbons = New instat.ucrCheck() - Me.ucrInputStation = New instat.ucrInputComboBox() - Me.ucrReceiverFacetBy = New instat.ucrReceiverSingle() - Me.lblFacetBy = New System.Windows.Forms.Label() - Me.UcrInputColour = New instat.ucrInputComboBox() - Me.ucrInputLegendPosition = New instat.ucrInputComboBox() - Me.cmdOptions = New instat.ucrSplitButton() + Me.ucrPnlOptions = New instat.UcrPanel() + Me.ucrSelectorForSeasonalGraph = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() + Me.ucrChkFill = New instat.ucrCheck() + Me.ucrChkColour = New instat.ucrCheck() + Me.ucrInputFill = New instat.ucrInputTextBox() + Me.ucrInputColour = New instat.ucrInputTextBox() + Me.lblFill = New System.Windows.Forms.Label() + Me.lblColour = New System.Windows.Forms.Label() Me.SuspendLayout() ' - 'ucrSelectorForSeasonalGraph - ' - Me.ucrSelectorForSeasonalGraph.AutoSize = True - Me.ucrSelectorForSeasonalGraph.bDropUnusedFilterLevels = False - Me.ucrSelectorForSeasonalGraph.bShowHiddenColumns = False - Me.ucrSelectorForSeasonalGraph.bUseCurrentFilter = True - Me.ucrSelectorForSeasonalGraph.Location = New System.Drawing.Point(13, 68) - Me.ucrSelectorForSeasonalGraph.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorForSeasonalGraph.Name = "ucrSelectorForSeasonalGraph" - Me.ucrSelectorForSeasonalGraph.Size = New System.Drawing.Size(213, 183) - Me.ucrSelectorForSeasonalGraph.TabIndex = 0 - ' - 'ucrBase - ' - Me.ucrBase.AutoSize = True - Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(22, 428) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 19 - ' 'rdoBar ' Me.rdoBar.Appearance = System.Windows.Forms.Appearance.Button @@ -104,39 +89,119 @@ Partial Class dlgSeasonalGraph Me.rdoLine.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoLine.UseVisualStyleBackColor = False ' - 'ucrPnlOptions - ' - Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlOptions.Location = New System.Drawing.Point(122, 12) - Me.ucrPnlOptions.Name = "ucrPnlOptions" - Me.ucrPnlOptions.Size = New System.Drawing.Size(220, 44) - Me.ucrPnlOptions.TabIndex = 1 - ' - 'ucrChkColour - ' - Me.ucrChkColour.AutoSize = True - Me.ucrChkColour.Checked = False - Me.ucrChkColour.Enabled = False - Me.ucrChkColour.Location = New System.Drawing.Point(13, 300) - Me.ucrChkColour.Name = "ucrChkColour" - Me.ucrChkColour.Size = New System.Drawing.Size(88, 23) - Me.ucrChkColour.TabIndex = 15 - ' 'lblXvariable ' Me.lblXvariable.AutoSize = True Me.lblXvariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblXvariable.Location = New System.Drawing.Point(260, 285) + Me.lblXvariable.Location = New System.Drawing.Point(320, 285) Me.lblXvariable.Name = "lblXvariable" Me.lblXvariable.Size = New System.Drawing.Size(58, 13) Me.lblXvariable.TabIndex = 6 Me.lblXvariable.Text = "X Variable:" ' + 'lblLines + ' + Me.lblLines.AutoSize = True + Me.lblLines.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblLines.Location = New System.Drawing.Point(320, 68) + Me.lblLines.Name = "lblLines" + Me.lblLines.Size = New System.Drawing.Size(35, 13) + Me.lblLines.TabIndex = 4 + Me.lblLines.Text = "Lines:" + ' + 'lblFacetBy + ' + Me.lblFacetBy.AutoSize = True + Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFacetBy.Location = New System.Drawing.Point(260, 476) + Me.lblFacetBy.Name = "lblFacetBy" + Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) + Me.lblFacetBy.TabIndex = 8 + Me.lblFacetBy.Tag = "" + Me.lblFacetBy.Text = "Facet By (Optional):" + ' + 'ucrReceiverAddPoint + ' + Me.ucrReceiverAddPoint.AutoSize = True + Me.ucrReceiverAddPoint.frmParent = Me + Me.ucrReceiverAddPoint.Location = New System.Drawing.Point(319, 352) + Me.ucrReceiverAddPoint.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverAddPoint.Name = "ucrReceiverAddPoint" + Me.ucrReceiverAddPoint.Selector = Nothing + Me.ucrReceiverAddPoint.Size = New System.Drawing.Size(120, 75) + Me.ucrReceiverAddPoint.strNcFilePath = "" + Me.ucrReceiverAddPoint.TabIndex = 20 + Me.ucrReceiverAddPoint.ucrSelector = Nothing + ' + 'cmdOptions + ' + Me.cmdOptions.AutoSize = True + Me.cmdOptions.Location = New System.Drawing.Point(13, 266) + Me.cmdOptions.Name = "cmdOptions" + Me.cmdOptions.Size = New System.Drawing.Size(148, 23) + Me.cmdOptions.TabIndex = 14 + Me.cmdOptions.Tag = "Plot Options" + Me.cmdOptions.Text = "Plot Options" + Me.cmdOptions.UseVisualStyleBackColor = True + ' + 'ucrInputLegendPosition + ' + Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True + Me.ucrInputLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputLegendPosition.GetSetSelectedIndex = -1 + Me.ucrInputLegendPosition.IsReadOnly = False + Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 490) + Me.ucrInputLegendPosition.Name = "ucrInputLegendPosition" + Me.ucrInputLegendPosition.Size = New System.Drawing.Size(82, 21) + Me.ucrInputLegendPosition.TabIndex = 18 + ' + 'ucrInputStation + ' + Me.ucrInputStation.AddQuotesIfUnrecognised = True + Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputStation.GetSetSelectedIndex = -1 + Me.ucrInputStation.IsReadOnly = False + Me.ucrInputStation.Location = New System.Drawing.Point(386, 490) + Me.ucrInputStation.Name = "ucrInputStation" + Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) + Me.ucrInputStation.TabIndex = 10 + ' + 'ucrReceiverFacetBy + ' + Me.ucrReceiverFacetBy.AutoSize = True + Me.ucrReceiverFacetBy.frmParent = Me + Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 491) + Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" + Me.ucrReceiverFacetBy.Selector = Nothing + Me.ucrReceiverFacetBy.Size = New System.Drawing.Size(120, 26) + Me.ucrReceiverFacetBy.strNcFilePath = "" + Me.ucrReceiverFacetBy.TabIndex = 9 + Me.ucrReceiverFacetBy.ucrSelector = Nothing + ' + 'ucrChkRibbons + ' + Me.ucrChkRibbons.AutoSize = True + Me.ucrChkRibbons.Checked = False + Me.ucrChkRibbons.Location = New System.Drawing.Point(319, 184) + Me.ucrChkRibbons.Name = "ucrChkRibbons" + Me.ucrChkRibbons.Size = New System.Drawing.Size(114, 23) + Me.ucrChkRibbons.TabIndex = 11 + ' + 'ucrChkAddPoint + ' + Me.ucrChkAddPoint.AutoSize = True + Me.ucrChkAddPoint.Checked = False + Me.ucrChkAddPoint.Location = New System.Drawing.Point(319, 326) + Me.ucrChkAddPoint.Name = "ucrChkAddPoint" + Me.ucrChkAddPoint.Size = New System.Drawing.Size(88, 23) + Me.ucrChkAddPoint.TabIndex = 15 + ' 'ucrReceiverX ' Me.ucrReceiverX.AutoSize = True Me.ucrReceiverX.frmParent = Me - Me.ucrReceiverX.Location = New System.Drawing.Point(259, 301) + Me.ucrReceiverX.Location = New System.Drawing.Point(319, 301) Me.ucrReceiverX.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverX.Name = "ucrReceiverX" Me.ucrReceiverX.Selector = Nothing @@ -149,7 +214,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverRibbons.AutoSize = True Me.ucrReceiverRibbons.frmParent = Me - Me.ucrReceiverRibbons.Location = New System.Drawing.Point(259, 207) + Me.ucrReceiverRibbons.Location = New System.Drawing.Point(319, 207) Me.ucrReceiverRibbons.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRibbons.Name = "ucrReceiverRibbons" Me.ucrReceiverRibbons.Selector = Nothing @@ -158,21 +223,11 @@ Partial Class dlgSeasonalGraph Me.ucrReceiverRibbons.TabIndex = 12 Me.ucrReceiverRibbons.ucrSelector = Nothing ' - 'lblLines - ' - Me.lblLines.AutoSize = True - Me.lblLines.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblLines.Location = New System.Drawing.Point(260, 68) - Me.lblLines.Name = "lblLines" - Me.lblLines.Size = New System.Drawing.Size(35, 13) - Me.lblLines.TabIndex = 4 - Me.lblLines.Text = "Lines:" - ' 'ucrReceiverLines ' Me.ucrReceiverLines.AutoSize = True Me.ucrReceiverLines.frmParent = Me - Me.ucrReceiverLines.Location = New System.Drawing.Point(259, 82) + Me.ucrReceiverLines.Location = New System.Drawing.Point(319, 82) Me.ucrReceiverLines.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverLines.Name = "ucrReceiverLines" Me.ucrReceiverLines.Selector = Nothing @@ -184,7 +239,7 @@ Partial Class dlgSeasonalGraph 'ucrSave ' Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSave.Location = New System.Drawing.Point(13, 383) + Me.ucrSave.Location = New System.Drawing.Point(13, 531) Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSave.Name = "ucrSave" Me.ucrSave.Size = New System.Drawing.Size(451, 24) @@ -194,101 +249,119 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkLegend.AutoSize = True Me.ucrChkLegend.Checked = False - Me.ucrChkLegend.Location = New System.Drawing.Point(13, 343) + Me.ucrChkLegend.Location = New System.Drawing.Point(13, 491) Me.ucrChkLegend.Name = "ucrChkLegend" Me.ucrChkLegend.Size = New System.Drawing.Size(88, 23) Me.ucrChkLegend.TabIndex = 17 ' - 'ucrChkRibbons - ' - Me.ucrChkRibbons.AutoSize = True - Me.ucrChkRibbons.Checked = False - Me.ucrChkRibbons.Location = New System.Drawing.Point(259, 184) - Me.ucrChkRibbons.Name = "ucrChkRibbons" - Me.ucrChkRibbons.Size = New System.Drawing.Size(114, 23) - Me.ucrChkRibbons.TabIndex = 11 - ' - 'ucrInputStation - ' - Me.ucrInputStation.AddQuotesIfUnrecognised = True - Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputStation.GetSetSelectedIndex = -1 - Me.ucrInputStation.IsReadOnly = False - Me.ucrInputStation.Location = New System.Drawing.Point(386, 342) - Me.ucrInputStation.Name = "ucrInputStation" - Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) - Me.ucrInputStation.TabIndex = 10 - ' - 'ucrReceiverFacetBy + 'ucrPnlOptions ' - Me.ucrReceiverFacetBy.AutoSize = True - Me.ucrReceiverFacetBy.frmParent = Me - Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 343) - Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" - Me.ucrReceiverFacetBy.Selector = Nothing - Me.ucrReceiverFacetBy.Size = New System.Drawing.Size(120, 26) - Me.ucrReceiverFacetBy.strNcFilePath = "" - Me.ucrReceiverFacetBy.TabIndex = 9 - Me.ucrReceiverFacetBy.ucrSelector = Nothing + Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOptions.Location = New System.Drawing.Point(122, 12) + Me.ucrPnlOptions.Name = "ucrPnlOptions" + Me.ucrPnlOptions.Size = New System.Drawing.Size(220, 44) + Me.ucrPnlOptions.TabIndex = 1 ' - 'lblFacetBy + 'ucrSelectorForSeasonalGraph ' - Me.lblFacetBy.AutoSize = True - Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFacetBy.Location = New System.Drawing.Point(260, 328) - Me.lblFacetBy.Name = "lblFacetBy" - Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) - Me.lblFacetBy.TabIndex = 8 - Me.lblFacetBy.Tag = "" - Me.lblFacetBy.Text = "Facet By (Optional):" + Me.ucrSelectorForSeasonalGraph.AutoSize = True + Me.ucrSelectorForSeasonalGraph.bDropUnusedFilterLevels = False + Me.ucrSelectorForSeasonalGraph.bShowHiddenColumns = False + Me.ucrSelectorForSeasonalGraph.bUseCurrentFilter = True + Me.ucrSelectorForSeasonalGraph.Location = New System.Drawing.Point(13, 68) + Me.ucrSelectorForSeasonalGraph.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorForSeasonalGraph.Name = "ucrSelectorForSeasonalGraph" + Me.ucrSelectorForSeasonalGraph.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorForSeasonalGraph.TabIndex = 0 ' - 'UcrInputColour + 'ucrBase ' - Me.UcrInputColour.AddQuotesIfUnrecognised = True - Me.UcrInputColour.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.UcrInputColour.GetSetSelectedIndex = -1 - Me.UcrInputColour.IsReadOnly = False - Me.UcrInputColour.Location = New System.Drawing.Point(119, 302) - Me.UcrInputColour.Name = "UcrInputColour" - Me.UcrInputColour.Size = New System.Drawing.Size(82, 21) - Me.UcrInputColour.TabIndex = 16 + Me.ucrBase.AutoSize = True + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(22, 576) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.TabIndex = 19 ' - 'ucrInputLegendPosition + 'ucrChkFill ' - Me.ucrInputLegendPosition.AddQuotesIfUnrecognised = True - Me.ucrInputLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrInputLegendPosition.GetSetSelectedIndex = -1 - Me.ucrInputLegendPosition.IsReadOnly = False - Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 342) - Me.ucrInputLegendPosition.Name = "ucrInputLegendPosition" - Me.ucrInputLegendPosition.Size = New System.Drawing.Size(82, 21) - Me.ucrInputLegendPosition.TabIndex = 18 + Me.ucrChkFill.AutoSize = True + Me.ucrChkFill.Checked = False + Me.ucrChkFill.Location = New System.Drawing.Point(14, 301) + Me.ucrChkFill.Name = "ucrChkFill" + Me.ucrChkFill.Size = New System.Drawing.Size(88, 23) + Me.ucrChkFill.TabIndex = 21 ' - 'cmdOptions + 'ucrChkColour ' - Me.cmdOptions.AutoSize = True - Me.cmdOptions.Location = New System.Drawing.Point(13, 266) - Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(148, 23) - Me.cmdOptions.TabIndex = 14 - Me.cmdOptions.Tag = "Plot Options" - Me.cmdOptions.Text = "Plot Options" - Me.cmdOptions.UseVisualStyleBackColor = True + Me.ucrChkColour.AutoSize = True + Me.ucrChkColour.Checked = False + Me.ucrChkColour.Location = New System.Drawing.Point(14, 370) + Me.ucrChkColour.Name = "ucrChkColour" + Me.ucrChkColour.Size = New System.Drawing.Size(88, 23) + Me.ucrChkColour.TabIndex = 22 + ' + 'ucrInputFill + ' + Me.ucrInputFill.AddQuotesIfUnrecognised = True + Me.ucrInputFill.AutoSize = True + Me.ucrInputFill.IsMultiline = False + Me.ucrInputFill.IsReadOnly = False + Me.ucrInputFill.Location = New System.Drawing.Point(64, 326) + Me.ucrInputFill.Name = "ucrInputFill" + Me.ucrInputFill.Size = New System.Drawing.Size(205, 23) + Me.ucrInputFill.TabIndex = 184 + ' + 'ucrInputColour + ' + Me.ucrInputColour.AddQuotesIfUnrecognised = True + Me.ucrInputColour.AutoSize = True + Me.ucrInputColour.IsMultiline = False + Me.ucrInputColour.IsReadOnly = False + Me.ucrInputColour.Location = New System.Drawing.Point(64, 395) + Me.ucrInputColour.Name = "ucrInputColour" + Me.ucrInputColour.Size = New System.Drawing.Size(205, 23) + Me.ucrInputColour.TabIndex = 185 + ' + 'lblFill + ' + Me.lblFill.AutoSize = True + Me.lblFill.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFill.Location = New System.Drawing.Point(14, 332) + Me.lblFill.Name = "lblFill" + Me.lblFill.Size = New System.Drawing.Size(35, 13) + Me.lblFill.TabIndex = 186 + Me.lblFill.Text = "Lines:" + ' + 'lblColour + ' + Me.lblColour.AutoSize = True + Me.lblColour.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColour.Location = New System.Drawing.Point(14, 399) + Me.lblColour.Name = "lblColour" + Me.lblColour.Size = New System.Drawing.Size(41, 13) + Me.lblColour.TabIndex = 187 + Me.lblColour.Text = "Labels:" ' 'dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(477, 493) + Me.ClientSize = New System.Drawing.Size(477, 638) + Me.Controls.Add(Me.lblColour) + Me.Controls.Add(Me.lblFill) + Me.Controls.Add(Me.ucrInputColour) + Me.Controls.Add(Me.ucrInputFill) + Me.Controls.Add(Me.ucrChkColour) + Me.Controls.Add(Me.ucrChkFill) + Me.Controls.Add(Me.ucrReceiverAddPoint) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.ucrInputLegendPosition) - Me.Controls.Add(Me.UcrInputColour) Me.Controls.Add(Me.ucrInputStation) Me.Controls.Add(Me.ucrReceiverFacetBy) Me.Controls.Add(Me.lblFacetBy) Me.Controls.Add(Me.ucrChkRibbons) - Me.Controls.Add(Me.ucrChkColour) + Me.Controls.Add(Me.ucrChkAddPoint) Me.Controls.Add(Me.lblXvariable) Me.Controls.Add(Me.ucrReceiverX) Me.Controls.Add(Me.ucrReceiverRibbons) @@ -317,7 +390,7 @@ Partial Class dlgSeasonalGraph Friend WithEvents rdoBar As RadioButton Friend WithEvents rdoLine As RadioButton Friend WithEvents ucrPnlOptions As UcrPanel - Friend WithEvents ucrChkColour As ucrCheck + Friend WithEvents ucrChkAddPoint As ucrCheck Friend WithEvents lblXvariable As Label Friend WithEvents ucrReceiverX As ucrReceiverSingle Friend WithEvents ucrChkRibbons As ucrCheck @@ -327,9 +400,15 @@ Partial Class dlgSeasonalGraph Friend WithEvents ucrSave As ucrSave Friend WithEvents ucrChkLegend As ucrCheck Friend WithEvents ucrInputLegendPosition As ucrInputComboBox - Friend WithEvents UcrInputColour As ucrInputComboBox Friend WithEvents ucrInputStation As ucrInputComboBox Friend WithEvents ucrReceiverFacetBy As ucrReceiverSingle Friend WithEvents lblFacetBy As Label Friend WithEvents cmdOptions As ucrSplitButton + Friend WithEvents ucrReceiverAddPoint As ucrReceiverMultiple + Friend WithEvents ucrChkColour As ucrCheck + Friend WithEvents ucrChkFill As ucrCheck + Friend WithEvents lblColour As Label + Friend WithEvents lblFill As Label + Friend WithEvents ucrInputColour As ucrInputTextBox + Friend WithEvents ucrInputFill As ucrInputTextBox End Class diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index e902cf8ee14..5834669e670 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -1,446 +1,627 @@ -' R- Instat -' Copyright (C) 2015-2017 -' -' This program is free software: you can redistribute it and/or modify -' it under the terms of the GNU General Public License as published by -' the Free Software Foundation, either version 3 of the License, or -' (at your option) any later version. -' -' This program is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU General Public License for more details. -' -' You should have received a copy of the GNU General Public License -' along with this program. If not, see . - -Imports instat.Translations Public Class dlgSeasonalGraph Private clsRaesFunction As New RFunction Private clsRaesGeomLineFunction As New RFunction Private clsRaesRibFunction As New RFunction Private clsBaseOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsGeomLineFunction As New RFunction Private bResetSubdialog As Boolean = True Private clsGeomRibbonFunction As New RFunction Private clsRggplotFunction As New RFunction Private clsDummyFunction As New RFunction Private clsFacetFunction As New RFunction - Private clsFacetOperator As New ROperator - Private clsFacetRowOp As New ROperator - Private clsFacetColOp As New ROperator - Private clsGroupByFunction As New RFunction - Private clsPipeOperator As New ROperator - Private clsThemeFunction As New RFunction - - Private clsLabsFunction As New RFunction - Private clsXlabsFunction As New RFunction - Private clsYlabFunction As New RFunction - Private clsXScalecontinuousFunction As New RFunction - Private clsYScalecontinuousFunction As New RFunction - Private clsRFacetFunction As New RFunction - Private dctThemeFunctions As New Dictionary(Of String, RFunction) - Private clsCoordPolarFunction As New RFunction - Private clsCoordPolarStartOperator As New ROperator - Private clsXScaleDateFunction As New RFunction - Private clsYScaleDateFunction As New RFunction - Private clsScaleFillViridisFunction As New RFunction - Private clsScaleColourViridisFunction As New RFunction - Private clsAnnotateFunction As New RFunction - - Private bUpdatingParameters As Boolean = False - Private ReadOnly strFacetWrap As String = "Facet Wrap" - Private ReadOnly strFacetRow As String = "Facet Row" - Private ReadOnly strFacetCol As String = "Facet Column" Private ReadOnly strNone As String = "None" Private bUpdateComboOptions As Boolean = True - - 'Parameter names for geoms - Private strFirstParameterName As String = "geomLine" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strgeomRibbonParameterName0 As String = "geom_ribbon" Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName0, strgeomRibbonParameterName} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() bFirstLoad = False End If If bReset Then SetDefaults() End If SetRCodeForControls(bReset) - bReset = False autoTranslate(Me) TestOkEnabled() End Sub Private Sub InitialiseDialog() - Dim dctLegendPosition As New Dictionary(Of String, String) Dim dctColour As New Dictionary(Of String, String) - - ucrBase.iHelpTopicID = 522 - - ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) ucrSelectorForSeasonalGraph.SetParameterIsrfunction() ucrPnlOptions.AddRadioButton(rdoLine) ucrPnlOptions.AddRadioButton(rdoBar) ucrPnlOptions.AddParameterValuesCondition(rdoLine, "checked", "geom_line") ucrPnlOptions.AddParameterValuesCondition(rdoBar, "checked", "geom_Bar") - - ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph ucrReceiverLines.strSelectorHeading = "Variables" ucrReceiverLines.SetParameterIsString() ucrReceiverLines.SetLinkedDisplayControl(lblLines) ucrReceiverLines.bWithQuotes = False - - ucrReceiverX.Selector = ucrSelectorForSeasonalGraph - ucrReceiverX.SetParameter(New RParameter("x", 2)) - ucrReceiverX.SetParameterIsString() - ucrReceiverX.bWithQuotes = False - ucrReceiverX.strSelectorHeading = "Variables" - - ucrChkRibbons.SetText("Ribbon(s):") ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - - ucrReceiverRibbons.SetParameter(New RParameter("y", 1)) - ucrReceiverRibbons.Selector = ucrSelectorForSeasonalGraph ucrReceiverRibbons.strSelectorHeading = "Variables" ucrReceiverRibbons.SetParameterIsString() ucrReceiverRibbons.bWithQuotes = False - - ucrReceiverFacetBy.SetParameter(New RParameter("")) - ucrReceiverFacetBy.Selector = ucrSelectorForSeasonalGraph - ucrReceiverFacetBy.SetIncludedDataTypes({"factor"}) - ucrReceiverFacetBy.strSelectorHeading = "Factors" - ucrReceiverFacetBy.bWithQuotes = False - ucrReceiverFacetBy.SetParameterIsString() - ucrReceiverFacetBy.SetValuesToIgnore({"."}) ucrInputStation.SetItems({strFacetWrap, strFacetRow, strFacetCol, strNone}) - ucrInputStation.SetDropDownStyleAsNonEditable() - - ucrChkLegend.SetText("Legend:") - ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") - ucrInputLegendPosition.SetDropDownStyleAsNonEditable() - ucrInputLegendPosition.SetParameter(New RParameter("legend.position")) - dctLegendPosition.Add("None", Chr(34) & "none" & Chr(34)) - dctLegendPosition.Add("Left", Chr(34) & "left" & Chr(34)) - dctLegendPosition.Add("Right", Chr(34) & "right" & Chr(34)) - dctLegendPosition.Add("Top", Chr(34) & "top" & Chr(34)) - dctLegendPosition.Add("Bottom", Chr(34) & "bottom" & Chr(34)) - ucrInputLegendPosition.SetItems(dctLegendPosition) - ucrChkLegend.AddParameterPresentCondition(True, "legend.position") - ucrChkLegend.AddParameterPresentCondition(False, "legend.position", False) - - ucrChkColour.SetText("Colour") - ucrChkColour.AddParameterValuesCondition(True, "checked", "True") - ucrChkColour.AddParameterValuesCondition(False, "checked", "False") - ucrChkColour.AddToLinkedControls(UcrInputColour, {True}, bNewLinkedHideIfParameterMissing:=True) - - UcrInputColour.SetParameter(New RParameter("colour", 5)) - dctColour.Add("Black", Chr(34) & "black" & Chr(34)) - dctColour.Add("Red", Chr(34) & "red" & Chr(34)) - dctColour.Add("Blue", Chr(34) & "blue" & Chr(34)) - dctColour.Add("Yellow", Chr(34) & "yellow" & Chr(34)) - dctColour.Add("Green", Chr(34) & "green" & Chr(34)) - dctColour.Add("Violet", Chr(34) & "violet" & Chr(34)) - dctColour.Add("White", Chr(34) & "white" & Chr(34)) - dctColour.Add("None", Chr(34) & "none" & Chr(34)) - UcrInputColour.SetItems(dctColour) - UcrInputColour.bAllowNonConditionValues = True - UcrInputColour.SetRDefault(Chr(34) & "black" & Chr(34)) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() ucrSave.SetCheckBoxText("Save Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") - End Sub Private Sub SetDefaults() clsRggplotFunction = New RFunction clsGeomLineFunction = New RFunction clsRaesFunction = New RFunction clsRaesGeomLineFunction = New RFunction clsRaesRibFunction = New RFunction clsBaseOperator = New ROperator clsDummyFunction = New RFunction clsGeomLineFunction = New RFunction clsGeomRibbonFunction = New RFunction - clsFacetFunction = New RFunction - clsFacetOperator = New ROperator - clsFacetRowOp = New ROperator - clsFacetColOp = New ROperator clsPipeOperator = New ROperator - - clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction - ucrSelectorForSeasonalGraph.Reset() ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) ucrSave.Reset() ucrReceiverLines.SetMeAsReceiver() bResetSubdialog = True clsDummyFunction.AddParameter("checked", "geom_line", iPosition:=0) clsBaseOperator.SetOperation("+") clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) clsRggplotFunction.SetPackageName("ggplot2") clsRggplotFunction.SetRCommand("ggplot") clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) clsRaesFunction.SetPackageName("ggplot2") clsRaesFunction.SetRCommand("aes") - - clsFacetFunction.SetPackageName("ggplot2") - clsFacetRowOp.SetOperation("+") - clsFacetRowOp.bBrackets = False - clsFacetColOp.SetOperation("+") - clsFacetColOp.bBrackets = False - clsFacetOperator.SetOperation("~") - clsFacetOperator.bForceIncludeOperation = True - clsFacetOperator.bBrackets = False - clsFacetFunction.AddParameter("facets", clsROperatorParameter:=clsFacetOperator, iPosition:=0) - - clsPipeOperator.SetOperation("%>%") - SetPipeAssignTo() - - ucrInputStation.SetName(strFacetWrap) - ucrInputStation.bUpdateRCodeFromControl = True - - clsGroupByFunction.SetPackageName("dplyr") - clsGroupByFunction.SetRCommand("group_by") - - clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction - clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) - clsXlabsFunction = GgplotDefaults.clsXlabTitleFunction.Clone() - clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone - clsLabsFunction = GgplotDefaults.clsDefaultLabs.Clone() - clsXScalecontinuousFunction = GgplotDefaults.clsXScalecontinuousFunction.Clone() - clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone() - clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone() - clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone() - clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone() - dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions) - clsXScaleDateFunction = GgplotDefaults.clsXScaleDateFunction.Clone() - clsYScaleDateFunction = GgplotDefaults.clsYScaleDateFunction.Clone() - clsScaleFillViridisFunction = GgplotDefaults.clsScaleFillViridisFunction - clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction - clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrPnlOptions.SetRCode(clsDummyFunction, bReset) - ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) ucrReceiverX.SetRCode(clsRaesFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) - ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) - ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) - ucrChkColour.SetRCode(clsGeomLineFunction, bReset) - UcrInputColour.SetRCode(clsGeomLineFunction, bReset) - If bReset Then - ucrReceiverRibbons.SetRCode(clsRaesRibFunction, bReset) - ucrReceiverLines.SetRCode(clsRaesGeomLineFunction, bReset) - ucrChkRibbons.SetRCode(clsGeomRibbonFunction, bReset) - AutoFacetStation() - AutoFillmonth() - End If - End Sub Private Sub TestOkEnabled() If Not ucrSave.IsComplete OrElse (ucrReceiverLines.IsEmpty AndAlso Not ucrChkRibbons.Checked) Then - ucrBase.OKEnabled(False) - ElseIf Not ucrSave.IsComplete OrElse (ucrReceiverRibbons.IsEmpty AndAlso ucrChkRibbons.Checked) Then - ucrBase.OKEnabled(False) - ElseIf ucrChkRibbons.Checked AndAlso ucrReceiverLines.IsEmpty AndAlso (ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 OrElse ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3 OrElse ucrReceiverX.IsEmpty) Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) - End If - End Sub Private Sub ListGeomLine() If ucrReceiverLines.lstSelectedVariables.Items.Count > 0 Then clsRaesFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(0).Text, iPosition:=0) For i = 1 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaesGeomLineFunction As New RFunction clsRaesGeomLineFunction.SetPackageName("ggplot2") clsRaesGeomLineFunction.SetRCommand("aes") clsRaesGeomLineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) Dim clsGeomLineFunction As New RFunction clsGeomLineFunction.SetPackageName("ggplot2") clsGeomLineFunction.SetRCommand("geom_line") clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesGeomLineFunction, iPosition:=1) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=2) Next - Else - clsRaesFunction.RemoveParameterByName("y") clsBaseOperator.RemoveParameterByName(strFirstParameterName) End If End Sub Private Sub UpdateParameters() - clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) - clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) - clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) - - clsBaseOperator.RemoveParameterByName("facets") - bUpdatingParameters = True - ucrReceiverFacetBy.SetRCode(Nothing) - Select Case ucrInputStation.GetText() - Case strFacetWrap - ucrReceiverFacetBy.ChangeParameterName("wrap" & ucrInputStation.Name) - ucrReceiverFacetBy.SetRCode(clsFacetOperator) - Case strFacetCol - ucrReceiverFacetBy.ChangeParameterName("col" & ucrInputStation.Name) - ucrReceiverFacetBy.SetRCode(clsFacetColOp) - Case strFacetRow - ucrReceiverFacetBy.ChangeParameterName("row" & ucrInputStation.Name) - ucrReceiverFacetBy.SetRCode(clsFacetRowOp) - End Select - If Not clsRaesFunction.ContainsParameter("x") Then - clsRaesFunction.AddParameter("x", Chr(34) & Chr(34), iPosition:=1) - End If - bUpdatingParameters = False - End Sub - - Private Sub AddRemoveFacets() - Dim bWrap As Boolean = False - Dim bCol As Boolean = False - Dim bRow As Boolean = False - - If bUpdatingParameters Then - Exit Sub - End If - - clsBaseOperator.RemoveParameterByName("facets") - If Not ucrReceiverFacetBy.IsEmpty Then - Select Case ucrInputStation.GetText() - Case strFacetWrap - bWrap = True - Case strFacetCol - bCol = True - Case strFacetRow - bRow = True - End Select - End If - - If bWrap OrElse bRow OrElse bCol Then - clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction) - End If - If bWrap Then - clsFacetFunction.SetRCommand("facet_wrap") - End If - If bRow OrElse bCol Then - clsFacetFunction.SetRCommand("facet_grid") - End If - If bRow Then - clsFacetOperator.AddParameter("left", clsROperatorParameter:=clsFacetRowOp, iPosition:=0) - ElseIf bCol AndAlso bWrap = False Then - clsFacetOperator.AddParameter("left", ".", iPosition:=0) - Else - clsFacetOperator.RemoveParameterByName("left") - End If - If bCol Then - clsFacetOperator.AddParameter("right", clsROperatorParameter:=clsFacetColOp, iPosition:=1) - ElseIf bRow AndAlso bWrap = False Then - clsFacetOperator.AddParameter("right", ".", iPosition:=1) - Else - clsFacetOperator.RemoveParameterByName("right") - End If - End Sub - - Private Sub AddRemoveGroupBy() - If clsPipeOperator.ContainsParameter("mutate") Then - clsGroupByFunction.ClearParameters() - If clsBaseOperator.ContainsParameter("facets") Then - Select Case ucrInputStation.GetText() - Case strFacetWrap - GetParameterValue(clsFacetOperator) - Case strFacetCol - GetParameterValue(clsFacetColOp) - Case strFacetRow - GetParameterValue(clsFacetRowOp) - End Select - End If - If clsGroupByFunction.iParameterCount > 0 Then - clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) - Else - clsPipeOperator.RemoveParameterByName("group_by") - End If - Else - clsPipeOperator.RemoveParameterByName("group_by") - End If - SetPipeAssignTo() - End Sub - - Private Sub ucrInput_ControlValueChanged(ucrChangedControl As ucrInputComboBox) Handles ucrInputStation.ControlValueChanged - If Not bUpdateComboOptions Then - Exit Sub - End If - Dim strChangedText As String = ucrChangedControl.GetText() - If strChangedText <> strNone Then - If Not strChangedText = strFacetCol AndAlso Not strChangedText = strFacetRow AndAlso - Not ucrInputStation.Equals(ucrChangedControl) AndAlso ucrInputStation.GetText() = strChangedText Then - bUpdateComboOptions = False - ucrInputStation.SetName(strNone) - bUpdateComboOptions = True - End If - If (strChangedText = strFacetWrap AndAlso ucrInputStation.GetText = strFacetRow) OrElse (strChangedText = strFacetRow AndAlso - ucrInputStation.GetText = strFacetWrap) OrElse (strChangedText = strFacetWrap AndAlso - ucrInputStation.GetText = strFacetCol) OrElse (strChangedText = strFacetCol AndAlso ucrInputStation.GetText = strFacetWrap) Then - ucrInputStation.SetName(strNone) - End If - End If - UpdateParameters() - AddRemoveFacets() - AddRemoveGroupBy() - End Sub - - Private Sub GetParameterValue(clsOperator As ROperator) - Dim i As Integer = 0 - For Each clsTempParam As RParameter In clsOperator.clsParameters - If clsTempParam.strArgumentValue <> "" AndAlso clsTempParam.strArgumentValue <> "." Then - clsGroupByFunction.AddParameter(i, clsTempParam.strArgumentValue, bIncludeArgumentName:=False, iPosition:=i) - i = i + 1 - End If - Next - End Sub - - Private Sub SetPipeAssignTo() - If ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso clsPipeOperator.clsParameters.Count > 1 Then - clsPipeOperator.SetAssignTo(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text) - Else - clsPipeOperator.RemoveAssignTo() - End If - End Sub - - Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged - AddRemoveFacets() - AddRemoveGroupBy() - End Sub - - Private Sub AutoFacetStation() - Dim ucrCurrentReceiver As ucrReceiver = Nothing - - If ucrSelectorForSeasonalGraph.CurrentReceiver IsNot Nothing Then - ucrCurrentReceiver = ucrSelectorForSeasonalGraph.CurrentReceiver - End If - ucrReceiverFacetBy.AddItemsWithMetadataProperty(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"station_label"}) - If ucrCurrentReceiver IsNot Nothing Then - ucrCurrentReceiver.SetMeAsReceiver() - End If - AddRemoveGroupBy() - End Sub - - Private Sub AutoFillmonth() - Dim ucrCurrentReceiver0 As ucrReceiver = Nothing - - If ucrSelectorForSeasonalGraph.CurrentReceiver IsNot Nothing Then - ucrCurrentReceiver0 = ucrSelectorForSeasonalGraph.CurrentReceiver - End If - ucrReceiverX.AddItemsWithMetadataProperty(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"month_label"}) - If ucrCurrentReceiver0 IsNot Nothing Then - ucrCurrentReceiver0.SetMeAsReceiver() - End If - End Sub - - Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() End Sub - - Private Sub AddRemoveTheme() - If clsThemeFunction.iParameterCount > 0 Then - clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=15) - Else - clsBaseOperator.RemoveParameterByName("theme") - End If - End Sub - - Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged - AddRemoveTheme() - End Sub - - Private Sub ucrSelectorForSeasonalGraph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForSeasonalGraph.ControlValueChanged - AutoFacetStation() - SetPipeAssignTo() - AutoFillmonth() - End Sub - - Private Sub ucrChkColour_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkColour.ControlValueChanged, UcrInputColour.ControlValueChanged - If ucrChkColour.Checked Then - clsGeomLineFunction.AddParameter("colour", UcrInputColour.GetText, iPosition:=3) - Else - clsGeomLineFunction.RemoveParameterByName("colour") - End If - End Sub - - Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() - SetRCodeForControls(True) - TestOkEnabled() - End Sub - - Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click ', PlotOptionsToolStripMenuItem.Click - sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, - clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, - clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, ucrNewBaseSelector:=ucrSelectorForSeasonalGraph, - clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction, - clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, - strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) - sdgPlots.ShowDialog() - bResetSubdialog = False - End Sub - - Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged - If ucrChkRibbons.Checked Then - ucrReceiverRibbons.SetMeAsReceiver() - If ucrReceiverRibbons.lstSelectedVariables.Items.Count > 0 Then - ' Determine the loop range based on the count of variables - Dim loopEnd As Integer = ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 - If loopEnd Mod 2 = 0 Then - loopEnd -= 1 ' Adjust the loop end for even count - End If - - ' Loop through pairs of variables - For i = 0 To loopEnd Step 2 - ' Get current variable - Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text - ' Get the next variable in the pair if available - Dim var2 As String = ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text - - Dim clsRaesRibFunction As New RFunction - clsRaesRibFunction.SetPackageName("ggplot2") - clsRaesRibFunction.SetRCommand("aes") - clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) - clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) - - Dim clsRibFunction As New RFunction - clsRibFunction.SetPackageName("ggplot2") - clsRibFunction.SetRCommand("geom_ribbon") - clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) - - clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) - Next - - ' Check if there is an odd number of variables and create a clsRibFunction for the last variable - If loopEnd < ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Then - Dim lastVar = ucrReceiverRibbons.lstSelectedVariables.Items(loopEnd + 1).Text - Dim clsLastRibFunction As New RFunction - clsLastRibFunction.SetPackageName("ggplot2") - clsLastRibFunction.SetRCommand("aes") - clsLastRibFunction.AddParameter("ymax", lastVar, iPosition:=loopEnd + 1) - clsLastRibFunction.AddParameter("ymin", lastVar, iPosition:=loopEnd + 1) - - Dim clsLastRib As New RFunction - clsLastRib.SetPackageName("ggplot2") - clsLastRib.SetRCommand("geom_ribbon") - clsLastRib.AddParameter("mapping", clsRFunctionParameter:=clsLastRibFunction, iPosition:=1) - - clsBaseOperator.AddParameter(strFirstParameterName & (loopEnd + 1), clsRFunctionParameter:=clsLastRib, iPosition:=1) - End If - clsBaseOperator.RemoveParameterByName(strFirstParameterName & (loopEnd + 1)) - End If - End If - End Sub - - Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub - - Private Sub ucrReceiverX_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverX.ControlValueChanged - If Not ucrReceiverX.IsEmpty AndAlso (ucrReceiverX.strCurrDataType.Contains("factor") OrElse ucrReceiverX.strCurrDataType = "ordered,factor") Then - clsRaesFunction.AddParameter("group", "1", iPosition:=3) - Else - clsRaesFunction.RemoveParameterByName("group") - End If - End Sub +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . + +Imports instat.Translations + +Public Class dlgSeasonalGraph + Private clsRaesFunction As New RFunction + Private clsBaseOperator As New ROperator + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private bResetSubdialog As Boolean = True + Private clsRggplotFunction As New RFunction + Private clsDummyFunction As New RFunction + Private clsFacetFunction As New RFunction + Private clsFacetOperator As New ROperator + Private clsFacetRowOp As New ROperator + Private clsFacetColOp As New ROperator + Private clsGroupByFunction As New RFunction + Private clsPipeOperator As New ROperator + Private clsThemeFunction As New RFunction + Private clsNumericFunction As New RFunction + Private clsLabsFunction As New RFunction + Private clsXlabsFunction As New RFunction + Private clsYlabFunction As New RFunction + Private clsXScalecontinuousFunction As New RFunction + Private clsYScalecontinuousFunction As New RFunction + Private clsRFacetFunction As New RFunction + Private dctThemeFunctions As New Dictionary(Of String, RFunction) + Private clsCoordPolarFunction As New RFunction + Private clsCoordPolarStartOperator As New ROperator + Private clsXScaleDateFunction As New RFunction + Private clsYScaleDateFunction As New RFunction + Private clsScaleFillViridisFunction As New RFunction + Private clsScaleColourViridisFunction As New RFunction + Private clsAnnotateFunction As New RFunction + Private clsScalefillidentityFunction As New RFunction + Private clsScalecolouridentityFunction As New RFunction + Private bUpdatingParameters As Boolean = False + Private ReadOnly strFacetWrap As String = "Facet Wrap" + Private ReadOnly strFacetRow As String = "Facet Row" + Private ReadOnly strFacetCol As String = "Facet Column" + Private ReadOnly strNone As String = "None" + Private bUpdateComboOptions As Boolean = True + + 'Parameter names for geoms + Private strFirstParameterName As String = "geomLine" + Private strGeompointParameterName As String = "geom_point" + Private strgeomRibbonParameterName As String = "geom_ribbon" + Private strgeomRibbonParameterName0 As String = "geom_ribbon" + Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName, strgeomRibbonParameterName0, strGeompointParameterName} + + Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + autoTranslate(Me) + TestOkEnabled() + End Sub + + Private Sub InitialiseDialog() + Dim dctLegendPosition As New Dictionary(Of String, String) + Dim dctColour As New Dictionary(Of String, String) + + ucrBase.iHelpTopicID = 522 + + ucrSelectorForSeasonalGraph.SetParameter(New RParameter("data", 0)) + ucrSelectorForSeasonalGraph.SetParameterIsrfunction() + + ucrPnlOptions.AddRadioButton(rdoLine) + ucrPnlOptions.AddRadioButton(rdoBar) + + ucrPnlOptions.AddParameterValuesCondition(rdoLine, "checked", "geom_line") + ucrPnlOptions.AddParameterValuesCondition(rdoBar, "checked", "geom_Bar") + + ucrReceiverLines.Selector = ucrSelectorForSeasonalGraph + ucrReceiverLines.strSelectorHeading = "Variables" + ucrReceiverLines.SetParameterIsString() + ucrReceiverLines.SetLinkedDisplayControl(lblLines) + ucrReceiverLines.bWithQuotes = False + + ucrReceiverX.Selector = ucrSelectorForSeasonalGraph + ucrReceiverX.SetParameter(New RParameter("x", 2)) + ucrReceiverX.SetParameterIsString() + ucrReceiverX.bWithQuotes = False + ucrReceiverX.strSelectorHeading = "Variables" + ucrReceiverX.SetLinkedDisplayControl(lblXvariable) + + ucrChkRibbons.SetText("Ribbon(s):") + ucrChkRibbons.AddParameterPresentCondition(True, "geom_ribbon") + ucrChkRibbons.AddParameterPresentCondition(False, "geom_ribbon", False) + ucrChkRibbons.AddToLinkedControls(ucrReceiverRibbons, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + + ucrReceiverRibbons.SetParameter(New RParameter("y", 1)) + ucrReceiverRibbons.Selector = ucrSelectorForSeasonalGraph + ucrReceiverRibbons.strSelectorHeading = "Variables" + ucrReceiverRibbons.SetParameterIsString() + ucrReceiverRibbons.bWithQuotes = False + + ucrReceiverFacetBy.SetParameter(New RParameter("")) + ucrReceiverFacetBy.Selector = ucrSelectorForSeasonalGraph + ucrReceiverFacetBy.SetIncludedDataTypes({"factor"}) + ucrReceiverFacetBy.strSelectorHeading = "Factors" + ucrReceiverFacetBy.bWithQuotes = False + ucrReceiverFacetBy.SetParameterIsString() + ucrReceiverFacetBy.SetValuesToIgnore({"."}) + + ucrInputStation.SetItems({strFacetWrap, strFacetRow, strFacetCol, strNone}) + ucrInputStation.SetDropDownStyleAsNonEditable() + + ucrChkLegend.SetText("Legend:") + ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None") + ucrInputLegendPosition.SetDropDownStyleAsNonEditable() + ucrInputLegendPosition.SetParameter(New RParameter("legend.position")) + dctLegendPosition.Add("None", Chr(34) & "none" & Chr(34)) + dctLegendPosition.Add("Left", Chr(34) & "left" & Chr(34)) + dctLegendPosition.Add("Right", Chr(34) & "right" & Chr(34)) + dctLegendPosition.Add("Top", Chr(34) & "top" & Chr(34)) + dctLegendPosition.Add("Bottom", Chr(34) & "bottom" & Chr(34)) + ucrInputLegendPosition.SetItems(dctLegendPosition) + ucrChkLegend.AddParameterPresentCondition(True, "legend.position") + ucrChkLegend.AddParameterPresentCondition(False, "legend.position", False) + + ucrChkAddPoint.SetText("Add point") + ucrChkAddPoint.AddParameterValuesCondition(True, "checked", "True") + ucrChkAddPoint.AddParameterValuesCondition(False, "checked", "False") + ucrChkAddPoint.AddToLinkedControls(ucrReceiverAddPoint, {True}, bNewLinkedHideIfParameterMissing:=True) + + ucrReceiverAddPoint.SetParameter(New RParameter("y", 6)) + ucrReceiverAddPoint.Selector = ucrSelectorForSeasonalGraph + ucrReceiverAddPoint.strSelectorHeading = "Variables" + ucrReceiverAddPoint.SetParameterIsString() + ucrReceiverAddPoint.bWithQuotes = False + + ucrChkFill.SetText("Fill Identity:") + ucrChkFill.AddParameterValuesCondition(True, "checked", "True") + ucrChkFill.AddParameterValuesCondition(False, "checked", "False") + ucrChkFill.AddToLinkedControls(ucrInputFill, {True}, bNewLinkedHideIfParameterMissing:=True) + ucrInputFill.SetValidationTypeAsList() + ucrInputFill.SetLinkedDisplayControl(lblFill) + + ucrChkColour.SetText("Colour Identity:") + ucrChkColour.AddParameterValuesCondition(True, "checked", "True") + ucrChkColour.AddParameterValuesCondition(False, "checked", "False") + ucrChkColour.AddToLinkedControls(ucrInputColour, {True}, bNewLinkedHideIfParameterMissing:=True) + ucrInputColour.SetValidationTypeAsList() + ucrInputColour.SetLinkedDisplayControl(lblColour) + + ucrSave.SetPrefix("Seasonal_Graph") + ucrSave.SetIsComboBox() + ucrSave.SetSaveTypeAsGraph() + ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) + ucrSave.SetAssignToIfUncheckedValue("last_graph") + End Sub + + Private Sub SetDefaults() + clsRggplotFunction = New RFunction + clsRaesFunction = New RFunction + clsBaseOperator = New ROperator + clsDummyFunction = New RFunction + clsFacetFunction = New RFunction + clsScalecolouridentityFunction = New RFunction + clsScalefillidentityFunction = New RFunction + clsNumericFunction = New RFunction + clsFacetOperator = New ROperator + clsFacetRowOp = New ROperator + clsFacetColOp = New ROperator + clsPipeOperator = New ROperator + + clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction + + ucrSelectorForSeasonalGraph.Reset() + ucrSelectorForSeasonalGraph.SetGgplotFunction(clsBaseOperator) + ucrSave.Reset() + ucrReceiverLines.SetMeAsReceiver() + bResetSubdialog = True + clsDummyFunction.AddParameter("checked", "geom_line", iPosition:=0) + + clsBaseOperator.SetOperation("+") + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + + clsRggplotFunction.SetPackageName("ggplot2") + clsRggplotFunction.SetRCommand("ggplot") + clsRggplotFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesFunction, iPosition:=1) + + clsRaesFunction.SetPackageName("ggplot2") + clsRaesFunction.SetRCommand("aes") + + clsScalecolouridentityFunction.SetRCommand("scale_colour_identity") + clsScalecolouridentityFunction.AddParameter("name", "NULL", iPosition:=0) + clsScalecolouridentityFunction.AddParameter("guide", Chr(34) & "legend" & Chr(34), iPosition:=1) + + clsScalefillidentityFunction.SetRCommand("scale_fill_identity") + clsScalefillidentityFunction.AddParameter("name", "NULL", iPosition:=0) + clsScalefillidentityFunction.AddParameter("guide", Chr(34) & "legend" & Chr(34), iPosition:=1) + + clsFacetFunction.SetPackageName("ggplot2") + clsFacetRowOp.SetOperation("+") + clsFacetRowOp.bBrackets = False + clsFacetColOp.SetOperation("+") + clsFacetColOp.bBrackets = False + clsFacetOperator.SetOperation("~") + clsFacetOperator.bForceIncludeOperation = True + clsFacetOperator.bBrackets = False + clsFacetFunction.AddParameter("facets", clsROperatorParameter:=clsFacetOperator, iPosition:=0) + + clsNumericFunction.SetRCommand("as.numeric") + + clsPipeOperator.SetOperation("%>%") + SetPipeAssignTo() + + ucrInputStation.SetName(strFacetWrap) + ucrInputStation.bUpdateRCodeFromControl = True + + clsGroupByFunction.SetPackageName("dplyr") + clsGroupByFunction.SetRCommand("group_by") + + clsThemeFunction = GgplotDefaults.clsDefaultThemeFunction + clsXlabsFunction = GgplotDefaults.clsXlabTitleFunction.Clone() + clsYlabFunction = GgplotDefaults.clsYlabTitleFunction.Clone + clsLabsFunction = GgplotDefaults.clsDefaultLabs.Clone() + clsXScalecontinuousFunction = GgplotDefaults.clsXScalecontinuousFunction.Clone() + clsYScalecontinuousFunction = GgplotDefaults.clsYScalecontinuousFunction.Clone() + clsRFacetFunction = GgplotDefaults.clsFacetFunction.Clone() + clsCoordPolarStartOperator = GgplotDefaults.clsCoordPolarStartOperator.Clone() + clsCoordPolarFunction = GgplotDefaults.clsCoordPolarFunction.Clone() + dctThemeFunctions = New Dictionary(Of String, RFunction)(GgplotDefaults.dctThemeFunctions) + clsXScaleDateFunction = GgplotDefaults.clsXScaleDateFunction.Clone() + clsYScaleDateFunction = GgplotDefaults.clsYScaleDateFunction.Clone() + clsScaleFillViridisFunction = GgplotDefaults.clsScaleFillViridisFunction + clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction + clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction + + clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrReceiverX.AddAdditionalCodeParameterPair(clsNumericFunction, New RParameter("x", 2), iAdditionalPairNo:=1) + + ucrPnlOptions.SetRCode(clsDummyFunction, bReset) + ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) + ucrSave.SetRCode(clsBaseOperator, bReset) + ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True) + If bReset Then + ucrReceiverX.SetRCode(clsRaesFunction, bReset) + ucrChkColour.SetRCode(clsScalecolouridentityFunction, bReset) + ucrInputColour.SetRCode(clsScalecolouridentityFunction, bReset) + ucrChkFill.SetRCode(clsScalefillidentityFunction, bReset) + ucrInputFill.SetRCode(clsScalefillidentityFunction, bReset) + ucrChkRibbons.SetRCode(clsBaseOperator, bReset) + ucrChkAddPoint.SetRCode(clsBaseOperator, bReset) + AutoFacetStation() + AutoFillmonth() + End If + End Sub + + Private Sub TestOkEnabled() + If Not ucrSave.IsComplete OrElse (ucrReceiverLines.IsEmpty AndAlso Not ucrChkRibbons.Checked) Then + ucrBase.OKEnabled(False) + ElseIf Not ucrSave.IsComplete OrElse (ucrReceiverRibbons.IsEmpty AndAlso ucrChkRibbons.Checked) Then + ucrBase.OKEnabled(False) + ElseIf ucrChkRibbons.Checked AndAlso ucrReceiverRibbons.lstSelectedVariables.Items.Count = 1 Then + ucrBase.OKEnabled(False) + ElseIf ucrChkRibbons.Checked AndAlso ucrReceiverRibbons.lstSelectedVariables.Items.Count = 3 Then + ucrBase.OKEnabled(False) + ElseIf ucrReceiverX.IsEmpty Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) + End If + End Sub + + Private Sub ListGeomLine() + ' Clear parameters before adding new ones + clsBaseOperator.ClearParameters() + + Dim i As Integer + + ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + Dim clsRaeslineFunction As New RFunction + Dim ColourArguments As New List(Of String) From {"grey", "grey", "black", "grey"} + Dim LinewidthArguments As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} + Dim GroupArguments As New List(Of String) From {"grey", "grey", "grey", "grey"} + + clsRaeslineFunction.SetPackageName("ggplot2") + clsRaeslineFunction.SetRCommand("aes") + clsRaeslineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) + clsRaeslineFunction.AddParameter("colour", Chr(34) & ColourArguments(i) & Chr(34), iPosition:=1) + + Dim clsGeomLineFunction As New RFunction + clsGeomLineFunction.SetPackageName("ggplot2") + clsGeomLineFunction.SetRCommand("geom_line") + clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaeslineFunction, iPosition:=1) + clsGeomLineFunction.AddParameter("linewidth", LinewidthArguments(i), iPosition:=2) + clsGeomLineFunction.AddParameter("group", Chr(34) & GroupArguments(i) & Chr(34), iPosition:=3) + + ' Add geom_line function to the base operator + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) + Next + + ' Add geom_point functions for ucrReceiverAddPoint.lstSelectedVariables + For i = 0 To ucrReceiverAddPoint.lstSelectedVariables.Items.Count - 1 + Dim clsAesGeompointFunction As New RFunction + clsAesGeompointFunction.SetPackageName("ggplot2") + clsAesGeompointFunction.SetRCommand("aes") + clsAesGeompointFunction.AddParameter("y", ucrReceiverAddPoint.lstSelectedVariables.Items(i).Text, iPosition:=0) + + Dim clsGeomPointFunction As New RFunction + clsGeomPointFunction.SetPackageName("ggplot2") + clsGeomPointFunction.SetRCommand("geom_point") + clsGeomPointFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction, iPosition:=1) + + ' Add geom_point function to the base operator + clsBaseOperator.AddParameter(strGeompointParameterName & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=8) + Next + + ' Add geom_ribbon functions for ucrReceiverRibbons.lstSelectedVariables + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 + ' Get current variable + Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text + ' Get the next variable in the pair if available + Dim var2 As String = If(i + 1 < ucrReceiverRibbons.lstSelectedVariables.Items.Count, ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text, "") + Dim fillArguments As New List(Of String) From {"#3270C1", "#A3A3A3", "#4DB0F1", "#FF5733"} + + If Not String.IsNullOrEmpty(var2) Then + Dim clsRaesRibFunction As New RFunction + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) + clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) + clsRaesRibFunction.AddParameter("fill", Chr(34) & fillArguments(i) & Chr(34), iPosition:=2) + + Dim clsRibFunction As New RFunction + clsRibFunction.SetPackageName("ggplot2") + clsRibFunction.SetRCommand("geom_ribbon") + clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) + + clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) + End If + Next + AddRemoveFacets() + AddRemoveGroupBy() + End Sub + + + Private Sub UpdateParameters() + clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) + clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) + clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) + + clsBaseOperator.RemoveParameterByName("facets") + bUpdatingParameters = True + ucrReceiverFacetBy.SetRCode(Nothing) + Select Case ucrInputStation.GetText() + Case strFacetWrap + ucrReceiverFacetBy.ChangeParameterName("wrap" & ucrInputStation.Name) + ucrReceiverFacetBy.SetRCode(clsFacetOperator) + Case strFacetCol + ucrReceiverFacetBy.ChangeParameterName("col" & ucrInputStation.Name) + ucrReceiverFacetBy.SetRCode(clsFacetColOp) + Case strFacetRow + ucrReceiverFacetBy.ChangeParameterName("row" & ucrInputStation.Name) + ucrReceiverFacetBy.SetRCode(clsFacetRowOp) + End Select + If Not clsRaesFunction.ContainsParameter("x") Then + clsRaesFunction.AddParameter("x", Chr(34) & Chr(34), iPosition:=1) + End If + bUpdatingParameters = False + End Sub + + Private Sub AddRemoveFacets() + Dim bWrap As Boolean = False + Dim bCol As Boolean = False + Dim bRow As Boolean = False + + If bUpdatingParameters Then + Exit Sub + End If + + clsBaseOperator.RemoveParameterByName("facets") + If Not ucrReceiverFacetBy.IsEmpty Then + Select Case ucrInputStation.GetText() + Case strFacetWrap + bWrap = True + Case strFacetCol + bCol = True + Case strFacetRow + bRow = True + End Select + End If + + If bWrap OrElse bRow OrElse bCol Then + clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction) + End If + If bWrap Then + clsFacetFunction.SetRCommand("facet_wrap") + End If + If bRow OrElse bCol Then + clsFacetFunction.SetRCommand("facet_grid") + End If + If bRow Then + clsFacetOperator.AddParameter("left", clsROperatorParameter:=clsFacetRowOp, iPosition:=0) + ElseIf bCol AndAlso bWrap = False Then + clsFacetOperator.AddParameter("left", ".", iPosition:=0) + Else + clsFacetOperator.RemoveParameterByName("left") + End If + If bCol Then + clsFacetOperator.AddParameter("right", clsROperatorParameter:=clsFacetColOp, iPosition:=1) + ElseIf bRow AndAlso bWrap = False Then + clsFacetOperator.AddParameter("right", ".", iPosition:=1) + Else + clsFacetOperator.RemoveParameterByName("right") + End If + End Sub + + Private Sub AddRemoveGroupBy() + If clsPipeOperator.ContainsParameter("mutate") Then + clsGroupByFunction.ClearParameters() + If clsBaseOperator.ContainsParameter("facets") Then + Select Case ucrInputStation.GetText() + Case strFacetWrap + GetParameterValue(clsFacetOperator) + Case strFacetCol + GetParameterValue(clsFacetColOp) + Case strFacetRow + GetParameterValue(clsFacetRowOp) + End Select + End If + If clsGroupByFunction.iParameterCount > 0 Then + clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1) + Else + clsPipeOperator.RemoveParameterByName("group_by") + End If + Else + clsPipeOperator.RemoveParameterByName("group_by") + End If + SetPipeAssignTo() + End Sub + + Private Sub ucrInput_ControlValueChanged(ucrChangedControl As ucrInputComboBox) Handles ucrInputStation.ControlValueChanged + If Not bUpdateComboOptions Then + Exit Sub + End If + Dim strChangedText As String = ucrChangedControl.GetText() + If strChangedText <> strNone Then + If Not strChangedText = strFacetCol AndAlso Not strChangedText = strFacetRow AndAlso + Not ucrInputStation.Equals(ucrChangedControl) AndAlso ucrInputStation.GetText() = strChangedText Then + bUpdateComboOptions = False + ucrInputStation.SetName(strNone) + bUpdateComboOptions = True + End If + If (strChangedText = strFacetWrap AndAlso ucrInputStation.GetText = strFacetRow) OrElse (strChangedText = strFacetRow AndAlso + ucrInputStation.GetText = strFacetWrap) OrElse (strChangedText = strFacetWrap AndAlso + ucrInputStation.GetText = strFacetCol) OrElse (strChangedText = strFacetCol AndAlso ucrInputStation.GetText = strFacetWrap) Then + ucrInputStation.SetName(strNone) + End If + End If + UpdateParameters() + AddRemoveFacets() + AddRemoveGroupBy() + End Sub + + Private Sub GetParameterValue(clsOperator As ROperator) + Dim i As Integer = 0 + For Each clsTempParam As RParameter In clsOperator.clsParameters + If clsTempParam.strArgumentValue <> "" AndAlso clsTempParam.strArgumentValue <> "." Then + clsGroupByFunction.AddParameter(i, clsTempParam.strArgumentValue, bIncludeArgumentName:=False, iPosition:=i) + i = i + 1 + End If + Next + End Sub + + Private Sub SetPipeAssignTo() + If ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text <> "" AndAlso clsPipeOperator.clsParameters.Count > 1 Then + clsPipeOperator.SetAssignTo(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text) + Else + clsPipeOperator.RemoveAssignTo() + End If + End Sub + + Private Sub ucrReceiverFacetBy_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFacetBy.ControlValueChanged + AddRemoveFacets() + AddRemoveGroupBy() + End Sub + + Private Sub AutoFacetStation() + Dim ucrCurrentReceiver As ucrReceiver = Nothing + + If ucrSelectorForSeasonalGraph.CurrentReceiver IsNot Nothing Then + ucrCurrentReceiver = ucrSelectorForSeasonalGraph.CurrentReceiver + End If + ucrReceiverFacetBy.AddItemsWithMetadataProperty(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"station_label"}) + If ucrCurrentReceiver IsNot Nothing Then + ucrCurrentReceiver.SetMeAsReceiver() + End If + AddRemoveGroupBy() + End Sub + + Private Sub AutoFillmonth() + Dim ucrCurrentReceiver0 As ucrReceiver = Nothing + + If ucrSelectorForSeasonalGraph.CurrentReceiver IsNot Nothing Then + ucrCurrentReceiver0 = ucrSelectorForSeasonalGraph.CurrentReceiver + End If + ucrReceiverX.AddItemsWithMetadataProperty(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, "Climatic_Type", {"month_label"}) + If ucrCurrentReceiver0 IsNot Nothing Then + ucrCurrentReceiver0.SetMeAsReceiver() + End If + End Sub + + Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged + ListGeomLine() + End Sub + + Private Sub AddRemoveTheme() + If clsThemeFunction.iParameterCount > 0 Then + clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=15) + Else + clsBaseOperator.RemoveParameterByName("theme") + End If + End Sub + + Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged + AddRemoveTheme() + End Sub + + Private Sub ucrSelectorForSeasonalGraph_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorForSeasonalGraph.ControlValueChanged + AutoFacetStation() + SetPipeAssignTo() + AutoFillmonth() + End Sub + + Private Sub ucrBase_Click(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click ', PlotOptionsToolStripMenuItem.Click + sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction, + clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, + clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, ucrNewBaseSelector:=ucrSelectorForSeasonalGraph, + clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction, + clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, + strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) + sdgPlots.ShowDialog() + bResetSubdialog = False + End Sub + + Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged + ListGeomLine() + If ucrChkRibbons.Checked Then + ucrReceiverRibbons.SetMeAsReceiver() + Else + clsBaseOperator.RemoveParameterByName(strgeomRibbonParameterName0) + End If + End Sub + + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged, ucrReceiverAddPoint.ControlContentsChanged + TestOkEnabled() + End Sub + + Private Sub ucrReceiverX_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverX.ControlValueChanged + Dim variableNames As String = String.Join(",", ucrReceiverX.GetVariableNames()) + ' Concatenate the variable names with commas + variableNames = variableNames.Replace("'", "").Replace("""", "") + + If Not ucrReceiverX.IsEmpty AndAlso (ucrReceiverX.strCurrDataType.Contains("factor") OrElse ucrReceiverX.strCurrDataType = "ordered,factor") Then + clsNumericFunction.AddParameter("x", variableNames, iPosition:=0, bIncludeArgumentName:=False) + clsRaesFunction.AddParameter("x", clsRFunctionParameter:=clsNumericFunction) + clsRaesFunction.AddParameter("group", "1", iPosition:=3) + Else + clsRaesFunction.RemoveParameterByName("group") + 'clsRaesFunction.AddParameter("x", ucrReceiverX.GetVariableNames().Trim()) + clsRaesFunction.AddParameter("x", variableNames) + End If + End Sub + + Private Sub ucrChkAddPoint_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddPoint.ControlValueChanged, ucrReceiverAddPoint.ControlValueChanged + If ucrChkAddPoint.Checked Then + ucrReceiverAddPoint.SetMeAsReceiver() + Else + clsBaseOperator.RemoveParameterByName(strGeompointParameterName) + End If + ListGeomLine() + End Sub + + Private Sub ucrChkFill_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkFill.ControlValueChanged, ucrChkColour.ControlValueChanged, ucrInputFill.ControlValueChanged, ucrInputColour.ControlValueChanged + If ucrChkFill.Checked AndAlso Not ucrInputFill.IsEmpty Then + clsScalefillidentityFunction.AddParameter("labels", ucrInputFill.clsRList.ToScript(), iPosition:=2) + clsBaseOperator.AddParameter("scale_fill_identity", clsRFunctionParameter:=clsScalefillidentityFunction, iPosition:=12) + Else + clsBaseOperator.RemoveParameterByName("scale_fill_identity") + End If + If ucrChkColour.Checked AndAlso Not ucrInputColour.IsEmpty Then + clsScalecolouridentityFunction.AddParameter("labels", ucrInputColour.clsRList.ToScript(), iPosition:=2) + clsBaseOperator.AddParameter("scale_colour_identity", clsRFunctionParameter:=clsScalecolouridentityFunction, iPosition:=13) + Else + clsBaseOperator.RemoveParameterByName("scale_colour_identity") + End If + End Sub End Class \ No newline at end of file From a14387fdcd3f637de35582f5437c5ee789cf54d0 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 8 Mar 2024 14:25:21 +0100 Subject: [PATCH 21/83] minor change --- instat/dlgSeasonalGraph.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 5834669e670..2738afe1448 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -114,6 +114,7 @@ Public Class dlgSeasonalGraph ucrReceiverRibbons.strSelectorHeading = "Variables" ucrReceiverRibbons.SetParameterIsString() ucrReceiverRibbons.bWithQuotes = False + ucrReceiverRibbons.iMaxItems = 4 ucrReceiverFacetBy.SetParameter(New RParameter("")) ucrReceiverFacetBy.Selector = ucrSelectorForSeasonalGraph From 6f10573fef41d6c9148f95df507106fa816a4533 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 4 Apr 2024 11:54:09 +0100 Subject: [PATCH 22/83] minor change made on the design --- instat/dlgSeasonalGraph.Designer.vb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index efe86a046cf..613d3df0522 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -113,7 +113,7 @@ Partial Class dlgSeasonalGraph ' Me.lblFacetBy.AutoSize = True Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFacetBy.Location = New System.Drawing.Point(260, 476) + Me.lblFacetBy.Location = New System.Drawing.Point(260, 444) Me.lblFacetBy.Name = "lblFacetBy" Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) Me.lblFacetBy.TabIndex = 8 @@ -150,7 +150,7 @@ Partial Class dlgSeasonalGraph Me.ucrInputLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputLegendPosition.GetSetSelectedIndex = -1 Me.ucrInputLegendPosition.IsReadOnly = False - Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 490) + Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 458) Me.ucrInputLegendPosition.Name = "ucrInputLegendPosition" Me.ucrInputLegendPosition.Size = New System.Drawing.Size(82, 21) Me.ucrInputLegendPosition.TabIndex = 18 @@ -161,7 +161,7 @@ Partial Class dlgSeasonalGraph Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputStation.GetSetSelectedIndex = -1 Me.ucrInputStation.IsReadOnly = False - Me.ucrInputStation.Location = New System.Drawing.Point(386, 490) + Me.ucrInputStation.Location = New System.Drawing.Point(386, 458) Me.ucrInputStation.Name = "ucrInputStation" Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) Me.ucrInputStation.TabIndex = 10 @@ -170,7 +170,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverFacetBy.AutoSize = True Me.ucrReceiverFacetBy.frmParent = Me - Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 491) + Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 459) Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" Me.ucrReceiverFacetBy.Selector = Nothing @@ -239,7 +239,7 @@ Partial Class dlgSeasonalGraph 'ucrSave ' Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSave.Location = New System.Drawing.Point(13, 531) + Me.ucrSave.Location = New System.Drawing.Point(13, 499) Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSave.Name = "ucrSave" Me.ucrSave.Size = New System.Drawing.Size(451, 24) @@ -249,7 +249,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkLegend.AutoSize = True Me.ucrChkLegend.Checked = False - Me.ucrChkLegend.Location = New System.Drawing.Point(13, 491) + Me.ucrChkLegend.Location = New System.Drawing.Point(13, 459) Me.ucrChkLegend.Name = "ucrChkLegend" Me.ucrChkLegend.Size = New System.Drawing.Size(88, 23) Me.ucrChkLegend.TabIndex = 17 @@ -278,7 +278,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(22, 576) + Me.ucrBase.Location = New System.Drawing.Point(22, 544) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 19 @@ -289,7 +289,7 @@ Partial Class dlgSeasonalGraph Me.ucrChkFill.Checked = False Me.ucrChkFill.Location = New System.Drawing.Point(14, 301) Me.ucrChkFill.Name = "ucrChkFill" - Me.ucrChkFill.Size = New System.Drawing.Size(88, 23) + Me.ucrChkFill.Size = New System.Drawing.Size(147, 23) Me.ucrChkFill.TabIndex = 21 ' 'ucrChkColour @@ -298,7 +298,7 @@ Partial Class dlgSeasonalGraph Me.ucrChkColour.Checked = False Me.ucrChkColour.Location = New System.Drawing.Point(14, 370) Me.ucrChkColour.Name = "ucrChkColour" - Me.ucrChkColour.Size = New System.Drawing.Size(88, 23) + Me.ucrChkColour.Size = New System.Drawing.Size(147, 23) Me.ucrChkColour.TabIndex = 22 ' 'ucrInputFill @@ -329,9 +329,9 @@ Partial Class dlgSeasonalGraph Me.lblFill.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.lblFill.Location = New System.Drawing.Point(14, 332) Me.lblFill.Name = "lblFill" - Me.lblFill.Size = New System.Drawing.Size(35, 13) + Me.lblFill.Size = New System.Drawing.Size(41, 13) Me.lblFill.TabIndex = 186 - Me.lblFill.Text = "Lines:" + Me.lblFill.Text = "Labels:" ' 'lblColour ' @@ -347,7 +347,7 @@ Partial Class dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(477, 638) + Me.ClientSize = New System.Drawing.Size(477, 604) Me.Controls.Add(Me.lblColour) Me.Controls.Add(Me.lblFill) Me.Controls.Add(Me.ucrInputColour) From 6db5eac87598f415e0863a8636072830a2a44de2 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:51:18 +0200 Subject: [PATCH 23/83] Code changes --- instat/dlgDescribeTwoVariable.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 7e827feaa35..e56056791f3 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -47,7 +47,7 @@ Public Class dlgDescribeTwoVariable Private clsGroupByPipeOperator, clsSummaryOperator, clsGroupByPipeOperator2, clsGroupByPipeOperator3, clsGroupByPipeOperator4, clsGroupByPipeOperatorData As New ROperator - Private clsGroupByPipeOperator, clsSummaryOperator, clsTildOperator, clsMapOperator, clsPivotOperator As New ROperator + Private clsTildOperator, clsMapOperator, clsPivotOperator As New ROperator Private clsgtFunction, clsMapSummaryFunction, clsMapGtFunction As New RFunction @@ -1131,6 +1131,7 @@ Public Class dlgDescribeTwoVariable ChangeSumaryLabelText() End If ManageControlsVisibility() + End Sub Private Sub SetHelpOptions() Select Case enumTwovariableMode From e3f9f96ba5c48e5047ba67b60919b516baa3b630 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Tue, 23 Apr 2024 09:15:33 +0300 Subject: [PATCH 24/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 303 ++++++++++++---------- instat/dlgDescribeTwoVariable.vb | 23 +- 2 files changed, 192 insertions(+), 134 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 0e4d5becb57..c0340073fa3 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -64,18 +64,19 @@ Partial Class dlgDescribeTwoVariable Me.lblFactorAsPercentage = New System.Windows.Forms.Label() Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() + Me.ucrChkCorrelations = New instat.ucrCheck() + Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() + Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() + Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrChkDisplayMargins = New instat.ucrCheck() Me.ucrBase = New instat.ucrButtons() - Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverSecondSkimrGroupByFactor = New instat.ucrReceiverSingle() - Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() Me.ucrSelectorDescribeTwoVar = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrPnlDescribe = New instat.UcrPanel() - Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() Me.ucrReceiverSkimrGroupByFactor = New instat.ucrReceiverSingle() Me.ucrChkOmitMissing = New instat.ucrCheck() Me.ucrChkSummariesRowCol = New instat.ucrCheck() @@ -91,9 +92,10 @@ Partial Class dlgDescribeTwoVariable Me.rdoThreeVariable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoThreeVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoThreeVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoThreeVariable.Location = New System.Drawing.Point(288, 8) + Me.rdoThreeVariable.Location = New System.Drawing.Point(432, 12) + Me.rdoThreeVariable.Margin = New System.Windows.Forms.Padding(4) Me.rdoThreeVariable.Name = "rdoThreeVariable" - Me.rdoThreeVariable.Size = New System.Drawing.Size(100, 28) + Me.rdoThreeVariable.Size = New System.Drawing.Size(150, 42) Me.rdoThreeVariable.TabIndex = 3 Me.rdoThreeVariable.Text = "Three Variables" Me.rdoThreeVariable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -102,9 +104,10 @@ Partial Class dlgDescribeTwoVariable 'cmdFormatTable ' Me.cmdFormatTable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFormatTable.Location = New System.Drawing.Point(326, 423) + Me.cmdFormatTable.Location = New System.Drawing.Point(489, 634) + Me.cmdFormatTable.Margin = New System.Windows.Forms.Padding(4) Me.cmdFormatTable.Name = "cmdFormatTable" - Me.cmdFormatTable.Size = New System.Drawing.Size(104, 23) + Me.cmdFormatTable.Size = New System.Drawing.Size(156, 34) Me.cmdFormatTable.TabIndex = 23 Me.cmdFormatTable.Text = "Format Table..." Me.cmdFormatTable.UseVisualStyleBackColor = True @@ -112,9 +115,10 @@ Partial Class dlgDescribeTwoVariable 'lblThreeVariableSecondFactor ' Me.lblThreeVariableSecondFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblThreeVariableSecondFactor.Location = New System.Drawing.Point(315, 150) + Me.lblThreeVariableSecondFactor.Location = New System.Drawing.Point(472, 225) + Me.lblThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblThreeVariableSecondFactor.Name = "lblThreeVariableSecondFactor" - Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(100, 15) + Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(150, 22) Me.lblThreeVariableSecondFactor.TabIndex = 10 Me.lblThreeVariableSecondFactor.Tag = "" Me.lblThreeVariableSecondFactor.Text = "Second Variable :" @@ -122,9 +126,10 @@ Partial Class dlgDescribeTwoVariable 'cmdMissingOptions ' Me.cmdMissingOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMissingOptions.Location = New System.Drawing.Point(167, 296) + Me.cmdMissingOptions.Location = New System.Drawing.Point(250, 444) + Me.cmdMissingOptions.Margin = New System.Windows.Forms.Padding(4) Me.cmdMissingOptions.Name = "cmdMissingOptions" - Me.cmdMissingOptions.Size = New System.Drawing.Size(105, 23) + Me.cmdMissingOptions.Size = New System.Drawing.Size(158, 34) Me.cmdMissingOptions.TabIndex = 21 Me.cmdMissingOptions.Text = "Missing Options..." Me.cmdMissingOptions.UseVisualStyleBackColor = True @@ -132,9 +137,10 @@ Partial Class dlgDescribeTwoVariable 'lbSecondVariable ' Me.lbSecondVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lbSecondVariable.Location = New System.Drawing.Point(310, 150) + Me.lbSecondVariable.Location = New System.Drawing.Point(465, 225) + Me.lbSecondVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lbSecondVariable.Name = "lbSecondVariable" - Me.lbSecondVariable.Size = New System.Drawing.Size(100, 15) + Me.lbSecondVariable.Size = New System.Drawing.Size(150, 22) Me.lbSecondVariable.TabIndex = 9 Me.lbSecondVariable.Tag = "" Me.lbSecondVariable.Text = "Second Variable:" @@ -143,9 +149,10 @@ Partial Class dlgDescribeTwoVariable ' Me.lblFirstVariable.AutoSize = True Me.lblFirstVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstVariable.Location = New System.Drawing.Point(310, 49) + Me.lblFirstVariable.Location = New System.Drawing.Point(465, 74) + Me.lblFirstVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFirstVariable.Name = "lblFirstVariable" - Me.lblFirstVariable.Size = New System.Drawing.Size(75, 13) + Me.lblFirstVariable.Size = New System.Drawing.Size(114, 20) Me.lblFirstVariable.TabIndex = 5 Me.lblFirstVariable.Tag = "" Me.lblFirstVariable.Text = "First Variables:" @@ -159,9 +166,11 @@ Partial Class dlgDescribeTwoVariable Me.grpSummaries.Controls.Add(Me.lblSummary) Me.grpSummaries.Controls.Add(Me.lblBy) Me.grpSummaries.Controls.Add(Me.lblSecondType) - Me.grpSummaries.Location = New System.Drawing.Point(11, 219) + Me.grpSummaries.Location = New System.Drawing.Point(16, 328) + Me.grpSummaries.Margin = New System.Windows.Forms.Padding(4) Me.grpSummaries.Name = "grpSummaries" - Me.grpSummaries.Size = New System.Drawing.Size(210, 72) + Me.grpSummaries.Padding = New System.Windows.Forms.Padding(4) + Me.grpSummaries.Size = New System.Drawing.Size(315, 108) Me.grpSummaries.TabIndex = 17 Me.grpSummaries.TabStop = False ' @@ -169,18 +178,20 @@ Partial Class dlgDescribeTwoVariable ' Me.lblFirstType.AutoSize = True Me.lblFirstType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstType.Location = New System.Drawing.Point(12, 18) + Me.lblFirstType.Location = New System.Drawing.Point(18, 27) + Me.lblFirstType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFirstType.Name = "lblFirstType" - Me.lblFirstType.Size = New System.Drawing.Size(0, 13) + Me.lblFirstType.Size = New System.Drawing.Size(0, 20) Me.lblFirstType.TabIndex = 0 ' 'lblSecondBy ' Me.lblSecondBy.AutoSize = True Me.lblSecondBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondBy.Location = New System.Drawing.Point(180, 16) + Me.lblSecondBy.Location = New System.Drawing.Point(270, 24) + Me.lblSecondBy.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSecondBy.Name = "lblSecondBy" - Me.lblSecondBy.Size = New System.Drawing.Size(18, 13) + Me.lblSecondBy.Size = New System.Drawing.Size(25, 20) Me.lblSecondBy.TabIndex = 6 Me.lblSecondBy.Text = "by" ' @@ -188,9 +199,10 @@ Partial Class dlgDescribeTwoVariable ' Me.lblThreeVariableCategorical.AutoSize = True Me.lblThreeVariableCategorical.ForeColor = System.Drawing.SystemColors.Highlight - Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(12, 33) + Me.lblThreeVariableCategorical.Location = New System.Drawing.Point(18, 50) + Me.lblThreeVariableCategorical.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblThreeVariableCategorical.Name = "lblThreeVariableCategorical" - Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(59, 13) + Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(86, 20) Me.lblThreeVariableCategorical.TabIndex = 1 Me.lblThreeVariableCategorical.Text = "categorical" ' @@ -198,18 +210,20 @@ Partial Class dlgDescribeTwoVariable ' Me.lblSummaryName.AutoSize = True Me.lblSummaryName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSummaryName.Location = New System.Drawing.Point(70, 51) + Me.lblSummaryName.Location = New System.Drawing.Point(105, 76) + Me.lblSummaryName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSummaryName.Name = "lblSummaryName" - Me.lblSummaryName.Size = New System.Drawing.Size(0, 13) + Me.lblSummaryName.Size = New System.Drawing.Size(0, 20) Me.lblSummaryName.TabIndex = 3 ' 'lblSummary ' Me.lblSummary.AutoSize = True Me.lblSummary.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSummary.Location = New System.Drawing.Point(12, 51) + Me.lblSummary.Location = New System.Drawing.Point(18, 76) + Me.lblSummary.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSummary.Name = "lblSummary" - Me.lblSummary.Size = New System.Drawing.Size(53, 13) + Me.lblSummary.Size = New System.Drawing.Size(80, 20) Me.lblSummary.TabIndex = 2 Me.lblSummary.Text = "Summary:" ' @@ -217,9 +231,10 @@ Partial Class dlgDescribeTwoVariable ' Me.lblBy.AutoSize = True Me.lblBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblBy.Location = New System.Drawing.Point(82, 16) + Me.lblBy.Location = New System.Drawing.Point(123, 24) + Me.lblBy.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblBy.Name = "lblBy" - Me.lblBy.Size = New System.Drawing.Size(18, 13) + Me.lblBy.Size = New System.Drawing.Size(25, 20) Me.lblBy.TabIndex = 4 Me.lblBy.Text = "by" ' @@ -227,17 +242,19 @@ Partial Class dlgDescribeTwoVariable ' Me.lblSecondType.AutoSize = True Me.lblSecondType.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondType.Location = New System.Drawing.Point(106, 18) + Me.lblSecondType.Location = New System.Drawing.Point(159, 27) + Me.lblSecondType.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSecondType.Name = "lblSecondType" - Me.lblSecondType.Size = New System.Drawing.Size(0, 13) + Me.lblSecondType.Size = New System.Drawing.Size(0, 20) Me.lblSecondType.TabIndex = 5 ' 'lblFirstGroupByFactor ' Me.lblFirstGroupByFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFirstGroupByFactor.Location = New System.Drawing.Point(315, 149) + Me.lblFirstGroupByFactor.Location = New System.Drawing.Point(472, 224) + Me.lblFirstGroupByFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFirstGroupByFactor.Name = "lblFirstGroupByFactor" - Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(100, 15) + Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(150, 22) Me.lblFirstGroupByFactor.TabIndex = 7 Me.lblFirstGroupByFactor.Tag = "" Me.lblFirstGroupByFactor.Text = "Factor (Optional) :" @@ -250,9 +267,10 @@ Partial Class dlgDescribeTwoVariable Me.rdoSkim.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoSkim.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoSkim.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSkim.Location = New System.Drawing.Point(95, 8) + Me.rdoSkim.Location = New System.Drawing.Point(142, 12) + Me.rdoSkim.Margin = New System.Windows.Forms.Padding(4) Me.rdoSkim.Name = "rdoSkim" - Me.rdoSkim.Size = New System.Drawing.Size(100, 28) + Me.rdoSkim.Size = New System.Drawing.Size(150, 42) Me.rdoSkim.TabIndex = 1 Me.rdoSkim.Text = "Skim" Me.rdoSkim.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -261,9 +279,10 @@ Partial Class dlgDescribeTwoVariable 'lblThirdVariable ' Me.lblThirdVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblThirdVariable.Location = New System.Drawing.Point(310, 191) + Me.lblThirdVariable.Location = New System.Drawing.Point(465, 286) + Me.lblThirdVariable.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblThirdVariable.Name = "lblThirdVariable" - Me.lblThirdVariable.Size = New System.Drawing.Size(154, 15) + Me.lblThirdVariable.Size = New System.Drawing.Size(231, 22) Me.lblThirdVariable.TabIndex = 13 Me.lblThirdVariable.Tag = "" Me.lblThirdVariable.Text = "Third Variable :" @@ -271,9 +290,10 @@ Partial Class dlgDescribeTwoVariable 'lblSecondGroupByFactor ' Me.lblSecondGroupByFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSecondGroupByFactor.Location = New System.Drawing.Point(315, 191) + Me.lblSecondGroupByFactor.Location = New System.Drawing.Point(472, 286) + Me.lblSecondGroupByFactor.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSecondGroupByFactor.Name = "lblSecondGroupByFactor" - Me.lblSecondGroupByFactor.Size = New System.Drawing.Size(137, 15) + Me.lblSecondGroupByFactor.Size = New System.Drawing.Size(206, 22) Me.lblSecondGroupByFactor.TabIndex = 33 Me.lblSecondGroupByFactor.Tag = "" Me.lblSecondGroupByFactor.Text = "Second Factor (Optional) :" @@ -286,9 +306,10 @@ Partial Class dlgDescribeTwoVariable Me.rdoTwoVariable.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoTwoVariable.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoTwoVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoTwoVariable.Location = New System.Drawing.Point(191, 8) + Me.rdoTwoVariable.Location = New System.Drawing.Point(286, 12) + Me.rdoTwoVariable.Margin = New System.Windows.Forms.Padding(4) Me.rdoTwoVariable.Name = "rdoTwoVariable" - Me.rdoTwoVariable.Size = New System.Drawing.Size(100, 28) + Me.rdoTwoVariable.Size = New System.Drawing.Size(150, 42) Me.rdoTwoVariable.TabIndex = 2 Me.rdoTwoVariable.Text = "Two Variables" Me.rdoTwoVariable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -297,9 +318,10 @@ Partial Class dlgDescribeTwoVariable 'cmdSummaries ' Me.cmdSummaries.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSummaries.Location = New System.Drawing.Point(310, 229) + Me.cmdSummaries.Location = New System.Drawing.Point(465, 344) + Me.cmdSummaries.Margin = New System.Windows.Forms.Padding(4) Me.cmdSummaries.Name = "cmdSummaries" - Me.cmdSummaries.Size = New System.Drawing.Size(120, 23) + Me.cmdSummaries.Size = New System.Drawing.Size(180, 34) Me.cmdSummaries.TabIndex = 1 Me.cmdSummaries.Tag = "Summaries" Me.cmdSummaries.Text = "Choose Summaries..." @@ -308,9 +330,10 @@ Partial Class dlgDescribeTwoVariable 'lblMarginName ' Me.lblMarginName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMarginName.Location = New System.Drawing.Point(15, 320) + Me.lblMarginName.Location = New System.Drawing.Point(22, 480) + Me.lblMarginName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblMarginName.Name = "lblMarginName" - Me.lblMarginName.Size = New System.Drawing.Size(93, 15) + Me.lblMarginName.Size = New System.Drawing.Size(140, 22) Me.lblMarginName.TabIndex = 19 Me.lblMarginName.Tag = "" Me.lblMarginName.Text = "Margin Name:" @@ -321,9 +344,11 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.Controls.Add(Me.lblFactorAsPercentage) Me.grpDisplay.Controls.Add(Me.ucrReceiverPercentages) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) - Me.grpDisplay.Location = New System.Drawing.Point(275, 205) + Me.grpDisplay.Location = New System.Drawing.Point(412, 308) + Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4) Me.grpDisplay.Name = "grpDisplay" - Me.grpDisplay.Size = New System.Drawing.Size(194, 115) + Me.grpDisplay.Padding = New System.Windows.Forms.Padding(4) + Me.grpDisplay.Size = New System.Drawing.Size(291, 172) Me.grpDisplay.TabIndex = 15 Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" @@ -332,18 +357,19 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkPercentageProportion.AutoSize = True Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(8, 56) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(95, 23) + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(142, 51) Me.ucrChkPercentageProportion.TabIndex = 57 ' 'lblFactorAsPercentage ' Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFactorAsPercentage.Location = New System.Drawing.Point(9, 42) + Me.lblFactorAsPercentage.Location = New System.Drawing.Point(14, 63) + Me.lblFactorAsPercentage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFactorAsPercentage.Name = "lblFactorAsPercentage" - Me.lblFactorAsPercentage.Size = New System.Drawing.Size(154, 15) + Me.lblFactorAsPercentage.Size = New System.Drawing.Size(231, 22) Me.lblFactorAsPercentage.TabIndex = 2 Me.lblFactorAsPercentage.Tag = "" Me.lblFactorAsPercentage.Text = "Factor as Percentage:" @@ -352,11 +378,11 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverPercentages.AutoSize = True Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(8, 38) + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(95, 13) + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(142, 20) Me.ucrReceiverPercentages.strNcFilePath = "" Me.ucrReceiverPercentages.TabIndex = 55 Me.ucrReceiverPercentages.ucrSelector = Nothing @@ -365,21 +391,70 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkDisplayAsPercentage.AutoSize = True Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(8, 11) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(95, 23) + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(142, 51) Me.ucrChkDisplayAsPercentage.TabIndex = 54 ' + 'ucrChkCorrelations + ' + Me.ucrChkCorrelations.AutoSize = True + Me.ucrChkCorrelations.Checked = False + Me.ucrChkCorrelations.Location = New System.Drawing.Point(462, 299) + Me.ucrChkCorrelations.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkCorrelations.Name = "ucrChkCorrelations" + Me.ucrChkCorrelations.Size = New System.Drawing.Size(223, 34) + Me.ucrChkCorrelations.TabIndex = 35 + ' + 'ucrReceiverThreeVariableSecondFactor + ' + Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True + Me.ucrReceiverThreeVariableSecondFactor.frmParent = Me + Me.ucrReceiverThreeVariableSecondFactor.Location = New System.Drawing.Point(465, 246) + Me.ucrReceiverThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverThreeVariableSecondFactor.Name = "ucrReceiverThreeVariableSecondFactor" + Me.ucrReceiverThreeVariableSecondFactor.Selector = Nothing + Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverThreeVariableSecondFactor.strNcFilePath = "" + Me.ucrReceiverThreeVariableSecondFactor.TabIndex = 12 + Me.ucrReceiverThreeVariableSecondFactor.ucrSelector = Nothing + ' + 'ucrReceiverSecondTwoVariableFactor + ' + Me.ucrReceiverSecondTwoVariableFactor.AutoSize = True + Me.ucrReceiverSecondTwoVariableFactor.frmParent = Me + Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(465, 246) + Me.ucrReceiverSecondTwoVariableFactor.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSecondTwoVariableFactor.Name = "ucrReceiverSecondTwoVariableFactor" + Me.ucrReceiverSecondTwoVariableFactor.Selector = Nothing + Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverSecondTwoVariableFactor.strNcFilePath = "" + Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 1 + Me.ucrReceiverSecondTwoVariableFactor.ucrSelector = Nothing + ' + 'ucrReceiverThreeVariableThirdVariable + ' + Me.ucrReceiverThreeVariableThirdVariable.AutoSize = True + Me.ucrReceiverThreeVariableThirdVariable.frmParent = Me + Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(465, 306) + Me.ucrReceiverThreeVariableThirdVariable.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverThreeVariableThirdVariable.Name = "ucrReceiverThreeVariableThirdVariable" + Me.ucrReceiverThreeVariableThirdVariable.Selector = Nothing + Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" + Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 14 + Me.ucrReceiverThreeVariableThirdVariable.ucrSelector = Nothing + ' 'ucrReceiverFirstVars ' Me.ucrReceiverFirstVars.AutoSize = True Me.ucrReceiverFirstVars.frmParent = Me - Me.ucrReceiverFirstVars.Location = New System.Drawing.Point(310, 64) + Me.ucrReceiverFirstVars.Location = New System.Drawing.Point(465, 96) Me.ucrReceiverFirstVars.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFirstVars.Name = "ucrReceiverFirstVars" Me.ucrReceiverFirstVars.Selector = Nothing - Me.ucrReceiverFirstVars.Size = New System.Drawing.Size(120, 79) + Me.ucrReceiverFirstVars.Size = New System.Drawing.Size(180, 118) Me.ucrReceiverFirstVars.strNcFilePath = "" Me.ucrReceiverFirstVars.TabIndex = 6 Me.ucrReceiverFirstVars.ucrSelector = Nothing @@ -387,10 +462,10 @@ Partial Class dlgDescribeTwoVariable 'ucrSaveTable ' Me.ucrSaveTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveTable.Location = New System.Drawing.Point(15, 451) - Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveTable.Location = New System.Drawing.Point(22, 676) + Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(399, 24) + Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) Me.ucrSaveTable.TabIndex = 24 ' 'ucrInputMarginName @@ -399,18 +474,18 @@ Partial Class dlgDescribeTwoVariable Me.ucrInputMarginName.AutoSize = True Me.ucrInputMarginName.IsMultiline = False Me.ucrInputMarginName.IsReadOnly = False - Me.ucrInputMarginName.Location = New System.Drawing.Point(114, 318) - Me.ucrInputMarginName.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputMarginName.Location = New System.Drawing.Point(171, 477) + Me.ucrInputMarginName.Margin = New System.Windows.Forms.Padding(14) Me.ucrInputMarginName.Name = "ucrInputMarginName" - Me.ucrInputMarginName.Size = New System.Drawing.Size(137, 21) + Me.ucrInputMarginName.Size = New System.Drawing.Size(206, 32) Me.ucrInputMarginName.TabIndex = 22 ' 'ucrReorderSummary ' - Me.ucrReorderSummary.Location = New System.Drawing.Point(275, 258) - Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrReorderSummary.Location = New System.Drawing.Point(412, 387) + Me.ucrReorderSummary.Margin = New System.Windows.Forms.Padding(9) Me.ucrReorderSummary.Name = "ucrReorderSummary" - Me.ucrReorderSummary.Size = New System.Drawing.Size(194, 156) + Me.ucrReorderSummary.Size = New System.Drawing.Size(291, 234) Me.ucrReorderSummary.TabIndex = 16 Me.ucrReorderSummary.ucrDataFrameList = Nothing Me.ucrReorderSummary.ucrReceiver = Nothing @@ -419,104 +494,65 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkDisplayMargins.AutoSize = True Me.ucrChkDisplayMargins.Checked = False - Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(17, 296) - Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) + Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" - Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(143, 23) + Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) Me.ucrChkDisplayMargins.TabIndex = 18 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(15, 489) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.ucrBase.Location = New System.Drawing.Point(22, 734) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 25 ' - 'ucrReceiverThreeVariableThirdVariable - ' - Me.ucrReceiverThreeVariableThirdVariable.AutoSize = True - Me.ucrReceiverThreeVariableThirdVariable.frmParent = Me - Me.ucrReceiverThreeVariableThirdVariable.Location = New System.Drawing.Point(310, 204) - Me.ucrReceiverThreeVariableThirdVariable.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverThreeVariableThirdVariable.Name = "ucrReceiverThreeVariableThirdVariable" - Me.ucrReceiverThreeVariableThirdVariable.Selector = Nothing - Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" - Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 14 - Me.ucrReceiverThreeVariableThirdVariable.ucrSelector = Nothing - ' 'ucrReceiverSecondSkimrGroupByFactor ' Me.ucrReceiverSecondSkimrGroupByFactor.AutoSize = True Me.ucrReceiverSecondSkimrGroupByFactor.frmParent = Me - Me.ucrReceiverSecondSkimrGroupByFactor.Location = New System.Drawing.Point(310, 204) + Me.ucrReceiverSecondSkimrGroupByFactor.Location = New System.Drawing.Point(465, 306) Me.ucrReceiverSecondSkimrGroupByFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSecondSkimrGroupByFactor.Name = "ucrReceiverSecondSkimrGroupByFactor" Me.ucrReceiverSecondSkimrGroupByFactor.Selector = Nothing - Me.ucrReceiverSecondSkimrGroupByFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSecondSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSecondSkimrGroupByFactor.strNcFilePath = "" Me.ucrReceiverSecondSkimrGroupByFactor.TabIndex = 34 Me.ucrReceiverSecondSkimrGroupByFactor.ucrSelector = Nothing ' - 'ucrReceiverSecondTwoVariableFactor - ' - Me.ucrReceiverSecondTwoVariableFactor.AutoSize = True - Me.ucrReceiverSecondTwoVariableFactor.frmParent = Me - Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(310, 164) - Me.ucrReceiverSecondTwoVariableFactor.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverSecondTwoVariableFactor.Name = "ucrReceiverSecondTwoVariableFactor" - Me.ucrReceiverSecondTwoVariableFactor.Selector = Nothing - Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverSecondTwoVariableFactor.strNcFilePath = "" - Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 1 - Me.ucrReceiverSecondTwoVariableFactor.ucrSelector = Nothing - ' 'ucrSelectorDescribeTwoVar ' Me.ucrSelectorDescribeTwoVar.AutoSize = True Me.ucrSelectorDescribeTwoVar.bDropUnusedFilterLevels = False Me.ucrSelectorDescribeTwoVar.bShowHiddenColumns = False Me.ucrSelectorDescribeTwoVar.bUseCurrentFilter = True - Me.ucrSelectorDescribeTwoVar.Location = New System.Drawing.Point(11, 36) + Me.ucrSelectorDescribeTwoVar.Location = New System.Drawing.Point(16, 54) Me.ucrSelectorDescribeTwoVar.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorDescribeTwoVar.Name = "ucrSelectorDescribeTwoVar" - Me.ucrSelectorDescribeTwoVar.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorDescribeTwoVar.Size = New System.Drawing.Size(320, 274) Me.ucrSelectorDescribeTwoVar.TabIndex = 4 ' 'ucrPnlDescribe ' Me.ucrPnlDescribe.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDescribe.Location = New System.Drawing.Point(92, 3) - Me.ucrPnlDescribe.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrPnlDescribe.Location = New System.Drawing.Point(138, 4) + Me.ucrPnlDescribe.Margin = New System.Windows.Forms.Padding(9) Me.ucrPnlDescribe.Name = "ucrPnlDescribe" - Me.ucrPnlDescribe.Size = New System.Drawing.Size(317, 34) + Me.ucrPnlDescribe.Size = New System.Drawing.Size(476, 51) Me.ucrPnlDescribe.TabIndex = 0 ' - 'ucrReceiverThreeVariableSecondFactor - ' - Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True - Me.ucrReceiverThreeVariableSecondFactor.frmParent = Me - Me.ucrReceiverThreeVariableSecondFactor.Location = New System.Drawing.Point(310, 164) - Me.ucrReceiverThreeVariableSecondFactor.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverThreeVariableSecondFactor.Name = "ucrReceiverThreeVariableSecondFactor" - Me.ucrReceiverThreeVariableSecondFactor.Selector = Nothing - Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverThreeVariableSecondFactor.strNcFilePath = "" - Me.ucrReceiverThreeVariableSecondFactor.TabIndex = 12 - Me.ucrReceiverThreeVariableSecondFactor.ucrSelector = Nothing - ' 'ucrReceiverSkimrGroupByFactor ' Me.ucrReceiverSkimrGroupByFactor.AutoSize = True Me.ucrReceiverSkimrGroupByFactor.frmParent = Me - Me.ucrReceiverSkimrGroupByFactor.Location = New System.Drawing.Point(310, 164) + Me.ucrReceiverSkimrGroupByFactor.Location = New System.Drawing.Point(465, 246) Me.ucrReceiverSkimrGroupByFactor.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverSkimrGroupByFactor.Name = "ucrReceiverSkimrGroupByFactor" Me.ucrReceiverSkimrGroupByFactor.Selector = Nothing - Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSkimrGroupByFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSkimrGroupByFactor.strNcFilePath = "" Me.ucrReceiverSkimrGroupByFactor.TabIndex = 2 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing @@ -525,28 +561,28 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkOmitMissing.AutoSize = True Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(17, 296) - Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(26, 444) + Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" - Me.ucrChkOmitMissing.Size = New System.Drawing.Size(143, 23) + Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) Me.ucrChkOmitMissing.TabIndex = 0 ' 'ucrChkSummariesRowCol ' Me.ucrChkSummariesRowCol.AutoSize = True Me.ucrChkSummariesRowCol.Checked = False - Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(15, 337) - Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 506) + Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkSummariesRowCol.Name = "ucrChkSummariesRowCol" - Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(180, 23) + Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) Me.ucrChkSummariesRowCol.TabIndex = 20 ' 'dlgDescribeTwoVariable ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ClientSize = New System.Drawing.Size(482, 499) + Me.ClientSize = New System.Drawing.Size(723, 748) Me.Controls.Add(Me.ucrReceiverThreeVariableSecondFactor) Me.Controls.Add(Me.ucrReceiverSecondTwoVariableFactor) Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) @@ -558,7 +594,6 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrReorderSummary) Me.Controls.Add(Me.lblMarginName) Me.Controls.Add(Me.cmdMissingOptions) - Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.cmdFormatTable) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.ucrReceiverSecondSkimrGroupByFactor) @@ -575,9 +610,12 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.lbSecondVariable) Me.Controls.Add(Me.lblFirstGroupByFactor) Me.Controls.Add(Me.lblThreeVariableSecondFactor) - Me.Controls.Add(Me.ucrChkOmitMissing) Me.Controls.Add(Me.ucrChkSummariesRowCol) + Me.Controls.Add(Me.ucrChkDisplayMargins) + Me.Controls.Add(Me.ucrChkOmitMissing) + Me.Controls.Add(Me.ucrChkCorrelations) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgDescribeTwoVariable" @@ -633,4 +671,5 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents ucrSaveTable As ucrSave Friend WithEvents ucrReceiverFirstVars As ucrReceiverMultiple Friend WithEvents ucrChkSummariesRowCol As ucrCheck + Friend WithEvents ucrChkCorrelations As ucrCheck End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index e56056791f3..3031e9b2ce7 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -149,6 +149,10 @@ Public Class dlgDescribeTwoVariable ucrChkSummariesRowCol.AddParameterValuesCondition(True, "row_sum", "True") ucrChkSummariesRowCol.AddParameterValuesCondition(False, "row_sum", "False") + ucrChkCorrelations.SetText("Correlations") + ucrChkCorrelations.AddParameterValuesCondition(True, "corr", "True") + ucrChkCorrelations.AddParameterValuesCondition(False, "corr", "False") + ucrPnlDescribe.AddRadioButton(rdoTwoVariable) ucrPnlDescribe.AddRadioButton(rdoSkim) ucrPnlDescribe.AddRadioButton(rdoThreeVariable) @@ -247,6 +251,7 @@ Public Class dlgDescribeTwoVariable clsDummyFunction.AddParameter("factor_cols", "Sum", iPosition:=1) clsDummyFunction.AddParameter("theme", "select", iPosition:=2) clsDummyFunction.AddParameter("row_sum", "False", iPosition:=3) + clsDummyFunction.AddParameter("corr", "False", iPosition:=4) clsPivotWiderFunction.SetRCommand("pivot_wider") clsPivotWiderFunction.AddParameter("values_from", "value", iPosition:=2) @@ -463,6 +468,7 @@ Public Class dlgDescribeTwoVariable ucrChkPercentageProportion.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrPnlDescribe.SetRCode(clsDummyFunction, bReset) ucrChkSummariesRowCol.SetRCode(clsDummyFunction, bReset) + ucrChkCorrelations.SetRCode(clsDummyFunction, bReset) ucrReceiverThreeVariableSecondFactor.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrReceiverThreeVariableThirdVariable.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrChkDisplayMargins.SetRCode(clsCombineFrequencyParametersFunction, bReset) @@ -561,9 +567,11 @@ Public Class dlgDescribeTwoVariable ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactor() grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrChkSummariesRowCol.Visible = False + ucrChkCorrelations.Visible = False If rdoTwoVariable.Checked Then ucrChkOmitMissing.Visible = strFirstVariablesType = "numeric" ucrChkSummariesRowCol.Visible = IsNumericByFactor() + ucrChkCorrelations.Visible = IsNumericByNumeric() ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else @@ -601,7 +609,15 @@ Public Class dlgDescribeTwoVariable ElseIf rdoTwoVariable.Checked Then clsDummyFunction.AddParameter("checked", "customize", iPosition:=0) If IsNumericByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRCorrelationFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaFunction) + If ucrChkCorrelations.Checked Then + ucrBase.clsRsyntax.AddToAfterCodes(clsRCorrelationFunction, iPosition:=0) + clsDummyFunction.AddParameter("corr", "True", iPosition:=4) + clsRCorrelationFunction.iCallType = 2 + Else + clsDummyFunction.AddParameter("corr", "False", iPosition:=4) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsRCorrelationFunction) + End If ucrSaveTable.Visible = False ElseIf IsFactorByNumeric() Then ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaFunction) @@ -1008,7 +1024,7 @@ Public Class dlgDescribeTwoVariable Else If rdoTwoVariable.Checked Then If IsNumericByNumeric() Then - strSummaryName = "Correlations" + strSummaryName = "ANOVA tables" ElseIf IsFactorByNumeric() Then strSummaryName = "ANOVA tables" ElseIf IsNumericByFactor() Then @@ -1294,4 +1310,7 @@ Public Class dlgDescribeTwoVariable SummariesInRowsOrCols() End Sub + Private Sub ucrChkCorrelations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkCorrelations.ControlValueChanged + ChangeBaseRCode() + End Sub End Class From 72959c7949522695dbdfe8748d8a436144417f64 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Wed, 24 Apr 2024 11:40:01 +0300 Subject: [PATCH 25/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 13 +++++++++++++ instat/dlgDescribeTwoVariable.vb | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index c0340073fa3..d07a0583e7e 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -80,6 +80,7 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverSkimrGroupByFactor = New instat.ucrReceiverSingle() Me.ucrChkOmitMissing = New instat.ucrCheck() Me.ucrChkSummariesRowCol = New instat.ucrCheck() + Me.ucrChkSwapXYVar = New instat.ucrCheck() Me.grpSummaries.SuspendLayout() Me.grpDisplay.SuspendLayout() Me.SuspendLayout() @@ -577,6 +578,16 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) Me.ucrChkSummariesRowCol.TabIndex = 20 ' + 'ucrChkSwapXYVar + ' + Me.ucrChkSwapXYVar.AutoSize = True + Me.ucrChkSwapXYVar.Checked = False + Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(443, 340) + Me.ucrChkSwapXYVar.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkSwapXYVar.Name = "ucrChkSwapXYVar" + Me.ucrChkSwapXYVar.Size = New System.Drawing.Size(239, 34) + Me.ucrChkSwapXYVar.TabIndex = 36 + ' 'dlgDescribeTwoVariable ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) @@ -614,6 +625,7 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.ucrChkOmitMissing) Me.Controls.Add(Me.ucrChkCorrelations) + Me.Controls.Add(Me.ucrChkSwapXYVar) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False @@ -672,4 +684,5 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents ucrReceiverFirstVars As ucrReceiverMultiple Friend WithEvents ucrChkSummariesRowCol As ucrCheck Friend WithEvents ucrChkCorrelations As ucrCheck + Friend WithEvents ucrChkSwapXYVar As ucrCheck End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 3031e9b2ce7..84f520e65dd 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -153,6 +153,10 @@ Public Class dlgDescribeTwoVariable ucrChkCorrelations.AddParameterValuesCondition(True, "corr", "True") ucrChkCorrelations.AddParameterValuesCondition(False, "corr", "False") + ucrChkSwapXYVar.SetText("Swap First and Second Variables") + ucrChkSwapXYVar.AddParameterValuesCondition(True, "var", "True") + ucrChkSwapXYVar.AddParameterValuesCondition(False, "var", "False") + ucrPnlDescribe.AddRadioButton(rdoTwoVariable) ucrPnlDescribe.AddRadioButton(rdoSkim) ucrPnlDescribe.AddRadioButton(rdoThreeVariable) @@ -252,6 +256,7 @@ Public Class dlgDescribeTwoVariable clsDummyFunction.AddParameter("theme", "select", iPosition:=2) clsDummyFunction.AddParameter("row_sum", "False", iPosition:=3) clsDummyFunction.AddParameter("corr", "False", iPosition:=4) + clsDummyFunction.AddParameter("var", "False", iPosition:=5) clsPivotWiderFunction.SetRCommand("pivot_wider") clsPivotWiderFunction.AddParameter("values_from", "value", iPosition:=2) @@ -469,6 +474,7 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.SetRCode(clsDummyFunction, bReset) ucrChkSummariesRowCol.SetRCode(clsDummyFunction, bReset) ucrChkCorrelations.SetRCode(clsDummyFunction, bReset) + ucrChkSwapXYVar.SetRCode(clsDummyFunction, bReset) ucrReceiverThreeVariableSecondFactor.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrReceiverThreeVariableThirdVariable.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrChkDisplayMargins.SetRCode(clsCombineFrequencyParametersFunction, bReset) @@ -568,10 +574,12 @@ Public Class dlgDescribeTwoVariable grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrChkSummariesRowCol.Visible = False ucrChkCorrelations.Visible = False + ucrChkSwapXYVar.Visible = False If rdoTwoVariable.Checked Then ucrChkOmitMissing.Visible = strFirstVariablesType = "numeric" ucrChkSummariesRowCol.Visible = IsNumericByFactor() ucrChkCorrelations.Visible = IsNumericByNumeric() + ucrChkSwapXYVar.Visible = IsNumericByNumeric() ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else @@ -1313,4 +1321,16 @@ Public Class dlgDescribeTwoVariable Private Sub ucrChkCorrelations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkCorrelations.ControlValueChanged ChangeBaseRCode() End Sub + + Private Sub ucrChkSwapXYVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSwapXYVar.ControlValueChanged + If ucrChkSwapXYVar.Checked Then + clsRAnovaFunction.AddParameter("y_col_name", ucrReceiverFirstVars.GetVariableNames, iPosition:=1) + clsRAnovaFunction.AddParameter("x_col_names", ucrReceiverSecondTwoVariableFactor.GetVariableNames, iPosition:=2) + + Else + clsRAnovaFunction.AddParameter("x_col_names", ucrReceiverFirstVars.GetVariableNames, iPosition:=1) + clsRAnovaFunction.AddParameter("y_col_name", ucrReceiverSecondTwoVariableFactor.GetVariableNames, iPosition:=2) + + End If + End Sub End Class From 3b6d58ddd9afc8dfb92eaddccf70f148ed62c904 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Thu, 25 Apr 2024 18:07:34 +0300 Subject: [PATCH 26/83] changes --- instat/dlgDescribeTwoVariable.vb | 77 ++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 84f520e65dd..96139a733a7 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -291,8 +291,8 @@ Public Class dlgDescribeTwoVariable clsRAnovaTable2Function.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables2") clsRAnovaTable2Function.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) + 'clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + 'clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) clsRAnovaTable2Function.AddParameter("signif.stars", "FALSE", iPosition:=3) clsRAnovaTable2Function.AddParameter("sign_level", "FALSE", iPosition:=4) clsRAnovaTable2Function.AddParameter("means", "FALSE", iPosition:=5) @@ -450,16 +450,16 @@ Public Class dlgDescribeTwoVariable Private Sub SetRCodeForControls(bReset As Boolean) bRcodeSet = False - ucrReceiverSecondTwoVariableFactor.AddAdditionalCodeParameterPair(clsRAnovaFunction, New RParameter("y_col_name", 2), iAdditionalPairNo:=1) - ucrReceiverSecondTwoVariableFactor.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("y_col_name", 2), iAdditionalPairNo:=2) + 'ucrReceiverSecondTwoVariableFactor.AddAdditionalCodeParameterPair(clsRAnovaFunction, New RParameter("y_col_name", 2), iAdditionalPairNo:=1) + ucrReceiverSecondTwoVariableFactor.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("y_col_name", 2), iAdditionalPairNo:=1) - ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRAnovaFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) - ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=2) - ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsSkimrFunction, New RParameter("col_names", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=3) - ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsMapSummaryFunction, New RParameter(".x", 1), iAdditionalPairNo:=4) + 'ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRAnovaFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) + ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) + ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsSkimrFunction, New RParameter("col_names", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) + ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsMapSummaryFunction, New RParameter(".x", 1), iAdditionalPairNo:=3) - ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsRAnovaFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) - ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=2) + 'ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsRAnovaFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) + ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSaveTable.AddAdditionalRCode(clsJoiningPipeOperator, iAdditionalPairNo:=1) ucrChkOmitMissing.SetRCode(clsSummaryTableFunction, bReset) @@ -617,7 +617,7 @@ Public Class dlgDescribeTwoVariable ElseIf rdoTwoVariable.Checked Then clsDummyFunction.AddParameter("checked", "customize", iPosition:=0) If IsNumericByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) If ucrChkCorrelations.Checked Then ucrBase.clsRsyntax.AddToAfterCodes(clsRCorrelationFunction, iPosition:=0) clsDummyFunction.AddParameter("corr", "True", iPosition:=4) @@ -628,7 +628,7 @@ Public Class dlgDescribeTwoVariable End If ucrSaveTable.Visible = False ElseIf IsFactorByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsRAnovaFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) ucrSaveTable.Visible = False ElseIf IsNumericByFactor() Then ucrSaveTable.Visible = True @@ -774,6 +774,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() + SwappingXYVar() End Sub Private Sub ShowFormatTableButton() @@ -903,6 +904,14 @@ Public Class dlgDescribeTwoVariable clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) End If End If + ElseIf rdoTwoVariable.Checked Then + If IsNumericByNumeric() OrElse IsNumericByFactor() Then + If ucrReceiverFirstVars.IsEmpty Then + clsYlistOperator.RemoveParameterByName("cols") + Else + clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + End If + End If End If End Sub @@ -915,6 +924,14 @@ Public Class dlgDescribeTwoVariable clsCombineAnova2Function.AddParameter("x", ucrReceiverThreeVariableSecondFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) End If End If + ElseIf rdoTwoVariable.Checked Then + If IsNumericByNumeric() OrElse IsNumericByNumeric() Then + If ucrReceiverSecondTwoVariableFactor.IsEmpty Then + clsCombineAnova2Function.RemoveParameterByName("x") + Else + clsCombineAnova2Function.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + End If + End If End If End Sub @@ -1019,6 +1036,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() + SwappingXYVar() End Sub Private Sub ChangeSumaryLabelText() @@ -1108,6 +1126,9 @@ Public Class dlgDescribeTwoVariable ShowFormatTableButton() ManageControlsVisibility() FactorColumns() + 'SwappingXYVar() + AddRemoveFirstAnova2Param() + AddRemoveSecondAnovaParam() End Sub Private Sub ChangeFirstTypeLabel() @@ -1184,6 +1205,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() + 'SwappingXYVar() End Sub Private Sub ucrReceiverThreeVariableSecondFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableSecondFactor.ControlValueChanged @@ -1193,6 +1215,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondCorrParam() AddRemoveSecondAnovaParam() AddRemoveFirstAnova2Param() + 'SwappingXYVar() End Sub Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirstVars.ControlContentsChanged, @@ -1321,16 +1344,32 @@ Public Class dlgDescribeTwoVariable Private Sub ucrChkCorrelations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkCorrelations.ControlValueChanged ChangeBaseRCode() End Sub + Private Sub SwappingXYVar() + If rdoTwoVariable.Checked Then + clsRAnovaTable2Function.RemoveParameterByName("y_col_name") + clsRAnovaTable2Function.RemoveParameterByName("x_col_names") + If ucrChkSwapXYVar.Checked Then + clsRAnovaTable2Function.AddParameter(" y_col_name", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + clsRAnovaTable2Function.AddParameter("x_col_names", ".x", iPosition:=2) + clsDummyFunction.AddParameter("var", "True", iPosition:=5) + Else + clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) + clsDummyFunction.AddParameter("var", "False", iPosition:=5) + End If - Private Sub ucrChkSwapXYVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSwapXYVar.ControlValueChanged - If ucrChkSwapXYVar.Checked Then - clsRAnovaFunction.AddParameter("y_col_name", ucrReceiverFirstVars.GetVariableNames, iPosition:=1) - clsRAnovaFunction.AddParameter("x_col_names", ucrReceiverSecondTwoVariableFactor.GetVariableNames, iPosition:=2) - + ElseIf rdoThreeVariable.Checked Then + clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) Else - clsRAnovaFunction.AddParameter("x_col_names", ucrReceiverFirstVars.GetVariableNames, iPosition:=1) - clsRAnovaFunction.AddParameter("y_col_name", ucrReceiverSecondTwoVariableFactor.GetVariableNames, iPosition:=2) + clsRAnovaTable2Function.RemoveParameterByName("y_col_name") + clsRAnovaTable2Function.RemoveParameterByName("x_col_names") End If End Sub + Private Sub ucrChkSwapXYVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSwapXYVar.ControlValueChanged + SwappingXYVar() + 'AddRemoveFirstAnova2Param() + 'AddRemoveSecondAnovaParam() + End Sub End Class From 8431347a7b324dc519dbd0716d023c7ad6c93d13 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Fri, 26 Apr 2024 14:44:06 +0300 Subject: [PATCH 27/83] changes --- instat/dlgDescribeTwoVariable.vb | 151 ++++++++++++++++++++++--------- 1 file changed, 110 insertions(+), 41 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 96139a733a7..8cc2cff9d2a 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -29,11 +29,11 @@ Public Class dlgDescribeTwoVariable Public strFirstVariablesType, strSecondVariableType, strThirdVariableType As String 'SUMMARY FUNCTIoNS - Private clsCombineFrequencyParametersFunction, clsCombineFunction, clsCombineAnova2Function, clsSummariseFunction, + Private clsCombineFrequencyParametersFunction, clsCombineFunction, clsCombineSwapAnova2Table, clsCombineAnova2Function, clsSummariseFunction, clsDummyFunction, clsGroupByFunction, clsRAnovaFunction, clsCorrFunction, clsRAnovaTableFunction, clsRCorrelationFunction, clsSkimrFunction, clsSummariesListFunction, clsCombineAnovaFunction, - clsSummaryTableCombineFactorsFunction, clsSummaryTableFunction, - clsThreeVariableCombineFrequencyParametersFunction, clsPivotWiderFunction, clsMappingFunction, clsRAnovaTable2Function As New RFunction + clsSummaryTableCombineFactorsFunction, clsSummaryTableFunction, clsRAnovaSwapTable2Funtion, + clsThreeVariableCombineFrequencyParametersFunction, clsPivotWiderFunction, clsMappingFunction, clsMapping2Function, clsRAnovaTable2Function As New RFunction 'FORMAT TABLE FUNCTIONS Private clsFootnoteCellBodyFunction, clsFootnoteCellFunction, @@ -58,7 +58,7 @@ Public Class dlgDescribeTwoVariable 'Format Operators Private clsPipeOperator, clsTabFootnoteOperator, - clsJoiningPipeOperator, clsMutableOperator, clsAnovaTable2Operator, clsYlistOperator As New ROperator + clsJoiningPipeOperator, clsMutableOperator, clsAnovaSwapTable2Opeator, clsAnovaTable2Operator, clsYlist2Operator, clsYlistOperator As New ROperator Private iUcrBaseXLocation, iDialogueXsize As Integer Private Sub dlgDescribeTwoVariable_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -220,6 +220,7 @@ Public Class dlgDescribeTwoVariable clsPivotWiderFunction = New RFunction clsCombineAnovaFunction = New RFunction clsCombineAnova2Function = New RFunction + clsCombineSwapAnova2Table = New RFunction clsSummariseFunction = New RFunction clsCorrFunction = New RFunction clsRAnovaTableFunction = New RFunction @@ -231,9 +232,13 @@ Public Class dlgDescribeTwoVariable clsGroupByPipeOperator4 = New ROperator clsGroupByPipeOperatorData = New ROperator clsMappingFunction = New RFunction + clsMapping2Function = New RFunction clsAnovaTable2Operator = New ROperator + clsAnovaSwapTable2Opeator = New ROperator clsYlistOperator = New ROperator + clsYlist2Operator = New ROperator clsRAnovaTable2Function = New RFunction + clsRAnovaSwapTable2Funtion = New RFunction clsTildOperator = New ROperator clsMapSummaryFunction = New RFunction @@ -277,26 +282,52 @@ Public Class dlgDescribeTwoVariable clsCombineAnova2Function.SetRCommand("c") + clsCombineSwapAnova2Table.SetRCommand("c") + + clsMappingFunction.SetPackageName("purrr") clsMappingFunction.SetRCommand("map") clsMappingFunction.AddParameter(".x", clsROperatorParameter:=clsYlistOperator, iPosition:=0) clsMappingFunction.AddParameter(".f", clsROperatorParameter:=clsAnovaTable2Operator, iPosition:=1) + clsMapping2Function.SetPackageName("purrr") + clsMapping2Function.SetRCommand("map") + clsMapping2Function.AddParameter(".x", clsROperatorParameter:=clsYlist2Operator, iPosition:=0) + clsMapping2Function.AddParameter(".f", clsROperatorParameter:=clsAnovaSwapTable2Opeator, iPosition:=1) + + clsAnovaTable2Operator.SetOperation("~") clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) clsAnovaTable2Operator.bForceIncludeOperation = True + clsAnovaSwapTable2Opeator.SetOperation("~") + clsAnovaSwapTable2Opeator.AddParameter("right", clsRFunctionParameter:=clsRAnovaSwapTable2Funtion, iPosition:=1) + clsAnovaSwapTable2Opeator.bForceIncludeOperation = True + + clsYlistOperator.SetOperation("", bBracketsTemp:=False) clsYlistOperator.SetAssignTo("y_col_names_list") + clsYlist2Operator.SetOperation("", bBracketsTemp:=False) + clsYlist2Operator.SetAssignTo("y_col_names_list") + clsRAnovaTable2Function.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables2") clsRAnovaTable2Function.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) - 'clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - 'clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) + clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) clsRAnovaTable2Function.AddParameter("signif.stars", "FALSE", iPosition:=3) clsRAnovaTable2Function.AddParameter("sign_level", "FALSE", iPosition:=4) clsRAnovaTable2Function.AddParameter("means", "FALSE", iPosition:=5) + clsRAnovaSwapTable2Funtion.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables2") + clsRAnovaSwapTable2Funtion.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsRAnovaSwapTable2Funtion.AddParameter(" y_col_name", clsRFunctionParameter:=clsCombineSwapAnova2Table, iPosition:=1) + clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", ".x", iPosition:=2) + clsRAnovaSwapTable2Funtion.AddParameter("signif.stars", "FALSE", iPosition:=3) + clsRAnovaSwapTable2Funtion.AddParameter("sign_level", "FALSE", iPosition:=4) + clsRAnovaSwapTable2Funtion.AddParameter("means", "FALSE", iPosition:=5) + + clsGroupByPipeOperator.SetOperation("%>%") clsGroupByPipeOperator.AddParameter("skim", clsRFunctionParameter:=clsSkimrFunction, iPosition:=2, bIncludeArgumentName:=False) @@ -340,6 +371,7 @@ Public Class dlgDescribeTwoVariable clsCombineFunction.SetRCommand("c") clsCombineAnovaFunction.SetRCommand("c") + clsPipeOperator.SetOperation("%>%") clsPipeOperator.bBrackets = False @@ -617,7 +649,14 @@ Public Class dlgDescribeTwoVariable ElseIf rdoTwoVariable.Checked Then clsDummyFunction.AddParameter("checked", "customize", iPosition:=0) If IsNumericByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + If ucrChkSwapXYVar.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsMapping2Function) + clsDummyFunction.AddParameter("var", "True", iPosition:=5) + + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + clsDummyFunction.AddParameter("var", "False", iPosition:=5) + End If If ucrChkCorrelations.Checked Then ucrBase.clsRsyntax.AddToAfterCodes(clsRCorrelationFunction, iPosition:=0) clsDummyFunction.AddParameter("corr", "True", iPosition:=4) @@ -774,7 +813,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() - SwappingXYVar() + 'SwappingXYVar() End Sub Private Sub ShowFormatTableButton() @@ -906,12 +945,24 @@ Public Class dlgDescribeTwoVariable End If ElseIf rdoTwoVariable.Checked Then If IsNumericByNumeric() OrElse IsNumericByFactor() Then - If ucrReceiverFirstVars.IsEmpty Then - clsYlistOperator.RemoveParameterByName("cols") + If Not ucrReceiverFirstVars.IsEmpty Then + If ucrChkSwapXYVar.Checked Then + clsYlist2Operator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + clsYlistOperator.RemoveParameterByName("cols") + + Else + clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + clsYlist2Operator.RemoveParameterByName("cols") + + End If Else - clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + clsYlist2Operator.RemoveParameterByName("cols") + clsYlistOperator.RemoveParameterByName("cols") + End If + End If + End If End Sub @@ -926,12 +977,22 @@ Public Class dlgDescribeTwoVariable End If ElseIf rdoTwoVariable.Checked Then If IsNumericByNumeric() OrElse IsNumericByNumeric() Then - If ucrReceiverSecondTwoVariableFactor.IsEmpty Then - clsCombineAnova2Function.RemoveParameterByName("x") + If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then + If ucrChkSwapXYVar.Checked Then + clsCombineSwapAnova2Table.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + clsCombineAnova2Function.RemoveParameterByName("x") + Else + clsCombineAnova2Function.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + clsCombineSwapAnova2Table.RemoveParameterByName("x") + + End If Else - clsCombineAnova2Function.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + clsCombineSwapAnova2Table.RemoveParameterByName("x") + clsCombineAnova2Function.RemoveParameterByName("x") + End If End If + End If End Sub @@ -1036,7 +1097,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() - SwappingXYVar() + 'SwappingXYVar() End Sub Private Sub ChangeSumaryLabelText() @@ -1344,32 +1405,40 @@ Public Class dlgDescribeTwoVariable Private Sub ucrChkCorrelations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkCorrelations.ControlValueChanged ChangeBaseRCode() End Sub - Private Sub SwappingXYVar() - If rdoTwoVariable.Checked Then - clsRAnovaTable2Function.RemoveParameterByName("y_col_name") - clsRAnovaTable2Function.RemoveParameterByName("x_col_names") - If ucrChkSwapXYVar.Checked Then - clsRAnovaTable2Function.AddParameter(" y_col_name", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - clsRAnovaTable2Function.AddParameter("x_col_names", ".x", iPosition:=2) - clsDummyFunction.AddParameter("var", "True", iPosition:=5) - Else - clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) - clsDummyFunction.AddParameter("var", "False", iPosition:=5) - End If - - ElseIf rdoThreeVariable.Checked Then - clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) - Else - clsRAnovaTable2Function.RemoveParameterByName("y_col_name") - clsRAnovaTable2Function.RemoveParameterByName("x_col_names") - - End If - End Sub + 'Private Sub SwappingXYVar() + ' If rdoTwoVariable.Checked Then + + ' If ucrChkSwapXYVar.Checked Then + ' clsRAnovaSwapTable2Funtion.AddParameter(" y_col_name", clsRFunctionParameter:=clsCombineSwapAnova2Table, iPosition:=1) + ' clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", ".x", iPosition:=2) + ' clsAnovaSwapTable2Opeator.AddParameter("right", clsRFunctionParameter:=clsRAnovaSwapTable2Funtion, iPosition:=1) + + ' clsDummyFunction.AddParameter("var", "True", iPosition:=5) + ' 'clsRAnovaTable2Function.RemoveParameterByName("y_col_name") + ' 'clsRAnovaTable2Function.RemoveParameterByName("x_col_names") + ' Else + ' clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + ' clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) + ' clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) + + ' clsDummyFunction.AddParameter("var", "False", iPosition:=5) + ' 'clsRAnovaSwapTable2Funtion.RemoveParameterByName("y_col_name") + ' 'clsRAnovaSwapTable2Funtion.RemoveParameterByName("x_col_names") + ' End If + + ' ElseIf rdoThreeVariable.Checked Then + ' clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) + ' clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) + ' 'Else + ' ' clsRAnovaTable2Function.RemoveParameterByName("y_col_name") + ' ' clsRAnovaTable2Function.RemoveParameterByName("x_col_names") + ' clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) + + ' End If + 'End Sub Private Sub ucrChkSwapXYVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSwapXYVar.ControlValueChanged - SwappingXYVar() - 'AddRemoveFirstAnova2Param() - 'AddRemoveSecondAnovaParam() + AddRemoveFirstAnova2Param() + AddRemoveSecondAnovaParam() + ChangeBaseRCode() End Sub End Class From 8c6d5b0d7c3b317d87b9a104c6a3673fdb246178 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 29 Apr 2024 11:01:15 +0300 Subject: [PATCH 28/83] changes --- instat/dlgDescribeTwoVariable.vb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 8cc2cff9d2a..77164928a89 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -648,7 +648,7 @@ Public Class dlgDescribeTwoVariable ElseIf rdoTwoVariable.Checked Then clsDummyFunction.AddParameter("checked", "customize", iPosition:=0) - If IsNumericByNumeric() Then + If IsNumericByNumeric() OrElse IsFactorByNumeric() Then If ucrChkSwapXYVar.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsMapping2Function) clsDummyFunction.AddParameter("var", "True", iPosition:=5) @@ -666,9 +666,6 @@ Public Class dlgDescribeTwoVariable ucrBase.clsRsyntax.RemoveFromAfterCodes(clsRCorrelationFunction) End If ucrSaveTable.Visible = False - ElseIf IsFactorByNumeric() Then - ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) - ucrSaveTable.Visible = False ElseIf IsNumericByFactor() Then ucrSaveTable.Visible = True ucrSaveTable.Location = New Point(23, 450) @@ -944,7 +941,7 @@ Public Class dlgDescribeTwoVariable End If End If ElseIf rdoTwoVariable.Checked Then - If IsNumericByNumeric() OrElse IsNumericByFactor() Then + If IsNumericByNumeric() OrElse IsFactorByNumeric() Then If Not ucrReceiverFirstVars.IsEmpty Then If ucrChkSwapXYVar.Checked Then clsYlist2Operator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) @@ -976,7 +973,7 @@ Public Class dlgDescribeTwoVariable End If End If ElseIf rdoTwoVariable.Checked Then - If IsNumericByNumeric() OrElse IsNumericByNumeric() Then + If IsNumericByNumeric() OrElse IsFactorByNumeric() Then If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then If ucrChkSwapXYVar.Checked Then clsCombineSwapAnova2Table.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) From 8bc17001ecf10905f719fb64a7ba3bce1490abaa Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 29 Apr 2024 11:21:53 +0300 Subject: [PATCH 29/83] changes --- instat/dlgDescribeTwoVariable.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 77164928a89..5125ac7fa87 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -612,6 +612,7 @@ Public Class dlgDescribeTwoVariable ucrChkSummariesRowCol.Visible = IsNumericByFactor() ucrChkCorrelations.Visible = IsNumericByNumeric() ucrChkSwapXYVar.Visible = IsNumericByNumeric() + ucrChkSwapXYVar.Visible = IsFactorByNumeric() ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else From 451eb53c1a09fb4dce3207a0d056ffec59b26589 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Tue, 30 Apr 2024 15:58:32 +0300 Subject: [PATCH 30/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 156 +++++++++-------- instat/dlgDescribeTwoVariable.vb | 196 +++++++++++++--------- 2 files changed, 201 insertions(+), 151 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index d07a0583e7e..fdb4cdfc07d 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,27 +60,28 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() - Me.ucrChkPercentageProportion = New instat.ucrCheck() Me.lblFactorAsPercentage = New System.Windows.Forms.Label() - Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() - Me.ucrChkCorrelations = New instat.ucrCheck() Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() + Me.ucrChkPercentageProportion = New instat.ucrCheck() + Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() - Me.ucrChkDisplayMargins = New instat.ucrCheck() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverSecondSkimrGroupByFactor = New instat.ucrReceiverSingle() Me.ucrSelectorDescribeTwoVar = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrPnlDescribe = New instat.UcrPanel() Me.ucrReceiverSkimrGroupByFactor = New instat.ucrReceiverSingle() - Me.ucrChkOmitMissing = New instat.ucrCheck() Me.ucrChkSummariesRowCol = New instat.ucrCheck() + Me.ucrChkDisplayMargins = New instat.ucrCheck() + Me.ucrChkOmitMissing = New instat.ucrCheck() + Me.ucrChkCorrelations = New instat.ucrCheck() Me.ucrChkSwapXYVar = New instat.ucrCheck() + Me.ucrChkMeans = New instat.ucrCheck() Me.grpSummaries.SuspendLayout() Me.grpDisplay.SuspendLayout() Me.SuspendLayout() @@ -354,16 +355,6 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(142, 51) - Me.ucrChkPercentageProportion.TabIndex = 57 - ' 'lblFactorAsPercentage ' Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -375,39 +366,6 @@ Partial Class dlgDescribeTwoVariable Me.lblFactorAsPercentage.Tag = "" Me.lblFactorAsPercentage.Text = "Factor as Percentage:" ' - 'ucrReceiverPercentages - ' - Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) - Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" - Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(142, 20) - Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 55 - Me.ucrReceiverPercentages.ucrSelector = Nothing - ' - 'ucrChkDisplayAsPercentage - ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(142, 51) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 - ' - 'ucrChkCorrelations - ' - Me.ucrChkCorrelations.AutoSize = True - Me.ucrChkCorrelations.Checked = False - Me.ucrChkCorrelations.Location = New System.Drawing.Point(462, 299) - Me.ucrChkCorrelations.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkCorrelations.Name = "ucrChkCorrelations" - Me.ucrChkCorrelations.Size = New System.Drawing.Size(223, 34) - Me.ucrChkCorrelations.TabIndex = 35 - ' 'ucrReceiverThreeVariableSecondFactor ' Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True @@ -469,6 +427,39 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) Me.ucrSaveTable.TabIndex = 24 ' + 'ucrChkPercentageProportion + ' + Me.ucrChkPercentageProportion.AutoSize = True + Me.ucrChkPercentageProportion.Checked = False + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(142, 51) + Me.ucrChkPercentageProportion.TabIndex = 57 + ' + 'ucrReceiverPercentages + ' + Me.ucrReceiverPercentages.AutoSize = True + Me.ucrReceiverPercentages.frmParent = Nothing + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) + Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" + Me.ucrReceiverPercentages.Selector = Nothing + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(142, 20) + Me.ucrReceiverPercentages.strNcFilePath = "" + Me.ucrReceiverPercentages.TabIndex = 55 + Me.ucrReceiverPercentages.ucrSelector = Nothing + ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(142, 51) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 + ' 'ucrInputMarginName ' Me.ucrInputMarginName.AddQuotesIfUnrecognised = True @@ -491,16 +482,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrReorderSummary.ucrDataFrameList = Nothing Me.ucrReorderSummary.ucrReceiver = Nothing ' - 'ucrChkDisplayMargins - ' - Me.ucrChkDisplayMargins.AutoSize = True - Me.ucrChkDisplayMargins.Checked = False - Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) - Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" - Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) - Me.ucrChkDisplayMargins.TabIndex = 18 - ' 'ucrBase ' Me.ucrBase.AutoSize = True @@ -558,6 +539,26 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverSkimrGroupByFactor.TabIndex = 2 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing ' + 'ucrChkSummariesRowCol + ' + Me.ucrChkSummariesRowCol.AutoSize = True + Me.ucrChkSummariesRowCol.Checked = False + Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 506) + Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkSummariesRowCol.Name = "ucrChkSummariesRowCol" + Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) + Me.ucrChkSummariesRowCol.TabIndex = 20 + ' + 'ucrChkDisplayMargins + ' + Me.ucrChkDisplayMargins.AutoSize = True + Me.ucrChkDisplayMargins.Checked = False + Me.ucrChkDisplayMargins.Location = New System.Drawing.Point(26, 444) + Me.ucrChkDisplayMargins.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkDisplayMargins.Name = "ucrChkDisplayMargins" + Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) + Me.ucrChkDisplayMargins.TabIndex = 18 + ' 'ucrChkOmitMissing ' Me.ucrChkOmitMissing.AutoSize = True @@ -568,26 +569,37 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) Me.ucrChkOmitMissing.TabIndex = 0 ' - 'ucrChkSummariesRowCol + 'ucrChkCorrelations ' - Me.ucrChkSummariesRowCol.AutoSize = True - Me.ucrChkSummariesRowCol.Checked = False - Me.ucrChkSummariesRowCol.Location = New System.Drawing.Point(22, 506) - Me.ucrChkSummariesRowCol.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkSummariesRowCol.Name = "ucrChkSummariesRowCol" - Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) - Me.ucrChkSummariesRowCol.TabIndex = 20 + Me.ucrChkCorrelations.AutoSize = True + Me.ucrChkCorrelations.Checked = False + Me.ucrChkCorrelations.Location = New System.Drawing.Point(450, 344) + Me.ucrChkCorrelations.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkCorrelations.Name = "ucrChkCorrelations" + Me.ucrChkCorrelations.Size = New System.Drawing.Size(223, 34) + Me.ucrChkCorrelations.TabIndex = 35 ' 'ucrChkSwapXYVar ' Me.ucrChkSwapXYVar.AutoSize = True Me.ucrChkSwapXYVar.Checked = False - Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(443, 340) + Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(450, 309) Me.ucrChkSwapXYVar.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkSwapXYVar.Name = "ucrChkSwapXYVar" - Me.ucrChkSwapXYVar.Size = New System.Drawing.Size(239, 34) + Me.ucrChkSwapXYVar.Size = New System.Drawing.Size(236, 34) Me.ucrChkSwapXYVar.TabIndex = 36 ' + 'ucrChkMeans + ' + Me.ucrChkMeans.AutoSize = True + Me.ucrChkMeans.Checked = False + Me.ucrChkMeans.Enabled = False + Me.ucrChkMeans.Location = New System.Drawing.Point(462, 278) + Me.ucrChkMeans.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkMeans.Name = "ucrChkMeans" + Me.ucrChkMeans.Size = New System.Drawing.Size(214, 34) + Me.ucrChkMeans.TabIndex = 37 + ' 'dlgDescribeTwoVariable ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) @@ -622,10 +634,11 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.lblFirstGroupByFactor) Me.Controls.Add(Me.lblThreeVariableSecondFactor) Me.Controls.Add(Me.ucrChkSummariesRowCol) - Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.ucrChkOmitMissing) - Me.Controls.Add(Me.ucrChkCorrelations) + Me.Controls.Add(Me.ucrChkMeans) + Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.ucrChkSwapXYVar) + Me.Controls.Add(Me.ucrChkCorrelations) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False @@ -685,4 +698,5 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents ucrChkSummariesRowCol As ucrCheck Friend WithEvents ucrChkCorrelations As ucrCheck Friend WithEvents ucrChkSwapXYVar As ucrCheck + Friend WithEvents ucrChkMeans As ucrCheck End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 5125ac7fa87..19ec058a05d 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -153,7 +153,9 @@ Public Class dlgDescribeTwoVariable ucrChkCorrelations.AddParameterValuesCondition(True, "corr", "True") ucrChkCorrelations.AddParameterValuesCondition(False, "corr", "False") - ucrChkSwapXYVar.SetText("Swap First and Second Variables") + ucrChkMeans.SetText("Means") + + ucrChkSwapXYVar.SetText("Swap First/Second Variables") ucrChkSwapXYVar.AddParameterValuesCondition(True, "var", "True") ucrChkSwapXYVar.AddParameterValuesCondition(False, "var", "False") @@ -576,7 +578,7 @@ Public Class dlgDescribeTwoVariable Private Sub cmdSummaries_Click(sender As Object, e As EventArgs) Handles cmdSummaries.Click If rdoTwoVariable.Checked Then - If IsNumericByFactor() Then + If IsFactorByNumeric() Then sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) End If 'ElseIf rdoThreeVariable.Checked Then @@ -599,20 +601,17 @@ Public Class dlgDescribeTwoVariable Private Sub ManageControlsVisibility() grpSummaries.Visible = rdoThreeVariable.Checked OrElse rdoTwoVariable.Checked - ucrReorderSummary.Visible = IsNumericByFactor() - cmdSummaries.Visible = IsNumericByFactor() ucrChkDisplayMargins.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactor() grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() - ucrChkSummariesRowCol.Visible = False ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False + ucrChkMeans.Visible = False If rdoTwoVariable.Checked Then ucrChkOmitMissing.Visible = strFirstVariablesType = "numeric" - ucrChkSummariesRowCol.Visible = IsNumericByFactor() + ucrChkSwapXYVar.Visible = IsNumericByNumeric() OrElse IsFactorByNumeric() ucrChkCorrelations.Visible = IsNumericByNumeric() - ucrChkSwapXYVar.Visible = IsNumericByNumeric() - ucrChkSwapXYVar.Visible = IsFactorByNumeric() + ucrChkMeans.Visible = IsNumericByFactor() ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else @@ -631,8 +630,13 @@ Public Class dlgDescribeTwoVariable Private Sub ChangeBaseRCode() ucrSaveTable.Visible = False + ucrReorderSummary.Visible = False + cmdSummaries.Visible = False + ucrChkSummariesRowCol.Visible = False + cmdFormatTable.Visible = False If rdoSkim.Checked Then clsDummyFunction.AddParameter("checked", "skim", iPosition:=0) + cmdFormatTable.Visible = False ucrSaveTable.Visible = True ucrSaveTable.Location = New Point(23, 286) @@ -649,7 +653,7 @@ Public Class dlgDescribeTwoVariable ElseIf rdoTwoVariable.Checked Then clsDummyFunction.AddParameter("checked", "customize", iPosition:=0) - If IsNumericByNumeric() OrElse IsFactorByNumeric() Then + If IsNumericByNumeric() Then If ucrChkSwapXYVar.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsMapping2Function) clsDummyFunction.AddParameter("var", "True", iPosition:=5) @@ -667,22 +671,13 @@ Public Class dlgDescribeTwoVariable ucrBase.clsRsyntax.RemoveFromAfterCodes(clsRCorrelationFunction) End If ucrSaveTable.Visible = False + cmdFormatTable.Visible = False ElseIf IsNumericByFactor() Then - ucrSaveTable.Visible = True - ucrSaveTable.Location = New Point(23, 450) - clsDummyFunction.AddParameter("factor_cols", "Sum", iPosition:=1) - ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) - ucrSaveTable.SetPrefix("summary_table") - ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - ucrSaveTable.SetAssignToIfUncheckedValue("last_table") - ucrSaveTable.SetCheckBoxText("Save Table") - clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", - strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, - strRObjectFormatToAssignTo:=RObjectFormat.Html, - strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, - strObjectName:="last_table") + ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + ElseIf IsFactorByFactor() Then ucrSaveTable.Visible = True + cmdFormatTable.Visible = True ucrSaveTable.Location = New Point(23, 350) clsDummyFunction.AddParameter("factor_cols", "FactorVar", iPosition:=1) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) @@ -695,6 +690,37 @@ Public Class dlgDescribeTwoVariable strRObjectFormatToAssignTo:=RObjectFormat.Html, strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, strObjectName:="last_table") + ElseIf IsFactorByNumeric() Then + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsRCorrelationFunction) + If ucrChkSwapXYVar.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsMapping2Function) + clsDummyFunction.AddParameter("var", "True", iPosition:=5) + ucrReorderSummary.Visible = False + cmdSummaries.Visible = False + ucrChkSummariesRowCol.Visible = False + cmdFormatTable.Visible = False + Else + clsDummyFunction.AddParameter("var", "False", iPosition:=5) + ucrSaveTable.Visible = True + ucrReorderSummary.Visible = True + cmdSummaries.Visible = True + ucrChkSummariesRowCol.Visible = True + cmdFormatTable.Visible = True + + ucrSaveTable.Location = New Point(23, 450) + clsDummyFunction.AddParameter("factor_cols", "Sum", iPosition:=1) + ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) + ucrSaveTable.SetPrefix("summary_table") + ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) + ucrSaveTable.SetAssignToIfUncheckedValue("last_table") + ucrSaveTable.SetCheckBoxText("Save Table") + clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, + strRObjectFormatToAssignTo:=RObjectFormat.Html, + strRDataFrameNameToAddObjectTo:=ucrSelectorDescribeTwoVar.strCurrentDataFrame, + strObjectName:="last_table") + End If + End If ElseIf rdoThreeVariable.Checked Then clsDummyFunction.AddParameter("checked", "three_variable", iPosition:=0) @@ -702,6 +728,8 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetCheckBoxText("Save Table") If IsFactorByFactorByFactor() Then + cmdFormatTable.Visible = True + ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, @@ -710,6 +738,7 @@ Public Class dlgDescribeTwoVariable strObjectName:="last_table") End If If IsFactorByNumericByNumeric() Then + cmdFormatTable.Visible = False ucrBase.clsRsyntax.SetBaseROperator(clsGroupByPipeOperator4) clsGroupByPipeOperator4.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, @@ -719,14 +748,18 @@ Public Class dlgDescribeTwoVariable End If If IsNumericByNumericByFactor() Then ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) + cmdFormatTable.Visible = False End If If IsNumericByNumericByNumeric() Then + cmdFormatTable.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If If IsNumericByFactorByFactor() Then + cmdFormatTable.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If If IsNumericByFactorByNumeric() Then + cmdFormatTable.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) End If End If @@ -803,7 +836,6 @@ Public Class dlgDescribeTwoVariable UpdateCombineFactorParameterFunction() ChangeLocations() AddRemoveNAParameter() - ShowFormatTableButton() FactorColumns() AddRemoveFirstCorrParam() AddRemoveSecondCorrParam() @@ -814,24 +846,13 @@ Public Class dlgDescribeTwoVariable 'SwappingXYVar() End Sub - Private Sub ShowFormatTableButton() - If rdoTwoVariable.Checked Then - cmdFormatTable.Visible = IsNumericByFactor() _ - OrElse IsFactorByFactor() OrElse IsFactorByNumeric() - ElseIf rdoThreeVariable.Checked Then - cmdFormatTable.Visible = IsFactorByFactorByFactor() - Else - cmdFormatTable.Visible = False - End If - End Sub - Private Sub ChangeLocations() If rdoTwoVariable.Checked Then - If IsNumericByFactor() Then + If IsFactorByNumeric() Then ucrBase.Location = New Point(iUcrBaseXLocation, 487) Me.Size = New Point(iDialogueXsize, 580) cmdFormatTable.Location = New Point(326, 423) - ElseIf IsFactorByNumeric() Then + ElseIf IsNumericByFactor() Then ucrBase.Location = New Point(iUcrBaseXLocation, 319) Me.Size = New Point(iDialogueXsize, 415) ElseIf IsFactorByFactor() Then @@ -911,6 +932,12 @@ Public Class dlgDescribeTwoVariable clsSummaryTableFunction.AddParameter("factors", "c(" & ucrReceiverSecondTwoVariableFactor.GetVariableNames & "," & ".x" & ")") clsSummaryTableFunction.AddParameter("columns_to_summarise", ".x") clsPivotWiderFunction.AddParameter("names_from", "{{ .x }}", iPosition:=1) + ElseIf IsFactorByNumeric Then + clsSummaryTableFunction.AddParameter("factors", ucrReceiverFirstVars.GetVariableNames) + clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=1) + clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverSecondTwoVariableFactor.GetVariableNames) + clsMapSummaryFunction.AddParameter(".x", ucrReceiverSecondTwoVariableFactor.GetVariableNames, iPosition:=3) + SummariesInRowsOrCols() Else clsSummaryTableFunction.AddParameter("factors", ucrReceiverSecondTwoVariableFactor.GetVariableNames) clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=1) @@ -942,7 +969,7 @@ Public Class dlgDescribeTwoVariable End If End If ElseIf rdoTwoVariable.Checked Then - If IsNumericByNumeric() OrElse IsFactorByNumeric() Then + If IsNumericByNumeric() Then If Not ucrReceiverFirstVars.IsEmpty Then If ucrChkSwapXYVar.Checked Then clsYlist2Operator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) @@ -958,7 +985,26 @@ Public Class dlgDescribeTwoVariable clsYlistOperator.RemoveParameterByName("cols") End If + ElseIf IsNumericByFactor() Then + If ucrReceiverFirstVars.IsEmpty Then + clsYlistOperator.RemoveParameterByName("cols") + Else + clsYlistOperator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + End If + ElseIf IsFactorByNumeric() Then + If Not ucrReceiverFirstVars.IsEmpty Then + If ucrChkSwapXYVar.Checked Then + clsYlist2Operator.AddParameter("cols", ucrReceiverFirstVars.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + clsYlistOperator.RemoveParameterByName("cols") + Else + clsYlist2Operator.RemoveParameterByName("cols") + clsYlistOperator.RemoveParameterByName("cols") + End If + Else + clsYlist2Operator.RemoveParameterByName("cols") + clsYlistOperator.RemoveParameterByName("cols") + End If End If End If @@ -974,7 +1020,7 @@ Public Class dlgDescribeTwoVariable End If End If ElseIf rdoTwoVariable.Checked Then - If IsNumericByNumeric() OrElse IsFactorByNumeric() Then + If IsNumericByNumeric() Then If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then If ucrChkSwapXYVar.Checked Then clsCombineSwapAnova2Table.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) @@ -989,9 +1035,30 @@ Public Class dlgDescribeTwoVariable clsCombineAnova2Function.RemoveParameterByName("x") End If - End If + ElseIf IsFactorByNumeric Then + If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then + If ucrChkSwapXYVar.Checked Then + clsCombineSwapAnova2Table.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + clsCombineAnova2Function.RemoveParameterByName("x") + Else + clsCombineSwapAnova2Table.RemoveParameterByName("x") + clsCombineAnova2Function.RemoveParameterByName("x") + End If + Else + clsCombineSwapAnova2Table.RemoveParameterByName("x") + clsCombineAnova2Function.RemoveParameterByName("x") + End If + ElseIf IsNumericByFactor() Then + If ucrReceiverSecondTwoVariableFactor.IsEmpty Then + clsCombineAnova2Function.RemoveParameterByName("x") + Else + clsCombineAnova2Function.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) + End If + End If End If + + End Sub Private Sub AddRemoveThirdAnovaParam() @@ -1067,7 +1134,7 @@ Public Class dlgDescribeTwoVariable If rdoTwoVariable.Checked Then If IsFactorByFactor() Then clsSummaryTableFunction.AddParameter("summaries", "count_label", iPosition:=4) - ElseIf IsNumericByFactor() Then + ElseIf IsFactorByNumeric() Then clsSummaryTableFunction.AddParameter("summaries", clsRFunctionParameter:=clsSummariesListFunction, iPosition:=4) End If ElseIf rdoThreeVariable.Checked Then @@ -1088,7 +1155,6 @@ Public Class dlgDescribeTwoVariable UpdateSummaryTableFunction() AddRemoveFrequencyParameters() AddRemoveNAParameter() - ShowFormatTableButton() AddRemoveFirstCorrParam() AddRemoveThirdCorrParam() AddRemoveSecondCorrParam() @@ -1111,9 +1177,13 @@ Public Class dlgDescribeTwoVariable If IsNumericByNumeric() Then strSummaryName = "ANOVA tables" ElseIf IsFactorByNumeric() Then - strSummaryName = "ANOVA tables" + If ucrChkSwapXYVar.Checked Then + strSummaryName = "ANOVA tables" + Else + strSummaryName = "Summary tables" + End If ElseIf IsNumericByFactor() Then - strSummaryName = "Summary tables" + strSummaryName = "ANOVA tables" Else strSummaryName = "" End If @@ -1166,7 +1236,7 @@ Public Class dlgDescribeTwoVariable Private Sub SummariesInRowsOrCols() If ucrChkSummariesRowCol.Checked Then - clsPivotWiderFunction.AddParameter("names_from", ucrReceiverSecondTwoVariableFactor.GetVariableNames(False), iPosition:=1) + clsPivotWiderFunction.AddParameter("names_from", ucrReceiverFirstVars.GetVariableNames(False), iPosition:=1) clsDummyFunction.AddParameter("row_sum", "True", iPosition:=3) Else clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=1) @@ -1182,10 +1252,8 @@ Public Class dlgDescribeTwoVariable UpdateSummaryTableFunction() ChangeLocations() AddRemoveNAParameter() - ShowFormatTableButton() ManageControlsVisibility() FactorColumns() - 'SwappingXYVar() AddRemoveFirstAnova2Param() AddRemoveSecondAnovaParam() End Sub @@ -1258,13 +1326,11 @@ Public Class dlgDescribeTwoVariable ChangeLocations() AddRemoveFrequencyParameters() AddRemoveNAParameter() - ShowFormatTableButton() FactorColumns() AddRemoveFirstCorrParam() AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() - 'SwappingXYVar() End Sub Private Sub ucrReceiverThreeVariableSecondFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableSecondFactor.ControlValueChanged @@ -1274,7 +1340,6 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondCorrParam() AddRemoveSecondAnovaParam() AddRemoveFirstAnova2Param() - 'SwappingXYVar() End Sub Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirstVars.ControlContentsChanged, @@ -1403,40 +1468,11 @@ Public Class dlgDescribeTwoVariable Private Sub ucrChkCorrelations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkCorrelations.ControlValueChanged ChangeBaseRCode() End Sub - 'Private Sub SwappingXYVar() - ' If rdoTwoVariable.Checked Then - - ' If ucrChkSwapXYVar.Checked Then - ' clsRAnovaSwapTable2Funtion.AddParameter(" y_col_name", clsRFunctionParameter:=clsCombineSwapAnova2Table, iPosition:=1) - ' clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", ".x", iPosition:=2) - ' clsAnovaSwapTable2Opeator.AddParameter("right", clsRFunctionParameter:=clsRAnovaSwapTable2Funtion, iPosition:=1) - - ' clsDummyFunction.AddParameter("var", "True", iPosition:=5) - ' 'clsRAnovaTable2Function.RemoveParameterByName("y_col_name") - ' 'clsRAnovaTable2Function.RemoveParameterByName("x_col_names") - ' Else - ' clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - ' clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) - ' clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) - - ' clsDummyFunction.AddParameter("var", "False", iPosition:=5) - ' 'clsRAnovaSwapTable2Funtion.RemoveParameterByName("y_col_name") - ' 'clsRAnovaSwapTable2Funtion.RemoveParameterByName("x_col_names") - ' End If - - ' ElseIf rdoThreeVariable.Checked Then - ' clsRAnovaTable2Function.AddParameter(" x_col_names", clsRFunctionParameter:=clsCombineAnova2Function, iPosition:=1) - ' clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) - ' 'Else - ' ' clsRAnovaTable2Function.RemoveParameterByName("y_col_name") - ' ' clsRAnovaTable2Function.RemoveParameterByName("x_col_names") - ' clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) - - ' End If - 'End Sub + Private Sub ucrChkSwapXYVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSwapXYVar.ControlValueChanged AddRemoveFirstAnova2Param() AddRemoveSecondAnovaParam() ChangeBaseRCode() + ChangeSumaryLabelText() End Sub End Class From 1c8066864553d7baf9241114f237d8420d8574ab Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Wed, 1 May 2024 04:44:23 +0300 Subject: [PATCH 31/83] change --- instat/static/InstatObject/R/data_object_R6.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 609b2309d02..e3406e2d002 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -4469,8 +4469,15 @@ DataSheet$set("public", "anova_tables2", function(x_col_names, y_col_name, signi if(missing(x_col_names) || missing(y_col_name)) stop("Both x_col_names and y_col_names are required") if(sign_level || signif.stars) message("This is no longer descriptive") if(sign_level) end_col = 5 else end_col = 4 - mod <- lm(formula = as.formula(paste0("as.numeric(", as.name(y_col_name), ") ~ ", as.name(x_col_names[1]), " + ", as.name(x_col_names[2]))), data = self$get_data_frame()) - cat("ANOVA table: ", y_col_name, " ~ ", x_col_names[1], " + ", x_col_names[2], "\n", sep = "") + + if (length(x_col_names) == 1) { + formula_str <- paste0( as.name(y_col_name), "~ ", as.name(x_col_names)) + } else if (length(x_col_names) > 1) { + formula_str <- paste0(as.name(y_col_name), "~ ", as.name(paste(x_col_names, collapse = " + "))) + } + + mod <- lm(formula = as.formula(formula_str), data = self$get_data_frame()) + cat("ANOVA table: ", formula_str, "\n", sep = "") print(anova(mod)[1:end_col], signif.stars = signif.stars) cat("\n") if(means) (print(model.tables(aov(mod), type = "means"))) From 95a5b9e886fa90c4745107e1a8d22d7dd523d655 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Thu, 2 May 2024 14:50:37 +0300 Subject: [PATCH 32/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 146 ++++++++++++---------- instat/dlgDescribeTwoVariable.vb | 39 ++++-- 2 files changed, 108 insertions(+), 77 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index fdb4cdfc07d..895c6a5dc6c 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,15 +60,14 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() + Me.ucrChkPercentageProportion = New instat.ucrCheck() Me.lblFactorAsPercentage = New System.Windows.Forms.Label() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() - Me.ucrChkPercentageProportion = New instat.ucrCheck() - Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrBase = New instat.ucrButtons() @@ -77,11 +76,13 @@ Partial Class dlgDescribeTwoVariable Me.ucrPnlDescribe = New instat.UcrPanel() Me.ucrReceiverSkimrGroupByFactor = New instat.ucrReceiverSingle() Me.ucrChkSummariesRowCol = New instat.ucrCheck() - Me.ucrChkDisplayMargins = New instat.ucrCheck() Me.ucrChkOmitMissing = New instat.ucrCheck() - Me.ucrChkCorrelations = New instat.ucrCheck() - Me.ucrChkSwapXYVar = New instat.ucrCheck() Me.ucrChkMeans = New instat.ucrCheck() + Me.ucrChkDisplayMargins = New instat.ucrCheck() + Me.ucrChkSwapXYVar = New instat.ucrCheck() + Me.ucrChkCorrelations = New instat.ucrCheck() + Me.ucrChkLevSig = New instat.ucrCheck() + Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() Me.grpSummaries.SuspendLayout() Me.grpDisplay.SuspendLayout() Me.SuspendLayout() @@ -344,7 +345,6 @@ Partial Class dlgDescribeTwoVariable ' Me.grpDisplay.Controls.Add(Me.ucrChkPercentageProportion) Me.grpDisplay.Controls.Add(Me.lblFactorAsPercentage) - Me.grpDisplay.Controls.Add(Me.ucrReceiverPercentages) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) Me.grpDisplay.Location = New System.Drawing.Point(412, 308) Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4) @@ -355,10 +355,20 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' + 'ucrChkPercentageProportion + ' + Me.ucrChkPercentageProportion.AutoSize = True + Me.ucrChkPercentageProportion.Checked = False + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 115) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(190, 51) + Me.ucrChkPercentageProportion.TabIndex = 57 + ' 'lblFactorAsPercentage ' Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFactorAsPercentage.Location = New System.Drawing.Point(14, 63) + Me.lblFactorAsPercentage.Location = New System.Drawing.Point(14, 48) Me.lblFactorAsPercentage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblFactorAsPercentage.Name = "lblFactorAsPercentage" Me.lblFactorAsPercentage.Size = New System.Drawing.Size(231, 22) @@ -366,6 +376,16 @@ Partial Class dlgDescribeTwoVariable Me.lblFactorAsPercentage.Tag = "" Me.lblFactorAsPercentage.Text = "Factor as Percentage:" ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(142, 51) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 + ' 'ucrReceiverThreeVariableSecondFactor ' Me.ucrReceiverThreeVariableSecondFactor.AutoSize = True @@ -427,39 +447,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) Me.ucrSaveTable.TabIndex = 24 ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 84) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(142, 51) - Me.ucrChkPercentageProportion.TabIndex = 57 - ' - 'ucrReceiverPercentages - ' - Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Nothing - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(12, 57) - Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" - Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(142, 20) - Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 55 - Me.ucrReceiverPercentages.ucrSelector = Nothing - ' - 'ucrChkDisplayAsPercentage - ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(142, 51) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 - ' 'ucrInputMarginName ' Me.ucrInputMarginName.AddQuotesIfUnrecognised = True @@ -549,6 +536,26 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) Me.ucrChkSummariesRowCol.TabIndex = 20 ' + 'ucrChkOmitMissing + ' + Me.ucrChkOmitMissing.AutoSize = True + Me.ucrChkOmitMissing.Checked = False + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(26, 444) + Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" + Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) + Me.ucrChkOmitMissing.TabIndex = 0 + ' + 'ucrChkMeans + ' + Me.ucrChkMeans.AutoSize = True + Me.ucrChkMeans.Checked = False + Me.ucrChkMeans.Location = New System.Drawing.Point(450, 278) + Me.ucrChkMeans.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkMeans.Name = "ucrChkMeans" + Me.ucrChkMeans.Size = New System.Drawing.Size(145, 34) + Me.ucrChkMeans.TabIndex = 37 + ' 'ucrChkDisplayMargins ' Me.ucrChkDisplayMargins.AutoSize = True @@ -559,15 +566,15 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkDisplayMargins.Size = New System.Drawing.Size(214, 34) Me.ucrChkDisplayMargins.TabIndex = 18 ' - 'ucrChkOmitMissing + 'ucrChkSwapXYVar ' - Me.ucrChkOmitMissing.AutoSize = True - Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(26, 444) - Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" - Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) - Me.ucrChkOmitMissing.TabIndex = 0 + Me.ucrChkSwapXYVar.AutoSize = True + Me.ucrChkSwapXYVar.Checked = False + Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(450, 309) + Me.ucrChkSwapXYVar.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkSwapXYVar.Name = "ucrChkSwapXYVar" + Me.ucrChkSwapXYVar.Size = New System.Drawing.Size(236, 34) + Me.ucrChkSwapXYVar.TabIndex = 36 ' 'ucrChkCorrelations ' @@ -579,26 +586,28 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkCorrelations.Size = New System.Drawing.Size(223, 34) Me.ucrChkCorrelations.TabIndex = 35 ' - 'ucrChkSwapXYVar + 'ucrChkLevSig ' - Me.ucrChkSwapXYVar.AutoSize = True - Me.ucrChkSwapXYVar.Checked = False - Me.ucrChkSwapXYVar.Location = New System.Drawing.Point(450, 309) - Me.ucrChkSwapXYVar.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkSwapXYVar.Name = "ucrChkSwapXYVar" - Me.ucrChkSwapXYVar.Size = New System.Drawing.Size(236, 34) - Me.ucrChkSwapXYVar.TabIndex = 36 + Me.ucrChkLevSig.AutoSize = True + Me.ucrChkLevSig.Checked = False + Me.ucrChkLevSig.Location = New System.Drawing.Point(595, 278) + Me.ucrChkLevSig.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkLevSig.Name = "ucrChkLevSig" + Me.ucrChkLevSig.Size = New System.Drawing.Size(129, 34) + Me.ucrChkLevSig.TabIndex = 38 ' - 'ucrChkMeans + 'ucrReceiverPercentages ' - Me.ucrChkMeans.AutoSize = True - Me.ucrChkMeans.Checked = False - Me.ucrChkMeans.Enabled = False - Me.ucrChkMeans.Location = New System.Drawing.Point(462, 278) - Me.ucrChkMeans.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkMeans.Name = "ucrChkMeans" - Me.ucrChkMeans.Size = New System.Drawing.Size(214, 34) - Me.ucrChkMeans.TabIndex = 37 + Me.ucrReceiverPercentages.AutoSize = True + Me.ucrReceiverPercentages.frmParent = Me + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(427, 380) + Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" + Me.ucrReceiverPercentages.Selector = Nothing + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverPercentages.strNcFilePath = "" + Me.ucrReceiverPercentages.TabIndex = 39 + Me.ucrReceiverPercentages.ucrSelector = Nothing ' 'dlgDescribeTwoVariable ' @@ -606,6 +615,7 @@ Partial Class dlgDescribeTwoVariable Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ClientSize = New System.Drawing.Size(723, 748) + Me.Controls.Add(Me.ucrReceiverPercentages) Me.Controls.Add(Me.ucrReceiverThreeVariableSecondFactor) Me.Controls.Add(Me.ucrReceiverSecondTwoVariableFactor) Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) @@ -639,6 +649,7 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.ucrChkSwapXYVar) Me.Controls.Add(Me.ucrChkCorrelations) + Me.Controls.Add(Me.ucrChkLevSig) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False @@ -691,7 +702,6 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents grpDisplay As GroupBox Friend WithEvents ucrChkPercentageProportion As ucrCheck Friend WithEvents lblFactorAsPercentage As Label - Friend WithEvents ucrReceiverPercentages As ucrReceiverSingle Friend WithEvents ucrChkDisplayAsPercentage As ucrCheck Friend WithEvents ucrSaveTable As ucrSave Friend WithEvents ucrReceiverFirstVars As ucrReceiverMultiple @@ -699,4 +709,6 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents ucrChkCorrelations As ucrCheck Friend WithEvents ucrChkSwapXYVar As ucrCheck Friend WithEvents ucrChkMeans As ucrCheck + Friend WithEvents ucrChkLevSig As ucrCheck + Friend WithEvents ucrReceiverPercentages As ucrReceiverSingle End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 19ec058a05d..689b5ad654b 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -154,6 +154,15 @@ Public Class dlgDescribeTwoVariable ucrChkCorrelations.AddParameterValuesCondition(False, "corr", "False") ucrChkMeans.SetText("Means") + ucrChkMeans.SetParameter(New RParameter("means", 5)) + ucrChkMeans.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkMeans.SetRDefault("FALSE") + + ucrChkLevSig.SetText("Sig.Level") + ucrChkLevSig.SetParameter(New RParameter("sign_level", 4)) + ucrChkLevSig.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkLevSig.SetRDefault("FALSE") + ucrChkSwapXYVar.SetText("Swap First/Second Variables") ucrChkSwapXYVar.AddParameterValuesCondition(True, "var", "True") @@ -319,7 +328,7 @@ Public Class dlgDescribeTwoVariable clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) clsRAnovaTable2Function.AddParameter("signif.stars", "FALSE", iPosition:=3) clsRAnovaTable2Function.AddParameter("sign_level", "FALSE", iPosition:=4) - clsRAnovaTable2Function.AddParameter("means", "FALSE", iPosition:=5) + 'clsRAnovaTable2Function.AddParameter("means", "FALSE", iPosition:=5) clsRAnovaSwapTable2Funtion.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables2") clsRAnovaSwapTable2Funtion.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) @@ -327,7 +336,7 @@ Public Class dlgDescribeTwoVariable clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", ".x", iPosition:=2) clsRAnovaSwapTable2Funtion.AddParameter("signif.stars", "FALSE", iPosition:=3) clsRAnovaSwapTable2Funtion.AddParameter("sign_level", "FALSE", iPosition:=4) - clsRAnovaSwapTable2Funtion.AddParameter("means", "FALSE", iPosition:=5) + 'clsRAnovaSwapTable2Funtion.AddParameter("means", "FALSE", iPosition:=5) clsGroupByPipeOperator.SetOperation("%>%") @@ -393,7 +402,7 @@ Public Class dlgDescribeTwoVariable clsStyleListFunction.SetRCommand("list") clsSummariesListFunction.SetRCommand("c") - clsSummariesListFunction.AddParameter("summary_count", Chr(34) & "summary_count" & Chr(34), + clsSummariesListFunction.AddParameter("summary_mean", Chr(34) & "summary_mean" & Chr(34), bIncludeArgumentName:=False, iPosition:=0) clsSummaryTableCombineFactorsFunction.SetRCommand("c") @@ -491,6 +500,8 @@ Public Class dlgDescribeTwoVariable ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsSkimrFunction, New RParameter("col_names", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsMapSummaryFunction, New RParameter(".x", 1), iAdditionalPairNo:=3) + ucrChkMeans.AddAdditionalCodeParameterPair(clsCombineSwapAnova2Table, New RParameter("means", iNewPosition:=5), iAdditionalPairNo:=1) + ucrChkLevSig.AddAdditionalCodeParameterPair(clsCombineSwapAnova2Table, New RParameter("sign_level", iNewPosition:=4), iAdditionalPairNo:=1) 'ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsRAnovaFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) @@ -509,6 +520,8 @@ Public Class dlgDescribeTwoVariable ucrChkSummariesRowCol.SetRCode(clsDummyFunction, bReset) ucrChkCorrelations.SetRCode(clsDummyFunction, bReset) ucrChkSwapXYVar.SetRCode(clsDummyFunction, bReset) + ucrChkMeans.SetRCode(clsRAnovaTable2Function, bReset) + ucrChkLevSig.SetRCode(clsRAnovaTable2Function, bReset) ucrReceiverThreeVariableSecondFactor.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrReceiverThreeVariableThirdVariable.SetRCode(clsSummaryTableCombineFactorsFunction, bReset) ucrChkDisplayMargins.SetRCode(clsCombineFrequencyParametersFunction, bReset) @@ -606,12 +619,10 @@ Public Class dlgDescribeTwoVariable grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False - ucrChkMeans.Visible = False If rdoTwoVariable.Checked Then ucrChkOmitMissing.Visible = strFirstVariablesType = "numeric" ucrChkSwapXYVar.Visible = IsNumericByNumeric() OrElse IsFactorByNumeric() ucrChkCorrelations.Visible = IsNumericByNumeric() - ucrChkMeans.Visible = IsNumericByFactor() ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else @@ -634,10 +645,11 @@ Public Class dlgDescribeTwoVariable cmdSummaries.Visible = False ucrChkSummariesRowCol.Visible = False cmdFormatTable.Visible = False + ucrChkMeans.Visible = False + ucrChkLevSig.Visible = False If rdoSkim.Checked Then clsDummyFunction.AddParameter("checked", "skim", iPosition:=0) cmdFormatTable.Visible = False - ucrSaveTable.Visible = True ucrSaveTable.Location = New Point(23, 286) ucrSaveTable.SetPrefix("summary_table") @@ -672,12 +684,17 @@ Public Class dlgDescribeTwoVariable End If ucrSaveTable.Visible = False cmdFormatTable.Visible = False + ucrChkMeans.Visible = True + ucrChkLevSig.Visible = True ElseIf IsNumericByFactor() Then ucrBase.clsRsyntax.SetBaseRFunction(clsMappingFunction) - + ucrChkMeans.Visible = True + ucrChkLevSig.Visible = True ElseIf IsFactorByFactor() Then ucrSaveTable.Visible = True cmdFormatTable.Visible = True + ucrChkMeans.Visible = False + ucrChkLevSig.Visible = False ucrSaveTable.Location = New Point(23, 350) clsDummyFunction.AddParameter("factor_cols", "FactorVar", iPosition:=1) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) @@ -699,6 +716,8 @@ Public Class dlgDescribeTwoVariable cmdSummaries.Visible = False ucrChkSummariesRowCol.Visible = False cmdFormatTable.Visible = False + ucrChkMeans.Visible = True + ucrChkLevSig.Visible = True Else clsDummyFunction.AddParameter("var", "False", iPosition:=5) ucrSaveTable.Visible = True @@ -706,7 +725,8 @@ Public Class dlgDescribeTwoVariable cmdSummaries.Visible = True ucrChkSummariesRowCol.Visible = True cmdFormatTable.Visible = True - + ucrChkMeans.Visible = False + ucrChkLevSig.Visible = False ucrSaveTable.Location = New Point(23, 450) clsDummyFunction.AddParameter("factor_cols", "Sum", iPosition:=1) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) @@ -1101,8 +1121,7 @@ Public Class dlgDescribeTwoVariable End Sub Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPercentageProportion.ControlValueChanged, - ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, - ucrReceiverPercentages.ControlValueChanged, ucrInputMarginName.ControlValueChanged + ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, ucrInputMarginName.ControlValueChanged If rdoTwoVariable.Checked Then If ucrChkDisplayAsPercentage.Checked Then ucrReceiverPercentages.SetMeAsReceiver() From 899083a87e64238f579e751540a2176e3e02627d Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Fri, 3 May 2024 13:56:26 +0300 Subject: [PATCH 33/83] changes to the code --- instat/dlgDescribeTwoVariable.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 689b5ad654b..3139d9bf91a 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -500,8 +500,8 @@ Public Class dlgDescribeTwoVariable ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsSkimrFunction, New RParameter("col_names", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsMapSummaryFunction, New RParameter(".x", 1), iAdditionalPairNo:=3) - ucrChkMeans.AddAdditionalCodeParameterPair(clsCombineSwapAnova2Table, New RParameter("means", iNewPosition:=5), iAdditionalPairNo:=1) - ucrChkLevSig.AddAdditionalCodeParameterPair(clsCombineSwapAnova2Table, New RParameter("sign_level", iNewPosition:=4), iAdditionalPairNo:=1) + ucrChkMeans.AddAdditionalCodeParameterPair(clsRAnovaSwapTable2Funtion, New RParameter("means", iNewPosition:=5), iAdditionalPairNo:=1) + ucrChkLevSig.AddAdditionalCodeParameterPair(clsRAnovaSwapTable2Funtion, New RParameter("sign_level", iNewPosition:=4), iAdditionalPairNo:=1) 'ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsRAnovaFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) From 14cacdef9f554a4387dbbc8df6215ea039f96122 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Tue, 7 May 2024 15:34:06 +0300 Subject: [PATCH 34/83] changes to the code --- instat/static/InstatObject/R/data_object_R6.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index e3406e2d002..1489180ff82 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -4466,6 +4466,7 @@ DataSheet$set("public", "has_labels", function(col_names) { ) DataSheet$set("public", "anova_tables2", function(x_col_names, y_col_name, signif.stars = FALSE, sign_level = FALSE, means = FALSE) { + if(missing(x_col_names) || missing(y_col_name)) stop("Both x_col_names and y_col_names are required") if(sign_level || signif.stars) message("This is no longer descriptive") if(sign_level) end_col = 5 else end_col = 4 @@ -4476,10 +4477,10 @@ DataSheet$set("public", "anova_tables2", function(x_col_names, y_col_name, signi formula_str <- paste0(as.name(y_col_name), "~ ", as.name(paste(x_col_names, collapse = " + "))) } + return_item <- NULL mod <- lm(formula = as.formula(formula_str), data = self$get_data_frame()) - cat("ANOVA table: ", formula_str, "\n", sep = "") - print(anova(mod)[1:end_col], signif.stars = signif.stars) - cat("\n") - if(means) (print(model.tables(aov(mod), type = "means"))) + return_item[[paste0("ANOVA table: ", formula_str, sep = "")]] <- anova(mod)[1:end_col] + if(means) return_item[[paste0("Means table of ", y_col_name)]] <- model.tables(aov(mod), type = "means") + return(return_item) } ) \ No newline at end of file From f3d7f211a2827f7a3c1188bb0a2fa9dbdef52e18 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Wed, 8 May 2024 16:18:09 +0300 Subject: [PATCH 35/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 8 ++++---- instat/dlgDescribeTwoVariable.vb | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 895c6a5dc6c..7577142ad37 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -129,7 +129,7 @@ Partial Class dlgDescribeTwoVariable 'cmdMissingOptions ' Me.cmdMissingOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMissingOptions.Location = New System.Drawing.Point(250, 444) + Me.cmdMissingOptions.Location = New System.Drawing.Point(539, 439) Me.cmdMissingOptions.Margin = New System.Windows.Forms.Padding(4) Me.cmdMissingOptions.Name = "cmdMissingOptions" Me.cmdMissingOptions.Size = New System.Drawing.Size(158, 34) @@ -540,7 +540,7 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrChkOmitMissing.AutoSize = True Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(26, 444) + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(450, 383) Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) @@ -626,7 +626,6 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.cmdSummaries) Me.Controls.Add(Me.ucrReorderSummary) Me.Controls.Add(Me.lblMarginName) - Me.Controls.Add(Me.cmdMissingOptions) Me.Controls.Add(Me.cmdFormatTable) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.ucrReceiverSecondSkimrGroupByFactor) @@ -644,12 +643,13 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.lblFirstGroupByFactor) Me.Controls.Add(Me.lblThreeVariableSecondFactor) Me.Controls.Add(Me.ucrChkSummariesRowCol) - Me.Controls.Add(Me.ucrChkOmitMissing) Me.Controls.Add(Me.ucrChkMeans) Me.Controls.Add(Me.ucrChkDisplayMargins) Me.Controls.Add(Me.ucrChkSwapXYVar) Me.Controls.Add(Me.ucrChkCorrelations) Me.Controls.Add(Me.ucrChkLevSig) + Me.Controls.Add(Me.ucrChkOmitMissing) + Me.Controls.Add(Me.cmdMissingOptions) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 3139d9bf91a..51fa1ab4c1f 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -619,14 +619,18 @@ Public Class dlgDescribeTwoVariable grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False + ucrChkOmitMissing.Visible = False + cmdMissingOptions.Visible = False If rdoTwoVariable.Checked Then - ucrChkOmitMissing.Visible = strFirstVariablesType = "numeric" + ucrChkOmitMissing.Visible = IsNumericByNumeric() OrElse IsNumericByFactor() ucrChkSwapXYVar.Visible = IsNumericByNumeric() OrElse IsFactorByNumeric() ucrChkCorrelations.Visible = IsNumericByNumeric() + cmdMissingOptions.Visible = ucrChkOmitMissing.Checked ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else ucrChkOmitMissing.Visible = False + cmdMissingOptions.Visible = False End If If rdoThreeVariable.Checked Then If IsNumericByFactorByFactor() OrElse IsNumericByFactorByNumeric() Then @@ -636,7 +640,6 @@ Public Class dlgDescribeTwoVariable ucrChkDisplayMargins.Visible = IsFactorByFactorByFactor() ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactorByFactor() End If - cmdMissingOptions.Visible = ucrChkOmitMissing.Checked End Sub Private Sub ChangeBaseRCode() @@ -647,6 +650,7 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = False ucrChkMeans.Visible = False ucrChkLevSig.Visible = False + cmdMissingOptions.Visible = False If rdoSkim.Checked Then clsDummyFunction.AddParameter("checked", "skim", iPosition:=0) cmdFormatTable.Visible = False @@ -809,8 +813,8 @@ Public Class dlgDescribeTwoVariable TestOKEnabled() End Sub - Private Sub ucrChkOmitMissing_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkOmitMissing.ControlValueChanged - If ucrChkOmitMissing.Checked Then + Private Sub ucrChkOmitMissing_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkOmitMissing.ControlValueChanged, ucrChkCorrelations.ControlValueChanged + If ucrChkOmitMissing.Checked AndAlso ucrChkCorrelations.Checked Then clsRCorrelationFunction.AddParameter("use", Chr(34) & "pairwise.complete.obs" & Chr(34), iPosition:=2) Else clsRCorrelationFunction.RemoveParameterByName("use") @@ -825,6 +829,8 @@ Public Class dlgDescribeTwoVariable Else clsSummaryTableFunction.AddParameter("na_type", clsRFunctionParameter:=clsCombineFunction, iPosition:=9) End If + cmdMissingOptions.Visible = ucrChkOmitMissing.Checked + End Sub Private Sub ucrPnlDescribe_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlDescribe.ControlValueChanged @@ -952,7 +958,7 @@ Public Class dlgDescribeTwoVariable clsSummaryTableFunction.AddParameter("factors", "c(" & ucrReceiverSecondTwoVariableFactor.GetVariableNames & "," & ".x" & ")") clsSummaryTableFunction.AddParameter("columns_to_summarise", ".x") clsPivotWiderFunction.AddParameter("names_from", "{{ .x }}", iPosition:=1) - ElseIf IsFactorByNumeric Then + ElseIf IsFactorByNumeric() Then clsSummaryTableFunction.AddParameter("factors", ucrReceiverFirstVars.GetVariableNames) clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=1) clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverSecondTwoVariableFactor.GetVariableNames) @@ -1055,7 +1061,7 @@ Public Class dlgDescribeTwoVariable clsCombineAnova2Function.RemoveParameterByName("x") End If - ElseIf IsFactorByNumeric Then + ElseIf IsFactorByNumeric() Then If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then If ucrChkSwapXYVar.Checked Then clsCombineSwapAnova2Table.AddParameter("x", ucrReceiverSecondTwoVariableFactor.GetVariableNames(True), iPosition:=1, bIncludeArgumentName:=False) @@ -1120,7 +1126,7 @@ Public Class dlgDescribeTwoVariable Next End Sub - Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPercentageProportion.ControlValueChanged, + Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPercentageProportion.ControlValueChanged, ucrReceiverPercentages.ControlValueChanged, ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, ucrInputMarginName.ControlValueChanged If rdoTwoVariable.Checked Then If ucrChkDisplayAsPercentage.Checked Then From 57e4b7f16a45e0fcefdb26dc62bac5a5cba47ac8 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 13 May 2024 14:32:31 +0300 Subject: [PATCH 36/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 2 +- instat/dlgDescribeTwoVariable.vb | 26 +++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 7577142ad37..e2c17d23e32 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -600,7 +600,7 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverPercentages.AutoSize = True Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(427, 380) + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(429, 381) Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" Me.ucrReceiverPercentages.Selector = Nothing diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 51fa1ab4c1f..43688fa6488 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -127,20 +127,20 @@ Public Class dlgDescribeTwoVariable ucrInputMarginName.SetLinkedDisplayControl(lblMarginName) + ucrReceiverPercentages.SetParameter(New RParameter("perc_total_factors", 2)) + ucrReceiverPercentages.SetParameterIsString() + ucrReceiverPercentages.Selector = ucrSelectorDescribeTwoVar + ucrReceiverPercentages.SetDataType("factor") + ucrReceiverPercentages.SetLinkedDisplayControl(lblFactorAsPercentage) + ucrChkDisplayAsPercentage.SetParameter(New RParameter("percentage_type", 1)) ucrChkDisplayAsPercentage.SetText("As Percentages") ucrChkDisplayAsPercentage.SetValuesCheckedAndUnchecked(Chr(34) & "factors" & Chr(34), Chr(34) & "none" & Chr(34)) ucrChkDisplayAsPercentage.SetRDefault(Chr(34) & "none" & Chr(34)) - ucrChkDisplayAsPercentage.AddToLinkedControls(ucrReceiverPercentages, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrChkDisplayAsPercentage.AddToLinkedControls(ucrReceiverPercentages, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True) ucrChkDisplayAsPercentage.AddToLinkedControls(ucrChkPercentageProportion, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrReceiverPercentages.SetParameter(New RParameter("perc_total_factors", 2)) - ucrReceiverPercentages.SetParameterIsString() - ucrReceiverPercentages.Selector = ucrSelectorDescribeTwoVar - ucrReceiverPercentages.SetDataType("factor") - ucrReceiverPercentages.SetLinkedDisplayControl(lblFactorAsPercentage) - ucrChkPercentageProportion.SetParameter(New RParameter("perc_decimal", 3)) ucrChkPercentageProportion.SetText("Display as Decimal") ucrChkPercentageProportion.SetRDefault("FALSE") @@ -295,7 +295,6 @@ Public Class dlgDescribeTwoVariable clsCombineSwapAnova2Table.SetRCommand("c") - clsMappingFunction.SetPackageName("purrr") clsMappingFunction.SetRCommand("map") clsMappingFunction.AddParameter(".x", clsROperatorParameter:=clsYlistOperator, iPosition:=0) @@ -617,6 +616,7 @@ Public Class dlgDescribeTwoVariable ucrChkDisplayMargins.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactor() grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() + ucrReceiverPercentages.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False ucrChkOmitMissing.Visible = False @@ -869,7 +869,6 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() - 'SwappingXYVar() End Sub Private Sub ChangeLocations() @@ -1356,6 +1355,7 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() + AddingColumnFactor() End Sub Private Sub ucrReceiverThreeVariableSecondFactor_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThreeVariableSecondFactor.ControlValueChanged @@ -1500,4 +1500,12 @@ Public Class dlgDescribeTwoVariable ChangeBaseRCode() ChangeSumaryLabelText() End Sub + + Private Sub AddingColumnFactor() + If ucrReceiverFirstVars.lstSelectedVariables.Items.Count >= 1 Then + Dim iIndex = ucrReceiverFirstVars.lstSelectedVariables.Items.Count - 1 + ucrReceiverPercentages.Add(ucrReceiverFirstVars.lstSelectedVariables.Items(iIndex).Text) + ucrReceiverFirstVars.SetMeAsReceiver() + End If + End Sub End Class From 291aceecdfa762083e484edd1f9d2775881de7d0 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 16 May 2024 12:46:47 +0100 Subject: [PATCH 37/83] Change made --- instat/dlgSeasonalGraph.Designer.vb | 156 +++++++++++----------- instat/dlgSeasonalGraph.vb | 200 ++++++++++++++++------------ 2 files changed, 189 insertions(+), 167 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index 613d3df0522..a97db11e2be 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -27,7 +27,12 @@ Partial Class dlgSeasonalGraph Me.lblXvariable = New System.Windows.Forms.Label() Me.lblLines = New System.Windows.Forms.Label() Me.lblFacetBy = New System.Windows.Forms.Label() - Me.ucrReceiverAddPoint = New instat.ucrReceiverMultiple() + Me.lblFill = New System.Windows.Forms.Label() + Me.lblColour = New System.Windows.Forms.Label() + Me.ucrInputColour = New instat.ucrInputTextBox() + Me.ucrInputFill = New instat.ucrInputTextBox() + Me.ucrChkColour = New instat.ucrCheck() + Me.ucrChkFill = New instat.ucrCheck() Me.cmdOptions = New instat.ucrSplitButton() Me.ucrInputLegendPosition = New instat.ucrInputComboBox() Me.ucrInputStation = New instat.ucrInputComboBox() @@ -42,12 +47,7 @@ Partial Class dlgSeasonalGraph Me.ucrPnlOptions = New instat.UcrPanel() Me.ucrSelectorForSeasonalGraph = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.ucrChkFill = New instat.ucrCheck() - Me.ucrChkColour = New instat.ucrCheck() - Me.ucrInputFill = New instat.ucrInputTextBox() - Me.ucrInputColour = New instat.ucrInputTextBox() - Me.lblFill = New System.Windows.Forms.Label() - Me.lblColour = New System.Windows.Forms.Label() + Me.ucrChkAddpointRibbon = New instat.ucrCheck() Me.SuspendLayout() ' 'rdoBar @@ -120,18 +120,65 @@ Partial Class dlgSeasonalGraph Me.lblFacetBy.Tag = "" Me.lblFacetBy.Text = "Facet By (Optional):" ' - 'ucrReceiverAddPoint + 'lblFill + ' + Me.lblFill.AutoSize = True + Me.lblFill.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFill.Location = New System.Drawing.Point(14, 332) + Me.lblFill.Name = "lblFill" + Me.lblFill.Size = New System.Drawing.Size(41, 13) + Me.lblFill.TabIndex = 186 + Me.lblFill.Text = "Labels:" + ' + 'lblColour + ' + Me.lblColour.AutoSize = True + Me.lblColour.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblColour.Location = New System.Drawing.Point(14, 385) + Me.lblColour.Name = "lblColour" + Me.lblColour.Size = New System.Drawing.Size(41, 13) + Me.lblColour.TabIndex = 187 + Me.lblColour.Text = "Labels:" + ' + 'ucrInputColour + ' + Me.ucrInputColour.AddQuotesIfUnrecognised = True + Me.ucrInputColour.AutoSize = True + Me.ucrInputColour.IsMultiline = False + Me.ucrInputColour.IsReadOnly = False + Me.ucrInputColour.Location = New System.Drawing.Point(64, 381) + Me.ucrInputColour.Name = "ucrInputColour" + Me.ucrInputColour.Size = New System.Drawing.Size(205, 23) + Me.ucrInputColour.TabIndex = 185 + ' + 'ucrInputFill + ' + Me.ucrInputFill.AddQuotesIfUnrecognised = True + Me.ucrInputFill.AutoSize = True + Me.ucrInputFill.IsMultiline = False + Me.ucrInputFill.IsReadOnly = False + Me.ucrInputFill.Location = New System.Drawing.Point(64, 326) + Me.ucrInputFill.Name = "ucrInputFill" + Me.ucrInputFill.Size = New System.Drawing.Size(205, 23) + Me.ucrInputFill.TabIndex = 184 + ' + 'ucrChkColour + ' + Me.ucrChkColour.AutoSize = True + Me.ucrChkColour.Checked = False + Me.ucrChkColour.Location = New System.Drawing.Point(14, 356) + Me.ucrChkColour.Name = "ucrChkColour" + Me.ucrChkColour.Size = New System.Drawing.Size(147, 23) + Me.ucrChkColour.TabIndex = 22 + ' + 'ucrChkFill ' - Me.ucrReceiverAddPoint.AutoSize = True - Me.ucrReceiverAddPoint.frmParent = Me - Me.ucrReceiverAddPoint.Location = New System.Drawing.Point(319, 352) - Me.ucrReceiverAddPoint.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverAddPoint.Name = "ucrReceiverAddPoint" - Me.ucrReceiverAddPoint.Selector = Nothing - Me.ucrReceiverAddPoint.Size = New System.Drawing.Size(120, 75) - Me.ucrReceiverAddPoint.strNcFilePath = "" - Me.ucrReceiverAddPoint.TabIndex = 20 - Me.ucrReceiverAddPoint.ucrSelector = Nothing + Me.ucrChkFill.AutoSize = True + Me.ucrChkFill.Checked = False + Me.ucrChkFill.Location = New System.Drawing.Point(14, 301) + Me.ucrChkFill.Name = "ucrChkFill" + Me.ucrChkFill.Size = New System.Drawing.Size(147, 23) + Me.ucrChkFill.TabIndex = 21 ' 'cmdOptions ' @@ -192,9 +239,9 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkAddPoint.AutoSize = True Me.ucrChkAddPoint.Checked = False - Me.ucrChkAddPoint.Location = New System.Drawing.Point(319, 326) + Me.ucrChkAddPoint.Location = New System.Drawing.Point(13, 418) Me.ucrChkAddPoint.Name = "ucrChkAddPoint" - Me.ucrChkAddPoint.Size = New System.Drawing.Size(88, 23) + Me.ucrChkAddPoint.Size = New System.Drawing.Size(148, 23) Me.ucrChkAddPoint.TabIndex = 15 ' 'ucrReceiverX @@ -283,78 +330,27 @@ Partial Class dlgSeasonalGraph Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 19 ' - 'ucrChkFill - ' - Me.ucrChkFill.AutoSize = True - Me.ucrChkFill.Checked = False - Me.ucrChkFill.Location = New System.Drawing.Point(14, 301) - Me.ucrChkFill.Name = "ucrChkFill" - Me.ucrChkFill.Size = New System.Drawing.Size(147, 23) - Me.ucrChkFill.TabIndex = 21 - ' - 'ucrChkColour + 'ucrChkAddpointRibbon ' - Me.ucrChkColour.AutoSize = True - Me.ucrChkColour.Checked = False - Me.ucrChkColour.Location = New System.Drawing.Point(14, 370) - Me.ucrChkColour.Name = "ucrChkColour" - Me.ucrChkColour.Size = New System.Drawing.Size(147, 23) - Me.ucrChkColour.TabIndex = 22 - ' - 'ucrInputFill - ' - Me.ucrInputFill.AddQuotesIfUnrecognised = True - Me.ucrInputFill.AutoSize = True - Me.ucrInputFill.IsMultiline = False - Me.ucrInputFill.IsReadOnly = False - Me.ucrInputFill.Location = New System.Drawing.Point(64, 326) - Me.ucrInputFill.Name = "ucrInputFill" - Me.ucrInputFill.Size = New System.Drawing.Size(205, 23) - Me.ucrInputFill.TabIndex = 184 - ' - 'ucrInputColour - ' - Me.ucrInputColour.AddQuotesIfUnrecognised = True - Me.ucrInputColour.AutoSize = True - Me.ucrInputColour.IsMultiline = False - Me.ucrInputColour.IsReadOnly = False - Me.ucrInputColour.Location = New System.Drawing.Point(64, 395) - Me.ucrInputColour.Name = "ucrInputColour" - Me.ucrInputColour.Size = New System.Drawing.Size(205, 23) - Me.ucrInputColour.TabIndex = 185 - ' - 'lblFill - ' - Me.lblFill.AutoSize = True - Me.lblFill.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFill.Location = New System.Drawing.Point(14, 332) - Me.lblFill.Name = "lblFill" - Me.lblFill.Size = New System.Drawing.Size(41, 13) - Me.lblFill.TabIndex = 186 - Me.lblFill.Text = "Labels:" - ' - 'lblColour - ' - Me.lblColour.AutoSize = True - Me.lblColour.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblColour.Location = New System.Drawing.Point(14, 399) - Me.lblColour.Name = "lblColour" - Me.lblColour.Size = New System.Drawing.Size(41, 13) - Me.lblColour.TabIndex = 187 - Me.lblColour.Text = "Labels:" + Me.ucrChkAddpointRibbon.AutoSize = True + Me.ucrChkAddpointRibbon.Checked = False + Me.ucrChkAddpointRibbon.Location = New System.Drawing.Point(319, 332) + Me.ucrChkAddpointRibbon.Name = "ucrChkAddpointRibbon" + Me.ucrChkAddpointRibbon.Size = New System.Drawing.Size(148, 23) + Me.ucrChkAddpointRibbon.TabIndex = 188 ' 'dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(477, 604) + Me.Controls.Add(Me.ucrChkAddpointRibbon) Me.Controls.Add(Me.lblColour) Me.Controls.Add(Me.lblFill) Me.Controls.Add(Me.ucrInputColour) Me.Controls.Add(Me.ucrInputFill) Me.Controls.Add(Me.ucrChkColour) Me.Controls.Add(Me.ucrChkFill) - Me.Controls.Add(Me.ucrReceiverAddPoint) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.ucrInputLegendPosition) Me.Controls.Add(Me.ucrInputStation) @@ -404,11 +400,11 @@ Partial Class dlgSeasonalGraph Friend WithEvents ucrReceiverFacetBy As ucrReceiverSingle Friend WithEvents lblFacetBy As Label Friend WithEvents cmdOptions As ucrSplitButton - Friend WithEvents ucrReceiverAddPoint As ucrReceiverMultiple Friend WithEvents ucrChkColour As ucrCheck Friend WithEvents ucrChkFill As ucrCheck Friend WithEvents lblColour As Label Friend WithEvents lblFill As Label Friend WithEvents ucrInputColour As ucrInputTextBox Friend WithEvents ucrInputFill As ucrInputTextBox + Friend WithEvents ucrChkAddpointRibbon As ucrCheck End Class diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 2738afe1448..807746135d2 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -31,7 +31,6 @@ Public Class dlgSeasonalGraph Private clsGroupByFunction As New RFunction Private clsPipeOperator As New ROperator Private clsThemeFunction As New RFunction - Private clsNumericFunction As New RFunction Private clsLabsFunction As New RFunction Private clsXlabsFunction As New RFunction Private clsYlabFunction As New RFunction @@ -58,9 +57,10 @@ Public Class dlgSeasonalGraph 'Parameter names for geoms Private strFirstParameterName As String = "geomLine" Private strGeompointParameterName As String = "geom_point" + Private strGeompointParameterName1 As String = "geom_point" Private strgeomRibbonParameterName As String = "geom_ribbon" Private strgeomRibbonParameterName0 As String = "geom_ribbon" - Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName, strgeomRibbonParameterName0, strGeompointParameterName} + Private strGeomParameterNames() As String = {strFirstParameterName, strgeomRibbonParameterName, strgeomRibbonParameterName0, strGeompointParameterName, strGeompointParameterName1} Private Sub dlgSeasonalGraph_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -140,16 +140,13 @@ Public Class dlgSeasonalGraph ucrChkLegend.AddParameterPresentCondition(True, "legend.position") ucrChkLegend.AddParameterPresentCondition(False, "legend.position", False) - ucrChkAddPoint.SetText("Add point") + ucrChkAddPoint.SetText("Add point on Lines") ucrChkAddPoint.AddParameterValuesCondition(True, "checked", "True") ucrChkAddPoint.AddParameterValuesCondition(False, "checked", "False") - ucrChkAddPoint.AddToLinkedControls(ucrReceiverAddPoint, {True}, bNewLinkedHideIfParameterMissing:=True) - ucrReceiverAddPoint.SetParameter(New RParameter("y", 6)) - ucrReceiverAddPoint.Selector = ucrSelectorForSeasonalGraph - ucrReceiverAddPoint.strSelectorHeading = "Variables" - ucrReceiverAddPoint.SetParameterIsString() - ucrReceiverAddPoint.bWithQuotes = False + ucrChkAddpointRibbon.SetText("Add point on Ribbon") + ucrChkAddpointRibbon.AddParameterValuesCondition(True, "checked", "True") + ucrChkAddpointRibbon.AddParameterValuesCondition(False, "checked", "False") ucrChkFill.SetText("Fill Identity:") ucrChkFill.AddParameterValuesCondition(True, "checked", "True") @@ -181,7 +178,6 @@ Public Class dlgSeasonalGraph clsFacetFunction = New RFunction clsScalecolouridentityFunction = New RFunction clsScalefillidentityFunction = New RFunction - clsNumericFunction = New RFunction clsFacetOperator = New ROperator clsFacetRowOp = New ROperator clsFacetColOp = New ROperator @@ -224,8 +220,6 @@ Public Class dlgSeasonalGraph clsFacetOperator.bBrackets = False clsFacetFunction.AddParameter("facets", clsROperatorParameter:=clsFacetOperator, iPosition:=0) - clsNumericFunction.SetRCommand("as.numeric") - clsPipeOperator.SetOperation("%>%") SetPipeAssignTo() @@ -256,8 +250,6 @@ Public Class dlgSeasonalGraph End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrReceiverX.AddAdditionalCodeParameterPair(clsNumericFunction, New RParameter("x", 2), iAdditionalPairNo:=1) - ucrPnlOptions.SetRCode(clsDummyFunction, bReset) ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) ucrSave.SetRCode(clsBaseOperator, bReset) @@ -271,6 +263,7 @@ Public Class dlgSeasonalGraph ucrInputFill.SetRCode(clsScalefillidentityFunction, bReset) ucrChkRibbons.SetRCode(clsBaseOperator, bReset) ucrChkAddPoint.SetRCode(clsBaseOperator, bReset) + ucrChkAddpointRibbon.SetRCode(clsBaseOperator, bReset) AutoFacetStation() AutoFillmonth() End If @@ -298,76 +291,67 @@ Public Class dlgSeasonalGraph Dim i As Integer - ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 - Dim clsRaeslineFunction As New RFunction - Dim ColourArguments As New List(Of String) From {"grey", "grey", "black", "grey"} - Dim LinewidthArguments As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} - Dim GroupArguments As New List(Of String) From {"grey", "grey", "grey", "grey"} - - clsRaeslineFunction.SetPackageName("ggplot2") - clsRaeslineFunction.SetRCommand("aes") - clsRaeslineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) - clsRaeslineFunction.AddParameter("colour", Chr(34) & ColourArguments(i) & Chr(34), iPosition:=1) - - Dim clsGeomLineFunction As New RFunction - clsGeomLineFunction.SetPackageName("ggplot2") - clsGeomLineFunction.SetRCommand("geom_line") - clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaeslineFunction, iPosition:=1) - clsGeomLineFunction.AddParameter("linewidth", LinewidthArguments(i), iPosition:=2) - clsGeomLineFunction.AddParameter("group", Chr(34) & GroupArguments(i) & Chr(34), iPosition:=3) - - ' Add geom_line function to the base operator - clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) - clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) - clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) - Next - - ' Add geom_point functions for ucrReceiverAddPoint.lstSelectedVariables - For i = 0 To ucrReceiverAddPoint.lstSelectedVariables.Items.Count - 1 - Dim clsAesGeompointFunction As New RFunction - clsAesGeompointFunction.SetPackageName("ggplot2") - clsAesGeompointFunction.SetRCommand("aes") - clsAesGeompointFunction.AddParameter("y", ucrReceiverAddPoint.lstSelectedVariables.Items(i).Text, iPosition:=0) - - Dim clsGeomPointFunction As New RFunction - clsGeomPointFunction.SetPackageName("ggplot2") - clsGeomPointFunction.SetRCommand("geom_point") - clsGeomPointFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction, iPosition:=1) - - ' Add geom_point function to the base operator - clsBaseOperator.AddParameter(strGeompointParameterName & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=8) - Next - - ' Add geom_ribbon functions for ucrReceiverRibbons.lstSelectedVariables - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 - ' Get current variable - Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text - ' Get the next variable in the pair if available - Dim var2 As String = If(i + 1 < ucrReceiverRibbons.lstSelectedVariables.Items.Count, ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text, "") - Dim fillArguments As New List(Of String) From {"#3270C1", "#A3A3A3", "#4DB0F1", "#FF5733"} - - If Not String.IsNullOrEmpty(var2) Then - Dim clsRaesRibFunction As New RFunction - clsRaesRibFunction.SetPackageName("ggplot2") - clsRaesRibFunction.SetRCommand("aes") - clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) - clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) - clsRaesRibFunction.AddParameter("fill", Chr(34) & fillArguments(i) & Chr(34), iPosition:=2) - - Dim clsRibFunction As New RFunction - clsRibFunction.SetPackageName("ggplot2") - clsRibFunction.SetRCommand("geom_ribbon") - clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) - - clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) - End If - Next + If Not ucrReceiverLines.IsEmpty Then + ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + Dim clsRaeslineFunction As New RFunction + Dim ColourArguments As New List(Of String) From {"grey", "grey", "black", "grey"} + Dim LinewidthArguments As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} + Dim GroupArguments As New List(Of String) From {"grey", "grey", "grey", "grey"} + + clsRaeslineFunction.SetPackageName("ggplot2") + clsRaeslineFunction.SetRCommand("aes") + clsRaeslineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) + clsRaeslineFunction.AddParameter("colour", Chr(34) & ColourArguments(i) & Chr(34), iPosition:=1) + + Dim clsGeomLineFunction As New RFunction + clsGeomLineFunction.SetPackageName("ggplot2") + clsGeomLineFunction.SetRCommand("geom_line") + clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaeslineFunction, iPosition:=1) + clsGeomLineFunction.AddParameter("linewidth", LinewidthArguments(i), iPosition:=2) + clsGeomLineFunction.AddParameter("group", Chr(34) & GroupArguments(i) & Chr(34), iPosition:=3) + + ' Add geom_line function to the base operator + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) + Next + Else + clsBaseOperator.RemoveParameterByName(strFirstParameterName) + End If + If ucrChkRibbons.Checked AndAlso Not ucrReceiverRibbons.IsEmpty Then + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 + ' Get current variable + Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text + ' Get the next variable in the pair if available + Dim var2 As String = If(i + 1 < ucrReceiverRibbons.lstSelectedVariables.Items.Count, ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text, "") + Dim fillArguments As New List(Of String) From {"#3270C1", "#A3A3A3", "#4DB0F1", "#FF5733"} + + If Not String.IsNullOrEmpty(var2) Then + Dim clsRaesRibFunction As New RFunction + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) + clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) + clsRaesRibFunction.AddParameter("fill", Chr(34) & fillArguments(i) & Chr(34), iPosition:=2) + + Dim clsRibFunction As New RFunction + clsRibFunction.SetPackageName("ggplot2") + clsRibFunction.SetRCommand("geom_ribbon") + clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) + + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) + End If + Next + Else + clsBaseOperator.RemoveParameterByName(strgeomRibbonParameterName0) + End If AddRemoveFacets() AddRemoveGroupBy() End Sub - Private Sub UpdateParameters() clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) @@ -536,6 +520,7 @@ Public Class dlgSeasonalGraph Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() + Points() End Sub Private Sub AddRemoveTheme() @@ -575,6 +560,7 @@ Public Class dlgSeasonalGraph Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged ListGeomLine() + Ribbon() If ucrChkRibbons.Checked Then ucrReceiverRibbons.SetMeAsReceiver() Else @@ -582,7 +568,7 @@ Public Class dlgSeasonalGraph End If End Sub - Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged, ucrReceiverAddPoint.ControlContentsChanged + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub @@ -592,23 +578,59 @@ Public Class dlgSeasonalGraph variableNames = variableNames.Replace("'", "").Replace("""", "") If Not ucrReceiverX.IsEmpty AndAlso (ucrReceiverX.strCurrDataType.Contains("factor") OrElse ucrReceiverX.strCurrDataType = "ordered,factor") Then - clsNumericFunction.AddParameter("x", variableNames, iPosition:=0, bIncludeArgumentName:=False) - clsRaesFunction.AddParameter("x", clsRFunctionParameter:=clsNumericFunction) clsRaesFunction.AddParameter("group", "1", iPosition:=3) Else clsRaesFunction.RemoveParameterByName("group") - 'clsRaesFunction.AddParameter("x", ucrReceiverX.GetVariableNames().Trim()) clsRaesFunction.AddParameter("x", variableNames) End If End Sub - Private Sub ucrChkAddPoint_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddPoint.ControlValueChanged, ucrReceiverAddPoint.ControlValueChanged + Private Sub Ribbon() + If ucrChkAddpointRibbon.Checked Then + ' Iterate over each parameter in the list + For Each selectedItem As ListViewItem In ucrReceiverRibbons.lstSelectedVariables.Items + Dim clsAesGeompointFunction1 As New RFunction + clsAesGeompointFunction1.SetPackageName("ggplot2") + clsAesGeompointFunction1.SetRCommand("aes") + clsAesGeompointFunction1.AddParameter("y", selectedItem.Text, iPosition:=0) + + Dim clsGeomPointFunction1 As New RFunction + clsGeomPointFunction1.SetPackageName("ggplot2") + clsGeomPointFunction1.SetRCommand("geom_point") + clsGeomPointFunction1.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction1, iPosition:=1) + + ' Add geom_point function to the base operator with a unique parameter name + clsBaseOperator.AddParameter(strGeompointParameterName1 & ucrReceiverRibbons.lstSelectedVariables.Items.IndexOf(selectedItem), clsRFunctionParameter:=clsGeomPointFunction1, iPosition:=11) + Next + Else + ' If checkbox is unchecked, remove the parameters + clsBaseOperator.RemoveParameterByName(strGeompointParameterName1) + End If + End Sub + + Private Sub Points() If ucrChkAddPoint.Checked Then - ucrReceiverAddPoint.SetMeAsReceiver() + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + Dim clsAesGeompointFunction As New RFunction + clsAesGeompointFunction.SetPackageName("ggplot2") + clsAesGeompointFunction.SetRCommand("aes") + clsAesGeompointFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) + + Dim clsGeomPointFunction As New RFunction + clsGeomPointFunction.SetPackageName("ggplot2") + clsGeomPointFunction.SetRCommand("geom_point") + clsGeomPointFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction, iPosition:=1) + + ' Add geom_point function to the base operator + clsBaseOperator.AddParameter(strGeompointParameterName & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=8) + Next Else clsBaseOperator.RemoveParameterByName(strGeompointParameterName) End If - ListGeomLine() + End Sub + + Private Sub ucrChkAddPoint_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddPoint.ControlValueChanged + Points() End Sub Private Sub ucrChkFill_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkFill.ControlValueChanged, ucrChkColour.ControlValueChanged, ucrInputFill.ControlValueChanged, ucrInputColour.ControlValueChanged @@ -625,4 +647,8 @@ Public Class dlgSeasonalGraph clsBaseOperator.RemoveParameterByName("scale_colour_identity") End If End Sub + + Private Sub ucrChkAddpointRibbon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddpointRibbon.ControlValueChanged + Ribbon() + End Sub End Class \ No newline at end of file From d3aaa015b39b729e76f61ad4b0651c7893e2f965 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 16 May 2024 12:51:33 +0100 Subject: [PATCH 38/83] change made --- instat/dlgSeasonalGraph.Designer.vb | 38 ++++++++++++++--------------- instat/dlgSeasonalGraph.vb | 8 ++++++ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index a97db11e2be..e19e4f2ab8a 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -29,6 +29,7 @@ Partial Class dlgSeasonalGraph Me.lblFacetBy = New System.Windows.Forms.Label() Me.lblFill = New System.Windows.Forms.Label() Me.lblColour = New System.Windows.Forms.Label() + Me.ucrChkAddpointRibbon = New instat.ucrCheck() Me.ucrInputColour = New instat.ucrInputTextBox() Me.ucrInputFill = New instat.ucrInputTextBox() Me.ucrChkColour = New instat.ucrCheck() @@ -47,7 +48,6 @@ Partial Class dlgSeasonalGraph Me.ucrPnlOptions = New instat.UcrPanel() Me.ucrSelectorForSeasonalGraph = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.ucrChkAddpointRibbon = New instat.ucrCheck() Me.SuspendLayout() ' 'rdoBar @@ -113,7 +113,7 @@ Partial Class dlgSeasonalGraph ' Me.lblFacetBy.AutoSize = True Me.lblFacetBy.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFacetBy.Location = New System.Drawing.Point(260, 444) + Me.lblFacetBy.Location = New System.Drawing.Point(260, 417) Me.lblFacetBy.Name = "lblFacetBy" Me.lblFacetBy.Size = New System.Drawing.Size(100, 13) Me.lblFacetBy.TabIndex = 8 @@ -140,6 +140,15 @@ Partial Class dlgSeasonalGraph Me.lblColour.TabIndex = 187 Me.lblColour.Text = "Labels:" ' + 'ucrChkAddpointRibbon + ' + Me.ucrChkAddpointRibbon.AutoSize = True + Me.ucrChkAddpointRibbon.Checked = False + Me.ucrChkAddpointRibbon.Location = New System.Drawing.Point(319, 381) + Me.ucrChkAddpointRibbon.Name = "ucrChkAddpointRibbon" + Me.ucrChkAddpointRibbon.Size = New System.Drawing.Size(148, 23) + Me.ucrChkAddpointRibbon.TabIndex = 188 + ' 'ucrInputColour ' Me.ucrInputColour.AddQuotesIfUnrecognised = True @@ -197,7 +206,7 @@ Partial Class dlgSeasonalGraph Me.ucrInputLegendPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputLegendPosition.GetSetSelectedIndex = -1 Me.ucrInputLegendPosition.IsReadOnly = False - Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 458) + Me.ucrInputLegendPosition.Location = New System.Drawing.Point(119, 431) Me.ucrInputLegendPosition.Name = "ucrInputLegendPosition" Me.ucrInputLegendPosition.Size = New System.Drawing.Size(82, 21) Me.ucrInputLegendPosition.TabIndex = 18 @@ -208,7 +217,7 @@ Partial Class dlgSeasonalGraph Me.ucrInputStation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputStation.GetSetSelectedIndex = -1 Me.ucrInputStation.IsReadOnly = False - Me.ucrInputStation.Location = New System.Drawing.Point(386, 458) + Me.ucrInputStation.Location = New System.Drawing.Point(386, 431) Me.ucrInputStation.Name = "ucrInputStation" Me.ucrInputStation.Size = New System.Drawing.Size(82, 21) Me.ucrInputStation.TabIndex = 10 @@ -217,7 +226,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrReceiverFacetBy.AutoSize = True Me.ucrReceiverFacetBy.frmParent = Me - Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 459) + Me.ucrReceiverFacetBy.Location = New System.Drawing.Point(259, 432) Me.ucrReceiverFacetBy.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFacetBy.Name = "ucrReceiverFacetBy" Me.ucrReceiverFacetBy.Selector = Nothing @@ -239,7 +248,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkAddPoint.AutoSize = True Me.ucrChkAddPoint.Checked = False - Me.ucrChkAddPoint.Location = New System.Drawing.Point(13, 418) + Me.ucrChkAddPoint.Location = New System.Drawing.Point(319, 331) Me.ucrChkAddPoint.Name = "ucrChkAddPoint" Me.ucrChkAddPoint.Size = New System.Drawing.Size(148, 23) Me.ucrChkAddPoint.TabIndex = 15 @@ -286,7 +295,7 @@ Partial Class dlgSeasonalGraph 'ucrSave ' Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSave.Location = New System.Drawing.Point(13, 499) + Me.ucrSave.Location = New System.Drawing.Point(13, 472) Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSave.Name = "ucrSave" Me.ucrSave.Size = New System.Drawing.Size(451, 24) @@ -296,7 +305,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkLegend.AutoSize = True Me.ucrChkLegend.Checked = False - Me.ucrChkLegend.Location = New System.Drawing.Point(13, 459) + Me.ucrChkLegend.Location = New System.Drawing.Point(13, 432) Me.ucrChkLegend.Name = "ucrChkLegend" Me.ucrChkLegend.Size = New System.Drawing.Size(88, 23) Me.ucrChkLegend.TabIndex = 17 @@ -325,25 +334,16 @@ Partial Class dlgSeasonalGraph ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(22, 544) + Me.ucrBase.Location = New System.Drawing.Point(22, 517) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 19 ' - 'ucrChkAddpointRibbon - ' - Me.ucrChkAddpointRibbon.AutoSize = True - Me.ucrChkAddpointRibbon.Checked = False - Me.ucrChkAddpointRibbon.Location = New System.Drawing.Point(319, 332) - Me.ucrChkAddpointRibbon.Name = "ucrChkAddpointRibbon" - Me.ucrChkAddpointRibbon.Size = New System.Drawing.Size(148, 23) - Me.ucrChkAddpointRibbon.TabIndex = 188 - ' 'dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(477, 604) + Me.ClientSize = New System.Drawing.Size(477, 573) Me.Controls.Add(Me.ucrChkAddpointRibbon) Me.Controls.Add(Me.lblColour) Me.Controls.Add(Me.lblFill) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 807746135d2..533ce0b0d73 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -651,4 +651,12 @@ Public Class dlgSeasonalGraph Private Sub ucrChkAddpointRibbon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddpointRibbon.ControlValueChanged Ribbon() End Sub + + Private Sub ucrInput_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputStation.ControlValueChanged + + End Sub + + Private Sub AllControl_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSave.ControlContentsChanged, ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged + + End Sub End Class \ No newline at end of file From 23fbb96dbf5a630b82dd66abfc5ee60f3150edd0 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 16 May 2024 13:24:24 +0100 Subject: [PATCH 39/83] Change made --- instat/dlgSeasonalGraph.vb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 533ce0b0d73..3ae598b7a7d 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -116,7 +116,7 @@ Public Class dlgSeasonalGraph ucrReceiverRibbons.bWithQuotes = False ucrReceiverRibbons.iMaxItems = 4 - ucrReceiverFacetBy.SetParameter(New RParameter("")) + ucrReceiverFacetBy.SetParameter(New RParameter("var1")) ucrReceiverFacetBy.Selector = ucrSelectorForSeasonalGraph ucrReceiverFacetBy.SetIncludedDataTypes({"factor"}) ucrReceiverFacetBy.strSelectorHeading = "Factors" @@ -353,7 +353,7 @@ Public Class dlgSeasonalGraph End Sub Private Sub UpdateParameters() - clsFacetOperator.RemoveParameterByName("wrap" & ucrInputStation.Name) + clsFacetOperator.RemoveParameterByName("var1") clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) clsFacetRowOp.RemoveParameterByName("row" & ucrInputStation.Name) @@ -362,7 +362,7 @@ Public Class dlgSeasonalGraph ucrReceiverFacetBy.SetRCode(Nothing) Select Case ucrInputStation.GetText() Case strFacetWrap - ucrReceiverFacetBy.ChangeParameterName("wrap" & ucrInputStation.Name) + ucrReceiverFacetBy.ChangeParameterName("var1") ucrReceiverFacetBy.SetRCode(clsFacetOperator) Case strFacetCol ucrReceiverFacetBy.ChangeParameterName("col" & ucrInputStation.Name) @@ -552,7 +552,7 @@ Public Class dlgSeasonalGraph clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction, clsNewThemeFunction:=clsThemeFunction, dctNewThemeFunctions:=dctThemeFunctions, clsNewGlobalAesFunction:=clsRaesFunction, ucrNewBaseSelector:=ucrSelectorForSeasonalGraph, clsNewCoordPolarFunction:=clsCoordPolarFunction, clsNewCoordPolarStartOperator:=clsCoordPolarStartOperator, clsNewXScaleDateFunction:=clsXScaleDateFunction, clsNewAnnotateFunction:=clsAnnotateFunction, - clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, + clsNewScaleFillViridisFunction:=clsScaleFillViridisFunction, clsNewScaleColourViridisFunction:=clsScaleColourViridisFunction, clsNewYScaleDateFunction:=clsYScaleDateFunction, clsNewFacetVariablesOperator:=clsFacetOperator, strMainDialogGeomParameterNames:=strGeomParameterNames, bReset:=bResetSubdialog) sdgPlots.ShowDialog() bResetSubdialog = False @@ -651,12 +651,4 @@ Public Class dlgSeasonalGraph Private Sub ucrChkAddpointRibbon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddpointRibbon.ControlValueChanged Ribbon() End Sub - - Private Sub ucrInput_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputStation.ControlValueChanged - - End Sub - - Private Sub AllControl_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSave.ControlContentsChanged, ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged - - End Sub End Class \ No newline at end of file From 3d3f3acb149c0772b7c1426dd91cb74b33056451 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Fri, 17 May 2024 12:08:42 +0300 Subject: [PATCH 40/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 152 ++++++++++++++-------- instat/dlgDescribeTwoVariable.vb | 49 ++++++- 2 files changed, 138 insertions(+), 63 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index e2c17d23e32..203ab99a5b5 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,14 +60,17 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() - Me.ucrChkPercentageProportion = New instat.ucrCheck() - Me.lblFactorAsPercentage = New System.Windows.Forms.Label() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() + Me.rdoOCol = New System.Windows.Forms.RadioButton() + Me.rdoOCell = New System.Windows.Forms.RadioButton() + Me.rdoORow = New System.Windows.Forms.RadioButton() + Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() + Me.ucrChkPercentageProportion = New instat.ucrCheck() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrBase = New instat.ucrButtons() @@ -76,13 +79,13 @@ Partial Class dlgDescribeTwoVariable Me.ucrPnlDescribe = New instat.UcrPanel() Me.ucrReceiverSkimrGroupByFactor = New instat.ucrReceiverSingle() Me.ucrChkSummariesRowCol = New instat.ucrCheck() - Me.ucrChkOmitMissing = New instat.ucrCheck() Me.ucrChkMeans = New instat.ucrCheck() Me.ucrChkDisplayMargins = New instat.ucrCheck() Me.ucrChkSwapXYVar = New instat.ucrCheck() Me.ucrChkCorrelations = New instat.ucrCheck() Me.ucrChkLevSig = New instat.ucrCheck() - Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() + Me.ucrChkOmitMissing = New instat.ucrCheck() + Me.ucrpnlPercent = New instat.UcrPanel() Me.grpSummaries.SuspendLayout() Me.grpDisplay.SuspendLayout() Me.SuspendLayout() @@ -344,7 +347,6 @@ Partial Class dlgDescribeTwoVariable 'grpDisplay ' Me.grpDisplay.Controls.Add(Me.ucrChkPercentageProportion) - Me.grpDisplay.Controls.Add(Me.lblFactorAsPercentage) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) Me.grpDisplay.Location = New System.Drawing.Point(412, 308) Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4) @@ -355,36 +357,51 @@ Partial Class dlgDescribeTwoVariable Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' - 'ucrChkPercentageProportion + 'rdoOCol + ' + Me.rdoOCol.AutoSize = True + Me.rdoOCol.Location = New System.Drawing.Point(451, 365) + Me.rdoOCol.Name = "rdoOCol" + Me.rdoOCol.Size = New System.Drawing.Size(69, 24) + Me.rdoOCol.TabIndex = 40 + Me.rdoOCol.TabStop = True + Me.rdoOCol.Text = "OCol" + Me.rdoOCol.UseVisualStyleBackColor = True + ' + 'rdoOCell + ' + Me.rdoOCell.AutoSize = True + Me.rdoOCell.Location = New System.Drawing.Point(607, 364) + Me.rdoOCell.Name = "rdoOCell" + Me.rdoOCell.Size = New System.Drawing.Size(72, 24) + Me.rdoOCell.TabIndex = 41 + Me.rdoOCell.TabStop = True + Me.rdoOCell.Text = "OCell" + Me.rdoOCell.UseVisualStyleBackColor = True + ' + 'rdoORow + ' + Me.rdoORow.AutoSize = True + Me.rdoORow.Location = New System.Drawing.Point(525, 365) + Me.rdoORow.Name = "rdoORow" + Me.rdoORow.Size = New System.Drawing.Size(78, 24) + Me.rdoORow.TabIndex = 42 + Me.rdoORow.TabStop = True + Me.rdoORow.Text = "ORow" + Me.rdoORow.UseVisualStyleBackColor = True ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 115) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(190, 51) - Me.ucrChkPercentageProportion.TabIndex = 57 - ' - 'lblFactorAsPercentage - ' - Me.lblFactorAsPercentage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFactorAsPercentage.Location = New System.Drawing.Point(14, 48) - Me.lblFactorAsPercentage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) - Me.lblFactorAsPercentage.Name = "lblFactorAsPercentage" - Me.lblFactorAsPercentage.Size = New System.Drawing.Size(231, 22) - Me.lblFactorAsPercentage.TabIndex = 2 - Me.lblFactorAsPercentage.Tag = "" - Me.lblFactorAsPercentage.Text = "Factor as Percentage:" - ' - 'ucrChkDisplayAsPercentage + 'ucrReceiverPercentages ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(142, 51) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 + Me.ucrReceiverPercentages.AutoSize = True + Me.ucrReceiverPercentages.frmParent = Me + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(429, 401) + Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" + Me.ucrReceiverPercentages.Selector = Nothing + Me.ucrReceiverPercentages.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverPercentages.strNcFilePath = "" + Me.ucrReceiverPercentages.TabIndex = 39 + Me.ucrReceiverPercentages.ucrSelector = Nothing ' 'ucrReceiverThreeVariableSecondFactor ' @@ -447,6 +464,26 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) Me.ucrSaveTable.TabIndex = 24 ' + 'ucrChkPercentageProportion + ' + Me.ucrChkPercentageProportion.AutoSize = True + Me.ucrChkPercentageProportion.Checked = False + Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 129) + Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" + Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(209, 34) + Me.ucrChkPercentageProportion.TabIndex = 57 + ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(171, 34) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 + ' 'ucrInputMarginName ' Me.ucrInputMarginName.AddQuotesIfUnrecognised = True @@ -536,16 +573,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkSummariesRowCol.Size = New System.Drawing.Size(270, 34) Me.ucrChkSummariesRowCol.TabIndex = 20 ' - 'ucrChkOmitMissing - ' - Me.ucrChkOmitMissing.AutoSize = True - Me.ucrChkOmitMissing.Checked = False - Me.ucrChkOmitMissing.Location = New System.Drawing.Point(450, 383) - Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" - Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) - Me.ucrChkOmitMissing.TabIndex = 0 - ' 'ucrChkMeans ' Me.ucrChkMeans.AutoSize = True @@ -596,18 +623,24 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkLevSig.Size = New System.Drawing.Size(129, 34) Me.ucrChkLevSig.TabIndex = 38 ' - 'ucrReceiverPercentages + 'ucrChkOmitMissing ' - Me.ucrReceiverPercentages.AutoSize = True - Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(429, 381) - Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" - Me.ucrReceiverPercentages.Selector = Nothing - Me.ucrReceiverPercentages.Size = New System.Drawing.Size(180, 30) - Me.ucrReceiverPercentages.strNcFilePath = "" - Me.ucrReceiverPercentages.TabIndex = 39 - Me.ucrReceiverPercentages.ucrSelector = Nothing + Me.ucrChkOmitMissing.AutoSize = True + Me.ucrChkOmitMissing.Checked = False + Me.ucrChkOmitMissing.Location = New System.Drawing.Point(450, 383) + Me.ucrChkOmitMissing.Margin = New System.Windows.Forms.Padding(9) + Me.ucrChkOmitMissing.Name = "ucrChkOmitMissing" + Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) + Me.ucrChkOmitMissing.TabIndex = 0 + ' + 'ucrpnlPercent + ' + Me.ucrpnlPercent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrpnlPercent.Location = New System.Drawing.Point(432, 352) + Me.ucrpnlPercent.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrpnlPercent.Name = "ucrpnlPercent" + Me.ucrpnlPercent.Size = New System.Drawing.Size(260, 46) + Me.ucrpnlPercent.TabIndex = 43 ' 'dlgDescribeTwoVariable ' @@ -615,6 +648,10 @@ Partial Class dlgDescribeTwoVariable Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ClientSize = New System.Drawing.Size(723, 748) + Me.Controls.Add(Me.rdoORow) + Me.Controls.Add(Me.rdoOCell) + Me.Controls.Add(Me.rdoOCol) + Me.Controls.Add(Me.ucrpnlPercent) Me.Controls.Add(Me.ucrReceiverPercentages) Me.Controls.Add(Me.ucrReceiverThreeVariableSecondFactor) Me.Controls.Add(Me.ucrReceiverSecondTwoVariableFactor) @@ -701,7 +738,6 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents ucrChkDisplayMargins As ucrCheck Friend WithEvents grpDisplay As GroupBox Friend WithEvents ucrChkPercentageProportion As ucrCheck - Friend WithEvents lblFactorAsPercentage As Label Friend WithEvents ucrChkDisplayAsPercentage As ucrCheck Friend WithEvents ucrSaveTable As ucrSave Friend WithEvents ucrReceiverFirstVars As ucrReceiverMultiple @@ -711,4 +747,8 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents ucrChkMeans As ucrCheck Friend WithEvents ucrChkLevSig As ucrCheck Friend WithEvents ucrReceiverPercentages As ucrReceiverSingle + Friend WithEvents rdoORow As RadioButton + Friend WithEvents rdoOCell As RadioButton + Friend WithEvents rdoOCol As RadioButton + Friend WithEvents ucrpnlPercent As UcrPanel End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 43688fa6488..a886cfccb60 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -131,7 +131,7 @@ Public Class dlgDescribeTwoVariable ucrReceiverPercentages.SetParameterIsString() ucrReceiverPercentages.Selector = ucrSelectorDescribeTwoVar ucrReceiverPercentages.SetDataType("factor") - ucrReceiverPercentages.SetLinkedDisplayControl(lblFactorAsPercentage) + 'ucrReceiverPercentages.SetLinkedDisplayControl(lblFactorAsPercentage) ucrChkDisplayAsPercentage.SetParameter(New RParameter("percentage_type", 1)) ucrChkDisplayAsPercentage.SetText("As Percentages") @@ -139,7 +139,7 @@ Public Class dlgDescribeTwoVariable ucrChkDisplayAsPercentage.SetRDefault(Chr(34) & "none" & Chr(34)) ucrChkDisplayAsPercentage.AddToLinkedControls(ucrReceiverPercentages, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True) - ucrChkDisplayAsPercentage.AddToLinkedControls(ucrChkPercentageProportion, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrChkDisplayAsPercentage.AddToLinkedControls({ucrChkPercentageProportion, ucrpnlPercent}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkPercentageProportion.SetParameter(New RParameter("perc_decimal", 3)) ucrChkPercentageProportion.SetText("Display as Decimal") @@ -175,6 +175,13 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddParameterValuesCondition(rdoSkim, "checked", "skim") ucrPnlDescribe.AddParameterValuesCondition(rdoThreeVariable, "checked", "three_variable") 'rdoThreeVariable.Enabled = False + ucrpnlPercent.AddRadioButton(rdoOCol) + ucrpnlPercent.AddRadioButton(rdoORow) + ucrpnlPercent.AddRadioButton(rdoOCell) + ucrpnlPercent.AddParameterValuesCondition(rdoOCol, "percent", "col") + ucrpnlPercent.AddParameterValuesCondition(rdoORow, "percent", "row") + ucrpnlPercent.AddParameterValuesCondition(rdoOCell, "percent", "cell") + 'ucrpnlPercent.SetLinkedDisplayControl(grpDisplay) ucrPnlDescribe.AddToLinkedControls({ucrReceiverSkimrGroupByFactor, ucrReceiverSecondSkimrGroupByFactor}, {rdoSkim}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableThirdVariable}, {rdoThreeVariable}, bNewLinkedHideIfParameterMissing:=True) @@ -273,6 +280,7 @@ Public Class dlgDescribeTwoVariable clsDummyFunction.AddParameter("row_sum", "False", iPosition:=3) clsDummyFunction.AddParameter("corr", "False", iPosition:=4) clsDummyFunction.AddParameter("var", "False", iPosition:=5) + clsDummyFunction.AddParameter("percent", "col", iPosition:=6) clsPivotWiderFunction.SetRCommand("pivot_wider") clsPivotWiderFunction.AddParameter("values_from", "value", iPosition:=2) @@ -516,6 +524,7 @@ Public Class dlgDescribeTwoVariable ucrReceiverPercentages.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrChkPercentageProportion.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrPnlDescribe.SetRCode(clsDummyFunction, bReset) + ucrpnlPercent.SetRCode(clsDummyFunction, bReset) ucrChkSummariesRowCol.SetRCode(clsDummyFunction, bReset) ucrChkCorrelations.SetRCode(clsDummyFunction, bReset) ucrChkSwapXYVar.SetRCode(clsDummyFunction, bReset) @@ -617,15 +626,18 @@ Public Class dlgDescribeTwoVariable ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactor() grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrReceiverPercentages.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() + ucrpnlPercent.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False ucrChkOmitMissing.Visible = False cmdMissingOptions.Visible = False + If rdoTwoVariable.Checked Then ucrChkOmitMissing.Visible = IsNumericByNumeric() OrElse IsNumericByFactor() ucrChkSwapXYVar.Visible = IsNumericByNumeric() OrElse IsFactorByNumeric() ucrChkCorrelations.Visible = IsNumericByNumeric() cmdMissingOptions.Visible = ucrChkOmitMissing.Checked + ElseIf rdoThreeVariable.Checked Then ucrChkOmitMissing.Visible = IsFactorByNumeric() OrElse IsNumericByFactor() Else @@ -1126,7 +1138,7 @@ Public Class dlgDescribeTwoVariable End Sub Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPercentageProportion.ControlValueChanged, ucrReceiverPercentages.ControlValueChanged, - ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, ucrInputMarginName.ControlValueChanged + ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, ucrInputMarginName.ControlValueChanged, ucrpnlPercent.ControlValueChanged If rdoTwoVariable.Checked Then If ucrChkDisplayAsPercentage.Checked Then ucrReceiverPercentages.SetMeAsReceiver() @@ -1145,6 +1157,7 @@ Public Class dlgDescribeTwoVariable End If FactorColumns() AddRemoveFrequencyParameters() + AddingColumnFactor() End Sub Private Sub ucrSelectorDescribeTwoVar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorDescribeTwoVar.ControlValueChanged @@ -1280,6 +1293,7 @@ Public Class dlgDescribeTwoVariable FactorColumns() AddRemoveFirstAnova2Param() AddRemoveSecondAnovaParam() + AddingColumnFactor() End Sub Private Sub ChangeFirstTypeLabel() @@ -1502,10 +1516,31 @@ Public Class dlgDescribeTwoVariable End Sub Private Sub AddingColumnFactor() - If ucrReceiverFirstVars.lstSelectedVariables.Items.Count >= 1 Then - Dim iIndex = ucrReceiverFirstVars.lstSelectedVariables.Items.Count - 1 - ucrReceiverPercentages.Add(ucrReceiverFirstVars.lstSelectedVariables.Items(iIndex).Text) - ucrReceiverFirstVars.SetMeAsReceiver() + If rdoOCol.Checked Then + If ucrReceiverFirstVars.lstSelectedVariables.Items.Count >= 1 Then + Dim iIndex = ucrReceiverFirstVars.lstSelectedVariables.Items.Count - 1 + ucrReceiverPercentages.Add(ucrReceiverFirstVars.lstSelectedVariables.Items(iIndex).Text) + ucrReceiverFirstVars.SetMeAsReceiver() + End If + ElseIf rdoORow.Checked Then + If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then + ucrReceiverPercentages.Add(ucrReceiverSecondTwoVariableFactor.GetVariableNames(False)) + ucrReceiverSecondTwoVariableFactor.SetMeAsReceiver() + End If + Else + ucrReceiverPercentages.Clear() + End If + + End Sub + + Private Sub ucrpnlPercent_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrpnlPercent.ControlValueChanged + AddingColumnFactor() + If rdoOCol.Checked Then + clsDummyFunction.AddParameter("percent", "col", iPosition:=6) + ElseIf rdoORow.Checked Then + clsDummyFunction.AddParameter("percent", "row", iPosition:=6) + Else + clsDummyFunction.AddParameter("percent", "cell", iPosition:=6) End If End Sub End Class From 10ee3d91e8bcd6f1c08e921a80db0926bb23ec2b Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Fri, 17 May 2024 13:03:27 +0300 Subject: [PATCH 41/83] changes to the code --- instat/dlgDescribeTwoVariable.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index a886cfccb60..9067333011e 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -188,6 +188,8 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddToLinkedControls({ucrReceiverSecondTwoVariableFactor, ucrChkSummariesRowCol}, {rdoTwoVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableSecondFactor}, {rdoThreeVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrpnlPercent.AddToLinkedControls({ucrReceiverPercentages}, {rdoOCol, rdoORow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrReceiverThreeVariableSecondFactor.SetParameter(New RParameter("second_three_varible_factor", 0, bNewIncludeArgumentName:=False)) ucrReceiverThreeVariableSecondFactor.SetParameterIsString() ucrReceiverThreeVariableSecondFactor.Selector = ucrSelectorDescribeTwoVar @@ -1198,7 +1200,6 @@ Public Class dlgDescribeTwoVariable AddRemoveSecondAnovaParam() AddRemoveThirdAnovaParam() AddRemoveFirstAnova2Param() - 'SwappingXYVar() End Sub Private Sub ChangeSumaryLabelText() @@ -1323,7 +1324,6 @@ Public Class dlgDescribeTwoVariable End If End Sub - Private Sub AssignThirdVariableType() If rdoThreeVariable.Checked Then Dim ucrCurrentReceiver As ucrReceiverSingle = ucrReceiverThreeVariableThirdVariable @@ -1530,7 +1530,6 @@ Public Class dlgDescribeTwoVariable Else ucrReceiverPercentages.Clear() End If - End Sub Private Sub ucrpnlPercent_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrpnlPercent.ControlValueChanged From 73c8de53539e334903137dda5ec0ab9c6ad04ad9 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Mon, 20 May 2024 09:54:10 +0300 Subject: [PATCH 42/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 51 +++++++++-------------- instat/dlgDescribeTwoVariable.vb | 9 +--- 2 files changed, 21 insertions(+), 39 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 203ab99a5b5..d0c12d0b1de 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -63,13 +63,13 @@ Partial Class dlgDescribeTwoVariable Me.rdoOCol = New System.Windows.Forms.RadioButton() Me.rdoOCell = New System.Windows.Forms.RadioButton() Me.rdoORow = New System.Windows.Forms.RadioButton() + Me.ucrpnlPercent = New instat.UcrPanel() Me.ucrReceiverPercentages = New instat.ucrReceiverSingle() Me.ucrReceiverThreeVariableSecondFactor = New instat.ucrReceiverSingle() Me.ucrReceiverSecondTwoVariableFactor = New instat.ucrReceiverSingle() Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() - Me.ucrChkPercentageProportion = New instat.ucrCheck() Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() @@ -85,7 +85,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkCorrelations = New instat.ucrCheck() Me.ucrChkLevSig = New instat.ucrCheck() Me.ucrChkOmitMissing = New instat.ucrCheck() - Me.ucrpnlPercent = New instat.UcrPanel() Me.grpSummaries.SuspendLayout() Me.grpDisplay.SuspendLayout() Me.SuspendLayout() @@ -346,7 +345,6 @@ Partial Class dlgDescribeTwoVariable ' 'grpDisplay ' - Me.grpDisplay.Controls.Add(Me.ucrChkPercentageProportion) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) Me.grpDisplay.Location = New System.Drawing.Point(412, 308) Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4) @@ -360,36 +358,45 @@ Partial Class dlgDescribeTwoVariable 'rdoOCol ' Me.rdoOCol.AutoSize = True - Me.rdoOCol.Location = New System.Drawing.Point(451, 365) + Me.rdoOCol.Location = New System.Drawing.Point(430, 365) Me.rdoOCol.Name = "rdoOCol" - Me.rdoOCol.Size = New System.Drawing.Size(69, 24) + Me.rdoOCol.Size = New System.Drawing.Size(81, 24) Me.rdoOCol.TabIndex = 40 Me.rdoOCol.TabStop = True - Me.rdoOCol.Text = "OCol" + Me.rdoOCol.Text = "Col(%)" Me.rdoOCol.UseVisualStyleBackColor = True ' 'rdoOCell ' Me.rdoOCell.AutoSize = True - Me.rdoOCell.Location = New System.Drawing.Point(607, 364) + Me.rdoOCell.Location = New System.Drawing.Point(610, 364) Me.rdoOCell.Name = "rdoOCell" - Me.rdoOCell.Size = New System.Drawing.Size(72, 24) + Me.rdoOCell.Size = New System.Drawing.Size(84, 24) Me.rdoOCell.TabIndex = 41 Me.rdoOCell.TabStop = True - Me.rdoOCell.Text = "OCell" + Me.rdoOCell.Text = "Cell(%)" Me.rdoOCell.UseVisualStyleBackColor = True ' 'rdoORow ' Me.rdoORow.AutoSize = True - Me.rdoORow.Location = New System.Drawing.Point(525, 365) + Me.rdoORow.Location = New System.Drawing.Point(515, 365) Me.rdoORow.Name = "rdoORow" - Me.rdoORow.Size = New System.Drawing.Size(78, 24) + Me.rdoORow.Size = New System.Drawing.Size(90, 24) Me.rdoORow.TabIndex = 42 Me.rdoORow.TabStop = True - Me.rdoORow.Text = "ORow" + Me.rdoORow.Text = "Row(%)" Me.rdoORow.UseVisualStyleBackColor = True ' + 'ucrpnlPercent + ' + Me.ucrpnlPercent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrpnlPercent.Location = New System.Drawing.Point(422, 352) + Me.ucrpnlPercent.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrpnlPercent.Name = "ucrpnlPercent" + Me.ucrpnlPercent.Size = New System.Drawing.Size(270, 46) + Me.ucrpnlPercent.TabIndex = 43 + ' 'ucrReceiverPercentages ' Me.ucrReceiverPercentages.AutoSize = True @@ -464,16 +471,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) Me.ucrSaveTable.TabIndex = 24 ' - 'ucrChkPercentageProportion - ' - Me.ucrChkPercentageProportion.AutoSize = True - Me.ucrChkPercentageProportion.Checked = False - Me.ucrChkPercentageProportion.Location = New System.Drawing.Point(12, 129) - Me.ucrChkPercentageProportion.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkPercentageProportion.Name = "ucrChkPercentageProportion" - Me.ucrChkPercentageProportion.Size = New System.Drawing.Size(209, 34) - Me.ucrChkPercentageProportion.TabIndex = 57 - ' 'ucrChkDisplayAsPercentage ' Me.ucrChkDisplayAsPercentage.AutoSize = True @@ -633,15 +630,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrChkOmitMissing.Size = New System.Drawing.Size(214, 34) Me.ucrChkOmitMissing.TabIndex = 0 ' - 'ucrpnlPercent - ' - Me.ucrpnlPercent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrpnlPercent.Location = New System.Drawing.Point(432, 352) - Me.ucrpnlPercent.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrpnlPercent.Name = "ucrpnlPercent" - Me.ucrpnlPercent.Size = New System.Drawing.Size(260, 46) - Me.ucrpnlPercent.TabIndex = 43 - ' 'dlgDescribeTwoVariable ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) @@ -737,7 +725,6 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents lblMarginName As Label Friend WithEvents ucrChkDisplayMargins As ucrCheck Friend WithEvents grpDisplay As GroupBox - Friend WithEvents ucrChkPercentageProportion As ucrCheck Friend WithEvents ucrChkDisplayAsPercentage As ucrCheck Friend WithEvents ucrSaveTable As ucrSave Friend WithEvents ucrReceiverFirstVars As ucrReceiverMultiple diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 9067333011e..51e33b7b9db 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -139,11 +139,7 @@ Public Class dlgDescribeTwoVariable ucrChkDisplayAsPercentage.SetRDefault(Chr(34) & "none" & Chr(34)) ucrChkDisplayAsPercentage.AddToLinkedControls(ucrReceiverPercentages, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True) - ucrChkDisplayAsPercentage.AddToLinkedControls({ucrChkPercentageProportion, ucrpnlPercent}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - - ucrChkPercentageProportion.SetParameter(New RParameter("perc_decimal", 3)) - ucrChkPercentageProportion.SetText("Display as Decimal") - ucrChkPercentageProportion.SetRDefault("FALSE") + ucrChkDisplayAsPercentage.AddToLinkedControls(ucrpnlPercent, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkSummariesRowCol.SetText("Summaries in Rows") ucrChkSummariesRowCol.AddParameterValuesCondition(True, "row_sum", "True") @@ -524,7 +520,6 @@ Public Class dlgDescribeTwoVariable ucrReceiverSecondSkimrGroupByFactor.SetRCode(clsGroupByFunction, bReset) ucrChkDisplayAsPercentage.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrReceiverPercentages.SetRCode(clsCombineFrequencyParametersFunction, bReset) - ucrChkPercentageProportion.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrPnlDescribe.SetRCode(clsDummyFunction, bReset) ucrpnlPercent.SetRCode(clsDummyFunction, bReset) ucrChkSummariesRowCol.SetRCode(clsDummyFunction, bReset) @@ -1139,7 +1134,7 @@ Public Class dlgDescribeTwoVariable Next End Sub - Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPercentageProportion.ControlValueChanged, ucrReceiverPercentages.ControlValueChanged, + Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverPercentages.ControlValueChanged, ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, ucrInputMarginName.ControlValueChanged, ucrpnlPercent.ControlValueChanged If rdoTwoVariable.Checked Then If ucrChkDisplayAsPercentage.Checked Then From 4c592df584957c046dde7902cb9558d8e7e39602 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Wed, 22 May 2024 16:04:11 +0300 Subject: [PATCH 43/83] changes --- instat/dlgDescribeTwoVariable.Designer.vb | 60 ++++++---- instat/dlgDescribeTwoVariable.vb | 136 +++++++++++++++++----- 2 files changed, 147 insertions(+), 49 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index d0c12d0b1de..f75fa34b720 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -60,6 +60,8 @@ Partial Class dlgDescribeTwoVariable Me.cmdSummaries = New System.Windows.Forms.Button() Me.lblMarginName = New System.Windows.Forms.Label() Me.grpDisplay = New System.Windows.Forms.GroupBox() + Me.ucrReceiverColumns = New instat.ucrReceiverMultiple() + Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.rdoOCol = New System.Windows.Forms.RadioButton() Me.rdoOCell = New System.Windows.Forms.RadioButton() Me.rdoORow = New System.Windows.Forms.RadioButton() @@ -70,7 +72,6 @@ Partial Class dlgDescribeTwoVariable Me.ucrReceiverThreeVariableThirdVariable = New instat.ucrReceiverSingle() Me.ucrReceiverFirstVars = New instat.ucrReceiverMultiple() Me.ucrSaveTable = New instat.ucrSave() - Me.ucrChkDisplayAsPercentage = New instat.ucrCheck() Me.ucrInputMarginName = New instat.ucrInputTextBox() Me.ucrReorderSummary = New instat.ucrReorder() Me.ucrBase = New instat.ucrButtons() @@ -345,20 +346,44 @@ Partial Class dlgDescribeTwoVariable ' 'grpDisplay ' + Me.grpDisplay.Controls.Add(Me.ucrReceiverColumns) Me.grpDisplay.Controls.Add(Me.ucrChkDisplayAsPercentage) - Me.grpDisplay.Location = New System.Drawing.Point(412, 308) + Me.grpDisplay.Location = New System.Drawing.Point(414, 277) Me.grpDisplay.Margin = New System.Windows.Forms.Padding(4) Me.grpDisplay.Name = "grpDisplay" Me.grpDisplay.Padding = New System.Windows.Forms.Padding(4) - Me.grpDisplay.Size = New System.Drawing.Size(291, 172) + Me.grpDisplay.Size = New System.Drawing.Size(291, 219) Me.grpDisplay.TabIndex = 15 Me.grpDisplay.TabStop = False Me.grpDisplay.Text = "Percentages" ' + 'ucrReceiverColumns + ' + Me.ucrReceiverColumns.AutoSize = True + Me.ucrReceiverColumns.frmParent = Me + Me.ucrReceiverColumns.Location = New System.Drawing.Point(19, 92) + Me.ucrReceiverColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverColumns.Name = "ucrReceiverColumns" + Me.ucrReceiverColumns.Selector = Nothing + Me.ucrReceiverColumns.Size = New System.Drawing.Size(180, 121) + Me.ucrReceiverColumns.strNcFilePath = "" + Me.ucrReceiverColumns.TabIndex = 55 + Me.ucrReceiverColumns.ucrSelector = Nothing + ' + 'ucrChkDisplayAsPercentage + ' + Me.ucrChkDisplayAsPercentage.AutoSize = True + Me.ucrChkDisplayAsPercentage.Checked = False + Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(14, 22) + Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(171, 34) + Me.ucrChkDisplayAsPercentage.TabIndex = 54 + ' 'rdoOCol ' Me.rdoOCol.AutoSize = True - Me.rdoOCol.Location = New System.Drawing.Point(430, 365) + Me.rdoOCol.Location = New System.Drawing.Point(432, 336) Me.rdoOCol.Name = "rdoOCol" Me.rdoOCol.Size = New System.Drawing.Size(81, 24) Me.rdoOCol.TabIndex = 40 @@ -369,7 +394,7 @@ Partial Class dlgDescribeTwoVariable 'rdoOCell ' Me.rdoOCell.AutoSize = True - Me.rdoOCell.Location = New System.Drawing.Point(610, 364) + Me.rdoOCell.Location = New System.Drawing.Point(612, 335) Me.rdoOCell.Name = "rdoOCell" Me.rdoOCell.Size = New System.Drawing.Size(84, 24) Me.rdoOCell.TabIndex = 41 @@ -380,7 +405,7 @@ Partial Class dlgDescribeTwoVariable 'rdoORow ' Me.rdoORow.AutoSize = True - Me.rdoORow.Location = New System.Drawing.Point(515, 365) + Me.rdoORow.Location = New System.Drawing.Point(517, 336) Me.rdoORow.Name = "rdoORow" Me.rdoORow.Size = New System.Drawing.Size(90, 24) Me.rdoORow.TabIndex = 42 @@ -391,17 +416,17 @@ Partial Class dlgDescribeTwoVariable 'ucrpnlPercent ' Me.ucrpnlPercent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrpnlPercent.Location = New System.Drawing.Point(422, 352) + Me.ucrpnlPercent.Location = New System.Drawing.Point(424, 331) Me.ucrpnlPercent.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrpnlPercent.Name = "ucrpnlPercent" - Me.ucrpnlPercent.Size = New System.Drawing.Size(270, 46) + Me.ucrpnlPercent.Size = New System.Drawing.Size(270, 37) Me.ucrpnlPercent.TabIndex = 43 ' 'ucrReceiverPercentages ' Me.ucrReceiverPercentages.AutoSize = True Me.ucrReceiverPercentages.frmParent = Me - Me.ucrReceiverPercentages.Location = New System.Drawing.Point(429, 401) + Me.ucrReceiverPercentages.Location = New System.Drawing.Point(431, 369) Me.ucrReceiverPercentages.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverPercentages.Name = "ucrReceiverPercentages" Me.ucrReceiverPercentages.Selector = Nothing @@ -468,19 +493,9 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Location = New System.Drawing.Point(22, 676) Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(598, 36) + Me.ucrSaveTable.Size = New System.Drawing.Size(623, 36) Me.ucrSaveTable.TabIndex = 24 ' - 'ucrChkDisplayAsPercentage - ' - Me.ucrChkDisplayAsPercentage.AutoSize = True - Me.ucrChkDisplayAsPercentage.Checked = False - Me.ucrChkDisplayAsPercentage.Location = New System.Drawing.Point(12, 16) - Me.ucrChkDisplayAsPercentage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) - Me.ucrChkDisplayAsPercentage.Name = "ucrChkDisplayAsPercentage" - Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(171, 34) - Me.ucrChkDisplayAsPercentage.TabIndex = 54 - ' 'ucrInputMarginName ' Me.ucrInputMarginName.AddQuotesIfUnrecognised = True @@ -636,14 +651,13 @@ Partial Class dlgDescribeTwoVariable Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ClientSize = New System.Drawing.Size(723, 748) + Me.Controls.Add(Me.ucrReceiverPercentages) Me.Controls.Add(Me.rdoORow) Me.Controls.Add(Me.rdoOCell) Me.Controls.Add(Me.rdoOCol) Me.Controls.Add(Me.ucrpnlPercent) - Me.Controls.Add(Me.ucrReceiverPercentages) Me.Controls.Add(Me.ucrReceiverThreeVariableSecondFactor) Me.Controls.Add(Me.ucrReceiverSecondTwoVariableFactor) - Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) Me.Controls.Add(Me.ucrReceiverFirstVars) Me.Controls.Add(Me.ucrSaveTable) Me.Controls.Add(Me.grpDisplay) @@ -675,6 +689,7 @@ Partial Class dlgDescribeTwoVariable Me.Controls.Add(Me.ucrChkLevSig) Me.Controls.Add(Me.ucrChkOmitMissing) Me.Controls.Add(Me.cmdMissingOptions) + Me.Controls.Add(Me.ucrReceiverThreeVariableThirdVariable) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False @@ -738,4 +753,5 @@ Partial Class dlgDescribeTwoVariable Friend WithEvents rdoOCell As RadioButton Friend WithEvents rdoOCol As RadioButton Friend WithEvents ucrpnlPercent As UcrPanel + Friend WithEvents ucrReceiverColumns As ucrReceiverMultiple End Class diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 51e33b7b9db..fcc21ef624e 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -29,7 +29,7 @@ Public Class dlgDescribeTwoVariable Public strFirstVariablesType, strSecondVariableType, strThirdVariableType As String 'SUMMARY FUNCTIoNS - Private clsCombineFrequencyParametersFunction, clsCombineFunction, clsCombineSwapAnova2Table, clsCombineAnova2Function, clsSummariseFunction, + Private clsCombineFrequencyParametersFunction, clsCombineFrequencyColParametersFunction, clsCombineFunction, clsCombineSwapAnova2Table, clsCombineAnova2Function, clsSummariseFunction, clsDummyFunction, clsGroupByFunction, clsRAnovaFunction, clsCorrFunction, clsRAnovaTableFunction, clsRCorrelationFunction, clsSkimrFunction, clsSummariesListFunction, clsCombineAnovaFunction, clsSummaryTableCombineFactorsFunction, clsSummaryTableFunction, clsRAnovaSwapTable2Funtion, @@ -133,6 +133,11 @@ Public Class dlgDescribeTwoVariable ucrReceiverPercentages.SetDataType("factor") 'ucrReceiverPercentages.SetLinkedDisplayControl(lblFactorAsPercentage) + ucrReceiverColumns.SetParameter(New RParameter("perc_total_factors", 3)) + ucrReceiverColumns.SetParameterIsString() + ucrReceiverColumns.Selector = ucrSelectorDescribeTwoVar + ucrReceiverColumns.SetDataType("factor") + ucrChkDisplayAsPercentage.SetParameter(New RParameter("percentage_type", 1)) ucrChkDisplayAsPercentage.SetText("As Percentages") ucrChkDisplayAsPercentage.SetValuesCheckedAndUnchecked(Chr(34) & "factors" & Chr(34), Chr(34) & "none" & Chr(34)) @@ -184,7 +189,8 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddToLinkedControls({ucrReceiverSecondTwoVariableFactor, ucrChkSummariesRowCol}, {rdoTwoVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableSecondFactor}, {rdoThreeVariable}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrpnlPercent.AddToLinkedControls({ucrReceiverPercentages}, {rdoOCol, rdoORow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrpnlPercent.AddToLinkedControls({ucrReceiverPercentages}, {rdoORow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrpnlPercent.AddToLinkedControls({ucrReceiverColumns}, {rdoOCol}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrReceiverThreeVariableSecondFactor.SetParameter(New RParameter("second_three_varible_factor", 0, bNewIncludeArgumentName:=False)) ucrReceiverThreeVariableSecondFactor.SetParameterIsString() @@ -200,6 +206,7 @@ Public Class dlgDescribeTwoVariable Private Sub SetDefaults() clsCombineFrequencyParametersFunction = New RFunction + clsCombineFrequencyColParametersFunction = New RFunction clsCombineFunction = New RFunction clsDummyFunction = New RFunction clsFootnoteCellBodyFunction = New RFunction @@ -269,6 +276,7 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.Reset() clsCombineFrequencyParametersFunction.SetRCommand("c") + clsCombineFrequencyColParametersFunction.SetRCommand("c") clsCombineFunction.SetRCommand("c") @@ -507,6 +515,8 @@ Public Class dlgDescribeTwoVariable ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsMapSummaryFunction, New RParameter(".x", 1), iAdditionalPairNo:=3) ucrChkMeans.AddAdditionalCodeParameterPair(clsRAnovaSwapTable2Funtion, New RParameter("means", iNewPosition:=5), iAdditionalPairNo:=1) ucrChkLevSig.AddAdditionalCodeParameterPair(clsRAnovaSwapTable2Funtion, New RParameter("sign_level", iNewPosition:=4), iAdditionalPairNo:=1) + ucrChkDisplayMargins.AddAdditionalCodeParameterPair(clsCombineFrequencyColParametersFunction, New RParameter("include_margins", iNewPosition:=5), iAdditionalPairNo:=1) + ucrChkDisplayAsPercentage.AddAdditionalCodeParameterPair(clsCombineFrequencyColParametersFunction, New RParameter("percentage_type", iNewPosition:=1), iAdditionalPairNo:=1) 'ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsRAnovaFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) @@ -520,6 +530,7 @@ Public Class dlgDescribeTwoVariable ucrReceiverSecondSkimrGroupByFactor.SetRCode(clsGroupByFunction, bReset) ucrChkDisplayAsPercentage.SetRCode(clsCombineFrequencyParametersFunction, bReset) ucrReceiverPercentages.SetRCode(clsCombineFrequencyParametersFunction, bReset) + ucrReceiverColumns.SetRCode(clsCombineFrequencyColParametersFunction, bReset) ucrPnlDescribe.SetRCode(clsDummyFunction, bReset) ucrpnlPercent.SetRCode(clsDummyFunction, bReset) ucrChkSummariesRowCol.SetRCode(clsDummyFunction, bReset) @@ -622,8 +633,9 @@ Public Class dlgDescribeTwoVariable ucrChkDisplayMargins.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() ucrInputMarginName.Visible = ucrChkDisplayMargins.Checked AndAlso IsFactorByFactor() grpDisplay.Visible = rdoTwoVariable.Checked AndAlso IsFactorByFactor() - ucrReceiverPercentages.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() + ucrReceiverPercentages.Visible = ucrChkDisplayAsPercentage.Checked AndAlso rdoORow.Checked AndAlso IsFactorByFactor() ucrpnlPercent.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() + ucrReceiverColumns.Visible = ucrChkDisplayAsPercentage.Checked AndAlso IsFactorByFactor() AndAlso rdoOCol.Checked ucrChkCorrelations.Visible = False ucrChkSwapXYVar.Visible = False ucrChkOmitMissing.Visible = False @@ -892,7 +904,7 @@ Public Class dlgDescribeTwoVariable ElseIf IsFactorByFactor() Then ucrBase.Location = New Point(iUcrBaseXLocation, 370) Me.Size = New Point(iDialogueXsize, 465) - cmdFormatTable.Location = New Point(326, 325) + cmdFormatTable.Location = New Point(326, 331) Else ucrBase.Location = New Point(iUcrBaseXLocation, 328) Me.Size = New Point(iDialogueXsize, 425) @@ -905,7 +917,7 @@ Public Class dlgDescribeTwoVariable ucrBase.Location = New Point(iUcrBaseXLocation, 370) Me.Size = New Point(iDialogueXsize, 465) cmdFormatTable.Visible = True - cmdFormatTable.Location = New Point(326, 325) + cmdFormatTable.Location = New Point(326, 350) Else ucrBase.Location = New Point(iUcrBaseXLocation, 385) Me.Size = New Point(iDialogueXsize, 480) @@ -1119,39 +1131,76 @@ Public Class dlgDescribeTwoVariable Dim clsTempFrequency As RFunction = If(rdoThreeVariable.Checked, clsThreeVariableCombineFrequencyParametersFunction, clsCombineFrequencyParametersFunction).Clone + Dim clsTempColFrequency As RFunction = clsCombineFrequencyColParametersFunction.Clone + If rdoTwoVariable.Checked Then + If rdoORow.Checked OrElse rdoOCell.Checked Then + For Each clsParameter In clsTempFrequency.clsParameters + If IsFactorByFactor() Then + clsSummaryTableFunction.AddParameter(clsParameter) + Else + If IsNumericByFactor() OrElse IsFactorByNumeric() Then + Select Case clsParameter.strArgumentName + Case "signif_fig", "include_margins", "margin_name" + clsSummaryTableFunction.AddParameter(clsParameter) + End Select + End If + End If + Next - For Each clsParameter In clsTempFrequency.clsParameters - If IsFactorByFactor() Then - clsSummaryTableFunction.AddParameter(clsParameter) - Else - If IsNumericByFactor() OrElse IsFactorByNumeric() Then - Select Case clsParameter.strArgumentName - Case "signif_fig", "include_margins", "margin_name" - clsSummaryTableFunction.AddParameter(clsParameter) - End Select - End If + ElseIf rdoOCol.Checked Then + + For Each clsParameter In clsTempColFrequency.clsParameters + If IsFactorByFactor() Then + clsSummaryTableFunction.AddParameter(clsParameter) + Else + If IsNumericByFactor() OrElse IsFactorByNumeric() Then + Select Case clsParameter.strArgumentName + Case "signif_fig", "include_margins", "margin_name" + clsSummaryTableFunction.AddParameter(clsParameter) + End Select + End If + End If + Next End If - Next + End If End Sub - Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverPercentages.ControlValueChanged, + Private Sub Frequencies_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverPercentages.ControlValueChanged, ucrReceiverColumns.ControlValueChanged, ucrChkDisplayAsPercentage.ControlValueChanged, ucrChkDisplayMargins.ControlValueChanged, ucrInputMarginName.ControlValueChanged, ucrpnlPercent.ControlValueChanged If rdoTwoVariable.Checked Then If ucrChkDisplayAsPercentage.Checked Then - ucrReceiverPercentages.SetMeAsReceiver() + If rdoORow.Checked Then + ucrReceiverPercentages.SetMeAsReceiver() + Else + ucrReceiverColumns.SetMeAsReceiver() + End If Else ucrReceiverFirstVars.SetMeAsReceiver() End If Else ucrReceiverFirstVars.SetMeAsReceiver() End If - If ucrChkDisplayMargins.Checked Then - ucrInputMarginName.Visible = True - clsCombineFrequencyParametersFunction.AddParameter("margin_name", Chr(34) & ucrInputMarginName.GetText & Chr(34), iPosition:=6) + If rdoORow.Checked OrElse rdoOCell.Checked Then + If ucrChkDisplayMargins.Checked Then + ucrInputMarginName.Visible = True + clsCombineFrequencyParametersFunction.AddParameter("margin_name", Chr(34) & ucrInputMarginName.GetText & Chr(34), iPosition:=6) + Else + ucrInputMarginName.Visible = False + clsCombineFrequencyParametersFunction.RemoveParameterByName("margin_name") + End If + ElseIf rdoOCol.Checked Then + + If ucrChkDisplayMargins.Checked Then + ucrInputMarginName.Visible = True + clsCombineFrequencyColParametersFunction.AddParameter("margin_name", Chr(34) & ucrInputMarginName.GetText & Chr(34), iPosition:=6) + Else + ucrInputMarginName.Visible = False + clsCombineFrequencyColParametersFunction.RemoveParameterByName("margin_name") + End If Else - ucrInputMarginName.Visible = False - clsCombineFrequencyParametersFunction.RemoveParameterByName("margin_name") + clsCombineFrequencyColParametersFunction.RemoveParameterByName("margin_name") End If + FactorColumns() AddRemoveFrequencyParameters() AddingColumnFactor() @@ -1512,9 +1561,12 @@ Public Class dlgDescribeTwoVariable Private Sub AddingColumnFactor() If rdoOCol.Checked Then - If ucrReceiverFirstVars.lstSelectedVariables.Items.Count >= 1 Then - Dim iIndex = ucrReceiverFirstVars.lstSelectedVariables.Items.Count - 1 - ucrReceiverPercentages.Add(ucrReceiverFirstVars.lstSelectedVariables.Items(iIndex).Text) + + If Not ucrReceiverFirstVars.IsEmpty Then + Dim variableNames As List(Of String) = ucrReceiverFirstVars.GetVariableNamesAsList + For Each varName As String In variableNames + ucrReceiverColumns.Add(varName) + Next ucrReceiverFirstVars.SetMeAsReceiver() End If ElseIf rdoORow.Checked Then @@ -1522,9 +1574,39 @@ Public Class dlgDescribeTwoVariable ucrReceiverPercentages.Add(ucrReceiverSecondTwoVariableFactor.GetVariableNames(False)) ucrReceiverSecondTwoVariableFactor.SetMeAsReceiver() End If - Else + ElseIf rdoOCol.Checked Then ucrReceiverPercentages.Clear() + ucrReceiverColumns.Clear() End If + + 'If rdoOCol.Checked Then + ' If Not ucrReceiverFirstVars.IsEmpty Then + ' Dim variableNames As List(Of String) = ucrReceiverFirstVars.GetVariableNamesAsList + ' For Each varName As String In variableNames + ' ucrReceiverColumns.Add(varName) + ' 'clsCombineFrequencyParametersFunction.AddParameter("perc_total_factors", varName) + + ' Next + ' ucrReceiverFirstVars.SetMeAsReceiver() + ' End If + ' ' Clear ucrReceiverPercentages as it's not needed in this branch + ' ucrReceiverPercentages.Clear() + 'ElseIf rdoORow.Checked Then + ' If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then + ' ucrReceiverPercentages.Add(ucrReceiverSecondTwoVariableFactor.GetVariableNames(False)) + ' ucrReceiverSecondTwoVariableFactor.SetMeAsReceiver() + ' 'clsCombineFrequencyParametersFunction.AddParameter("perc_total_factors", varName2) + + ' End If + ' ' Clear ucrReceiverColumns as it's not needed in this branch + ' ucrReceiverColumns.Clear() + 'Else + ' ' Clear both ucrReceiverPercentages and ucrReceiverColumns if neither rdoOCol nor rdoORow is checked + ' ucrReceiverPercentages.Clear() + ' ucrReceiverColumns.Clear() + 'End If + + End Sub Private Sub ucrpnlPercent_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrpnlPercent.ControlValueChanged From cbe069ba50543c0216607041654195d1894e1d30 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Thu, 23 May 2024 10:00:02 +0300 Subject: [PATCH 44/83] change --- instat/dlgDescribeTwoVariable.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index fcc21ef624e..9cfc3c2cd65 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -904,7 +904,7 @@ Public Class dlgDescribeTwoVariable ElseIf IsFactorByFactor() Then ucrBase.Location = New Point(iUcrBaseXLocation, 370) Me.Size = New Point(iDialogueXsize, 465) - cmdFormatTable.Location = New Point(326, 331) + cmdFormatTable.Location = New Point(326, 330) Else ucrBase.Location = New Point(iUcrBaseXLocation, 328) Me.Size = New Point(iDialogueXsize, 425) @@ -1199,6 +1199,7 @@ Public Class dlgDescribeTwoVariable End If Else clsCombineFrequencyColParametersFunction.RemoveParameterByName("margin_name") + clsCombineFrequencyParametersFunction.RemoveParameterByName("margin_name") End If FactorColumns() From 17e1ab256ba634d1480b5355a08abba9329d04a7 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Thu, 30 May 2024 15:00:38 +0300 Subject: [PATCH 45/83] changes to the code --- instat/dlgDescribeTwoVariable.Designer.vb | 2 +- instat/dlgDescribeTwoVariable.vb | 77 ++++++++++------------- 2 files changed, 34 insertions(+), 45 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index f75fa34b720..03c893ea851 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -493,7 +493,7 @@ Partial Class dlgDescribeTwoVariable Me.ucrSaveTable.Location = New System.Drawing.Point(22, 676) Me.ucrSaveTable.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveTable.Name = "ucrSaveTable" - Me.ucrSaveTable.Size = New System.Drawing.Size(623, 36) + Me.ucrSaveTable.Size = New System.Drawing.Size(459, 36) Me.ucrSaveTable.TabIndex = 24 ' 'ucrInputMarginName diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 9cfc3c2cd65..0c2bb25992b 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -720,7 +720,7 @@ Public Class dlgDescribeTwoVariable cmdFormatTable.Visible = True ucrChkMeans.Visible = False ucrChkLevSig.Visible = False - ucrSaveTable.Location = New Point(23, 350) + ucrSaveTable.Location = New Point(23, 351) clsDummyFunction.AddParameter("factor_cols", "FactorVar", iPosition:=1) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) ucrSaveTable.SetPrefix("frequency_table") @@ -902,7 +902,7 @@ Public Class dlgDescribeTwoVariable ucrBase.Location = New Point(iUcrBaseXLocation, 319) Me.Size = New Point(iDialogueXsize, 415) ElseIf IsFactorByFactor() Then - ucrBase.Location = New Point(iUcrBaseXLocation, 370) + ucrBase.Location = New Point(iUcrBaseXLocation, 372) Me.Size = New Point(iDialogueXsize, 465) cmdFormatTable.Location = New Point(326, 330) Else @@ -1171,8 +1171,10 @@ Public Class dlgDescribeTwoVariable If ucrChkDisplayAsPercentage.Checked Then If rdoORow.Checked Then ucrReceiverPercentages.SetMeAsReceiver() - Else + ElseIf rdoOCol.Checked Then ucrReceiverColumns.SetMeAsReceiver() + Else + ucrReceiverFirstVars.SetMeAsReceiver() End If Else ucrReceiverFirstVars.SetMeAsReceiver() @@ -1561,53 +1563,40 @@ Public Class dlgDescribeTwoVariable End Sub Private Sub AddingColumnFactor() - If rdoOCol.Checked Then + If IsFactorByFactor() Then + If rdoOCol.Checked Then + If Not ucrReceiverFirstVars.IsEmpty Then + ' Get the list of variable names from ucrReceiverFirstVars + Dim variableNames As List(Of String) = ucrReceiverFirstVars.GetVariableNamesAsList - If Not ucrReceiverFirstVars.IsEmpty Then - Dim variableNames As List(Of String) = ucrReceiverFirstVars.GetVariableNamesAsList - For Each varName As String In variableNames - ucrReceiverColumns.Add(varName) - Next - ucrReceiverFirstVars.SetMeAsReceiver() - End If - ElseIf rdoORow.Checked Then - If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then - ucrReceiverPercentages.Add(ucrReceiverSecondTwoVariableFactor.GetVariableNames(False)) - ucrReceiverSecondTwoVariableFactor.SetMeAsReceiver() + ' Get the current list of variable names in ucrReceiverColumns + Dim currentColumnVars As List(Of String) = ucrReceiverColumns.GetVariableNamesAsList() + + ' Remove variables from ucrReceiverColumns that are no longer in ucrReceiverFirstVars + For Each varName As String In currentColumnVars + If Not variableNames.Contains(varName) Then + ucrReceiverColumns.Remove(New String() {varName}) ' Remove expects an array of strings + End If + Next + + ' Add the remaining variables to ucrReceiverColumns + For Each varName As String In variableNames + If Not currentColumnVars.Contains(varName) Then + ucrReceiverColumns.Add(varName) + End If + Next + + End If + ElseIf rdoORow.Checked Then + If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then + ucrReceiverPercentages.Add(ucrReceiverSecondTwoVariableFactor.GetVariableNames(False)) + End If End If - ElseIf rdoOCol.Checked Then + Else ucrReceiverPercentages.Clear() ucrReceiverColumns.Clear() End If - 'If rdoOCol.Checked Then - ' If Not ucrReceiverFirstVars.IsEmpty Then - ' Dim variableNames As List(Of String) = ucrReceiverFirstVars.GetVariableNamesAsList - ' For Each varName As String In variableNames - ' ucrReceiverColumns.Add(varName) - ' 'clsCombineFrequencyParametersFunction.AddParameter("perc_total_factors", varName) - - ' Next - ' ucrReceiverFirstVars.SetMeAsReceiver() - ' End If - ' ' Clear ucrReceiverPercentages as it's not needed in this branch - ' ucrReceiverPercentages.Clear() - 'ElseIf rdoORow.Checked Then - ' If Not ucrReceiverSecondTwoVariableFactor.IsEmpty Then - ' ucrReceiverPercentages.Add(ucrReceiverSecondTwoVariableFactor.GetVariableNames(False)) - ' ucrReceiverSecondTwoVariableFactor.SetMeAsReceiver() - ' 'clsCombineFrequencyParametersFunction.AddParameter("perc_total_factors", varName2) - - ' End If - ' ' Clear ucrReceiverColumns as it's not needed in this branch - ' ucrReceiverColumns.Clear() - 'Else - ' ' Clear both ucrReceiverPercentages and ucrReceiverColumns if neither rdoOCol nor rdoORow is checked - ' ucrReceiverPercentages.Clear() - ' ucrReceiverColumns.Clear() - 'End If - - End Sub Private Sub ucrpnlPercent_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrpnlPercent.ControlValueChanged From 4422b31ff145ea2f9c783343d6ea8bb8b9040c75 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Thu, 6 Jun 2024 10:50:45 +0300 Subject: [PATCH 46/83] changes to the code --- instat/dlgDescribeTwoVariable.vb | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index 0c2bb25992b..a4bff9ad1cc 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -131,7 +131,6 @@ Public Class dlgDescribeTwoVariable ucrReceiverPercentages.SetParameterIsString() ucrReceiverPercentages.Selector = ucrSelectorDescribeTwoVar ucrReceiverPercentages.SetDataType("factor") - 'ucrReceiverPercentages.SetLinkedDisplayControl(lblFactorAsPercentage) ucrReceiverColumns.SetParameter(New RParameter("perc_total_factors", 3)) ucrReceiverColumns.SetParameterIsString() @@ -164,7 +163,6 @@ Public Class dlgDescribeTwoVariable ucrChkLevSig.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkLevSig.SetRDefault("FALSE") - ucrChkSwapXYVar.SetText("Swap First/Second Variables") ucrChkSwapXYVar.AddParameterValuesCondition(True, "var", "True") ucrChkSwapXYVar.AddParameterValuesCondition(False, "var", "False") @@ -182,7 +180,6 @@ Public Class dlgDescribeTwoVariable ucrpnlPercent.AddParameterValuesCondition(rdoOCol, "percent", "col") ucrpnlPercent.AddParameterValuesCondition(rdoORow, "percent", "row") ucrpnlPercent.AddParameterValuesCondition(rdoOCell, "percent", "cell") - 'ucrpnlPercent.SetLinkedDisplayControl(grpDisplay) ucrPnlDescribe.AddToLinkedControls({ucrReceiverSkimrGroupByFactor, ucrReceiverSecondSkimrGroupByFactor}, {rdoSkim}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlDescribe.AddToLinkedControls({ucrReceiverThreeVariableThirdVariable}, {rdoThreeVariable}, bNewLinkedHideIfParameterMissing:=True) @@ -268,7 +265,6 @@ Public Class dlgDescribeTwoVariable clsMapGtFunction = New RFunction clsPivotOperator = New ROperator - ucrSelectorDescribeTwoVar.Reset() ucrReceiverFirstVars.SetMeAsReceiver() ucrInputMarginName.SetText("All") @@ -319,7 +315,6 @@ Public Class dlgDescribeTwoVariable clsMapping2Function.AddParameter(".x", clsROperatorParameter:=clsYlist2Operator, iPosition:=0) clsMapping2Function.AddParameter(".f", clsROperatorParameter:=clsAnovaSwapTable2Opeator, iPosition:=1) - clsAnovaTable2Operator.SetOperation("~") clsAnovaTable2Operator.AddParameter("right", clsRFunctionParameter:=clsRAnovaTable2Function, iPosition:=1) clsAnovaTable2Operator.bForceIncludeOperation = True @@ -328,7 +323,6 @@ Public Class dlgDescribeTwoVariable clsAnovaSwapTable2Opeator.AddParameter("right", clsRFunctionParameter:=clsRAnovaSwapTable2Funtion, iPosition:=1) clsAnovaSwapTable2Opeator.bForceIncludeOperation = True - clsYlistOperator.SetOperation("", bBracketsTemp:=False) clsYlistOperator.SetAssignTo("y_col_names_list") @@ -341,7 +335,6 @@ Public Class dlgDescribeTwoVariable clsRAnovaTable2Function.AddParameter("y_col_name", ".x", iPosition:=2) clsRAnovaTable2Function.AddParameter("signif.stars", "FALSE", iPosition:=3) clsRAnovaTable2Function.AddParameter("sign_level", "FALSE", iPosition:=4) - 'clsRAnovaTable2Function.AddParameter("means", "FALSE", iPosition:=5) clsRAnovaSwapTable2Funtion.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$anova_tables2") clsRAnovaSwapTable2Funtion.AddParameter("data", Chr(34) & ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) @@ -349,8 +342,6 @@ Public Class dlgDescribeTwoVariable clsRAnovaSwapTable2Funtion.AddParameter("x_col_names", ".x", iPosition:=2) clsRAnovaSwapTable2Funtion.AddParameter("signif.stars", "FALSE", iPosition:=3) clsRAnovaSwapTable2Funtion.AddParameter("sign_level", "FALSE", iPosition:=4) - 'clsRAnovaSwapTable2Funtion.AddParameter("means", "FALSE", iPosition:=5) - clsGroupByPipeOperator.SetOperation("%>%") clsGroupByPipeOperator.AddParameter("skim", clsRFunctionParameter:=clsSkimrFunction, @@ -378,7 +369,6 @@ Public Class dlgDescribeTwoVariable clsSummariseFunction.SetRCommand("summarise") clsSummariseFunction.AddParameter("cor", clsRFunctionParameter:=clsCorrFunction, bIncludeArgumentName:=False, iPosition:=0) - clsCorrFunction.SetRCommand("cor") clsSkimrFunction.SetPackageName("skimr") @@ -506,10 +496,7 @@ Public Class dlgDescribeTwoVariable Private Sub SetRCodeForControls(bReset As Boolean) bRcodeSet = False - 'ucrReceiverSecondTwoVariableFactor.AddAdditionalCodeParameterPair(clsRAnovaFunction, New RParameter("y_col_name", 2), iAdditionalPairNo:=1) ucrReceiverSecondTwoVariableFactor.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("y_col_name", 2), iAdditionalPairNo:=1) - - 'ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRAnovaFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsRCorrelationFunction, New RParameter("x_col_names", 1), iAdditionalPairNo:=1) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsSkimrFunction, New RParameter("col_names", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) ucrReceiverFirstVars.AddAdditionalCodeParameterPair(clsMapSummaryFunction, New RParameter(".x", 1), iAdditionalPairNo:=3) @@ -518,7 +505,6 @@ Public Class dlgDescribeTwoVariable ucrChkDisplayMargins.AddAdditionalCodeParameterPair(clsCombineFrequencyColParametersFunction, New RParameter("include_margins", iNewPosition:=5), iAdditionalPairNo:=1) ucrChkDisplayAsPercentage.AddAdditionalCodeParameterPair(clsCombineFrequencyColParametersFunction, New RParameter("percentage_type", iNewPosition:=1), iAdditionalPairNo:=1) - 'ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsRAnovaFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSelectorDescribeTwoVar.AddAdditionalCodeParameterPair(clsSummaryTableFunction, ucrSelectorDescribeTwoVar.GetParameter(), iAdditionalPairNo:=1) ucrSaveTable.AddAdditionalRCode(clsJoiningPipeOperator, iAdditionalPairNo:=1) @@ -979,10 +965,10 @@ Public Class dlgDescribeTwoVariable clsSummaryTableFunction.AddParameter("columns_to_summarise", ".x") clsPivotWiderFunction.AddParameter("names_from", "{{ .x }}", iPosition:=1) ElseIf IsFactorByNumeric() Then - clsSummaryTableFunction.AddParameter("factors", ucrReceiverFirstVars.GetVariableNames) - clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=1) + clsSummaryTableFunction.AddParameter("factors", ".x") + clsPivotWiderFunction.AddParameter("names_from", "{{ .x }}", iPosition:=1) clsSummaryTableFunction.AddParameter("columns_to_summarise", ucrReceiverSecondTwoVariableFactor.GetVariableNames) - clsMapSummaryFunction.AddParameter(".x", ucrReceiverSecondTwoVariableFactor.GetVariableNames, iPosition:=3) + clsMapSummaryFunction.AddParameter(".x", ucrReceiverFirstVars.GetVariableNames, iPosition:=3) SummariesInRowsOrCols() Else clsSummaryTableFunction.AddParameter("factors", ucrReceiverSecondTwoVariableFactor.GetVariableNames) @@ -1104,7 +1090,6 @@ Public Class dlgDescribeTwoVariable End If End If - End Sub Private Sub AddRemoveThirdAnovaParam() @@ -1321,7 +1306,7 @@ Public Class dlgDescribeTwoVariable Private Sub SummariesInRowsOrCols() If ucrChkSummariesRowCol.Checked Then - clsPivotWiderFunction.AddParameter("names_from", ucrReceiverFirstVars.GetVariableNames(False), iPosition:=1) + clsPivotWiderFunction.AddParameter("names_from", "{{ .x }}", iPosition:=1) clsDummyFunction.AddParameter("row_sum", "True", iPosition:=3) Else clsPivotWiderFunction.AddParameter("names_from", Chr(39) & "summary-variable" & Chr(39), iPosition:=1) From f62754f7279f21d762be31b8e59e72072e7d4192 Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Thu, 20 Jun 2024 09:34:26 +0300 Subject: [PATCH 47/83] changes to the code --- instat/dlgDescribeTwoVariable.vb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index a4bff9ad1cc..85a67a0ab5c 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -173,7 +173,9 @@ Public Class dlgDescribeTwoVariable ucrPnlDescribe.AddParameterValuesCondition(rdoTwoVariable, "checked", "customize") ucrPnlDescribe.AddParameterValuesCondition(rdoSkim, "checked", "skim") ucrPnlDescribe.AddParameterValuesCondition(rdoThreeVariable, "checked", "three_variable") - 'rdoThreeVariable.Enabled = False + + rdoThreeVariable.Enabled = False + ucrpnlPercent.AddRadioButton(rdoOCol) ucrpnlPercent.AddRadioButton(rdoORow) ucrpnlPercent.AddRadioButton(rdoOCell) @@ -192,7 +194,6 @@ Public Class dlgDescribeTwoVariable ucrReceiverThreeVariableSecondFactor.SetParameter(New RParameter("second_three_varible_factor", 0, bNewIncludeArgumentName:=False)) ucrReceiverThreeVariableSecondFactor.SetParameterIsString() ucrReceiverThreeVariableSecondFactor.Selector = ucrSelectorDescribeTwoVar - 'ucrReceiverThreeVariableSecondFactor.SetIncludedDataTypes({"factor"}) ucrReceiverThreeVariableSecondFactor.SetLinkedDisplayControl(lblThreeVariableSecondFactor) ucrSaveTable.SetDataFrameSelector(ucrSelectorDescribeTwoVar.ucrAvailableDataFrames) @@ -412,7 +413,6 @@ Public Class dlgDescribeTwoVariable clsSummaryTableFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$summary_table") clsSummaryTableFunction.AddParameter("treat_columns_as_factor", "FALSE", iPosition:=3) - 'clsSummaryTableFunction.SetAssignTo("summary_table") clsTildOperator.SetOperation("~") clsTildOperator.AddParameter("right", clsRFunctionParameter:=clsSummaryTableFunction) @@ -434,7 +434,6 @@ Public Class dlgDescribeTwoVariable clsSummaryOperator.SetOperation("%>%") clsSummaryOperator.AddParameter("data", clsRFunctionParameter:=ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) clsSummaryOperator.AddParameter("tableFun", clsRFunctionParameter:=clsMapSummaryFunction, iPosition:=1) - 'clsSummaryOperator.AddParameter("gttbl", clsRFunctionParameter:=clsgtFunction, iPosition:=1) clsPivotOperator.SetOperation("%>%") clsPivotOperator.AddParameter("left", clsRFunctionParameter:=clsPivotWiderFunction) @@ -443,8 +442,6 @@ Public Class dlgDescribeTwoVariable clsMapOperator.SetOperation("%>%") clsMapOperator.AddParameter("left", clsROperatorParameter:=clsTildOperator) - 'clsMapOperator.AddParameter("data", clsRFunctionParameter:=ucrSelectorDescribeTwoVar.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) - 'clsMapOperator.AddParameter("tableFun", clsRFunctionParameter:=clsMapSummaryFunction, iPosition:=1) clsMapOperator.AddParameter("right", clsROperatorParameter:=clsPivotOperator) clsMapOperator.bBrackets = False @@ -596,10 +593,6 @@ Public Class dlgDescribeTwoVariable If IsFactorByNumeric() Then sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) End If - 'ElseIf rdoThreeVariable.Checked Then - ' 'If IsFactorByNumeric() Then - ' ' sdgSummaries.SetRFunction(clsSummariesListFunction, clsSummaryTableFunction, clsCombineFunction, ucrSelectorDescribeTwoVar, bResetSubdialog) - ' 'End If End If bResetSubdialog = False sdgSummaries.ShowDialog() From 2f5d8ba3771217b3ed1ea49a1abd6b4612803688 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:35:42 +0200 Subject: [PATCH 48/83] Improving column Right click to Numeric --- instat/ucrDataView.vb | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index 3f77aed3c2f..1836ddd5e11 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -661,20 +661,24 @@ Public Class ucrDataView GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) Else Dim bCheckLabels As Boolean = GetCurrentDataFrameFocus().clsPrepareFunctions.CheckHasLabels(strColumn) - frmConvertToNumeric.SetDataFrameName(GetCurrentDataFrameFocus().strName) - frmConvertToNumeric.SetColumnName(strColumn) - frmConvertToNumeric.CheckLabels(bCheckLabels) - frmConvertToNumeric.SetNonNumeric(iNonNumericValues) - frmConvertToNumeric.ShowDialog() - ' Yes for "normal" convert and No for "ordinal" convert - Select Case frmConvertToNumeric.DialogResult - Case DialogResult.Yes - GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) - Case DialogResult.No - GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, False) - Case DialogResult.Cancel - Continue For - End Select + If bCheckLabels = False Then + frmConvertToNumeric.SetDataFrameName(GetCurrentDataFrameFocus().strName) + frmConvertToNumeric.SetColumnName(strColumn) + frmConvertToNumeric.CheckLabels(bCheckLabels) + frmConvertToNumeric.SetNonNumeric(iNonNumericValues) + frmConvertToNumeric.ShowDialog() + ' Yes for "normal" convert and No for "ordinal" convert + Select Case frmConvertToNumeric.DialogResult + Case DialogResult.Yes + GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) + Case DialogResult.No + GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, False) + Case DialogResult.Cancel + Continue For + End Select + ElseIf bCheckLabels = True Then + GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) + End If frmConvertToNumeric.Close() End If Next From 568dc7d0ff4b8b51c262328dc7987c0104f384a6 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 20 Jun 2024 22:26:36 +0100 Subject: [PATCH 49/83] Change made --- instat/dlgSeasonalGraph.vb | 138 ++++++++++++++++++++----------------- 1 file changed, 74 insertions(+), 64 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 3ae598b7a7d..919a2fef69a 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -291,6 +291,7 @@ Public Class dlgSeasonalGraph Dim i As Integer + ' Process ucrReceiverLines if not empty If Not ucrReceiverLines.IsEmpty Then ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 @@ -316,9 +317,42 @@ Public Class dlgSeasonalGraph clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) Next + + ' Add points if ucrChkAddPoint is checked + If ucrChkAddPoint.Checked Then + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + Dim clsAesGeompointFunction As New RFunction + clsAesGeompointFunction.SetPackageName("ggplot2") + clsAesGeompointFunction.SetRCommand("aes") + clsAesGeompointFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) + + Dim clsGeomPointFunction As New RFunction + clsGeomPointFunction.SetPackageName("ggplot2") + clsGeomPointFunction.SetRCommand("geom_point") + clsGeomPointFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction, iPosition:=1) + + ' Add geom_point function to the base operator + clsBaseOperator.AddParameter(strGeompointParameterName & "Line" & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=9) + Next + Else + clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line") + End If + If ucrChkColour.Checked Then + If Not ucrInputColour.IsEmpty Then + clsScalecolouridentityFunction.AddParameter("labels", ucrInputColour.clsRList.ToScript(), iPosition:=2) + Else + clsScalecolouridentityFunction.RemoveParameterByName("labels") + End If + clsBaseOperator.AddParameter("scale_colour_identity", clsRFunctionParameter:=clsScalecolouridentityFunction, iPosition:=13) + Else + clsBaseOperator.RemoveParameterByName("scale_colour_identity") + End If Else + clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line") clsBaseOperator.RemoveParameterByName(strFirstParameterName) End If + + ' Process ucrReceiverRibbons if not empty and ucrChkRibbons is checked If ucrChkRibbons.Checked AndAlso Not ucrReceiverRibbons.IsEmpty Then For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 ' Get current variable @@ -345,13 +379,46 @@ Public Class dlgSeasonalGraph clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) End If Next + + ' Add points to ribbons if ucrChkAddpointRibbon is checked + If ucrChkAddpointRibbon.Checked Then + For Each selectedItem As ListViewItem In ucrReceiverRibbons.lstSelectedVariables.Items + Dim clsAesGeompointFunction1 As New RFunction + clsAesGeompointFunction1.SetPackageName("ggplot2") + clsAesGeompointFunction1.SetRCommand("aes") + clsAesGeompointFunction1.AddParameter("y", selectedItem.Text, iPosition:=0) + + Dim clsGeomPointFunction1 As New RFunction + clsGeomPointFunction1.SetPackageName("ggplot2") + clsGeomPointFunction1.SetRCommand("geom_point") + clsGeomPointFunction1.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction1, iPosition:=1) + + ' Add geom_point function to the base operator with a unique parameter name + clsBaseOperator.AddParameter(strGeompointParameterName1 & "Ribbon" & ucrReceiverRibbons.lstSelectedVariables.Items.IndexOf(selectedItem), clsRFunctionParameter:=clsGeomPointFunction1, iPosition:=15) + Next + Else + clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon") + End If + If ucrChkFill.Checked Then + If Not ucrInputFill.IsEmpty Then + clsScalefillidentityFunction.AddParameter("labels", ucrInputFill.clsRList.ToScript(), iPosition:=2) + Else + clsScalefillidentityFunction.RemoveParameterByName("labels") + End If + clsBaseOperator.AddParameter("scale_fill_identity", clsRFunctionParameter:=clsScalefillidentityFunction, iPosition:=12) + Else + clsBaseOperator.RemoveParameterByName("scale_fill_identity") + End If Else + clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon") clsBaseOperator.RemoveParameterByName(strgeomRibbonParameterName0) End If + AddRemoveFacets() AddRemoveGroupBy() End Sub + Private Sub UpdateParameters() clsFacetOperator.RemoveParameterByName("var1") clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) @@ -520,7 +587,6 @@ Public Class dlgSeasonalGraph Private Sub ucrReceiverLines_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLines.ControlValueChanged ListGeomLine() - Points() End Sub Private Sub AddRemoveTheme() @@ -560,7 +626,6 @@ Public Class dlgSeasonalGraph Private Sub ucrChkRibbons_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkRibbons.ControlValueChanged, ucrReceiverRibbons.ControlValueChanged ListGeomLine() - Ribbon() If ucrChkRibbons.Checked Then ucrReceiverRibbons.SetMeAsReceiver() Else @@ -568,10 +633,6 @@ Public Class dlgSeasonalGraph End If End Sub - Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged - TestOkEnabled() - End Sub - Private Sub ucrReceiverX_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverX.ControlValueChanged Dim variableNames As String = String.Join(",", ucrReceiverX.GetVariableNames()) ' Concatenate the variable names with commas @@ -585,70 +646,19 @@ Public Class dlgSeasonalGraph End If End Sub - Private Sub Ribbon() - If ucrChkAddpointRibbon.Checked Then - ' Iterate over each parameter in the list - For Each selectedItem As ListViewItem In ucrReceiverRibbons.lstSelectedVariables.Items - Dim clsAesGeompointFunction1 As New RFunction - clsAesGeompointFunction1.SetPackageName("ggplot2") - clsAesGeompointFunction1.SetRCommand("aes") - clsAesGeompointFunction1.AddParameter("y", selectedItem.Text, iPosition:=0) - - Dim clsGeomPointFunction1 As New RFunction - clsGeomPointFunction1.SetPackageName("ggplot2") - clsGeomPointFunction1.SetRCommand("geom_point") - clsGeomPointFunction1.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction1, iPosition:=1) - - ' Add geom_point function to the base operator with a unique parameter name - clsBaseOperator.AddParameter(strGeompointParameterName1 & ucrReceiverRibbons.lstSelectedVariables.Items.IndexOf(selectedItem), clsRFunctionParameter:=clsGeomPointFunction1, iPosition:=11) - Next - Else - ' If checkbox is unchecked, remove the parameters - clsBaseOperator.RemoveParameterByName(strGeompointParameterName1) - End If - End Sub - - Private Sub Points() - If ucrChkAddPoint.Checked Then - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 - Dim clsAesGeompointFunction As New RFunction - clsAesGeompointFunction.SetPackageName("ggplot2") - clsAesGeompointFunction.SetRCommand("aes") - clsAesGeompointFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) - - Dim clsGeomPointFunction As New RFunction - clsGeomPointFunction.SetPackageName("ggplot2") - clsGeomPointFunction.SetRCommand("geom_point") - clsGeomPointFunction.AddParameter("mapping", clsRFunctionParameter:=clsAesGeompointFunction, iPosition:=1) - - ' Add geom_point function to the base operator - clsBaseOperator.AddParameter(strGeompointParameterName & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=8) - Next - Else - clsBaseOperator.RemoveParameterByName(strGeompointParameterName) - End If - End Sub - Private Sub ucrChkAddPoint_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddPoint.ControlValueChanged - Points() + ListGeomLine() End Sub Private Sub ucrChkFill_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkFill.ControlValueChanged, ucrChkColour.ControlValueChanged, ucrInputFill.ControlValueChanged, ucrInputColour.ControlValueChanged - If ucrChkFill.Checked AndAlso Not ucrInputFill.IsEmpty Then - clsScalefillidentityFunction.AddParameter("labels", ucrInputFill.clsRList.ToScript(), iPosition:=2) - clsBaseOperator.AddParameter("scale_fill_identity", clsRFunctionParameter:=clsScalefillidentityFunction, iPosition:=12) - Else - clsBaseOperator.RemoveParameterByName("scale_fill_identity") - End If - If ucrChkColour.Checked AndAlso Not ucrInputColour.IsEmpty Then - clsScalecolouridentityFunction.AddParameter("labels", ucrInputColour.clsRList.ToScript(), iPosition:=2) - clsBaseOperator.AddParameter("scale_colour_identity", clsRFunctionParameter:=clsScalecolouridentityFunction, iPosition:=13) - Else - clsBaseOperator.RemoveParameterByName("scale_colour_identity") - End If + ListGeomLine() End Sub Private Sub ucrChkAddpointRibbon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddpointRibbon.ControlValueChanged - Ribbon() + ListGeomLine() + End Sub + + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged + TestOkEnabled() End Sub End Class \ No newline at end of file From 43f0f2640fb230609016a8fbd32c6e3587edade6 Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Fri, 21 Jun 2024 17:08:43 +0300 Subject: [PATCH 50/83] Added scalar checkbox --- instat/dlgEnter.Designer.vb | 283 ++++++++++++++++++------------------ instat/dlgEnter.vb | 75 ++++++++-- 2 files changed, 204 insertions(+), 154 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 3794796db6d..ec74ba263e5 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -78,12 +78,12 @@ Partial Class dlgEnter Me.ttEnter = New System.Windows.Forms.ToolTip(Me.components) Me.ucrSaveEnterResultInto = New instat.ucrSave() Me.ucrTryModelling = New instat.ucrTry() - Me.ucrDataFrameEnter = New instat.ucrDataFrame() Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() Me.ucrBase = New instat.ucrButtons() Me.cmdRHelp = New instat.ucrSplitButton() Me.ContextMenuStripBase = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ToolStripMenuBase = New System.Windows.Forms.ToolStripMenuItem() + Me.ucrSelectorEnter = New instat.ucrSelectorByDataFrameAddRemove() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.ContextMenuStripBase.SuspendLayout() @@ -93,9 +93,10 @@ Partial Class dlgEnter ' Me.chkShowEnterArguments.AutoSize = True Me.chkShowEnterArguments.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.chkShowEnterArguments.Location = New System.Drawing.Point(307, 18) + Me.chkShowEnterArguments.Location = New System.Drawing.Point(460, 27) + Me.chkShowEnterArguments.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkShowEnterArguments.Name = "chkShowEnterArguments" - Me.chkShowEnterArguments.Size = New System.Drawing.Size(109, 17) + Me.chkShowEnterArguments.Size = New System.Drawing.Size(161, 24) Me.chkShowEnterArguments.TabIndex = 155 Me.chkShowEnterArguments.Text = "Show Parameters" Me.chkShowEnterArguments.UseVisualStyleBackColor = True @@ -104,10 +105,9 @@ Partial Class dlgEnter ' Me.lblData.AutoSize = True Me.lblData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblData.Location = New System.Drawing.Point(10, 20) - Me.lblData.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblData.Location = New System.Drawing.Point(15, 30) Me.lblData.Name = "lblData" - Me.lblData.Size = New System.Drawing.Size(33, 13) + Me.lblData.Size = New System.Drawing.Size(48, 20) Me.lblData.TabIndex = 152 Me.lblData.Tag = "Data" Me.lblData.Text = "Data:" @@ -115,10 +115,10 @@ Partial Class dlgEnter 'cmdQuotes ' Me.cmdQuotes.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdQuotes.Location = New System.Drawing.Point(100, 101) - Me.cmdQuotes.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdQuotes.Location = New System.Drawing.Point(150, 152) + Me.cmdQuotes.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdQuotes.Name = "cmdQuotes" - Me.cmdQuotes.Size = New System.Drawing.Size(49, 30) + Me.cmdQuotes.Size = New System.Drawing.Size(74, 45) Me.cmdQuotes.TabIndex = 142 Me.cmdQuotes.Text = """ """ Me.cmdQuotes.UseVisualStyleBackColor = True @@ -127,10 +127,10 @@ Partial Class dlgEnter ' Me.cmdExponential.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdExponential.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdExponential.Location = New System.Drawing.Point(52, 101) - Me.cmdExponential.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdExponential.Location = New System.Drawing.Point(78, 152) + Me.cmdExponential.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdExponential.Name = "cmdExponential" - Me.cmdExponential.Size = New System.Drawing.Size(49, 30) + Me.cmdExponential.Size = New System.Drawing.Size(74, 45) Me.cmdExponential.TabIndex = 143 Me.cmdExponential.Text = "E" Me.cmdExponential.UseVisualStyleBackColor = True @@ -138,10 +138,10 @@ Partial Class dlgEnter 'cmdConcantenateFunction ' Me.cmdConcantenateFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdConcantenateFunction.Location = New System.Drawing.Point(4, 101) - Me.cmdConcantenateFunction.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdConcantenateFunction.Location = New System.Drawing.Point(6, 152) + Me.cmdConcantenateFunction.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdConcantenateFunction.Name = "cmdConcantenateFunction" - Me.cmdConcantenateFunction.Size = New System.Drawing.Size(49, 30) + Me.cmdConcantenateFunction.Size = New System.Drawing.Size(74, 45) Me.cmdConcantenateFunction.TabIndex = 145 Me.cmdConcantenateFunction.Text = "c( )" Me.cmdConcantenateFunction.UseVisualStyleBackColor = True @@ -150,10 +150,10 @@ Partial Class dlgEnter ' Me.cmdSequenceFunction.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdSequenceFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdSequenceFunction.Location = New System.Drawing.Point(4, 72) - Me.cmdSequenceFunction.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdSequenceFunction.Location = New System.Drawing.Point(6, 108) + Me.cmdSequenceFunction.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdSequenceFunction.Name = "cmdSequenceFunction" - Me.cmdSequenceFunction.Size = New System.Drawing.Size(49, 30) + Me.cmdSequenceFunction.Size = New System.Drawing.Size(74, 45) Me.cmdSequenceFunction.TabIndex = 147 Me.cmdSequenceFunction.Tag = "Del" Me.cmdSequenceFunction.Text = "seq" @@ -163,10 +163,10 @@ Partial Class dlgEnter ' Me.cmdRepelicationFunction.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdRepelicationFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRepelicationFunction.Location = New System.Drawing.Point(4, 43) - Me.cmdRepelicationFunction.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRepelicationFunction.Location = New System.Drawing.Point(6, 64) + Me.cmdRepelicationFunction.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdRepelicationFunction.Name = "cmdRepelicationFunction" - Me.cmdRepelicationFunction.Size = New System.Drawing.Size(49, 30) + Me.cmdRepelicationFunction.Size = New System.Drawing.Size(74, 45) Me.cmdRepelicationFunction.TabIndex = 148 Me.cmdRepelicationFunction.Text = "rep" Me.cmdRepelicationFunction.UseVisualStyleBackColor = True @@ -174,10 +174,10 @@ Partial Class dlgEnter 'cmdLogical ' Me.cmdLogical.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdLogical.Location = New System.Drawing.Point(100, 72) - Me.cmdLogical.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdLogical.Location = New System.Drawing.Point(150, 108) + Me.cmdLogical.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdLogical.Name = "cmdLogical" - Me.cmdLogical.Size = New System.Drawing.Size(49, 30) + Me.cmdLogical.Size = New System.Drawing.Size(74, 45) Me.cmdLogical.TabIndex = 149 Me.cmdLogical.Text = "logical" Me.cmdLogical.UseVisualStyleBackColor = True @@ -185,10 +185,10 @@ Partial Class dlgEnter 'cmdPi ' Me.cmdPi.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdPi.Location = New System.Drawing.Point(52, 72) - Me.cmdPi.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPi.Location = New System.Drawing.Point(78, 108) + Me.cmdPi.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdPi.Name = "cmdPi" - Me.cmdPi.Size = New System.Drawing.Size(49, 30) + Me.cmdPi.Size = New System.Drawing.Size(74, 45) Me.cmdPi.TabIndex = 149 Me.cmdPi.Text = "pi" Me.cmdPi.UseVisualStyleBackColor = True @@ -196,10 +196,10 @@ Partial Class dlgEnter 'cmdLetters2 ' Me.cmdLetters2.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdLetters2.Location = New System.Drawing.Point(52, 14) - Me.cmdLetters2.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdLetters2.Location = New System.Drawing.Point(78, 21) + Me.cmdLetters2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdLetters2.Name = "cmdLetters2" - Me.cmdLetters2.Size = New System.Drawing.Size(49, 30) + Me.cmdLetters2.Size = New System.Drawing.Size(74, 45) Me.cmdLetters2.TabIndex = 152 Me.cmdLetters2.Text = "letters" Me.cmdLetters2.UseVisualStyleBackColor = True @@ -207,10 +207,10 @@ Partial Class dlgEnter 'cmdMonths ' Me.cmdMonths.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMonths.Location = New System.Drawing.Point(52, 43) - Me.cmdMonths.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdMonths.Location = New System.Drawing.Point(78, 64) + Me.cmdMonths.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdMonths.Name = "cmdMonths" - Me.cmdMonths.Size = New System.Drawing.Size(49, 30) + Me.cmdMonths.Size = New System.Drawing.Size(74, 45) Me.cmdMonths.TabIndex = 151 Me.cmdMonths.Text = "months " Me.cmdMonths.UseVisualStyleBackColor = True @@ -219,10 +219,10 @@ Partial Class dlgEnter ' Me.cmdColon.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdColon.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdColon.Location = New System.Drawing.Point(4, 14) - Me.cmdColon.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdColon.Location = New System.Drawing.Point(6, 21) + Me.cmdColon.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdColon.Name = "cmdColon" - Me.cmdColon.Size = New System.Drawing.Size(49, 30) + Me.cmdColon.Size = New System.Drawing.Size(74, 45) Me.cmdColon.TabIndex = 151 Me.cmdColon.Text = "[:]" Me.cmdColon.UseVisualStyleBackColor = True @@ -241,11 +241,11 @@ Partial Class dlgEnter Me.grpEnterKeyboard2.Controls.Add(Me.cmdConcantenateFunction) Me.grpEnterKeyboard2.Controls.Add(Me.cmdExponential) Me.grpEnterKeyboard2.Controls.Add(Me.cmdQuotes) - Me.grpEnterKeyboard2.Location = New System.Drawing.Point(378, 50) - Me.grpEnterKeyboard2.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.grpEnterKeyboard2.Location = New System.Drawing.Point(662, 75) + Me.grpEnterKeyboard2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.grpEnterKeyboard2.Name = "grpEnterKeyboard2" - Me.grpEnterKeyboard2.Padding = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.grpEnterKeyboard2.Size = New System.Drawing.Size(156, 134) + Me.grpEnterKeyboard2.Padding = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.grpEnterKeyboard2.Size = New System.Drawing.Size(234, 201) Me.grpEnterKeyboard2.TabIndex = 159 Me.grpEnterKeyboard2.TabStop = False ' @@ -253,10 +253,10 @@ Partial Class dlgEnter ' Me.cmdText.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdText.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdText.Location = New System.Drawing.Point(100, 43) - Me.cmdText.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdText.Location = New System.Drawing.Point(150, 64) + Me.cmdText.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdText.Name = "cmdText" - Me.cmdText.Size = New System.Drawing.Size(49, 30) + Me.cmdText.Size = New System.Drawing.Size(74, 45) Me.cmdText.TabIndex = 155 Me.cmdText.Text = "text" Me.cmdText.UseVisualStyleBackColor = True @@ -265,10 +265,10 @@ Partial Class dlgEnter ' Me.cmdFactor.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdFactor.Location = New System.Drawing.Point(100, 14) - Me.cmdFactor.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdFactor.Location = New System.Drawing.Point(150, 21) + Me.cmdFactor.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdFactor.Name = "cmdFactor" - Me.cmdFactor.Size = New System.Drawing.Size(49, 30) + Me.cmdFactor.Size = New System.Drawing.Size(74, 45) Me.cmdFactor.TabIndex = 153 Me.cmdFactor.Text = "factor " Me.cmdFactor.UseVisualStyleBackColor = True @@ -276,10 +276,9 @@ Partial Class dlgEnter 'btnExample ' Me.btnExample.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnExample.Location = New System.Drawing.Point(436, 16) - Me.btnExample.Margin = New System.Windows.Forms.Padding(2) + Me.btnExample.Location = New System.Drawing.Point(654, 24) Me.btnExample.Name = "btnExample" - Me.btnExample.Size = New System.Drawing.Size(64, 22) + Me.btnExample.Size = New System.Drawing.Size(96, 33) Me.btnExample.TabIndex = 161 Me.btnExample.Text = "Examples" Me.btnExample.UseVisualStyleBackColor = True @@ -305,21 +304,21 @@ Partial Class dlgEnter Me.grpBasic.Controls.Add(Me.cmd2) Me.grpBasic.Controls.Add(Me.cmd0) Me.grpBasic.Controls.Add(Me.cmd1) - Me.grpBasic.Location = New System.Drawing.Point(170, 51) - Me.grpBasic.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.grpBasic.Location = New System.Drawing.Point(350, 76) + Me.grpBasic.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.grpBasic.Name = "grpBasic" - Me.grpBasic.Padding = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.grpBasic.Size = New System.Drawing.Size(205, 134) + Me.grpBasic.Padding = New System.Windows.Forms.Padding(3, 4, 3, 4) + Me.grpBasic.Size = New System.Drawing.Size(308, 201) Me.grpBasic.TabIndex = 180 Me.grpBasic.TabStop = False ' 'cmdClear ' Me.cmdClear.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdClear.Location = New System.Drawing.Point(151, 71) - Me.cmdClear.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdClear.Location = New System.Drawing.Point(226, 106) + Me.cmdClear.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdClear.Name = "cmdClear" - Me.cmdClear.Size = New System.Drawing.Size(49, 60) + Me.cmdClear.Size = New System.Drawing.Size(74, 90) Me.cmdClear.TabIndex = 190 Me.cmdClear.Text = "Clear" Me.cmdClear.UseVisualStyleBackColor = True @@ -328,10 +327,10 @@ Partial Class dlgEnter ' Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!) Me.Button1.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Button1.Location = New System.Drawing.Point(3, 100) - Me.Button1.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.Button1.Location = New System.Drawing.Point(4, 150) + Me.Button1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(38, 30) + Me.Button1.Size = New System.Drawing.Size(57, 45) Me.Button1.TabIndex = 138 Me.Button1.Text = "," Me.Button1.UseVisualStyleBackColor = True @@ -339,10 +338,10 @@ Partial Class dlgEnter 'cmdBrackets ' Me.cmdBrackets.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdBrackets.Location = New System.Drawing.Point(77, 100) - Me.cmdBrackets.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdBrackets.Location = New System.Drawing.Point(116, 150) + Me.cmdBrackets.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdBrackets.Name = "cmdBrackets" - Me.cmdBrackets.Size = New System.Drawing.Size(38, 30) + Me.cmdBrackets.Size = New System.Drawing.Size(57, 45) Me.cmdBrackets.TabIndex = 136 Me.cmdBrackets.Text = "( )" Me.cmdBrackets.UseVisualStyleBackColor = True @@ -351,10 +350,10 @@ Partial Class dlgEnter ' Me.cmdPower.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!) Me.cmdPower.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdPower.Location = New System.Drawing.Point(151, 42) - Me.cmdPower.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPower.Location = New System.Drawing.Point(226, 63) + Me.cmdPower.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdPower.Name = "cmdPower" - Me.cmdPower.Size = New System.Drawing.Size(49, 30) + Me.cmdPower.Size = New System.Drawing.Size(74, 45) Me.cmdPower.TabIndex = 133 Me.cmdPower.Text = "^" Me.cmdPower.UseVisualStyleBackColor = True @@ -363,10 +362,10 @@ Partial Class dlgEnter ' Me.cmdDivide.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!) Me.cmdDivide.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdDivide.Location = New System.Drawing.Point(114, 13) - Me.cmdDivide.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdDivide.Location = New System.Drawing.Point(171, 20) + Me.cmdDivide.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdDivide.Name = "cmdDivide" - Me.cmdDivide.Size = New System.Drawing.Size(38, 30) + Me.cmdDivide.Size = New System.Drawing.Size(57, 45) Me.cmdDivide.TabIndex = 131 Me.cmdDivide.Text = "/" Me.cmdDivide.UseVisualStyleBackColor = True @@ -375,10 +374,10 @@ Partial Class dlgEnter ' Me.cmdPlus.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!) Me.cmdPlus.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdPlus.Location = New System.Drawing.Point(114, 100) - Me.cmdPlus.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdPlus.Location = New System.Drawing.Point(171, 150) + Me.cmdPlus.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdPlus.Name = "cmdPlus" - Me.cmdPlus.Size = New System.Drawing.Size(38, 30) + Me.cmdPlus.Size = New System.Drawing.Size(57, 45) Me.cmdPlus.TabIndex = 130 Me.cmdPlus.Text = "+" Me.cmdPlus.UseVisualStyleBackColor = True @@ -387,10 +386,10 @@ Partial Class dlgEnter ' Me.cmdMinus.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!) Me.cmdMinus.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMinus.Location = New System.Drawing.Point(114, 71) - Me.cmdMinus.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdMinus.Location = New System.Drawing.Point(171, 106) + Me.cmdMinus.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdMinus.Name = "cmdMinus" - Me.cmdMinus.Size = New System.Drawing.Size(38, 30) + Me.cmdMinus.Size = New System.Drawing.Size(57, 45) Me.cmdMinus.TabIndex = 129 Me.cmdMinus.Text = "-" Me.cmdMinus.UseVisualStyleBackColor = True @@ -399,10 +398,10 @@ Partial Class dlgEnter ' Me.cmdMultiply.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!) Me.cmdMultiply.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdMultiply.Location = New System.Drawing.Point(114, 42) - Me.cmdMultiply.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdMultiply.Location = New System.Drawing.Point(171, 63) + Me.cmdMultiply.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmdMultiply.Name = "cmdMultiply" - Me.cmdMultiply.Size = New System.Drawing.Size(38, 30) + Me.cmdMultiply.Size = New System.Drawing.Size(57, 45) Me.cmdMultiply.TabIndex = 128 Me.cmdMultiply.Text = "*" Me.cmdMultiply.UseVisualStyleBackColor = True @@ -411,10 +410,10 @@ Partial Class dlgEnter ' Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!) Me.Button2.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Button2.Location = New System.Drawing.Point(151, 13) - Me.Button2.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.Button2.Location = New System.Drawing.Point(226, 20) + Me.Button2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Button2.Name = "Button2" - Me.Button2.Size = New System.Drawing.Size(49, 30) + Me.Button2.Size = New System.Drawing.Size(74, 45) Me.Button2.TabIndex = 127 Me.Button2.Text = "." Me.Button2.UseVisualStyleBackColor = True @@ -422,10 +421,10 @@ Partial Class dlgEnter 'cmd9 ' Me.cmd9.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd9.Location = New System.Drawing.Point(77, 13) - Me.cmd9.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd9.Location = New System.Drawing.Point(116, 20) + Me.cmd9.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd9.Name = "cmd9" - Me.cmd9.Size = New System.Drawing.Size(38, 30) + Me.cmd9.Size = New System.Drawing.Size(57, 45) Me.cmd9.TabIndex = 126 Me.cmd9.Text = "9" Me.cmd9.UseVisualStyleBackColor = True @@ -433,10 +432,10 @@ Partial Class dlgEnter 'cmd8 ' Me.cmd8.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd8.Location = New System.Drawing.Point(40, 13) - Me.cmd8.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd8.Location = New System.Drawing.Point(60, 20) + Me.cmd8.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd8.Name = "cmd8" - Me.cmd8.Size = New System.Drawing.Size(38, 30) + Me.cmd8.Size = New System.Drawing.Size(57, 45) Me.cmd8.TabIndex = 125 Me.cmd8.Text = "8" Me.cmd8.UseVisualStyleBackColor = True @@ -444,10 +443,10 @@ Partial Class dlgEnter 'cmd7 ' Me.cmd7.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd7.Location = New System.Drawing.Point(3, 13) - Me.cmd7.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd7.Location = New System.Drawing.Point(4, 20) + Me.cmd7.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd7.Name = "cmd7" - Me.cmd7.Size = New System.Drawing.Size(38, 30) + Me.cmd7.Size = New System.Drawing.Size(57, 45) Me.cmd7.TabIndex = 124 Me.cmd7.Text = "7" Me.cmd7.UseVisualStyleBackColor = True @@ -455,10 +454,10 @@ Partial Class dlgEnter 'cmd6 ' Me.cmd6.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd6.Location = New System.Drawing.Point(77, 42) - Me.cmd6.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd6.Location = New System.Drawing.Point(116, 63) + Me.cmd6.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd6.Name = "cmd6" - Me.cmd6.Size = New System.Drawing.Size(38, 30) + Me.cmd6.Size = New System.Drawing.Size(57, 45) Me.cmd6.TabIndex = 123 Me.cmd6.Text = "6" Me.cmd6.UseVisualStyleBackColor = True @@ -466,10 +465,10 @@ Partial Class dlgEnter 'cmd5 ' Me.cmd5.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd5.Location = New System.Drawing.Point(40, 42) - Me.cmd5.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd5.Location = New System.Drawing.Point(60, 63) + Me.cmd5.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd5.Name = "cmd5" - Me.cmd5.Size = New System.Drawing.Size(38, 30) + Me.cmd5.Size = New System.Drawing.Size(57, 45) Me.cmd5.TabIndex = 122 Me.cmd5.Text = "5" Me.cmd5.UseVisualStyleBackColor = True @@ -477,10 +476,10 @@ Partial Class dlgEnter 'cmd4 ' Me.cmd4.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd4.Location = New System.Drawing.Point(3, 42) - Me.cmd4.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd4.Location = New System.Drawing.Point(4, 63) + Me.cmd4.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd4.Name = "cmd4" - Me.cmd4.Size = New System.Drawing.Size(38, 30) + Me.cmd4.Size = New System.Drawing.Size(57, 45) Me.cmd4.TabIndex = 121 Me.cmd4.Text = "4" Me.cmd4.UseVisualStyleBackColor = True @@ -488,10 +487,10 @@ Partial Class dlgEnter 'cmd3 ' Me.cmd3.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd3.Location = New System.Drawing.Point(77, 71) - Me.cmd3.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd3.Location = New System.Drawing.Point(116, 106) + Me.cmd3.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd3.Name = "cmd3" - Me.cmd3.Size = New System.Drawing.Size(38, 30) + Me.cmd3.Size = New System.Drawing.Size(57, 45) Me.cmd3.TabIndex = 120 Me.cmd3.Text = "3" Me.cmd3.UseVisualStyleBackColor = True @@ -499,10 +498,10 @@ Partial Class dlgEnter 'cmd2 ' Me.cmd2.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd2.Location = New System.Drawing.Point(40, 71) - Me.cmd2.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd2.Location = New System.Drawing.Point(60, 106) + Me.cmd2.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd2.Name = "cmd2" - Me.cmd2.Size = New System.Drawing.Size(38, 30) + Me.cmd2.Size = New System.Drawing.Size(57, 45) Me.cmd2.TabIndex = 119 Me.cmd2.Text = "2" Me.cmd2.UseVisualStyleBackColor = True @@ -510,10 +509,10 @@ Partial Class dlgEnter 'cmd0 ' Me.cmd0.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd0.Location = New System.Drawing.Point(40, 100) - Me.cmd0.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd0.Location = New System.Drawing.Point(60, 150) + Me.cmd0.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd0.Name = "cmd0" - Me.cmd0.Size = New System.Drawing.Size(38, 30) + Me.cmd0.Size = New System.Drawing.Size(57, 45) Me.cmd0.TabIndex = 118 Me.cmd0.Text = "0" Me.cmd0.UseVisualStyleBackColor = True @@ -521,10 +520,10 @@ Partial Class dlgEnter 'cmd1 ' Me.cmd1.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmd1.Location = New System.Drawing.Point(3, 71) - Me.cmd1.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmd1.Location = New System.Drawing.Point(4, 106) + Me.cmd1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.cmd1.Name = "cmd1" - Me.cmd1.Size = New System.Drawing.Size(38, 30) + Me.cmd1.Size = New System.Drawing.Size(57, 45) Me.cmd1.TabIndex = 117 Me.cmd1.Text = "1" Me.cmd1.UseVisualStyleBackColor = True @@ -532,41 +531,31 @@ Partial Class dlgEnter 'ucrSaveEnterResultInto ' Me.ucrSaveEnterResultInto.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(11, 243) - Me.ucrSaveEnterResultInto.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(10, 401) + Me.ucrSaveEnterResultInto.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" - Me.ucrSaveEnterResultInto.Size = New System.Drawing.Size(280, 22) + Me.ucrSaveEnterResultInto.Size = New System.Drawing.Size(420, 33) Me.ucrSaveEnterResultInto.TabIndex = 181 ' 'ucrTryModelling ' Me.ucrTryModelling.AutoSize = True - Me.ucrTryModelling.Location = New System.Drawing.Point(3, 202) + Me.ucrTryModelling.Location = New System.Drawing.Point(-2, 340) + Me.ucrTryModelling.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrTryModelling.Name = "ucrTryModelling" Me.ucrTryModelling.RunCommandAsMultipleLines = False - Me.ucrTryModelling.Size = New System.Drawing.Size(480, 33) + Me.ucrTryModelling.Size = New System.Drawing.Size(720, 55) Me.ucrTryModelling.TabIndex = 160 ' - 'ucrDataFrameEnter - ' - Me.ucrDataFrameEnter.AutoSize = True - Me.ucrDataFrameEnter.bDropUnusedFilterLevels = False - Me.ucrDataFrameEnter.bUseCurrentFilter = True - Me.ucrDataFrameEnter.Location = New System.Drawing.Point(11, 55) - Me.ucrDataFrameEnter.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameEnter.Name = "ucrDataFrameEnter" - Me.ucrDataFrameEnter.Size = New System.Drawing.Size(151, 43) - Me.ucrDataFrameEnter.TabIndex = 156 - ' 'ucrReceiverForEnterCalculation ' Me.ucrReceiverForEnterCalculation.AutoSize = True Me.ucrReceiverForEnterCalculation.frmParent = Me - Me.ucrReceiverForEnterCalculation.Location = New System.Drawing.Point(69, 16) - Me.ucrReceiverForEnterCalculation.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.ucrReceiverForEnterCalculation.Location = New System.Drawing.Point(104, 24) + Me.ucrReceiverForEnterCalculation.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.ucrReceiverForEnterCalculation.Name = "ucrReceiverForEnterCalculation" Me.ucrReceiverForEnterCalculation.Selector = Nothing - Me.ucrReceiverForEnterCalculation.Size = New System.Drawing.Size(229, 28) + Me.ucrReceiverForEnterCalculation.Size = New System.Drawing.Size(344, 42) Me.ucrReceiverForEnterCalculation.strNcFilePath = "" Me.ucrReceiverForEnterCalculation.TabIndex = 153 Me.ucrReceiverForEnterCalculation.ucrSelector = Nothing @@ -575,18 +564,20 @@ Partial Class dlgEnter ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(11, 278) + Me.ucrBase.Location = New System.Drawing.Point(10, 454) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 0 ' 'cmdRHelp ' Me.cmdRHelp.AutoSize = True Me.cmdRHelp.ContextMenuStrip = Me.ContextMenuStripBase - Me.cmdRHelp.Location = New System.Drawing.Point(459, 187) + Me.cmdRHelp.Location = New System.Drawing.Point(789, 280) + Me.cmdRHelp.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.cmdRHelp.Name = "cmdRHelp" - Me.cmdRHelp.Size = New System.Drawing.Size(68, 23) + Me.cmdRHelp.Size = New System.Drawing.Size(102, 34) Me.cmdRHelp.SplitMenuStrip = Me.ContextMenuStripBase Me.cmdRHelp.TabIndex = 213 Me.cmdRHelp.Text = "R Help" @@ -594,34 +585,48 @@ Partial Class dlgEnter ' 'ContextMenuStripBase ' + Me.ContextMenuStripBase.ImageScalingSize = New System.Drawing.Size(24, 24) Me.ContextMenuStripBase.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuBase}) Me.ContextMenuStripBase.Name = "ContextMenuStrip1" - Me.ContextMenuStripBase.Size = New System.Drawing.Size(99, 26) + Me.ContextMenuStripBase.Size = New System.Drawing.Size(122, 36) ' 'ToolStripMenuBase ' Me.ToolStripMenuBase.Name = "ToolStripMenuBase" - Me.ToolStripMenuBase.Size = New System.Drawing.Size(98, 22) + Me.ToolStripMenuBase.Size = New System.Drawing.Size(121, 32) Me.ToolStripMenuBase.Text = "base" ' + 'ucrSelectorEnter + ' + Me.ucrSelectorEnter.AutoSize = True + Me.ucrSelectorEnter.bDropUnusedFilterLevels = False + Me.ucrSelectorEnter.bShowHiddenColumns = False + Me.ucrSelectorEnter.bUseCurrentFilter = True + Me.ucrSelectorEnter.Location = New System.Drawing.Point(19, 62) + Me.ucrSelectorEnter.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorEnter.Name = "ucrSelectorEnter" + Me.ucrSelectorEnter.Size = New System.Drawing.Size(318, 274) + Me.ucrSelectorEnter.TabIndex = 214 + ' 'dlgEnter ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(538, 336) + Me.ClientSize = New System.Drawing.Size(910, 534) + Me.Controls.Add(Me.ucrSelectorEnter) Me.Controls.Add(Me.cmdRHelp) Me.Controls.Add(Me.ucrSaveEnterResultInto) Me.Controls.Add(Me.grpBasic) Me.Controls.Add(Me.btnExample) Me.Controls.Add(Me.ucrTryModelling) Me.Controls.Add(Me.grpEnterKeyboard2) - Me.Controls.Add(Me.ucrDataFrameEnter) Me.Controls.Add(Me.chkShowEnterArguments) Me.Controls.Add(Me.lblData) Me.Controls.Add(Me.ucrReceiverForEnterCalculation) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgEnter" @@ -639,7 +644,6 @@ Partial Class dlgEnter Friend WithEvents chkShowEnterArguments As CheckBox Friend WithEvents lblData As Label Friend WithEvents ucrReceiverForEnterCalculation As ucrReceiverExpression - Friend WithEvents ucrDataFrameEnter As ucrDataFrame Friend WithEvents cmdQuotes As Button Friend WithEvents cmdExponential As Button Friend WithEvents cmdConcantenateFunction As Button @@ -680,4 +684,5 @@ Partial Class dlgEnter Friend WithEvents cmdRHelp As ucrSplitButton Friend WithEvents ContextMenuStripBase As ContextMenuStrip Friend WithEvents ToolStripMenuBase As ToolStripMenuItem + Friend WithEvents ucrSelectorEnter As ucrSelectorByDataFrameAddRemove End Class diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 935c6daae1a..33ce346149b 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -17,14 +17,11 @@ Imports instat.Translations Imports RDotNet Public Class dlgEnter - Dim dataset As DataFrame - Dim clsAttach As New RFunction - Dim clsDetach As New RFunction - Dim clsLength As New RFunction - Public bFirstLoad As Boolean = True - Public strOutput As String + Private clsAttach As New RFunction + Private clsDetach As New RFunction + Private clsAttachScalarsFunction, clsDetachScalarsFunction, clsScalarsDataFuntion, clsAddScalarFunction As New RFunction + Private bFirstLoad As Boolean = True Private strPackageName As String - Public clsCommands As New RFunction Private Sub dlgEnter_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -37,26 +34,55 @@ Public Class dlgEnter TestOKEnabled() autoTranslate(Me) End Sub + Private Sub SetEntryHistory() ucrReceiverForEnterCalculation.AddtoCombobox(ucrReceiverForEnterCalculation.GetText) End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 458 + + ucrSelectorEnter.SetItemType("scalar") + ucrSelectorEnter.ShowCheckBoxScalar(True) + ucrSelectorEnter.HideShowAddOrDataOptionsOrListView(bAddVisible:=False, bDataOptionsVisible:=False, bListVariables:=False) + + ucrReceiverForEnterCalculation.strSelectorHeading = "Scalars" + ucrReceiverForEnterCalculation.Selector = ucrSelectorEnter + ucrTryModelling.SetReceiver(ucrReceiverForEnterCalculation) ucrTryModelling.SetIsCommand() ucrTryModelling.StrvecOutputRequired() + + + clsAddScalarFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$add_scalar") + + clsScalarsDataFuntion.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_scalars") + clsScalarsDataFuntion.SetAssignTo("scalars") + + + clsAttachScalarsFunction.SetRCommand("attach") + clsDetachScalarsFunction.SetRCommand("detach") + clsAttachScalarsFunction.AddParameter("what", clsRFunctionParameter:=clsScalarsDataFuntion) + clsDetachScalarsFunction.AddParameter("name", "scalars") + clsDetachScalarsFunction.AddParameter("unload", "TRUE") + clsAttach.SetRCommand("attach") - clsAttach.AddParameter("what", clsRFunctionParameter:=ucrDataFrameEnter.clsCurrDataFrame) + clsAttach.AddParameter("what", clsRFunctionParameter:=ucrSelectorEnter.ucrAvailableDataFrames.clsCurrDataFrame) clsDetach.SetRCommand("detach") - clsDetach.AddParameter("name", clsRFunctionParameter:=ucrDataFrameEnter.clsCurrDataFrame) clsDetach.AddParameter("unload", "TRUE") + ucrBase.clsRsyntax.SetCommandString("") + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach, 0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttachScalarsFunction, 1) + + ucrBase.clsRsyntax.AddToAfterCodes(clsDetach, 0) + ucrBase.clsRsyntax.AddToAfterCodes(clsDetachScalarsFunction, 1) + ucrSaveEnterResultInto.SetPrefix("enter") - ucrSaveEnterResultInto.SetDataFrameSelector(ucrDataFrameEnter) - ucrSaveEnterResultInto.SetIsComboBox() ucrSaveEnterResultInto.SetSaveTypeAsColumn() + ucrSaveEnterResultInto.SetIsComboBox() ucrSaveEnterResultInto.SetLabelText("Enter Result Into:") + ucrSaveEnterResultInto.SetDataFrameSelector(ucrSelectorEnter.ucrAvailableDataFrames) 'Adding tooltips for the buttons ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") @@ -71,13 +97,25 @@ Public Class dlgEnter ttEnter.SetToolTip(cmdConcantenateFunction, "Combines arguments to form a single vector, e.g. c(1:3 8) is 1, 2, 3, 8.") ttEnter.SetToolTip(cmdExponential, "For scientific notation, e.g. 1.5E-1 = 0.15.") - ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) - ucrBase.clsRsyntax.AddToAfterCodes(clsDetach) + + AddHandler ucrSelectorEnter.checkBoxScalar.CheckedChanged, AddressOf checkBoxScalar_CheckedChanged + + End Sub + + Private Sub checkBoxScalar_CheckedChanged() + If ucrSelectorEnter.checkBoxScalar.Checked Then + ucrSelectorEnter.HideShowAddOrDataOptionsOrListView(bAddVisible:=True, bDataOptionsVisible:=False, bListVariables:=True) + Else + ucrSelectorEnter.HideShowAddOrDataOptionsOrListView(bAddVisible:=False, bDataOptionsVisible:=False, bListVariables:=False) + End If End Sub + Private Sub SetDefaults() chkShowEnterArguments.Checked = False - ucrDataFrameEnter.Reset() + ucrSelectorEnter.Reset() + ucrSelectorEnter.checkBoxScalar.Checked = False ucrReceiverForEnterCalculation.Clear() + ucrReceiverForEnterCalculation.SetMeAsReceiver() ucrTryModelling.SetRSyntax(ucrBase.clsRsyntax) ucrSaveEnterResultInto.SetRCode(ucrBase.clsRsyntax.clsBaseCommandString) End Sub @@ -94,7 +132,7 @@ Public Class dlgEnter Private Sub SaveResults() If ucrSaveEnterResultInto.IsComplete Then - ucrBase.clsRsyntax.SetAssignTo(ucrSaveEnterResultInto.GetText(), strTempColumn:=ucrSaveEnterResultInto.GetText(), strTempDataframe:=ucrDataFrameEnter.cboAvailableDataFrames.Text, bRequireCorrectLength:=False) + ucrBase.clsRsyntax.SetAssignTo(ucrSaveEnterResultInto.GetText(), strTempColumn:=ucrSaveEnterResultInto.GetText(), strTempDataframe:=ucrSelectorEnter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bRequireCorrectLength:=False) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True ucrBase.clsRsyntax.iCallType = 0 Else @@ -383,4 +421,11 @@ Public Class dlgEnter frmMaximiseOutput.Show(strFileName:=clsFileUrlUtilities.GetHelpFileURL(strPackageName:=strPackageName), bReplace:=False) End If End Sub + + Private Sub ucrSaveEnterResultInto_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveEnterResultInto.ControlValueChanged + Dim strDataFrame As String = ucrSelectorEnter.ucrAvailableDataFrames.strCurrDataFrame + + clsDetach.AddParameter("name", strDataFrame) + clsScalarsDataFuntion.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34)) + End Sub End Class From 311bf6dab4bdb78c7174cf16354f5115b8775b0f Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Fri, 21 Jun 2024 17:20:13 +0300 Subject: [PATCH 51/83] Added store scalar --- instat/dlgEnter.Designer.vb | 29 +++++++++++++++++++++-------- instat/dlgEnter.resx | 2 +- instat/dlgEnter.vb | 36 +++++++++++++++++++++--------------- 3 files changed, 43 insertions(+), 24 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index ec74ba263e5..34aed69b021 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -84,6 +84,7 @@ Partial Class dlgEnter Me.ContextMenuStripBase = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ToolStripMenuBase = New System.Windows.Forms.ToolStripMenuItem() Me.ucrSelectorEnter = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrChkStoreScalar = New instat.ucrCheck() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.ContextMenuStripBase.SuspendLayout() @@ -94,7 +95,7 @@ Partial Class dlgEnter Me.chkShowEnterArguments.AutoSize = True Me.chkShowEnterArguments.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.chkShowEnterArguments.Location = New System.Drawing.Point(460, 27) - Me.chkShowEnterArguments.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.chkShowEnterArguments.Margin = New System.Windows.Forms.Padding(4) Me.chkShowEnterArguments.Name = "chkShowEnterArguments" Me.chkShowEnterArguments.Size = New System.Drawing.Size(161, 24) Me.chkShowEnterArguments.TabIndex = 155 @@ -531,7 +532,7 @@ Partial Class dlgEnter 'ucrSaveEnterResultInto ' Me.ucrSaveEnterResultInto.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(10, 401) + Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(12, 390) Me.ucrSaveEnterResultInto.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" Me.ucrSaveEnterResultInto.Size = New System.Drawing.Size(420, 33) @@ -541,7 +542,7 @@ Partial Class dlgEnter ' Me.ucrTryModelling.AutoSize = True Me.ucrTryModelling.Location = New System.Drawing.Point(-2, 340) - Me.ucrTryModelling.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrTryModelling.Margin = New System.Windows.Forms.Padding(6) Me.ucrTryModelling.Name = "ucrTryModelling" Me.ucrTryModelling.RunCommandAsMultipleLines = False Me.ucrTryModelling.Size = New System.Drawing.Size(720, 55) @@ -564,8 +565,8 @@ Partial Class dlgEnter ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 454) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrBase.Location = New System.Drawing.Point(10, 468) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 0 @@ -575,7 +576,7 @@ Partial Class dlgEnter Me.cmdRHelp.AutoSize = True Me.cmdRHelp.ContextMenuStrip = Me.ContextMenuStripBase Me.cmdRHelp.Location = New System.Drawing.Point(789, 280) - Me.cmdRHelp.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdRHelp.Margin = New System.Windows.Forms.Padding(4) Me.cmdRHelp.Name = "cmdRHelp" Me.cmdRHelp.Size = New System.Drawing.Size(102, 34) Me.cmdRHelp.SplitMenuStrip = Me.ContextMenuStripBase @@ -608,12 +609,23 @@ Partial Class dlgEnter Me.ucrSelectorEnter.Size = New System.Drawing.Size(318, 274) Me.ucrSelectorEnter.TabIndex = 214 ' + 'ucrChkStoreScalar + ' + Me.ucrChkStoreScalar.AutoSize = True + Me.ucrChkStoreScalar.Checked = False + Me.ucrChkStoreScalar.Location = New System.Drawing.Point(13, 426) + Me.ucrChkStoreScalar.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrChkStoreScalar.Name = "ucrChkStoreScalar" + Me.ucrChkStoreScalar.Size = New System.Drawing.Size(199, 34) + Me.ucrChkStoreScalar.TabIndex = 215 + ' 'dlgEnter ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(910, 534) + Me.ClientSize = New System.Drawing.Size(910, 553) + Me.Controls.Add(Me.ucrChkStoreScalar) Me.Controls.Add(Me.ucrSelectorEnter) Me.Controls.Add(Me.cmdRHelp) Me.Controls.Add(Me.ucrSaveEnterResultInto) @@ -626,7 +638,7 @@ Partial Class dlgEnter Me.Controls.Add(Me.ucrReceiverForEnterCalculation) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgEnter" @@ -685,4 +697,5 @@ Partial Class dlgEnter Friend WithEvents ContextMenuStripBase As ContextMenuStrip Friend WithEvents ToolStripMenuBase As ToolStripMenuItem Friend WithEvents ucrSelectorEnter As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrChkStoreScalar As ucrCheck End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 8f2e9555440..df2ac13fdd2 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -121,7 +121,7 @@ 17, 5 - 124 + 25 519, 24 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 33ce346149b..ce0050e6cb3 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -53,13 +53,13 @@ Public Class dlgEnter ucrTryModelling.SetIsCommand() ucrTryModelling.StrvecOutputRequired() + ucrChkStoreScalar.SetText("Store Scalar") clsAddScalarFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$add_scalar") clsScalarsDataFuntion.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_scalars") clsScalarsDataFuntion.SetAssignTo("scalars") - clsAttachScalarsFunction.SetRCommand("attach") clsDetachScalarsFunction.SetRCommand("detach") clsAttachScalarsFunction.AddParameter("what", clsRFunctionParameter:=clsScalarsDataFuntion) @@ -112,6 +112,7 @@ Public Class dlgEnter Private Sub SetDefaults() chkShowEnterArguments.Checked = False + ucrChkStoreScalar.Checked = False ucrSelectorEnter.Reset() ucrSelectorEnter.checkBoxScalar.Checked = False ucrReceiverForEnterCalculation.Clear() @@ -119,9 +120,11 @@ Public Class dlgEnter ucrTryModelling.SetRSyntax(ucrBase.clsRsyntax) ucrSaveEnterResultInto.SetRCode(ucrBase.clsRsyntax.clsBaseCommandString) End Sub + Private Sub ReopenDialog() SaveResults() End Sub + Private Sub TestOKEnabled() If Not ucrReceiverForEnterCalculation.IsEmpty AndAlso ucrSaveEnterResultInto.IsComplete Then ucrBase.OKEnabled(True) @@ -142,25 +145,13 @@ Public Class dlgEnter End If End Sub - Private Sub ucrBase_BeforeClickOk(sender As Object, e As EventArgs) Handles ucrBase.BeforeClickOk - 'Dim strScript As String = "" - 'Dim strFunc As String - 'clsAttach.AddParameter("what", clsRFunctionParameter:=ucrDataFrameEnter.clsCurrDataFrame) - 'strFunc = clsAttach.ToScript(strScript) - ' frmMain.clsRLink.RunScript(strScript & strFunc) - End Sub - Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk - 'Dim strScript As String = "" - ' Dim strFunc As String - 'clsDetach.AddParameter("name", clsRFunctionParameter:=ucrDataFrameEnter.clsCurrDataFrame) - 'strFunc = clsDetach.ToScript(strScript) - 'frmMain.clsRLink.RunScript(strScript & strFunc) SetEntryHistory() End Sub Private Sub ucrReceiverForCalculation_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverForEnterCalculation.SelectionChanged ucrBase.clsRsyntax.SetCommandString(ucrReceiverForEnterCalculation.GetVariableNames(False)) + ucrChkStoreScalar.Checked = False TestOKEnabled() End Sub @@ -232,7 +223,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdLETTERS_Click(sender As Object, e As EventArgs) Handles cmdLogical.Click ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.logical(c( ))", 3) TestOKEnabled() @@ -427,5 +417,21 @@ Public Class dlgEnter clsDetach.AddParameter("name", strDataFrame) clsScalarsDataFuntion.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34)) + clsAddScalarFunction.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34), iPosition:=0) + End Sub + + Private Sub ucrChkStoreScalar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkStoreScalar.ControlValueChanged + If ucrChkStoreScalar.Checked AndAlso Not ucrReceiverForEnterCalculation.IsEmpty Then + ucrSaveEnterResultInto.btnColumnPosition.Enabled = False + ucrSaveEnterResultInto.btnColumnPosition.Visible = True + Dim strResut As String = ucrSaveEnterResultInto.GetText + clsAddScalarFunction.AddParameter("scalar_name", Chr(34) & strResut & Chr(34), iPosition:=1) + clsAddScalarFunction.AddParameter("scalar_value", strResut, iPosition:=2) + ucrBase.clsRsyntax.AddToAfterCodes(clsAddScalarFunction, 2) + Else + ucrSaveEnterResultInto.btnColumnPosition.Enabled = True + ucrSaveEnterResultInto.btnColumnPosition.Visible = True + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsAddScalarFunction) + End If End Sub End Class From 57d49e5a3ae9057246a9281dda74cdffd6477a5d Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Tue, 25 Jun 2024 08:46:47 +0300 Subject: [PATCH 52/83] design changes --- instat/dlgEnter.Designer.vb | 13 +++++++++++++ instat/dlgEnter.vb | 14 +++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 34aed69b021..47717f80ccf 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -85,6 +85,7 @@ Partial Class dlgEnter Me.ToolStripMenuBase = New System.Windows.Forms.ToolStripMenuItem() Me.ucrSelectorEnter = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrChkStoreScalar = New instat.ucrCheck() + Me.checkScalars = New System.Windows.Forms.CheckBox() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.ContextMenuStripBase.SuspendLayout() @@ -619,12 +620,23 @@ Partial Class dlgEnter Me.ucrChkStoreScalar.Size = New System.Drawing.Size(199, 34) Me.ucrChkStoreScalar.TabIndex = 215 ' + 'checkScalars + ' + Me.checkScalars.AutoSize = True + Me.checkScalars.Location = New System.Drawing.Point(350, 289) + Me.checkScalars.Name = "checkScalars" + Me.checkScalars.Size = New System.Drawing.Size(88, 24) + Me.checkScalars.TabIndex = 216 + Me.checkScalars.Text = "Scalars" + Me.checkScalars.UseVisualStyleBackColor = True + ' 'dlgEnter ' Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(910, 553) + Me.Controls.Add(Me.checkScalars) Me.Controls.Add(Me.ucrChkStoreScalar) Me.Controls.Add(Me.ucrSelectorEnter) Me.Controls.Add(Me.cmdRHelp) @@ -698,4 +710,5 @@ Partial Class dlgEnter Friend WithEvents ToolStripMenuBase As ToolStripMenuItem Friend WithEvents ucrSelectorEnter As ucrSelectorByDataFrameAddRemove Friend WithEvents ucrChkStoreScalar As ucrCheck + Friend WithEvents checkScalars As CheckBox End Class diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index ce0050e6cb3..bbafd835be2 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -43,7 +43,6 @@ Public Class dlgEnter ucrBase.iHelpTopicID = 458 ucrSelectorEnter.SetItemType("scalar") - ucrSelectorEnter.ShowCheckBoxScalar(True) ucrSelectorEnter.HideShowAddOrDataOptionsOrListView(bAddVisible:=False, bDataOptionsVisible:=False, bListVariables:=False) ucrReceiverForEnterCalculation.strSelectorHeading = "Scalars" @@ -97,13 +96,10 @@ Public Class dlgEnter ttEnter.SetToolTip(cmdConcantenateFunction, "Combines arguments to form a single vector, e.g. c(1:3 8) is 1, 2, 3, 8.") ttEnter.SetToolTip(cmdExponential, "For scientific notation, e.g. 1.5E-1 = 0.15.") - - AddHandler ucrSelectorEnter.checkBoxScalar.CheckedChanged, AddressOf checkBoxScalar_CheckedChanged - End Sub - Private Sub checkBoxScalar_CheckedChanged() - If ucrSelectorEnter.checkBoxScalar.Checked Then + Private Sub checkScalars_CheckedChanged(sender As Object, e As EventArgs) Handles checkScalars.CheckedChanged + If checkScalars.Checked Then ucrSelectorEnter.HideShowAddOrDataOptionsOrListView(bAddVisible:=True, bDataOptionsVisible:=False, bListVariables:=True) Else ucrSelectorEnter.HideShowAddOrDataOptionsOrListView(bAddVisible:=False, bDataOptionsVisible:=False, bListVariables:=False) @@ -114,7 +110,7 @@ Public Class dlgEnter chkShowEnterArguments.Checked = False ucrChkStoreScalar.Checked = False ucrSelectorEnter.Reset() - ucrSelectorEnter.checkBoxScalar.Checked = False + checkScalars.Checked = False ucrReceiverForEnterCalculation.Clear() ucrReceiverForEnterCalculation.SetMeAsReceiver() ucrTryModelling.SetRSyntax(ucrBase.clsRsyntax) @@ -422,15 +418,11 @@ Public Class dlgEnter Private Sub ucrChkStoreScalar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkStoreScalar.ControlValueChanged If ucrChkStoreScalar.Checked AndAlso Not ucrReceiverForEnterCalculation.IsEmpty Then - ucrSaveEnterResultInto.btnColumnPosition.Enabled = False - ucrSaveEnterResultInto.btnColumnPosition.Visible = True Dim strResut As String = ucrSaveEnterResultInto.GetText clsAddScalarFunction.AddParameter("scalar_name", Chr(34) & strResut & Chr(34), iPosition:=1) clsAddScalarFunction.AddParameter("scalar_value", strResut, iPosition:=2) ucrBase.clsRsyntax.AddToAfterCodes(clsAddScalarFunction, 2) Else - ucrSaveEnterResultInto.btnColumnPosition.Enabled = True - ucrSaveEnterResultInto.btnColumnPosition.Visible = True ucrBase.clsRsyntax.RemoveFromAfterCodes(clsAddScalarFunction) End If End Sub From e34ee478622b23c20ce8b1ed90b1d8422994b505 Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Tue, 25 Jun 2024 09:41:50 +0300 Subject: [PATCH 53/83] code improvement --- instat/dlgEnter.vb | 58 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index bbafd835be2..f2220d1b887 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -77,10 +77,18 @@ Public Class dlgEnter ucrBase.clsRsyntax.AddToAfterCodes(clsDetach, 0) ucrBase.clsRsyntax.AddToAfterCodes(clsDetachScalarsFunction, 1) + ucrSaveEnterResultInto.SetPrefix("enter") + ucrSaveEnterResultInto.SetDataFrameSelector(ucrSelectorEnter.ucrAvailableDataFrames) + ucrSaveEnterResultInto.SetIsComboBox() + ucrSaveEnterResultInto.SetSaveTypeAsColumn() + ucrSaveEnterResultInto.SetCheckBoxText("Enter Result") + ucrSaveEnterResultInto.SetAssignToIfUncheckedValue("last_enter") + ucrSaveEnterResultInto.SetPrefix("enter") ucrSaveEnterResultInto.SetSaveTypeAsColumn() ucrSaveEnterResultInto.SetIsComboBox() - ucrSaveEnterResultInto.SetLabelText("Enter Result Into:") + ucrSaveEnterResultInto.SetCheckBoxText("Enter Result") + ucrSaveEnterResultInto.SetAssignToIfUncheckedValue("last_enter") ucrSaveEnterResultInto.SetDataFrameSelector(ucrSelectorEnter.ucrAvailableDataFrames) 'Adding tooltips for the buttons @@ -111,10 +119,18 @@ Public Class dlgEnter ucrChkStoreScalar.Checked = False ucrSelectorEnter.Reset() checkScalars.Checked = False + ucrSaveEnterResultInto.ucrChkSave.Checked = True ucrReceiverForEnterCalculation.Clear() ucrReceiverForEnterCalculation.SetMeAsReceiver() ucrTryModelling.SetRSyntax(ucrBase.clsRsyntax) ucrSaveEnterResultInto.SetRCode(ucrBase.clsRsyntax.clsBaseCommandString) + SaveResults() + ucrBase.clsRsyntax.SetAssignTo(ucrSaveEnterResultInto.GetText(), strTempColumn:=ucrSaveEnterResultInto.GetText(), + strTempDataframe:=ucrSelectorEnter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, + bAssignToIsPrefix:=ucrBase.clsRsyntax.clsBaseCommandString.bAssignToIsPrefix, + bAssignToColumnWithoutNames:=ucrBase.clsRsyntax.clsBaseCommandString.bAssignToColumnWithoutNames, + bInsertColumnBefore:=ucrBase.clsRsyntax.clsBaseCommandString.bInsertColumnBefore, + bRequireCorrectLength:=ucrBase.clsRsyntax.clsBaseCommandString.bRequireCorrectLength) End Sub Private Sub ReopenDialog() @@ -122,7 +138,8 @@ Public Class dlgEnter End Sub Private Sub TestOKEnabled() - If Not ucrReceiverForEnterCalculation.IsEmpty AndAlso ucrSaveEnterResultInto.IsComplete Then + If Not ucrReceiverForEnterCalculation.IsEmpty AndAlso ucrSaveEnterResultInto.IsComplete AndAlso + (ucrChkStoreScalar.Checked OrElse ucrSaveEnterResultInto.ucrChkSave.Checked) Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -130,8 +147,7 @@ Public Class dlgEnter End Sub Private Sub SaveResults() - If ucrSaveEnterResultInto.IsComplete Then - ucrBase.clsRsyntax.SetAssignTo(ucrSaveEnterResultInto.GetText(), strTempColumn:=ucrSaveEnterResultInto.GetText(), strTempDataframe:=ucrSelectorEnter.ucrAvailableDataFrames.cboAvailableDataFrames.Text, bRequireCorrectLength:=False) + If ucrSaveEnterResultInto.IsComplete AndAlso ucrSaveEnterResultInto.ucrChkSave.Checked Then ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True ucrBase.clsRsyntax.iCallType = 0 Else @@ -139,6 +155,7 @@ Public Class dlgEnter ucrBase.clsRsyntax.iCallType = 2 ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False End If + ManageScalarStorage() End Sub Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk @@ -148,6 +165,7 @@ Public Class dlgEnter Private Sub ucrReceiverForCalculation_SelectionChanged(sender As Object, e As EventArgs) Handles ucrReceiverForEnterCalculation.SelectionChanged ucrBase.clsRsyntax.SetCommandString(ucrReceiverForEnterCalculation.GetVariableNames(False)) ucrChkStoreScalar.Checked = False + SaveResults() TestOKEnabled() End Sub @@ -234,14 +252,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub ucrSaveEnterResultInto_NameChanged() - SaveResults() - End Sub - - Private Sub ucrSaveEnterResultInto_ContentsChanged() - TestOKEnabled() - End Sub - ''' ''' displays a popup with example commands just above the input receiver ''' @@ -414,16 +424,38 @@ Public Class dlgEnter clsDetach.AddParameter("name", strDataFrame) clsScalarsDataFuntion.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34)) clsAddScalarFunction.AddParameter("data_name", Chr(34) & strDataFrame & Chr(34), iPosition:=0) + SaveResults() + TestOKEnabled() End Sub - Private Sub ucrChkStoreScalar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkStoreScalar.ControlValueChanged + Private Sub ManageScalarStorage() If ucrChkStoreScalar.Checked AndAlso Not ucrReceiverForEnterCalculation.IsEmpty Then Dim strResut As String = ucrSaveEnterResultInto.GetText clsAddScalarFunction.AddParameter("scalar_name", Chr(34) & strResut & Chr(34), iPosition:=1) clsAddScalarFunction.AddParameter("scalar_value", strResut, iPosition:=2) ucrBase.clsRsyntax.AddToAfterCodes(clsAddScalarFunction, 2) + ucrBase.clsRsyntax.SetAssignTo(strResut) + + ucrSaveEnterResultInto.btnColumnPosition.Enabled = False + ucrSaveEnterResultInto.ucrChkSave.Enabled = False + ucrSaveEnterResultInto.ucrChkSave.Checked = False + Else ucrBase.clsRsyntax.RemoveFromAfterCodes(clsAddScalarFunction) + ucrSaveEnterResultInto.btnColumnPosition.Enabled = True + ucrSaveEnterResultInto.ucrChkSave.Enabled = True End If + ucrSaveEnterResultInto.btnColumnPosition.Visible = True + ucrSaveEnterResultInto.ucrInputComboSave.Visible = True + ucrSaveEnterResultInto.ucrInputComboSave.Enabled = True + TestOKEnabled() + End Sub + + Private Sub ucrChkStoreScalar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkStoreScalar.ControlValueChanged + ManageScalarStorage() + End Sub + + Private Sub ucrSaveEnterResultInto_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveEnterResultInto.ControlContentsChanged + SaveResults() End Sub End Class From a7445c1019381d1bf65485c6a79bf2c6e9fdee8e Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 25 Jun 2024 11:10:05 +0100 Subject: [PATCH 54/83] Change made --- instat/dlgSeasonalGraph.Designer.vb | 64 +++---- instat/dlgSeasonalGraph.vb | 250 ++++++++++++++++++---------- 2 files changed, 193 insertions(+), 121 deletions(-) diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb index e19e4f2ab8a..a310c25d833 100644 --- a/instat/dlgSeasonalGraph.Designer.vb +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -30,8 +30,6 @@ Partial Class dlgSeasonalGraph Me.lblFill = New System.Windows.Forms.Label() Me.lblColour = New System.Windows.Forms.Label() Me.ucrChkAddpointRibbon = New instat.ucrCheck() - Me.ucrInputColour = New instat.ucrInputTextBox() - Me.ucrInputFill = New instat.ucrInputTextBox() Me.ucrChkColour = New instat.ucrCheck() Me.ucrChkFill = New instat.ucrCheck() Me.cmdOptions = New instat.ucrSplitButton() @@ -48,6 +46,8 @@ Partial Class dlgSeasonalGraph Me.ucrPnlOptions = New instat.UcrPanel() Me.ucrSelectorForSeasonalGraph = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() + Me.ucrInputAddLegendLine = New instat.ucrInputComboBox() + Me.ucrInputAddLegendRibbon = New instat.ucrInputComboBox() Me.SuspendLayout() ' 'rdoBar @@ -124,7 +124,7 @@ Partial Class dlgSeasonalGraph ' Me.lblFill.AutoSize = True Me.lblFill.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFill.Location = New System.Drawing.Point(14, 332) + Me.lblFill.Location = New System.Drawing.Point(14, 384) Me.lblFill.Name = "lblFill" Me.lblFill.Size = New System.Drawing.Size(41, 13) Me.lblFill.TabIndex = 186 @@ -134,7 +134,7 @@ Partial Class dlgSeasonalGraph ' Me.lblColour.AutoSize = True Me.lblColour.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblColour.Location = New System.Drawing.Point(14, 385) + Me.lblColour.Location = New System.Drawing.Point(14, 332) Me.lblColour.Name = "lblColour" Me.lblColour.Size = New System.Drawing.Size(41, 13) Me.lblColour.TabIndex = 187 @@ -149,33 +149,11 @@ Partial Class dlgSeasonalGraph Me.ucrChkAddpointRibbon.Size = New System.Drawing.Size(148, 23) Me.ucrChkAddpointRibbon.TabIndex = 188 ' - 'ucrInputColour - ' - Me.ucrInputColour.AddQuotesIfUnrecognised = True - Me.ucrInputColour.AutoSize = True - Me.ucrInputColour.IsMultiline = False - Me.ucrInputColour.IsReadOnly = False - Me.ucrInputColour.Location = New System.Drawing.Point(64, 381) - Me.ucrInputColour.Name = "ucrInputColour" - Me.ucrInputColour.Size = New System.Drawing.Size(205, 23) - Me.ucrInputColour.TabIndex = 185 - ' - 'ucrInputFill - ' - Me.ucrInputFill.AddQuotesIfUnrecognised = True - Me.ucrInputFill.AutoSize = True - Me.ucrInputFill.IsMultiline = False - Me.ucrInputFill.IsReadOnly = False - Me.ucrInputFill.Location = New System.Drawing.Point(64, 326) - Me.ucrInputFill.Name = "ucrInputFill" - Me.ucrInputFill.Size = New System.Drawing.Size(205, 23) - Me.ucrInputFill.TabIndex = 184 - ' 'ucrChkColour ' Me.ucrChkColour.AutoSize = True Me.ucrChkColour.Checked = False - Me.ucrChkColour.Location = New System.Drawing.Point(14, 356) + Me.ucrChkColour.Location = New System.Drawing.Point(14, 301) Me.ucrChkColour.Name = "ucrChkColour" Me.ucrChkColour.Size = New System.Drawing.Size(147, 23) Me.ucrChkColour.TabIndex = 22 @@ -184,7 +162,7 @@ Partial Class dlgSeasonalGraph ' Me.ucrChkFill.AutoSize = True Me.ucrChkFill.Checked = False - Me.ucrChkFill.Location = New System.Drawing.Point(14, 301) + Me.ucrChkFill.Location = New System.Drawing.Point(14, 356) Me.ucrChkFill.Name = "ucrChkFill" Me.ucrChkFill.Size = New System.Drawing.Size(147, 23) Me.ucrChkFill.TabIndex = 21 @@ -339,16 +317,38 @@ Partial Class dlgSeasonalGraph Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 19 ' + 'ucrInputAddLegendLine + ' + Me.ucrInputAddLegendLine.AddQuotesIfUnrecognised = True + Me.ucrInputAddLegendLine.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputAddLegendLine.GetSetSelectedIndex = -1 + Me.ucrInputAddLegendLine.IsReadOnly = False + Me.ucrInputAddLegendLine.Location = New System.Drawing.Point(64, 326) + Me.ucrInputAddLegendLine.Name = "ucrInputAddLegendLine" + Me.ucrInputAddLegendLine.Size = New System.Drawing.Size(205, 23) + Me.ucrInputAddLegendLine.TabIndex = 219 + ' + 'ucrInputAddLegendRibbon + ' + Me.ucrInputAddLegendRibbon.AddQuotesIfUnrecognised = True + Me.ucrInputAddLegendRibbon.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputAddLegendRibbon.GetSetSelectedIndex = -1 + Me.ucrInputAddLegendRibbon.IsReadOnly = False + Me.ucrInputAddLegendRibbon.Location = New System.Drawing.Point(64, 381) + Me.ucrInputAddLegendRibbon.Name = "ucrInputAddLegendRibbon" + Me.ucrInputAddLegendRibbon.Size = New System.Drawing.Size(205, 23) + Me.ucrInputAddLegendRibbon.TabIndex = 220 + ' 'dlgSeasonalGraph ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(477, 573) + Me.Controls.Add(Me.ucrInputAddLegendRibbon) + Me.Controls.Add(Me.ucrInputAddLegendLine) Me.Controls.Add(Me.ucrChkAddpointRibbon) Me.Controls.Add(Me.lblColour) Me.Controls.Add(Me.lblFill) - Me.Controls.Add(Me.ucrInputColour) - Me.Controls.Add(Me.ucrInputFill) Me.Controls.Add(Me.ucrChkColour) Me.Controls.Add(Me.ucrChkFill) Me.Controls.Add(Me.cmdOptions) @@ -404,7 +404,7 @@ Partial Class dlgSeasonalGraph Friend WithEvents ucrChkFill As ucrCheck Friend WithEvents lblColour As Label Friend WithEvents lblFill As Label - Friend WithEvents ucrInputColour As ucrInputTextBox - Friend WithEvents ucrInputFill As ucrInputTextBox Friend WithEvents ucrChkAddpointRibbon As ucrCheck + Friend WithEvents ucrInputAddLegendRibbon As ucrInputComboBox + Friend WithEvents ucrInputAddLegendLine As ucrInputComboBox End Class diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 919a2fef69a..06eaa7055eb 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -140,27 +140,29 @@ Public Class dlgSeasonalGraph ucrChkLegend.AddParameterPresentCondition(True, "legend.position") ucrChkLegend.AddParameterPresentCondition(False, "legend.position", False) - ucrChkAddPoint.SetText("Add point on Lines") + ucrChkAddPoint.SetText("Add Points on Lines") ucrChkAddPoint.AddParameterValuesCondition(True, "checked", "True") ucrChkAddPoint.AddParameterValuesCondition(False, "checked", "False") - ucrChkAddpointRibbon.SetText("Add point on Ribbon") + ucrChkAddpointRibbon.SetText("Add Points on Ribbons") ucrChkAddpointRibbon.AddParameterValuesCondition(True, "checked", "True") ucrChkAddpointRibbon.AddParameterValuesCondition(False, "checked", "False") - ucrChkFill.SetText("Fill Identity:") + ucrChkFill.SetText("Legend for Ribbons") ucrChkFill.AddParameterValuesCondition(True, "checked", "True") ucrChkFill.AddParameterValuesCondition(False, "checked", "False") - ucrChkFill.AddToLinkedControls(ucrInputFill, {True}, bNewLinkedHideIfParameterMissing:=True) - ucrInputFill.SetValidationTypeAsList() - ucrInputFill.SetLinkedDisplayControl(lblFill) + ucrChkFill.AddToLinkedControls(ucrInputAddLegendRibbon, {True}, bNewLinkedHideIfParameterMissing:=True) + ucrInputAddLegendRibbon.SetValidationTypeAsList() + ucrInputAddLegendRibbon.SetItems({"Normal (Between Lower and Upper Tercile),Range 40th-90th Percentile", "A,B"}) + ucrInputAddLegendRibbon.SetLinkedDisplayControl(lblFill) - ucrChkColour.SetText("Colour Identity:") + ucrChkColour.SetText("Legend for Lines") ucrChkColour.AddParameterValuesCondition(True, "checked", "True") ucrChkColour.AddParameterValuesCondition(False, "checked", "False") - ucrChkColour.AddToLinkedControls(ucrInputColour, {True}, bNewLinkedHideIfParameterMissing:=True) - ucrInputColour.SetValidationTypeAsList() - ucrInputColour.SetLinkedDisplayControl(lblColour) + ucrChkColour.AddToLinkedControls(ucrInputAddLegendLine, {True}, bNewLinkedHideIfParameterMissing:=True) + ucrInputAddLegendLine.SetValidationTypeAsList() + ucrInputAddLegendLine.SetItems({"Median,Record Low/High", "A,B", "maximum,minimum,mean"}) + ucrInputAddLegendLine.SetLinkedDisplayControl(lblColour) ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() @@ -249,6 +251,22 @@ Public Class dlgSeasonalGraph ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) End Sub + Private Sub SetCalculationHistory() + Dim newItem As String = ucrInputAddLegendLine.GetText().Trim() + + If Not String.IsNullOrEmpty(newItem) AndAlso Not ucrInputAddLegendLine.cboInput.Items.Contains(newItem) Then + ucrInputAddLegendLine.AddItems({newItem}) + End If + End Sub + + Private Sub SetCalculationHistory1() + Dim newItem As String = ucrInputAddLegendRibbon.GetText().Trim() + + If Not String.IsNullOrEmpty(newItem) AndAlso Not ucrInputAddLegendRibbon.cboInput.Items.Contains(newItem) Then + ucrInputAddLegendRibbon.AddItems({newItem}) + End If + End Sub + Private Sub SetRCodeForControls(bReset As Boolean) ucrPnlOptions.SetRCode(clsDummyFunction, bReset) ucrSelectorForSeasonalGraph.SetRCode(clsRggplotFunction, bReset) @@ -258,9 +276,7 @@ Public Class dlgSeasonalGraph If bReset Then ucrReceiverX.SetRCode(clsRaesFunction, bReset) ucrChkColour.SetRCode(clsScalecolouridentityFunction, bReset) - ucrInputColour.SetRCode(clsScalecolouridentityFunction, bReset) ucrChkFill.SetRCode(clsScalefillidentityFunction, bReset) - ucrInputFill.SetRCode(clsScalefillidentityFunction, bReset) ucrChkRibbons.SetRCode(clsBaseOperator, bReset) ucrChkAddPoint.SetRCode(clsBaseOperator, bReset) ucrChkAddpointRibbon.SetRCode(clsBaseOperator, bReset) @@ -293,31 +309,61 @@ Public Class dlgSeasonalGraph ' Process ucrReceiverLines if not empty If Not ucrReceiverLines.IsEmpty Then - ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 - Dim clsRaeslineFunction As New RFunction - Dim ColourArguments As New List(Of String) From {"grey", "grey", "black", "grey"} - Dim LinewidthArguments As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} - Dim GroupArguments As New List(Of String) From {"grey", "grey", "grey", "grey"} - - clsRaeslineFunction.SetPackageName("ggplot2") - clsRaeslineFunction.SetRCommand("aes") - clsRaeslineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) - clsRaeslineFunction.AddParameter("colour", Chr(34) & ColourArguments(i) & Chr(34), iPosition:=1) - - Dim clsGeomLineFunction As New RFunction - clsGeomLineFunction.SetPackageName("ggplot2") - clsGeomLineFunction.SetRCommand("geom_line") - clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaeslineFunction, iPosition:=1) - clsGeomLineFunction.AddParameter("linewidth", LinewidthArguments(i), iPosition:=2) - clsGeomLineFunction.AddParameter("group", Chr(34) & GroupArguments(i) & Chr(34), iPosition:=3) - - ' Add geom_line function to the base operator - clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) - clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) - clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) - Next - + If ucrChkColour.Checked Then + ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + Dim clsRaeslineFunction As New RFunction + Dim ColourArguments As New List(Of String) From {"grey", "grey", "black", "grey"} + Dim LinewidthArguments As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} + Dim GroupArguments As New List(Of String) From {"grey", "grey", "grey", "grey"} + + clsRaeslineFunction.SetPackageName("ggplot2") + clsRaeslineFunction.SetRCommand("aes") + clsRaeslineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) + clsRaeslineFunction.AddParameter("colour", Chr(34) & ColourArguments(i) & Chr(34), iPosition:=1) + + Dim clsGeomLineFunction As New RFunction + clsGeomLineFunction.SetPackageName("ggplot2") + clsGeomLineFunction.SetRCommand("geom_line") + clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaeslineFunction, iPosition:=1) + clsGeomLineFunction.AddParameter("linewidth", LinewidthArguments(i), iPosition:=2) + clsGeomLineFunction.AddParameter("group", Chr(34) & GroupArguments(i) & Chr(34), iPosition:=3) + + ' Add geom_line function to the base operator + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) + Next + If Not ucrInputAddLegendLine.IsEmpty Then + clsScalecolouridentityFunction.AddParameter("labels", ucrInputAddLegendLine.clsRList.ToScript(), iPosition:=2) + Else + clsScalecolouridentityFunction.RemoveParameterByName("labels") + End If + clsBaseOperator.AddParameter("scale_colour_identity", clsRFunctionParameter:=clsScalecolouridentityFunction, iPosition:=13) + Else + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + Dim clsRaeslineFunction As New RFunction + Dim ColourArguments1 As New List(Of String) From {"grey", "grey", "black", "grey"} + Dim LinewidthArguments1 As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} + + clsRaeslineFunction.SetPackageName("ggplot2") + clsRaeslineFunction.SetRCommand("aes") + clsRaeslineFunction.AddParameter("y", ucrReceiverLines.lstSelectedVariables.Items(i).Text, iPosition:=0) + + Dim clsGeomLineFunction As New RFunction + clsGeomLineFunction.SetPackageName("ggplot2") + clsGeomLineFunction.SetRCommand("geom_line") + clsGeomLineFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaeslineFunction, iPosition:=1) + clsGeomLineFunction.AddParameter("linewidth", LinewidthArguments1(i), iPosition:=2) + clsGeomLineFunction.AddParameter("colour", Chr(34) & ColourArguments1(i) & Chr(34), iPosition:=3) + + ' Add geom_line function to the base operator + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strFirstParameterName & i, clsRFunctionParameter:=clsGeomLineFunction, iPosition:=3) + Next + clsBaseOperator.RemoveParameterByName("scale_colour_identity") + End If ' Add points if ucrChkAddPoint is checked If ucrChkAddPoint.Checked Then For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 @@ -335,50 +381,80 @@ Public Class dlgSeasonalGraph clsBaseOperator.AddParameter(strGeompointParameterName & "Line" & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=9) Next Else - clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line") - End If - If ucrChkColour.Checked Then - If Not ucrInputColour.IsEmpty Then - clsScalecolouridentityFunction.AddParameter("labels", ucrInputColour.clsRList.ToScript(), iPosition:=2) - Else - clsScalecolouridentityFunction.RemoveParameterByName("labels") - End If - clsBaseOperator.AddParameter("scale_colour_identity", clsRFunctionParameter:=clsScalecolouridentityFunction, iPosition:=13) - Else - clsBaseOperator.RemoveParameterByName("scale_colour_identity") + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line" & i) + Next End If Else - clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line") - clsBaseOperator.RemoveParameterByName(strFirstParameterName) + For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line" & i) + clsBaseOperator.RemoveParameterByName(strFirstParameterName & i) + Next + clsBaseOperator.RemoveParameterByName("scale_colour_identity") End If ' Process ucrReceiverRibbons if not empty and ucrChkRibbons is checked If ucrChkRibbons.Checked AndAlso Not ucrReceiverRibbons.IsEmpty Then - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 - ' Get current variable - Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text - ' Get the next variable in the pair if available - Dim var2 As String = If(i + 1 < ucrReceiverRibbons.lstSelectedVariables.Items.Count, ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text, "") - Dim fillArguments As New List(Of String) From {"#3270C1", "#A3A3A3", "#4DB0F1", "#FF5733"} - - If Not String.IsNullOrEmpty(var2) Then - Dim clsRaesRibFunction As New RFunction - clsRaesRibFunction.SetPackageName("ggplot2") - clsRaesRibFunction.SetRCommand("aes") - clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) - clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) - clsRaesRibFunction.AddParameter("fill", Chr(34) & fillArguments(i) & Chr(34), iPosition:=2) - - Dim clsRibFunction As New RFunction - clsRibFunction.SetPackageName("ggplot2") - clsRibFunction.SetRCommand("geom_ribbon") - clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) - - clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) - clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) - clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) + If ucrChkFill.Checked Then + clsBaseOperator.AddParameter("scale_fill_identity", clsRFunctionParameter:=clsScalefillidentityFunction, iPosition:=12) + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 + ' Get current variable + Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text + ' Get the next variable in the pair if available + Dim var2 As String = If(i + 1 < ucrReceiverRibbons.lstSelectedVariables.Items.Count, ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text, "") + Dim fillArguments As New List(Of String) From {"#3270C1", "#A3A3A3", "#4DB0F1", "#FF5733"} + + If Not String.IsNullOrEmpty(var2) Then + Dim clsRaesRibFunction As New RFunction + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) + clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) + clsRaesRibFunction.AddParameter("fill", Chr(34) & fillArguments(i) & Chr(34), iPosition:=2) + + Dim clsRibFunction As New RFunction + clsRibFunction.SetPackageName("ggplot2") + clsRibFunction.SetRCommand("geom_ribbon") + clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) + + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) + End If + Next + If Not ucrInputAddLegendRibbon.IsEmpty Then + clsScalefillidentityFunction.AddParameter("labels", ucrInputAddLegendRibbon.clsRList.ToScript(), iPosition:=2) + Else + clsScalefillidentityFunction.RemoveParameterByName("labels") End If - Next + Else + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 + ' Get current variable + Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text + ' Get the next variable in the pair if available + Dim var2 As String = If(i + 1 < ucrReceiverRibbons.lstSelectedVariables.Items.Count, ucrReceiverRibbons.lstSelectedVariables.Items(i + 1).Text, "") + Dim fillArguments As New List(Of String) From {"#3270C1", "#A3A3A3", "#4DB0F1", "#FF5733"} + + If Not String.IsNullOrEmpty(var2) Then + Dim clsRaesRibFunction As New RFunction + clsRaesRibFunction.SetPackageName("ggplot2") + clsRaesRibFunction.SetRCommand("aes") + clsRaesRibFunction.AddParameter("ymax", var1, iPosition:=0) + clsRaesRibFunction.AddParameter("ymin", var2, iPosition:=1) + + Dim clsRibFunction As New RFunction + clsRibFunction.SetPackageName("ggplot2") + clsRibFunction.SetRCommand("geom_ribbon") + clsRibFunction.AddParameter("mapping", clsRFunctionParameter:=clsRaesRibFunction, iPosition:=1) + clsRibFunction.AddParameter("fill", Chr(34) & fillArguments(i) & Chr(34), iPosition:=2) + + clsBaseOperator.AddParameter(GgplotDefaults.clsDefaultThemeParameter.Clone()) + clsBaseOperator.AddParameter("ggplot", clsRFunctionParameter:=clsRggplotFunction, iPosition:=0) + clsBaseOperator.AddParameter(strgeomRibbonParameterName0 & i, clsRFunctionParameter:=clsRibFunction, iPosition:=1) + End If + Next + clsBaseOperator.RemoveParameterByName("scale_fill_identity") + End If ' Add points to ribbons if ucrChkAddpointRibbon is checked If ucrChkAddpointRibbon.Checked Then @@ -397,28 +473,22 @@ Public Class dlgSeasonalGraph clsBaseOperator.AddParameter(strGeompointParameterName1 & "Ribbon" & ucrReceiverRibbons.lstSelectedVariables.Items.IndexOf(selectedItem), clsRFunctionParameter:=clsGeomPointFunction1, iPosition:=15) Next Else - clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon") - End If - If ucrChkFill.Checked Then - If Not ucrInputFill.IsEmpty Then - clsScalefillidentityFunction.AddParameter("labels", ucrInputFill.clsRList.ToScript(), iPosition:=2) - Else - clsScalefillidentityFunction.RemoveParameterByName("labels") - End If - clsBaseOperator.AddParameter("scale_fill_identity", clsRFunctionParameter:=clsScalefillidentityFunction, iPosition:=12) - Else - clsBaseOperator.RemoveParameterByName("scale_fill_identity") + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 + clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon" & i) + Next End If Else - clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon") - clsBaseOperator.RemoveParameterByName(strgeomRibbonParameterName0) + For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 + clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon" & i) + clsBaseOperator.RemoveParameterByName(strgeomRibbonParameterName0 & i) + Next + clsBaseOperator.RemoveParameterByName("scale_fill_identity") End If AddRemoveFacets() AddRemoveGroupBy() End Sub - Private Sub UpdateParameters() clsFacetOperator.RemoveParameterByName("var1") clsFacetColOp.RemoveParameterByName("col" & ucrInputStation.Name) @@ -650,8 +720,10 @@ Public Class dlgSeasonalGraph ListGeomLine() End Sub - Private Sub ucrChkFill_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkFill.ControlValueChanged, ucrChkColour.ControlValueChanged, ucrInputFill.ControlValueChanged, ucrInputColour.ControlValueChanged + Private Sub ucrChkFill_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkFill.ControlValueChanged, ucrChkColour.ControlValueChanged, ucrInputAddLegendRibbon.ControlValueChanged, ucrInputAddLegendLine.ControlValueChanged ListGeomLine() + SetCalculationHistory() + SetCalculationHistory1() End Sub Private Sub ucrChkAddpointRibbon_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddpointRibbon.ControlValueChanged From 0a978d29020e6bb46b3778f509a7585cf33887f9 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:20:40 +0200 Subject: [PATCH 55/83] code changes --- instat/ucrDataView.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index 1836ddd5e11..6eac98b8937 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -661,7 +661,9 @@ Public Class ucrDataView GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) Else Dim bCheckLabels As Boolean = GetCurrentDataFrameFocus().clsPrepareFunctions.CheckHasLabels(strColumn) - If bCheckLabels = False Then + If bCheckLabels Then + GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) + Else frmConvertToNumeric.SetDataFrameName(GetCurrentDataFrameFocus().strName) frmConvertToNumeric.SetColumnName(strColumn) frmConvertToNumeric.CheckLabels(bCheckLabels) @@ -676,8 +678,6 @@ Public Class ucrDataView Case DialogResult.Cancel Continue For End Select - ElseIf bCheckLabels = True Then - GetCurrentDataFrameFocus().clsPrepareFunctions.ConvertToNumeric(strColumn, True) End If frmConvertToNumeric.Close() End If From 01bc9b6c7b53df5f5a4109e6caec2a96d0c325d2 Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Wed, 26 Jun 2024 10:04:36 +0300 Subject: [PATCH 56/83] design changes --- instat/dlgEnter.Designer.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 47717f80ccf..faf0e23076a 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -536,7 +536,7 @@ Partial Class dlgEnter Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(12, 390) Me.ucrSaveEnterResultInto.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" - Me.ucrSaveEnterResultInto.Size = New System.Drawing.Size(420, 33) + Me.ucrSaveEnterResultInto.Size = New System.Drawing.Size(511, 33) Me.ucrSaveEnterResultInto.TabIndex = 181 ' 'ucrTryModelling From 3f5856da07029fd1b6ee6b0f09b57161f6d2b011 Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Wed, 26 Jun 2024 13:55:13 +0300 Subject: [PATCH 57/83] minor design changes --- instat/dlgEnter.Designer.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index faf0e23076a..8ddbf63363b 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -533,7 +533,7 @@ Partial Class dlgEnter 'ucrSaveEnterResultInto ' Me.ucrSaveEnterResultInto.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(12, 390) + Me.ucrSaveEnterResultInto.Location = New System.Drawing.Point(19, 390) Me.ucrSaveEnterResultInto.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" Me.ucrSaveEnterResultInto.Size = New System.Drawing.Size(511, 33) @@ -542,7 +542,7 @@ Partial Class dlgEnter 'ucrTryModelling ' Me.ucrTryModelling.AutoSize = True - Me.ucrTryModelling.Location = New System.Drawing.Point(-2, 340) + Me.ucrTryModelling.Location = New System.Drawing.Point(19, 340) Me.ucrTryModelling.Margin = New System.Windows.Forms.Padding(6) Me.ucrTryModelling.Name = "ucrTryModelling" Me.ucrTryModelling.RunCommandAsMultipleLines = False @@ -566,7 +566,7 @@ Partial Class dlgEnter ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 468) + Me.ucrBase.Location = New System.Drawing.Point(19, 468) Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(611, 77) @@ -614,7 +614,7 @@ Partial Class dlgEnter ' Me.ucrChkStoreScalar.AutoSize = True Me.ucrChkStoreScalar.Checked = False - Me.ucrChkStoreScalar.Location = New System.Drawing.Point(13, 426) + Me.ucrChkStoreScalar.Location = New System.Drawing.Point(19, 426) Me.ucrChkStoreScalar.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrChkStoreScalar.Name = "ucrChkStoreScalar" Me.ucrChkStoreScalar.Size = New System.Drawing.Size(199, 34) From 08917c00a54d74813d349e1b65979eff89062b45 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 26 Jun 2024 15:19:59 +0100 Subject: [PATCH 58/83] Change made --- instat/dlgBarAndPieChart.vb | 2 +- instat/dlgCanonicalCorrelationAnalysis.vb | 2 +- instat/dlgCircularDensityPlot.vb | 2 +- instat/dlgCombineforGraphics.vb | 2 +- instat/dlgCorrelation.vb | 8 ++++---- instat/dlgCumulativeDistribution.vb | 2 +- instat/dlgDescribeTwoVarGraph.vb | 2 +- instat/dlgDescribeTwoVariable.vb | 8 ++++---- instat/dlgFitModel.vb | 2 +- instat/dlgFourVariableModelling.vb | 2 +- instat/dlgGeneralForGraphics.vb | 2 +- instat/dlgHeatMapPlot.vb | 2 +- instat/dlgHistogram.vb | 2 +- instat/dlgHypothesisTestsCalculator.vb | 2 +- instat/dlgLinePlot.vb | 2 +- instat/dlgModelling.vb | 2 +- instat/dlgMosaicPlot.vb | 2 +- instat/dlgOneVarFitModel.vb | 8 ++++---- instat/dlgOtherRosePlots.vb | 2 +- instat/dlgParallelCoordinatePlot.vb | 2 +- instat/dlgPrincipalComponentAnalysis.vb | 2 +- instat/dlgRatingScales.vb | 6 +++--- instat/dlgScatterPlot.vb | 2 +- instat/dlgShowModel.vb | 2 +- instat/dlgSummaryTables.vb | 2 +- instat/dlgThreeVariableFrequencies.vb | 4 ++-- instat/dlgThreeVariablesModelling.vb | 2 +- instat/dlgTwoVariableFitModel.vb | 2 +- instat/dlgTwoWayFrequencies.vb | 4 ++-- instat/dlgUseGraph.vb | 2 +- instat/dlgUseModel.vb | 2 +- instat/dlgUseTable.vb | 2 +- instat/dlgWindPollutionRose.vb | 2 +- instat/dlgWindrose.vb | 2 +- 34 files changed, 47 insertions(+), 47 deletions(-) diff --git a/instat/dlgBarAndPieChart.vb b/instat/dlgBarAndPieChart.vb index 011f33a91c3..4f7f6cc316e 100644 --- a/instat/dlgBarAndPieChart.vb +++ b/instat/dlgBarAndPieChart.vb @@ -224,7 +224,7 @@ Public Class dlgBarAndPieChart ucrReceiverWordcloudAngle.Selector = ucrBarChartSelector ucrSaveBar.SetIsComboBox() - ucrSaveBar.SetCheckBoxText("Save Graph") + ucrSaveBar.SetCheckBoxText("Store Graph") ucrSaveBar.SetDataFrameSelector(ucrBarChartSelector.ucrAvailableDataFrames) ucrSaveBar.SetSaveTypeAsGraph() ucrSaveBar.SetPrefix("bar_plot") diff --git a/instat/dlgCanonicalCorrelationAnalysis.vb b/instat/dlgCanonicalCorrelationAnalysis.vb index af5bbb0335c..f7dab3ff36a 100644 --- a/instat/dlgCanonicalCorrelationAnalysis.vb +++ b/instat/dlgCanonicalCorrelationAnalysis.vb @@ -66,7 +66,7 @@ Public Class dlgCanonicalCorrelationAnalysis ucrSaveResult.SetSaveType(RObjectTypeLabel.Model, strRObjectFormat:=RObjectFormat.Text) ucrSaveResult.SetDataFrameSelector(ucrSelectorCCA.ucrAvailableDataFrames) ucrSaveResult.SetIsComboBox() - ucrSaveResult.SetCheckBoxText("Save Model") + ucrSaveResult.SetCheckBoxText("Store Model") ucrSaveResult.SetAssignToIfUncheckedValue("last_model") End Sub diff --git a/instat/dlgCircularDensityPlot.vb b/instat/dlgCircularDensityPlot.vb index 7861799a9ab..33561bf1c09 100644 --- a/instat/dlgCircularDensityPlot.vb +++ b/instat/dlgCircularDensityPlot.vb @@ -103,7 +103,7 @@ Public Class dlgCircularDensityPlot ucrSaveDensity.SetPrefix("circular_density") ucrSaveDensity.SetDataFrameSelector(ucrSelectorDataFrame.ucrAvailableDataFrames) ucrSaveDensity.SetIsComboBox() - ucrSaveDensity.SetCheckBoxText("Save Graph") + ucrSaveDensity.SetCheckBoxText("Store Graph") ucrSaveDensity.SetSaveTypeAsGraph() ucrSaveDensity.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgCombineforGraphics.vb b/instat/dlgCombineforGraphics.vb index df1997762ac..c7cb3855f09 100644 --- a/instat/dlgCombineforGraphics.vb +++ b/instat/dlgCombineforGraphics.vb @@ -48,7 +48,7 @@ Public Class dlgCombineforGraphics ucrSave.SetPrefix("combined_graph") ucrSave.SetDataFrameSelector(ucrCombineGraphSelector.ucrAvailableDataFrames) ucrSave.SetSaveType(strRObjectType:=RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) - ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetCheckBoxText("Store Graph") ucrSave.SetIsComboBox() ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgCorrelation.vb b/instat/dlgCorrelation.vb index e7c188447fe..332b92185c1 100644 --- a/instat/dlgCorrelation.vb +++ b/instat/dlgCorrelation.vb @@ -592,7 +592,7 @@ Public Class dlgCorrelation If rdoAsText.Checked Then clsDummyFunction.AddParameter("output", "as.table", iPosition:=2) ucrSaveCorrelation.SetSaveType(strRObjectType:=RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrSaveCorrelation.SetCheckBoxText("Save Table") + ucrSaveCorrelation.SetCheckBoxText("Store Table") ucrSaveCorrelation.SetPrefix("summary_table") ucrSaveCorrelation.SetAssignToIfUncheckedValue("last_table") clsPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", @@ -604,14 +604,14 @@ Public Class dlgCorrelation clsDummyFunction.AddParameter("output", "as.dataframe", iPosition:=2) clsPipeOperator.RemoveAssignTo() ucrSaveCorrelation.SetSaveTypeAsDataFrame() - ucrSaveCorrelation.SetCheckBoxText("Save Data Frame") + ucrSaveCorrelation.SetCheckBoxText("Store Data Frame") ucrSaveCorrelation.SetPrefix("data_frame") ucrSaveCorrelation.SetAssignToIfUncheckedValue("last_dataframe") End If Else ucrSaveCorrelation.SetSaveType(strRObjectType:=RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) - ucrSaveCorrelation.SetCheckBoxText("Save Table") + ucrSaveCorrelation.SetCheckBoxText("Store Table") ucrSaveCorrelation.SetPrefix("summary_table") ucrSaveCorrelation.SetAssignToIfUncheckedValue("last_table") clsCorrelationFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", @@ -623,7 +623,7 @@ Public Class dlgCorrelation Else ucrSaveCorrelation.SetSaveType(strRObjectType:=RObjectTypeLabel.Model, strRObjectFormat:=RObjectFormat.Text) - ucrSaveCorrelation.SetCheckBoxText("Save Model") + ucrSaveCorrelation.SetCheckBoxText("Store Model") ucrSaveCorrelation.SetPrefix("summary_model") ucrSaveCorrelation.SetAssignToIfUncheckedValue("last_model") clsCorrelationTestFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", diff --git a/instat/dlgCumulativeDistribution.vb b/instat/dlgCumulativeDistribution.vb index cd123316452..f6f326a7f47 100644 --- a/instat/dlgCumulativeDistribution.vb +++ b/instat/dlgCumulativeDistribution.vb @@ -164,7 +164,7 @@ Public Class dlgCumulativeDistribution ucrSaveCumDist.SetSaveTypeAsGraph() ucrSaveCumDist.SetDataFrameSelector(ucrCumDistSelector.ucrAvailableDataFrames) - ucrSaveCumDist.SetCheckBoxText("Save Graph") + ucrSaveCumDist.SetCheckBoxText("Store Graph") ucrSaveCumDist.SetIsComboBox() ucrSaveCumDist.SetPrefix("cumulative_dist") ucrSaveCumDist.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgDescribeTwoVarGraph.vb b/instat/dlgDescribeTwoVarGraph.vb index 00169a986fe..082a787de78 100644 --- a/instat/dlgDescribeTwoVarGraph.vb +++ b/instat/dlgDescribeTwoVarGraph.vb @@ -274,7 +274,7 @@ Public Class dlgDescribeTwoVarGraph ucrSaveGraph.SetPrefix("two_var") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorTwoVarGraph.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgDescribeTwoVariable.vb b/instat/dlgDescribeTwoVariable.vb index de0e1c3e530..0d7082ef26a 100644 --- a/instat/dlgDescribeTwoVariable.vb +++ b/instat/dlgDescribeTwoVariable.vb @@ -489,7 +489,7 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.SetPrefix("summary_table") ucrSaveTable.SetSaveType(RObjectTypeLabel.Summary, strRObjectFormat:=RObjectFormat.Text) ucrSaveTable.SetAssignToIfUncheckedValue("last_summary") - ucrSaveTable.SetCheckBoxText("Save Summary") + ucrSaveTable.SetCheckBoxText("Store Summary") ucrBase.clsRsyntax.SetBaseROperator(clsGroupByPipeOperator) clsGroupByPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, @@ -513,7 +513,7 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.SetPrefix("summary_table") ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetAssignToIfUncheckedValue("last_table") - ucrSaveTable.SetCheckBoxText("Save Table") + ucrSaveTable.SetCheckBoxText("Store Table") clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, strRObjectFormatToAssignTo:=RObjectFormat.Html, @@ -527,7 +527,7 @@ Public Class dlgDescribeTwoVariable ucrSaveTable.SetPrefix("frequency_table") ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetAssignToIfUncheckedValue("last_table") - ucrSaveTable.SetCheckBoxText("Save Table") + ucrSaveTable.SetCheckBoxText("Store Table") clsJoiningPipeOperator.SetAssignToOutputObject(strRObjectToAssignTo:="last_table", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Table, strRObjectFormatToAssignTo:=RObjectFormat.Html, @@ -538,7 +538,7 @@ Public Class dlgDescribeTwoVariable clsDummyFunction.AddParameter("checked", "three_variable", iPosition:=0) ucrBase.clsRsyntax.SetBaseROperator(clsJoiningPipeOperator) ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) - ucrSaveTable.SetCheckBoxText("Save Table") + ucrSaveTable.SetCheckBoxText("Store Table") End If FactorColumns() diff --git a/instat/dlgFitModel.vb b/instat/dlgFitModel.vb index 647967813f2..d9e6da9f826 100644 --- a/instat/dlgFitModel.vb +++ b/instat/dlgFitModel.vb @@ -80,7 +80,7 @@ Public Class dlgFitModel ucrModelName.SetDataFrameSelector(ucrSelectorByDataFrameAddRemoveForFitModel.ucrAvailableDataFrames) ucrModelName.SetPrefix("gen_model") ucrModelName.SetSaveTypeAsModel() - ucrModelName.SetCheckBoxText("Save Model") + ucrModelName.SetCheckBoxText("Store Model") ucrModelName.SetIsComboBox() ucrModelName.SetAssignToIfUncheckedValue("last_model") End Sub diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index 319eff77da8..5b506c46c9f 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -96,7 +96,7 @@ Public Class dlgFourVariableModelling ucrSaveModel.SetPrefix("reg") ucrSaveModel.SetDataFrameSelector(ucrSelectorFourVariableModelling.ucrAvailableDataFrames) ucrSaveModel.SetSaveTypeAsModel() - ucrSaveModel.SetCheckBoxText("Save Model") + ucrSaveModel.SetCheckBoxText("Store Model") ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") diff --git a/instat/dlgGeneralForGraphics.vb b/instat/dlgGeneralForGraphics.vb index 04112a21464..6605d8b45dc 100644 --- a/instat/dlgGeneralForGraphics.vb +++ b/instat/dlgGeneralForGraphics.vb @@ -172,7 +172,7 @@ Public Class dlgGeneralForGraphics ucrSave.SetPrefix("graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() - ucrSave.SetCheckBoxText("Save") + ucrSave.SetCheckBoxText("Store") ucrSave.SetDataFrameSelector(ucrGraphicsSelector.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") VariableXType() diff --git a/instat/dlgHeatMapPlot.vb b/instat/dlgHeatMapPlot.vb index aef1a4223e8..c9ac609d37d 100644 --- a/instat/dlgHeatMapPlot.vb +++ b/instat/dlgHeatMapPlot.vb @@ -159,7 +159,7 @@ Public Class dlgHeatMapPlot ucrSaveGraph.SetPrefix("heatmap") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetIsComboBox() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetDataFrameSelector(ucrHeatMapSelector.ucrAvailableDataFrames) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgHistogram.vb b/instat/dlgHistogram.vb index 74b2176d8c6..17dbfb99324 100644 --- a/instat/dlgHistogram.vb +++ b/instat/dlgHistogram.vb @@ -203,7 +203,7 @@ Public Class dlgHistogram ucrSaveHist.SetPrefix("histogram") ucrSaveHist.SetDataFrameSelector(ucrHistogramSelector.ucrAvailableDataFrames) ucrSaveHist.SetIsComboBox() - ucrSaveHist.SetCheckBoxText("Save Graph") + ucrSaveHist.SetCheckBoxText("Store Graph") ucrSaveHist.SetSaveTypeAsGraph() ucrSaveHist.SetAssignToIfUncheckedValue("last_graph") DialogueSize() diff --git a/instat/dlgHypothesisTestsCalculator.vb b/instat/dlgHypothesisTestsCalculator.vb index 9debb587c7e..1b393cccdc5 100644 --- a/instat/dlgHypothesisTestsCalculator.vb +++ b/instat/dlgHypothesisTestsCalculator.vb @@ -48,7 +48,7 @@ Public Class dlgHypothesisTestsCalculator ucrSaveResult.SetPrefix("test") ucrSaveResult.SetIsComboBox() ucrSaveResult.SetSaveTypeAsModel() - ucrSaveResult.SetCheckBoxText("Save test object") + ucrSaveResult.SetCheckBoxText("Store test object") ucrSaveResult.SetAssignToIfUncheckedValue("Last_Test") ucrSaveResult.SetDataFrameSelector(ucrSelectorColumn.ucrAvailableDataFrames) diff --git a/instat/dlgLinePlot.vb b/instat/dlgLinePlot.vb index b5d457c0fc9..c5338de519e 100644 --- a/instat/dlgLinePlot.vb +++ b/instat/dlgLinePlot.vb @@ -205,7 +205,7 @@ Public Class dlgLinePlot ucrSave.SetPrefix("line_plot") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() - ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetCheckBoxText("Store Graph") ucrSave.SetDataFrameSelector(ucrLinePlotSelector.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgModelling.vb b/instat/dlgModelling.vb index 9af0dd39c44..cae0e1ed343 100644 --- a/instat/dlgModelling.vb +++ b/instat/dlgModelling.vb @@ -60,7 +60,7 @@ Public Class dlgModelling ucrSaveResult.SetPrefix("model") ucrSaveResult.SetIsComboBox() ucrSaveResult.SetSaveTypeAsModel() - ucrSaveResult.SetCheckBoxText("Save Model") + ucrSaveResult.SetCheckBoxText("Store Model") ucrSaveResult.SetAssignToIfUncheckedValue("last_model") ucrSaveResult.SetDataFrameSelector(ucrSelectorModelling.ucrAvailableDataFrames) diff --git a/instat/dlgMosaicPlot.vb b/instat/dlgMosaicPlot.vb index f4f6c2cf6f0..c8b26f265e4 100644 --- a/instat/dlgMosaicPlot.vb +++ b/instat/dlgMosaicPlot.vb @@ -174,7 +174,7 @@ Public Class dlgMosaicPlot ucrSaveMosaicPlot.SetPrefix("mosaic") ucrSaveMosaicPlot.SetIsComboBox() - ucrSaveMosaicPlot.SetCheckBoxText("Save Graph") + ucrSaveMosaicPlot.SetCheckBoxText("Store Graph") ucrSaveMosaicPlot.SetSaveTypeAsGraph() ucrSaveMosaicPlot.SetDataFrameSelector(ucrSelectorMosaicPlot.ucrAvailableDataFrames) ucrSaveMosaicPlot.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgOneVarFitModel.vb b/instat/dlgOneVarFitModel.vb index 4301e18009f..565148d5c77 100644 --- a/instat/dlgOneVarFitModel.vb +++ b/instat/dlgOneVarFitModel.vb @@ -88,7 +88,7 @@ Public Class dlgOneVarFitModel ucrSaveModel.SetDataFrameSelector(ucrSelectorOneVarFitMod.ucrAvailableDataFrames) ucrSaveModel.SetSaveTypeAsModel() - ucrSaveModel.SetCheckBoxText("Save Model") + ucrSaveModel.SetCheckBoxText("Store Model") ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") @@ -651,13 +651,13 @@ Public Class dlgOneVarFitModel Private Sub SetSaveLabelTextAndPrefix() If rdoGeneralCase.Checked Then - ucrSaveModel.SetCheckBoxText("Save Model") + ucrSaveModel.SetCheckBoxText("Store Model") ucrSaveModel.SetPrefix("dist") ElseIf rdoTest.Checked Then - ucrSaveModel.SetCheckBoxText("Save Test") + ucrSaveModel.SetCheckBoxText("Store Test") ucrSaveModel.SetPrefix("test") ElseIf rdoEstimate.Checked Then - ucrSaveModel.SetCheckBoxText("Save Estimate") + ucrSaveModel.SetCheckBoxText("Store Estimate") ucrSaveModel.SetPrefix("ci") Else MsgBox("Developer error: the Radio Button has not been added to the Panel.") diff --git a/instat/dlgOtherRosePlots.vb b/instat/dlgOtherRosePlots.vb index 2affd52a850..527cb0a03bf 100644 --- a/instat/dlgOtherRosePlots.vb +++ b/instat/dlgOtherRosePlots.vb @@ -168,7 +168,7 @@ Public Class dlgOtherRosePlots ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetSaveTypeAsGraph() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetDataFrameSelector(ucrSelectorOtherRosePlots.ucrAvailableDataFrames) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgParallelCoordinatePlot.vb b/instat/dlgParallelCoordinatePlot.vb index e36c0fbf244..b3cd4519c9b 100644 --- a/instat/dlgParallelCoordinatePlot.vb +++ b/instat/dlgParallelCoordinatePlot.vb @@ -147,7 +147,7 @@ Public Class dlgParallelCoordinatePlot ucrSaveGraph.SetPrefix("par_coord_plot") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorParallelCoordinatePlot.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgPrincipalComponentAnalysis.vb b/instat/dlgPrincipalComponentAnalysis.vb index 401d2927796..c7e42e0917b 100644 --- a/instat/dlgPrincipalComponentAnalysis.vb +++ b/instat/dlgPrincipalComponentAnalysis.vb @@ -89,7 +89,7 @@ Public Class dlgPrincipalComponentAnalysis ucrSaveResult.SetPrefix("pca") ucrSaveResult.SetSaveTypeAsModel() ucrSaveResult.SetDataFrameSelector(ucrSelectorPCA.ucrAvailableDataFrames) - ucrSaveResult.SetCheckBoxText("Save Result") + ucrSaveResult.SetCheckBoxText("Store Result") ucrSaveResult.SetIsComboBox() ucrSaveResult.SetAssignToIfUncheckedValue("last_model") diff --git a/instat/dlgRatingScales.vb b/instat/dlgRatingScales.vb index fc971fee4f1..ed3211cc61e 100644 --- a/instat/dlgRatingScales.vb +++ b/instat/dlgRatingScales.vb @@ -262,17 +262,17 @@ Public Class dlgRatingScales ucrBase.clsRsyntax.SetBaseRFunction(clsSjpLikertFunction) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ElseIf rdoStacked.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsSjpStackFrqFunction) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ElseIf rdoTable.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsSjtStackFrqFunction) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Text) ucrSaveGraph.SetAssignToIfUncheckedValue("last_table") - ucrSaveGraph.SetCheckBoxText("Save Table") + ucrSaveGraph.SetCheckBoxText("Store Table") End If End Sub diff --git a/instat/dlgScatterPlot.vb b/instat/dlgScatterPlot.vb index 917b9a763ad..33a0a83fd51 100644 --- a/instat/dlgScatterPlot.vb +++ b/instat/dlgScatterPlot.vb @@ -183,7 +183,7 @@ Public Class dlgScatterPlot ucrSaveScatterPlot.SetSaveType(strRObjectType:=RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) ucrSaveScatterPlot.SetDataFrameSelector(ucrSelectorForScatter.ucrAvailableDataFrames) - ucrSaveScatterPlot.SetCheckBoxText("Save Graph") + ucrSaveScatterPlot.SetCheckBoxText("Store Graph") ucrSaveScatterPlot.SetIsComboBox() ucrSaveScatterPlot.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgShowModel.vb b/instat/dlgShowModel.vb index 879bb8c8d14..c534781f14a 100644 --- a/instat/dlgShowModel.vb +++ b/instat/dlgShowModel.vb @@ -58,7 +58,7 @@ Public Class dlgShowModel ucrSaveGraph.SetPrefix("quant") ucrSaveGraph.SetIsComboBox() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorShowModel.ucrAvailableDataFrames) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgSummaryTables.vb b/instat/dlgSummaryTables.vb index 4c553f4f818..bd7aba23fa4 100644 --- a/instat/dlgSummaryTables.vb +++ b/instat/dlgSummaryTables.vb @@ -182,7 +182,7 @@ Public Class dlgSummaryTables ucrSaveTable.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetDataFrameSelector(ucrSelectorSummaryTables.ucrAvailableDataFrames) ucrSaveTable.SetIsComboBox() - ucrSaveTable.SetCheckBoxText("Save Table") + ucrSaveTable.SetCheckBoxText("Store Table") ucrSaveTable.SetAssignToIfUncheckedValue("last_table") ucrReorderSummary.bDataIsSummaries = True diff --git a/instat/dlgThreeVariableFrequencies.vb b/instat/dlgThreeVariableFrequencies.vb index a0a3c3e330b..e68f16c6c2a 100644 --- a/instat/dlgThreeVariableFrequencies.vb +++ b/instat/dlgThreeVariableFrequencies.vb @@ -291,12 +291,12 @@ Public Class dlgThreeVariableFrequencies ucrBase.clsRsyntax.SetBaseROperator(clsTableBaseOperator) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveGraph.SetAssignToIfUncheckedValue("last_summary") - ucrSaveGraph.SetCheckBoxText("Save Summary") + ucrSaveGraph.SetCheckBoxText("Store Summary") ElseIf rdoGraph.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsGridArrangeFunction) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") End If End Sub diff --git a/instat/dlgThreeVariablesModelling.vb b/instat/dlgThreeVariablesModelling.vb index 80a2882f804..b91e3764e6f 100644 --- a/instat/dlgThreeVariablesModelling.vb +++ b/instat/dlgThreeVariablesModelling.vb @@ -86,7 +86,7 @@ Public Class dlgThreeVariableModelling ucrSaveModel.SetPrefix("reg") ucrSaveModel.SetDataFrameSelector(ucrSelectorThreeVariableModelling.ucrAvailableDataFrames) ucrSaveModel.SetSaveTypeAsModel() - ucrSaveModel.SetCheckBoxText("Save Model") + ucrSaveModel.SetCheckBoxText("Store Model") ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") diff --git a/instat/dlgTwoVariableFitModel.vb b/instat/dlgTwoVariableFitModel.vb index da56404685a..465cfc4f7c8 100644 --- a/instat/dlgTwoVariableFitModel.vb +++ b/instat/dlgTwoVariableFitModel.vb @@ -159,7 +159,7 @@ Public Class dlgTwoVariableFitModel ucrSaveModels.SetPrefix("two_var") ucrSaveModels.SetSaveTypeAsModel() ucrSaveModels.SetDataFrameSelector(ucrSelectorSimpleReg.ucrAvailableDataFrames) - ucrSaveModels.SetCheckBoxText("Save Model") + ucrSaveModels.SetCheckBoxText("Store Model") ucrSaveModels.SetIsComboBox() ucrSaveModels.SetAssignToIfUncheckedValue("last_model") diff --git a/instat/dlgTwoWayFrequencies.vb b/instat/dlgTwoWayFrequencies.vb index 9d07336cc92..b199bb1036e 100644 --- a/instat/dlgTwoWayFrequencies.vb +++ b/instat/dlgTwoWayFrequencies.vb @@ -379,12 +379,12 @@ Public Class dlgTwoWayFrequencies ucrBase.clsRsyntax.SetBaseRFunction(clsSjTab) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Summary, strRObjectFormat:=RObjectFormat.Html) ucrSaveGraph.SetAssignToIfUncheckedValue("last_summary") - ucrSaveGraph.SetCheckBoxText("Save Summary") + ucrSaveGraph.SetCheckBoxText("Store Summary") ElseIf rdoGraph.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsSjPlot) ucrSaveGraph.SetSaveType(RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") End If End Sub diff --git a/instat/dlgUseGraph.vb b/instat/dlgUseGraph.vb index 72f268a077c..8775b4e1a0e 100644 --- a/instat/dlgUseGraph.vb +++ b/instat/dlgUseGraph.vb @@ -85,7 +85,7 @@ Public Class dlgUseGraph ucrSaveGraph.SetSaveType(strRObjectType:=RObjectTypeLabel.Graph, strRObjectFormat:=RObjectFormat.Image) ucrSaveGraph.SetDataFrameSelector(ucrGraphsSelector.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save New Graph") + ucrSaveGraph.SetCheckBoxText("Store New Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgUseModel.vb b/instat/dlgUseModel.vb index 6cdefc38f12..1e280711954 100644 --- a/instat/dlgUseModel.vb +++ b/instat/dlgUseModel.vb @@ -41,7 +41,7 @@ Public Class dlgUseModel ucrSaveResult.SetPrefix("object") ucrSaveResult.SetIsComboBox() ucrSaveResult.SetSaveTypeAsModel() - ucrSaveResult.SetCheckBoxText("Save Output") + ucrSaveResult.SetCheckBoxText("Store Output") ucrSaveResult.SetAssignToIfUncheckedValue("last_object") ucrSaveResult.SetDataFrameSelector(ucrSelectorUseModel.ucrAvailableDataFrames) diff --git a/instat/dlgUseTable.vb b/instat/dlgUseTable.vb index 0e5bd17a22c..1757a270ecf 100644 --- a/instat/dlgUseTable.vb +++ b/instat/dlgUseTable.vb @@ -73,7 +73,7 @@ Public Class dlgUseTable ucrSaveTable.SetPrefix("use_table") ucrSaveTable.SetSaveType(strRObjectType:=RObjectTypeLabel.Table, strRObjectFormat:=RObjectFormat.Html) ucrSaveTable.SetDataFrameSelector(ucrTablesSelector.ucrAvailableDataFrames) - ucrSaveTable.SetCheckBoxText("Save New Table") + ucrSaveTable.SetCheckBoxText("Store New Table") ucrSaveTable.SetIsComboBox() ucrSaveTable.SetAssignToIfUncheckedValue("table") End Sub diff --git a/instat/dlgWindPollutionRose.vb b/instat/dlgWindPollutionRose.vb index 79c87d4b71d..3b94c16bd42 100644 --- a/instat/dlgWindPollutionRose.vb +++ b/instat/dlgWindPollutionRose.vb @@ -108,7 +108,7 @@ Public Class dlgWindPollutionRose ucrSaveGraph.SetPrefix("pollution_rose_plot") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetSaveTypeAsGraph() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetDataFrameSelector(ucrSelectorWindPollutionRose.ucrAvailableDataFrames) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgWindrose.vb b/instat/dlgWindrose.vb index 1d017283960..5d13cfa1c4d 100644 --- a/instat/dlgWindrose.vb +++ b/instat/dlgWindrose.vb @@ -80,7 +80,7 @@ Public Class dlgWindrose ucrSaveGraph.SetDataFrameSelector(ucrWindRoseSelector.ucrAvailableDataFrames) ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetIsComboBox() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub From 8f03b74272af096edb460e3ffb2f9ce1097db2c3 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 27 Jun 2024 10:25:08 +0100 Subject: [PATCH 59/83] Change made --- instat/dlgSeasonalGraph.vb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 06eaa7055eb..2093b9a2a0a 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -47,6 +47,7 @@ Public Class dlgSeasonalGraph Private clsAnnotateFunction As New RFunction Private clsScalefillidentityFunction As New RFunction Private clsScalecolouridentityFunction As New RFunction + Private clsGetObjectDataFunction As New RFunction Private bUpdatingParameters As Boolean = False Private ReadOnly strFacetWrap As String = "Facet Wrap" Private ReadOnly strFacetRow As String = "Facet Row" @@ -180,6 +181,7 @@ Public Class dlgSeasonalGraph clsFacetFunction = New RFunction clsScalecolouridentityFunction = New RFunction clsScalefillidentityFunction = New RFunction + clsGetObjectDataFunction = New RFunction clsFacetOperator = New ROperator clsFacetRowOp = New ROperator clsFacetColOp = New ROperator @@ -247,8 +249,13 @@ Public Class dlgSeasonalGraph clsScaleColourViridisFunction = GgplotDefaults.clsScaleColorViridisFunction clsAnnotateFunction = GgplotDefaults.clsAnnotateFunction + clsGetObjectDataFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_object_data") + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetObjectDataFunction.AddParameter("as_file", "TRUE", iPosition:=2) + clsBaseOperator.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") ucrBase.clsRsyntax.SetBaseROperator(clsBaseOperator) + ucrBase.clsRsyntax.AddToAfterCodes(clsGetObjectDataFunction, iPosition:=0) End Sub Private Sub SetCalculationHistory() @@ -730,6 +737,18 @@ Public Class dlgSeasonalGraph ListGeomLine() End Sub + Private Sub ucrSelectorForSeasonalGraph_DataFrameChanged() Handles ucrSelectorForSeasonalGraph.DataFrameChanged + clsGetObjectDataFunction.AddParameter("data_name", Chr(34) & ucrSelectorForSeasonalGraph.ucrAvailableDataFrames.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + End Sub + + Private Sub ucrSave_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSave.ControlValueChanged + If ucrSave.ucrChkSave.Checked Then + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & ucrSave.GetText & Chr(34), iPosition:=1) + Else + clsGetObjectDataFunction.AddParameter("object_name", Chr(34) & "last_graph" & Chr(34), iPosition:=1) + End If + End Sub + Private Sub AllControl_ControlContentsChanged() Handles ucrReceiverX.ControlContentsChanged, ucrReceiverRibbons.ControlContentsChanged, ucrReceiverLines.ControlContentsChanged, ucrSave.ControlContentsChanged TestOkEnabled() End Sub From 1ff4955e80e35b3c580451f6f5ffb56ba25d8a29 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:33:07 +0200 Subject: [PATCH 60/83] Added Items from the View menu to the Toolbar --- instat/frmMain.Designer.vb | 67 +++++++++++++++++++++++--------------- instat/frmMain.vb | 16 +++++++++ 2 files changed, 57 insertions(+), 26 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 638415b3234..545ab7205e5 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -698,6 +698,8 @@ Partial Class frmMain Me.mnuDataFrameMetadata = New System.Windows.Forms.ToolStripMenuItem() Me.mnuScriptFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuLogFile = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuSwapDataMetadata = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuSwapDataLogScript = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -1540,6 +1542,7 @@ Partial Class frmMain ' 'mnuViewSwapDataAndScript ' + Me.mnuViewSwapDataAndScript.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuViewSwapDataAndScript.Name = "mnuViewSwapDataAndScript" Me.mnuViewSwapDataAndScript.Size = New System.Drawing.Size(213, 22) Me.mnuViewSwapDataAndScript.Text = "Swap Data and Log/Script" @@ -1579,7 +1582,7 @@ Partial Class frmMain 'ToolStripSeparator28 ' Me.ToolStripSeparator28.Name = "ToolStripSeparator28" - Me.ToolStripSeparator28.Size = New System.Drawing.Size(206, 6) + Me.ToolStripSeparator28.Size = New System.Drawing.Size(215, 6) ' 'mnuHelpWindows ' @@ -1590,95 +1593,95 @@ Partial Class frmMain 'ToolStripSeparator81 ' Me.ToolStripSeparator81.Name = "ToolStripSeparator81" - Me.ToolStripSeparator81.Size = New System.Drawing.Size(206, 6) + Me.ToolStripSeparator81.Size = New System.Drawing.Size(215, 6) ' 'mnuHelpMenus ' Me.mnuHelpMenus.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MenusAndDialogsToolStripMenuItem, Me.ToolStripSeparator82, Me.FileToolStripMenuItem, Me.EditToolStripMenuItem, Me.PrepareToolStripMenuItem, Me.DescribeToolStripMenuItem, Me.ModelToolStripMenuItem, Me.ToolStripSeparator83, Me.StructuredToolStripMenuItem, Me.ClimaticToolStripMenuItem, Me.ProcurementToolStripMenuItem, Me.ExperimentsToolStripMenuItem, Me.ToolsToolStripMenuItem, Me.ViewToolStripMenuItem}) Me.mnuHelpMenus.Name = "mnuHelpMenus" - Me.mnuHelpMenus.Size = New System.Drawing.Size(209, 22) + Me.mnuHelpMenus.Size = New System.Drawing.Size(218, 22) Me.mnuHelpMenus.Text = "Menus and Dialogs" ' 'MenusAndDialogsToolStripMenuItem ' Me.MenusAndDialogsToolStripMenuItem.Name = "MenusAndDialogsToolStripMenuItem" - Me.MenusAndDialogsToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.MenusAndDialogsToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.MenusAndDialogsToolStripMenuItem.Text = "Menus and Dialogs" ' 'ToolStripSeparator82 ' Me.ToolStripSeparator82.Name = "ToolStripSeparator82" - Me.ToolStripSeparator82.Size = New System.Drawing.Size(177, 6) + Me.ToolStripSeparator82.Size = New System.Drawing.Size(172, 6) ' 'FileToolStripMenuItem ' Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem" - Me.FileToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.FileToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.FileToolStripMenuItem.Text = "File" ' 'EditToolStripMenuItem ' Me.EditToolStripMenuItem.Name = "EditToolStripMenuItem" - Me.EditToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.EditToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.EditToolStripMenuItem.Text = "Edit" ' 'PrepareToolStripMenuItem ' Me.PrepareToolStripMenuItem.Name = "PrepareToolStripMenuItem" - Me.PrepareToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.PrepareToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.PrepareToolStripMenuItem.Text = "Prepare" ' 'DescribeToolStripMenuItem ' Me.DescribeToolStripMenuItem.Name = "DescribeToolStripMenuItem" - Me.DescribeToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.DescribeToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.DescribeToolStripMenuItem.Text = "Describe" ' 'ModelToolStripMenuItem ' Me.ModelToolStripMenuItem.Name = "ModelToolStripMenuItem" - Me.ModelToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.ModelToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.ModelToolStripMenuItem.Text = "Model" ' 'ToolStripSeparator83 ' Me.ToolStripSeparator83.Name = "ToolStripSeparator83" - Me.ToolStripSeparator83.Size = New System.Drawing.Size(177, 6) + Me.ToolStripSeparator83.Size = New System.Drawing.Size(172, 6) ' 'StructuredToolStripMenuItem ' Me.StructuredToolStripMenuItem.Name = "StructuredToolStripMenuItem" - Me.StructuredToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.StructuredToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.StructuredToolStripMenuItem.Text = "Structured" ' 'ClimaticToolStripMenuItem ' Me.ClimaticToolStripMenuItem.Name = "ClimaticToolStripMenuItem" - Me.ClimaticToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.ClimaticToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.ClimaticToolStripMenuItem.Text = "Climatic" ' 'ProcurementToolStripMenuItem ' Me.ProcurementToolStripMenuItem.Name = "ProcurementToolStripMenuItem" - Me.ProcurementToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.ProcurementToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.ProcurementToolStripMenuItem.Text = "Procurement" ' 'ExperimentsToolStripMenuItem ' Me.ExperimentsToolStripMenuItem.Name = "ExperimentsToolStripMenuItem" - Me.ExperimentsToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.ExperimentsToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.ExperimentsToolStripMenuItem.Text = "Experiments" ' 'ToolsToolStripMenuItem ' Me.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem" - Me.ToolsToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.ToolsToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.ToolsToolStripMenuItem.Text = "Tools" ' 'ViewToolStripMenuItem ' Me.ViewToolStripMenuItem.Name = "ViewToolStripMenuItem" - Me.ViewToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.ViewToolStripMenuItem.Size = New System.Drawing.Size(175, 22) Me.ViewToolStripMenuItem.Text = "View" ' 'mnuHelpAboutR @@ -1717,7 +1720,7 @@ Partial Class frmMain 'ToolStripSeparator29 ' Me.ToolStripSeparator29.Name = "ToolStripSeparator29" - Me.ToolStripSeparator29.Size = New System.Drawing.Size(206, 6) + Me.ToolStripSeparator29.Size = New System.Drawing.Size(215, 6) ' 'mnuHelpPackagesDocumentation ' @@ -3254,7 +3257,7 @@ Partial Class frmMain ' Me.mnuTbLogScript.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.mnuTbLogScript.DropDownButtonWidth = 18 - Me.mnuTbLogScript.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuLogScript}) + Me.mnuTbLogScript.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuLogScript, Me.mnuSwapDataLogScript}) Me.mnuTbLogScript.Image = Global.instat.My.Resources.Resources.scriptwindow Me.mnuTbLogScript.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuTbLogScript.Name = "mnuTbLogScript" @@ -3266,14 +3269,14 @@ Partial Class frmMain ' Me.mnuLogScript.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuLogScript.Name = "mnuLogScript" - Me.mnuLogScript.Size = New System.Drawing.Size(129, 22) + Me.mnuLogScript.Size = New System.Drawing.Size(210, 22) Me.mnuLogScript.Text = "Log/Script" ' 'mnuMetadata ' Me.mnuMetadata.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.mnuMetadata.DropDownButtonWidth = 18 - Me.mnuMetadata.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuColumnMetadat, Me.mnuDataFrameMetadat}) + Me.mnuMetadata.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuColumnMetadat, Me.mnuDataFrameMetadat, Me.mnuSwapDataMetadata}) Me.mnuMetadata.Image = CType(resources.GetObject("mnuMetadata.Image"), System.Drawing.Image) Me.mnuMetadata.ImageTransparentColor = System.Drawing.Color.Magenta Me.mnuMetadata.Name = "mnuMetadata" @@ -3285,14 +3288,14 @@ Partial Class frmMain ' Me.mnuColumnMetadat.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuColumnMetadat.Name = "mnuColumnMetadat" - Me.mnuColumnMetadat.Size = New System.Drawing.Size(202, 22) + Me.mnuColumnMetadat.Size = New System.Drawing.Size(214, 22) Me.mnuColumnMetadat.Text = " Column Metadata..." ' 'mnuDataFrameMetadat ' Me.mnuDataFrameMetadat.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.mnuDataFrameMetadat.Name = "mnuDataFrameMetadat" - Me.mnuDataFrameMetadat.Size = New System.Drawing.Size(202, 22) + Me.mnuDataFrameMetadat.Size = New System.Drawing.Size(214, 22) Me.mnuDataFrameMetadat.Text = " Data Frame Metadata..." ' 'ToolStripSeparator76 @@ -5209,6 +5212,18 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' + 'mnuSwapDataMetadata + ' + Me.mnuSwapDataMetadata.Name = "mnuSwapDataMetadata" + Me.mnuSwapDataMetadata.Size = New System.Drawing.Size(214, 22) + Me.mnuSwapDataMetadata.Text = "Swap Data and Metadata..." + ' + 'mnuSwapDataLogScript + ' + Me.mnuSwapDataLogScript.Name = "mnuSwapDataLogScript" + Me.mnuSwapDataLogScript.Size = New System.Drawing.Size(210, 22) + Me.mnuSwapDataLogScript.Text = "Swap Data and Log/Script" + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -5222,9 +5237,7 @@ Partial Class frmMain Me.IsMdiContainer = True Me.MainMenuStrip = Me.mnuBar Me.Name = "frmMain" - Me.Text = "R-Instat " + My.Application.Info.Version.Major.ToString + "." + - My.Application.Info.Version.Minor.ToString + "." + - My.Application.Info.Version.Build.ToString + Me.Text = "R-Instat .." Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.stsStrip.ResumeLayout(False) Me.stsStrip.PerformLayout() @@ -5928,4 +5941,6 @@ Partial Class frmMain Friend WithEvents ExperimentsToolStripMenuItem As ToolStripMenuItem Friend WithEvents ToolsToolStripMenuItem As ToolStripMenuItem Friend WithEvents ViewToolStripMenuItem As ToolStripMenuItem + Friend WithEvents mnuSwapDataLogScript As ToolStripMenuItem + Friend WithEvents mnuSwapDataMetadata As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index f249dd309dc..525f7712626 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2808,4 +2808,20 @@ Public Class frmMain Private Sub MenusAndDialogsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MenusAndDialogsToolStripMenuItem.Click Help.ShowHelp(Me, strStaticPath & "\" & strHelpFilePath, HelpNavigator.TopicId, "12") End Sub + + Private Sub mnuSwapDataMetadata_Click(sender As Object, e As EventArgs) Handles mnuSwapDataMetadata.Click + mnuSwapDataMetadata.Checked = mnuViewSwapDataAndMetadata.Checked + mnuViewSwapDataAndScript.Enabled = mnuViewSwapDataAndMetadata.Checked + mnuViewSwapDataAndMetadata.Checked = Not mnuViewSwapDataAndMetadata.Checked + UpdateSwapDataAndMetadata() + UpdateLayout() + End Sub + + Private Sub mnuSwapDataLogScript_Click(sender As Object, e As EventArgs) Handles mnuSwapDataLogScript.Click + mnuSwapDataLogScript.Checked = mnuViewSwapDataAndScript.Checked + mnuViewSwapDataAndMetadata.Enabled = mnuViewSwapDataAndScript.Checked + mnuViewSwapDataAndScript.Checked = Not mnuViewSwapDataAndScript.Checked + UpdateSwapDataAndScript() + UpdateLayout() + End Sub End Class From e1500970c319186b8eb89cc3931491dcccaecec7 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 27 Jun 2024 11:53:47 +0100 Subject: [PATCH 61/83] minor change --- instat/dlgSeasonalGraph.vb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 2093b9a2a0a..9679e747052 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -312,13 +312,11 @@ Public Class dlgSeasonalGraph ' Clear parameters before adding new ones clsBaseOperator.ClearParameters() - Dim i As Integer - ' Process ucrReceiverLines if not empty If Not ucrReceiverLines.IsEmpty Then If ucrChkColour.Checked Then ' Add geom_line functions for ucrReceiverLines.lstSelectedVariables - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaeslineFunction As New RFunction Dim ColourArguments As New List(Of String) From {"grey", "grey", "black", "grey"} Dim LinewidthArguments As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} @@ -348,7 +346,7 @@ Public Class dlgSeasonalGraph End If clsBaseOperator.AddParameter("scale_colour_identity", clsRFunctionParameter:=clsScalecolouridentityFunction, iPosition:=13) Else - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsRaeslineFunction As New RFunction Dim ColourArguments1 As New List(Of String) From {"grey", "grey", "black", "grey"} Dim LinewidthArguments1 As New List(Of String) From {"1.0", "1.0", "2.0", "1.0"} @@ -373,7 +371,7 @@ Public Class dlgSeasonalGraph End If ' Add points if ucrChkAddPoint is checked If ucrChkAddPoint.Checked Then - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 Dim clsAesGeompointFunction As New RFunction clsAesGeompointFunction.SetPackageName("ggplot2") clsAesGeompointFunction.SetRCommand("aes") @@ -388,12 +386,12 @@ Public Class dlgSeasonalGraph clsBaseOperator.AddParameter(strGeompointParameterName & "Line" & i, clsRFunctionParameter:=clsGeomPointFunction, iPosition:=9) Next Else - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line" & i) Next End If Else - For i = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverLines.lstSelectedVariables.Items.Count - 1 clsBaseOperator.RemoveParameterByName(strGeompointParameterName & "Line" & i) clsBaseOperator.RemoveParameterByName(strFirstParameterName & i) Next @@ -404,7 +402,7 @@ Public Class dlgSeasonalGraph If ucrChkRibbons.Checked AndAlso Not ucrReceiverRibbons.IsEmpty Then If ucrChkFill.Checked Then clsBaseOperator.AddParameter("scale_fill_identity", clsRFunctionParameter:=clsScalefillidentityFunction, iPosition:=12) - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 + For i As Integer = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 ' Get current variable Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text ' Get the next variable in the pair if available @@ -435,7 +433,7 @@ Public Class dlgSeasonalGraph clsScalefillidentityFunction.RemoveParameterByName("labels") End If Else - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 + For i As Integer = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 Step 2 ' Get current variable Dim var1 = ucrReceiverRibbons.lstSelectedVariables.Items(i).Text ' Get the next variable in the pair if available @@ -480,12 +478,12 @@ Public Class dlgSeasonalGraph clsBaseOperator.AddParameter(strGeompointParameterName1 & "Ribbon" & ucrReceiverRibbons.lstSelectedVariables.Items.IndexOf(selectedItem), clsRFunctionParameter:=clsGeomPointFunction1, iPosition:=15) Next Else - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon" & i) Next End If Else - For i = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 + For i As Integer = 0 To ucrReceiverRibbons.lstSelectedVariables.Items.Count - 1 clsBaseOperator.RemoveParameterByName(strGeompointParameterName1 & "Ribbon" & i) clsBaseOperator.RemoveParameterByName(strgeomRibbonParameterName0 & i) Next From 6d42ea9c61392f31f577d3a6e64913b75ce2e39b Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Thu, 27 Jun 2024 12:00:50 +0100 Subject: [PATCH 62/83] minor change made --- instat/dlgSeasonalGraph.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb index 9679e747052..e21ea4601bf 100644 --- a/instat/dlgSeasonalGraph.vb +++ b/instat/dlgSeasonalGraph.vb @@ -168,7 +168,7 @@ Public Class dlgSeasonalGraph ucrSave.SetPrefix("Seasonal_Graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() - ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetCheckBoxText("Store Graph") ucrSave.SetDataFrameSelector(ucrSelectorForSeasonalGraph.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub From c6630c42c54cd6ee4b9e22f9caf01befc9168396 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Fri, 28 Jun 2024 09:28:23 +0100 Subject: [PATCH 63/83] Change made --- instat/dlgEvapotranspiration.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index b78cee3e008..280d3d33928 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -98,7 +98,7 @@ Public Class dlgEvapotranspiration ucrReceiverHumidityMin.SetClimaticType("hum_min") ucrReceiverHumidityMin.bAutoFill = True - ucrReceiverWindSpeed.SetParameter(New RParameter("u2", 7)) + ucrReceiverWindSpeed.SetParameter(New RParameter("uz", 7)) ucrReceiverWindSpeed.SetParameterIsRFunction() ucrReceiverWindSpeed.SetClimaticType("wind_speed") ucrReceiverWindSpeed.bAutoFill = True @@ -488,7 +488,7 @@ Public Class dlgEvapotranspiration Private Sub ucrReceiverWindSpeed_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverWindSpeed.ControlValueChanged, ucrChkWind.ControlValueChanged If ucrChkWind.Checked AndAlso Not ucrReceiverWindSpeed.IsEmpty Then - clsVarnamesVectorPMFunction.AddParameter("x", Chr(34) & "u2" & Chr(34), bIncludeArgumentName:=False) + clsVarnamesVectorPMFunction.AddParameter("x", Chr(34) & "uz" & Chr(34), bIncludeArgumentName:=False) Else clsVarnamesVectorPMFunction.RemoveParameterByName("x") ucrReceiverHumidityMax.SetMeAsReceiver() From 615bdaf0eda3840bd430eda9f3fe0d90ed246d86 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:50:21 +0200 Subject: [PATCH 64/83] code changes --- instat/frmMain.Designer.vb | 30 ++++++++++++++++-------------- instat/frmMain.vb | 9 ++++++--- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 545ab7205e5..43155880a06 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -415,9 +415,11 @@ Partial Class frmMain Me.ToolStripSeparator75 = New System.Windows.Forms.ToolStripSeparator() Me.mnuTbLogScript = New System.Windows.Forms.ToolStripSplitButton() Me.mnuLogScript = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuSwapDataLogScript = New System.Windows.Forms.ToolStripMenuItem() Me.mnuMetadata = New System.Windows.Forms.ToolStripSplitButton() Me.mnuColumnMetadat = New System.Windows.Forms.ToolStripMenuItem() Me.mnuDataFrameMetadat = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuSwapDataMetadata = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator76 = New System.Windows.Forms.ToolStripSeparator() Me.mnuTbResetLayout = New System.Windows.Forms.ToolStripButton() Me.separator3 = New System.Windows.Forms.ToolStripSeparator() @@ -698,8 +700,6 @@ Partial Class frmMain Me.mnuDataFrameMetadata = New System.Windows.Forms.ToolStripMenuItem() Me.mnuScriptFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuLogFile = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuSwapDataMetadata = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuSwapDataLogScript = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -3272,6 +3272,13 @@ Partial Class frmMain Me.mnuLogScript.Size = New System.Drawing.Size(210, 22) Me.mnuLogScript.Text = "Log/Script" ' + 'mnuSwapDataLogScript + ' + Me.mnuSwapDataLogScript.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None + Me.mnuSwapDataLogScript.Name = "mnuSwapDataLogScript" + Me.mnuSwapDataLogScript.Size = New System.Drawing.Size(210, 22) + Me.mnuSwapDataLogScript.Text = "Swap Data and Log/Script" + ' 'mnuMetadata ' Me.mnuMetadata.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image @@ -3298,6 +3305,13 @@ Partial Class frmMain Me.mnuDataFrameMetadat.Size = New System.Drawing.Size(214, 22) Me.mnuDataFrameMetadat.Text = " Data Frame Metadata..." ' + 'mnuSwapDataMetadata + ' + Me.mnuSwapDataMetadata.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None + Me.mnuSwapDataMetadata.Name = "mnuSwapDataMetadata" + Me.mnuSwapDataMetadata.Size = New System.Drawing.Size(214, 22) + Me.mnuSwapDataMetadata.Text = "Swap Data and Metadata..." + ' 'ToolStripSeparator76 ' Me.ToolStripSeparator76.Name = "ToolStripSeparator76" @@ -5212,18 +5226,6 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' - 'mnuSwapDataMetadata - ' - Me.mnuSwapDataMetadata.Name = "mnuSwapDataMetadata" - Me.mnuSwapDataMetadata.Size = New System.Drawing.Size(214, 22) - Me.mnuSwapDataMetadata.Text = "Swap Data and Metadata..." - ' - 'mnuSwapDataLogScript - ' - Me.mnuSwapDataLogScript.Name = "mnuSwapDataLogScript" - Me.mnuSwapDataLogScript.Size = New System.Drawing.Size(210, 22) - Me.mnuSwapDataLogScript.Text = "Swap Data and Log/Script" - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 525f7712626..b1a58b1cc0c 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -295,7 +295,8 @@ Public Class frmMain mnuViewSwapDataAndScript.Checked = False mnuColumnMetadat.Checked = False mnuDataFrameMetadat.Checked = False - + mnuSwapDataLogScript.Checked = False + mnuSwapDataMetadata.Checked = False mnuTbDataView.Checked = True mnuOutputWindow.Checked = True mnuLogScript.Checked = False @@ -578,11 +579,13 @@ Public Class frmMain splMetadata.Panel1.Controls.Add(ucrDataViewer) mnuViewColumnMetadata.Text = "Data View" mnuViewDataView.Text = "Column Metadata" + mnuSwapDataMetadata.Checked = True Else splDataOutput.Panel1.Controls.Add(ucrDataViewer) splMetadata.Panel1.Controls.Add(ucrColumnMeta) mnuViewColumnMetadata.Text = "Column Metadata" mnuViewDataView.Text = "Data View" + mnuSwapDataMetadata.Checked = False End If End Sub @@ -592,11 +595,13 @@ Public Class frmMain splExtraWindows.Panel2.Controls.Add(ucrDataViewer) mnuViewLogScript.Text = "Data View" mnuViewDataView.Text = "Log/Script" + mnuSwapDataLogScript.Checked = True Else splDataOutput.Panel1.Controls.Add(ucrDataViewer) splExtraWindows.Panel2.Controls.Add(ucrScriptWindow) mnuViewLogScript.Text = "Log/Script" mnuViewDataView.Text = "Data View" + mnuSwapDataLogScript.Checked = False End If End Sub @@ -2810,7 +2815,6 @@ Public Class frmMain End Sub Private Sub mnuSwapDataMetadata_Click(sender As Object, e As EventArgs) Handles mnuSwapDataMetadata.Click - mnuSwapDataMetadata.Checked = mnuViewSwapDataAndMetadata.Checked mnuViewSwapDataAndScript.Enabled = mnuViewSwapDataAndMetadata.Checked mnuViewSwapDataAndMetadata.Checked = Not mnuViewSwapDataAndMetadata.Checked UpdateSwapDataAndMetadata() @@ -2818,7 +2822,6 @@ Public Class frmMain End Sub Private Sub mnuSwapDataLogScript_Click(sender As Object, e As EventArgs) Handles mnuSwapDataLogScript.Click - mnuSwapDataLogScript.Checked = mnuViewSwapDataAndScript.Checked mnuViewSwapDataAndMetadata.Enabled = mnuViewSwapDataAndScript.Checked mnuViewSwapDataAndScript.Checked = Not mnuViewSwapDataAndScript.Checked UpdateSwapDataAndScript() From 64bad597e7bd2d8b09dd1635e7ce93c931df4c21 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:27:47 +0300 Subject: [PATCH 65/83] changes --- instat/ucrDataView.Designer.vb | 204 ++++++++++----------------------- instat/ucrDataView.vb | 12 +- 2 files changed, 67 insertions(+), 149 deletions(-) diff --git a/instat/ucrDataView.Designer.vb b/instat/ucrDataView.Designer.vb index d1250cdae1f..ec35203e159 100644 --- a/instat/ucrDataView.Designer.vb +++ b/instat/ucrDataView.Designer.vb @@ -120,24 +120,18 @@ Partial Class ucrDataView Me.lblHeaderDataView = New System.Windows.Forms.Label() Me.tlpTableContainer = New System.Windows.Forms.TableLayoutPanel() Me.panelSectionsAll = New System.Windows.Forms.Panel() - Me.panelSectionIfYouMust = New System.Windows.Forms.Panel() + Me.panelSectionAdvanced = New System.Windows.Forms.Panel() Me.linkStartAddRPackage = New System.Windows.Forms.LinkLabel() - Me.lblIFYouMust = New System.Windows.Forms.Label() - Me.linkStartPasteData = New System.Windows.Forms.LinkLabel() + Me.lblAdvanced = New System.Windows.Forms.Label() Me.linkStartRestoreBackup = New System.Windows.Forms.LinkLabel() Me.linkStartSwapDataScriptWindow = New System.Windows.Forms.LinkLabel() Me.panelSectionRecent = New System.Windows.Forms.Panel() Me.lblRecent = New System.Windows.Forms.Label() Me.panelRecentMenuItems = New System.Windows.Forms.Panel() Me.panelSectionHelp = New System.Windows.Forms.Panel() - Me.linkHelpClimaticMenu = New System.Windows.Forms.LinkLabel() - Me.linkHelpPrepareMenu = New System.Windows.Forms.LinkLabel() Me.linkHelpData = New System.Windows.Forms.LinkLabel() Me.linkHelpGettingStarted = New System.Windows.Forms.LinkLabel() Me.lblHelp = New System.Windows.Forms.Label() - Me.linkHelpIntroduction = New System.Windows.Forms.LinkLabel() - Me.linkHelpInstructionVideos = New System.Windows.Forms.LinkLabel() - Me.linkHelpRpackages = New System.Windows.Forms.LinkLabel() Me.linkHelpRInstatWebsite = New System.Windows.Forms.LinkLabel() Me.panelSectionStart = New System.Windows.Forms.Panel() Me.lblStart = New System.Windows.Forms.Label() @@ -158,13 +152,14 @@ Partial Class ucrDataView Me.ucrReoGrid = New instat.ucrDataViewReoGrid() Me.ucrLinuxGrid = New instat.ucrDataViewLinuxGrid() Me.ttGoToRowOrColPage = New System.Windows.Forms.ToolTip(Me.components) + Me.linkStartPasteData = New System.Windows.Forms.LinkLabel() Me.columnContextMenuStrip.SuspendLayout() Me.cellContextMenuStrip.SuspendLayout() Me.rowContextMenuStrip.SuspendLayout() Me.statusColumnMenu.SuspendLayout() Me.tlpTableContainer.SuspendLayout() Me.panelSectionsAll.SuspendLayout() - Me.panelSectionIfYouMust.SuspendLayout() + Me.panelSectionAdvanced.SuspendLayout() Me.panelSectionRecent.SuspendLayout() Me.panelSectionHelp.SuspendLayout() Me.panelSectionStart.SuspendLayout() @@ -672,7 +667,7 @@ Partial Class ucrDataView ' 'panelSectionsAll ' - Me.panelSectionsAll.Controls.Add(Me.panelSectionIfYouMust) + Me.panelSectionsAll.Controls.Add(Me.panelSectionAdvanced) Me.panelSectionsAll.Controls.Add(Me.panelSectionRecent) Me.panelSectionsAll.Controls.Add(Me.panelSectionHelp) Me.panelSectionsAll.Controls.Add(Me.panelSectionStart) @@ -683,17 +678,16 @@ Partial Class ucrDataView Me.panelSectionsAll.Size = New System.Drawing.Size(243, 455) Me.panelSectionsAll.TabIndex = 9 ' - 'panelSectionIfYouMust + 'panelSectionAdvanced ' - Me.panelSectionIfYouMust.Controls.Add(Me.linkStartAddRPackage) - Me.panelSectionIfYouMust.Controls.Add(Me.lblIFYouMust) - Me.panelSectionIfYouMust.Controls.Add(Me.linkStartPasteData) - Me.panelSectionIfYouMust.Controls.Add(Me.linkStartRestoreBackup) - Me.panelSectionIfYouMust.Controls.Add(Me.linkStartSwapDataScriptWindow) - Me.panelSectionIfYouMust.Location = New System.Drawing.Point(28, 446) - Me.panelSectionIfYouMust.Name = "panelSectionIfYouMust" - Me.panelSectionIfYouMust.Size = New System.Drawing.Size(374, 105) - Me.panelSectionIfYouMust.TabIndex = 12 + Me.panelSectionAdvanced.Controls.Add(Me.linkStartAddRPackage) + Me.panelSectionAdvanced.Controls.Add(Me.lblAdvanced) + Me.panelSectionAdvanced.Controls.Add(Me.linkStartRestoreBackup) + Me.panelSectionAdvanced.Controls.Add(Me.linkStartSwapDataScriptWindow) + Me.panelSectionAdvanced.Location = New System.Drawing.Point(28, 428) + Me.panelSectionAdvanced.Name = "panelSectionAdvanced" + Me.panelSectionAdvanced.Size = New System.Drawing.Size(374, 105) + Me.panelSectionAdvanced.TabIndex = 12 ' 'linkStartAddRPackage ' @@ -701,36 +695,23 @@ Partial Class ucrDataView Me.linkStartAddRPackage.AutoSize = True Me.linkStartAddRPackage.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartAddRPackage.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartAddRPackage.Location = New System.Drawing.Point(7, 86) + Me.linkStartAddRPackage.Location = New System.Drawing.Point(7, 65) Me.linkStartAddRPackage.Name = "linkStartAddRPackage" Me.linkStartAddRPackage.Size = New System.Drawing.Size(143, 13) Me.linkStartAddRPackage.TabIndex = 6 Me.linkStartAddRPackage.TabStop = True Me.linkStartAddRPackage.Text = "Add R package to R-Instat..." ' - 'lblIFYouMust + 'lblAdvanced ' - Me.lblIFYouMust.AutoSize = True - Me.lblIFYouMust.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.lblIFYouMust.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblIFYouMust.Location = New System.Drawing.Point(5, 4) - Me.lblIFYouMust.Name = "lblIFYouMust" - Me.lblIFYouMust.Size = New System.Drawing.Size(122, 25) - Me.lblIFYouMust.TabIndex = 0 - Me.lblIFYouMust.Text = "If you must:" - ' - 'linkStartPasteData - ' - Me.linkStartPasteData.ActiveLinkColor = System.Drawing.Color.Red - Me.linkStartPasteData.AutoSize = True - Me.linkStartPasteData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkStartPasteData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartPasteData.Location = New System.Drawing.Point(7, 31) - Me.linkStartPasteData.Name = "linkStartPasteData" - Me.linkStartPasteData.Size = New System.Drawing.Size(136, 13) - Me.linkStartPasteData.TabIndex = 3 - Me.linkStartPasteData.TabStop = True - Me.linkStartPasteData.Text = "Paste data from clipboard..." + Me.lblAdvanced.AutoSize = True + Me.lblAdvanced.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.lblAdvanced.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblAdvanced.Location = New System.Drawing.Point(5, 4) + Me.lblAdvanced.Name = "lblAdvanced" + Me.lblAdvanced.Size = New System.Drawing.Size(108, 25) + Me.lblAdvanced.TabIndex = 0 + Me.lblAdvanced.Text = "Advanced" ' 'linkStartRestoreBackup ' @@ -738,12 +719,12 @@ Partial Class ucrDataView Me.linkStartRestoreBackup.AutoSize = True Me.linkStartRestoreBackup.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartRestoreBackup.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartRestoreBackup.Location = New System.Drawing.Point(7, 49) + Me.linkStartRestoreBackup.Location = New System.Drawing.Point(7, 47) Me.linkStartRestoreBackup.Name = "linkStartRestoreBackup" - Me.linkStartRestoreBackup.Size = New System.Drawing.Size(116, 13) + Me.linkStartRestoreBackup.Size = New System.Drawing.Size(166, 13) Me.linkStartRestoreBackup.TabIndex = 4 Me.linkStartRestoreBackup.TabStop = True - Me.linkStartRestoreBackup.Text = "Restore from Backup..." + Me.linkStartRestoreBackup.Text = "Restore Data or Log from Backup" ' 'linkStartSwapDataScriptWindow ' @@ -751,12 +732,12 @@ Partial Class ucrDataView Me.linkStartSwapDataScriptWindow.AutoSize = True Me.linkStartSwapDataScriptWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartSwapDataScriptWindow.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartSwapDataScriptWindow.Location = New System.Drawing.Point(7, 68) + Me.linkStartSwapDataScriptWindow.Location = New System.Drawing.Point(8, 30) Me.linkStartSwapDataScriptWindow.Name = "linkStartSwapDataScriptWindow" - Me.linkStartSwapDataScriptWindow.Size = New System.Drawing.Size(162, 13) + Me.linkStartSwapDataScriptWindow.Size = New System.Drawing.Size(134, 13) Me.linkStartSwapDataScriptWindow.TabIndex = 5 Me.linkStartSwapDataScriptWindow.TabStop = True - Me.linkStartSwapDataScriptWindow.Text = "Swap Data and Script Window..." + Me.linkStartSwapDataScriptWindow.Text = "Paste Script from Clipboard" ' 'panelSectionRecent ' @@ -764,7 +745,7 @@ Partial Class ucrDataView Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.panelSectionRecent.Controls.Add(Me.lblRecent) Me.panelSectionRecent.Controls.Add(Me.panelRecentMenuItems) - Me.panelSectionRecent.Location = New System.Drawing.Point(28, 91) + Me.panelSectionRecent.Location = New System.Drawing.Point(28, 124) Me.panelSectionRecent.Name = "panelSectionRecent" Me.panelSectionRecent.Size = New System.Drawing.Size(179, 186) Me.panelSectionRecent.TabIndex = 13 @@ -785,60 +766,29 @@ Partial Class ucrDataView Me.panelRecentMenuItems.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.panelRecentMenuItems.AutoScroll = True - Me.panelRecentMenuItems.Location = New System.Drawing.Point(9, 38) + Me.panelRecentMenuItems.Location = New System.Drawing.Point(9, 44) Me.panelRecentMenuItems.Name = "panelRecentMenuItems" Me.panelRecentMenuItems.Size = New System.Drawing.Size(159, 138) Me.panelRecentMenuItems.TabIndex = 6 ' 'panelSectionHelp ' - Me.panelSectionHelp.Controls.Add(Me.linkHelpClimaticMenu) - Me.panelSectionHelp.Controls.Add(Me.linkHelpPrepareMenu) Me.panelSectionHelp.Controls.Add(Me.linkHelpData) Me.panelSectionHelp.Controls.Add(Me.linkHelpGettingStarted) Me.panelSectionHelp.Controls.Add(Me.lblHelp) - Me.panelSectionHelp.Controls.Add(Me.linkHelpIntroduction) - Me.panelSectionHelp.Controls.Add(Me.linkHelpInstructionVideos) - Me.panelSectionHelp.Controls.Add(Me.linkHelpRpackages) Me.panelSectionHelp.Controls.Add(Me.linkHelpRInstatWebsite) - Me.panelSectionHelp.Location = New System.Drawing.Point(28, 278) + Me.panelSectionHelp.Location = New System.Drawing.Point(28, 314) Me.panelSectionHelp.Name = "panelSectionHelp" - Me.panelSectionHelp.Size = New System.Drawing.Size(374, 169) + Me.panelSectionHelp.Size = New System.Drawing.Size(374, 109) Me.panelSectionHelp.TabIndex = 12 ' - 'linkHelpClimaticMenu - ' - Me.linkHelpClimaticMenu.ActiveLinkColor = System.Drawing.Color.Red - Me.linkHelpClimaticMenu.AutoSize = True - Me.linkHelpClimaticMenu.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkHelpClimaticMenu.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpClimaticMenu.Location = New System.Drawing.Point(8, 98) - Me.linkHelpClimaticMenu.Name = "linkHelpClimaticMenu" - Me.linkHelpClimaticMenu.Size = New System.Drawing.Size(73, 13) - Me.linkHelpClimaticMenu.TabIndex = 14 - Me.linkHelpClimaticMenu.TabStop = True - Me.linkHelpClimaticMenu.Text = "Climatic Menu" - ' - 'linkHelpPrepareMenu - ' - Me.linkHelpPrepareMenu.ActiveLinkColor = System.Drawing.Color.Red - Me.linkHelpPrepareMenu.AutoSize = True - Me.linkHelpPrepareMenu.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkHelpPrepareMenu.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpPrepareMenu.Location = New System.Drawing.Point(8, 82) - Me.linkHelpPrepareMenu.Name = "linkHelpPrepareMenu" - Me.linkHelpPrepareMenu.Size = New System.Drawing.Size(74, 13) - Me.linkHelpPrepareMenu.TabIndex = 13 - Me.linkHelpPrepareMenu.TabStop = True - Me.linkHelpPrepareMenu.Text = "Prepare Menu" - ' 'linkHelpData ' Me.linkHelpData.ActiveLinkColor = System.Drawing.Color.Red Me.linkHelpData.AutoSize = True Me.linkHelpData.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpData.Location = New System.Drawing.Point(8, 66) + Me.linkHelpData.Location = New System.Drawing.Point(8, 49) Me.linkHelpData.Name = "linkHelpData" Me.linkHelpData.Size = New System.Drawing.Size(30, 13) Me.linkHelpData.TabIndex = 12 @@ -851,7 +801,7 @@ Partial Class ucrDataView Me.linkHelpGettingStarted.AutoSize = True Me.linkHelpGettingStarted.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpGettingStarted.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpGettingStarted.Location = New System.Drawing.Point(8, 49) + Me.linkHelpGettingStarted.Location = New System.Drawing.Point(8, 33) Me.linkHelpGettingStarted.Name = "linkHelpGettingStarted" Me.linkHelpGettingStarted.Size = New System.Drawing.Size(78, 13) Me.linkHelpGettingStarted.TabIndex = 11 @@ -869,69 +819,29 @@ Partial Class ucrDataView Me.lblHelp.TabIndex = 2 Me.lblHelp.Text = "Help" ' - 'linkHelpIntroduction - ' - Me.linkHelpIntroduction.ActiveLinkColor = System.Drawing.Color.Red - Me.linkHelpIntroduction.AutoSize = True - Me.linkHelpIntroduction.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkHelpIntroduction.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpIntroduction.Location = New System.Drawing.Point(8, 31) - Me.linkHelpIntroduction.Name = "linkHelpIntroduction" - Me.linkHelpIntroduction.Size = New System.Drawing.Size(63, 13) - Me.linkHelpIntroduction.TabIndex = 7 - Me.linkHelpIntroduction.TabStop = True - Me.linkHelpIntroduction.Text = "Introduction" - ' - 'linkHelpInstructionVideos - ' - Me.linkHelpInstructionVideos.ActiveLinkColor = System.Drawing.Color.Red - Me.linkHelpInstructionVideos.AutoSize = True - Me.linkHelpInstructionVideos.Enabled = False - Me.linkHelpInstructionVideos.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkHelpInstructionVideos.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpInstructionVideos.Location = New System.Drawing.Point(8, 152) - Me.linkHelpInstructionVideos.Name = "linkHelpInstructionVideos" - Me.linkHelpInstructionVideos.Size = New System.Drawing.Size(98, 13) - Me.linkHelpInstructionVideos.TabIndex = 10 - Me.linkHelpInstructionVideos.TabStop = True - Me.linkHelpInstructionVideos.Text = "Instructional videos" - Me.linkHelpInstructionVideos.Visible = False - ' - 'linkHelpRpackages - ' - Me.linkHelpRpackages.ActiveLinkColor = System.Drawing.Color.Red - Me.linkHelpRpackages.AutoSize = True - Me.linkHelpRpackages.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkHelpRpackages.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpRpackages.Location = New System.Drawing.Point(8, 114) - Me.linkHelpRpackages.Name = "linkHelpRpackages" - Me.linkHelpRpackages.Size = New System.Drawing.Size(116, 13) - Me.linkHelpRpackages.TabIndex = 8 - Me.linkHelpRpackages.TabStop = True - Me.linkHelpRpackages.Text = "R packages in R-Instat" - ' 'linkHelpRInstatWebsite ' Me.linkHelpRInstatWebsite.ActiveLinkColor = System.Drawing.Color.Red Me.linkHelpRInstatWebsite.AutoSize = True Me.linkHelpRInstatWebsite.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkHelpRInstatWebsite.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpRInstatWebsite.Location = New System.Drawing.Point(8, 133) + Me.linkHelpRInstatWebsite.Location = New System.Drawing.Point(8, 65) Me.linkHelpRInstatWebsite.Name = "linkHelpRInstatWebsite" - Me.linkHelpRInstatWebsite.Size = New System.Drawing.Size(83, 13) + Me.linkHelpRInstatWebsite.Size = New System.Drawing.Size(119, 13) Me.linkHelpRInstatWebsite.TabIndex = 9 Me.linkHelpRInstatWebsite.TabStop = True - Me.linkHelpRInstatWebsite.Text = "R-Instat website" + Me.linkHelpRInstatWebsite.Text = "R-Instat Resources Site" ' 'panelSectionStart ' + Me.panelSectionStart.Controls.Add(Me.linkStartPasteData) Me.panelSectionStart.Controls.Add(Me.lblStart) Me.panelSectionStart.Controls.Add(Me.linkStartNewDataFrame) Me.panelSectionStart.Controls.Add(Me.linkStartOpenFile) Me.panelSectionStart.Controls.Add(Me.linkStartOpenLibrary) Me.panelSectionStart.Location = New System.Drawing.Point(28, 6) Me.panelSectionStart.Name = "panelSectionStart" - Me.panelSectionStart.Size = New System.Drawing.Size(374, 85) + Me.panelSectionStart.Size = New System.Drawing.Size(374, 113) Me.panelSectionStart.TabIndex = 11 ' 'lblStart @@ -964,7 +874,7 @@ Partial Class ucrDataView Me.linkStartOpenFile.AutoSize = True Me.linkStartOpenFile.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartOpenFile.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartOpenFile.Location = New System.Drawing.Point(7, 49) + Me.linkStartOpenFile.Location = New System.Drawing.Point(7, 48) Me.linkStartOpenFile.Name = "linkStartOpenFile" Me.linkStartOpenFile.Size = New System.Drawing.Size(90, 13) Me.linkStartOpenFile.TabIndex = 4 @@ -977,7 +887,7 @@ Partial Class ucrDataView Me.linkStartOpenLibrary.AutoSize = True Me.linkStartOpenLibrary.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.linkStartOpenLibrary.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartOpenLibrary.Location = New System.Drawing.Point(7, 68) + Me.linkStartOpenLibrary.Location = New System.Drawing.Point(7, 66) Me.linkStartOpenLibrary.Name = "linkStartOpenLibrary" Me.linkStartOpenLibrary.Size = New System.Drawing.Size(105, 13) Me.linkStartOpenLibrary.TabIndex = 5 @@ -1150,6 +1060,19 @@ Partial Class ucrDataView Me.ucrLinuxGrid.Size = New System.Drawing.Size(245, 437) Me.ucrLinuxGrid.TabIndex = 13 ' + 'linkStartPasteData + ' + Me.linkStartPasteData.ActiveLinkColor = System.Drawing.Color.Red + Me.linkStartPasteData.AutoSize = True + Me.linkStartPasteData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.linkStartPasteData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline + Me.linkStartPasteData.Location = New System.Drawing.Point(7, 84) + Me.linkStartPasteData.Name = "linkStartPasteData" + Me.linkStartPasteData.Size = New System.Drawing.Size(136, 13) + Me.linkStartPasteData.TabIndex = 7 + Me.linkStartPasteData.TabStop = True + Me.linkStartPasteData.Text = "Paste data from clipboard..." + ' 'ucrDataView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -1166,8 +1089,8 @@ Partial Class ucrDataView Me.tlpTableContainer.ResumeLayout(False) Me.tlpTableContainer.PerformLayout() Me.panelSectionsAll.ResumeLayout(False) - Me.panelSectionIfYouMust.ResumeLayout(False) - Me.panelSectionIfYouMust.PerformLayout() + Me.panelSectionAdvanced.ResumeLayout(False) + Me.panelSectionAdvanced.PerformLayout() Me.panelSectionRecent.ResumeLayout(False) Me.panelSectionRecent.PerformLayout() Me.panelSectionHelp.ResumeLayout(False) @@ -1253,9 +1176,6 @@ Partial Class ucrDataView Friend WithEvents panelRecentMenuItems As Panel Friend WithEvents panelSectionHelp As Panel Friend WithEvents lblHelp As Label - Friend WithEvents linkHelpIntroduction As LinkLabel - Friend WithEvents linkHelpInstructionVideos As LinkLabel - Friend WithEvents linkHelpRpackages As LinkLabel Friend WithEvents linkHelpRInstatWebsite As LinkLabel Friend WithEvents panelSectionStart As Panel Friend WithEvents lblStart As Label @@ -1291,14 +1211,12 @@ Partial Class ucrDataView Friend WithEvents mnuDeleteCol2 As ToolStripMenuItem Friend WithEvents ToolStripSeparator14 As ToolStripSeparator Friend WithEvents mnuEditCell As ToolStripMenuItem - Friend WithEvents linkHelpPrepareMenu As LinkLabel Friend WithEvents linkHelpData As LinkLabel Friend WithEvents linkHelpGettingStarted As LinkLabel - Friend WithEvents linkHelpClimaticMenu As LinkLabel - Friend WithEvents panelSectionIfYouMust As Panel - Friend WithEvents lblIFYouMust As Label - Friend WithEvents linkStartPasteData As LinkLabel + Friend WithEvents panelSectionAdvanced As Panel + Friend WithEvents lblAdvanced As Label Friend WithEvents linkStartRestoreBackup As LinkLabel Friend WithEvents linkStartSwapDataScriptWindow As LinkLabel Friend WithEvents linkStartAddRPackage As LinkLabel + Friend WithEvents linkStartPasteData As LinkLabel End Class diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index 3f77aed3c2f..6afc6f51719 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -765,16 +765,16 @@ Public Class ucrDataView panelSectionRecent.Visible = panelRecentMenuItems.Controls.Count > 0 End Sub - Private Sub linkHelpIntroduction_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpIntroduction.LinkClicked + Private Sub linkHelpIntroduction_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Help.ShowHelp(frmMain, frmMain.strStaticPath & "/" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "0") End Sub - Private Sub linkHelpRpackages_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpRpackages.LinkClicked + Private Sub linkHelpRpackages_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) dlgHelpVignettes.ShowDialog() End Sub Private Sub linkHelpRInstatWebsite_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpRInstatWebsite.LinkClicked - Process.Start("http://r-instat.org/") + Process.Start("https://ecampus.r-instat.org/course/view.php?id=14") End Sub Private Sub rowContextMenuStrip_Opening(sender As Object, e As CancelEventArgs) Handles rowContextMenuStrip.Opening @@ -1019,11 +1019,11 @@ Public Class ucrDataView Help.ShowHelp(frmMain, frmMain.strStaticPath & "/" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "71") End Sub - Private Sub linkHelpPrepareMenu_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpPrepareMenu.LinkClicked + Private Sub linkHelpPrepareMenu_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Help.ShowHelp(frmMain, frmMain.strStaticPath & "/" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "9") End Sub - Private Sub linkHelpClimaticMenu_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpClimaticMenu.LinkClicked + Private Sub linkHelpClimaticMenu_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Help.ShowHelp(frmMain, frmMain.strStaticPath & "/" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "19") End Sub @@ -1042,7 +1042,7 @@ Public Class ucrDataView dlgInstallRPackage.ShowDialog() End Sub - Private Sub linkStartPasteData_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkStartPasteData.LinkClicked + Private Sub linkStartPasteData_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) dlgPasteNewColumns.ShowDialog() End Sub End Class \ No newline at end of file From dcceb2a1a48ecf8b085877b8d71f4b929fe571b8 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:28:07 +0300 Subject: [PATCH 66/83] changes2 --- instat/ucrDataView.Designer.vb | 28 ++++++++++++++-------------- instat/ucrDataView.vb | 6 +++++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/instat/ucrDataView.Designer.vb b/instat/ucrDataView.Designer.vb index ec35203e159..3b6ece44028 100644 --- a/instat/ucrDataView.Designer.vb +++ b/instat/ucrDataView.Designer.vb @@ -132,7 +132,7 @@ Partial Class ucrDataView Me.linkHelpData = New System.Windows.Forms.LinkLabel() Me.linkHelpGettingStarted = New System.Windows.Forms.LinkLabel() Me.lblHelp = New System.Windows.Forms.Label() - Me.linkHelpRInstatWebsite = New System.Windows.Forms.LinkLabel() + Me.linkHelpRInstatResourcesSite = New System.Windows.Forms.LinkLabel() Me.panelSectionStart = New System.Windows.Forms.Panel() Me.lblStart = New System.Windows.Forms.Label() Me.linkStartNewDataFrame = New System.Windows.Forms.LinkLabel() @@ -776,7 +776,7 @@ Partial Class ucrDataView Me.panelSectionHelp.Controls.Add(Me.linkHelpData) Me.panelSectionHelp.Controls.Add(Me.linkHelpGettingStarted) Me.panelSectionHelp.Controls.Add(Me.lblHelp) - Me.panelSectionHelp.Controls.Add(Me.linkHelpRInstatWebsite) + Me.panelSectionHelp.Controls.Add(Me.linkHelpRInstatResourcesSite) Me.panelSectionHelp.Location = New System.Drawing.Point(28, 314) Me.panelSectionHelp.Name = "panelSectionHelp" Me.panelSectionHelp.Size = New System.Drawing.Size(374, 109) @@ -819,18 +819,18 @@ Partial Class ucrDataView Me.lblHelp.TabIndex = 2 Me.lblHelp.Text = "Help" ' - 'linkHelpRInstatWebsite + 'linkHelpRInstatResourcesSite ' - Me.linkHelpRInstatWebsite.ActiveLinkColor = System.Drawing.Color.Red - Me.linkHelpRInstatWebsite.AutoSize = True - Me.linkHelpRInstatWebsite.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkHelpRInstatWebsite.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkHelpRInstatWebsite.Location = New System.Drawing.Point(8, 65) - Me.linkHelpRInstatWebsite.Name = "linkHelpRInstatWebsite" - Me.linkHelpRInstatWebsite.Size = New System.Drawing.Size(119, 13) - Me.linkHelpRInstatWebsite.TabIndex = 9 - Me.linkHelpRInstatWebsite.TabStop = True - Me.linkHelpRInstatWebsite.Text = "R-Instat Resources Site" + Me.linkHelpRInstatResourcesSite.ActiveLinkColor = System.Drawing.Color.Red + Me.linkHelpRInstatResourcesSite.AutoSize = True + Me.linkHelpRInstatResourcesSite.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.linkHelpRInstatResourcesSite.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline + Me.linkHelpRInstatResourcesSite.Location = New System.Drawing.Point(8, 65) + Me.linkHelpRInstatResourcesSite.Name = "linkHelpRInstatResourcesSite" + Me.linkHelpRInstatResourcesSite.Size = New System.Drawing.Size(119, 13) + Me.linkHelpRInstatResourcesSite.TabIndex = 9 + Me.linkHelpRInstatResourcesSite.TabStop = True + Me.linkHelpRInstatResourcesSite.Text = "R-Instat Resources Site" ' 'panelSectionStart ' @@ -1176,7 +1176,7 @@ Partial Class ucrDataView Friend WithEvents panelRecentMenuItems As Panel Friend WithEvents panelSectionHelp As Panel Friend WithEvents lblHelp As Label - Friend WithEvents linkHelpRInstatWebsite As LinkLabel + Friend WithEvents linkHelpRInstatResourcesSite As LinkLabel Friend WithEvents panelSectionStart As Panel Friend WithEvents lblStart As Label Friend WithEvents linkStartNewDataFrame As LinkLabel diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index 6afc6f51719..fdace2c8f05 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -773,7 +773,7 @@ Public Class ucrDataView dlgHelpVignettes.ShowDialog() End Sub - Private Sub linkHelpRInstatWebsite_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpRInstatWebsite.LinkClicked + Private Sub linkHelpRInstatWebsite_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpRInstatResourcesSite.LinkClicked Process.Start("https://ecampus.r-instat.org/course/view.php?id=14") End Sub @@ -1045,4 +1045,8 @@ Public Class ucrDataView Private Sub linkStartPasteData_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) dlgPasteNewColumns.ShowDialog() End Sub + + Private Sub linkStartPasteData_LinkClicked_1(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkStartPasteData.LinkClicked + + End Sub End Class \ No newline at end of file From 3ba3facae37d755d95247c019b2cf5d32b5dd7d9 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:56:50 +0300 Subject: [PATCH 67/83] Advanced Options --- instat/ucrDataView.Designer.vb | 58 +++++++++++++++++----------------- instat/ucrDataView.vb | 7 ++-- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/instat/ucrDataView.Designer.vb b/instat/ucrDataView.Designer.vb index 3b6ece44028..312d7b4de5d 100644 --- a/instat/ucrDataView.Designer.vb +++ b/instat/ucrDataView.Designer.vb @@ -124,7 +124,7 @@ Partial Class ucrDataView Me.linkStartAddRPackage = New System.Windows.Forms.LinkLabel() Me.lblAdvanced = New System.Windows.Forms.Label() Me.linkStartRestoreBackup = New System.Windows.Forms.LinkLabel() - Me.linkStartSwapDataScriptWindow = New System.Windows.Forms.LinkLabel() + Me.linkStartPasteScriptfromClipboard = New System.Windows.Forms.LinkLabel() Me.panelSectionRecent = New System.Windows.Forms.Panel() Me.lblRecent = New System.Windows.Forms.Label() Me.panelRecentMenuItems = New System.Windows.Forms.Panel() @@ -134,6 +134,7 @@ Partial Class ucrDataView Me.lblHelp = New System.Windows.Forms.Label() Me.linkHelpRInstatResourcesSite = New System.Windows.Forms.LinkLabel() Me.panelSectionStart = New System.Windows.Forms.Panel() + Me.linkStartPasteData = New System.Windows.Forms.LinkLabel() Me.lblStart = New System.Windows.Forms.Label() Me.linkStartNewDataFrame = New System.Windows.Forms.LinkLabel() Me.linkStartOpenFile = New System.Windows.Forms.LinkLabel() @@ -152,7 +153,6 @@ Partial Class ucrDataView Me.ucrReoGrid = New instat.ucrDataViewReoGrid() Me.ucrLinuxGrid = New instat.ucrDataViewLinuxGrid() Me.ttGoToRowOrColPage = New System.Windows.Forms.ToolTip(Me.components) - Me.linkStartPasteData = New System.Windows.Forms.LinkLabel() Me.columnContextMenuStrip.SuspendLayout() Me.cellContextMenuStrip.SuspendLayout() Me.rowContextMenuStrip.SuspendLayout() @@ -683,8 +683,8 @@ Partial Class ucrDataView Me.panelSectionAdvanced.Controls.Add(Me.linkStartAddRPackage) Me.panelSectionAdvanced.Controls.Add(Me.lblAdvanced) Me.panelSectionAdvanced.Controls.Add(Me.linkStartRestoreBackup) - Me.panelSectionAdvanced.Controls.Add(Me.linkStartSwapDataScriptWindow) - Me.panelSectionAdvanced.Location = New System.Drawing.Point(28, 428) + Me.panelSectionAdvanced.Controls.Add(Me.linkStartPasteScriptfromClipboard) + Me.panelSectionAdvanced.Location = New System.Drawing.Point(28, 431) Me.panelSectionAdvanced.Name = "panelSectionAdvanced" Me.panelSectionAdvanced.Size = New System.Drawing.Size(374, 105) Me.panelSectionAdvanced.TabIndex = 12 @@ -726,18 +726,18 @@ Partial Class ucrDataView Me.linkStartRestoreBackup.TabStop = True Me.linkStartRestoreBackup.Text = "Restore Data or Log from Backup" ' - 'linkStartSwapDataScriptWindow + 'linkStartPasteScriptfromClipboard ' - Me.linkStartSwapDataScriptWindow.ActiveLinkColor = System.Drawing.Color.Red - Me.linkStartSwapDataScriptWindow.AutoSize = True - Me.linkStartSwapDataScriptWindow.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkStartSwapDataScriptWindow.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartSwapDataScriptWindow.Location = New System.Drawing.Point(8, 30) - Me.linkStartSwapDataScriptWindow.Name = "linkStartSwapDataScriptWindow" - Me.linkStartSwapDataScriptWindow.Size = New System.Drawing.Size(134, 13) - Me.linkStartSwapDataScriptWindow.TabIndex = 5 - Me.linkStartSwapDataScriptWindow.TabStop = True - Me.linkStartSwapDataScriptWindow.Text = "Paste Script from Clipboard" + Me.linkStartPasteScriptfromClipboard.ActiveLinkColor = System.Drawing.Color.Red + Me.linkStartPasteScriptfromClipboard.AutoSize = True + Me.linkStartPasteScriptfromClipboard.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.linkStartPasteScriptfromClipboard.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline + Me.linkStartPasteScriptfromClipboard.Location = New System.Drawing.Point(8, 30) + Me.linkStartPasteScriptfromClipboard.Name = "linkStartPasteScriptfromClipboard" + Me.linkStartPasteScriptfromClipboard.Size = New System.Drawing.Size(134, 13) + Me.linkStartPasteScriptfromClipboard.TabIndex = 5 + Me.linkStartPasteScriptfromClipboard.TabStop = True + Me.linkStartPasteScriptfromClipboard.Text = "Paste Script from Clipboard" ' 'panelSectionRecent ' @@ -844,6 +844,19 @@ Partial Class ucrDataView Me.panelSectionStart.Size = New System.Drawing.Size(374, 113) Me.panelSectionStart.TabIndex = 11 ' + 'linkStartPasteData + ' + Me.linkStartPasteData.ActiveLinkColor = System.Drawing.Color.Red + Me.linkStartPasteData.AutoSize = True + Me.linkStartPasteData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.linkStartPasteData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline + Me.linkStartPasteData.Location = New System.Drawing.Point(7, 84) + Me.linkStartPasteData.Name = "linkStartPasteData" + Me.linkStartPasteData.Size = New System.Drawing.Size(136, 13) + Me.linkStartPasteData.TabIndex = 7 + Me.linkStartPasteData.TabStop = True + Me.linkStartPasteData.Text = "Paste data from clipboard..." + ' 'lblStart ' Me.lblStart.AutoSize = True @@ -1060,19 +1073,6 @@ Partial Class ucrDataView Me.ucrLinuxGrid.Size = New System.Drawing.Size(245, 437) Me.ucrLinuxGrid.TabIndex = 13 ' - 'linkStartPasteData - ' - Me.linkStartPasteData.ActiveLinkColor = System.Drawing.Color.Red - Me.linkStartPasteData.AutoSize = True - Me.linkStartPasteData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.linkStartPasteData.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline - Me.linkStartPasteData.Location = New System.Drawing.Point(7, 84) - Me.linkStartPasteData.Name = "linkStartPasteData" - Me.linkStartPasteData.Size = New System.Drawing.Size(136, 13) - Me.linkStartPasteData.TabIndex = 7 - Me.linkStartPasteData.TabStop = True - Me.linkStartPasteData.Text = "Paste data from clipboard..." - ' 'ucrDataView ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -1216,7 +1216,7 @@ Partial Class ucrDataView Friend WithEvents panelSectionAdvanced As Panel Friend WithEvents lblAdvanced As Label Friend WithEvents linkStartRestoreBackup As LinkLabel - Friend WithEvents linkStartSwapDataScriptWindow As LinkLabel + Friend WithEvents linkStartPasteScriptfromClipboard As LinkLabel Friend WithEvents linkStartAddRPackage As LinkLabel Friend WithEvents linkStartPasteData As LinkLabel End Class diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index fdace2c8f05..f402a43bf56 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -1027,7 +1027,7 @@ Public Class ucrDataView Help.ShowHelp(frmMain, frmMain.strStaticPath & "/" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "19") End Sub - Private Sub linkStartSwapDataScriptWindow_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkStartSwapDataScriptWindow.LinkClicked + Private Sub linkStartPasteScriptfromClipboard_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkStartPasteScriptfromClipboard.LinkClicked frmMain.mnuViewSwapDataAndMetadata.Enabled = frmMain.mnuViewSwapDataAndScript.Checked frmMain.mnuViewSwapDataAndScript.Checked = Not frmMain.mnuViewSwapDataAndScript.Checked frmMain.UpdateSwapDataAndScript() @@ -1042,11 +1042,8 @@ Public Class ucrDataView dlgInstallRPackage.ShowDialog() End Sub - Private Sub linkStartPasteData_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) + Private Sub linkStartPasteData_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkStartPasteData.LinkClicked dlgPasteNewColumns.ShowDialog() End Sub - Private Sub linkStartPasteData_LinkClicked_1(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkStartPasteData.LinkClicked - - End Sub End Class \ No newline at end of file From 217374f9f176d5031e7784b262a2f46f80c2006d Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:12:00 +0300 Subject: [PATCH 68/83] calc --- instat/dlgCalculator.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgCalculator.vb b/instat/dlgCalculator.vb index d56f7fac738..52822e1cdf7 100644 --- a/instat/dlgCalculator.vb +++ b/instat/dlgCalculator.vb @@ -262,7 +262,6 @@ Public Class dlgCalculator Private Sub SetHelpOptions() Select Case enumCalculatorMode Case CalculatorMode.Prepare - ucrCalc.ucrInputCalOptions.SetName("Basic") ucrBase.iHelpTopicID = 14 Case CalculatorMode.Structured ucrCalc.ucrInputCalOptions.SetName("Circular") From 36aaba172b0464c0ee3842048739fcdc942bbd54 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:11:19 +0300 Subject: [PATCH 69/83] Design --- instat/dlgOptions.Designer.vb | 473 +++++++++++++++------------------- instat/dlgOptions.vb | 2 +- 2 files changed, 210 insertions(+), 265 deletions(-) diff --git a/instat/dlgOptions.Designer.vb b/instat/dlgOptions.Designer.vb index 41fe03ab1e8..4f66bbbd531 100644 --- a/instat/dlgOptions.Designer.vb +++ b/instat/dlgOptions.Designer.vb @@ -153,10 +153,9 @@ Partial Class dlgOptions ' 'cmdApply ' - Me.cmdApply.Location = New System.Drawing.Point(576, 486) - Me.cmdApply.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdApply.Location = New System.Drawing.Point(384, 324) Me.cmdApply.Name = "cmdApply" - Me.cmdApply.Size = New System.Drawing.Size(112, 34) + Me.cmdApply.Size = New System.Drawing.Size(75, 23) Me.cmdApply.TabIndex = 10 Me.cmdApply.Tag = "Apply" Me.cmdApply.Text = "Apply" @@ -164,10 +163,9 @@ Partial Class dlgOptions ' 'cmdHelp ' - Me.cmdHelp.Location = New System.Drawing.Point(698, 486) - Me.cmdHelp.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdHelp.Location = New System.Drawing.Point(465, 324) Me.cmdHelp.Name = "cmdHelp" - Me.cmdHelp.Size = New System.Drawing.Size(112, 34) + Me.cmdHelp.Size = New System.Drawing.Size(75, 23) Me.cmdHelp.TabIndex = 12 Me.cmdHelp.Tag = "Help" Me.cmdHelp.Text = "Help" @@ -175,10 +173,9 @@ Partial Class dlgOptions ' 'cmdCancel ' - Me.cmdCancel.Location = New System.Drawing.Point(454, 486) - Me.cmdCancel.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdCancel.Location = New System.Drawing.Point(303, 324) Me.cmdCancel.Name = "cmdCancel" - Me.cmdCancel.Size = New System.Drawing.Size(112, 34) + Me.cmdCancel.Size = New System.Drawing.Size(75, 23) Me.cmdCancel.TabIndex = 9 Me.cmdCancel.Tag = "Cancel" Me.cmdCancel.Text = "Cancel" @@ -186,10 +183,9 @@ Partial Class dlgOptions ' 'cmdOk ' - Me.cmdOk.Location = New System.Drawing.Point(333, 486) - Me.cmdOk.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdOk.Location = New System.Drawing.Point(222, 324) Me.cmdOk.Name = "cmdOk" - Me.cmdOk.Size = New System.Drawing.Size(112, 34) + Me.cmdOk.Size = New System.Drawing.Size(75, 23) Me.cmdOk.TabIndex = 11 Me.cmdOk.Tag = "Ok" Me.cmdOk.Text = "Ok" @@ -198,10 +194,9 @@ Partial Class dlgOptions 'cmdLanguage ' Me.cmdLanguage.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdLanguage.Location = New System.Drawing.Point(818, 486) - Me.cmdLanguage.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdLanguage.Location = New System.Drawing.Point(545, 324) Me.cmdLanguage.Name = "cmdLanguage" - Me.cmdLanguage.Size = New System.Drawing.Size(56, 34) + Me.cmdLanguage.Size = New System.Drawing.Size(37, 23) Me.cmdLanguage.TabIndex = 13 Me.cmdLanguage.Tag = "" Me.cmdLanguage.Text = "Lang" @@ -209,8 +204,7 @@ Partial Class dlgOptions ' 'spltControls ' - Me.spltControls.Location = New System.Drawing.Point(8, 2) - Me.spltControls.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.spltControls.Location = New System.Drawing.Point(5, 1) Me.spltControls.Name = "spltControls" ' 'spltControls.Panel1 @@ -221,17 +215,15 @@ Partial Class dlgOptions 'spltControls.Panel2 ' Me.spltControls.Panel2.Controls.Add(Me.tbcOptions) - Me.spltControls.Size = New System.Drawing.Size(1140, 476) - Me.spltControls.SplitterDistance = 276 - Me.spltControls.SplitterWidth = 6 + Me.spltControls.Size = New System.Drawing.Size(760, 317) + Me.spltControls.SplitterDistance = 184 Me.spltControls.TabIndex = 8 ' 'cmdFactoryReset ' - Me.cmdFactoryReset.Location = New System.Drawing.Point(20, 430) - Me.cmdFactoryReset.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdFactoryReset.Location = New System.Drawing.Point(13, 287) Me.cmdFactoryReset.Name = "cmdFactoryReset" - Me.cmdFactoryReset.Size = New System.Drawing.Size(150, 34) + Me.cmdFactoryReset.Size = New System.Drawing.Size(100, 23) Me.cmdFactoryReset.TabIndex = 13 Me.cmdFactoryReset.Tag = "Help" Me.cmdFactoryReset.Text = "Factory Reset" @@ -241,7 +233,6 @@ Partial Class dlgOptions ' Me.trOptions.Dock = System.Windows.Forms.DockStyle.Fill Me.trOptions.Location = New System.Drawing.Point(0, 0) - Me.trOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.trOptions.Name = "trOptions" TreeNode1.Name = "ndLanguages" TreeNode1.Tag = "1" @@ -266,7 +257,7 @@ Partial Class dlgOptions TreeNode6.Name = "ndDataView" TreeNode6.Text = "Data View" Me.trOptions.Nodes.AddRange(New System.Windows.Forms.TreeNode() {TreeNode1, TreeNode2, TreeNode3, TreeNode4, TreeNode5, TreeNode6}) - Me.trOptions.Size = New System.Drawing.Size(276, 476) + Me.trOptions.Size = New System.Drawing.Size(184, 317) Me.trOptions.TabIndex = 0 ' 'tbcOptions @@ -285,10 +276,9 @@ Partial Class dlgOptions Me.tbcOptions.Controls.Add(Me.tbpWebsite) Me.tbcOptions.Dock = System.Windows.Forms.DockStyle.Fill Me.tbcOptions.Location = New System.Drawing.Point(0, 0) - Me.tbcOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.tbcOptions.Name = "tbcOptions" Me.tbcOptions.SelectedIndex = 0 - Me.tbcOptions.Size = New System.Drawing.Size(858, 476) + Me.tbcOptions.Size = New System.Drawing.Size(572, 317) Me.tbcOptions.TabIndex = 0 ' 'tbpLanguages @@ -296,11 +286,10 @@ Partial Class dlgOptions Me.tbpLanguages.Controls.Add(Me.lversion) Me.tbpLanguages.Controls.Add(Me.lblLanguage) Me.tbpLanguages.Controls.Add(Me.ucrInputLanguage) - Me.tbpLanguages.Location = New System.Drawing.Point(4, 29) - Me.tbpLanguages.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpLanguages.Location = New System.Drawing.Point(4, 22) Me.tbpLanguages.Name = "tbpLanguages" - Me.tbpLanguages.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpLanguages.Size = New System.Drawing.Size(850, 443) + Me.tbpLanguages.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpLanguages.Size = New System.Drawing.Size(564, 291) Me.tbpLanguages.TabIndex = 0 Me.tbpLanguages.Tag = "Languages" Me.tbpLanguages.Text = "Languages" @@ -308,9 +297,10 @@ Partial Class dlgOptions ' 'lversion ' - Me.lversion.Location = New System.Drawing.Point(459, 400) + Me.lversion.Location = New System.Drawing.Point(306, 267) + Me.lversion.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lversion.Name = "lversion" - Me.lversion.Size = New System.Drawing.Size(381, 27) + Me.lversion.Size = New System.Drawing.Size(254, 18) Me.lversion.TabIndex = 4 Me.lversion.Text = "v. " Me.lversion.TextAlign = System.Drawing.ContentAlignment.TopRight @@ -318,10 +308,9 @@ Partial Class dlgOptions 'lblLanguage ' Me.lblLanguage.AutoSize = True - Me.lblLanguage.Location = New System.Drawing.Point(14, 27) - Me.lblLanguage.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblLanguage.Location = New System.Drawing.Point(9, 18) Me.lblLanguage.Name = "lblLanguage" - Me.lblLanguage.Size = New System.Drawing.Size(89, 20) + Me.lblLanguage.Size = New System.Drawing.Size(61, 13) Me.lblLanguage.TabIndex = 3 Me.lblLanguage.Text = "Language :" ' @@ -331,20 +320,19 @@ Partial Class dlgOptions Me.ucrInputLanguage.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputLanguage.GetSetSelectedIndex = -1 Me.ucrInputLanguage.IsReadOnly = False - Me.ucrInputLanguage.Location = New System.Drawing.Point(112, 22) - Me.ucrInputLanguage.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputLanguage.Location = New System.Drawing.Point(75, 15) + Me.ucrInputLanguage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrInputLanguage.Name = "ucrInputLanguage" - Me.ucrInputLanguage.Size = New System.Drawing.Size(165, 32) + Me.ucrInputLanguage.Size = New System.Drawing.Size(110, 21) Me.ucrInputLanguage.TabIndex = 2 ' 'tbpComments ' Me.tbpComments.Controls.Add(Me.pnComments) - Me.tbpComments.Location = New System.Drawing.Point(4, 29) - Me.tbpComments.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpComments.Location = New System.Drawing.Point(4, 22) Me.tbpComments.Name = "tbpComments" - Me.tbpComments.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpComments.Size = New System.Drawing.Size(850, 443) + Me.tbpComments.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpComments.Size = New System.Drawing.Size(564, 291) Me.tbpComments.TabIndex = 1 Me.tbpComments.Tag = "Comments" Me.tbpComments.Text = "Comments" @@ -355,10 +343,9 @@ Partial Class dlgOptions Me.pnComments.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.pnComments.Controls.Add(Me.ucrInputComment) Me.pnComments.Controls.Add(Me.lblComment) - Me.pnComments.Location = New System.Drawing.Point(15, 15) - Me.pnComments.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.pnComments.Location = New System.Drawing.Point(10, 10) Me.pnComments.Name = "pnComments" - Me.pnComments.Size = New System.Drawing.Size(586, 44) + Me.pnComments.Size = New System.Drawing.Size(391, 29) Me.pnComments.TabIndex = 2 ' 'ucrInputComment @@ -367,19 +354,18 @@ Partial Class dlgOptions Me.ucrInputComment.AutoSize = True Me.ucrInputComment.IsMultiline = False Me.ucrInputComment.IsReadOnly = False - Me.ucrInputComment.Location = New System.Drawing.Point(144, 8) - Me.ucrInputComment.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputComment.Location = New System.Drawing.Point(96, 5) + Me.ucrInputComment.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrInputComment.Name = "ucrInputComment" - Me.ucrInputComment.Size = New System.Drawing.Size(438, 32) + Me.ucrInputComment.Size = New System.Drawing.Size(292, 21) Me.ucrInputComment.TabIndex = 1 ' 'lblComment ' Me.lblComment.AutoSize = True - Me.lblComment.Location = New System.Drawing.Point(3, 14) - Me.lblComment.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblComment.Location = New System.Drawing.Point(2, 9) Me.lblComment.Name = "lblComment" - Me.lblComment.Size = New System.Drawing.Size(82, 20) + Me.lblComment.Size = New System.Drawing.Size(54, 13) Me.lblComment.TabIndex = 0 Me.lblComment.Tag = "Comment:" Me.lblComment.Text = "Comment:" @@ -389,10 +375,9 @@ Partial Class dlgOptions Me.tbpImport.Controls.Add(Me.lblPreviewRows) Me.tbpImport.Controls.Add(Me.ucrNudPreviewRows) Me.tbpImport.Controls.Add(Me.pnImportData) - Me.tbpImport.Location = New System.Drawing.Point(4, 29) - Me.tbpImport.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpImport.Location = New System.Drawing.Point(4, 22) Me.tbpImport.Name = "tbpImport" - Me.tbpImport.Size = New System.Drawing.Size(850, 443) + Me.tbpImport.Size = New System.Drawing.Size(564, 291) Me.tbpImport.TabIndex = 3 Me.tbpImport.Text = "Import" Me.tbpImport.UseVisualStyleBackColor = True @@ -400,10 +385,9 @@ Partial Class dlgOptions 'lblPreviewRows ' Me.lblPreviewRows.AutoSize = True - Me.lblPreviewRows.Location = New System.Drawing.Point(4, 14) - Me.lblPreviewRows.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblPreviewRows.Location = New System.Drawing.Point(3, 9) Me.lblPreviewRows.Name = "lblPreviewRows" - Me.lblPreviewRows.Size = New System.Drawing.Size(189, 20) + Me.lblPreviewRows.Size = New System.Drawing.Size(130, 13) Me.lblPreviewRows.TabIndex = 0 Me.lblPreviewRows.Text = "Number of Preview Rows:" ' @@ -412,12 +396,12 @@ Partial Class dlgOptions Me.ucrNudPreviewRows.AutoSize = True Me.ucrNudPreviewRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudPreviewRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudPreviewRows.Location = New System.Drawing.Point(405, 8) - Me.ucrNudPreviewRows.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudPreviewRows.Location = New System.Drawing.Point(270, 5) + Me.ucrNudPreviewRows.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudPreviewRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudPreviewRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudPreviewRows.Name = "ucrNudPreviewRows" - Me.ucrNudPreviewRows.Size = New System.Drawing.Size(75, 30) + Me.ucrNudPreviewRows.Size = New System.Drawing.Size(50, 20) Me.ucrNudPreviewRows.TabIndex = 3 Me.ucrNudPreviewRows.Value = New Decimal(New Integer() {10, 0, 0, 0}) ' @@ -425,8 +409,7 @@ Partial Class dlgOptions ' Me.pnImportData.AutoSize = True Me.pnImportData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.pnImportData.Location = New System.Drawing.Point(15, 15) - Me.pnImportData.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.pnImportData.Location = New System.Drawing.Point(10, 10) Me.pnImportData.Name = "pnImportData" Me.pnImportData.Size = New System.Drawing.Size(0, 0) Me.pnImportData.TabIndex = 2 @@ -439,11 +422,10 @@ Partial Class dlgOptions Me.tbpOutputWindow.Controls.Add(Me.ucrChkIncludeCommentsbyDefault) Me.tbpOutputWindow.Controls.Add(Me.grpROptions) Me.tbpOutputWindow.Controls.Add(Me.pnFormatOptions) - Me.tbpOutputWindow.Location = New System.Drawing.Point(4, 29) - Me.tbpOutputWindow.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpOutputWindow.Location = New System.Drawing.Point(4, 22) Me.tbpOutputWindow.Name = "tbpOutputWindow" - Me.tbpOutputWindow.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpOutputWindow.Size = New System.Drawing.Size(850, 443) + Me.tbpOutputWindow.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpOutputWindow.Size = New System.Drawing.Size(564, 291) Me.tbpOutputWindow.TabIndex = 2 Me.tbpOutputWindow.Text = "Output Window" Me.tbpOutputWindow.UseVisualStyleBackColor = True @@ -453,12 +435,12 @@ Partial Class dlgOptions Me.ucrNudMaxOutputsHeight.AutoSize = True Me.ucrNudMaxOutputsHeight.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxOutputsHeight.Location = New System.Drawing.Point(759, 202) - Me.ucrNudMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudMaxOutputsHeight.Location = New System.Drawing.Point(506, 135) + Me.ucrNudMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudMaxOutputsHeight.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Name = "ucrNudMaxOutputsHeight" - Me.ucrNudMaxOutputsHeight.Size = New System.Drawing.Size(75, 30) + Me.ucrNudMaxOutputsHeight.Size = New System.Drawing.Size(50, 20) Me.ucrNudMaxOutputsHeight.TabIndex = 29 Me.ucrNudMaxOutputsHeight.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' @@ -466,30 +448,30 @@ Partial Class dlgOptions ' Me.ucrChkMaxOutputsHeight.AutoSize = True Me.ucrChkMaxOutputsHeight.Checked = False - Me.ucrChkMaxOutputsHeight.Location = New System.Drawing.Point(450, 202) - Me.ucrChkMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkMaxOutputsHeight.Location = New System.Drawing.Point(300, 135) + Me.ucrChkMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkMaxOutputsHeight.Name = "ucrChkMaxOutputsHeight" - Me.ucrChkMaxOutputsHeight.Size = New System.Drawing.Size(294, 51) + Me.ucrChkMaxOutputsHeight.Size = New System.Drawing.Size(196, 34) Me.ucrChkMaxOutputsHeight.TabIndex = 28 ' 'ucrChkShowRCommandsinOutputWindow ' Me.ucrChkShowRCommandsinOutputWindow.AutoSize = True Me.ucrChkShowRCommandsinOutputWindow.Checked = False - Me.ucrChkShowRCommandsinOutputWindow.Location = New System.Drawing.Point(15, 240) - Me.ucrChkShowRCommandsinOutputWindow.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkShowRCommandsinOutputWindow.Location = New System.Drawing.Point(10, 160) + Me.ucrChkShowRCommandsinOutputWindow.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkShowRCommandsinOutputWindow.Name = "ucrChkShowRCommandsinOutputWindow" - Me.ucrChkShowRCommandsinOutputWindow.Size = New System.Drawing.Size(406, 51) + Me.ucrChkShowRCommandsinOutputWindow.Size = New System.Drawing.Size(271, 34) Me.ucrChkShowRCommandsinOutputWindow.TabIndex = 27 ' 'ucrChkIncludeCommentsbyDefault ' Me.ucrChkIncludeCommentsbyDefault.AutoSize = True Me.ucrChkIncludeCommentsbyDefault.Checked = False - Me.ucrChkIncludeCommentsbyDefault.Location = New System.Drawing.Point(15, 202) - Me.ucrChkIncludeCommentsbyDefault.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkIncludeCommentsbyDefault.Location = New System.Drawing.Point(10, 135) + Me.ucrChkIncludeCommentsbyDefault.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkIncludeCommentsbyDefault.Name = "ucrChkIncludeCommentsbyDefault" - Me.ucrChkIncludeCommentsbyDefault.Size = New System.Drawing.Size(406, 51) + Me.ucrChkIncludeCommentsbyDefault.Size = New System.Drawing.Size(271, 34) Me.ucrChkIncludeCommentsbyDefault.TabIndex = 26 ' 'grpROptions @@ -497,11 +479,9 @@ Partial Class dlgOptions Me.grpROptions.Controls.Add(Me.ucrChkShowSignifStars) Me.grpROptions.Controls.Add(Me.ucrNudDigits) Me.grpROptions.Controls.Add(Me.lblNoDigits) - Me.grpROptions.Location = New System.Drawing.Point(15, 288) - Me.grpROptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpROptions.Location = New System.Drawing.Point(10, 192) Me.grpROptions.Name = "grpROptions" - Me.grpROptions.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.grpROptions.Size = New System.Drawing.Size(406, 140) + Me.grpROptions.Size = New System.Drawing.Size(271, 93) Me.grpROptions.TabIndex = 25 Me.grpROptions.TabStop = False Me.grpROptions.Text = "R Options" @@ -510,10 +490,10 @@ Partial Class dlgOptions ' Me.ucrChkShowSignifStars.AutoSize = True Me.ucrChkShowSignifStars.Checked = False - Me.ucrChkShowSignifStars.Location = New System.Drawing.Point(10, 74) - Me.ucrChkShowSignifStars.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkShowSignifStars.Location = New System.Drawing.Point(7, 49) + Me.ucrChkShowSignifStars.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkShowSignifStars.Name = "ucrChkShowSignifStars" - Me.ucrChkShowSignifStars.Size = New System.Drawing.Size(382, 51) + Me.ucrChkShowSignifStars.Size = New System.Drawing.Size(255, 34) Me.ucrChkShowSignifStars.TabIndex = 28 ' 'ucrNudDigits @@ -521,22 +501,21 @@ Partial Class dlgOptions Me.ucrNudDigits.AutoSize = True Me.ucrNudDigits.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDigits.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudDigits.Location = New System.Drawing.Point(266, 34) - Me.ucrNudDigits.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudDigits.Location = New System.Drawing.Point(177, 23) + Me.ucrNudDigits.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudDigits.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudDigits.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDigits.Name = "ucrNudDigits" - Me.ucrNudDigits.Size = New System.Drawing.Size(75, 30) + Me.ucrNudDigits.Size = New System.Drawing.Size(50, 20) Me.ucrNudDigits.TabIndex = 27 Me.ucrNudDigits.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'lblNoDigits ' Me.lblNoDigits.AutoSize = True - Me.lblNoDigits.Location = New System.Drawing.Point(9, 34) - Me.lblNoDigits.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblNoDigits.Location = New System.Drawing.Point(6, 23) Me.lblNoDigits.Name = "lblNoDigits" - Me.lblNoDigits.Size = New System.Drawing.Size(204, 20) + Me.lblNoDigits.Size = New System.Drawing.Size(137, 13) Me.lblNoDigits.TabIndex = 1 Me.lblNoDigits.Text = "Number of Digits to Display:" ' @@ -553,48 +532,43 @@ Partial Class dlgOptions Me.pnFormatOptions.Controls.Add(Me.lblOutputFormat) Me.pnFormatOptions.Controls.Add(Me.cmdCommentFormat) Me.pnFormatOptions.Controls.Add(Me.lblCommandFormat) - Me.pnFormatOptions.Location = New System.Drawing.Point(15, 15) - Me.pnFormatOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.pnFormatOptions.Location = New System.Drawing.Point(10, 10) Me.pnFormatOptions.Name = "pnFormatOptions" - Me.pnFormatOptions.Size = New System.Drawing.Size(586, 175) + Me.pnFormatOptions.Size = New System.Drawing.Size(391, 118) Me.pnFormatOptions.TabIndex = 21 ' 'rtbCommentPreview ' - Me.rtbCommentPreview.Location = New System.Drawing.Point(186, 134) - Me.rtbCommentPreview.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rtbCommentPreview.Location = New System.Drawing.Point(124, 89) Me.rtbCommentPreview.Name = "rtbCommentPreview" Me.rtbCommentPreview.ReadOnly = True - Me.rtbCommentPreview.Size = New System.Drawing.Size(218, 37) + Me.rtbCommentPreview.Size = New System.Drawing.Size(147, 26) Me.rtbCommentPreview.TabIndex = 22 Me.rtbCommentPreview.Text = "" ' 'rtbOutputPreview ' - Me.rtbOutputPreview.Location = New System.Drawing.Point(186, 74) - Me.rtbOutputPreview.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rtbOutputPreview.Location = New System.Drawing.Point(124, 49) Me.rtbOutputPreview.Name = "rtbOutputPreview" Me.rtbOutputPreview.ReadOnly = True - Me.rtbOutputPreview.Size = New System.Drawing.Size(218, 37) + Me.rtbOutputPreview.Size = New System.Drawing.Size(147, 26) Me.rtbOutputPreview.TabIndex = 21 Me.rtbOutputPreview.Text = "" ' 'rtbCommandPreview ' - Me.rtbCommandPreview.Location = New System.Drawing.Point(186, 14) - Me.rtbCommandPreview.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rtbCommandPreview.Location = New System.Drawing.Point(124, 9) Me.rtbCommandPreview.Name = "rtbCommandPreview" Me.rtbCommandPreview.ReadOnly = True - Me.rtbCommandPreview.Size = New System.Drawing.Size(218, 37) + Me.rtbCommandPreview.Size = New System.Drawing.Size(147, 26) Me.rtbCommandPreview.TabIndex = 20 Me.rtbCommandPreview.Text = "" ' 'cmdCommandFormat ' - Me.cmdCommandFormat.Location = New System.Drawing.Point(432, 14) - Me.cmdCommandFormat.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdCommandFormat.Location = New System.Drawing.Point(288, 9) Me.cmdCommandFormat.Name = "cmdCommandFormat" - Me.cmdCommandFormat.Size = New System.Drawing.Size(150, 34) + Me.cmdCommandFormat.Size = New System.Drawing.Size(100, 23) Me.cmdCommandFormat.TabIndex = 10 Me.cmdCommandFormat.Text = "Change..." Me.cmdCommandFormat.UseVisualStyleBackColor = True @@ -602,19 +576,17 @@ Partial Class dlgOptions 'lblCommentFormat ' Me.lblCommentFormat.AutoSize = True - Me.lblCommentFormat.Location = New System.Drawing.Point(6, 141) - Me.lblCommentFormat.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblCommentFormat.Location = New System.Drawing.Point(4, 94) Me.lblCommentFormat.Name = "lblCommentFormat" - Me.lblCommentFormat.Size = New System.Drawing.Size(137, 20) + Me.lblCommentFormat.Size = New System.Drawing.Size(89, 13) Me.lblCommentFormat.TabIndex = 19 Me.lblCommentFormat.Text = "Comment Format:" ' 'cmdOutputFormat ' - Me.cmdOutputFormat.Location = New System.Drawing.Point(432, 74) - Me.cmdOutputFormat.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdOutputFormat.Location = New System.Drawing.Point(288, 49) Me.cmdOutputFormat.Name = "cmdOutputFormat" - Me.cmdOutputFormat.Size = New System.Drawing.Size(150, 34) + Me.cmdOutputFormat.Size = New System.Drawing.Size(100, 23) Me.cmdOutputFormat.TabIndex = 16 Me.cmdOutputFormat.Text = "Change..." Me.cmdOutputFormat.UseVisualStyleBackColor = True @@ -622,19 +594,17 @@ Partial Class dlgOptions 'lblOutputFormat ' Me.lblOutputFormat.AutoSize = True - Me.lblOutputFormat.Location = New System.Drawing.Point(6, 81) - Me.lblOutputFormat.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblOutputFormat.Location = New System.Drawing.Point(4, 54) Me.lblOutputFormat.Name = "lblOutputFormat" - Me.lblOutputFormat.Size = New System.Drawing.Size(117, 20) + Me.lblOutputFormat.Size = New System.Drawing.Size(77, 13) Me.lblOutputFormat.TabIndex = 18 Me.lblOutputFormat.Text = "Output Format:" ' 'cmdCommentFormat ' - Me.cmdCommentFormat.Location = New System.Drawing.Point(432, 134) - Me.cmdCommentFormat.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdCommentFormat.Location = New System.Drawing.Point(288, 89) Me.cmdCommentFormat.Name = "cmdCommentFormat" - Me.cmdCommentFormat.Size = New System.Drawing.Size(150, 34) + Me.cmdCommentFormat.Size = New System.Drawing.Size(100, 23) Me.cmdCommentFormat.TabIndex = 16 Me.cmdCommentFormat.Text = "Change..." Me.cmdCommentFormat.UseVisualStyleBackColor = True @@ -642,21 +612,19 @@ Partial Class dlgOptions 'lblCommandFormat ' Me.lblCommandFormat.AutoSize = True - Me.lblCommandFormat.Location = New System.Drawing.Point(6, 21) - Me.lblCommandFormat.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblCommandFormat.Location = New System.Drawing.Point(4, 14) Me.lblCommandFormat.Name = "lblCommandFormat" - Me.lblCommandFormat.Size = New System.Drawing.Size(141, 20) + Me.lblCommandFormat.Size = New System.Drawing.Size(92, 13) Me.lblCommandFormat.TabIndex = 17 Me.lblCommandFormat.Text = "Command Format:" ' 'tbpEditor ' Me.tbpEditor.Controls.Add(Me.pnFormatEditor) - Me.tbpEditor.Location = New System.Drawing.Point(4, 29) - Me.tbpEditor.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpEditor.Location = New System.Drawing.Point(4, 22) Me.tbpEditor.Name = "tbpEditor" - Me.tbpEditor.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpEditor.Size = New System.Drawing.Size(850, 443) + Me.tbpEditor.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpEditor.Size = New System.Drawing.Size(564, 291) Me.tbpEditor.TabIndex = 10 Me.tbpEditor.Text = "Editor Window" Me.tbpEditor.ToolTipText = "Data View" @@ -668,18 +636,16 @@ Partial Class dlgOptions Me.pnFormatEditor.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.pnFormatEditor.Controls.Add(Me.cmdEditorFont) Me.pnFormatEditor.Controls.Add(Me.lblFont) - Me.pnFormatEditor.Location = New System.Drawing.Point(15, 15) - Me.pnFormatEditor.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.pnFormatEditor.Location = New System.Drawing.Point(10, 10) Me.pnFormatEditor.Name = "pnFormatEditor" - Me.pnFormatEditor.Size = New System.Drawing.Size(318, 41) + Me.pnFormatEditor.Size = New System.Drawing.Size(212, 28) Me.pnFormatEditor.TabIndex = 22 ' 'cmdEditorFont ' - Me.cmdEditorFont.Location = New System.Drawing.Point(164, 3) - Me.cmdEditorFont.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdEditorFont.Location = New System.Drawing.Point(109, 2) Me.cmdEditorFont.Name = "cmdEditorFont" - Me.cmdEditorFont.Size = New System.Drawing.Size(150, 34) + Me.cmdEditorFont.Size = New System.Drawing.Size(100, 23) Me.cmdEditorFont.TabIndex = 10 Me.cmdEditorFont.Text = "Change..." Me.cmdEditorFont.UseVisualStyleBackColor = True @@ -687,10 +653,9 @@ Partial Class dlgOptions 'lblFont ' Me.lblFont.AutoSize = True - Me.lblFont.Location = New System.Drawing.Point(6, 10) - Me.lblFont.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblFont.Location = New System.Drawing.Point(4, 7) Me.lblFont.Name = "lblFont" - Me.lblFont.Size = New System.Drawing.Size(101, 20) + Me.lblFont.Size = New System.Drawing.Size(66, 13) Me.lblFont.TabIndex = 17 Me.lblFont.Text = "Format Font:" ' @@ -700,11 +665,10 @@ Partial Class dlgOptions Me.tbpCommands.Controls.Add(Me.ucrChkShowWaitDialog) Me.tbpCommands.Controls.Add(Me.ucrNudWaitSeconds) Me.tbpCommands.Controls.Add(Me.ucrChkIncludeDefaultParams) - Me.tbpCommands.Location = New System.Drawing.Point(4, 29) - Me.tbpCommands.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpCommands.Location = New System.Drawing.Point(4, 22) Me.tbpCommands.Name = "tbpCommands" - Me.tbpCommands.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpCommands.Size = New System.Drawing.Size(850, 443) + Me.tbpCommands.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpCommands.Size = New System.Drawing.Size(564, 291) Me.tbpCommands.TabIndex = 4 Me.tbpCommands.Tag = "Commands" Me.tbpCommands.Text = "Commands" @@ -713,10 +677,9 @@ Partial Class dlgOptions 'lblWaitSeconds ' Me.lblWaitSeconds.AutoSize = True - Me.lblWaitSeconds.Location = New System.Drawing.Point(604, 69) - Me.lblWaitSeconds.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblWaitSeconds.Location = New System.Drawing.Point(403, 46) Me.lblWaitSeconds.Name = "lblWaitSeconds" - Me.lblWaitSeconds.Size = New System.Drawing.Size(69, 20) + Me.lblWaitSeconds.Size = New System.Drawing.Size(47, 13) Me.lblWaitSeconds.TabIndex = 8 Me.lblWaitSeconds.Text = "seconds" ' @@ -724,10 +687,10 @@ Partial Class dlgOptions ' Me.ucrChkShowWaitDialog.AutoSize = True Me.ucrChkShowWaitDialog.Checked = False - Me.ucrChkShowWaitDialog.Location = New System.Drawing.Point(9, 70) - Me.ucrChkShowWaitDialog.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkShowWaitDialog.Location = New System.Drawing.Point(6, 47) + Me.ucrChkShowWaitDialog.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkShowWaitDialog.Name = "ucrChkShowWaitDialog" - Me.ucrChkShowWaitDialog.Size = New System.Drawing.Size(506, 51) + Me.ucrChkShowWaitDialog.Size = New System.Drawing.Size(337, 34) Me.ucrChkShowWaitDialog.TabIndex = 6 ' 'ucrNudWaitSeconds @@ -735,12 +698,12 @@ Partial Class dlgOptions Me.ucrNudWaitSeconds.AutoSize = True Me.ucrNudWaitSeconds.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudWaitSeconds.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudWaitSeconds.Location = New System.Drawing.Point(524, 68) - Me.ucrNudWaitSeconds.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudWaitSeconds.Location = New System.Drawing.Point(349, 45) + Me.ucrNudWaitSeconds.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudWaitSeconds.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudWaitSeconds.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudWaitSeconds.Name = "ucrNudWaitSeconds" - Me.ucrNudWaitSeconds.Size = New System.Drawing.Size(75, 30) + Me.ucrNudWaitSeconds.Size = New System.Drawing.Size(50, 20) Me.ucrNudWaitSeconds.TabIndex = 5 Me.ucrNudWaitSeconds.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' @@ -748,10 +711,10 @@ Partial Class dlgOptions ' Me.ucrChkIncludeDefaultParams.AutoSize = True Me.ucrChkIncludeDefaultParams.Checked = False - Me.ucrChkIncludeDefaultParams.Location = New System.Drawing.Point(9, 30) - Me.ucrChkIncludeDefaultParams.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkIncludeDefaultParams.Location = New System.Drawing.Point(6, 20) + Me.ucrChkIncludeDefaultParams.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkIncludeDefaultParams.Name = "ucrChkIncludeDefaultParams" - Me.ucrChkIncludeDefaultParams.Size = New System.Drawing.Size(597, 51) + Me.ucrChkIncludeDefaultParams.Size = New System.Drawing.Size(398, 34) Me.ucrChkIncludeDefaultParams.TabIndex = 3 ' 'tbpDataView @@ -765,11 +728,10 @@ Partial Class dlgOptions Me.tbpDataView.Controls.Add(Me.lblMaxCols) Me.tbpDataView.Controls.Add(Me.ucrNudMaxRows) Me.tbpDataView.Controls.Add(Me.lblMaxRows) - Me.tbpDataView.Location = New System.Drawing.Point(4, 29) - Me.tbpDataView.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpDataView.Location = New System.Drawing.Point(4, 22) Me.tbpDataView.Name = "tbpDataView" - Me.tbpDataView.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpDataView.Size = New System.Drawing.Size(850, 443) + Me.tbpDataView.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpDataView.Size = New System.Drawing.Size(564, 291) Me.tbpDataView.TabIndex = 9 Me.tbpDataView.Text = "Data View" Me.tbpDataView.UseVisualStyleBackColor = True @@ -777,20 +739,18 @@ Partial Class dlgOptions 'lblEvery ' Me.lblEvery.AutoSize = True - Me.lblEvery.Location = New System.Drawing.Point(356, 164) - Me.lblEvery.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblEvery.Location = New System.Drawing.Point(237, 115) Me.lblEvery.Name = "lblEvery" - Me.lblEvery.Size = New System.Drawing.Size(46, 20) + Me.lblEvery.Size = New System.Drawing.Size(33, 13) Me.lblEvery.TabIndex = 4 Me.lblEvery.Text = "every" ' 'lblMinutes ' Me.lblMinutes.AutoSize = True - Me.lblMinutes.Location = New System.Drawing.Point(516, 164) - Me.lblMinutes.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblMinutes.Location = New System.Drawing.Point(344, 115) Me.lblMinutes.Name = "lblMinutes" - Me.lblMinutes.Size = New System.Drawing.Size(65, 20) + Me.lblMinutes.Size = New System.Drawing.Size(43, 13) Me.lblMinutes.TabIndex = 4 Me.lblMinutes.Text = "minutes" ' @@ -798,20 +758,20 @@ Partial Class dlgOptions ' Me.ucrChkAutoSave.AutoSize = True Me.ucrChkAutoSave.Checked = False - Me.ucrChkAutoSave.Location = New System.Drawing.Point(20, 162) - Me.ucrChkAutoSave.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkAutoSave.Location = New System.Drawing.Point(13, 114) + Me.ucrChkAutoSave.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkAutoSave.Name = "ucrChkAutoSave" - Me.ucrChkAutoSave.Size = New System.Drawing.Size(326, 51) + Me.ucrChkAutoSave.Size = New System.Drawing.Size(217, 34) Me.ucrChkAutoSave.TabIndex = 3 ' 'ucrChkShowDataonGrid ' Me.ucrChkShowDataonGrid.AutoSize = True Me.ucrChkShowDataonGrid.Checked = False - Me.ucrChkShowDataonGrid.Location = New System.Drawing.Point(20, 117) - Me.ucrChkShowDataonGrid.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkShowDataonGrid.Location = New System.Drawing.Point(13, 78) + Me.ucrChkShowDataonGrid.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkShowDataonGrid.Name = "ucrChkShowDataonGrid" - Me.ucrChkShowDataonGrid.Size = New System.Drawing.Size(590, 51) + Me.ucrChkShowDataonGrid.Size = New System.Drawing.Size(393, 34) Me.ucrChkShowDataonGrid.TabIndex = 3 ' 'ucrNudAutoSaveMinutes @@ -819,12 +779,12 @@ Partial Class dlgOptions Me.ucrNudAutoSaveMinutes.AutoSize = True Me.ucrNudAutoSaveMinutes.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(432, 159) - Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(288, 112) + Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudAutoSaveMinutes.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Name = "ucrNudAutoSaveMinutes" - Me.ucrNudAutoSaveMinutes.Size = New System.Drawing.Size(75, 30) + Me.ucrNudAutoSaveMinutes.Size = New System.Drawing.Size(50, 20) Me.ucrNudAutoSaveMinutes.TabIndex = 2 Me.ucrNudAutoSaveMinutes.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' @@ -833,22 +793,21 @@ Partial Class dlgOptions Me.ucrNudMaxCols.AutoSize = True Me.ucrNudMaxCols.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxCols.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxCols.Location = New System.Drawing.Point(402, 62) - Me.ucrNudMaxCols.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudMaxCols.Location = New System.Drawing.Point(268, 41) + Me.ucrNudMaxCols.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudMaxCols.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxCols.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxCols.Name = "ucrNudMaxCols" - Me.ucrNudMaxCols.Size = New System.Drawing.Size(75, 30) + Me.ucrNudMaxCols.Size = New System.Drawing.Size(50, 20) Me.ucrNudMaxCols.TabIndex = 2 Me.ucrNudMaxCols.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'lblMaxCols ' Me.lblMaxCols.AutoSize = True - Me.lblMaxCols.Location = New System.Drawing.Point(15, 66) - Me.lblMaxCols.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblMaxCols.Location = New System.Drawing.Point(10, 44) Me.lblMaxCols.Name = "lblMaxCols" - Me.lblMaxCols.Size = New System.Drawing.Size(297, 20) + Me.lblMaxCols.Size = New System.Drawing.Size(198, 13) Me.lblMaxCols.TabIndex = 1 Me.lblMaxCols.Text = "Maximum Number of Columns to Display:" ' @@ -857,22 +816,21 @@ Partial Class dlgOptions Me.ucrNudMaxRows.AutoSize = True Me.ucrNudMaxRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxRows.Location = New System.Drawing.Point(402, 22) - Me.ucrNudMaxRows.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrNudMaxRows.Location = New System.Drawing.Point(268, 15) + Me.ucrNudMaxRows.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudMaxRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxRows.Name = "ucrNudMaxRows" - Me.ucrNudMaxRows.Size = New System.Drawing.Size(75, 30) + Me.ucrNudMaxRows.Size = New System.Drawing.Size(50, 20) Me.ucrNudMaxRows.TabIndex = 2 Me.ucrNudMaxRows.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'lblMaxRows ' Me.lblMaxRows.AutoSize = True - Me.lblMaxRows.Location = New System.Drawing.Point(15, 27) - Me.lblMaxRows.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblMaxRows.Location = New System.Drawing.Point(10, 18) Me.lblMaxRows.Name = "lblMaxRows" - Me.lblMaxRows.Size = New System.Drawing.Size(275, 20) + Me.lblMaxRows.Size = New System.Drawing.Size(185, 13) Me.lblMaxRows.TabIndex = 1 Me.lblMaxRows.Text = "Maximum Number of Rows to Display:" ' @@ -881,21 +839,19 @@ Partial Class dlgOptions Me.tbpWorkingDirectory.Controls.Add(Me.cmdWorkingDirectory) Me.tbpWorkingDirectory.Controls.Add(Me.lblWorkingDirectory) Me.tbpWorkingDirectory.Controls.Add(Me.ucrWorkingDirectory) - Me.tbpWorkingDirectory.Location = New System.Drawing.Point(4, 29) - Me.tbpWorkingDirectory.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpWorkingDirectory.Location = New System.Drawing.Point(4, 22) Me.tbpWorkingDirectory.Name = "tbpWorkingDirectory" - Me.tbpWorkingDirectory.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpWorkingDirectory.Size = New System.Drawing.Size(850, 443) + Me.tbpWorkingDirectory.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpWorkingDirectory.Size = New System.Drawing.Size(564, 291) Me.tbpWorkingDirectory.TabIndex = 11 Me.tbpWorkingDirectory.Text = "Working Directory" Me.tbpWorkingDirectory.UseVisualStyleBackColor = True ' 'cmdWorkingDirectory ' - Me.cmdWorkingDirectory.Location = New System.Drawing.Point(598, 24) - Me.cmdWorkingDirectory.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmdWorkingDirectory.Location = New System.Drawing.Point(399, 16) Me.cmdWorkingDirectory.Name = "cmdWorkingDirectory" - Me.cmdWorkingDirectory.Size = New System.Drawing.Size(36, 32) + Me.cmdWorkingDirectory.Size = New System.Drawing.Size(24, 21) Me.cmdWorkingDirectory.TabIndex = 2 Me.cmdWorkingDirectory.Text = "..." Me.cmdWorkingDirectory.UseVisualStyleBackColor = True @@ -903,10 +859,9 @@ Partial Class dlgOptions 'lblWorkingDirectory ' Me.lblWorkingDirectory.AutoSize = True - Me.lblWorkingDirectory.Location = New System.Drawing.Point(20, 30) - Me.lblWorkingDirectory.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblWorkingDirectory.Location = New System.Drawing.Point(13, 20) Me.lblWorkingDirectory.Name = "lblWorkingDirectory" - Me.lblWorkingDirectory.Size = New System.Drawing.Size(138, 20) + Me.lblWorkingDirectory.Size = New System.Drawing.Size(95, 13) Me.lblWorkingDirectory.TabIndex = 0 Me.lblWorkingDirectory.Text = "Working Directory:" ' @@ -916,10 +871,10 @@ Partial Class dlgOptions Me.ucrWorkingDirectory.AutoSize = True Me.ucrWorkingDirectory.IsMultiline = False Me.ucrWorkingDirectory.IsReadOnly = False - Me.ucrWorkingDirectory.Location = New System.Drawing.Point(207, 26) - Me.ucrWorkingDirectory.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrWorkingDirectory.Location = New System.Drawing.Point(138, 17) + Me.ucrWorkingDirectory.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrWorkingDirectory.Name = "ucrWorkingDirectory" - Me.ucrWorkingDirectory.Size = New System.Drawing.Size(382, 32) + Me.ucrWorkingDirectory.Size = New System.Drawing.Size(255, 21) Me.ucrWorkingDirectory.TabIndex = 1 ' 'tbpGraphDisplay @@ -928,11 +883,10 @@ Partial Class dlgOptions Me.tbpGraphDisplay.Controls.Add(Me.rdoDisplayinRViewer) Me.tbpGraphDisplay.Controls.Add(Me.rdoDisplayinOutputWindow) Me.tbpGraphDisplay.Controls.Add(Me.ucrPnlGraphDisplay) - Me.tbpGraphDisplay.Location = New System.Drawing.Point(4, 29) - Me.tbpGraphDisplay.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpGraphDisplay.Location = New System.Drawing.Point(4, 22) Me.tbpGraphDisplay.Name = "tbpGraphDisplay" - Me.tbpGraphDisplay.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpGraphDisplay.Size = New System.Drawing.Size(850, 443) + Me.tbpGraphDisplay.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpGraphDisplay.Size = New System.Drawing.Size(564, 291) Me.tbpGraphDisplay.TabIndex = 12 Me.tbpGraphDisplay.Text = "Graph Display" Me.tbpGraphDisplay.UseVisualStyleBackColor = True @@ -941,10 +895,9 @@ Partial Class dlgOptions ' Me.rdoDisplayinSeparateWindows.AutoSize = True Me.rdoDisplayinSeparateWindows.Checked = True - Me.rdoDisplayinSeparateWindows.Location = New System.Drawing.Point(9, 78) - Me.rdoDisplayinSeparateWindows.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoDisplayinSeparateWindows.Location = New System.Drawing.Point(6, 52) Me.rdoDisplayinSeparateWindows.Name = "rdoDisplayinSeparateWindows" - Me.rdoDisplayinSeparateWindows.Size = New System.Drawing.Size(239, 24) + Me.rdoDisplayinSeparateWindows.Size = New System.Drawing.Size(163, 17) Me.rdoDisplayinSeparateWindows.TabIndex = 1 Me.rdoDisplayinSeparateWindows.TabStop = True Me.rdoDisplayinSeparateWindows.Text = "Display in Separate Windows" @@ -953,10 +906,9 @@ Partial Class dlgOptions 'rdoDisplayinRViewer ' Me.rdoDisplayinRViewer.AutoSize = True - Me.rdoDisplayinRViewer.Location = New System.Drawing.Point(9, 44) - Me.rdoDisplayinRViewer.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoDisplayinRViewer.Location = New System.Drawing.Point(6, 29) Me.rdoDisplayinRViewer.Name = "rdoDisplayinRViewer" - Me.rdoDisplayinRViewer.Size = New System.Drawing.Size(169, 24) + Me.rdoDisplayinRViewer.Size = New System.Drawing.Size(116, 17) Me.rdoDisplayinRViewer.TabIndex = 1 Me.rdoDisplayinRViewer.Text = "Display in R Viewer" Me.rdoDisplayinRViewer.UseVisualStyleBackColor = True @@ -964,10 +916,9 @@ Partial Class dlgOptions 'rdoDisplayinOutputWindow ' Me.rdoDisplayinOutputWindow.AutoSize = True - Me.rdoDisplayinOutputWindow.Location = New System.Drawing.Point(9, 9) - Me.rdoDisplayinOutputWindow.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoDisplayinOutputWindow.Location = New System.Drawing.Point(6, 6) Me.rdoDisplayinOutputWindow.Name = "rdoDisplayinOutputWindow" - Me.rdoDisplayinOutputWindow.Size = New System.Drawing.Size(214, 24) + Me.rdoDisplayinOutputWindow.Size = New System.Drawing.Size(147, 17) Me.rdoDisplayinOutputWindow.TabIndex = 1 Me.rdoDisplayinOutputWindow.Text = "Display in Output Window" Me.rdoDisplayinOutputWindow.UseVisualStyleBackColor = True @@ -975,10 +926,10 @@ Partial Class dlgOptions 'ucrPnlGraphDisplay ' Me.ucrPnlGraphDisplay.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGraphDisplay.Location = New System.Drawing.Point(0, 4) - Me.ucrPnlGraphDisplay.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrPnlGraphDisplay.Location = New System.Drawing.Point(0, 3) + Me.ucrPnlGraphDisplay.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrPnlGraphDisplay.Name = "ucrPnlGraphDisplay" - Me.ucrPnlGraphDisplay.Size = New System.Drawing.Size(548, 99) + Me.ucrPnlGraphDisplay.Size = New System.Drawing.Size(365, 66) Me.ucrPnlGraphDisplay.TabIndex = 3 ' 'tbpTailoredMenus @@ -987,11 +938,10 @@ Partial Class dlgOptions Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewOptionsByContextMenu) Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewProcurementMenu) Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewClimaticMenu) - Me.tbpTailoredMenus.Location = New System.Drawing.Point(4, 29) - Me.tbpTailoredMenus.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpTailoredMenus.Location = New System.Drawing.Point(4, 22) Me.tbpTailoredMenus.Name = "tbpTailoredMenus" - Me.tbpTailoredMenus.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpTailoredMenus.Size = New System.Drawing.Size(850, 443) + Me.tbpTailoredMenus.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpTailoredMenus.Size = New System.Drawing.Size(564, 291) Me.tbpTailoredMenus.TabIndex = 13 Me.tbpTailoredMenus.Text = "Tailored Menus" Me.tbpTailoredMenus.UseVisualStyleBackColor = True @@ -1000,40 +950,40 @@ Partial Class dlgOptions ' Me.ucrChkViewStructuredMenu.AutoSize = True Me.ucrChkViewStructuredMenu.Checked = False - Me.ucrChkViewStructuredMenu.Location = New System.Drawing.Point(10, 18) - Me.ucrChkViewStructuredMenu.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkViewStructuredMenu.Location = New System.Drawing.Point(7, 12) + Me.ucrChkViewStructuredMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkViewStructuredMenu.Name = "ucrChkViewStructuredMenu" - Me.ucrChkViewStructuredMenu.Size = New System.Drawing.Size(567, 51) + Me.ucrChkViewStructuredMenu.Size = New System.Drawing.Size(378, 34) Me.ucrChkViewStructuredMenu.TabIndex = 2 ' 'ucrChkViewOptionsByContextMenu ' Me.ucrChkViewOptionsByContextMenu.AutoSize = True Me.ucrChkViewOptionsByContextMenu.Checked = False - Me.ucrChkViewOptionsByContextMenu.Location = New System.Drawing.Point(10, 135) - Me.ucrChkViewOptionsByContextMenu.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkViewOptionsByContextMenu.Location = New System.Drawing.Point(7, 90) + Me.ucrChkViewOptionsByContextMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkViewOptionsByContextMenu.Name = "ucrChkViewOptionsByContextMenu" - Me.ucrChkViewOptionsByContextMenu.Size = New System.Drawing.Size(620, 51) + Me.ucrChkViewOptionsByContextMenu.Size = New System.Drawing.Size(413, 34) Me.ucrChkViewOptionsByContextMenu.TabIndex = 1 ' 'ucrChkViewProcurementMenu ' Me.ucrChkViewProcurementMenu.AutoSize = True Me.ucrChkViewProcurementMenu.Checked = False - Me.ucrChkViewProcurementMenu.Location = New System.Drawing.Point(10, 96) - Me.ucrChkViewProcurementMenu.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkViewProcurementMenu.Location = New System.Drawing.Point(7, 64) + Me.ucrChkViewProcurementMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkViewProcurementMenu.Name = "ucrChkViewProcurementMenu" - Me.ucrChkViewProcurementMenu.Size = New System.Drawing.Size(620, 51) + Me.ucrChkViewProcurementMenu.Size = New System.Drawing.Size(413, 34) Me.ucrChkViewProcurementMenu.TabIndex = 0 ' 'ucrChkViewClimaticMenu ' Me.ucrChkViewClimaticMenu.AutoSize = True Me.ucrChkViewClimaticMenu.Checked = False - Me.ucrChkViewClimaticMenu.Location = New System.Drawing.Point(10, 57) - Me.ucrChkViewClimaticMenu.Margin = New System.Windows.Forms.Padding(8, 8, 8, 8) + Me.ucrChkViewClimaticMenu.Location = New System.Drawing.Point(7, 38) + Me.ucrChkViewClimaticMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkViewClimaticMenu.Name = "ucrChkViewClimaticMenu" - Me.ucrChkViewClimaticMenu.Size = New System.Drawing.Size(610, 51) + Me.ucrChkViewClimaticMenu.Size = New System.Drawing.Size(407, 34) Me.ucrChkViewClimaticMenu.TabIndex = 0 ' 'tbpClimsoft @@ -1046,11 +996,10 @@ Partial Class dlgOptions Me.tbpClimsoft.Controls.Add(Me.ucrInputPort) Me.tbpClimsoft.Controls.Add(Me.ucrInputHost) Me.tbpClimsoft.Controls.Add(Me.ucrInputDatabaseName) - Me.tbpClimsoft.Location = New System.Drawing.Point(4, 29) - Me.tbpClimsoft.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.tbpClimsoft.Location = New System.Drawing.Point(4, 22) Me.tbpClimsoft.Name = "tbpClimsoft" - Me.tbpClimsoft.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.tbpClimsoft.Size = New System.Drawing.Size(850, 443) + Me.tbpClimsoft.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpClimsoft.Size = New System.Drawing.Size(564, 291) Me.tbpClimsoft.TabIndex = 14 Me.tbpClimsoft.Text = "Climsoft" Me.tbpClimsoft.UseVisualStyleBackColor = True @@ -1059,10 +1008,9 @@ Partial Class dlgOptions ' Me.lblUserName.AutoSize = True Me.lblUserName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblUserName.Location = New System.Drawing.Point(9, 154) - Me.lblUserName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblUserName.Location = New System.Drawing.Point(6, 103) Me.lblUserName.Name = "lblUserName" - Me.lblUserName.Size = New System.Drawing.Size(87, 20) + Me.lblUserName.Size = New System.Drawing.Size(58, 13) Me.lblUserName.TabIndex = 19 Me.lblUserName.Text = "Username:" ' @@ -1070,10 +1018,9 @@ Partial Class dlgOptions ' Me.lblPort.AutoSize = True Me.lblPort.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblPort.Location = New System.Drawing.Point(9, 114) - Me.lblPort.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblPort.Location = New System.Drawing.Point(6, 76) Me.lblPort.Name = "lblPort" - Me.lblPort.Size = New System.Drawing.Size(42, 20) + Me.lblPort.Size = New System.Drawing.Size(29, 13) Me.lblPort.TabIndex = 18 Me.lblPort.Text = "Port:" ' @@ -1081,10 +1028,9 @@ Partial Class dlgOptions ' Me.lblHost.AutoSize = True Me.lblHost.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHost.Location = New System.Drawing.Point(9, 74) - Me.lblHost.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblHost.Location = New System.Drawing.Point(6, 49) Me.lblHost.Name = "lblHost" - Me.lblHost.Size = New System.Drawing.Size(47, 20) + Me.lblHost.Size = New System.Drawing.Size(32, 13) Me.lblHost.TabIndex = 17 Me.lblHost.Text = "Host:" ' @@ -1092,10 +1038,9 @@ Partial Class dlgOptions ' Me.lblDatabaseName.AutoSize = True Me.lblDatabaseName.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblDatabaseName.Location = New System.Drawing.Point(9, 32) - Me.lblDatabaseName.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblDatabaseName.Location = New System.Drawing.Point(6, 21) Me.lblDatabaseName.Name = "lblDatabaseName" - Me.lblDatabaseName.Size = New System.Drawing.Size(129, 20) + Me.lblDatabaseName.Size = New System.Drawing.Size(87, 13) Me.lblDatabaseName.TabIndex = 16 Me.lblDatabaseName.Text = "Database Name:" ' @@ -1105,10 +1050,10 @@ Partial Class dlgOptions Me.ucrInputUserName.AutoSize = True Me.ucrInputUserName.IsMultiline = False Me.ucrInputUserName.IsReadOnly = False - Me.ucrInputUserName.Location = New System.Drawing.Point(252, 144) - Me.ucrInputUserName.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputUserName.Location = New System.Drawing.Point(168, 96) + Me.ucrInputUserName.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrInputUserName.Name = "ucrInputUserName" - Me.ucrInputUserName.Size = New System.Drawing.Size(206, 32) + Me.ucrInputUserName.Size = New System.Drawing.Size(137, 21) Me.ucrInputUserName.TabIndex = 15 ' 'ucrInputPort @@ -1117,10 +1062,10 @@ Partial Class dlgOptions Me.ucrInputPort.AutoSize = True Me.ucrInputPort.IsMultiline = False Me.ucrInputPort.IsReadOnly = False - Me.ucrInputPort.Location = New System.Drawing.Point(252, 104) - Me.ucrInputPort.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputPort.Location = New System.Drawing.Point(168, 69) + Me.ucrInputPort.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrInputPort.Name = "ucrInputPort" - Me.ucrInputPort.Size = New System.Drawing.Size(206, 32) + Me.ucrInputPort.Size = New System.Drawing.Size(137, 21) Me.ucrInputPort.TabIndex = 14 ' 'ucrInputHost @@ -1129,10 +1074,10 @@ Partial Class dlgOptions Me.ucrInputHost.AutoSize = True Me.ucrInputHost.IsMultiline = False Me.ucrInputHost.IsReadOnly = False - Me.ucrInputHost.Location = New System.Drawing.Point(252, 64) - Me.ucrInputHost.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputHost.Location = New System.Drawing.Point(168, 43) + Me.ucrInputHost.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrInputHost.Name = "ucrInputHost" - Me.ucrInputHost.Size = New System.Drawing.Size(206, 32) + Me.ucrInputHost.Size = New System.Drawing.Size(137, 21) Me.ucrInputHost.TabIndex = 13 ' 'ucrInputDatabaseName @@ -1141,19 +1086,20 @@ Partial Class dlgOptions Me.ucrInputDatabaseName.AutoSize = True Me.ucrInputDatabaseName.IsMultiline = False Me.ucrInputDatabaseName.IsReadOnly = False - Me.ucrInputDatabaseName.Location = New System.Drawing.Point(252, 26) - Me.ucrInputDatabaseName.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrInputDatabaseName.Location = New System.Drawing.Point(168, 17) + Me.ucrInputDatabaseName.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrInputDatabaseName.Name = "ucrInputDatabaseName" - Me.ucrInputDatabaseName.Size = New System.Drawing.Size(206, 32) + Me.ucrInputDatabaseName.Size = New System.Drawing.Size(137, 21) Me.ucrInputDatabaseName.TabIndex = 12 ' 'tbpWebsite ' Me.tbpWebsite.Controls.Add(Me.ucrChkReminder) - Me.tbpWebsite.Location = New System.Drawing.Point(4, 29) + Me.tbpWebsite.Location = New System.Drawing.Point(4, 22) + Me.tbpWebsite.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) Me.tbpWebsite.Name = "tbpWebsite" - Me.tbpWebsite.Padding = New System.Windows.Forms.Padding(3) - Me.tbpWebsite.Size = New System.Drawing.Size(850, 443) + Me.tbpWebsite.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.tbpWebsite.Size = New System.Drawing.Size(564, 291) Me.tbpWebsite.TabIndex = 15 Me.tbpWebsite.Text = "Website" Me.tbpWebsite.UseVisualStyleBackColor = True @@ -1162,18 +1108,18 @@ Partial Class dlgOptions ' Me.ucrChkReminder.AutoSize = True Me.ucrChkReminder.Checked = False - Me.ucrChkReminder.Location = New System.Drawing.Point(11, 33) - Me.ucrChkReminder.Margin = New System.Windows.Forms.Padding(8) + Me.ucrChkReminder.Location = New System.Drawing.Point(7, 22) + Me.ucrChkReminder.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrChkReminder.Name = "ucrChkReminder" - Me.ucrChkReminder.Size = New System.Drawing.Size(620, 51) + Me.ucrChkReminder.Size = New System.Drawing.Size(413, 34) Me.ucrChkReminder.TabIndex = 2 ' 'dlgOptions ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(1155, 530) + Me.ClientSize = New System.Drawing.Size(770, 353) Me.Controls.Add(Me.cmdLanguage) Me.Controls.Add(Me.cmdApply) Me.Controls.Add(Me.cmdHelp) @@ -1181,7 +1127,6 @@ Partial Class dlgOptions Me.Controls.Add(Me.cmdOk) Me.Controls.Add(Me.spltControls) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgOptions" diff --git a/instat/dlgOptions.vb b/instat/dlgOptions.vb index ed9b34f1cd0..35cf301c8b7 100644 --- a/instat/dlgOptions.vb +++ b/instat/dlgOptions.vb @@ -428,7 +428,7 @@ Public Class dlgOptions ApplyEnabled(True) End Sub - Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged + Private Sub AllControls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudWaitSeconds.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrNudMaxCols.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged End Sub From eea44b6a6d62b468863e4de0cd8c50075c6b36c3 Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:23:03 +0300 Subject: [PATCH 70/83] small design change --- instat/dlgOptions.Designer.vb | 64 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/instat/dlgOptions.Designer.vb b/instat/dlgOptions.Designer.vb index 4f66bbbd531..7047873dc50 100644 --- a/instat/dlgOptions.Designer.vb +++ b/instat/dlgOptions.Designer.vb @@ -38,12 +38,12 @@ Partial Class dlgOptions 'Do not modify it using the code editor. Private Sub InitializeComponent() - Dim TreeNode1 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Languages") - Dim TreeNode2 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Comments") - Dim TreeNode3 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Import") - Dim TreeNode4 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Output Window") - Dim TreeNode5 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Commands") - Dim TreeNode6 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Data View") + Dim TreeNode7 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Languages") + Dim TreeNode8 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Comments") + Dim TreeNode9 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Import") + Dim TreeNode10 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Output Window") + Dim TreeNode11 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Commands") + Dim TreeNode12 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Data View") Me.cmdApply = New System.Windows.Forms.Button() Me.cmdHelp = New System.Windows.Forms.Button() Me.cmdCancel = New System.Windows.Forms.Button() @@ -234,29 +234,29 @@ Partial Class dlgOptions Me.trOptions.Dock = System.Windows.Forms.DockStyle.Fill Me.trOptions.Location = New System.Drawing.Point(0, 0) Me.trOptions.Name = "trOptions" - TreeNode1.Name = "ndLanguages" - TreeNode1.Tag = "1" - TreeNode1.Text = "Languages" - TreeNode1.ToolTipText = "Choose different languages" - TreeNode2.Name = "ndComments" - TreeNode2.Tag = "2" - TreeNode2.Text = "Comments" - TreeNode2.ToolTipText = "Comments for the dialogs" - TreeNode3.Name = "ndImport" - TreeNode3.Tag = "3" - TreeNode3.Text = "Import" - TreeNode3.ToolTipText = "Import Data Settings" - TreeNode4.Name = "ndOutputWindow" - TreeNode4.Tag = "4" - TreeNode4.Text = "Output Window" - TreeNode4.ToolTipText = "Output Window Formatting Options" - TreeNode5.Name = "ndCommands" - TreeNode5.Tag = "8" - TreeNode5.Text = "Commands" - TreeNode5.ToolTipText = "Commands Options" - TreeNode6.Name = "ndDataView" - TreeNode6.Text = "Data View" - Me.trOptions.Nodes.AddRange(New System.Windows.Forms.TreeNode() {TreeNode1, TreeNode2, TreeNode3, TreeNode4, TreeNode5, TreeNode6}) + TreeNode7.Name = "ndLanguages" + TreeNode7.Tag = "1" + TreeNode7.Text = "Languages" + TreeNode7.ToolTipText = "Choose different languages" + TreeNode8.Name = "ndComments" + TreeNode8.Tag = "2" + TreeNode8.Text = "Comments" + TreeNode8.ToolTipText = "Comments for the dialogs" + TreeNode9.Name = "ndImport" + TreeNode9.Tag = "3" + TreeNode9.Text = "Import" + TreeNode9.ToolTipText = "Import Data Settings" + TreeNode10.Name = "ndOutputWindow" + TreeNode10.Tag = "4" + TreeNode10.Text = "Output Window" + TreeNode10.ToolTipText = "Output Window Formatting Options" + TreeNode11.Name = "ndCommands" + TreeNode11.Tag = "8" + TreeNode11.Text = "Commands" + TreeNode11.ToolTipText = "Commands Options" + TreeNode12.Name = "ndDataView" + TreeNode12.Text = "Data View" + Me.trOptions.Nodes.AddRange(New System.Windows.Forms.TreeNode() {TreeNode7, TreeNode8, TreeNode9, TreeNode10, TreeNode11, TreeNode12}) Me.trOptions.Size = New System.Drawing.Size(184, 317) Me.trOptions.TabIndex = 0 ' @@ -739,7 +739,7 @@ Partial Class dlgOptions 'lblEvery ' Me.lblEvery.AutoSize = True - Me.lblEvery.Location = New System.Drawing.Point(237, 115) + Me.lblEvery.Location = New System.Drawing.Point(220, 115) Me.lblEvery.Name = "lblEvery" Me.lblEvery.Size = New System.Drawing.Size(33, 13) Me.lblEvery.TabIndex = 4 @@ -748,7 +748,7 @@ Partial Class dlgOptions 'lblMinutes ' Me.lblMinutes.AutoSize = True - Me.lblMinutes.Location = New System.Drawing.Point(344, 115) + Me.lblMinutes.Location = New System.Drawing.Point(340, 115) Me.lblMinutes.Name = "lblMinutes" Me.lblMinutes.Size = New System.Drawing.Size(43, 13) Me.lblMinutes.TabIndex = 4 @@ -779,7 +779,7 @@ Partial Class dlgOptions Me.ucrNudAutoSaveMinutes.AutoSize = True Me.ucrNudAutoSaveMinutes.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(288, 112) + Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(268, 112) Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) Me.ucrNudAutoSaveMinutes.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) From e612a32dd50c399b47113c6f30b83241f99cdd4e Mon Sep 17 00:00:00 2001 From: Fidel365 <107605960+Fidel365@users.noreply.github.com> Date: Tue, 2 Jul 2024 08:51:05 +0300 Subject: [PATCH 71/83] tailored menus --- instat/dlgOptions.Designer.vb | 86 +++++++++++++++++------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/instat/dlgOptions.Designer.vb b/instat/dlgOptions.Designer.vb index 7047873dc50..ed5bd9584f7 100644 --- a/instat/dlgOptions.Designer.vb +++ b/instat/dlgOptions.Designer.vb @@ -288,7 +288,7 @@ Partial Class dlgOptions Me.tbpLanguages.Controls.Add(Me.ucrInputLanguage) Me.tbpLanguages.Location = New System.Drawing.Point(4, 22) Me.tbpLanguages.Name = "tbpLanguages" - Me.tbpLanguages.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpLanguages.Padding = New System.Windows.Forms.Padding(3) Me.tbpLanguages.Size = New System.Drawing.Size(564, 291) Me.tbpLanguages.TabIndex = 0 Me.tbpLanguages.Tag = "Languages" @@ -321,7 +321,7 @@ Partial Class dlgOptions Me.ucrInputLanguage.GetSetSelectedIndex = -1 Me.ucrInputLanguage.IsReadOnly = False Me.ucrInputLanguage.Location = New System.Drawing.Point(75, 15) - Me.ucrInputLanguage.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrInputLanguage.Margin = New System.Windows.Forms.Padding(6) Me.ucrInputLanguage.Name = "ucrInputLanguage" Me.ucrInputLanguage.Size = New System.Drawing.Size(110, 21) Me.ucrInputLanguage.TabIndex = 2 @@ -331,7 +331,7 @@ Partial Class dlgOptions Me.tbpComments.Controls.Add(Me.pnComments) Me.tbpComments.Location = New System.Drawing.Point(4, 22) Me.tbpComments.Name = "tbpComments" - Me.tbpComments.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpComments.Padding = New System.Windows.Forms.Padding(3) Me.tbpComments.Size = New System.Drawing.Size(564, 291) Me.tbpComments.TabIndex = 1 Me.tbpComments.Tag = "Comments" @@ -355,7 +355,7 @@ Partial Class dlgOptions Me.ucrInputComment.IsMultiline = False Me.ucrInputComment.IsReadOnly = False Me.ucrInputComment.Location = New System.Drawing.Point(96, 5) - Me.ucrInputComment.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrInputComment.Margin = New System.Windows.Forms.Padding(6) Me.ucrInputComment.Name = "ucrInputComment" Me.ucrInputComment.Size = New System.Drawing.Size(292, 21) Me.ucrInputComment.TabIndex = 1 @@ -397,7 +397,7 @@ Partial Class dlgOptions Me.ucrNudPreviewRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudPreviewRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudPreviewRows.Location = New System.Drawing.Point(270, 5) - Me.ucrNudPreviewRows.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudPreviewRows.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudPreviewRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudPreviewRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudPreviewRows.Name = "ucrNudPreviewRows" @@ -424,7 +424,7 @@ Partial Class dlgOptions Me.tbpOutputWindow.Controls.Add(Me.pnFormatOptions) Me.tbpOutputWindow.Location = New System.Drawing.Point(4, 22) Me.tbpOutputWindow.Name = "tbpOutputWindow" - Me.tbpOutputWindow.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpOutputWindow.Padding = New System.Windows.Forms.Padding(3) Me.tbpOutputWindow.Size = New System.Drawing.Size(564, 291) Me.tbpOutputWindow.TabIndex = 2 Me.tbpOutputWindow.Text = "Output Window" @@ -436,7 +436,7 @@ Partial Class dlgOptions Me.ucrNudMaxOutputsHeight.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Location = New System.Drawing.Point(506, 135) - Me.ucrNudMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudMaxOutputsHeight.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxOutputsHeight.Name = "ucrNudMaxOutputsHeight" @@ -449,7 +449,7 @@ Partial Class dlgOptions Me.ucrChkMaxOutputsHeight.AutoSize = True Me.ucrChkMaxOutputsHeight.Checked = False Me.ucrChkMaxOutputsHeight.Location = New System.Drawing.Point(300, 135) - Me.ucrChkMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkMaxOutputsHeight.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkMaxOutputsHeight.Name = "ucrChkMaxOutputsHeight" Me.ucrChkMaxOutputsHeight.Size = New System.Drawing.Size(196, 34) Me.ucrChkMaxOutputsHeight.TabIndex = 28 @@ -459,7 +459,7 @@ Partial Class dlgOptions Me.ucrChkShowRCommandsinOutputWindow.AutoSize = True Me.ucrChkShowRCommandsinOutputWindow.Checked = False Me.ucrChkShowRCommandsinOutputWindow.Location = New System.Drawing.Point(10, 160) - Me.ucrChkShowRCommandsinOutputWindow.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkShowRCommandsinOutputWindow.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkShowRCommandsinOutputWindow.Name = "ucrChkShowRCommandsinOutputWindow" Me.ucrChkShowRCommandsinOutputWindow.Size = New System.Drawing.Size(271, 34) Me.ucrChkShowRCommandsinOutputWindow.TabIndex = 27 @@ -469,7 +469,7 @@ Partial Class dlgOptions Me.ucrChkIncludeCommentsbyDefault.AutoSize = True Me.ucrChkIncludeCommentsbyDefault.Checked = False Me.ucrChkIncludeCommentsbyDefault.Location = New System.Drawing.Point(10, 135) - Me.ucrChkIncludeCommentsbyDefault.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkIncludeCommentsbyDefault.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkIncludeCommentsbyDefault.Name = "ucrChkIncludeCommentsbyDefault" Me.ucrChkIncludeCommentsbyDefault.Size = New System.Drawing.Size(271, 34) Me.ucrChkIncludeCommentsbyDefault.TabIndex = 26 @@ -491,7 +491,7 @@ Partial Class dlgOptions Me.ucrChkShowSignifStars.AutoSize = True Me.ucrChkShowSignifStars.Checked = False Me.ucrChkShowSignifStars.Location = New System.Drawing.Point(7, 49) - Me.ucrChkShowSignifStars.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkShowSignifStars.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkShowSignifStars.Name = "ucrChkShowSignifStars" Me.ucrChkShowSignifStars.Size = New System.Drawing.Size(255, 34) Me.ucrChkShowSignifStars.TabIndex = 28 @@ -502,7 +502,7 @@ Partial Class dlgOptions Me.ucrNudDigits.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDigits.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudDigits.Location = New System.Drawing.Point(177, 23) - Me.ucrNudDigits.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudDigits.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudDigits.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudDigits.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudDigits.Name = "ucrNudDigits" @@ -623,7 +623,7 @@ Partial Class dlgOptions Me.tbpEditor.Controls.Add(Me.pnFormatEditor) Me.tbpEditor.Location = New System.Drawing.Point(4, 22) Me.tbpEditor.Name = "tbpEditor" - Me.tbpEditor.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpEditor.Padding = New System.Windows.Forms.Padding(3) Me.tbpEditor.Size = New System.Drawing.Size(564, 291) Me.tbpEditor.TabIndex = 10 Me.tbpEditor.Text = "Editor Window" @@ -667,7 +667,7 @@ Partial Class dlgOptions Me.tbpCommands.Controls.Add(Me.ucrChkIncludeDefaultParams) Me.tbpCommands.Location = New System.Drawing.Point(4, 22) Me.tbpCommands.Name = "tbpCommands" - Me.tbpCommands.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpCommands.Padding = New System.Windows.Forms.Padding(3) Me.tbpCommands.Size = New System.Drawing.Size(564, 291) Me.tbpCommands.TabIndex = 4 Me.tbpCommands.Tag = "Commands" @@ -688,7 +688,7 @@ Partial Class dlgOptions Me.ucrChkShowWaitDialog.AutoSize = True Me.ucrChkShowWaitDialog.Checked = False Me.ucrChkShowWaitDialog.Location = New System.Drawing.Point(6, 47) - Me.ucrChkShowWaitDialog.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkShowWaitDialog.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkShowWaitDialog.Name = "ucrChkShowWaitDialog" Me.ucrChkShowWaitDialog.Size = New System.Drawing.Size(337, 34) Me.ucrChkShowWaitDialog.TabIndex = 6 @@ -699,7 +699,7 @@ Partial Class dlgOptions Me.ucrNudWaitSeconds.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudWaitSeconds.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudWaitSeconds.Location = New System.Drawing.Point(349, 45) - Me.ucrNudWaitSeconds.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudWaitSeconds.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudWaitSeconds.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudWaitSeconds.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudWaitSeconds.Name = "ucrNudWaitSeconds" @@ -712,7 +712,7 @@ Partial Class dlgOptions Me.ucrChkIncludeDefaultParams.AutoSize = True Me.ucrChkIncludeDefaultParams.Checked = False Me.ucrChkIncludeDefaultParams.Location = New System.Drawing.Point(6, 20) - Me.ucrChkIncludeDefaultParams.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkIncludeDefaultParams.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkIncludeDefaultParams.Name = "ucrChkIncludeDefaultParams" Me.ucrChkIncludeDefaultParams.Size = New System.Drawing.Size(398, 34) Me.ucrChkIncludeDefaultParams.TabIndex = 3 @@ -730,7 +730,7 @@ Partial Class dlgOptions Me.tbpDataView.Controls.Add(Me.lblMaxRows) Me.tbpDataView.Location = New System.Drawing.Point(4, 22) Me.tbpDataView.Name = "tbpDataView" - Me.tbpDataView.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpDataView.Padding = New System.Windows.Forms.Padding(3) Me.tbpDataView.Size = New System.Drawing.Size(564, 291) Me.tbpDataView.TabIndex = 9 Me.tbpDataView.Text = "Data View" @@ -759,7 +759,7 @@ Partial Class dlgOptions Me.ucrChkAutoSave.AutoSize = True Me.ucrChkAutoSave.Checked = False Me.ucrChkAutoSave.Location = New System.Drawing.Point(13, 114) - Me.ucrChkAutoSave.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkAutoSave.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkAutoSave.Name = "ucrChkAutoSave" Me.ucrChkAutoSave.Size = New System.Drawing.Size(217, 34) Me.ucrChkAutoSave.TabIndex = 3 @@ -769,7 +769,7 @@ Partial Class dlgOptions Me.ucrChkShowDataonGrid.AutoSize = True Me.ucrChkShowDataonGrid.Checked = False Me.ucrChkShowDataonGrid.Location = New System.Drawing.Point(13, 78) - Me.ucrChkShowDataonGrid.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkShowDataonGrid.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkShowDataonGrid.Name = "ucrChkShowDataonGrid" Me.ucrChkShowDataonGrid.Size = New System.Drawing.Size(393, 34) Me.ucrChkShowDataonGrid.TabIndex = 3 @@ -780,7 +780,7 @@ Partial Class dlgOptions Me.ucrNudAutoSaveMinutes.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Location = New System.Drawing.Point(268, 112) - Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudAutoSaveMinutes.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudAutoSaveMinutes.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudAutoSaveMinutes.Name = "ucrNudAutoSaveMinutes" @@ -794,7 +794,7 @@ Partial Class dlgOptions Me.ucrNudMaxCols.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxCols.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudMaxCols.Location = New System.Drawing.Point(268, 41) - Me.ucrNudMaxCols.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudMaxCols.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudMaxCols.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxCols.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxCols.Name = "ucrNudMaxCols" @@ -817,7 +817,7 @@ Partial Class dlgOptions Me.ucrNudMaxRows.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxRows.Increment = New Decimal(New Integer() {1, 0, 0, 0}) Me.ucrNudMaxRows.Location = New System.Drawing.Point(268, 15) - Me.ucrNudMaxRows.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrNudMaxRows.Margin = New System.Windows.Forms.Padding(5) Me.ucrNudMaxRows.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxRows.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxRows.Name = "ucrNudMaxRows" @@ -841,7 +841,7 @@ Partial Class dlgOptions Me.tbpWorkingDirectory.Controls.Add(Me.ucrWorkingDirectory) Me.tbpWorkingDirectory.Location = New System.Drawing.Point(4, 22) Me.tbpWorkingDirectory.Name = "tbpWorkingDirectory" - Me.tbpWorkingDirectory.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpWorkingDirectory.Padding = New System.Windows.Forms.Padding(3) Me.tbpWorkingDirectory.Size = New System.Drawing.Size(564, 291) Me.tbpWorkingDirectory.TabIndex = 11 Me.tbpWorkingDirectory.Text = "Working Directory" @@ -872,7 +872,7 @@ Partial Class dlgOptions Me.ucrWorkingDirectory.IsMultiline = False Me.ucrWorkingDirectory.IsReadOnly = False Me.ucrWorkingDirectory.Location = New System.Drawing.Point(138, 17) - Me.ucrWorkingDirectory.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrWorkingDirectory.Margin = New System.Windows.Forms.Padding(6) Me.ucrWorkingDirectory.Name = "ucrWorkingDirectory" Me.ucrWorkingDirectory.Size = New System.Drawing.Size(255, 21) Me.ucrWorkingDirectory.TabIndex = 1 @@ -885,7 +885,7 @@ Partial Class dlgOptions Me.tbpGraphDisplay.Controls.Add(Me.ucrPnlGraphDisplay) Me.tbpGraphDisplay.Location = New System.Drawing.Point(4, 22) Me.tbpGraphDisplay.Name = "tbpGraphDisplay" - Me.tbpGraphDisplay.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpGraphDisplay.Padding = New System.Windows.Forms.Padding(3) Me.tbpGraphDisplay.Size = New System.Drawing.Size(564, 291) Me.tbpGraphDisplay.TabIndex = 12 Me.tbpGraphDisplay.Text = "Graph Display" @@ -927,7 +927,7 @@ Partial Class dlgOptions ' Me.ucrPnlGraphDisplay.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrPnlGraphDisplay.Location = New System.Drawing.Point(0, 3) - Me.ucrPnlGraphDisplay.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrPnlGraphDisplay.Margin = New System.Windows.Forms.Padding(5) Me.ucrPnlGraphDisplay.Name = "ucrPnlGraphDisplay" Me.ucrPnlGraphDisplay.Size = New System.Drawing.Size(365, 66) Me.ucrPnlGraphDisplay.TabIndex = 3 @@ -940,7 +940,7 @@ Partial Class dlgOptions Me.tbpTailoredMenus.Controls.Add(Me.ucrChkViewClimaticMenu) Me.tbpTailoredMenus.Location = New System.Drawing.Point(4, 22) Me.tbpTailoredMenus.Name = "tbpTailoredMenus" - Me.tbpTailoredMenus.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpTailoredMenus.Padding = New System.Windows.Forms.Padding(3) Me.tbpTailoredMenus.Size = New System.Drawing.Size(564, 291) Me.tbpTailoredMenus.TabIndex = 13 Me.tbpTailoredMenus.Text = "Tailored Menus" @@ -951,7 +951,7 @@ Partial Class dlgOptions Me.ucrChkViewStructuredMenu.AutoSize = True Me.ucrChkViewStructuredMenu.Checked = False Me.ucrChkViewStructuredMenu.Location = New System.Drawing.Point(7, 12) - Me.ucrChkViewStructuredMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkViewStructuredMenu.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkViewStructuredMenu.Name = "ucrChkViewStructuredMenu" Me.ucrChkViewStructuredMenu.Size = New System.Drawing.Size(378, 34) Me.ucrChkViewStructuredMenu.TabIndex = 2 @@ -960,8 +960,8 @@ Partial Class dlgOptions ' Me.ucrChkViewOptionsByContextMenu.AutoSize = True Me.ucrChkViewOptionsByContextMenu.Checked = False - Me.ucrChkViewOptionsByContextMenu.Location = New System.Drawing.Point(7, 90) - Me.ucrChkViewOptionsByContextMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkViewOptionsByContextMenu.Location = New System.Drawing.Point(7, 137) + Me.ucrChkViewOptionsByContextMenu.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkViewOptionsByContextMenu.Name = "ucrChkViewOptionsByContextMenu" Me.ucrChkViewOptionsByContextMenu.Size = New System.Drawing.Size(413, 34) Me.ucrChkViewOptionsByContextMenu.TabIndex = 1 @@ -970,8 +970,8 @@ Partial Class dlgOptions ' Me.ucrChkViewProcurementMenu.AutoSize = True Me.ucrChkViewProcurementMenu.Checked = False - Me.ucrChkViewProcurementMenu.Location = New System.Drawing.Point(7, 64) - Me.ucrChkViewProcurementMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkViewProcurementMenu.Location = New System.Drawing.Point(7, 95) + Me.ucrChkViewProcurementMenu.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkViewProcurementMenu.Name = "ucrChkViewProcurementMenu" Me.ucrChkViewProcurementMenu.Size = New System.Drawing.Size(413, 34) Me.ucrChkViewProcurementMenu.TabIndex = 0 @@ -980,8 +980,8 @@ Partial Class dlgOptions ' Me.ucrChkViewClimaticMenu.AutoSize = True Me.ucrChkViewClimaticMenu.Checked = False - Me.ucrChkViewClimaticMenu.Location = New System.Drawing.Point(7, 38) - Me.ucrChkViewClimaticMenu.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkViewClimaticMenu.Location = New System.Drawing.Point(7, 53) + Me.ucrChkViewClimaticMenu.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkViewClimaticMenu.Name = "ucrChkViewClimaticMenu" Me.ucrChkViewClimaticMenu.Size = New System.Drawing.Size(407, 34) Me.ucrChkViewClimaticMenu.TabIndex = 0 @@ -998,7 +998,7 @@ Partial Class dlgOptions Me.tbpClimsoft.Controls.Add(Me.ucrInputDatabaseName) Me.tbpClimsoft.Location = New System.Drawing.Point(4, 22) Me.tbpClimsoft.Name = "tbpClimsoft" - Me.tbpClimsoft.Padding = New System.Windows.Forms.Padding(3, 3, 3, 3) + Me.tbpClimsoft.Padding = New System.Windows.Forms.Padding(3) Me.tbpClimsoft.Size = New System.Drawing.Size(564, 291) Me.tbpClimsoft.TabIndex = 14 Me.tbpClimsoft.Text = "Climsoft" @@ -1051,7 +1051,7 @@ Partial Class dlgOptions Me.ucrInputUserName.IsMultiline = False Me.ucrInputUserName.IsReadOnly = False Me.ucrInputUserName.Location = New System.Drawing.Point(168, 96) - Me.ucrInputUserName.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrInputUserName.Margin = New System.Windows.Forms.Padding(6) Me.ucrInputUserName.Name = "ucrInputUserName" Me.ucrInputUserName.Size = New System.Drawing.Size(137, 21) Me.ucrInputUserName.TabIndex = 15 @@ -1063,7 +1063,7 @@ Partial Class dlgOptions Me.ucrInputPort.IsMultiline = False Me.ucrInputPort.IsReadOnly = False Me.ucrInputPort.Location = New System.Drawing.Point(168, 69) - Me.ucrInputPort.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrInputPort.Margin = New System.Windows.Forms.Padding(6) Me.ucrInputPort.Name = "ucrInputPort" Me.ucrInputPort.Size = New System.Drawing.Size(137, 21) Me.ucrInputPort.TabIndex = 14 @@ -1075,7 +1075,7 @@ Partial Class dlgOptions Me.ucrInputHost.IsMultiline = False Me.ucrInputHost.IsReadOnly = False Me.ucrInputHost.Location = New System.Drawing.Point(168, 43) - Me.ucrInputHost.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrInputHost.Margin = New System.Windows.Forms.Padding(6) Me.ucrInputHost.Name = "ucrInputHost" Me.ucrInputHost.Size = New System.Drawing.Size(137, 21) Me.ucrInputHost.TabIndex = 13 @@ -1087,7 +1087,7 @@ Partial Class dlgOptions Me.ucrInputDatabaseName.IsMultiline = False Me.ucrInputDatabaseName.IsReadOnly = False Me.ucrInputDatabaseName.Location = New System.Drawing.Point(168, 17) - Me.ucrInputDatabaseName.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrInputDatabaseName.Margin = New System.Windows.Forms.Padding(6) Me.ucrInputDatabaseName.Name = "ucrInputDatabaseName" Me.ucrInputDatabaseName.Size = New System.Drawing.Size(137, 21) Me.ucrInputDatabaseName.TabIndex = 12 @@ -1096,9 +1096,9 @@ Partial Class dlgOptions ' Me.tbpWebsite.Controls.Add(Me.ucrChkReminder) Me.tbpWebsite.Location = New System.Drawing.Point(4, 22) - Me.tbpWebsite.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.tbpWebsite.Margin = New System.Windows.Forms.Padding(2) Me.tbpWebsite.Name = "tbpWebsite" - Me.tbpWebsite.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.tbpWebsite.Padding = New System.Windows.Forms.Padding(2) Me.tbpWebsite.Size = New System.Drawing.Size(564, 291) Me.tbpWebsite.TabIndex = 15 Me.tbpWebsite.Text = "Website" @@ -1109,7 +1109,7 @@ Partial Class dlgOptions Me.ucrChkReminder.AutoSize = True Me.ucrChkReminder.Checked = False Me.ucrChkReminder.Location = New System.Drawing.Point(7, 22) - Me.ucrChkReminder.Margin = New System.Windows.Forms.Padding(5, 5, 5, 5) + Me.ucrChkReminder.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkReminder.Name = "ucrChkReminder" Me.ucrChkReminder.Size = New System.Drawing.Size(413, 34) Me.ucrChkReminder.TabIndex = 2 From ca313aa1c6a22525316923c052cef69719e3d3b4 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 2 Jul 2024 14:33:16 +0100 Subject: [PATCH 72/83] Change made --- instat/dlgClimaticBoxPlot.vb | 2 +- instat/dlgClimaticStationMaps.vb | 2 +- instat/dlgClimdexIndices.vb | 2 +- instat/dlgCompareTreatmentLines.vb | 2 +- instat/dlgConditionalQuantilePlot.vb | 2 +- instat/dlgCountryColouredMap.vb | 2 +- instat/dlgDisplayDailyData.vb | 2 +- instat/dlgDisplayTopN.vb | 2 +- instat/dlgEvapotranspiration.vb | 2 +- instat/dlgExtremes.vb | 2 +- instat/dlgExtremesClimatic.vb | 6 +++--- instat/dlgFitCorruptionModel.vb | 2 +- instat/dlgHomogenization.vb | 2 +- instat/dlgIDFCurves.vb | 2 +- instat/dlgInfillMissingValues.vb | 2 +- instat/dlgInventoryPlot.vb | 4 ++-- instat/dlgNewMarkovChains.Designer.vb | 4 ++-- instat/dlgOptionsByContextBoxplot.vb | 2 +- instat/dlgOptionsByContextFItModel.vb | 2 +- instat/dlgPICSARainfall.vb | 2 +- instat/dlgSPI.vb | 6 +++--- instat/dlgSeasonalPlot.vb | 2 +- instat/dlgTaylorDiagram.vb | 2 +- instat/dlgTimeSeriesPlot.vb | 2 +- instat/dlgTreemap.vb | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) diff --git a/instat/dlgClimaticBoxPlot.vb b/instat/dlgClimaticBoxPlot.vb index c8874b72be6..b4ab4385bf2 100644 --- a/instat/dlgClimaticBoxPlot.vb +++ b/instat/dlgClimaticBoxPlot.vb @@ -200,7 +200,7 @@ Public Class dlgClimaticBoxPlot ucrSavePlot.SetPrefix("box_plot") ucrSavePlot.SetIsComboBox() - ucrSavePlot.SetCheckBoxText("Save Graph") + ucrSavePlot.SetCheckBoxText("Store Graph") ucrSavePlot.SetSaveTypeAsGraph() ucrSavePlot.SetDataFrameSelector(ucrSelectorClimaticBoxPlot.ucrAvailableDataFrames) ucrSavePlot.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgClimaticStationMaps.vb b/instat/dlgClimaticStationMaps.vb index 7d27f489804..d1be62a0b98 100644 --- a/instat/dlgClimaticStationMaps.vb +++ b/instat/dlgClimaticStationMaps.vb @@ -120,7 +120,7 @@ Public Class dlgClimaticStationMaps ucrSaveMap.SetPrefix("map") ucrSaveMap.SetSaveTypeAsGraph() ucrSaveMap.SetIsComboBox() - ucrSaveMap.SetCheckBoxText("Save Map") + ucrSaveMap.SetCheckBoxText("Store Map") ucrSaveMap.SetAssignToIfUncheckedValue("last_map") ucrSaveMap.SetDataFrameSelector(ucrSelectorOutline.ucrAvailableDataFrames) diff --git a/instat/dlgClimdexIndices.vb b/instat/dlgClimdexIndices.vb index 991cc3ee222..613ef424cc8 100644 --- a/instat/dlgClimdexIndices.vb +++ b/instat/dlgClimdexIndices.vb @@ -101,7 +101,7 @@ Public Class dlgClimdexIndices ucrPnlAnnualMonthly.SetRDefault(Chr(34) & "annual" & Chr(34)) ucrPnlAnnualMonthly.AddToLinkedControls({ucrReceiverMonth}, {rdoMonthly}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkSave.SetText("Save Indices") + ucrChkSave.SetText("Store Indices") ucrChkSave.bChangeParameterValue = False End Sub diff --git a/instat/dlgCompareTreatmentLines.vb b/instat/dlgCompareTreatmentLines.vb index 4f464a8dd99..d73b112418a 100644 --- a/instat/dlgCompareTreatmentLines.vb +++ b/instat/dlgCompareTreatmentLines.vb @@ -156,7 +156,7 @@ Public Class dlgCompareTreatmentLines ucrSavePlot.SetPrefix("two_options") ucrSavePlot.SetIsComboBox() - ucrSavePlot.SetCheckBoxText("Save Graph") + ucrSavePlot.SetCheckBoxText("Store Graph") ucrSavePlot.SetSaveTypeAsGraph() ucrSavePlot.SetDataFrameSelector(ucrSelectorPlot.ucrAvailableDataFrames) ucrSavePlot.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgConditionalQuantilePlot.vb b/instat/dlgConditionalQuantilePlot.vb index e3ceb9deef0..5a22b4e399d 100644 --- a/instat/dlgConditionalQuantilePlot.vb +++ b/instat/dlgConditionalQuantilePlot.vb @@ -131,7 +131,7 @@ Public Class dlgConditionalQuantilePlot ucrReceiverType.SetLinkedDisplayControl(lblType) ucrSavePlot.SetPrefix("cond_quantile_plot") - ucrSavePlot.SetCheckBoxText("Save Graph") + ucrSavePlot.SetCheckBoxText("Store Graph") ucrSavePlot.SetIsComboBox() ucrSavePlot.SetSaveTypeAsGraph() ucrSavePlot.SetDataFrameSelector(ucrConditionalQuantilePlotSelector.ucrAvailableDataFrames) diff --git a/instat/dlgCountryColouredMap.vb b/instat/dlgCountryColouredMap.vb index 10e97e2f2e0..ccea8029c23 100644 --- a/instat/dlgCountryColouredMap.vb +++ b/instat/dlgCountryColouredMap.vb @@ -92,7 +92,7 @@ Public Class dlgCountryColouredMap ucrSaveMap.SetPrefix("Map") ucrSaveMap.SetSaveTypeAsGraph() ucrSaveMap.SetIsComboBox() - ucrSaveMap.SetCheckBoxText("Save Graph") + ucrSaveMap.SetCheckBoxText("Store Graph") ucrSaveMap.SetAssignToIfUncheckedValue("last_graph") ucrSaveMap.SetDataFrameSelector(ucrSelectorCountryColouredMap.ucrAvailableDataFrames) End Sub diff --git a/instat/dlgDisplayDailyData.vb b/instat/dlgDisplayDailyData.vb index 59a7178f476..c4cb6d97038 100644 --- a/instat/dlgDisplayDailyData.vb +++ b/instat/dlgDisplayDailyData.vb @@ -214,7 +214,7 @@ Public Class dlgDisplayDailyData ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorDisplayDailyClimaticData.ucrAvailableDataFrames) ucrSaveGraph.SetIsComboBox() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") ucrPnlFrequencyDisplay.AddRadioButton(rdoTable) diff --git a/instat/dlgDisplayTopN.vb b/instat/dlgDisplayTopN.vb index e4c3a89fd93..59f93c6e4b1 100644 --- a/instat/dlgDisplayTopN.vb +++ b/instat/dlgDisplayTopN.vb @@ -161,7 +161,7 @@ Public Class dlgDisplayTopN ucrInputDisplay.SetDropDownStyleAsNonEditable() ucrSaveDisplay.SetIsComboBox() - ucrSaveDisplay.SetCheckBoxText("Save Graph") + ucrSaveDisplay.SetCheckBoxText("Store Graph") ucrSaveDisplay.SetDataFrameSelector(ucrSelectorDisplayTopN.ucrAvailableDataFrames) ucrSaveDisplay.SetSaveTypeAsGraph() ucrSaveDisplay.SetPrefix("lollipop") diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index b78cee3e008..0df48c08b71 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -153,7 +153,7 @@ Public Class dlgEvapotranspiration ucrPnlMethod.AddToLinkedControls(ucrReceiverExtraRadiation, {rdoHargreavesSamani}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethod.AddToLinkedControls(ucrNudAlpha, {rdoPriestleyTaylor}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="0.23") - ucrReceiverExtraRadiation.SetLinkedDisplayControl(lblRa) + ucrReceiverExtraRadiation.SetLinkedDisplayControl(lblRA) ucrReceiverRadiation.SetLinkedDisplayControl(lblRadiation) ucrReceiverHumidityMax.SetLinkedDisplayControl(lblHumidityMax) ucrReceiverHumidityMin.SetLinkedDisplayControl(lblHumidityMin) diff --git a/instat/dlgExtremes.vb b/instat/dlgExtremes.vb index 122ebf33a53..46840734212 100644 --- a/instat/dlgExtremes.vb +++ b/instat/dlgExtremes.vb @@ -86,7 +86,7 @@ clsInitialListFunction, clsOmitMissingFunction As New RFunction ucrSaveExtremes.SetPrefix("extreme") ucrSaveExtremes.SetIsComboBox() - ucrSaveExtremes.SetCheckBoxText("Save Model:") + ucrSaveExtremes.SetCheckBoxText("Store Model:") ucrSaveExtremes.SetSaveTypeAsModel() ucrSaveExtremes.SetDataFrameSelector(ucrSelectorExtremes.ucrAvailableDataFrames) ucrSaveExtremes.SetAssignToIfUncheckedValue("last_model") diff --git a/instat/dlgExtremesClimatic.vb b/instat/dlgExtremesClimatic.vb index da47e4c0784..6c6052c193c 100644 --- a/instat/dlgExtremesClimatic.vb +++ b/instat/dlgExtremesClimatic.vb @@ -257,14 +257,14 @@ Public Class dlgExtremesClimatic ucrSaveMrlPlot.SetPrefix("mrl_plot") ucrSaveMrlPlot.SetSaveTypeAsGraph() ucrSaveMrlPlot.SetIsComboBox() - ucrSaveMrlPlot.SetCheckBoxText("Save Graph") + ucrSaveMrlPlot.SetCheckBoxText("Store Graph") ucrSaveMrlPlot.SetAssignToIfUncheckedValue("last_graph") ucrSaveThresholdPlot.SetDataFrameSelector(ucrSelectorClimaticExtremes.ucrAvailableDataFrames) ucrSaveThresholdPlot.SetPrefix("threshold_plot") ucrSaveThresholdPlot.SetSaveTypeAsGraph() ucrSaveThresholdPlot.SetIsComboBox() - ucrSaveThresholdPlot.SetCheckBoxText("Save Graph") + ucrSaveThresholdPlot.SetCheckBoxText("Store Graph") ucrSaveThresholdPlot.SetAssignToIfUncheckedValue("last_graph") ucrNudDeclusterColumns.SetParameter(New RParameter("ncol", 7)) @@ -275,7 +275,7 @@ Public Class dlgExtremesClimatic ucrSaveDeclusteredPlot.SetPrefix("declustered_plot") ucrSaveDeclusteredPlot.SetSaveTypeAsGraph() ucrSaveDeclusteredPlot.SetIsComboBox() - ucrSaveDeclusteredPlot.SetCheckBoxText("Save Graph") + ucrSaveDeclusteredPlot.SetCheckBoxText("Store Graph") ucrSaveDeclusteredPlot.SetAssignToIfUncheckedValue("last_graph") ucrInputDistribution.SetParameter(New RParameter("type", 4)) diff --git a/instat/dlgFitCorruptionModel.vb b/instat/dlgFitCorruptionModel.vb index b17694a8fe5..bb4eb2ad90f 100644 --- a/instat/dlgFitCorruptionModel.vb +++ b/instat/dlgFitCorruptionModel.vb @@ -78,7 +78,7 @@ Public Class dlgCorruptionFitModel ucrSaveCorruptionModel.SetPrefix("Corruption_Model") ucrSaveCorruptionModel.SetSaveTypeAsModel() ucrSaveCorruptionModel.SetDataFrameSelector(ucrSelectorFitModel.ucrAvailableDataFrames) - ucrSaveCorruptionModel.SetCheckBoxText("Save Model") + ucrSaveCorruptionModel.SetCheckBoxText("Store Model") ucrSaveCorruptionModel.SetIsComboBox() ucrSaveCorruptionModel.SetAssignToIfUncheckedValue("last_model") End Sub diff --git a/instat/dlgHomogenization.vb b/instat/dlgHomogenization.vb index c376b0bdb9f..bcf7cd18f0d 100644 --- a/instat/dlgHomogenization.vb +++ b/instat/dlgHomogenization.vb @@ -206,7 +206,7 @@ Public Class dlgHomogenization ucrInputPenValue.SetValidationTypeAsNumeric() ttOptions.SetToolTip(ucrInputPenValue.txtInput, "The theoretical type I error e.g.0.05 when using the Asymptotic penalty. A vector of length 2 (min,max) if using the CROPS penalty") - ucrSaveResult.SetCheckBoxText("Save Test Object:") + ucrSaveResult.SetCheckBoxText("Store Test Object:") ucrPnlOptions.AddToLinkedControls({ucrSelectorHomogenization, ucrSaveResult, ucrReceiverNeighbour, ucrReceiverStation, ucrReceiverElement}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrInputClimateVariables}, {rdoPrepare, rdoQualityControl, rdoHomogenization, rdoMonthlyTotals}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) diff --git a/instat/dlgIDFCurves.vb b/instat/dlgIDFCurves.vb index 215c4e7b639..5370ce37a79 100644 --- a/instat/dlgIDFCurves.vb +++ b/instat/dlgIDFCurves.vb @@ -59,7 +59,7 @@ Public Class dlgIDFCurves ucrSave.SetPrefix("Prec_accum") ucrSave.SetIsComboBox() - ucrSave.SetCheckBoxText("Save DataFrame") + ucrSave.SetCheckBoxText("Store DataFrame") ucrSave.SetSaveTypeAsDataFrame() ucrSave.SetDataFrameSelector(ucrIDFCurvesSelector.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_accum") diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 1a90511ddec..92c2342f252 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -285,7 +285,7 @@ Public Class dlgInfillMissingValues ucrSaveGraph.SetPrefix("missing_plot") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgInventoryPlot.vb b/instat/dlgInventoryPlot.vb index ca4fe3055d8..a750178ff13 100644 --- a/instat/dlgInventoryPlot.vb +++ b/instat/dlgInventoryPlot.vb @@ -106,7 +106,7 @@ Public Class dlgInventoryPlot ucrChkDay.SetRDefault("FALSE") ucrSaveDetails.SetPrefix("details") - ucrSaveDetails.SetCheckBoxText("Save Details") + ucrSaveDetails.SetCheckBoxText("Store Details") ucrSaveDetails.SetSaveTypeAsDataFrame() ucrSaveDetails.SetDataFrameSelector(ucrInventoryPlotSelector.ucrAvailableDataFrames) ucrSaveDetails.SetIsComboBox() @@ -160,7 +160,7 @@ Public Class dlgInventoryPlot ucrSaveGraph.SetPrefix("inventory") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrInventoryPlotSelector.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgNewMarkovChains.Designer.vb b/instat/dlgNewMarkovChains.Designer.vb index 6a367c32415..30e8be4f219 100644 --- a/instat/dlgNewMarkovChains.Designer.vb +++ b/instat/dlgNewMarkovChains.Designer.vb @@ -85,7 +85,7 @@ Partial Class dlgNewMarkovChains Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrBase.Location = New System.Drawing.Point(12, 437) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 0 ' 'ucrSelectorMarkovChains @@ -389,7 +389,7 @@ Partial Class dlgNewMarkovChains Me.chkSaveModel.Name = "chkSaveModel" Me.chkSaveModel.Size = New System.Drawing.Size(83, 17) Me.chkSaveModel.TabIndex = 20 - Me.chkSaveModel.Text = "Save Model" + Me.chkSaveModel.Text = "Store Model" Me.chkSaveModel.UseVisualStyleBackColor = True ' 'chkGraph diff --git a/instat/dlgOptionsByContextBoxplot.vb b/instat/dlgOptionsByContextBoxplot.vb index 11b160cbab7..d13b34fa9fb 100644 --- a/instat/dlgOptionsByContextBoxplot.vb +++ b/instat/dlgOptionsByContextBoxplot.vb @@ -190,7 +190,7 @@ Public Class dlgOptionsByContextBoxplot ucrSavePlot.SetPrefix("boxplot") ucrSavePlot.SetIsComboBox() - ucrSavePlot.SetCheckBoxText("Save Graph") + ucrSavePlot.SetCheckBoxText("Store Graph") ucrSavePlot.SetSaveTypeAsGraph() ucrSavePlot.SetDataFrameSelector(ucrSelectorPlot.ucrAvailableDataFrames) ucrSavePlot.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgOptionsByContextFItModel.vb b/instat/dlgOptionsByContextFItModel.vb index 774413160bc..fea1db22d81 100644 --- a/instat/dlgOptionsByContextFItModel.vb +++ b/instat/dlgOptionsByContextFItModel.vb @@ -130,7 +130,7 @@ Public Class dlgOptionsByContextFitModel ucrSaveModel.SetPrefix("reg") ucrSaveModel.SetDataFrameSelector(ucrSelectorFitModel.ucrAvailableDataFrames) ucrSaveModel.SetSaveTypeAsModel() - ucrSaveModel.SetCheckBoxText("Save Model") + ucrSaveModel.SetCheckBoxText("Store Model") ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") diff --git a/instat/dlgPICSARainfall.vb b/instat/dlgPICSARainfall.vb index f424bb2b746..9094cf90890 100644 --- a/instat/dlgPICSARainfall.vb +++ b/instat/dlgPICSARainfall.vb @@ -202,7 +202,7 @@ Public Class dlgPICSARainfall ucrSave.SetPrefix("picsa_rainfall_graph") ucrSave.SetIsComboBox() ucrSave.SetSaveTypeAsGraph() - ucrSave.SetCheckBoxText("Save Graph") + ucrSave.SetCheckBoxText("Store Graph") ucrSave.SetDataFrameSelector(ucrSelectorPICSARainfall.ucrAvailableDataFrames) ucrSave.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgSPI.vb b/instat/dlgSPI.vb index 206ad8431aa..2ab81117dfc 100644 --- a/instat/dlgSPI.vb +++ b/instat/dlgSPI.vb @@ -114,20 +114,20 @@ Public Class dlgSPI ucrSaveIndex.SetSaveTypeAsColumn() ucrSaveIndex.SetDataFrameSelector(ucrSelectorVariable.ucrAvailableDataFrames) - ucrSaveIndex.SetLabelText("Save Index into:") + ucrSaveIndex.SetLabelText("Store Index into:") ucrSaveIndex.SetIsTextBox() ucrSaveIndex.SetPrefix("spi") ucrSaveModel.SetSaveTypeAsModel() ucrSaveModel.SetDataFrameSelector(ucrSelectorVariable.ucrAvailableDataFrames) - ucrSaveModel.SetCheckBoxText("Save Model") + ucrSaveModel.SetCheckBoxText("Store Model") ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") ucrSaveGraph.SetPrefix("SPI_plot") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorVariable.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgSeasonalPlot.vb b/instat/dlgSeasonalPlot.vb index 2df8b779213..fa976b592a8 100644 --- a/instat/dlgSeasonalPlot.vb +++ b/instat/dlgSeasonalPlot.vb @@ -183,7 +183,7 @@ Public Class dlgSeasonalPlot ucrSaveGraph.SetPrefix("seasonality_plot") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetSaveTypeAsGraph() - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetDataFrameSelector(ucrSelectorSeasonalityComparisons.ucrAvailableDataFrames) ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgTaylorDiagram.vb b/instat/dlgTaylorDiagram.vb index 5de43bf7299..72e41922759 100644 --- a/instat/dlgTaylorDiagram.vb +++ b/instat/dlgTaylorDiagram.vb @@ -71,7 +71,7 @@ Public Class dlgTaylorDiagram ucrChkNormalise.SetRDefault("FALSE") ucrSavePlot.SetPrefix("taylor_diagram_plot") - ucrSavePlot.SetCheckBoxText("Save Graph") + ucrSavePlot.SetCheckBoxText("Store Graph") ucrSavePlot.SetIsComboBox() ucrSavePlot.SetSaveTypeAsGraph() ucrSavePlot.SetDataFrameSelector(ucrSelectorTaylorDiagram.ucrAvailableDataFrames) diff --git a/instat/dlgTimeSeriesPlot.vb b/instat/dlgTimeSeriesPlot.vb index 0ee96af11e3..aa55864e5f6 100644 --- a/instat/dlgTimeSeriesPlot.vb +++ b/instat/dlgTimeSeriesPlot.vb @@ -258,7 +258,7 @@ Public Class dlgTimeSeriesPlot ucrSavePlot.SetPrefix("line") ucrSavePlot.SetIsComboBox() - ucrSavePlot.SetCheckBoxText("Save Graph") + ucrSavePlot.SetCheckBoxText("Store Graph") ucrSavePlot.SetSaveTypeAsGraph() ucrSavePlot.SetDataFrameSelector(ucrSelectorTimeSeriesPlots.ucrAvailableDataFrames) ucrSavePlot.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgTreemap.vb b/instat/dlgTreemap.vb index c0b6a25b996..ef94b10e7b2 100644 --- a/instat/dlgTreemap.vb +++ b/instat/dlgTreemap.vb @@ -137,7 +137,7 @@ Public Class dlgTreemap ucrColourText.SetColours() ucrSaveTreemap.SetIsComboBox() - ucrSaveTreemap.SetCheckBoxText("Save Treemap") + ucrSaveTreemap.SetCheckBoxText("Store Treemap") ucrSaveTreemap.SetDataFrameSelector(ucrSelectorTreemap.ucrAvailableDataFrames) ucrSaveTreemap.SetSaveTypeAsGraph() ucrSaveTreemap.SetPrefix("tree_map") From 852f80a4bf2b1488ef6997cd5f2c275a3c5f44fc Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 2 Jul 2024 14:40:31 +0100 Subject: [PATCH 73/83] minor change --- instat/dlgClusterAnalysis.vb | 2 +- instat/dlgDotPlot.vb | 2 +- instat/dlgScript.vb | 2 +- instat/dlgSummaryBarOrPieChart.vb | 2 +- instat/sdgCorrPlot.vb | 2 +- instat/sdgOneVarFitModDisplay.vb | 4 ++-- instat/sdgPrincipalComponentAnalysis.vb | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/instat/dlgClusterAnalysis.vb b/instat/dlgClusterAnalysis.vb index 328bd682f89..67ee63a0125 100644 --- a/instat/dlgClusterAnalysis.vb +++ b/instat/dlgClusterAnalysis.vb @@ -119,7 +119,7 @@ Public Class dlgClusterAnalysis ucrSaveGraph.SetPrefix("Cluster_plot") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorClusterData.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/dlgDotPlot.vb b/instat/dlgDotPlot.vb index fa66d7cb1b8..6d1823458db 100644 --- a/instat/dlgDotPlot.vb +++ b/instat/dlgDotPlot.vb @@ -111,7 +111,7 @@ Public Class dlgDotPlot ucrSaveDotPlot.SetPrefix("dot_plot") ucrSaveDotPlot.SetSaveTypeAsGraph() ucrSaveDotPlot.SetIsComboBox() - ucrSaveDotPlot.SetCheckBoxText("Save Graph") + ucrSaveDotPlot.SetCheckBoxText("Store Graph") ucrSaveDotPlot.SetDataFrameSelector(ucrDotPlotSelector.ucrAvailableDataFrames) ucrSaveDotPlot.SetAssignToIfUncheckedValue("last_graph") End Sub diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index f16bb22c428..7ca7d373b6e 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -72,7 +72,7 @@ Public Class dlgScript ucrCboSaveOutputObjectFormat.SetLinkedDisplayControl(lblSaveObjectFormat) ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = 0 - ucrSaveObject.SetLabelText("Save Graph") + ucrSaveObject.SetLabelText("Store Graph") ucrSaveObject.SetIsComboBox() ucrSaveObject.SetDataFrameSelector(ucrDataFrameSaveOutputSelect) diff --git a/instat/dlgSummaryBarOrPieChart.vb b/instat/dlgSummaryBarOrPieChart.vb index 63224a72d51..88ecfdc2b52 100644 --- a/instat/dlgSummaryBarOrPieChart.vb +++ b/instat/dlgSummaryBarOrPieChart.vb @@ -100,7 +100,7 @@ Public Class dlgSummaryBarOrPieChart ucrReceiverSecondFactor.SetParameterIsString() ucrSaveSummaryBar.SetIsComboBox() - ucrSaveSummaryBar.SetCheckBoxText("Save Graph") + ucrSaveSummaryBar.SetCheckBoxText("Store Graph") ucrSaveSummaryBar.SetDataFrameSelector(ucrSummaryBarSelector.ucrAvailableDataFrames) ucrSaveSummaryBar.SetSaveTypeAsGraph() ucrSaveSummaryBar.SetPrefix("bar") diff --git a/instat/sdgCorrPlot.vb b/instat/sdgCorrPlot.vb index 1faf8f6ff24..c3007a715b4 100644 --- a/instat/sdgCorrPlot.vb +++ b/instat/sdgCorrPlot.vb @@ -62,7 +62,7 @@ Public Class sdgCorrPlot ucrSaveGraph.SetPrefix("cor_graph") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(dlgCorrelation.ucrSelectorCorrelation.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") diff --git a/instat/sdgOneVarFitModDisplay.vb b/instat/sdgOneVarFitModDisplay.vb index a8f0c0ee9a6..9f88a303e55 100644 --- a/instat/sdgOneVarFitModDisplay.vb +++ b/instat/sdgOneVarFitModDisplay.vb @@ -61,14 +61,14 @@ Public Class sdgOneVarFitModDisplay ucrSavePlots.SetPrefix("plot") ucrSavePlots.SetSaveTypeAsGraph() ucrSavePlots.SetDataFrameSelector(dlgOneVarFitModel.ucrSelectorOneVarFitMod.ucrAvailableDataFrames) - ucrSavePlots.SetCheckBoxText("Save Graph") + ucrSavePlots.SetCheckBoxText("Store Graph") ucrSavePlots.SetIsComboBox() ucrSavePlots.SetAssignToIfUncheckedValue("last_graph") ucrSaveLikelihood.SetPrefix("likelihood") ucrSaveLikelihood.SetSaveTypeAsGraph() ucrSaveLikelihood.SetDataFrameSelector(dlgOneVarFitModel.ucrSelectorOneVarFitMod.ucrAvailableDataFrames) - ucrSaveLikelihood.SetCheckBoxText("Save Graph") + ucrSaveLikelihood.SetCheckBoxText("Store Graph") ucrSaveLikelihood.SetIsComboBox() ucrSaveLikelihood.SetAssignToIfUncheckedValue("last_likelihood") InitialiseTabs() diff --git a/instat/sdgPrincipalComponentAnalysis.vb b/instat/sdgPrincipalComponentAnalysis.vb index b69bc650010..29e0ba24da7 100644 --- a/instat/sdgPrincipalComponentAnalysis.vb +++ b/instat/sdgPrincipalComponentAnalysis.vb @@ -123,7 +123,7 @@ Public Class sdgPrincipalComponentAnalysis ucrSaveGraph.SetPrefix("pca_graph") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(dlgPrincipalComponentAnalysis.ucrSelectorPCA.ucrAvailableDataFrames) - ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetCheckBoxText("Store Graph") ucrSaveGraph.SetIsComboBox() ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") From bc142d2f890c4c7de327bf74a2dadd24f7840919 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 2 Jul 2024 14:59:51 +0100 Subject: [PATCH 74/83] Change Save Model To Store Model in the data base --- instat/translations/rInstatTranslations.db | Bin 8306688 -> 8306688 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/instat/translations/rInstatTranslations.db b/instat/translations/rInstatTranslations.db index 47b59844abfe11b51576ed8aa5062b35036b839f..2425ae6c2ac56ad8f24b0e142fce67d93e197e61 100644 GIT binary patch delta 546 zcmW;G%U6s60EY3tscAG!3K3xgR*N;FL97+)M59_yTop>N9+~*#C~x=^ooPxkT@)kh(2*t^owIZ2!DNv)qXE`d=2x}@pMHx zJ6-y{m~1T1eG6w|iJHZVFq>;FO{9YM^5A^f8xOilJ;RwyqW@>UDw}KjUrH{iye3r{{SErd2;$L)ljv{QE4&e)*k?5qvhu${B>He#c8!7kb*yKGnNs$H||mbV*r z)5h$UVYls$-L-Km*gd;%5A2~mvd8xC^{G9x$e!DTP1*~avX}PCUfUacYwv8@X6$`= JX<@dm{x3zs|6Bk7 delta 529 zcmWN=%Qut(0LJ0IF*8C!NeUB58d4_Rq^M69L!_%}l3zEvPIPz48H@L{)oPY?T69hu zyUwia`xpEdTHAP^bDmsoqbTRgbwT!feSeT$LIffribPbzL|hb$t)fJfiZZcHl#A`6 zLR5+>u|w<>)nb>Z5xYgL*dz9eI#DkgL_+KnjiO2H7tP{;Xb}fRt2iW*qD{1m!=ghR z5l2O*NQq;jOB@#`#7S{VoEF{UjOY<(#W~R{`owv0;V5i~&gXr>zZTY47AvbZ0g}V|^#A|> From b2b6ae5b17f0a4f57705cd07545dff80e88551b1 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 3 Jul 2024 10:28:27 +0200 Subject: [PATCH 75/83] Added the Version Number --- instat/frmMain.Designer.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 43155880a06..4632c909034 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -5239,7 +5239,9 @@ Partial Class frmMain Me.IsMdiContainer = True Me.MainMenuStrip = Me.mnuBar Me.Name = "frmMain" - Me.Text = "R-Instat .." + Me.Text = "R-Instat " + My.Application.Info.Version.Major.ToString + "." + + My.Application.Info.Version.Minor.ToString + "." + + My.Application.Info.Version.Build.ToString Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.stsStrip.ResumeLayout(False) Me.stsStrip.PerformLayout() From eaaf596ec91db2d9232aeaa95e21e11a52281b6b Mon Sep 17 00:00:00 2001 From: KWAMBAI VITALIS Date: Wed, 3 Jul 2024 12:11:43 +0300 Subject: [PATCH 76/83] disable format option --- instat/dlgDescribeTwoVariable.Designer.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index 03c893ea851..e0234ea7e9f 100644 --- a/instat/dlgDescribeTwoVariable.Designer.vb +++ b/instat/dlgDescribeTwoVariable.Designer.vb @@ -109,6 +109,7 @@ Partial Class dlgDescribeTwoVariable ' 'cmdFormatTable ' + Me.cmdFormatTable.Enabled = False Me.cmdFormatTable.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.cmdFormatTable.Location = New System.Drawing.Point(489, 634) Me.cmdFormatTable.Margin = New System.Windows.Forms.Padding(4) From 53e4c09cc1f161d3eb19918bbf2d0081a4ff637a Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:21:29 +0200 Subject: [PATCH 77/83] Fixed problem with R-instat start up --- instat/frmMain.vb | 76 ++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 53 deletions(-) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index b1a58b1cc0c..7b454b236e9 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -1120,59 +1120,29 @@ Public Class frmMain End Sub Public Sub DeleteAutoSaveFiles() - Try - If Directory.Exists(strAutoSaveDataFolderPath) OrElse Directory.Exists(strAutoSaveLogFolderPath) OrElse Directory.Exists(strAutoSaveInternalLogFolderPath) Then - ' Define the retention policy (keep last N autosaves) - Dim retentionCount As Integer = 5 ' Example: Keep the last 5 autosaves - - ' Retrieve autosaved files - If Directory.Exists(strAutoSaveDataFolderPath) Then - Dim autoSaveDirectory As New DirectoryInfo(strAutoSaveDataFolderPath) - Dim files As FileInfo() = autoSaveDirectory.GetFiles("data_*.rds") ' Adjust pattern to match actual filenames - - ' Sort files by last write time in descending order - Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = files.OrderByDescending(Function(f) f.LastWriteTime) - - ' Determine files to delete based on retention policy - Dim filesToDelete As IEnumerable(Of FileInfo) = sortedFiles.Skip(retentionCount) - - ' Delete older autosaved files - For Each file In filesToDelete - file.Delete() - Next - ElseIf Directory.Exists(strAutoSaveLogFolderPath) Then - Dim autoSaveDirectory As New DirectoryInfo(strAutoSaveLogFolderPath) - Dim files As FileInfo() = autoSaveDirectory.GetFiles("log*.R") ' Adjust pattern to match actual filenames - - ' Sort files by last write time in descending order - Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = files.OrderByDescending(Function(f) f.LastWriteTime) - - ' Determine files to delete based on retention policy - Dim filesToDelete As IEnumerable(Of FileInfo) = sortedFiles.Skip(retentionCount) - - ' Delete older autosaved files - For Each file In filesToDelete - file.Delete() - Next - ElseIf Directory.Exists(strAutoSaveInternalLogFolderPath) Then - Dim autoSaveDirectory As New DirectoryInfo(strAutoSaveInternalLogFolderPath) - Dim files As FileInfo() = autoSaveDirectory.GetFiles("debug_log*.R") ' Adjust pattern to match actual filenames - - ' Sort files by last write time in descending order - Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = files.OrderByDescending(Function(f) f.LastWriteTime) - - ' Determine files to delete based on retention policy - Dim filesToDelete As IEnumerable(Of FileInfo) = sortedFiles.Skip(retentionCount) - - ' Delete older autosaved files - For Each file In filesToDelete - file.Delete() - Next - End If - End If - Catch ex As Exception - MsgBox("Could not delete auto save data file at: " & strCurrentAutoSaveDataFilePath & Environment.NewLine & ex.Message) - End Try + If strCurrentAutoSaveDataFilePath <> "" Then + Try + File.Delete(strCurrentAutoSaveDataFilePath) + Catch ex As Exception + MsgBox("Could not delete auto save data file at: " & strCurrentAutoSaveDataFilePath & Environment.NewLine & ex.Message) + End Try + End If + + If clsRLink.strAutoSaveLogFilePath <> "" Then + Try + File.Delete(clsRLink.strAutoSaveLogFilePath) + Catch ex As Exception + MsgBox("Could not delete auto save log file at: " & clsRLink.strAutoSaveLogFilePath & Environment.NewLine & ex.Message) + End Try + End If + + If clsRLink.strAutoSaveDebugLogFilePath <> "" Then + Try + File.Delete(clsRLink.strAutoSaveDebugLogFilePath) + Catch ex As Exception + MsgBox("Could not delete auto save debug log file at: " & clsRLink.strAutoSaveDebugLogFilePath & Environment.NewLine & ex.Message) + End Try + End If End Sub From 10189dce81c45dd2008c5aebc9ade9f19fb41577 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:56:56 +0200 Subject: [PATCH 78/83] code changes --- instat/frmMain.vb | 86 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 28 deletions(-) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 7b454b236e9..e0a1dbaa222 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -458,15 +458,15 @@ Public Class frmMain '--------------------------------------- 'prompt user for recovery selection If (strAutoSavedLogFilePaths.Length > 0 OrElse - strAutoSavedDataFilePaths.Length > 0) AndAlso - MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & - "Would you like to see auto recovery options?", - MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then + strAutoSavedDataFilePaths.Length > 0) Then + 'MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & + ' "Would you like to see auto recovery options?", + ' MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then dlgAutoSaveRecovery.strAutoSavedLogFilePaths = strAutoSavedLogFilePaths dlgAutoSaveRecovery.strAutoSavedDataFilePaths = strAutoSavedDataFilePaths dlgAutoSaveRecovery.strAutoSavedInternalLogFilePaths = strAutoSavedInternalLogFilePaths - dlgAutoSaveRecovery.ShowDialog() + 'dlgAutoSaveRecovery.ShowDialog() 'todo. the dialog design is meant to only return just one option; script, data file path or new session. 'refactor the dialog to enforce the design @@ -1120,29 +1120,59 @@ Public Class frmMain End Sub Public Sub DeleteAutoSaveFiles() - If strCurrentAutoSaveDataFilePath <> "" Then - Try - File.Delete(strCurrentAutoSaveDataFilePath) - Catch ex As Exception - MsgBox("Could not delete auto save data file at: " & strCurrentAutoSaveDataFilePath & Environment.NewLine & ex.Message) - End Try - End If - - If clsRLink.strAutoSaveLogFilePath <> "" Then - Try - File.Delete(clsRLink.strAutoSaveLogFilePath) - Catch ex As Exception - MsgBox("Could not delete auto save log file at: " & clsRLink.strAutoSaveLogFilePath & Environment.NewLine & ex.Message) - End Try - End If - - If clsRLink.strAutoSaveDebugLogFilePath <> "" Then - Try - File.Delete(clsRLink.strAutoSaveDebugLogFilePath) - Catch ex As Exception - MsgBox("Could not delete auto save debug log file at: " & clsRLink.strAutoSaveDebugLogFilePath & Environment.NewLine & ex.Message) - End Try - End If + Try + If Directory.Exists(strAutoSaveDataFolderPath) OrElse Directory.Exists(strAutoSaveLogFolderPath) OrElse Directory.Exists(strAutoSaveInternalLogFolderPath) Then + ' Define the retention policy (keep last N autosaves) + Dim retentionCount As Integer = 5 ' Example: Keep the last 5 autosaves + + ' Retrieve autosaved files + If Directory.Exists(strAutoSaveDataFolderPath) Then + Dim autoSaveDirectory As New DirectoryInfo(strAutoSaveDataFolderPath) + Dim files As FileInfo() = autoSaveDirectory.GetFiles("data_*.rds") ' Adjust pattern to match actual filenames + + ' Sort files by last write time in descending order + Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = files.OrderByDescending(Function(f) f.LastWriteTime) + + ' Determine files to delete based on retention policy + Dim filesToDelete As IEnumerable(Of FileInfo) = sortedFiles.Skip(retentionCount) + + ' Delete older autosaved files + For Each file In filesToDelete + file.Delete() + Next + ElseIf Directory.Exists(strAutoSaveLogFolderPath) Then + Dim autoSaveDirectory As New DirectoryInfo(strAutoSaveLogFolderPath) + Dim files As FileInfo() = autoSaveDirectory.GetFiles("log*.R") ' Adjust pattern to match actual filenames + + ' Sort files by last write time in descending order + Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = files.OrderByDescending(Function(f) f.LastWriteTime) + + ' Determine files to delete based on retention policy + Dim filesToDelete As IEnumerable(Of FileInfo) = sortedFiles.Skip(retentionCount) + + ' Delete older autosaved files + For Each file In filesToDelete + file.Delete() + Next + ElseIf Directory.Exists(strAutoSaveInternalLogFolderPath) Then + Dim autoSaveDirectory As New DirectoryInfo(strAutoSaveInternalLogFolderPath) + Dim files As FileInfo() = autoSaveDirectory.GetFiles("debug_log*.R") ' Adjust pattern to match actual filenames + + ' Sort files by last write time in descending order + Dim sortedFiles As IOrderedEnumerable(Of FileInfo) = files.OrderByDescending(Function(f) f.LastWriteTime) + + ' Determine files to delete based on retention policy + Dim filesToDelete As IEnumerable(Of FileInfo) = sortedFiles.Skip(retentionCount) + + ' Delete older autosaved files + For Each file In filesToDelete + file.Delete() + Next + End If + End If + Catch ex As Exception + MsgBox("Could not delete auto save data file at: " & strCurrentAutoSaveDataFilePath & Environment.NewLine & ex.Message) + End Try End Sub From b5792c31ca16f164f8d127c1cf427882e2341aee Mon Sep 17 00:00:00 2001 From: Ntalumeso Date: Thu, 4 Jul 2024 20:11:51 +0300 Subject: [PATCH 79/83] fix auto recovery --- instat/frmMain.vb | 54 ++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index b1a58b1cc0c..c2351ac4d28 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -54,6 +54,8 @@ Public Class frmMain Public strAutoSaveLogFolderPath As String = Path.Combine(Path.GetTempPath, "R-Instat_log_auto_save") Public strAutoSaveInternalLogFolderPath As String = Path.Combine(Path.GetTempPath, "R-Instat_debug_log_auto_save") + Private strMarkerFilePath As String = Path.Combine(strAutoSaveLogFolderPath, "app_marker.log") + Public strCurrentAutoSaveDataFilePath As String = "" Private strLatestVersion As String = "" @@ -457,32 +459,41 @@ Public Class frmMain '--------------------------------------- 'prompt user for recovery selection - If (strAutoSavedLogFilePaths.Length > 0 OrElse - strAutoSavedDataFilePaths.Length > 0) AndAlso - MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & - "Would you like to see auto recovery options?", - MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then - - dlgAutoSaveRecovery.strAutoSavedLogFilePaths = strAutoSavedLogFilePaths - dlgAutoSaveRecovery.strAutoSavedDataFilePaths = strAutoSavedDataFilePaths - dlgAutoSaveRecovery.strAutoSavedInternalLogFilePaths = strAutoSavedInternalLogFilePaths - dlgAutoSaveRecovery.ShowDialog() - - 'todo. the dialog design is meant to only return just one option; script, data file path or new session. - 'refactor the dialog to enforce the design - - 'get the R script from read file if selected by the user - strScript = dlgAutoSaveRecovery.GetScript() - 'get the data file path if selected by the user - strDataFilePath = dlgAutoSaveRecovery.GetDataFilePath() + 'Check if the marker file exists + If File.Exists(strMarkerFilePath) Then + Dim lastExitStatus As String = File.ReadAllText(strMarkerFilePath).Trim() + If lastExitStatus <> "CleanExit" AndAlso + MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & + "Would you like to see auto recovery options?", + MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then + + dlgAutoSaveRecovery.strAutoSavedLogFilePaths = strAutoSavedLogFilePaths + dlgAutoSaveRecovery.strAutoSavedDataFilePaths = strAutoSavedDataFilePaths + dlgAutoSaveRecovery.strAutoSavedInternalLogFilePaths = strAutoSavedInternalLogFilePaths + dlgAutoSaveRecovery.ShowDialog() + + 'todo. the dialog design is meant to only return just one option; script, data file path or new session. + 'refactor the dialog to enforce the design + + 'get the R script from read file if selected by the user + strScript = dlgAutoSaveRecovery.GetScript() + 'get the data file path if selected by the user + strDataFilePath = dlgAutoSaveRecovery.GetDataFilePath() + End If End If + + Using writer As StreamWriter = New StreamWriter(strMarkerFilePath, False) + writer.WriteLine("Running") + End Using + '--------------------------------------- + '--------------------------------------- 'delete the recovery files If strAutoSavedLogFilePaths.Length > 0 Then Try - File.Delete(strAutoSavedLogFilePaths(0)) + File.Delete(strAutoSavedLogFilePaths(1)) '1 to avoid deleting app_marker file Catch ex As Exception MsgBox("Could not delete backup log file" & Environment.NewLine, "Error deleting file") End Try @@ -1078,6 +1089,11 @@ Public Class frmMain If RuntimeInformation.IsOSPlatform(OSPlatform.Windows) Then CefRuntimeWrapper.ShutDownCef() End If + + Using writer As StreamWriter = New StreamWriter(strMarkerFilePath, False) + writer.WriteLine("CleanExit") + End Using + Catch ex As Exception MsgBox("Error attempting to save setting files to App Data folder." & Environment.NewLine & "System error message: " & ex.Message, MsgBoxStyle.Critical, "Error saving settings") End Try From fe79c4c1e0d1236976ab3221a3a72f6a2118e761 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:05:27 +0200 Subject: [PATCH 80/83] Code changes --- instat/frmMain.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index e0a1dbaa222..b1a58b1cc0c 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -458,15 +458,15 @@ Public Class frmMain '--------------------------------------- 'prompt user for recovery selection If (strAutoSavedLogFilePaths.Length > 0 OrElse - strAutoSavedDataFilePaths.Length > 0) Then - 'MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & - ' "Would you like to see auto recovery options?", - ' MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then + strAutoSavedDataFilePaths.Length > 0) AndAlso + MsgBox("We have detected that R-Instat may have closed unexpectedly last time." & Environment.NewLine & + "Would you like to see auto recovery options?", + MessageBoxButtons.YesNo, "Auto Recovery") = MsgBoxResult.Yes Then dlgAutoSaveRecovery.strAutoSavedLogFilePaths = strAutoSavedLogFilePaths dlgAutoSaveRecovery.strAutoSavedDataFilePaths = strAutoSavedDataFilePaths dlgAutoSaveRecovery.strAutoSavedInternalLogFilePaths = strAutoSavedInternalLogFilePaths - 'dlgAutoSaveRecovery.ShowDialog() + dlgAutoSaveRecovery.ShowDialog() 'todo. the dialog design is meant to only return just one option; script, data file path or new session. 'refactor the dialog to enforce the design From 03812a6d88c145ce8bdc5314a8df4d2c0ee70fea Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Tue, 9 Jul 2024 09:30:08 +0100 Subject: [PATCH 81/83] Change Made --- instat/dlgTransformClimatic.vb | 52 ++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/instat/dlgTransformClimatic.vb b/instat/dlgTransformClimatic.vb index ca2690e2c39..1b6f7c6009b 100644 --- a/instat/dlgTransformClimatic.vb +++ b/instat/dlgTransformClimatic.vb @@ -520,7 +520,6 @@ Public Class dlgTransformClimatic clsRRaindayUpperOperator.SetOperation("<=") clsRRaindayAndOperator.AddParameter("lower", clsROperatorParameter:=clsRRaindayLowerOperator, iPosition:=1) clsRRaindayLowerOperator.SetOperation(">=") - clsRRaindayLowerOperator.AddParameter("min", 0.85, iPosition:=1) clsRRaindayOrOperator.SetOperation("|") clsRRaindayOrOperator.AddParameter("upper", clsROperatorParameter:=clsGreaterThanOperator, iPosition:=0) @@ -894,11 +893,9 @@ Public Class dlgTransformClimatic clsRTransformCountSpellSub.AddParameter("sub1", clsRFunctionParameter:=clsRRainday, bIncludeArgumentName:=False, iPosition:=0) clsTransformManipulationsFunc.SetRCommand("list") - clsTransformManipulationsFunc.AddParameter("group_by_year", clsRFunctionParameter:=clsGroupByYear, bIncludeArgumentName:=False, iPosition:=0) clsRTransform.SetRCommand("instat_calculation$new") clsRTransform.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) - clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsRCountFunction, iPosition:=1) ' changes depending on the rdo clsRTransform.AddParameter("result_name", Chr(34) & "count" & Chr(34), iPosition:=2) clsRTransform.AddParameter("sub_calculations", clsRFunctionParameter:=clsRTransformCountSpellSub, iPosition:=4) clsRTransform.AddParameter("manipulations", clsRFunctionParameter:=clsTransformManipulationsFunc, iPosition:=5) @@ -930,8 +927,6 @@ Public Class dlgTransformClimatic ucrReceiverData.AddAdditionalCodeParameterPair(clsIfElseRainMaxFunction, New RParameter("no", 2), iAdditionalPairNo:=12) ucrNudSumOver.AddAdditionalCodeParameterPair(clsRasterFuction, New RParameter("n", 1), iAdditionalPairNo:=1) ucrInputSum.AddAdditionalCodeParameterPair(clsRasterFuction, New RParameter("fun", 2), iAdditionalPairNo:=1) - ucrInputSpellUpper.AddAdditionalCodeParameterPair(clsGreaterThanOperator, New RParameter("max", 1), iAdditionalPairNo:=1) - ucrInputSpellLower.AddAdditionalCodeParameterPair(clsLessThanOperator, New RParameter("min", 1), iAdditionalPairNo:=1) ucrReceiverTMin.AddAdditionalCodeParameterPair(clsTMeanAddOperator, New RParameter("tmin", 1), iAdditionalPairNo:=1) ucrReceiverTMax.AddAdditionalCodeParameterPair(clsTMeanAddOperator, New RParameter("tmax", 0), iAdditionalPairNo:=1) ucrReceiverTMean.AddAdditionalCodeParameterPair(clsGrowingDegreDiffOperator, New RParameter("tmean", 0), iAdditionalPairNo:=1) @@ -947,6 +942,7 @@ Public Class dlgTransformClimatic ucrInputEvaporation.AddAdditionalCodeParameterPair(clsWBMaxEvapOperator, New RParameter("value", 1, bNewIncludeArgumentName:=False), iAdditionalPairNo:=1) ucrReceiverEvap.AddAdditionalCodeParameterPair(clsWBMaxTailFunction1, New RParameter("x", 0), iAdditionalPairNo:=1) ucrReceiverEvap.AddAdditionalCodeParameterPair(clsAsNumericFunction, New RParameter("x", 0), iAdditionalPairNo:=2) + ucrSaveColumn.AddAdditionalCodeParameterPair(clsEndSeasonWBCalc, New RParameter("result_name", 2), iAdditionalPairNo:=1) ' Moving ucrNudSumOver.SetRCode(clsRMovingFunction, bReset) @@ -961,7 +957,7 @@ Public Class dlgTransformClimatic ' Count ucrNudCountOver.SetRCode(clsRCountFunction, bReset) - ucrInputSpellLower.SetRCode(clsRRaindayLowerOperator, bReset) + ucrInputSpellLower.SetRCode(clsLessThanOperator, bReset) ucrInputSpellUpper.SetRCode(clsRRaindayUpperOperator, bReset) ' Water Balance @@ -1106,6 +1102,7 @@ Public Class dlgTransformClimatic ChangeFunctions() AddRemoveMeanOperator() ShowGroups() + InputConditionOptions() End Sub Private Sub DegreeFunctions() @@ -1217,7 +1214,6 @@ Public Class dlgTransformClimatic Private Sub RainDays() clsRRainday.AddParameter("calculated_from", " list(" & strCurrDataName & "=" & ucrReceiverData.GetVariableNames() & ")", iPosition:=3) - clsRTransform.AddParameter("calculated_from", "list(" & strCurrDataName & "=" & ucrReceiverData.GetVariableNames & ")", iPosition:=3) End Sub Private Sub ucrSelectorTransform_ControlValueChanged(ucrchangedControl As ucrCore) Handles ucrSelectorTransform.ControlValueChanged @@ -1232,7 +1228,7 @@ Public Class dlgTransformClimatic RainfallChange() End Sub - Private Sub ucrInputSpellLower_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSpellUpper.ControlValueChanged, ucrInputCondition.ControlValueChanged + Private Sub ucrInputSpellLower_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSpellLower.ControlValueChanged, ucrInputSpellUpper.ControlValueChanged, ucrInputCondition.ControlValueChanged InputConditionOptions() End Sub @@ -1282,25 +1278,33 @@ Public Class dlgTransformClimatic End Sub Private Sub CumulativeFunctions() - Select Case ucrInputCumulative.GetText - Case "Sum" - clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsCumulativeSum, iPosition:=1) - Case "Maximum" - clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsCumulativeMaximum, iPosition:=1) - Case "Minimum" - clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsCumulativeMinimum, iPosition:=1) - End Select + If rdoCumulative.Checked Then + Select Case ucrInputCumulative.GetText + Case "Sum" + clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsCumulativeSum, iPosition:=1) + Case "Maximum" + clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsCumulativeMaximum, iPosition:=1) + Case "Minimum" + clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsCumulativeMinimum, iPosition:=1) + End Select + ElseIf rdoCount.Checked Then + clsRTransform.AddParameter("function_exp", clsRFunctionParameter:=clsRCountFunction, iPosition:=1) ' changes depending on the rdo + End If End Sub Private Sub CumulativeColNames() - Select Case ucrInputCumulative.GetText - Case "Sum" - ucrSaveColumn.SetName("cumsum") - Case "Maximum" - ucrSaveColumn.SetName("cummax") - Case "Minimum" - ucrSaveColumn.SetName("cummin") - End Select + If rdoCumulative.Checked Then + Select Case ucrInputCumulative.GetText + Case "Sum" + ucrSaveColumn.SetName("cumsum") + Case "Maximum" + ucrSaveColumn.SetName("cummax") + Case "Minimum" + ucrSaveColumn.SetName("cummin") + End Select + ElseIf rdoCount.Checked Then + ucrSaveColumn.SetName("count") + End If End Sub Private Sub ucrInputCumulative_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputCumulative.ControlValueChanged From 53b237bc14aa4ceb4896a0ab0e91bf57562acb8a Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 12 Jul 2024 10:06:55 +0300 Subject: [PATCH 82/83] New climsoft dialog --- instat/dlgClimSoft.Designer.vb | 536 +++++++++++------- instat/dlgClimSoft.vb | 442 ++++++++------- instat/instat.vbproj | 6 + instat/sdgClimsoft.Designer.vb | 259 +++++++++ instat/sdgClimsoft.vb | 112 ++++ .../static/InstatObject/R/instat_object_R6.R | 242 ++++++++ 6 files changed, 1195 insertions(+), 402 deletions(-) create mode 100644 instat/sdgClimsoft.Designer.vb create mode 100644 instat/sdgClimsoft.vb diff --git a/instat/dlgClimSoft.Designer.vb b/instat/dlgClimSoft.Designer.vb index aa14f7e0879..18e11098e6a 100644 --- a/instat/dlgClimSoft.Designer.vb +++ b/instat/dlgClimSoft.Designer.vb @@ -39,202 +39,310 @@ Partial Class dlgClimSoft Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Me.cmdEstablishConnection = New System.Windows.Forms.Button() - Me.lblElements = New System.Windows.Forms.Label() - Me.lblStations = New System.Windows.Forms.Label() - Me.lblStartDate = New System.Windows.Forms.Label() - Me.lblEndDate = New System.Windows.Forms.Label() + Me.btnConnection = New System.Windows.Forms.Button() + Me.lblSelectElements = New System.Windows.Forms.Label() + Me.lblSelectStations = New System.Windows.Forms.Label() Me.ttClimsoft = New System.Windows.Forms.ToolTip(Me.components) - Me.ucrChkUnstackData = New instat.ucrCheck() - Me.ucrChkFlagsData = New instat.ucrCheck() - Me.ucrChkElements = New instat.ucrCheck() - Me.ucrChkDateRange = New instat.ucrCheck() - Me.ucrDtpEndDate = New instat.ucrDateTimePicker() - Me.ucrDtpStartdate = New instat.ucrDateTimePicker() - Me.ucrChkObservationData = New instat.ucrCheck() + Me.ucrChkImportElementsMetadata = New instat.ucrCheck() + Me.ucrChkImportStationsMetadata = New instat.ucrCheck() + Me.ucrChkDataDate = New instat.ucrCheck() + Me.ucrDtpEndDataDate = New instat.ucrDateTimePicker() + Me.ucrDtpStartDataDate = New instat.ucrDateTimePicker() + Me.ucrChkImportFlagsMetadata = New instat.ucrCheck() Me.lblConnection = New System.Windows.Forms.Label() - Me.ucrComboBoxElements = New instat.ucrInputComboBox() - Me.ucrComboBoxStations = New instat.ucrInputComboBox() + Me.lblToDataDate = New System.Windows.Forms.Label() + Me.lblSelectTable = New System.Windows.Forms.Label() + Me.lblSelectQCStatus = New System.Windows.Forms.Label() + Me.btnCheckRecords = New System.Windows.Forms.Button() + Me.lblRecordsNum = New System.Windows.Forms.Label() + Me.btnMoreOptions = New System.Windows.Forms.Button() + Me.rdoMetadata = New System.Windows.Forms.RadioButton() + Me.rdoData = New System.Windows.Forms.RadioButton() + Me.ucrPnlOptions = New instat.UcrPanel() + Me.ucrCboQCStatus = New instat.ucrInputComboBox() + Me.ucrCboTable = New instat.ucrInputComboBox() + Me.ucrCboElements = New instat.ucrInputComboBox() + Me.ucrCboStations = New instat.ucrInputComboBox() Me.ucrSelectorForClimSoft = New instat.ucrSelectorAddRemove() Me.ucrReceiverMultipleElements = New instat.ucrReceiverMultiple() Me.ucrReceiverMultipleStations = New instat.ucrReceiverMultiple() Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'cmdEstablishConnection - ' - Me.cmdEstablishConnection.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdEstablishConnection.Location = New System.Drawing.Point(8, 8) - Me.cmdEstablishConnection.Name = "cmdEstablishConnection" - Me.cmdEstablishConnection.Size = New System.Drawing.Size(142, 23) - Me.cmdEstablishConnection.TabIndex = 1 - Me.cmdEstablishConnection.Text = "Establish Connection..." - Me.cmdEstablishConnection.UseVisualStyleBackColor = True - ' - 'lblElements - ' - Me.lblElements.AutoSize = True - Me.lblElements.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblElements.Location = New System.Drawing.Point(256, 194) - Me.lblElements.Name = "lblElements" - Me.lblElements.Size = New System.Drawing.Size(98, 13) - Me.lblElements.TabIndex = 4 - Me.lblElements.Text = "Selected Elements:" - ' - 'lblStations - ' - Me.lblStations.AutoSize = True - Me.lblStations.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblStations.Location = New System.Drawing.Point(256, 38) - Me.lblStations.Name = "lblStations" - Me.lblStations.Size = New System.Drawing.Size(93, 13) - Me.lblStations.TabIndex = 2 - Me.lblStations.Text = "Selected Stations:" - Me.lblStations.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - ' - 'lblStartDate - ' - Me.lblStartDate.AutoSize = True - Me.lblStartDate.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblStartDate.Location = New System.Drawing.Point(32, 307) - Me.lblStartDate.Name = "lblStartDate" - Me.lblStartDate.Size = New System.Drawing.Size(58, 13) - Me.lblStartDate.TabIndex = 7 - Me.lblStartDate.Text = "Start Date:" - ' - 'lblEndDate - ' - Me.lblEndDate.AutoSize = True - Me.lblEndDate.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblEndDate.Location = New System.Drawing.Point(34, 349) - Me.lblEndDate.Name = "lblEndDate" - Me.lblEndDate.Size = New System.Drawing.Size(55, 13) - Me.lblEndDate.TabIndex = 9 - Me.lblEndDate.Text = "End Date:" - ' - 'ucrChkUnstackData - ' - Me.ucrChkUnstackData.AutoSize = True - Me.ucrChkUnstackData.Checked = True - Me.ucrChkUnstackData.Location = New System.Drawing.Point(8, 235) - Me.ucrChkUnstackData.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrChkUnstackData.Name = "ucrChkUnstackData" - Me.ucrChkUnstackData.Size = New System.Drawing.Size(178, 23) - Me.ucrChkUnstackData.TabIndex = 9 - Me.ttClimsoft.SetToolTip(Me.ucrChkUnstackData, "Select Observation Data Date Range") - ' - 'ucrChkFlagsData - ' - Me.ucrChkFlagsData.AutoSize = True - Me.ucrChkFlagsData.Checked = False - Me.ucrChkFlagsData.Location = New System.Drawing.Point(8, 212) - Me.ucrChkFlagsData.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrChkFlagsData.Name = "ucrChkFlagsData" - Me.ucrChkFlagsData.Size = New System.Drawing.Size(213, 23) - Me.ucrChkFlagsData.TabIndex = 8 - Me.ttClimsoft.SetToolTip(Me.ucrChkFlagsData, "Select Observation Data Date Range") - ' - 'ucrChkElements - ' - Me.ucrChkElements.AutoSize = True - Me.ucrChkElements.Checked = False - Me.ucrChkElements.Location = New System.Drawing.Point(8, 258) - Me.ucrChkElements.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrChkElements.Name = "ucrChkElements" - Me.ucrChkElements.Size = New System.Drawing.Size(230, 23) - Me.ucrChkElements.TabIndex = 10 - Me.ttClimsoft.SetToolTip(Me.ucrChkElements, "Select Observation Data Date Range") - ' - 'ucrChkDateRange - ' - Me.ucrChkDateRange.AutoSize = True - Me.ucrChkDateRange.Checked = False - Me.ucrChkDateRange.Location = New System.Drawing.Point(8, 283) - Me.ucrChkDateRange.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrChkDateRange.Name = "ucrChkDateRange" - Me.ucrChkDateRange.Size = New System.Drawing.Size(178, 23) - Me.ucrChkDateRange.TabIndex = 11 - Me.ttClimsoft.SetToolTip(Me.ucrChkDateRange, "Select Observation Data Date Range") - ' - 'ucrDtpEndDate - ' - Me.ucrDtpEndDate.AutoSize = True - Me.ucrDtpEndDate.DateValue = New Date(2021, 5, 18, 16, 45, 8, 379) - Me.ucrDtpEndDate.Format = "dd MMM yyyy" - Me.ucrDtpEndDate.Location = New System.Drawing.Point(36, 367) - Me.ucrDtpEndDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrDtpEndDate.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) - Me.ucrDtpEndDate.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) - Me.ucrDtpEndDate.Name = "ucrDtpEndDate" - Me.ucrDtpEndDate.Size = New System.Drawing.Size(163, 20) - Me.ucrDtpEndDate.TabIndex = 13 - Me.ttClimsoft.SetToolTip(Me.ucrDtpEndDate, "End Date (To)") - ' - 'ucrDtpStartdate - ' - Me.ucrDtpStartdate.AutoSize = True - Me.ucrDtpStartdate.DateValue = New Date(2021, 5, 18, 16, 45, 8, 408) - Me.ucrDtpStartdate.Format = "dd MMM yyyy" - Me.ucrDtpStartdate.Location = New System.Drawing.Point(35, 322) - Me.ucrDtpStartdate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrDtpStartdate.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) - Me.ucrDtpStartdate.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) - Me.ucrDtpStartdate.Name = "ucrDtpStartdate" - Me.ucrDtpStartdate.Size = New System.Drawing.Size(163, 20) - Me.ucrDtpStartdate.TabIndex = 12 - Me.ttClimsoft.SetToolTip(Me.ucrDtpStartdate, "Start Date (From)") - ' - 'ucrChkObservationData - ' - Me.ucrChkObservationData.AutoSize = True - Me.ucrChkObservationData.Checked = False - Me.ucrChkObservationData.Location = New System.Drawing.Point(8, 188) - Me.ucrChkObservationData.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) - Me.ucrChkObservationData.Name = "ucrChkObservationData" - Me.ucrChkObservationData.Size = New System.Drawing.Size(202, 23) - Me.ucrChkObservationData.TabIndex = 7 - Me.ttClimsoft.SetToolTip(Me.ucrChkObservationData, "Select Observation Data Date Range") + 'btnConnection + ' + Me.btnConnection.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnConnection.Location = New System.Drawing.Point(7, 45) + Me.btnConnection.Name = "btnConnection" + Me.btnConnection.Size = New System.Drawing.Size(147, 23) + Me.btnConnection.TabIndex = 1 + Me.btnConnection.Text = "Connect to Database" + Me.btnConnection.UseVisualStyleBackColor = True + ' + 'lblSelectElements + ' + Me.lblSelectElements.AutoSize = True + Me.lblSelectElements.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSelectElements.Location = New System.Drawing.Point(285, 226) + Me.lblSelectElements.Name = "lblSelectElements" + Me.lblSelectElements.Size = New System.Drawing.Size(86, 13) + Me.lblSelectElements.TabIndex = 4 + Me.lblSelectElements.Text = "Select Elements:" + ' + 'lblSelectStations + ' + Me.lblSelectStations.AutoSize = True + Me.lblSelectStations.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSelectStations.Location = New System.Drawing.Point(285, 70) + Me.lblSelectStations.Name = "lblSelectStations" + Me.lblSelectStations.Size = New System.Drawing.Size(81, 13) + Me.lblSelectStations.TabIndex = 2 + Me.lblSelectStations.Text = "Select Stations:" + Me.lblSelectStations.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'ucrChkImportElementsMetadata + ' + Me.ucrChkImportElementsMetadata.AutoSize = True + Me.ucrChkImportElementsMetadata.Checked = True + Me.ucrChkImportElementsMetadata.Location = New System.Drawing.Point(10, 110) + Me.ucrChkImportElementsMetadata.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrChkImportElementsMetadata.Name = "ucrChkImportElementsMetadata" + Me.ucrChkImportElementsMetadata.Size = New System.Drawing.Size(213, 23) + Me.ucrChkImportElementsMetadata.TabIndex = 36 + Me.ttClimsoft.SetToolTip(Me.ucrChkImportElementsMetadata, "Unstack elements") + ' + 'ucrChkImportStationsMetadata + ' + Me.ucrChkImportStationsMetadata.AutoSize = True + Me.ucrChkImportStationsMetadata.Checked = True + Me.ucrChkImportStationsMetadata.Location = New System.Drawing.Point(10, 85) + Me.ucrChkImportStationsMetadata.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrChkImportStationsMetadata.Name = "ucrChkImportStationsMetadata" + Me.ucrChkImportStationsMetadata.Size = New System.Drawing.Size(213, 23) + Me.ucrChkImportStationsMetadata.TabIndex = 35 + Me.ttClimsoft.SetToolTip(Me.ucrChkImportStationsMetadata, "Unstack elements") + ' + 'ucrChkDataDate + ' + Me.ucrChkDataDate.AutoSize = True + Me.ucrChkDataDate.Checked = False + Me.ucrChkDataDate.Location = New System.Drawing.Point(9, 289) + Me.ucrChkDataDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrChkDataDate.Name = "ucrChkDataDate" + Me.ucrChkDataDate.Size = New System.Drawing.Size(169, 23) + Me.ucrChkDataDate.TabIndex = 21 + Me.ttClimsoft.SetToolTip(Me.ucrChkDataDate, "Select Observation Data Date Range") + ' + 'ucrDtpEndDataDate + ' + Me.ucrDtpEndDataDate.AutoSize = True + Me.ucrDtpEndDataDate.DateValue = New Date(2021, 5, 18, 16, 45, 8, 379) + Me.ucrDtpEndDataDate.Format = "dd MMM yyyy" + Me.ucrDtpEndDataDate.Location = New System.Drawing.Point(156, 312) + Me.ucrDtpEndDataDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrDtpEndDataDate.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) + Me.ucrDtpEndDataDate.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) + Me.ucrDtpEndDataDate.Name = "ucrDtpEndDataDate" + Me.ucrDtpEndDataDate.Size = New System.Drawing.Size(102, 20) + Me.ucrDtpEndDataDate.TabIndex = 23 + Me.ttClimsoft.SetToolTip(Me.ucrDtpEndDataDate, "End Date (To)") + ' + 'ucrDtpStartDataDate + ' + Me.ucrDtpStartDataDate.AutoSize = True + Me.ucrDtpStartDataDate.DateValue = New Date(2021, 5, 18, 16, 45, 8, 408) + Me.ucrDtpStartDataDate.Format = "dd MMM yyyy" + Me.ucrDtpStartDataDate.Location = New System.Drawing.Point(23, 313) + Me.ucrDtpStartDataDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrDtpStartDataDate.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) + Me.ucrDtpStartDataDate.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) + Me.ucrDtpStartDataDate.Name = "ucrDtpStartDataDate" + Me.ucrDtpStartDataDate.Size = New System.Drawing.Size(102, 20) + Me.ucrDtpStartDataDate.TabIndex = 22 + Me.ttClimsoft.SetToolTip(Me.ucrDtpStartDataDate, "Start Date (From)") + ' + 'ucrChkImportFlagsMetadata + ' + Me.ucrChkImportFlagsMetadata.AutoSize = True + Me.ucrChkImportFlagsMetadata.Checked = True + Me.ucrChkImportFlagsMetadata.Location = New System.Drawing.Point(10, 135) + Me.ucrChkImportFlagsMetadata.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrChkImportFlagsMetadata.Name = "ucrChkImportFlagsMetadata" + Me.ucrChkImportFlagsMetadata.Size = New System.Drawing.Size(213, 23) + Me.ucrChkImportFlagsMetadata.TabIndex = 37 + Me.ttClimsoft.SetToolTip(Me.ucrChkImportFlagsMetadata, "Unstack elements") ' 'lblConnection ' Me.lblConnection.AutoSize = True Me.lblConnection.ForeColor = System.Drawing.Color.Red Me.lblConnection.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblConnection.Location = New System.Drawing.Point(153, 14) + Me.lblConnection.Location = New System.Drawing.Point(164, 51) Me.lblConnection.Name = "lblConnection" Me.lblConnection.Size = New System.Drawing.Size(78, 13) Me.lblConnection.TabIndex = 16 Me.lblConnection.Text = "No Connection" ' - 'ucrComboBoxElements - ' - Me.ucrComboBoxElements.AddQuotesIfUnrecognised = True - Me.ucrComboBoxElements.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrComboBoxElements.GetSetSelectedIndex = -1 - Me.ucrComboBoxElements.IsReadOnly = False - Me.ucrComboBoxElements.Location = New System.Drawing.Point(259, 210) - Me.ucrComboBoxElements.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) - Me.ucrComboBoxElements.Name = "ucrComboBoxElements" - Me.ucrComboBoxElements.Size = New System.Drawing.Size(137, 21) - Me.ucrComboBoxElements.TabIndex = 5 - ' - 'ucrComboBoxStations - ' - Me.ucrComboBoxStations.AddQuotesIfUnrecognised = True - Me.ucrComboBoxStations.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrComboBoxStations.GetSetSelectedIndex = -1 - Me.ucrComboBoxStations.IsReadOnly = False - Me.ucrComboBoxStations.Location = New System.Drawing.Point(256, 53) - Me.ucrComboBoxStations.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) - Me.ucrComboBoxStations.Name = "ucrComboBoxStations" - Me.ucrComboBoxStations.Size = New System.Drawing.Size(137, 21) - Me.ucrComboBoxStations.TabIndex = 3 + 'lblToDataDate + ' + Me.lblToDataDate.AutoSize = True + Me.lblToDataDate.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblToDataDate.Location = New System.Drawing.Point(130, 315) + Me.lblToDataDate.Name = "lblToDataDate" + Me.lblToDataDate.Size = New System.Drawing.Size(20, 13) + Me.lblToDataDate.TabIndex = 20 + Me.lblToDataDate.Text = "To" + ' + 'lblSelectTable + ' + Me.lblSelectTable.AutoSize = True + Me.lblSelectTable.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSelectTable.Location = New System.Drawing.Point(5, 238) + Me.lblSelectTable.Name = "lblSelectTable" + Me.lblSelectTable.Size = New System.Drawing.Size(96, 13) + Me.lblSelectTable.TabIndex = 24 + Me.lblSelectTable.Text = "Select Data Table:" + Me.lblSelectTable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'lblSelectQCStatus + ' + Me.lblSelectQCStatus.AutoSize = True + Me.lblSelectQCStatus.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblSelectQCStatus.Location = New System.Drawing.Point(5, 265) + Me.lblSelectQCStatus.Name = "lblSelectQCStatus" + Me.lblSelectQCStatus.Size = New System.Drawing.Size(117, 13) + Me.lblSelectQCStatus.TabIndex = 26 + Me.lblSelectQCStatus.Text = "Select Data QC Status:" + Me.lblSelectQCStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'btnCheckRecords + ' + Me.btnCheckRecords.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnCheckRecords.Location = New System.Drawing.Point(6, 376) + Me.btnCheckRecords.Name = "btnCheckRecords" + Me.btnCheckRecords.Size = New System.Drawing.Size(139, 23) + Me.btnCheckRecords.TabIndex = 28 + Me.btnCheckRecords.Text = "Check Records" + Me.btnCheckRecords.UseVisualStyleBackColor = True + ' + 'lblRecordsNum + ' + Me.lblRecordsNum.AutoSize = True + Me.lblRecordsNum.ForeColor = System.Drawing.Color.Red + Me.lblRecordsNum.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblRecordsNum.Location = New System.Drawing.Point(156, 380) + Me.lblRecordsNum.Name = "lblRecordsNum" + Me.lblRecordsNum.Size = New System.Drawing.Size(64, 13) + Me.lblRecordsNum.TabIndex = 29 + Me.lblRecordsNum.Text = "No Records" + ' + 'btnMoreOptions + ' + Me.btnMoreOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.btnMoreOptions.Location = New System.Drawing.Point(5, 345) + Me.btnMoreOptions.Name = "btnMoreOptions" + Me.btnMoreOptions.Size = New System.Drawing.Size(139, 23) + Me.btnMoreOptions.TabIndex = 31 + Me.btnMoreOptions.Text = "More options" + Me.btnMoreOptions.UseVisualStyleBackColor = True + ' + 'rdoMetadata + ' + Me.rdoMetadata.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoMetadata.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoMetadata.FlatAppearance.BorderSize = 2 + Me.rdoMetadata.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoMetadata.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoMetadata.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoMetadata.Location = New System.Drawing.Point(197, 5) + Me.rdoMetadata.Name = "rdoMetadata" + Me.rdoMetadata.Size = New System.Drawing.Size(145, 28) + Me.rdoMetadata.TabIndex = 34 + Me.rdoMetadata.TabStop = True + Me.rdoMetadata.Tag = "" + Me.rdoMetadata.Text = "Metadata" + Me.rdoMetadata.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoMetadata.UseVisualStyleBackColor = True + ' + 'rdoData + ' + Me.rdoData.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoData.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoData.FlatAppearance.BorderSize = 2 + Me.rdoData.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoData.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoData.Location = New System.Drawing.Point(55, 5) + Me.rdoData.Name = "rdoData" + Me.rdoData.Size = New System.Drawing.Size(145, 28) + Me.rdoData.TabIndex = 33 + Me.rdoData.TabStop = True + Me.rdoData.Tag = "" + Me.rdoData.Text = "Observation Data" + Me.rdoData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoData.UseVisualStyleBackColor = True + ' + 'ucrPnlOptions + ' + Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOptions.Location = New System.Drawing.Point(6, 4) + Me.ucrPnlOptions.Margin = New System.Windows.Forms.Padding(5) + Me.ucrPnlOptions.Name = "ucrPnlOptions" + Me.ucrPnlOptions.Size = New System.Drawing.Size(428, 30) + Me.ucrPnlOptions.TabIndex = 32 + ' + 'ucrCboQCStatus + ' + Me.ucrCboQCStatus.AddQuotesIfUnrecognised = True + Me.ucrCboQCStatus.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboQCStatus.GetSetSelectedIndex = -1 + Me.ucrCboQCStatus.IsReadOnly = False + Me.ucrCboQCStatus.Location = New System.Drawing.Point(154, 259) + Me.ucrCboQCStatus.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) + Me.ucrCboQCStatus.Name = "ucrCboQCStatus" + Me.ucrCboQCStatus.Size = New System.Drawing.Size(104, 21) + Me.ucrCboQCStatus.TabIndex = 27 + ' + 'ucrCboTable + ' + Me.ucrCboTable.AddQuotesIfUnrecognised = True + Me.ucrCboTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboTable.GetSetSelectedIndex = -1 + Me.ucrCboTable.IsReadOnly = False + Me.ucrCboTable.Location = New System.Drawing.Point(154, 233) + Me.ucrCboTable.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) + Me.ucrCboTable.Name = "ucrCboTable" + Me.ucrCboTable.Size = New System.Drawing.Size(104, 21) + Me.ucrCboTable.TabIndex = 25 + ' + 'ucrCboElements + ' + Me.ucrCboElements.AddQuotesIfUnrecognised = True + Me.ucrCboElements.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboElements.GetSetSelectedIndex = -1 + Me.ucrCboElements.IsReadOnly = False + Me.ucrCboElements.Location = New System.Drawing.Point(288, 242) + Me.ucrCboElements.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) + Me.ucrCboElements.Name = "ucrCboElements" + Me.ucrCboElements.Size = New System.Drawing.Size(137, 21) + Me.ucrCboElements.TabIndex = 5 + ' + 'ucrCboStations + ' + Me.ucrCboStations.AddQuotesIfUnrecognised = True + Me.ucrCboStations.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboStations.GetSetSelectedIndex = -1 + Me.ucrCboStations.IsReadOnly = False + Me.ucrCboStations.Location = New System.Drawing.Point(285, 85) + Me.ucrCboStations.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) + Me.ucrCboStations.Name = "ucrCboStations" + Me.ucrCboStations.Size = New System.Drawing.Size(137, 21) + Me.ucrCboStations.TabIndex = 3 ' 'ucrSelectorForClimSoft ' Me.ucrSelectorForClimSoft.AutoSize = True Me.ucrSelectorForClimSoft.bShowHiddenColumns = False - Me.ucrSelectorForClimSoft.Location = New System.Drawing.Point(8, 43) + Me.ucrSelectorForClimSoft.Location = New System.Drawing.Point(7, 84) Me.ucrSelectorForClimSoft.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForClimSoft.Name = "ucrSelectorForClimSoft" Me.ucrSelectorForClimSoft.Size = New System.Drawing.Size(216, 147) @@ -244,7 +352,7 @@ Partial Class dlgClimSoft ' Me.ucrReceiverMultipleElements.AutoSize = True Me.ucrReceiverMultipleElements.frmParent = Me - Me.ucrReceiverMultipleElements.Location = New System.Drawing.Point(259, 234) + Me.ucrReceiverMultipleElements.Location = New System.Drawing.Point(288, 266) Me.ucrReceiverMultipleElements.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverMultipleElements.Name = "ucrReceiverMultipleElements" Me.ucrReceiverMultipleElements.Selector = Nothing @@ -257,7 +365,7 @@ Partial Class dlgClimSoft ' Me.ucrReceiverMultipleStations.AutoSize = True Me.ucrReceiverMultipleStations.frmParent = Me - Me.ucrReceiverMultipleStations.Location = New System.Drawing.Point(256, 77) + Me.ucrReceiverMultipleStations.Location = New System.Drawing.Point(285, 109) Me.ucrReceiverMultipleStations.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverMultipleStations.Name = "ucrReceiverMultipleStations" Me.ucrReceiverMultipleStations.Selector = Nothing @@ -270,10 +378,10 @@ Partial Class dlgClimSoft ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(8, 402) + Me.ucrBase.Location = New System.Drawing.Point(9, 407) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 14 ' 'dlgClimSoft @@ -281,25 +389,33 @@ Partial Class dlgClimSoft Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(408, 459) - Me.Controls.Add(Me.ucrChkUnstackData) - Me.Controls.Add(Me.ucrChkFlagsData) + Me.ClientSize = New System.Drawing.Size(438, 464) + Me.Controls.Add(Me.ucrChkImportFlagsMetadata) + Me.Controls.Add(Me.ucrChkImportElementsMetadata) + Me.Controls.Add(Me.ucrChkImportStationsMetadata) + Me.Controls.Add(Me.rdoMetadata) + Me.Controls.Add(Me.rdoData) + Me.Controls.Add(Me.ucrPnlOptions) + Me.Controls.Add(Me.btnMoreOptions) + Me.Controls.Add(Me.lblRecordsNum) + Me.Controls.Add(Me.btnCheckRecords) + Me.Controls.Add(Me.ucrCboQCStatus) + Me.Controls.Add(Me.lblSelectQCStatus) + Me.Controls.Add(Me.ucrCboTable) + Me.Controls.Add(Me.lblSelectTable) + Me.Controls.Add(Me.ucrChkDataDate) + Me.Controls.Add(Me.ucrDtpEndDataDate) + Me.Controls.Add(Me.ucrDtpStartDataDate) + Me.Controls.Add(Me.lblToDataDate) Me.Controls.Add(Me.lblConnection) - Me.Controls.Add(Me.ucrChkElements) - Me.Controls.Add(Me.ucrComboBoxElements) - Me.Controls.Add(Me.ucrComboBoxStations) - Me.Controls.Add(Me.ucrChkDateRange) - Me.Controls.Add(Me.ucrDtpEndDate) - Me.Controls.Add(Me.ucrDtpStartdate) - Me.Controls.Add(Me.ucrChkObservationData) - Me.Controls.Add(Me.lblEndDate) + Me.Controls.Add(Me.ucrCboElements) + Me.Controls.Add(Me.ucrCboStations) Me.Controls.Add(Me.ucrSelectorForClimSoft) - Me.Controls.Add(Me.lblStartDate) Me.Controls.Add(Me.ucrReceiverMultipleElements) - Me.Controls.Add(Me.lblStations) - Me.Controls.Add(Me.lblElements) + Me.Controls.Add(Me.lblSelectStations) + Me.Controls.Add(Me.lblSelectElements) Me.Controls.Add(Me.ucrReceiverMultipleStations) - Me.Controls.Add(Me.cmdEstablishConnection) + Me.Controls.Add(Me.btnConnection) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -313,23 +429,31 @@ Partial Class dlgClimSoft End Sub Friend WithEvents ucrBase As ucrButtons - Friend WithEvents cmdEstablishConnection As Button + Friend WithEvents btnConnection As Button Friend WithEvents ucrReceiverMultipleStations As ucrReceiverMultiple Friend WithEvents ucrReceiverMultipleElements As ucrReceiverMultiple - Friend WithEvents lblStations As Label - Friend WithEvents lblElements As Label - Friend WithEvents lblStartDate As Label + Friend WithEvents lblSelectStations As Label + Friend WithEvents lblSelectElements As Label Friend WithEvents ucrSelectorForClimSoft As ucrSelectorAddRemove - Friend WithEvents lblEndDate As Label Friend WithEvents ttClimsoft As ToolTip - Friend WithEvents ucrDtpEndDate As ucrDateTimePicker - Friend WithEvents ucrDtpStartdate As ucrDateTimePicker - Friend WithEvents ucrChkObservationData As ucrCheck - Friend WithEvents ucrChkDateRange As ucrCheck - Friend WithEvents ucrComboBoxStations As ucrInputComboBox - Friend WithEvents ucrComboBoxElements As ucrInputComboBox - Friend WithEvents ucrChkElements As ucrCheck + Friend WithEvents ucrCboStations As ucrInputComboBox + Friend WithEvents ucrCboElements As ucrInputComboBox Friend WithEvents lblConnection As Label - Friend WithEvents ucrChkFlagsData As ucrCheck - Friend WithEvents ucrChkUnstackData As ucrCheck -End Class + Friend WithEvents ucrChkDataDate As ucrCheck + Friend WithEvents ucrDtpEndDataDate As ucrDateTimePicker + Friend WithEvents ucrDtpStartDataDate As ucrDateTimePicker + Friend WithEvents lblToDataDate As Label + Friend WithEvents ucrCboTable As ucrInputComboBox + Friend WithEvents lblSelectTable As Label + Friend WithEvents ucrCboQCStatus As ucrInputComboBox + Friend WithEvents lblSelectQCStatus As Label + Friend WithEvents lblRecordsNum As Label + Friend WithEvents btnCheckRecords As Button + Friend WithEvents btnMoreOptions As Button + Friend WithEvents rdoMetadata As RadioButton + Friend WithEvents rdoData As RadioButton + Friend WithEvents ucrPnlOptions As UcrPanel + Friend WithEvents ucrChkImportElementsMetadata As ucrCheck + Friend WithEvents ucrChkImportStationsMetadata As ucrCheck + Friend WithEvents ucrChkImportFlagsMetadata As ucrCheck +End Class \ No newline at end of file diff --git a/instat/dlgClimSoft.vb b/instat/dlgClimSoft.vb index fd5aeac8f7a..c6113117e85 100644 --- a/instat/dlgClimSoft.vb +++ b/instat/dlgClimSoft.vb @@ -14,28 +14,22 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . -Imports instat + Imports instat.Translations +Imports RDotNet Public Class dlgClimSoft Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsRImportFromClimsoft As New RFunction + Private clsRImportClimsoftData, clsRImportClimsoftMetaData As New RFunction - 'the 2 dictionaries hold data for the station and elements comboboxes + 'the 4 dictionaries hold data for the station, elements, tables and QC comboboxes 'As of 28th August 2020, there is no direct way of getting the selected value from the custom combobox 'these are declared here to be used in getting the selected value - Private dctStationColumns As New Dictionary(Of String, String) - Private dctElementsColumns As New Dictionary(Of String, String) - - 'flag used by elements receiver to determine when not to clear itself and change its sql query - 'useful when form is reloaded, to let the elements reciever retain the elements selected - Private bIgnoreReceiverChanges As Boolean = False + Private dctStationCols, dctElementsCols, dctTables, dctQCStatuses As New Dictionary(Of String, String) Private Sub dlgClimSoft_Load(sender As Object, e As EventArgs) Handles MyBase.Load - bIgnoreReceiverChanges = True If bFirstLoad Then - bIgnoreReceiverChanges = False InitialiseDialog() bFirstLoad = False End If @@ -44,7 +38,6 @@ Public Class dlgClimSoft End If SetRCodeForControls(bReset) bReset = False - bIgnoreReceiverChanges = False CheckAndUpdateConnectionStatus() 'autoTranslate(Me) ' temporary commented, affects the connected text by overwriting it with wrong text End Sub @@ -52,221 +45,287 @@ Public Class dlgClimSoft Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 329 - 'stations combobox - dctStationColumns.Add("Station IDs", Chr(34) & "stationId" & Chr(34)) - dctStationColumns.Add("Station Names", Chr(34) & "stationName" & Chr(34)) - dctStationColumns.Add("Station Qualifiers", Chr(34) & "qualifier" & Chr(34)) - ucrComboBoxStations.SetParameter(New RParameter("stationfiltercolumn", 0)) - ucrComboBoxStations.SetItems(dctStationColumns) - ucrComboBoxStations.SetRDefault(Chr(34) & "stationId" & Chr(34)) - ucrComboBoxStations.bAllowNonConditionValues = False - ucrComboBoxStations.SetDropDownStyleAsNonEditable() - - 'stations receiver - ucrReceiverMultipleStations.SetParameter(New RParameter("stations", 1)) + '--------------------------------------- + 'tables + dctTables.Add("Initial", Chr(34) & "observationinitial" & Chr(34)) + dctTables.Add("Final", Chr(34) & "observationfinal" & Chr(34)) + ucrCboTable.SetParameter(New RParameter("table", 0)) + ucrCboTable.SetItems(dctTables) + ucrCboTable.bAllowNonConditionValues = False + ucrCboTable.SetDropDownStyleAsNonEditable() + ucrCboTable.SetLinkedDisplayControl(lblSelectTable) + '--------------------------------------- + + 'stations + '--------------------------------------- + dctStationCols.Add("Station IDs", Chr(34) & "stationId" & Chr(34)) + dctStationCols.Add("Station Names", Chr(34) & "stationName" & Chr(34)) + dctStationCols.Add("Station Qualifiers", Chr(34) & "qualifier" & Chr(34)) + ucrCboStations.SetParameter(New RParameter("station_filter_column", 1)) + ucrCboStations.SetItems(dctStationCols) + ucrCboStations.bAllowNonConditionValues = False + ucrCboStations.SetDropDownStyleAsNonEditable() + ucrCboElements.SetLinkedDisplayControl(lblSelectElements) + + ucrReceiverMultipleStations.SetParameter(New RParameter("stations", 2)) ucrReceiverMultipleStations.SetParameterIsString() ucrReceiverMultipleStations.Selector = ucrSelectorForClimSoft ucrReceiverMultipleStations.SetItemType("database_variables") ucrReceiverMultipleStations.strSelectorHeading = "Stations" - ucrReceiverMultipleStations.SetLinkedDisplayControl(lblStations) - - 'elements combobox - dctElementsColumns.Add("Element IDs", Chr(34) & "elementId" & Chr(34)) - dctElementsColumns.Add("Element Names", Chr(34) & "elementName" & Chr(34)) - dctElementsColumns.Add("Element Abbreviation", Chr(34) & "abbreviation" & Chr(34)) - dctElementsColumns.Add("Element Types", Chr(34) & "elementtype" & Chr(34)) - ucrComboBoxElements.SetParameter(New RParameter("elementfiltercolumn", 2)) - ucrComboBoxElements.SetItems(dctElementsColumns) - ucrComboBoxElements.SetRDefault(Chr(34) & "elementId" & Chr(34)) - ucrComboBoxElements.bAllowNonConditionValues = False - ucrComboBoxElements.SetDropDownStyleAsNonEditable() - - 'elements receiver - ucrReceiverMultipleElements.SetParameter(New RParameter("elements", 3)) + ucrReceiverMultipleStations.SetLinkedDisplayControl(lblSelectStations) + '--------------------------------------- + + 'elements + '--------------------------------------- + dctElementsCols.Add("Element IDs", Chr(34) & "elementId" & Chr(34)) + dctElementsCols.Add("Element Names", Chr(34) & "elementName" & Chr(34)) + dctElementsCols.Add("Element Abbreviation", Chr(34) & "abbreviation" & Chr(34)) + dctElementsCols.Add("Element Types", Chr(34) & "elementtype" & Chr(34)) + ucrCboElements.SetParameter(New RParameter("element_filter_column", 3)) + ucrCboElements.SetItems(dctElementsCols) + ucrCboElements.bAllowNonConditionValues = False + ucrCboElements.SetDropDownStyleAsNonEditable() + ucrCboElements.SetLinkedDisplayControl(lblSelectElements) + + ucrReceiverMultipleElements.SetParameter(New RParameter("elements", 4)) ucrReceiverMultipleElements.SetParameterIsString() ucrReceiverMultipleElements.Selector = ucrSelectorForClimSoft ucrReceiverMultipleElements.SetItemType("database_variables") ucrReceiverMultipleElements.strSelectorHeading = "Elements" - ucrReceiverMultipleElements.SetLinkedDisplayControl(lblElements) - - 'include observation data checkbox - ucrChkObservationData.SetText("Include Observation Data") - ucrChkObservationData.SetParameter(New RParameter("include_observation_data", 4)) - ucrChkObservationData.SetRDefault("FALSE") - - 'include flags data checkbox - ucrChkFlagsData.SetText("Include Observation Flags") - ucrChkFlagsData.SetParameter(New RParameter("include_observation_flags", 5)) - ucrChkFlagsData.SetRDefault("FALSE") - - 'include Unstack data checkbox. - 'parameter attached to it is determined by elements receiver no. of contents. Thus not directly set by the control - ucrChkUnstackData.SetText("Unstack Data") - 'ucrChkUnstackData.Checked = True - - 'include elements info checkbox - ucrChkElements.SetText("Include Elements Information") - ucrChkElements.SetParameter(New RParameter("include_elements_info", 7)) - ucrChkElements.SetRDefault("FALSE") - - 'date range checkbox - ucrChkDateRange.SetText("Select Date Range") - - 'start date datepicker - ucrDtpStartdate.SetParameter(New RParameter("start_date", 8)) - ucrDtpStartdate.SetParameterIsRDate() - ucrDtpStartdate.SetLinkedDisplayControl(lblStartDate) - - 'end date datepicker - ucrDtpEndDate.SetParameter(New RParameter("end_date", 9)) - ucrDtpEndDate.SetParameterIsRDate() - ucrDtpEndDate.SetLinkedDisplayControl(lblEndDate) - - 'linking observation data related controls to include observation data checkbox - ucrChkObservationData.AddToLinkedControls({ucrChkFlagsData, ucrChkUnstackData, ucrChkElements, ucrComboBoxElements, ucrReceiverMultipleElements}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - 'link date range checkbox - ucrChkObservationData.AddToLinkedControls({ucrChkDateRange}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - 'linking date pickers to date range checkbox - ucrChkDateRange.AddToLinkedControls({ucrDtpStartdate, ucrDtpEndDate}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrReceiverMultipleElements.SetLinkedDisplayControl(lblSelectElements) + '--------------------------------------- + + 'qc status + '--------------------------------------- + dctQCStatuses.Add("All", "-1") + dctQCStatuses.Add("Zero", "0") + dctQCStatuses.Add("One", "1") + dctQCStatuses.Add("Two", "2") + ucrCboQCStatus.SetParameter(New RParameter("qc_status", 5)) + ucrCboQCStatus.SetItems(dctQCStatuses) + ucrCboQCStatus.SetRDefault("-1") + ucrCboQCStatus.bAllowNonConditionValues = False + ucrCboQCStatus.SetDropDownStyleAsNonEditable() + ucrCboQCStatus.SetLinkedDisplayControl(lblSelectQCStatus) + '--------------------------------------- + + 'date range + '--------------------------------------- + ucrChkDataDate.SetText("Select Data Date") + + ucrDtpStartDataDate.SetParameter(New RParameter("start_date", 6)) + ucrDtpStartDataDate.SetParameterIsRDate() + ucrDtpStartDataDate.SetLinkedDisplayControl(lblToDataDate) + + ucrDtpEndDataDate.SetParameter(New RParameter("end_date", 7)) + ucrDtpEndDataDate.SetParameterIsRDate() + + ucrChkDataDate.AddToLinkedControls({ucrDtpStartDataDate, ucrDtpEndDataDate}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + '--------------------------------------- + + 'metadata controls + '--------------------------------------- + ucrChkImportStationsMetadata.SetText("Import All Stations Metadata") + ucrChkImportStationsMetadata.SetParameter(New RParameter("import_stations", 0)) + ucrChkImportStationsMetadata.SetRDefault("FALSE") + + ucrChkImportElementsMetadata.SetText("Import All Elements Metadata") + ucrChkImportElementsMetadata.SetParameter(New RParameter("import_elements", 2)) + ucrChkImportElementsMetadata.SetRDefault("FALSE") + + ucrChkImportFlagsMetadata.SetText("Import All Flags Metadata") + ucrChkImportFlagsMetadata.SetParameter(New RParameter("import_flags", 3)) + ucrChkImportFlagsMetadata.SetRDefault("FALSE") + '--------------------------------------- + + 'dialog options + '--------------------------------------- + ucrPnlOptions.AddRadioButton(rdoData) + ucrPnlOptions.AddRadioButton(rdoMetadata) + + ucrPnlOptions.AddFunctionNamesCondition(rdoData, frmMain.clsRLink.strInstatDataObject & "$import_climsoft_data") + ucrPnlOptions.AddFunctionNamesCondition(rdoMetadata, frmMain.clsRLink.strInstatDataObject & "$import_climsoft_metadata") + + + ucrPnlOptions.AddToLinkedControls({ucrCboTable, ucrCboQCStatus, ucrSelectorForClimSoft, ucrReceiverMultipleStations, ucrReceiverMultipleElements, ucrCboStations, ucrCboElements, ucrChkDataDate}, + {rdoData}, bNewLinkedAddRemoveParameter:=False, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkImportStationsMetadata, ucrChkImportElementsMetadata, ucrChkImportFlagsMetadata}, + {rdoMetadata}, bNewLinkedAddRemoveParameter:=False, bNewLinkedHideIfParameterMissing:=True) + + '--------------------------------------- End Sub Private Sub SetDefaults() - clsRImportFromClimsoft = New RFunction - clsRImportFromClimsoft.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_from_climsoft") - ucrBase.clsRsyntax.SetBaseRFunction(clsRImportFromClimsoft) + clsRImportClimsoftData = New RFunction + clsRImportClimsoftMetaData = New RFunction + + 'data command + '--------------------------------------- + clsRImportClimsoftData.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_climsoft_data") + clsRImportClimsoftData.AddParameter(strParameterName:="table", strParameterValue:=Chr(34) & "observationinitial" & Chr(34), iPosition:=0) + clsRImportClimsoftData.AddParameter(strParameterName:="station_filter_column", strParameterValue:=Chr(34) & "stationId" & Chr(34), iPosition:=1) + clsRImportClimsoftData.AddParameter(strParameterName:="element_filter_column", strParameterValue:=Chr(34) & "elementId" & Chr(34), iPosition:=3) + '--------------------------------------- + + 'metadata command + '--------------------------------------- + clsRImportClimsoftMetaData.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_climsoft_metadata") + '--------------------------------------- + + ucrBase.clsRsyntax.SetBaseRFunction(clsRImportClimsoftData) - ucrReceiverMultipleStations.SetMeAsReceiver() ucrSelectorForClimSoft.Reset() - ucrChkUnstackData.Checked = True - ucrChkDateRange.Checked = False + ucrReceiverMultipleStations.SetMeAsReceiver() + ucrChkDataDate.Checked = False + rdoData.Checked = True End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrComboBoxStations.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrReceiverMultipleStations.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrComboBoxElements.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrReceiverMultipleElements.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkObservationData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkFlagsData.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrChkElements.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrDtpStartdate.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrDtpEndDate.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - End Sub - Private Sub TestOKEnabled() - ucrBase.OKEnabled((Not ucrReceiverMultipleStations.IsEmpty() AndAlso Not ucrChkObservationData.Checked) OrElse (Not ucrReceiverMultipleElements.IsEmpty() AndAlso ucrChkObservationData.Checked)) - End Sub + 'data option + '--------------------------------------- + ucrCboStations.SetRCode(clsRImportClimsoftData, bReset) + ucrReceiverMultipleStations.SetRCode(clsRImportClimsoftData, bReset) - Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - SetDefaults() - SetRCodeForControls(True) - sdgImportFromClimSoft.Reset() - CheckAndUpdateConnectionStatus() - TestOKEnabled() + ucrCboElements.SetRCode(clsRImportClimsoftData, bReset) + ucrReceiverMultipleElements.SetRCode(clsRImportClimsoftData, bReset) + + ucrCboTable.SetRCode(clsRImportClimsoftData, bReset) + + ucrCboQCStatus.SetRCode(clsRImportClimsoftData, bReset) + + ucrDtpStartDataDate.SetRCode(clsRImportClimsoftData, bReset) + ucrDtpEndDataDate.SetRCode(clsRImportClimsoftData, bReset) + + 'data sub dialog + sdgClimsoft.SetRCode(clsRImportClimsoftData, bReset) + '--------------------------------------- + + 'metadata option + '--------------------------------------- + ucrChkImportStationsMetadata.SetRCode(clsRImportClimsoftMetaData, bReset) + ucrChkImportElementsMetadata.SetRCode(clsRImportClimsoftMetaData, bReset) + ucrChkImportFlagsMetadata.SetRCode(clsRImportClimsoftMetaData, bReset) + '--------------------------------------- End Sub - Private Sub btnEstablishConnection_Click(sender As Object, e As EventArgs) Handles cmdEstablishConnection.Click + Private Sub btnConnection_Click(sender As Object, e As EventArgs) Handles btnConnection.Click 'shows the database connect sub dialog and checks if connection has been established sdgImportFromClimSoft.ShowDialog() CheckAndUpdateConnectionStatus() ucrReceiverMultipleStations.Clear() + ucrReceiverMultipleElements.Clear() ucrReceiverMultipleStations.SetMeAsReceiver() End Sub - ''' - ''' constructs and sets the stations reciver SQL query - ''' - ''' returns true if receivers query was changed - Private Function SetStationsReceiverQuery() As Boolean - If dctStationColumns.Count < 1 Then - Return False - End If - - 'sql query to get station values of the selected column from station table - Dim strQuery As String - Dim strSelectedColumn As String = dctStationColumns.Item(ucrComboBoxStations.GetText).Trim("""") - - strQuery = "SELECT DISTINCT " & strSelectedColumn & " FROM station WHERE " & strSelectedColumn & " IS NOT NULL AND " & strSelectedColumn & " <> '';" - If ucrReceiverMultipleStations.strDatabaseQuery = strQuery Then - Return False - End If - ucrReceiverMultipleStations.Clear() - ucrReceiverMultipleStations.strDatabaseQuery = strQuery - Return True - End Function - - ''' - ''' constructs and sets elements receiver SQL query - ''' - ''' returns true if receivers query was changed - Private Function SetElementsRecieverQuery() As Boolean - If dctElementsColumns.Count < 1 Then - Return False - End If + Private Sub ucrPnlOption_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged + btnMoreOptions.Visible = rdoData.Checked + btnCheckRecords.Visible = rdoData.Checked + lblRecordsNum.Visible = rdoData.Checked + ucrBase.clsRsyntax.SetBaseRFunction(If(rdoData.Checked, clsRImportClimsoftData, clsRImportClimsoftMetaData)) + End Sub - 'sql query to get distinct element values of the selected column(obselement TABLE COLUMN) from the observationfinal table - Dim strQuery As String - strQuery = "SELECT DISTINCT obselement." & dctElementsColumns.Item(ucrComboBoxElements.GetText).Trim("""") & - " FROM observationfinal" & - " INNER JOIN obselement ON observationfinal.describedBy = obselement.elementId" & - " INNER JOIN station ON observationfinal.recordedFrom = station.stationId" - 'if stations have been specified, then get elements for those stations only - If Not ucrReceiverMultipleStations.IsEmpty Then - strQuery = strQuery & " WHERE " & "station." & dctStationColumns.Item(ucrComboBoxStations.GetText).Trim("""") & " IN (" & - String.Join(",", ucrReceiverMultipleStations.GetVariableNamesList(strQuotes:=Chr(39))) & ")" + Private Sub ucrCboStations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboStations.ControlValueChanged + If dctStationCols.Count < 1 Then + Exit Sub End If - strQuery &= ";" + SetRecieverQuery("station", dctStationCols.Item(ucrCboStations.GetText).Trim(""""), ucrReceiverMultipleStations) + 'set as selected receiver. will also execute the receiver's sql query + ucrReceiverMultipleStations.SetMeAsReceiver() + End Sub - If ucrReceiverMultipleElements.strDatabaseQuery = strQuery Then - Return False - End If - ucrReceiverMultipleElements.Clear() - ucrReceiverMultipleElements.strDatabaseQuery = strQuery - Return True - End Function - - Private Sub ucrComboBoxStations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrComboBoxStations.ControlValueChanged - If SetStationsReceiverQuery() Then - 'set as selected receiver. will also execute the receiver's sql query - ucrReceiverMultipleStations.SetMeAsReceiver() + Private Sub ucrCboElements_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrCboElements.ControlValueChanged + If dctElementsCols.Count < 1 Then + Exit Sub End If + SetRecieverQuery("obselement", dctElementsCols.Item(ucrCboElements.GetText).Trim(""""), ucrReceiverMultipleElements) + 'set as selected receiver. will also execute receiver's sql the query + ucrReceiverMultipleElements.SetMeAsReceiver() End Sub - Private Sub ucrReceiverMultipleStations_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleStations.ControlValueChanged - If Not bIgnoreReceiverChanges Then - SetElementsRecieverQuery() + + Private Sub ucrChkDataDate_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDataDate.ControlValueChanged + 'this forces the date pickers to write default parameter values to the Rfunction. + 'date picker controls have a problem of default date. + 'its not set by default until the user changes selected date + 'todo. in future, this may not be needed + If ucrChkDataDate.Checked Then + ucrDtpEndDataDate.OnControlValueChanged() + ucrDtpStartDataDate.OnControlValueChanged() End If End Sub - Private Sub ucrComboBoxElements_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrComboBoxElements.ControlValueChanged - If SetElementsRecieverQuery() Then - 'set as selected receiver. will also execute receiver's sql the query - ucrReceiverMultipleElements.SetMeAsReceiver() - End If + Private Sub btnMoreOptions_Click(sender As Object, e As EventArgs) Handles btnMoreOptions.Click + sdgClimsoft.ShowDialog() + lblRecordsNum.Text = "" End Sub - Private Sub ucrUnstackDataControlsValueChanged_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkUnstackData.ControlValueChanged, ucrReceiverMultipleElements.ControlValueChanged, ucrChkObservationData.ControlValueChanged - 'only change the receivers if the event was raised by ucrChkObservationData checkbox - If TypeOf ucrChangedControl Is ucrCheck Then - If ucrChkObservationData.Checked Then - ucrReceiverMultipleElements.SetMeAsReceiver() - Else - ucrReceiverMultipleStations.SetMeAsReceiver() + Private Sub btnCheckRecords_Click(sender As Object, e As EventArgs) Handles btnCheckRecords.Click + Try + lblRecordsNum.Text = "" + Dim strTableName As String = dctTables.Item(ucrCboTable.GetText).Trim("""") + Dim strStationColumn As String = dctStationCols.Item(ucrCboStations.GetText).Trim("""") + Dim strElementsColumn As String = dctElementsCols.Item(ucrCboElements.GetText).Trim("""") + Dim strStationsValues As String = String.Join(",", ucrReceiverMultipleStations.GetVariableNamesList(bWithQuotes:=True, strQuotes:="'")) + Dim strElementsValues As String = String.Join(",", ucrReceiverMultipleElements.GetVariableNamesList(bWithQuotes:=True, strQuotes:="'")) + Dim strQueryCondition As String = " INNER JOIN station ON " & strTableName & ".recordedFrom = station.stationId" & + " INNER JOIN obselement ON " & strTableName & ".describedBy = obselement.elementId WHERE" & + " station." & strStationColumn & " IN (" & strStationsValues & ")" & + " AND obselement." & strElementsColumn & " IN (" & strElementsValues & ")" + + Dim strQCStatus As String = If(dctQCStatuses.Item(ucrCboQCStatus.GetText) = "-1", "", dctQCStatuses.Item(ucrCboQCStatus.GetText)) + + If dctQCStatuses.Item(ucrCboQCStatus.GetText) <> "-1" Then + strQueryCondition = strQueryCondition & " AND qcStatus = " & dctQCStatuses.Item(ucrCboQCStatus.GetText) End If - End If - 'unstack observation data only when more than 1 element is selected - If ucrChkObservationData.Checked AndAlso ucrReceiverMultipleElements.GetVariableNamesAsList.Count > 1 Then - ucrChkUnstackData.Enabled = True - clsRImportFromClimsoft.AddParameter("unstack_data", If(ucrChkUnstackData.Checked, "TRUE", "FALSE"), iPosition:=6) - Else - ucrChkUnstackData.Enabled = False - clsRImportFromClimsoft.RemoveParameterByName("unstack_data") + If ucrChkDataDate.Checked Then + strQueryCondition = strQueryCondition & " AND obsDatetime >= '" & ucrDtpStartDataDate.DateValue.ToString("yyyy-MM-dd") & "' AND obsDatetime <= '" & ucrDtpEndDataDate.DateValue.ToString("yyyy-MM-dd") & "'" + End If + + Dim clsRowsCountRFunction As New RFunction + clsRowsCountRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_db_table_row_count") + clsRowsCountRFunction.AddParameter(strParameterName:="tableName", strParameterValue:=Chr(34) & strTableName & Chr(34)) + clsRowsCountRFunction.AddParameter(strParameterName:="query_condition", strParameterValue:=Chr(34) & strQueryCondition & Chr(34)) + + Dim expTemp As SymbolicExpression = frmMain.clsRLink.RunInternalScriptGetValue(clsRowsCountRFunction.ToScript()) + If expTemp IsNot Nothing Then + Dim recordsNum As Integer = expTemp.AsNumeric().FirstOrDefault() + lblRecordsNum.Text = recordsNum & " records found" + lblRecordsNum.ForeColor = If(recordsNum > 0, Color.Green, Color.Red) + End If + Catch ex As Exception + MessageBox.Show(Me, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + + Private Sub ucrControlsContents_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleStations.ControlContentsChanged, ucrReceiverMultipleElements.ControlContentsChanged, ucrCboTable.ControlContentsChanged, ucrCboQCStatus.ControlContentsChanged, ucrDtpStartDataDate.ControlContentsChanged, ucrDtpEndDataDate.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrChkImportStationsMetadata.ControlContentsChanged, ucrChkImportElementsMetadata.ControlContentsChanged, ucrChkImportFlagsMetadata.ControlContentsChanged + Dim bValid As Boolean = False + If rdoData.Checked Then + bValid = Not ucrReceiverMultipleStations.IsEmpty() AndAlso Not ucrReceiverMultipleElements.IsEmpty() AndAlso Not ucrCboTable.IsEmpty() + btnCheckRecords.Enabled = bValid + lblRecordsNum.Text = "" + ElseIf rdoMetadata.Checked Then + bValid = ucrChkImportStationsMetadata.Checked OrElse ucrChkImportElementsMetadata.Checked OrElse ucrChkImportFlagsMetadata.Checked End If + ucrBase.OKEnabled(bValid) End Sub - Private Sub ucrControlsContents_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMultipleStations.ControlContentsChanged, ucrReceiverMultipleElements.ControlContentsChanged, ucrChkObservationData.ControlContentsChanged, ucrChkUnstackData.ControlContentsChanged - TestOKEnabled() + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + sdgImportFromClimSoft.Reset() + CheckAndUpdateConnectionStatus() + End Sub + + Private Sub SetRecieverQuery(strTable As String, strSelectedColumn As String, ucrReceiverControl As ucrReceiverMultiple) + 'sql query to get values of the selected column from the table + Dim strQuery As String = "SELECT DISTINCT " & strSelectedColumn & " FROM " & strTable & " WHERE " & strSelectedColumn & " IS NOT NULL AND " & strSelectedColumn & " <> '';" + If ucrReceiverControl.strDatabaseQuery = strQuery Then + Exit Sub + End If + ucrReceiverControl.Clear() + ucrReceiverControl.strDatabaseQuery = strQuery End Sub Private Sub CheckAndUpdateConnectionStatus() @@ -277,18 +336,9 @@ Public Class dlgClimSoft lblConnection.Text = "No Connection" lblConnection.ForeColor = Color.Red ucrReceiverMultipleStations.Clear() + ucrReceiverMultipleElements.Clear() End If - autoTranslate(Me) End Sub - Private Sub ucrChkDateRange_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkDateRange.ControlValueChanged - 'this forces the date pickers to write default parameter values to the Rfunction. - 'date picker controls have a problem of default date. - 'its not set by default until the user changes selected date - 'todo. in future, this may not be needed - If ucrChkDateRange.Checked Then - ucrDtpEndDate.OnControlValueChanged() - ucrDtpStartdate.OnControlValueChanged() - End If - End Sub -End Class + +End Class \ No newline at end of file diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 741d4f7da58..ac9774d99bb 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -313,6 +313,12 @@ + + sdgClimsoft.vb + + + Form + sdgDefineAnnualRainfall.vb diff --git a/instat/sdgClimsoft.Designer.vb b/instat/sdgClimsoft.Designer.vb new file mode 100644 index 00000000000..0dc1103611d --- /dev/null +++ b/instat/sdgClimsoft.Designer.vb @@ -0,0 +1,259 @@ + +Partial Class sdgClimsoft + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.tbpTitles = New System.Windows.Forms.TabPage() + Me.grpMetadataToImport = New System.Windows.Forms.GroupBox() + Me.tbColumns = New System.Windows.Forms.TabPage() + Me.grpColumnsToInclude = New System.Windows.Forms.GroupBox() + Me.tbpMoreOptions = New System.Windows.Forms.TabControl() + Me.ucrBaseSubdialog = New instat.ucrButtonsSubdialogue() + Me.ucrChkIncludeQCLog = New instat.ucrCheck() + Me.ucrChkIncludeCapturedBy = New instat.ucrCheck() + Me.ucrChkIncludeQCStatus = New instat.ucrCheck() + Me.ucrChkIncludeLevel = New instat.ucrCheck() + Me.ucrChkIncludeElementAbbrv = New instat.ucrCheck() + Me.ucrChkIncludeStationName = New instat.ucrCheck() + Me.ucrChkIncludeAquistion = New instat.ucrCheck() + Me.ucrChkIncludeEntryForm = New instat.ucrCheck() + Me.ucrChkIncludeFlag = New instat.ucrCheck() + Me.ucrChkImportElementsMetadata = New instat.ucrCheck() + Me.ucrChkImportStationsMetadata = New instat.ucrCheck() + Me.tbpTitles.SuspendLayout() + Me.grpMetadataToImport.SuspendLayout() + Me.tbColumns.SuspendLayout() + Me.grpColumnsToInclude.SuspendLayout() + Me.tbpMoreOptions.SuspendLayout() + Me.SuspendLayout() + ' + 'tbpTitles + ' + Me.tbpTitles.Controls.Add(Me.grpMetadataToImport) + Me.tbpTitles.Location = New System.Drawing.Point(4, 22) + Me.tbpTitles.Name = "tbpTitles" + Me.tbpTitles.Padding = New System.Windows.Forms.Padding(3) + Me.tbpTitles.Size = New System.Drawing.Size(409, 281) + Me.tbpTitles.TabIndex = 2 + Me.tbpTitles.Tag = "" + Me.tbpTitles.Text = "Metadata" + Me.tbpTitles.UseVisualStyleBackColor = True + ' + 'grpMetadataToImport + ' + Me.grpMetadataToImport.Controls.Add(Me.ucrChkImportElementsMetadata) + Me.grpMetadataToImport.Controls.Add(Me.ucrChkImportStationsMetadata) + Me.grpMetadataToImport.Location = New System.Drawing.Point(6, 6) + Me.grpMetadataToImport.Name = "grpMetadataToImport" + Me.grpMetadataToImport.Size = New System.Drawing.Size(384, 243) + Me.grpMetadataToImport.TabIndex = 8 + Me.grpMetadataToImport.TabStop = False + Me.grpMetadataToImport.Text = "Metadata to Import" + ' + 'tbColumns + ' + Me.tbColumns.Controls.Add(Me.grpColumnsToInclude) + Me.tbColumns.Location = New System.Drawing.Point(4, 22) + Me.tbColumns.Name = "tbColumns" + Me.tbColumns.Padding = New System.Windows.Forms.Padding(3) + Me.tbColumns.Size = New System.Drawing.Size(409, 281) + Me.tbColumns.TabIndex = 3 + Me.tbColumns.Tag = "" + Me.tbColumns.Text = "Data" + Me.tbColumns.UseVisualStyleBackColor = True + ' + 'grpColumnsToInclude + ' + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeQCLog) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeCapturedBy) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeQCStatus) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeLevel) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeElementAbbrv) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeStationName) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeAquistion) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeEntryForm) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeFlag) + Me.grpColumnsToInclude.Location = New System.Drawing.Point(8, 10) + Me.grpColumnsToInclude.Name = "grpColumnsToInclude" + Me.grpColumnsToInclude.Size = New System.Drawing.Size(394, 265) + Me.grpColumnsToInclude.TabIndex = 32 + Me.grpColumnsToInclude.TabStop = False + Me.grpColumnsToInclude.Text = "Columns to Include" + ' + 'tbpMoreOptions + ' + Me.tbpMoreOptions.Controls.Add(Me.tbColumns) + Me.tbpMoreOptions.Controls.Add(Me.tbpTitles) + Me.tbpMoreOptions.Location = New System.Drawing.Point(-1, 4) + Me.tbpMoreOptions.Name = "tbpMoreOptions" + Me.tbpMoreOptions.SelectedIndex = 0 + Me.tbpMoreOptions.Size = New System.Drawing.Size(417, 307) + Me.tbpMoreOptions.TabIndex = 2 + ' + 'ucrBaseSubdialog + ' + Me.ucrBaseSubdialog.AutoSize = True + Me.ucrBaseSubdialog.Location = New System.Drawing.Point(88, 315) + Me.ucrBaseSubdialog.Name = "ucrBaseSubdialog" + Me.ucrBaseSubdialog.Size = New System.Drawing.Size(224, 29) + Me.ucrBaseSubdialog.TabIndex = 3 + ' + 'ucrChkIncludeQCLog + ' + Me.ucrChkIncludeQCLog.AutoSize = True + Me.ucrChkIncludeQCLog.Checked = True + Me.ucrChkIncludeQCLog.Location = New System.Drawing.Point(6, 186) + Me.ucrChkIncludeQCLog.Name = "ucrChkIncludeQCLog" + Me.ucrChkIncludeQCLog.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeQCLog.TabIndex = 21 + ' + 'ucrChkIncludeCapturedBy + ' + Me.ucrChkIncludeCapturedBy.AutoSize = True + Me.ucrChkIncludeCapturedBy.Checked = True + Me.ucrChkIncludeCapturedBy.Location = New System.Drawing.Point(6, 138) + Me.ucrChkIncludeCapturedBy.Name = "ucrChkIncludeCapturedBy" + Me.ucrChkIncludeCapturedBy.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeCapturedBy.TabIndex = 20 + ' + 'ucrChkIncludeQCStatus + ' + Me.ucrChkIncludeQCStatus.AutoSize = True + Me.ucrChkIncludeQCStatus.Checked = True + Me.ucrChkIncludeQCStatus.Location = New System.Drawing.Point(6, 162) + Me.ucrChkIncludeQCStatus.Name = "ucrChkIncludeQCStatus" + Me.ucrChkIncludeQCStatus.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeQCStatus.TabIndex = 0 + ' + 'ucrChkIncludeLevel + ' + Me.ucrChkIncludeLevel.AutoSize = True + Me.ucrChkIncludeLevel.Checked = True + Me.ucrChkIncludeLevel.Location = New System.Drawing.Point(6, 90) + Me.ucrChkIncludeLevel.Name = "ucrChkIncludeLevel" + Me.ucrChkIncludeLevel.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeLevel.TabIndex = 19 + ' + 'ucrChkIncludeElementAbbrv + ' + Me.ucrChkIncludeElementAbbrv.AutoSize = True + Me.ucrChkIncludeElementAbbrv.Checked = True + Me.ucrChkIncludeElementAbbrv.Location = New System.Drawing.Point(6, 42) + Me.ucrChkIncludeElementAbbrv.Name = "ucrChkIncludeElementAbbrv" + Me.ucrChkIncludeElementAbbrv.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeElementAbbrv.TabIndex = 18 + ' + 'ucrChkIncludeStationName + ' + Me.ucrChkIncludeStationName.AutoSize = True + Me.ucrChkIncludeStationName.Checked = True + Me.ucrChkIncludeStationName.Location = New System.Drawing.Point(6, 20) + Me.ucrChkIncludeStationName.Name = "ucrChkIncludeStationName" + Me.ucrChkIncludeStationName.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeStationName.TabIndex = 17 + ' + 'ucrChkIncludeAquistion + ' + Me.ucrChkIncludeAquistion.AutoSize = True + Me.ucrChkIncludeAquistion.Checked = True + Me.ucrChkIncludeAquistion.Location = New System.Drawing.Point(6, 66) + Me.ucrChkIncludeAquistion.Name = "ucrChkIncludeAquistion" + Me.ucrChkIncludeAquistion.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeAquistion.TabIndex = 16 + ' + 'ucrChkIncludeEntryForm + ' + Me.ucrChkIncludeEntryForm.AutoSize = True + Me.ucrChkIncludeEntryForm.Checked = True + Me.ucrChkIncludeEntryForm.Location = New System.Drawing.Point(6, 114) + Me.ucrChkIncludeEntryForm.Name = "ucrChkIncludeEntryForm" + Me.ucrChkIncludeEntryForm.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeEntryForm.TabIndex = 15 + ' + 'ucrChkIncludeFlag + ' + Me.ucrChkIncludeFlag.AutoSize = True + Me.ucrChkIncludeFlag.Checked = True + Me.ucrChkIncludeFlag.Location = New System.Drawing.Point(7, 210) + Me.ucrChkIncludeFlag.Name = "ucrChkIncludeFlag" + Me.ucrChkIncludeFlag.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeFlag.TabIndex = 14 + ' + 'ucrChkImportElementsMetadata + ' + Me.ucrChkImportElementsMetadata.AutoSize = True + Me.ucrChkImportElementsMetadata.Checked = True + Me.ucrChkImportElementsMetadata.Location = New System.Drawing.Point(0, 46) + Me.ucrChkImportElementsMetadata.Name = "ucrChkImportElementsMetadata" + Me.ucrChkImportElementsMetadata.Size = New System.Drawing.Size(315, 23) + Me.ucrChkImportElementsMetadata.TabIndex = 20 + ' + 'ucrChkImportStationsMetadata + ' + Me.ucrChkImportStationsMetadata.AutoSize = True + Me.ucrChkImportStationsMetadata.Checked = True + Me.ucrChkImportStationsMetadata.Location = New System.Drawing.Point(0, 22) + Me.ucrChkImportStationsMetadata.Name = "ucrChkImportStationsMetadata" + Me.ucrChkImportStationsMetadata.Size = New System.Drawing.Size(315, 23) + Me.ucrChkImportStationsMetadata.TabIndex = 19 + ' + 'sdgClimsoft + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(417, 348) + Me.Controls.Add(Me.ucrBaseSubdialog) + Me.Controls.Add(Me.tbpMoreOptions) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "sdgClimsoft" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "More Climsoft Options" + Me.tbpTitles.ResumeLayout(False) + Me.grpMetadataToImport.ResumeLayout(False) + Me.grpMetadataToImport.PerformLayout() + Me.tbColumns.ResumeLayout(False) + Me.grpColumnsToInclude.ResumeLayout(False) + Me.grpColumnsToInclude.PerformLayout() + Me.tbpMoreOptions.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrBaseSubdialog As ucrButtonsSubdialogue + Friend WithEvents tbpTitles As TabPage + Friend WithEvents grpMetadataToImport As GroupBox + Friend WithEvents tbColumns As TabPage + Friend WithEvents ucrChkIncludeQCStatus As ucrCheck + Friend WithEvents tbpMoreOptions As TabControl + Friend WithEvents grpColumnsToInclude As GroupBox + Friend WithEvents ucrChkIncludeFlag As ucrCheck + Friend WithEvents ucrChkIncludeAquistion As ucrCheck + Friend WithEvents ucrChkIncludeEntryForm As ucrCheck + Friend WithEvents ucrChkIncludeElementAbbrv As ucrCheck + Friend WithEvents ucrChkIncludeStationName As ucrCheck + Friend WithEvents ucrChkImportElementsMetadata As ucrCheck + Friend WithEvents ucrChkImportStationsMetadata As ucrCheck + Friend WithEvents ucrChkIncludeCapturedBy As ucrCheck + Friend WithEvents ucrChkIncludeLevel As ucrCheck + Friend WithEvents ucrChkIncludeQCLog As ucrCheck +End Class \ No newline at end of file diff --git a/instat/sdgClimsoft.vb b/instat/sdgClimsoft.vb new file mode 100644 index 00000000000..d6a61a9bb2a --- /dev/null +++ b/instat/sdgClimsoft.vb @@ -0,0 +1,112 @@ +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . +Imports instat.Translations + +Public Class sdgClimsoft + + Private bControlsInitialised As Boolean = False + Private Sub sdgClimsoft_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + End Sub + + Private Sub InitialiseControls() + + If bControlsInitialised Then + Exit Sub + End If + + 'Columns to include + '--------------------------------------- + ucrChkIncludeStationName.SetText("Station Name") + ucrChkIncludeStationName.SetParameter(New RParameter("include_station_name", 13)) + ucrChkIncludeStationName.SetRDefault("TRUE") + + ucrChkIncludeElementAbbrv.SetText("Element Abbreviation") + ucrChkIncludeElementAbbrv.SetParameter(New RParameter("include_element_abbreviation", 14)) + ucrChkIncludeElementAbbrv.SetRDefault("TRUE") + + ucrChkIncludeAquistion.SetText("Acquisition Type") + ucrChkIncludeAquistion.SetParameter(New RParameter("include_acquisition_type", 15)) + ucrChkIncludeAquistion.SetRDefault("TRUE") + + ucrChkIncludeLevel.SetText("Level") + ucrChkIncludeLevel.SetParameter(New RParameter("include_level", 16)) + ucrChkIncludeLevel.SetRDefault("TRUE") + + ucrChkIncludeEntryForm.SetText("Entry Form") + ucrChkIncludeEntryForm.SetParameter(New RParameter("include_entry_form", 17)) + ucrChkIncludeEntryForm.SetRDefault("TRUE") + + ucrChkIncludeCapturedBy.SetText("Captured By (user)") + ucrChkIncludeCapturedBy.SetParameter(New RParameter("include_captured_by", 18)) + ucrChkIncludeCapturedBy.SetRDefault("TRUE") + + ucrChkIncludeQCStatus.SetText("QC Status") + ucrChkIncludeQCStatus.SetParameter(New RParameter("include_qc_status", 19)) + ucrChkIncludeQCStatus.SetRDefault("TRUE") + + ucrChkIncludeQCLog.SetText("QC Log") + ucrChkIncludeQCLog.SetParameter(New RParameter("include_qc_log", 20)) + ucrChkIncludeQCLog.SetRDefault("TRUE") + + ucrChkIncludeFlag.SetText("Flag") + ucrChkIncludeFlag.SetParameter(New RParameter("include_flag", 21)) + ucrChkIncludeFlag.SetRDefault("TRUE") + + '--------------------------------------- + + 'Metadata + '--------------------------------------- + ucrChkImportStationsMetadata.SetText("Selected Stations") + ucrChkImportStationsMetadata.SetParameter(New RParameter("import_selected_stations_metadata", 12)) + ucrChkImportStationsMetadata.SetRDefault("TRUE") + + ucrChkImportElementsMetadata.SetText("Selected Elements") + ucrChkImportElementsMetadata.SetParameter(New RParameter("import_selected_elements_metadata", 13)) + ucrChkImportElementsMetadata.SetRDefault("TRUE") + '--------------------------------------- + + bControlsInitialised = True + + End Sub + + Public Sub SetRCode(clsRFunction As RFunction, Optional bReset As Boolean = True) + 'initialise controls if not initialised + InitialiseControls() + + 'Columns + '--------------------------------------- + ucrChkIncludeStationName.SetRCode(clsRFunction, bReset) + ucrChkIncludeElementAbbrv.SetRCode(clsRFunction, bReset) + ucrChkIncludeAquistion.SetRCode(clsRFunction, bReset) + ucrChkIncludeLevel.SetRCode(clsRFunction, bReset) + ucrChkIncludeEntryForm.SetRCode(clsRFunction, bReset) + ucrChkIncludeCapturedBy.SetRCode(clsRFunction, bReset) + ucrChkIncludeQCStatus.SetRCode(clsRFunction, bReset) + ucrChkIncludeQCLog.SetRCode(clsRFunction, bReset) + ucrChkIncludeFlag.SetRCode(clsRFunction, bReset) + '--------------------------------------- + + 'Metadata + '--------------------------------------- + ucrChkImportStationsMetadata.SetRCode(clsRFunction, bReset) + ucrChkImportElementsMetadata.SetRCode(clsRFunction, bReset) + '--------------------------------------- + + End Sub + + +End Class \ No newline at end of file diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 7bf6274f247..95c44c5c065 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -1848,6 +1848,248 @@ DataBook$set("public", "database_disconnect", function() { } ) +#Gets the row count of the table. +DataBook$set("public", "get_db_table_row_count", function(tableName, query_condition = NULL) { + con <- self$get_database_connection() + if(is.null(con)){ + stop("No database connection") + } + + if(is.null(query_condition)){ + query_condition <- "" + } + + out <- DBI::dbGetQuery(con, paste0("SELECT COUNT(*) as result FROM ",tableName," ", query_condition, ";" )) + return(out$result) + +}) + +#Imports Climsoft metadata. +DataBook$set("public", "import_climsoft_metadata", function(import_stations = FALSE, import_elements = FALSE, import_flags = FALSE) { + + if(!import_stations || !import_elements){ + stop("No metadata selected for import") + } + + con <- self$get_database_connection() + if(is.null(con)){ + stop("No database connection") + } + + #imports metadata + #-------------------------------- + data_list <- list() + + if(import_stations){ + stations_metadata_name <- next_default_item("stations_metadata", self$get_data_names(), include_index = FALSE) + #todo.(22/03/2023) 2 fields have been intentionally left out because they are yet to be released to Climsoft users. Namely; wsi and gtsWSI + #include them once the new Climsoft release has been supplied to users + data_list[[stations_metadata_name]] <- DBI::dbGetQuery(con, "SELECT stationId AS station_id, stationName AS station_name, wmoid, icaoid, latitude, longitude, elevation, qualifier, geoLocationMethod AS geo_location_method, geoLocationAccuracy AS geo_location_accuracy, openingDatetime AS opening_date_time, closingDatetime AS closing_date_time, authority, adminRegion AS admin_region, drainageBasin AS drainage_basin, wacaSelection AS waca_selection, cptSelection AS cpt_selection, stationOperational AS station_Operational, country AS country FROM station;") + } + + if(import_elements){ + elements_metadata_name <- next_default_item("elements_metadata", self$get_data_names(), include_index = FALSE) + data_list[[elements_metadata_name]] <- DBI::dbGetQuery(con, "SELECT elementId AS element_id, elementName AS element_name, abbreviation, description, elementtype AS element_type, upperLimit AS upper_limit , lowerLimit AS lower_limit, units FROM obselement;") + } + + if(import_flags){ + flags_metadata_name <- next_default_item("flags_metadata", self$get_data_names(), include_index = FALSE) + data_list[[flags_metadata_name]] <- DBI::dbGetQuery(con, "SELECT characterSymbol AS flag_name, description FROM flags;") + + } + + self$import_data(data_tables = data_list) + #-------------------------------- + + #transform imported metadata + #-------------------------------- + if(import_stations){ + self$convert_column_to_type(data_name = stations_metadata_name, col_names = c("station_id","station_name","qualifier","authority","admin_region","drainage_basin","station_Operational","country"), to_type = "factor") + } + + if(import_elements){ + self$convert_column_to_type(data_name = elements_metadata_name, col_names = c("element_id","element_name","abbreviation","element_type"), to_type = "factor") + } + + if(import_flags){ + self$convert_column_to_type(data_name = flags_metadata_name, col_names = c("flag_name"), to_type = "factor") + } + #-------------------------------- + +}) + + +#imports data from climsoft observation tables; initial or final. +#imports selected stations and elements metadata +DataBook$set("public", "import_climsoft_data", function(tableName, + station_filter_column, stations = c(), + element_filter_column, elements = c(), + qc_status = -1, start_date = NULL, end_date = NULL, + include_station_name = TRUE, include_element_abbreviation = TRUE, include_qc_status = TRUE, + include_acquisition_type = TRUE, include_flag = TRUE, include_entry_form = TRUE, + include_qc_log = TRUE, include_captured_by = TRUE, include_level = TRUE, + import_selected_stations_metadata = TRUE, import_selected_elements_metadata = TRUE) { + #connection and parameter checks + #-------------------------------- + con <- self$get_database_connection() + if(is.null(con)){ + stop("No database connection") + } + + if(missing(tableName) || missing(station_filter_column) || missing(element_filter_column) || length(stations) == 0 || length(elements) == 0){ + stop("Missing parameters. tableName, station_filter_column, element_filter_column, stations and elements must be supplied") + } + + if (!is.null(start_date) && !lubridate::is.Date(start_date) ) { + stop("start_date must be of type Date.") + } + + if (!is.null(end_date) && !lubridate::is.Date(end_date) ) { + stop("start_date must be of type Date.") + } + #-------------------------------- + + #selects + #-------------------------------- + sql_select <- paste0(tableName,".recordedFrom AS station_id") + + if(include_station_name){ + sql_select <-paste0(sql_select,", station.stationName AS station_name") + } + + sql_select <-paste0(sql_select, ", ", tableName,".describedBy AS element_id") + + if(include_element_abbreviation){ + sql_select <-paste0(sql_select,", obselement.abbreviation AS element_abbrv") + } + + if(include_acquisition_type){ + sql_select <-paste0(sql_select,", ", tableName,".acquisitionType"," AS acquisition_type") + } + + if(include_level){ + sql_select <-paste0(sql_select,", ", tableName,".obsLevel"," AS level") + } + + if(include_entry_form){ + sql_select <-paste0(sql_select,", ", tableName,".dataForm"," AS entry_form") + } + + if(include_captured_by){ + sql_select <-paste0(sql_select,", ", tableName,".capturedBy"," AS captured_by") + } + + if(include_qc_status){ + sql_select <-paste0(sql_select,", ", tableName,".qcStatus"," AS qc_status") + } + + sql_select <-paste0(sql_select,", ", tableName,".obsDatetime AS date_time") + + if(include_qc_log){ + sql_select <-paste0(sql_select,", ", tableName,".qcTypeLog"," AS qc_log") + } + + if(include_flag){ + sql_select <-paste0(sql_select,", ", tableName,".flag"," AS flag") + } + + sql_select <-paste0(sql_select,", ", tableName,".obsValue AS value") + + sql_select<- paste0("SELECT ", sql_select, " FROM ", tableName, + " INNER JOIN station ON ", tableName, ".recordedFrom = station.stationId", + " INNER JOIN obselement ON ",tableName,".describedBy = obselement.elementId") + #-------------------------------- + + #filters + #-------------------------------- + sql_stations_filter <- paste0(" station.", station_filter_column, " IN ", paste0("(", paste0("'", stations, "'", collapse = ", "), ")")) + sql_elements_filter <- paste0(" obselement.", element_filter_column, " IN ", paste0("(", paste0("'", elements, "'", collapse = ", "), ")")) + + sql_filter <- sql_stations_filter + sql_filter <- paste0(sql_filter," AND ",sql_elements_filter) + + if(qc_status>-1){ + sql_filter <- paste0(sql_filter," AND qcStatus = ", qc_status) + } + + if (!is.null(start_date)) { + sql_filter = paste0(sql_filter," AND obsDatetime >= ", sQuote(format(start_date, format = "%Y-%m-%d"))) + } + + if (!is.null(end_date)) { + sql_filter <- paste0(sql_filter," AND obsDatetime <=", sQuote(format(end_date, format = "%Y-%m-%d"))) + } + + sql_filter<- paste0(" WHERE ",sql_filter) + #-------------------------------- + + #order by + #-------------------------------- + sql_order_by <- paste0(" ORDER BY ",tableName,".recordedFrom, ",tableName, ".describedBy, ",tableName, ".obsDatetime",";") + #-------------------------------- + + #import data + #-------------------------------- + data_list <- list() + + if(import_selected_stations_metadata){ + stations_metadata_name <- next_default_item("stations_metadata", self$get_data_names(), include_index = FALSE) + data_list[[stations_metadata_name]] <- DBI::dbGetQuery(con, paste0("SELECT * FROM station WHERE", sql_stations_filter)) + } + + if(import_selected_elements_metadata){ + elements_metadata_name <- next_default_item("elements_metadata", self$get_data_names(), include_index = FALSE) + data_list[[elements_metadata_name]] <- DBI::dbGetQuery(con, paste0("SELECT * FROM obselement WHERE", sql_elements_filter)) + } + + observations_data_name <- next_default_item("observations_data", self$get_data_names(), include_index = FALSE) + data_list[[observations_data_name]] <- DBI::dbGetQuery(con,paste0(sql_select, sql_filter, sql_order_by)) + + + self$import_data(data_tables = data_list) + #-------------------------------- + + #transform imported data + #-------------------------------- + self$convert_column_to_type(data_name = observations_data_name, col_names = c("station_id","element_id"), to_type = "factor") + + if(include_station_name){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "station_name", to_type = "factor") + } + + if(include_element_abbreviation){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "element_abbrv", to_type = "factor") + } + + if(include_qc_status){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "qc_status", to_type = "factor") + } + + if(include_acquisition_type){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "acquisition_type", to_type = "factor") + } + + if(include_level){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "level", to_type = "factor") + } + + if(include_flag){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "flag", to_type = "factor") + } + + if(include_entry_form){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "entry_form", to_type = "factor") + } + + #todo. should this be done at this point?? Keeping in mind that we may have hourly data + #create a plain date column from the observation data datetime column values + obsdate <- self$get_columns_from_data(data_name = observations_data_name, col_names = "date_time", use_current_filter = FALSE) + self$add_columns_to_data(data_name = observations_data_name, col_name = "date", col_data = as.Date(x = obsdate), before = FALSE, adjacent_column = "date_time") + #-------------------------------- + +}) + +#TODO. Deprecated. Delete this after after deleting the import from climsoft wizard dialog DataBook$set("public", "import_from_climsoft", function(stationfiltercolumn = "stationId", stations = c(), elementfiltercolumn = "elementId", elements = c(), include_observation_data = FALSE, include_observation_flags = FALSE, unstack_data = FALSE, include_elements_info = FALSE, start_date = NULL, end_date = NULL) { #need to perform checks here con <- self$get_database_connection() From d1af34c2291218f54467d081b7ce6db8508b6a04 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 23 Jul 2024 05:23:02 +0300 Subject: [PATCH 83/83] Made suggested changes --- instat/dlgClimSoft.Designer.vb | 34 ++-- instat/dlgClimSoft.vb | 15 +- instat/instat.vbproj | 3 + instat/sdgClimsoft.Designer.vb | 156 ++++++++++++------ instat/sdgClimsoft.resx | 120 ++++++++++++++ instat/sdgClimsoft.vb | 62 ++++--- .../static/InstatObject/R/instat_object_R6.R | 58 ++++--- 7 files changed, 336 insertions(+), 112 deletions(-) create mode 100644 instat/sdgClimsoft.resx diff --git a/instat/dlgClimSoft.Designer.vb b/instat/dlgClimSoft.Designer.vb index 18e11098e6a..1c5b32afda8 100644 --- a/instat/dlgClimSoft.Designer.vb +++ b/instat/dlgClimSoft.Designer.vb @@ -67,6 +67,7 @@ Partial Class dlgClimSoft Me.ucrReceiverMultipleElements = New instat.ucrReceiverMultiple() Me.ucrReceiverMultipleStations = New instat.ucrReceiverMultiple() Me.ucrBase = New instat.ucrButtons() + Me.ucrChKUnstackData = New instat.ucrCheck() Me.SuspendLayout() ' 'btnConnection @@ -126,7 +127,7 @@ Partial Class dlgClimSoft ' Me.ucrChkDataDate.AutoSize = True Me.ucrChkDataDate.Checked = False - Me.ucrChkDataDate.Location = New System.Drawing.Point(9, 289) + Me.ucrChkDataDate.Location = New System.Drawing.Point(9, 317) Me.ucrChkDataDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrChkDataDate.Name = "ucrChkDataDate" Me.ucrChkDataDate.Size = New System.Drawing.Size(169, 23) @@ -138,7 +139,7 @@ Partial Class dlgClimSoft Me.ucrDtpEndDataDate.AutoSize = True Me.ucrDtpEndDataDate.DateValue = New Date(2021, 5, 18, 16, 45, 8, 379) Me.ucrDtpEndDataDate.Format = "dd MMM yyyy" - Me.ucrDtpEndDataDate.Location = New System.Drawing.Point(156, 312) + Me.ucrDtpEndDataDate.Location = New System.Drawing.Point(156, 340) Me.ucrDtpEndDataDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrDtpEndDataDate.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) Me.ucrDtpEndDataDate.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) @@ -152,7 +153,7 @@ Partial Class dlgClimSoft Me.ucrDtpStartDataDate.AutoSize = True Me.ucrDtpStartDataDate.DateValue = New Date(2021, 5, 18, 16, 45, 8, 408) Me.ucrDtpStartDataDate.Format = "dd MMM yyyy" - Me.ucrDtpStartDataDate.Location = New System.Drawing.Point(23, 313) + Me.ucrDtpStartDataDate.Location = New System.Drawing.Point(23, 341) Me.ucrDtpStartDataDate.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrDtpStartDataDate.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) Me.ucrDtpStartDataDate.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) @@ -187,7 +188,7 @@ Partial Class dlgClimSoft ' Me.lblToDataDate.AutoSize = True Me.lblToDataDate.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblToDataDate.Location = New System.Drawing.Point(130, 315) + Me.lblToDataDate.Location = New System.Drawing.Point(130, 345) Me.lblToDataDate.Name = "lblToDataDate" Me.lblToDataDate.Size = New System.Drawing.Size(20, 13) Me.lblToDataDate.TabIndex = 20 @@ -218,7 +219,7 @@ Partial Class dlgClimSoft 'btnCheckRecords ' Me.btnCheckRecords.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnCheckRecords.Location = New System.Drawing.Point(6, 376) + Me.btnCheckRecords.Location = New System.Drawing.Point(6, 404) Me.btnCheckRecords.Name = "btnCheckRecords" Me.btnCheckRecords.Size = New System.Drawing.Size(139, 23) Me.btnCheckRecords.TabIndex = 28 @@ -230,7 +231,7 @@ Partial Class dlgClimSoft Me.lblRecordsNum.AutoSize = True Me.lblRecordsNum.ForeColor = System.Drawing.Color.Red Me.lblRecordsNum.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblRecordsNum.Location = New System.Drawing.Point(156, 380) + Me.lblRecordsNum.Location = New System.Drawing.Point(156, 408) Me.lblRecordsNum.Name = "lblRecordsNum" Me.lblRecordsNum.Size = New System.Drawing.Size(64, 13) Me.lblRecordsNum.TabIndex = 29 @@ -239,11 +240,11 @@ Partial Class dlgClimSoft 'btnMoreOptions ' Me.btnMoreOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnMoreOptions.Location = New System.Drawing.Point(5, 345) + Me.btnMoreOptions.Location = New System.Drawing.Point(5, 373) Me.btnMoreOptions.Name = "btnMoreOptions" Me.btnMoreOptions.Size = New System.Drawing.Size(139, 23) Me.btnMoreOptions.TabIndex = 31 - Me.btnMoreOptions.Text = "More options" + Me.btnMoreOptions.Text = "Options" Me.btnMoreOptions.UseVisualStyleBackColor = True ' 'rdoMetadata @@ -378,18 +379,30 @@ Partial Class dlgClimSoft ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(9, 407) + Me.ucrBase.Location = New System.Drawing.Point(9, 444) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 14 ' + 'ucrChKUnstackData + ' + Me.ucrChKUnstackData.AutoSize = True + Me.ucrChKUnstackData.Checked = False + Me.ucrChKUnstackData.Location = New System.Drawing.Point(8, 289) + Me.ucrChKUnstackData.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrChKUnstackData.Name = "ucrChKUnstackData" + Me.ucrChKUnstackData.Size = New System.Drawing.Size(169, 23) + Me.ucrChKUnstackData.TabIndex = 38 + Me.ttClimsoft.SetToolTip(Me.ucrChKUnstackData, "Select Observation Data Date Range") + ' 'dlgClimSoft ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(438, 464) + Me.ClientSize = New System.Drawing.Size(438, 505) + Me.Controls.Add(Me.ucrChKUnstackData) Me.Controls.Add(Me.ucrChkImportFlagsMetadata) Me.Controls.Add(Me.ucrChkImportElementsMetadata) Me.Controls.Add(Me.ucrChkImportStationsMetadata) @@ -456,4 +469,5 @@ Partial Class dlgClimSoft Friend WithEvents ucrChkImportElementsMetadata As ucrCheck Friend WithEvents ucrChkImportStationsMetadata As ucrCheck Friend WithEvents ucrChkImportFlagsMetadata As ucrCheck + Friend WithEvents ucrChKUnstackData As ucrCheck End Class \ No newline at end of file diff --git a/instat/dlgClimSoft.vb b/instat/dlgClimSoft.vb index c6113117e85..b448a049de6 100644 --- a/instat/dlgClimSoft.vb +++ b/instat/dlgClimSoft.vb @@ -109,9 +109,16 @@ Public Class dlgClimSoft ucrCboQCStatus.SetLinkedDisplayControl(lblSelectQCStatus) '--------------------------------------- + 'Unstack data + '--------------------------------------- + ucrChKUnstackData.SetText("Unstack Data") + ucrChKUnstackData.SetParameter(New RParameter("unstack_data", 13)) + ucrChKUnstackData.SetRDefault("FALSE") + '--------------------------------------- + 'date range '--------------------------------------- - ucrChkDataDate.SetText("Select Data Date") + ucrChkDataDate.SetText("Select Dates") ucrDtpStartDataDate.SetParameter(New RParameter("start_date", 6)) ucrDtpStartDataDate.SetParameterIsRDate() @@ -147,7 +154,7 @@ Public Class dlgClimSoft ucrPnlOptions.AddFunctionNamesCondition(rdoMetadata, frmMain.clsRLink.strInstatDataObject & "$import_climsoft_metadata") - ucrPnlOptions.AddToLinkedControls({ucrCboTable, ucrCboQCStatus, ucrSelectorForClimSoft, ucrReceiverMultipleStations, ucrReceiverMultipleElements, ucrCboStations, ucrCboElements, ucrChkDataDate}, + ucrPnlOptions.AddToLinkedControls({ucrCboTable, ucrCboQCStatus, ucrSelectorForClimSoft, ucrReceiverMultipleStations, ucrReceiverMultipleElements, ucrCboStations, ucrCboElements, ucrChkDataDate, ucrChKUnstackData}, {rdoData}, bNewLinkedAddRemoveParameter:=False, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrChkImportStationsMetadata, ucrChkImportElementsMetadata, ucrChkImportFlagsMetadata}, {rdoMetadata}, bNewLinkedAddRemoveParameter:=False, bNewLinkedHideIfParameterMissing:=True) @@ -163,7 +170,7 @@ Public Class dlgClimSoft 'data command '--------------------------------------- clsRImportClimsoftData.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_climsoft_data") - clsRImportClimsoftData.AddParameter(strParameterName:="table", strParameterValue:=Chr(34) & "observationinitial" & Chr(34), iPosition:=0) + clsRImportClimsoftData.AddParameter(strParameterName:="table", strParameterValue:=Chr(34) & "observationfinal" & Chr(34), iPosition:=0) clsRImportClimsoftData.AddParameter(strParameterName:="station_filter_column", strParameterValue:=Chr(34) & "stationId" & Chr(34), iPosition:=1) clsRImportClimsoftData.AddParameter(strParameterName:="element_filter_column", strParameterValue:=Chr(34) & "elementId" & Chr(34), iPosition:=3) '--------------------------------------- @@ -193,6 +200,8 @@ Public Class dlgClimSoft ucrCboTable.SetRCode(clsRImportClimsoftData, bReset) + ucrChKUnstackData.SetRCode(clsRImportClimsoftData, bReset) + ucrCboQCStatus.SetRCode(clsRImportClimsoftData, bReset) ucrDtpStartDataDate.SetRCode(clsRImportClimsoftData, bReset) diff --git a/instat/instat.vbproj b/instat/instat.vbproj index ac9774d99bb..7670f979bf2 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -3206,6 +3206,9 @@ dlgThreeVariablePivotTable.vb + + sdgClimsoft.vb + sdgDefineAnnualRainfall.vb diff --git a/instat/sdgClimsoft.Designer.vb b/instat/sdgClimsoft.Designer.vb index 0dc1103611d..66902102eb5 100644 --- a/instat/sdgClimsoft.Designer.vb +++ b/instat/sdgClimsoft.Designer.vb @@ -24,10 +24,10 @@ Partial Class sdgClimsoft Private Sub InitializeComponent() Me.tbpTitles = New System.Windows.Forms.TabPage() Me.grpMetadataToImport = New System.Windows.Forms.GroupBox() + Me.ucrChkImportElementsMetadata = New instat.ucrCheck() + Me.ucrChkImportStationsMetadata = New instat.ucrCheck() Me.tbColumns = New System.Windows.Forms.TabPage() Me.grpColumnsToInclude = New System.Windows.Forms.GroupBox() - Me.tbpMoreOptions = New System.Windows.Forms.TabControl() - Me.ucrBaseSubdialog = New instat.ucrButtonsSubdialogue() Me.ucrChkIncludeQCLog = New instat.ucrCheck() Me.ucrChkIncludeCapturedBy = New instat.ucrCheck() Me.ucrChkIncludeQCStatus = New instat.ucrCheck() @@ -37,8 +37,12 @@ Partial Class sdgClimsoft Me.ucrChkIncludeAquistion = New instat.ucrCheck() Me.ucrChkIncludeEntryForm = New instat.ucrCheck() Me.ucrChkIncludeFlag = New instat.ucrCheck() - Me.ucrChkImportElementsMetadata = New instat.ucrCheck() - Me.ucrChkImportStationsMetadata = New instat.ucrCheck() + Me.tbpMoreOptions = New System.Windows.Forms.TabControl() + Me.ucrBaseSubdialog = New instat.ucrButtonsSubdialogue() + Me.ucrChkIncludeElementId = New instat.ucrCheck() + Me.ucrChkIncludeStationId = New instat.ucrCheck() + Me.ucrChkIncludeDateTime = New instat.ucrCheck() + Me.ucrChkIncludeElementName = New instat.ucrCheck() Me.tbpTitles.SuspendLayout() Me.grpMetadataToImport.SuspendLayout() Me.tbColumns.SuspendLayout() @@ -52,7 +56,7 @@ Partial Class sdgClimsoft Me.tbpTitles.Location = New System.Drawing.Point(4, 22) Me.tbpTitles.Name = "tbpTitles" Me.tbpTitles.Padding = New System.Windows.Forms.Padding(3) - Me.tbpTitles.Size = New System.Drawing.Size(409, 281) + Me.tbpTitles.Size = New System.Drawing.Size(409, 303) Me.tbpTitles.TabIndex = 2 Me.tbpTitles.Tag = "" Me.tbpTitles.Text = "Metadata" @@ -69,13 +73,31 @@ Partial Class sdgClimsoft Me.grpMetadataToImport.TabStop = False Me.grpMetadataToImport.Text = "Metadata to Import" ' + 'ucrChkImportElementsMetadata + ' + Me.ucrChkImportElementsMetadata.AutoSize = True + Me.ucrChkImportElementsMetadata.Checked = False + Me.ucrChkImportElementsMetadata.Location = New System.Drawing.Point(0, 46) + Me.ucrChkImportElementsMetadata.Name = "ucrChkImportElementsMetadata" + Me.ucrChkImportElementsMetadata.Size = New System.Drawing.Size(315, 23) + Me.ucrChkImportElementsMetadata.TabIndex = 20 + ' + 'ucrChkImportStationsMetadata + ' + Me.ucrChkImportStationsMetadata.AutoSize = True + Me.ucrChkImportStationsMetadata.Checked = False + Me.ucrChkImportStationsMetadata.Location = New System.Drawing.Point(0, 22) + Me.ucrChkImportStationsMetadata.Name = "ucrChkImportStationsMetadata" + Me.ucrChkImportStationsMetadata.Size = New System.Drawing.Size(315, 23) + Me.ucrChkImportStationsMetadata.TabIndex = 19 + ' 'tbColumns ' Me.tbColumns.Controls.Add(Me.grpColumnsToInclude) Me.tbColumns.Location = New System.Drawing.Point(4, 22) Me.tbColumns.Name = "tbColumns" Me.tbColumns.Padding = New System.Windows.Forms.Padding(3) - Me.tbColumns.Size = New System.Drawing.Size(409, 281) + Me.tbColumns.Size = New System.Drawing.Size(409, 367) Me.tbColumns.TabIndex = 3 Me.tbColumns.Tag = "" Me.tbColumns.Text = "Data" @@ -83,6 +105,10 @@ Partial Class sdgClimsoft ' 'grpColumnsToInclude ' + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeElementName) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeDateTime) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeElementId) + Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeStationId) Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeQCLog) Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeCapturedBy) Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeQCStatus) @@ -94,34 +120,16 @@ Partial Class sdgClimsoft Me.grpColumnsToInclude.Controls.Add(Me.ucrChkIncludeFlag) Me.grpColumnsToInclude.Location = New System.Drawing.Point(8, 10) Me.grpColumnsToInclude.Name = "grpColumnsToInclude" - Me.grpColumnsToInclude.Size = New System.Drawing.Size(394, 265) + Me.grpColumnsToInclude.Size = New System.Drawing.Size(394, 351) Me.grpColumnsToInclude.TabIndex = 32 Me.grpColumnsToInclude.TabStop = False Me.grpColumnsToInclude.Text = "Columns to Include" ' - 'tbpMoreOptions - ' - Me.tbpMoreOptions.Controls.Add(Me.tbColumns) - Me.tbpMoreOptions.Controls.Add(Me.tbpTitles) - Me.tbpMoreOptions.Location = New System.Drawing.Point(-1, 4) - Me.tbpMoreOptions.Name = "tbpMoreOptions" - Me.tbpMoreOptions.SelectedIndex = 0 - Me.tbpMoreOptions.Size = New System.Drawing.Size(417, 307) - Me.tbpMoreOptions.TabIndex = 2 - ' - 'ucrBaseSubdialog - ' - Me.ucrBaseSubdialog.AutoSize = True - Me.ucrBaseSubdialog.Location = New System.Drawing.Point(88, 315) - Me.ucrBaseSubdialog.Name = "ucrBaseSubdialog" - Me.ucrBaseSubdialog.Size = New System.Drawing.Size(224, 29) - Me.ucrBaseSubdialog.TabIndex = 3 - ' 'ucrChkIncludeQCLog ' Me.ucrChkIncludeQCLog.AutoSize = True - Me.ucrChkIncludeQCLog.Checked = True - Me.ucrChkIncludeQCLog.Location = New System.Drawing.Point(6, 186) + Me.ucrChkIncludeQCLog.Checked = False + Me.ucrChkIncludeQCLog.Location = New System.Drawing.Point(6, 294) Me.ucrChkIncludeQCLog.Name = "ucrChkIncludeQCLog" Me.ucrChkIncludeQCLog.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeQCLog.TabIndex = 21 @@ -129,8 +137,8 @@ Partial Class sdgClimsoft 'ucrChkIncludeCapturedBy ' Me.ucrChkIncludeCapturedBy.AutoSize = True - Me.ucrChkIncludeCapturedBy.Checked = True - Me.ucrChkIncludeCapturedBy.Location = New System.Drawing.Point(6, 138) + Me.ucrChkIncludeCapturedBy.Checked = False + Me.ucrChkIncludeCapturedBy.Location = New System.Drawing.Point(6, 243) Me.ucrChkIncludeCapturedBy.Name = "ucrChkIncludeCapturedBy" Me.ucrChkIncludeCapturedBy.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeCapturedBy.TabIndex = 20 @@ -138,8 +146,8 @@ Partial Class sdgClimsoft 'ucrChkIncludeQCStatus ' Me.ucrChkIncludeQCStatus.AutoSize = True - Me.ucrChkIncludeQCStatus.Checked = True - Me.ucrChkIncludeQCStatus.Location = New System.Drawing.Point(6, 162) + Me.ucrChkIncludeQCStatus.Checked = False + Me.ucrChkIncludeQCStatus.Location = New System.Drawing.Point(6, 269) Me.ucrChkIncludeQCStatus.Name = "ucrChkIncludeQCStatus" Me.ucrChkIncludeQCStatus.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeQCStatus.TabIndex = 0 @@ -147,8 +155,8 @@ Partial Class sdgClimsoft 'ucrChkIncludeLevel ' Me.ucrChkIncludeLevel.AutoSize = True - Me.ucrChkIncludeLevel.Checked = True - Me.ucrChkIncludeLevel.Location = New System.Drawing.Point(6, 90) + Me.ucrChkIncludeLevel.Checked = False + Me.ucrChkIncludeLevel.Location = New System.Drawing.Point(6, 196) Me.ucrChkIncludeLevel.Name = "ucrChkIncludeLevel" Me.ucrChkIncludeLevel.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeLevel.TabIndex = 19 @@ -174,8 +182,8 @@ Partial Class sdgClimsoft 'ucrChkIncludeAquistion ' Me.ucrChkIncludeAquistion.AutoSize = True - Me.ucrChkIncludeAquistion.Checked = True - Me.ucrChkIncludeAquistion.Location = New System.Drawing.Point(6, 66) + Me.ucrChkIncludeAquistion.Checked = False + Me.ucrChkIncludeAquistion.Location = New System.Drawing.Point(6, 168) Me.ucrChkIncludeAquistion.Name = "ucrChkIncludeAquistion" Me.ucrChkIncludeAquistion.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeAquistion.TabIndex = 16 @@ -183,8 +191,8 @@ Partial Class sdgClimsoft 'ucrChkIncludeEntryForm ' Me.ucrChkIncludeEntryForm.AutoSize = True - Me.ucrChkIncludeEntryForm.Checked = True - Me.ucrChkIncludeEntryForm.Location = New System.Drawing.Point(6, 114) + Me.ucrChkIncludeEntryForm.Checked = False + Me.ucrChkIncludeEntryForm.Location = New System.Drawing.Point(6, 220) Me.ucrChkIncludeEntryForm.Name = "ucrChkIncludeEntryForm" Me.ucrChkIncludeEntryForm.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeEntryForm.TabIndex = 15 @@ -192,35 +200,71 @@ Partial Class sdgClimsoft 'ucrChkIncludeFlag ' Me.ucrChkIncludeFlag.AutoSize = True - Me.ucrChkIncludeFlag.Checked = True - Me.ucrChkIncludeFlag.Location = New System.Drawing.Point(7, 210) + Me.ucrChkIncludeFlag.Checked = False + Me.ucrChkIncludeFlag.Location = New System.Drawing.Point(7, 321) Me.ucrChkIncludeFlag.Name = "ucrChkIncludeFlag" Me.ucrChkIncludeFlag.Size = New System.Drawing.Size(295, 23) Me.ucrChkIncludeFlag.TabIndex = 14 ' - 'ucrChkImportElementsMetadata + 'tbpMoreOptions ' - Me.ucrChkImportElementsMetadata.AutoSize = True - Me.ucrChkImportElementsMetadata.Checked = True - Me.ucrChkImportElementsMetadata.Location = New System.Drawing.Point(0, 46) - Me.ucrChkImportElementsMetadata.Name = "ucrChkImportElementsMetadata" - Me.ucrChkImportElementsMetadata.Size = New System.Drawing.Size(315, 23) - Me.ucrChkImportElementsMetadata.TabIndex = 20 + Me.tbpMoreOptions.Controls.Add(Me.tbColumns) + Me.tbpMoreOptions.Controls.Add(Me.tbpTitles) + Me.tbpMoreOptions.Location = New System.Drawing.Point(-1, 4) + Me.tbpMoreOptions.Name = "tbpMoreOptions" + Me.tbpMoreOptions.SelectedIndex = 0 + Me.tbpMoreOptions.Size = New System.Drawing.Size(417, 393) + Me.tbpMoreOptions.TabIndex = 2 ' - 'ucrChkImportStationsMetadata + 'ucrBaseSubdialog ' - Me.ucrChkImportStationsMetadata.AutoSize = True - Me.ucrChkImportStationsMetadata.Checked = True - Me.ucrChkImportStationsMetadata.Location = New System.Drawing.Point(0, 22) - Me.ucrChkImportStationsMetadata.Name = "ucrChkImportStationsMetadata" - Me.ucrChkImportStationsMetadata.Size = New System.Drawing.Size(315, 23) - Me.ucrChkImportStationsMetadata.TabIndex = 19 + Me.ucrBaseSubdialog.AutoSize = True + Me.ucrBaseSubdialog.Location = New System.Drawing.Point(88, 397) + Me.ucrBaseSubdialog.Name = "ucrBaseSubdialog" + Me.ucrBaseSubdialog.Size = New System.Drawing.Size(224, 29) + Me.ucrBaseSubdialog.TabIndex = 3 + ' + 'ucrChkIncludeElementId + ' + Me.ucrChkIncludeElementId.AutoSize = True + Me.ucrChkIncludeElementId.Checked = False + Me.ucrChkIncludeElementId.Location = New System.Drawing.Point(7, 116) + Me.ucrChkIncludeElementId.Name = "ucrChkIncludeElementId" + Me.ucrChkIncludeElementId.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeElementId.TabIndex = 23 + ' + 'ucrChkIncludeStationId + ' + Me.ucrChkIncludeStationId.AutoSize = True + Me.ucrChkIncludeStationId.Checked = False + Me.ucrChkIncludeStationId.Location = New System.Drawing.Point(7, 92) + Me.ucrChkIncludeStationId.Name = "ucrChkIncludeStationId" + Me.ucrChkIncludeStationId.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeStationId.TabIndex = 22 + ' + 'ucrChkIncludeDateTime + ' + Me.ucrChkIncludeDateTime.AutoSize = True + Me.ucrChkIncludeDateTime.Checked = True + Me.ucrChkIncludeDateTime.Location = New System.Drawing.Point(7, 66) + Me.ucrChkIncludeDateTime.Name = "ucrChkIncludeDateTime" + Me.ucrChkIncludeDateTime.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeDateTime.TabIndex = 24 + ' + 'ucrChkIncludeElementName + ' + Me.ucrChkIncludeElementName.AutoSize = True + Me.ucrChkIncludeElementName.Checked = False + Me.ucrChkIncludeElementName.Location = New System.Drawing.Point(7, 141) + Me.ucrChkIncludeElementName.Name = "ucrChkIncludeElementName" + Me.ucrChkIncludeElementName.Size = New System.Drawing.Size(295, 23) + Me.ucrChkIncludeElementName.TabIndex = 25 ' 'sdgClimsoft ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(417, 348) + Me.ClientSize = New System.Drawing.Size(417, 434) Me.Controls.Add(Me.ucrBaseSubdialog) Me.Controls.Add(Me.tbpMoreOptions) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow @@ -256,4 +300,8 @@ Partial Class sdgClimsoft Friend WithEvents ucrChkIncludeCapturedBy As ucrCheck Friend WithEvents ucrChkIncludeLevel As ucrCheck Friend WithEvents ucrChkIncludeQCLog As ucrCheck + Friend WithEvents ucrChkIncludeElementId As ucrCheck + Friend WithEvents ucrChkIncludeStationId As ucrCheck + Friend WithEvents ucrChkIncludeDateTime As ucrCheck + Friend WithEvents ucrChkIncludeElementName As ucrCheck End Class \ No newline at end of file diff --git a/instat/sdgClimsoft.resx b/instat/sdgClimsoft.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/sdgClimsoft.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/sdgClimsoft.vb b/instat/sdgClimsoft.vb index d6a61a9bb2a..c1a48427aa3 100644 --- a/instat/sdgClimsoft.vb +++ b/instat/sdgClimsoft.vb @@ -31,52 +31,65 @@ Public Class sdgClimsoft 'Columns to include '--------------------------------------- ucrChkIncludeStationName.SetText("Station Name") - ucrChkIncludeStationName.SetParameter(New RParameter("include_station_name", 13)) - ucrChkIncludeStationName.SetRDefault("TRUE") + ucrChkIncludeStationName.Enabled = False ucrChkIncludeElementAbbrv.SetText("Element Abbreviation") - ucrChkIncludeElementAbbrv.SetParameter(New RParameter("include_element_abbreviation", 14)) - ucrChkIncludeElementAbbrv.SetRDefault("TRUE") + ucrChkIncludeElementAbbrv.Enabled = False + + ucrChkIncludeDateTime.SetText("Date Time") + ucrChkIncludeDateTime.Enabled = False + + ucrChkIncludeStationId.SetText("Station Id") + ucrChkIncludeStationId.SetParameter(New RParameter("include_station_id", 13)) + ucrChkIncludeStationId.SetRDefault("FALSE") + + ucrChkIncludeElementId.SetText("Element Id") + ucrChkIncludeElementId.SetParameter(New RParameter("include_element_id", 14)) + ucrChkIncludeElementId.SetRDefault("FALSE") + + ucrChkIncludeElementName.SetText("Element Name") + ucrChkIncludeElementName.SetParameter(New RParameter("include_element_name", 15)) + ucrChkIncludeElementName.SetRDefault("FALSE") ucrChkIncludeAquistion.SetText("Acquisition Type") - ucrChkIncludeAquistion.SetParameter(New RParameter("include_acquisition_type", 15)) - ucrChkIncludeAquistion.SetRDefault("TRUE") + ucrChkIncludeAquistion.SetParameter(New RParameter("include_acquisition_type", 16)) + ucrChkIncludeAquistion.SetRDefault("FALSE") ucrChkIncludeLevel.SetText("Level") - ucrChkIncludeLevel.SetParameter(New RParameter("include_level", 16)) - ucrChkIncludeLevel.SetRDefault("TRUE") + ucrChkIncludeLevel.SetParameter(New RParameter("include_level", 17)) + ucrChkIncludeLevel.SetRDefault("FALSE") ucrChkIncludeEntryForm.SetText("Entry Form") - ucrChkIncludeEntryForm.SetParameter(New RParameter("include_entry_form", 17)) - ucrChkIncludeEntryForm.SetRDefault("TRUE") + ucrChkIncludeEntryForm.SetParameter(New RParameter("include_entry_form", 18)) + ucrChkIncludeEntryForm.SetRDefault("FALSE") ucrChkIncludeCapturedBy.SetText("Captured By (user)") - ucrChkIncludeCapturedBy.SetParameter(New RParameter("include_captured_by", 18)) - ucrChkIncludeCapturedBy.SetRDefault("TRUE") + ucrChkIncludeCapturedBy.SetParameter(New RParameter("include_captured_by", 19)) + ucrChkIncludeCapturedBy.SetRDefault("FALSE") ucrChkIncludeQCStatus.SetText("QC Status") - ucrChkIncludeQCStatus.SetParameter(New RParameter("include_qc_status", 19)) - ucrChkIncludeQCStatus.SetRDefault("TRUE") + ucrChkIncludeQCStatus.SetParameter(New RParameter("include_qc_status", 20)) + ucrChkIncludeQCStatus.SetRDefault("FALSE") ucrChkIncludeQCLog.SetText("QC Log") - ucrChkIncludeQCLog.SetParameter(New RParameter("include_qc_log", 20)) - ucrChkIncludeQCLog.SetRDefault("TRUE") + ucrChkIncludeQCLog.SetParameter(New RParameter("include_qc_log", 21)) + ucrChkIncludeQCLog.SetRDefault("FALSE") ucrChkIncludeFlag.SetText("Flag") - ucrChkIncludeFlag.SetParameter(New RParameter("include_flag", 21)) - ucrChkIncludeFlag.SetRDefault("TRUE") + ucrChkIncludeFlag.SetParameter(New RParameter("include_flag", 22)) + ucrChkIncludeFlag.SetRDefault("FALSE") '--------------------------------------- 'Metadata '--------------------------------------- ucrChkImportStationsMetadata.SetText("Selected Stations") - ucrChkImportStationsMetadata.SetParameter(New RParameter("import_selected_stations_metadata", 12)) - ucrChkImportStationsMetadata.SetRDefault("TRUE") + ucrChkImportStationsMetadata.SetParameter(New RParameter("import_selected_stations_metadata", 23)) + ucrChkImportStationsMetadata.SetRDefault("FALSE") ucrChkImportElementsMetadata.SetText("Selected Elements") - ucrChkImportElementsMetadata.SetParameter(New RParameter("import_selected_elements_metadata", 13)) - ucrChkImportElementsMetadata.SetRDefault("TRUE") + ucrChkImportElementsMetadata.SetParameter(New RParameter("import_selected_elements_metadata", 24)) + ucrChkImportElementsMetadata.SetRDefault("FALSE") '--------------------------------------- bControlsInitialised = True @@ -89,8 +102,9 @@ Public Class sdgClimsoft 'Columns '--------------------------------------- - ucrChkIncludeStationName.SetRCode(clsRFunction, bReset) - ucrChkIncludeElementAbbrv.SetRCode(clsRFunction, bReset) + ucrChkIncludeStationId.SetRCode(clsRFunction, bReset) + ucrChkIncludeElementId.SetRCode(clsRFunction, bReset) + ucrChkIncludeElementName.SetRCode(clsRFunction, bReset) ucrChkIncludeAquistion.SetRCode(clsRFunction, bReset) ucrChkIncludeLevel.SetRCode(clsRFunction, bReset) ucrChkIncludeEntryForm.SetRCode(clsRFunction, bReset) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 95c44c5c065..78fe1743d8b 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -1867,7 +1867,7 @@ DataBook$set("public", "get_db_table_row_count", function(tableName, query_condi #Imports Climsoft metadata. DataBook$set("public", "import_climsoft_metadata", function(import_stations = FALSE, import_elements = FALSE, import_flags = FALSE) { - if(!import_stations || !import_elements){ + if(!import_stations && !import_elements){ stop("No metadata selected for import") } @@ -1918,17 +1918,16 @@ DataBook$set("public", "import_climsoft_metadata", function(import_stations = FA }) - -#imports data from climsoft observation tables; initial or final. +#imports data from Climsoft observation tables; initial or final. #imports selected stations and elements metadata DataBook$set("public", "import_climsoft_data", function(tableName, station_filter_column, stations = c(), element_filter_column, elements = c(), - qc_status = -1, start_date = NULL, end_date = NULL, - include_station_name = TRUE, include_element_abbreviation = TRUE, include_qc_status = TRUE, - include_acquisition_type = TRUE, include_flag = TRUE, include_entry_form = TRUE, - include_qc_log = TRUE, include_captured_by = TRUE, include_level = TRUE, - import_selected_stations_metadata = TRUE, import_selected_elements_metadata = TRUE) { + qc_status = -1, start_date = NULL, end_date = NULL, unstack_data = FALSE, + include_station_id = FALSE, include_element_id = FALSE, include_element_name = FALSE, + include_acquisition_type = FALSE, include_level = FALSE, include_entry_form = FALSE, include_captured_by = FALSE, + include_qc_status = FALSE, include_qc_log = FALSE, include_flag = FALSE, + import_selected_stations_metadata = FALSE, import_selected_elements_metadata = FALSE) { #connection and parameter checks #-------------------------------- con <- self$get_database_connection() @@ -1951,16 +1950,24 @@ DataBook$set("public", "import_climsoft_data", function(tableName, #selects #-------------------------------- - sql_select <- paste0(tableName,".recordedFrom AS station_id") + + sql_select<- "" - if(include_station_name){ + if(include_station_id){ + sql_select <- paste0(tableName,".recordedFrom AS station_id") sql_select <-paste0(sql_select,", station.stationName AS station_name") + }else{ + sql_select <-"station.stationName AS station_name" + } + + if(include_element_id){ + sql_select <-paste0(sql_select, ", ", tableName,".describedBy AS element_id") } - sql_select <-paste0(sql_select, ", ", tableName,".describedBy AS element_id") + sql_select <-paste0(sql_select,", obselement.abbreviation AS element_abbrv") - if(include_element_abbreviation){ - sql_select <-paste0(sql_select,", obselement.abbreviation AS element_abbrv") + if(include_element_name){ + sql_select <-paste0(sql_select,", obselement.elementName AS element_name") } if(include_acquisition_type){ @@ -2045,20 +2052,29 @@ DataBook$set("public", "import_climsoft_data", function(tableName, observations_data_name <- next_default_item("observations_data", self$get_data_names(), include_index = FALSE) data_list[[observations_data_name]] <- DBI::dbGetQuery(con,paste0(sql_select, sql_filter, sql_order_by)) + if(unstack_data){ + observations_unstacked_data_name <- next_default_item("observations_unstacked_data", self$get_data_names(), include_index = FALSE) + data_list[[observations_unstacked_data_name]] <- reshape2::dcast(data = data_list[[observations_data_name]], formula = station_name + date_time ~ element_abbrv, value.var = "value") + } + self$import_data(data_tables = data_list) #-------------------------------- #transform imported data #-------------------------------- - self$convert_column_to_type(data_name = observations_data_name, col_names = c("station_id","element_id"), to_type = "factor") + self$convert_column_to_type(data_name = observations_data_name, col_names = c("station_name","element_abbrv"), to_type = "factor") + + if(include_station_id){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "station_id", to_type = "factor") + } - if(include_station_name){ - self$convert_column_to_type(data_name = observations_data_name, col_names = "station_name", to_type = "factor") + if(include_element_id){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "element_id", to_type = "factor") } - if(include_element_abbreviation){ - self$convert_column_to_type(data_name = observations_data_name, col_names = "element_abbrv", to_type = "factor") + if(include_element_name){ + self$convert_column_to_type(data_name = observations_data_name, col_names = "element_name", to_type = "factor") } if(include_qc_status){ @@ -2083,13 +2099,13 @@ DataBook$set("public", "import_climsoft_data", function(tableName, #todo. should this be done at this point?? Keeping in mind that we may have hourly data #create a plain date column from the observation data datetime column values - obsdate <- self$get_columns_from_data(data_name = observations_data_name, col_names = "date_time", use_current_filter = FALSE) - self$add_columns_to_data(data_name = observations_data_name, col_name = "date", col_data = as.Date(x = obsdate), before = FALSE, adjacent_column = "date_time") + #obsdate <- self$get_columns_from_data(data_name = observations_data_name, col_names = "date_time", use_current_filter = FALSE) + #self$add_columns_to_data(data_name = observations_data_name, col_name = "date", col_data = as.Date(x = obsdate), before = FALSE, adjacent_column = "date_time") #-------------------------------- }) -#TODO. Deprecated. Delete this after after deleting the import from climsoft wizard dialog +#TODO. Deprecated. Delete this after after deleting the import from Climsoft wizard dialog DataBook$set("public", "import_from_climsoft", function(stationfiltercolumn = "stationId", stations = c(), elementfiltercolumn = "elementId", elements = c(), include_observation_data = FALSE, include_observation_flags = FALSE, unstack_data = FALSE, include_elements_info = FALSE, start_date = NULL, end_date = NULL) { #need to perform checks here con <- self$get_database_connection()