From 468dd24de31731df69050faea40821abe66fbafc Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Wed, 28 Apr 2021 13:04:48 +0300 Subject: [PATCH 01/10] Fixed issues with dlgCompareColumns --- instat/dlgCompareColumns.Designer.vb | 72 +++++++------- instat/dlgCompareColumns.resx | 30 +++--- instat/dlgCompareColumns.vb | 137 +++++++++++++-------------- 3 files changed, 119 insertions(+), 120 deletions(-) diff --git a/instat/dlgCompareColumns.Designer.vb b/instat/dlgCompareColumns.Designer.vb index 7423005b525..f08a0ad4f50 100644 --- a/instat/dlgCompareColumns.Designer.vb +++ b/instat/dlgCompareColumns.Designer.vb @@ -26,11 +26,6 @@ Partial Class dlgCompareColumns Me.lblFirstColumn = New System.Windows.Forms.Label() Me.lblSecondColumn = New System.Windows.Forms.Label() Me.grpComparisions = New System.Windows.Forms.GroupBox() - Me.ucrChkAllValues = New instat.ucrCheck() - Me.ucrChkUnion = New instat.ucrCheck() - Me.ucrChkIntersection = New instat.ucrCheck() - Me.ucrChkSecondNotFirst = New instat.ucrCheck() - Me.ucrChkFirstNotSecond = New instat.ucrCheck() Me.lblTolerance = New System.Windows.Forms.Label() Me.rdoByValue = New System.Windows.Forms.RadioButton() Me.rdoByRow = New System.Windows.Forms.RadioButton() @@ -38,6 +33,11 @@ Partial Class dlgCompareColumns Me.ucrPnlOptions = New instat.UcrPanel() Me.ucrSaveLogical = New instat.ucrSave() Me.ucrChkSort = New instat.ucrCheck() + Me.ucrChkAllValues = New instat.ucrCheck() + Me.ucrChkUnion = New instat.ucrCheck() + Me.ucrChkIntersection = New instat.ucrCheck() + Me.ucrChkSecondNotFirst = New instat.ucrCheck() + Me.ucrChkFirstNotSecond = New instat.ucrCheck() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverSecond = New instat.ucrReceiverSingle() Me.ucrReceiverFirst = New instat.ucrReceiverSingle() @@ -67,36 +67,6 @@ Partial Class dlgCompareColumns Me.grpComparisions.Name = "grpComparisions" Me.grpComparisions.TabStop = False ' - 'ucrChkAllValues - ' - Me.ucrChkAllValues.Checked = False - resources.ApplyResources(Me.ucrChkAllValues, "ucrChkAllValues") - Me.ucrChkAllValues.Name = "ucrChkAllValues" - ' - 'ucrChkUnion - ' - Me.ucrChkUnion.Checked = False - resources.ApplyResources(Me.ucrChkUnion, "ucrChkUnion") - Me.ucrChkUnion.Name = "ucrChkUnion" - ' - 'ucrChkIntersection - ' - Me.ucrChkIntersection.Checked = False - resources.ApplyResources(Me.ucrChkIntersection, "ucrChkIntersection") - Me.ucrChkIntersection.Name = "ucrChkIntersection" - ' - 'ucrChkSecondNotFirst - ' - Me.ucrChkSecondNotFirst.Checked = False - resources.ApplyResources(Me.ucrChkSecondNotFirst, "ucrChkSecondNotFirst") - Me.ucrChkSecondNotFirst.Name = "ucrChkSecondNotFirst" - ' - 'ucrChkFirstNotSecond - ' - Me.ucrChkFirstNotSecond.Checked = False - resources.ApplyResources(Me.ucrChkFirstNotSecond, "ucrChkFirstNotSecond") - Me.ucrChkFirstNotSecond.Name = "ucrChkFirstNotSecond" - ' 'lblTolerance ' resources.ApplyResources(Me.lblTolerance, "lblTolerance") @@ -148,6 +118,36 @@ Partial Class dlgCompareColumns resources.ApplyResources(Me.ucrChkSort, "ucrChkSort") Me.ucrChkSort.Name = "ucrChkSort" ' + 'ucrChkAllValues + ' + Me.ucrChkAllValues.Checked = False + resources.ApplyResources(Me.ucrChkAllValues, "ucrChkAllValues") + Me.ucrChkAllValues.Name = "ucrChkAllValues" + ' + 'ucrChkUnion + ' + Me.ucrChkUnion.Checked = False + resources.ApplyResources(Me.ucrChkUnion, "ucrChkUnion") + Me.ucrChkUnion.Name = "ucrChkUnion" + ' + 'ucrChkIntersection + ' + Me.ucrChkIntersection.Checked = False + resources.ApplyResources(Me.ucrChkIntersection, "ucrChkIntersection") + Me.ucrChkIntersection.Name = "ucrChkIntersection" + ' + 'ucrChkSecondNotFirst + ' + Me.ucrChkSecondNotFirst.Checked = False + resources.ApplyResources(Me.ucrChkSecondNotFirst, "ucrChkSecondNotFirst") + Me.ucrChkSecondNotFirst.Name = "ucrChkSecondNotFirst" + ' + 'ucrChkFirstNotSecond + ' + Me.ucrChkFirstNotSecond.Checked = False + resources.ApplyResources(Me.ucrChkFirstNotSecond, "ucrChkFirstNotSecond") + Me.ucrChkFirstNotSecond.Name = "ucrChkFirstNotSecond" + ' 'ucrBase ' resources.ApplyResources(Me.ucrBase, "ucrBase") @@ -189,6 +189,7 @@ Partial Class dlgCompareColumns ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.grpComparisions) Me.Controls.Add(Me.lblTolerance) Me.Controls.Add(Me.ucrInputTolerance) Me.Controls.Add(Me.rdoByValue) @@ -196,7 +197,6 @@ Partial Class dlgCompareColumns Me.Controls.Add(Me.ucrPnlOptions) Me.Controls.Add(Me.ucrSaveLogical) Me.Controls.Add(Me.ucrChkSort) - Me.Controls.Add(Me.grpComparisions) Me.Controls.Add(Me.ucrBase) Me.Controls.Add(Me.lblSecondColumn) Me.Controls.Add(Me.lblFirstColumn) diff --git a/instat/dlgCompareColumns.resx b/instat/dlgCompareColumns.resx index 52be4a37db7..47847772ef5 100644 --- a/instat/dlgCompareColumns.resx +++ b/instat/dlgCompareColumns.resx @@ -202,7 +202,7 @@ 0 - 11, 104 + 11, 98 210, 20 @@ -223,7 +223,7 @@ 1 - 11, 78 + 11, 74 210, 20 @@ -244,7 +244,7 @@ 2 - 11, 52 + 11, 50 210, 20 @@ -307,7 +307,7 @@ $this - 7 + 0 True @@ -337,7 +337,7 @@ $this - 0 + 1 Button @@ -349,7 +349,7 @@ NoControl - 180, 13 + 215, 13 96, 28 @@ -373,7 +373,7 @@ $this - 2 + 3 Button @@ -385,7 +385,7 @@ NoControl - 84, 13 + 117, 13 98, 28 @@ -409,7 +409,7 @@ $this - 3 + 4 328, 197 @@ -430,10 +430,10 @@ $this - 1 + 2 - 67, 8 + 101, 8 5, 5, 5, 5 @@ -454,7 +454,7 @@ $this - 4 + 5 11, 426 @@ -463,7 +463,7 @@ 4, 5, 4, 5 - 396, 24 + 341, 24 8 @@ -478,7 +478,7 @@ $this - 5 + 6 270, 242 @@ -499,7 +499,7 @@ $this - 6 + 7 11, 456 diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index 22b38f2f9bf..1fefada293d 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -20,10 +20,10 @@ Public Class dlgCompareColumns Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private bRcodeSet As Boolean = False - Private clsCompareColumns, clsIfElseCompareFunction, clsAbsoluteFunction As New RFunction + Private clsCompareColumns, clsAbsoluteFunction As New RFunction Private clsAsCharacterFunctionOne, clsAsCharacterFunctionTwo, clsSummaryFunction As New RFunction Private clsYinXOperator, clsIsEqualToOperator, clsSubtractOperator, clsLessorEqualToOperator As New ROperator + Private clsDummyOperator As ROperator Private Sub dlgCompareColumns_Load(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then @@ -47,10 +47,12 @@ Public Class dlgCompareColumns ucrPnlOptions.AddRadioButton(rdoByRow) ucrPnlOptions.AddRadioButton(rdoByValue) - ucrPnlOptions.AddFunctionNamesCondition(rdoByRow, "ifelse") - ucrPnlOptions.AddFunctionNamesCondition(rdoByValue, {"%in%", "compare_columns"}) + 'ucrPnlOptions.AddParameterIsROperatorCondition(rdoByRow, "==") + 'ucrPnlOptions.AddParameterIsROperatorCondition(rdoByRow, "<=") + 'ucrPnlOptions.AddFunctionNamesCondition(rdoByValue, {"compare_columns"}) - ucrPnlOptions.AddToLinkedControls({ucrChkSort, ucrChkUnique}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkUnique, ucrChkSort, ucrChkFirstNotSecond}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrChkFirstNotSecond.SetLinkedDisplayControl(grpComparisions) ucrReceiverFirst.SetParameter(New RParameter("x", 0)) ucrReceiverFirst.Selector = ucrSelectorCompareColumns @@ -71,10 +73,10 @@ Public Class dlgCompareColumns dctTolerance.Add("0.005", "0.005") dctTolerance.Add("0.0000000001", "0.0000000001") ucrInputTolerance.SetItems(dctTolerance) - ucrInputTolerance.bAllowNonConditionValues = True ucrInputTolerance.SetValidationTypeAsNumeric() ucrInputTolerance.AddQuotesIfUnrecognised = False ucrInputTolerance.SetLinkedDisplayControl(lblTolerance) + ucrInputTolerance.bAllowNonConditionValues = True ucrChkUnique.SetParameter(New RParameter("use_unique", 2), bNewChangeParameterValue:=True) ucrChkUnique.SetText("Use unique values for comparison") @@ -108,14 +110,13 @@ Public Class dlgCompareColumns ucrSaveLogical.SetSaveTypeAsColumn() ucrSaveLogical.SetDataFrameSelector(ucrSelectorCompareColumns.ucrAvailableDataFrames) ucrSaveLogical.SetIsComboBox() - ucrSaveLogical.SetLabelText("New Column Name") + ucrSaveLogical.SetLabelText("New Column Name:") ucrBase.clsRsyntax.iCallType = 2 End Sub Private Sub SetDefaults() clsCompareColumns = New RFunction - clsIfElseCompareFunction = New RFunction clsAbsoluteFunction = New RFunction clsAsCharacterFunctionOne = New RFunction clsAsCharacterFunctionTwo = New RFunction @@ -124,9 +125,11 @@ Public Class dlgCompareColumns clsIsEqualToOperator = New ROperator clsSubtractOperator = New ROperator clsLessorEqualToOperator = New ROperator + clsDummyOperator = New ROperator ucrBase.clsRsyntax.ClearCodes() - ucrInputTolerance.SetText("0") + ' ucrInputTolerance.SetText("0") + rdoByRow.Checked = True ucrSelectorCompareColumns.Reset() ucrReceiverFirst.SetMeAsReceiver() @@ -139,8 +142,6 @@ Public Class dlgCompareColumns clsAsCharacterFunctionTwo.SetRCommand("as.character") clsIsEqualToOperator.SetOperation("==") - clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAsCharacterFunctionOne, iPosition:=0) - clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsAsCharacterFunctionTwo, iPosition:=1) clsSubtractOperator.SetOperation("-") @@ -148,23 +149,15 @@ Public Class dlgCompareColumns clsAbsoluteFunction.AddParameter("x", clsROperatorParameter:=clsSubtractOperator, iPosition:=0) clsLessorEqualToOperator.SetOperation("<=") - clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) - clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) - - clsIfElseCompareFunction.SetRCommand("ifelse") - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=0) - clsIfElseCompareFunction.AddParameter("yes", "TRUE", iPosition:=1) - clsIfElseCompareFunction.AddParameter("no", "FALSE", iPosition:=2) + clsLessorEqualToOperator.AddParameter("tol", 0, iPosition:=1) clsSummaryFunction.SetRCommand("summary") - clsSummaryFunction.AddParameter("x", clsRFunctionParameter:=clsIfElseCompareFunction, bIncludeArgumentName:=False, iPosition:=1) clsSummaryFunction.iCallType = 2 - ucrBase.clsRsyntax.SetBaseRFunction(clsIfElseCompareFunction) + ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - bRcodeSet = False ucrReceiverFirst.AddAdditionalCodeParameterPair(clsYinXOperator, New RParameter("right", iNewPosition:=1), iAdditionalPairNo:=1) ucrReceiverFirst.AddAdditionalCodeParameterPair(clsAsCharacterFunctionOne, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=2) ucrReceiverFirst.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=3) @@ -173,7 +166,7 @@ Public Class dlgCompareColumns ucrReceiverSecond.AddAdditionalCodeParameterPair(clsAsCharacterFunctionTwo, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=2) ucrReceiverSecond.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=3) - ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ' ucrPnlOptions.SetRCode(, bReset) ucrReceiverFirst.SetRCode(clsCompareColumns, bReset) ucrReceiverSecond.SetRCode(clsCompareColumns, bReset) @@ -186,30 +179,21 @@ Public Class dlgCompareColumns ucrChkAllValues.SetRCode(clsCompareColumns, bReset) ucrInputTolerance.SetRCode(clsLessorEqualToOperator, bReset) - ucrSaveLogical.SetRCode(clsIfElseCompareFunction, bReset) - ucrSaveLogical.AddAdditionalRCode(clsYinXOperator, iAdditionalPairNo:=1) - bRcodeSet = True + ucrSaveLogical.AddAdditionalRCode(clsLessorEqualToOperator, iAdditionalPairNo:=1) + ucrSaveLogical.AddAdditionalRCode(clsYinXOperator, iAdditionalPairNo:=2) + ucrSaveLogical.SetRCode(clsIsEqualToOperator, bReset) End Sub + Private Sub TestOkEnabled() - If Not ucrReceiverFirst.IsEmpty AndAlso Not ucrReceiverSecond.IsEmpty AndAlso ucrSaveLogical.IsComplete() Then - If rdoByRow.Checked Then - If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then - ucrBase.OKEnabled(True) - ElseIf ucrReceiverFirst.strCurrDataType = "Date" AndAlso ucrReceiverSecond.strCurrDataType = "Date" Then - ucrBase.OKEnabled(True) - ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then - ucrBase.OKEnabled(True) - ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If - Else + If ucrReceiverFirst.IsEmpty OrElse ucrReceiverSecond.IsEmpty OrElse Not ucrSaveLogical.IsComplete() Then + ucrBase.OKEnabled(False) + Else + If ({"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse (ucrReceiverFirst.strCurrDataType = "Date" AndAlso ucrReceiverSecond.strCurrDataType = "Date") OrElse ({"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse (ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical") Then ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) End If - Else - ucrBase.OKEnabled(False) End If End Sub @@ -225,13 +209,14 @@ Public Class dlgCompareColumns Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged If rdoByValue.Checked Then - grpComparisions.Visible = True + 'grpComparisions.Visible = True + ucrInputTolerance.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumns) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) ucrBase.clsRsyntax.AddToAfterCodes(clsYinXOperator, iPosition:=1) - Else - grpComparisions.Visible = False - ucrBase.clsRsyntax.SetBaseRFunction(clsIfElseCompareFunction) + ElseIf rdoByRow.Checked Then + 'grpComparisions.Visible = False + ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsYinXOperator) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, iPosition:=1) End If @@ -239,40 +224,54 @@ Public Class dlgCompareColumns End Sub Private Sub CheckDatatype() - If bRcodeSet Then - If rdoByRow.Checked Then - If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then + 'If bRcodeSet Then + If Not ucrReceiverSecond.IsEmpty AndAlso Not ucrReceiverFirst.IsEmpty Then + If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = True - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=0) - ElseIf ucrReceiverFirst.strCurrDataType = "date" AndAlso ucrReceiverSecond.strCurrDataType = "date" Then + clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) + clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) + clsDummyOperator = clsLessorEqualToOperator + 'ucrBase.clsRsyntax.SetBaseROperator(clsLessorEqualToOperator) + End If + ElseIf ucrReceiverFirst.strCurrDataType = "date" AndAlso ucrReceiverSecond.strCurrDataType = "date" Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = True - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=0) - ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then - ucrInputTolerance.Visible = False - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=0) - ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then + clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) + clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) + 'ucrBase.clsRsyntax.SetBaseROperator(clsLessorEqualToOperator) + clsDummyOperator = clsLessorEqualToOperator + End If + ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = False - clsIfElseCompareFunction.AddParameter("test", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=0) - Else - MsgBox("Receivers must have the same data type, OK will not be enabled") + clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAsCharacterFunctionOne, iPosition:=0) + clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsAsCharacterFunctionTwo, iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=1) + clsDummyOperator = clsIsEqualToOperator + End If + ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = False + clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAsCharacterFunctionOne, iPosition:=0) + clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsAsCharacterFunctionTwo, iPosition:=1) + clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=1) + clsDummyOperator = clsIsEqualToOperator End If Else - ucrInputTolerance.Visible = False + MsgBox("Receivers must have the same data type, OK will not be enabled") + 'ucrInputTolerance.Visible = False End If End If + 'Else + 'ucrInputTolerance.Visible = False + 'End If TestOkEnabled() End Sub - Private Sub ucrReceiverFirst_ValueChanged(sender As Object, e As EventArgs) Handles ucrReceiverFirst.ValueChanged - If Not ucrReceiverSecond.IsEmpty Then - CheckDatatype() - End If - End Sub - - Private Sub ucrReceiverSecond_ValueChanged(sender As Object, e As EventArgs) Handles ucrReceiverSecond.ValueChanged - If Not ucrReceiverFirst.IsEmpty Then - CheckDatatype() - End If + Private Sub ucrReceiverFirst_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirst.ControlValueChanged, ucrReceiverSecond.ControlValueChanged + CheckDatatype() End Sub End Class \ No newline at end of file From fb7f5ff6cf9a5f3c61df5169ea5dae97cfd481fd Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Wed, 28 Apr 2021 16:35:09 +0300 Subject: [PATCH 02/10] Implemented change in dialog size... --- instat/dlgCompareColumns.vb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index 1fefada293d..1327e8767c6 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -20,6 +20,8 @@ Public Class dlgCompareColumns Private bFirstLoad As Boolean = True Private bReset As Boolean = True + Private iDialogHeight As Integer + Private iBaseMaxY Private clsCompareColumns, clsAbsoluteFunction As New RFunction Private clsAsCharacterFunctionOne, clsAsCharacterFunctionTwo, clsSummaryFunction As New RFunction Private clsYinXOperator, clsIsEqualToOperator, clsSubtractOperator, clsLessorEqualToOperator As New ROperator @@ -27,6 +29,8 @@ Public Class dlgCompareColumns Private Sub dlgCompareColumns_Load(sender As Object, e As EventArgs) Handles Me.Load If bFirstLoad Then + iDialogHeight = Me.Height + iBaseMaxY = ucrBase.Location.Y InitialiseDialog() bFirstLoad = False End If @@ -214,11 +218,17 @@ Public Class dlgCompareColumns ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumns) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) ucrBase.clsRsyntax.AddToAfterCodes(clsYinXOperator, iPosition:=1) + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) + ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.07) ElseIf rdoByRow.Checked Then 'grpComparisions.Visible = False ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsYinXOperator) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, iPosition:=1) + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.68) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.62) + ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.8) End If CheckDatatype() End Sub From 18dbafea94a19afe64bf4b02244d13dc36f1a034 Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Wed, 5 May 2021 11:58:16 +0300 Subject: [PATCH 03/10] removed commented code --- instat/dlgCompareColumns.vb | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index 1327e8767c6..a9c808803b6 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -51,10 +51,6 @@ Public Class dlgCompareColumns ucrPnlOptions.AddRadioButton(rdoByRow) ucrPnlOptions.AddRadioButton(rdoByValue) - 'ucrPnlOptions.AddParameterIsROperatorCondition(rdoByRow, "==") - 'ucrPnlOptions.AddParameterIsROperatorCondition(rdoByRow, "<=") - 'ucrPnlOptions.AddFunctionNamesCondition(rdoByValue, {"compare_columns"}) - ucrPnlOptions.AddToLinkedControls({ucrChkUnique, ucrChkSort, ucrChkFirstNotSecond}, {rdoByValue}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkFirstNotSecond.SetLinkedDisplayControl(grpComparisions) @@ -132,7 +128,6 @@ Public Class dlgCompareColumns clsDummyOperator = New ROperator ucrBase.clsRsyntax.ClearCodes() - ' ucrInputTolerance.SetText("0") rdoByRow.Checked = True ucrSelectorCompareColumns.Reset() @@ -170,8 +165,6 @@ Public Class dlgCompareColumns ucrReceiverSecond.AddAdditionalCodeParameterPair(clsAsCharacterFunctionTwo, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=2) ucrReceiverSecond.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=3) - ' ucrPnlOptions.SetRCode(, bReset) - ucrReceiverFirst.SetRCode(clsCompareColumns, bReset) ucrReceiverSecond.SetRCode(clsCompareColumns, bReset) ucrChkUnique.SetRCode(clsCompareColumns, bReset) @@ -213,7 +206,6 @@ Public Class dlgCompareColumns Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged If rdoByValue.Checked Then - 'grpComparisions.Visible = True ucrInputTolerance.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumns) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) @@ -222,7 +214,6 @@ Public Class dlgCompareColumns ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.07) ElseIf rdoByRow.Checked Then - 'grpComparisions.Visible = False ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsYinXOperator) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, iPosition:=1) @@ -234,7 +225,6 @@ Public Class dlgCompareColumns End Sub Private Sub CheckDatatype() - 'If bRcodeSet Then If Not ucrReceiverSecond.IsEmpty AndAlso Not ucrReceiverFirst.IsEmpty Then If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then If rdoByRow.Checked Then @@ -243,7 +233,6 @@ Public Class dlgCompareColumns clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) clsDummyOperator = clsLessorEqualToOperator - 'ucrBase.clsRsyntax.SetBaseROperator(clsLessorEqualToOperator) End If ElseIf ucrReceiverFirst.strCurrDataType = "date" AndAlso ucrReceiverSecond.strCurrDataType = "date" Then If rdoByRow.Checked Then @@ -251,7 +240,6 @@ Public Class dlgCompareColumns clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) - 'ucrBase.clsRsyntax.SetBaseROperator(clsLessorEqualToOperator) clsDummyOperator = clsLessorEqualToOperator End If ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then @@ -272,12 +260,8 @@ Public Class dlgCompareColumns End If Else MsgBox("Receivers must have the same data type, OK will not be enabled") - 'ucrInputTolerance.Visible = False End If End If - 'Else - 'ucrInputTolerance.Visible = False - 'End If TestOkEnabled() End Sub From b68c453080d6e35a1ca1d99fdc20aac3e1636f60 Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Fri, 7 May 2021 12:09:19 +0300 Subject: [PATCH 04/10] Fixed raised issues --- instat/dlgCompareColumns.vb | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index a9c808803b6..73f90e3340d 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -22,8 +22,8 @@ Public Class dlgCompareColumns Private bReset As Boolean = True Private iDialogHeight As Integer Private iBaseMaxY - Private clsCompareColumns, clsAbsoluteFunction As New RFunction - Private clsAsCharacterFunctionOne, clsAsCharacterFunctionTwo, clsSummaryFunction As New RFunction + Private clsCompareColumnsFunction, clsAbsoluteFunction As New RFunction + Private clsFirstAsCharacterFunction, clsSecondAsCharacterFunction, clsSummaryFunction As New RFunction Private clsYinXOperator, clsIsEqualToOperator, clsSubtractOperator, clsLessorEqualToOperator As New ROperator Private clsDummyOperator As ROperator @@ -116,10 +116,10 @@ Public Class dlgCompareColumns End Sub Private Sub SetDefaults() - clsCompareColumns = New RFunction + clsCompareColumnsFunction = New RFunction clsAbsoluteFunction = New RFunction - clsAsCharacterFunctionOne = New RFunction - clsAsCharacterFunctionTwo = New RFunction + clsFirstAsCharacterFunction = New RFunction + clsSecondAsCharacterFunction = New RFunction clsSummaryFunction = New RFunction clsYinXOperator = New ROperator clsIsEqualToOperator = New ROperator @@ -134,11 +134,11 @@ Public Class dlgCompareColumns ucrReceiverFirst.SetMeAsReceiver() ucrSaveLogical.Reset() - clsCompareColumns.SetRCommand("compare_columns") + clsCompareColumnsFunction.SetRCommand("compare_columns") clsYinXOperator.SetOperation("%in%") - clsAsCharacterFunctionOne.SetRCommand("as.character") - clsAsCharacterFunctionTwo.SetRCommand("as.character") + clsFirstAsCharacterFunction.SetRCommand("as.character") + clsSecondAsCharacterFunction.SetRCommand("as.character") clsIsEqualToOperator.SetOperation("==") @@ -158,22 +158,22 @@ Public Class dlgCompareColumns Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverFirst.AddAdditionalCodeParameterPair(clsYinXOperator, New RParameter("right", iNewPosition:=1), iAdditionalPairNo:=1) - ucrReceiverFirst.AddAdditionalCodeParameterPair(clsAsCharacterFunctionOne, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=2) + ucrReceiverFirst.AddAdditionalCodeParameterPair(clsFirstAsCharacterFunction, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=2) ucrReceiverFirst.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("first", bNewIncludeArgumentName:=False, iNewPosition:=0), iAdditionalPairNo:=3) ucrReceiverSecond.AddAdditionalCodeParameterPair(clsYinXOperator, New RParameter("left", iNewPosition:=0), iAdditionalPairNo:=1) - ucrReceiverSecond.AddAdditionalCodeParameterPair(clsAsCharacterFunctionTwo, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=2) + ucrReceiverSecond.AddAdditionalCodeParameterPair(clsSecondAsCharacterFunction, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=2) ucrReceiverSecond.AddAdditionalCodeParameterPair(clsSubtractOperator, New RParameter("second", bNewIncludeArgumentName:=False, iNewPosition:=1), iAdditionalPairNo:=3) - ucrReceiverFirst.SetRCode(clsCompareColumns, bReset) - ucrReceiverSecond.SetRCode(clsCompareColumns, bReset) - ucrChkUnique.SetRCode(clsCompareColumns, bReset) - ucrChkSort.SetRCode(clsCompareColumns, bReset) - ucrChkFirstNotSecond.SetRCode(clsCompareColumns, bReset) - ucrChkSecondNotFirst.SetRCode(clsCompareColumns, bReset) - ucrChkIntersection.SetRCode(clsCompareColumns, bReset) - ucrChkUnion.SetRCode(clsCompareColumns, bReset) - ucrChkAllValues.SetRCode(clsCompareColumns, bReset) + ucrReceiverFirst.SetRCode(clsCompareColumnsFunction, bReset) + ucrReceiverSecond.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkUnique.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkSort.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkFirstNotSecond.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkSecondNotFirst.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkIntersection.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkUnion.SetRCode(clsCompareColumnsFunction, bReset) + ucrChkAllValues.SetRCode(clsCompareColumnsFunction, bReset) ucrInputTolerance.SetRCode(clsLessorEqualToOperator, bReset) ucrSaveLogical.AddAdditionalRCode(clsLessorEqualToOperator, iAdditionalPairNo:=1) @@ -207,7 +207,7 @@ Public Class dlgCompareColumns Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged If rdoByValue.Checked Then ucrInputTolerance.Visible = False - ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumns) + ucrBase.clsRsyntax.SetBaseRFunction(clsCompareColumnsFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) ucrBase.clsRsyntax.AddToAfterCodes(clsYinXOperator, iPosition:=1) Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) @@ -245,16 +245,16 @@ Public Class dlgCompareColumns ElseIf {"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType) Then If rdoByRow.Checked Then ucrInputTolerance.Visible = False - clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAsCharacterFunctionOne, iPosition:=0) - clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsAsCharacterFunctionTwo, iPosition:=1) + clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsFirstAsCharacterFunction, iPosition:=0) + clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsSecondAsCharacterFunction, iPosition:=1) clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=1) clsDummyOperator = clsIsEqualToOperator End If ElseIf ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical" Then If rdoByRow.Checked Then ucrInputTolerance.Visible = False - clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAsCharacterFunctionOne, iPosition:=0) - clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsAsCharacterFunctionTwo, iPosition:=1) + clsIsEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsFirstAsCharacterFunction, iPosition:=0) + clsIsEqualToOperator.AddParameter("second", clsRFunctionParameter:=clsSecondAsCharacterFunction, iPosition:=1) clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsIsEqualToOperator, iPosition:=1) clsDummyOperator = clsIsEqualToOperator End If From 46f560bbb30a2a54e73da9b2cbdb5cb1efc37253 Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Thu, 20 May 2021 11:06:21 +0300 Subject: [PATCH 05/10] Update instat/dlgCompareColumns.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgCompareColumns.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index 73f90e3340d..ea69e705338 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -212,7 +212,7 @@ Public Class dlgCompareColumns ucrBase.clsRsyntax.AddToAfterCodes(clsYinXOperator, iPosition:=1) Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) - ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.07) + ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY) ElseIf rdoByRow.Checked Then ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsYinXOperator) @@ -268,4 +268,4 @@ Public Class dlgCompareColumns Private Sub ucrReceiverFirst_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverFirst.ControlValueChanged, ucrReceiverSecond.ControlValueChanged CheckDatatype() End Sub -End Class \ No newline at end of file +End Class From bcb1b8e3191d7cbab541de496aae781d737187e4 Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Thu, 20 May 2021 11:08:17 +0300 Subject: [PATCH 06/10] Update instat/dlgCompareColumns.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgCompareColumns.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index ea69e705338..cabcd523b10 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -186,7 +186,14 @@ Public Class dlgCompareColumns If ucrReceiverFirst.IsEmpty OrElse ucrReceiverSecond.IsEmpty OrElse Not ucrSaveLogical.IsComplete() Then ucrBase.OKEnabled(False) Else - If ({"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse (ucrReceiverFirst.strCurrDataType = "Date" AndAlso ucrReceiverSecond.strCurrDataType = "Date") OrElse ({"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse (ucrReceiverFirst.strCurrDataType = "logical" AndAlso ucrReceiverSecond.strCurrDataType = "logical") Then + If ({"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso + {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse + (ucrReceiverFirst.strCurrDataType = "Date" AndAlso + ucrReceiverSecond.strCurrDataType = "Date") OrElse + ({"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso + {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse + (ucrReceiverFirst.strCurrDataType = "logical" AndAlso + ucrReceiverSecond.strCurrDataType = "logical") Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) From fbb7ff7fea84906a8c31471d48c8cecadbd4334a Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Thu, 20 May 2021 11:09:32 +0300 Subject: [PATCH 07/10] Update instat/dlgCompareColumns.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgCompareColumns.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index cabcd523b10..da561745e71 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -232,7 +232,10 @@ Public Class dlgCompareColumns End Sub Private Sub CheckDatatype() - If Not ucrReceiverSecond.IsEmpty AndAlso Not ucrReceiverFirst.IsEmpty Then + If ucrReceiverSecond.IsEmpty OrElse ucrReceiverFirst.IsEmpty OrElse Not rdoByRow.Checked Then + TestOkEnabled() + Exit Sub + Else If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then If rdoByRow.Checked Then ucrInputTolerance.Visible = True From a6e476c94ed1abcfb6c021744f9424f4f940f16b Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Thu, 20 May 2021 11:10:33 +0300 Subject: [PATCH 08/10] Update instat/dlgCompareColumns.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgCompareColumns.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index da561745e71..26ff17afd62 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -237,7 +237,6 @@ Public Class dlgCompareColumns Exit Sub Else If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then - If rdoByRow.Checked Then ucrInputTolerance.Visible = True clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) From 373114f891d319528d5959526c3e2510cf18bf9d Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Thu, 20 May 2021 16:53:05 +0300 Subject: [PATCH 09/10] Updated dlgCompare columns.vb --- instat/dlgCompareColumns.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index df066ffdcc5..232509f3143 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -224,7 +224,7 @@ Public Class dlgCompareColumns ucrBase.clsRsyntax.AddToAfterCodes(clsYinXOperator, iPosition:=1) Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) - ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY) + ucrSaveLogical.Location = New Point(ucrSaveLogical.Location.X, iBaseMaxY / 1.07) ElseIf rdoByRow.Checked Then ucrBase.clsRsyntax.SetBaseROperator(clsDummyOperator) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsYinXOperator) @@ -237,18 +237,19 @@ Public Class dlgCompareColumns End Sub Private Sub CheckDatatype() - If ucrReceiverSecond.IsEmpty OrElse ucrReceiverFirst.IsEmpty OrElse Not rdoByRow.Checked Then + If ucrReceiverSecond.IsEmpty OrElse ucrReceiverFirst.IsEmpty Then TestOkEnabled() Exit Sub Else If {"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType) Then + If rdoByRow.Checked Then ucrInputTolerance.Visible = True clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) clsLessorEqualToOperator.AddParameter("tol", "0", iPosition:=1) clsSummaryFunction.AddParameter("object", clsROperatorParameter:=clsLessorEqualToOperator, iPosition:=1) clsDummyOperator = clsLessorEqualToOperator End If - ElseIf ucrReceiverFirst.strCurrDataType = "date" AndAlso ucrReceiverSecond.strCurrDataType = "date" Then + ElseIf {"Date", "date"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso {"Date", "date"}.Contains(ucrReceiverSecond.strCurrDataType) Then If rdoByRow.Checked Then ucrInputTolerance.Visible = True clsLessorEqualToOperator.AddParameter("first", clsRFunctionParameter:=clsAbsoluteFunction, iPosition:=0) @@ -273,7 +274,7 @@ Public Class dlgCompareColumns clsDummyOperator = clsIsEqualToOperator End If Else - MsgBox("Receivers must have the same data type, OK will not be enabled") + MsgBox("Receivers must have the same data type, OK will not be enabled") End If End If TestOkEnabled() From 32ddead9261d9d201d8271ecfe55bf8a8990f00b Mon Sep 17 00:00:00 2001 From: Haward Ketoyo Date: Fri, 21 May 2021 10:10:23 +0300 Subject: [PATCH 10/10] updated code --- instat/dlgCompareColumns.vb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/instat/dlgCompareColumns.vb b/instat/dlgCompareColumns.vb index 232509f3143..b14616587ad 100644 --- a/instat/dlgCompareColumns.vb +++ b/instat/dlgCompareColumns.vb @@ -116,7 +116,6 @@ Public Class dlgCompareColumns ucrSaveLogical.SetLabelText("Save result for second column:") ucrSaveLogical.setLinkedReceiver(ucrReceiverSecond) - ucrBase.clsRsyntax.iCallType = 2 End Sub @@ -192,13 +191,13 @@ Public Class dlgCompareColumns ucrBase.OKEnabled(False) Else If ({"integer", "numeric"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso - {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse - (ucrReceiverFirst.strCurrDataType = "Date" AndAlso - ucrReceiverSecond.strCurrDataType = "Date") OrElse - ({"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso - {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse - (ucrReceiverFirst.strCurrDataType = "logical" AndAlso - ucrReceiverSecond.strCurrDataType = "logical") Then + {"integer", "numeric"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse + (ucrReceiverFirst.strCurrDataType = "Date" AndAlso + ucrReceiverSecond.strCurrDataType = "Date") OrElse + ({"factor", "character"}.Contains(ucrReceiverFirst.strCurrDataType) AndAlso + {"factor", "character"}.Contains(ucrReceiverSecond.strCurrDataType)) OrElse + (ucrReceiverFirst.strCurrDataType = "logical" AndAlso + ucrReceiverSecond.strCurrDataType = "logical") Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -274,7 +273,7 @@ Public Class dlgCompareColumns clsDummyOperator = clsIsEqualToOperator End If Else - MsgBox("Receivers must have the same data type, OK will not be enabled") + MsgBox("Receivers must have the same data type, OK will not be enabled") End If End If TestOkEnabled()