From fcb01b1ed6712413a5a5344d3f4461dff6c28608 Mon Sep 17 00:00:00 2001 From: n-thony Date: Sat, 11 Nov 2023 11:10:19 +0300 Subject: [PATCH 01/22] Set the focus to return to the first receiver always when re-opening a dialogue --- instat/ucrSelector.vb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 879349ac503..24c80c64154 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -63,6 +63,10 @@ Public Class ucrSelector 'always load selector contents on load event because contents may have been changed at R level 'and the control needs to refresh the data frame names. LoadList() + 'always return the focus to the first Receiver when re-opening the dialogue. + If lstOrderedReceivers.Count > 0 Then + SetCurrentReceiver(lstOrderedReceivers(0)) + End If End Sub Protected Sub OnResetAll() From b999d3ef2747b9bb02c83e97e1652ad080852aaf Mon Sep 17 00:00:00 2001 From: n-thony Date: Wed, 15 Nov 2023 18:37:47 +0300 Subject: [PATCH 02/22] code improvement and fixed tab orders in dlgDescribeTwoVariables --- instat/dlgDescribeTwoVariable.Designer.vb | 331 ++++++++++++---------- instat/ucrSelector.vb | 4 +- 2 files changed, 182 insertions(+), 153 deletions(-) diff --git a/instat/dlgDescribeTwoVariable.Designer.vb b/instat/dlgDescribeTwoVariable.Designer.vb index e4176b1f531..72f32dd229a 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() @@ -91,10 +91,11 @@ 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, 4, 4, 4) Me.rdoThreeVariable.Name = "rdoThreeVariable" - Me.rdoThreeVariable.Size = New System.Drawing.Size(100, 28) - Me.rdoThreeVariable.TabIndex = 26 + 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 Me.rdoThreeVariable.UseVisualStyleBackColor = True @@ -102,40 +103,44 @@ 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, 4, 4, 4) Me.cmdFormatTable.Name = "cmdFormatTable" - Me.cmdFormatTable.Size = New System.Drawing.Size(104, 23) - Me.cmdFormatTable.TabIndex = 44 + Me.cmdFormatTable.Size = New System.Drawing.Size(156, 34) + Me.cmdFormatTable.TabIndex = 23 Me.cmdFormatTable.Text = "Format Table..." Me.cmdFormatTable.UseVisualStyleBackColor = True ' '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.TabIndex = 35 + Me.lblThreeVariableSecondFactor.Size = New System.Drawing.Size(150, 22) + Me.lblThreeVariableSecondFactor.TabIndex = 10 Me.lblThreeVariableSecondFactor.Tag = "" Me.lblThreeVariableSecondFactor.Text = "Second Variable :" ' '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, 4, 4, 4) Me.cmdMissingOptions.Name = "cmdMissingOptions" - Me.cmdMissingOptions.Size = New System.Drawing.Size(105, 23) - Me.cmdMissingOptions.TabIndex = 46 + Me.cmdMissingOptions.Size = New System.Drawing.Size(158, 34) + Me.cmdMissingOptions.TabIndex = 21 Me.cmdMissingOptions.Text = "Missing Options..." Me.cmdMissingOptions.UseVisualStyleBackColor = True ' '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.TabIndex = 27 + Me.lbSecondVariable.Size = New System.Drawing.Size(150, 22) + Me.lbSecondVariable.TabIndex = 9 Me.lbSecondVariable.Tag = "" Me.lbSecondVariable.Text = "Second Variable:" ' @@ -143,10 +148,11 @@ 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.TabIndex = 31 + Me.lblFirstVariable.Size = New System.Drawing.Size(114, 20) + Me.lblFirstVariable.TabIndex = 5 Me.lblFirstVariable.Tag = "" Me.lblFirstVariable.Text = "First Variables:" ' @@ -159,86 +165,96 @@ 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, 4, 4, 4) Me.grpSummaries.Name = "grpSummaries" - Me.grpSummaries.Size = New System.Drawing.Size(210, 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.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(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.TabIndex = 1 + Me.lblSecondBy.Size = New System.Drawing.Size(25, 20) + Me.lblSecondBy.TabIndex = 6 Me.lblSecondBy.Text = "by" ' 'lblThreeVariableCategorical ' 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.TabIndex = 3 + Me.lblThreeVariableCategorical.Size = New System.Drawing.Size(86, 20) + Me.lblThreeVariableCategorical.TabIndex = 1 Me.lblThreeVariableCategorical.Text = "categorical" ' 'lblSummaryName ' 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.TabIndex = 5 + 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.TabIndex = 4 + Me.lblSummary.Size = New System.Drawing.Size(80, 20) + Me.lblSummary.TabIndex = 2 Me.lblSummary.Text = "Summary:" ' 'lblBy ' 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.TabIndex = 6 + Me.lblBy.Size = New System.Drawing.Size(25, 20) + Me.lblBy.TabIndex = 4 Me.lblBy.Text = "by" ' 'lblSecondType ' 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.TabIndex = 0 + 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.TabIndex = 29 + Me.lblFirstGroupByFactor.Size = New System.Drawing.Size(150, 22) + Me.lblFirstGroupByFactor.TabIndex = 7 Me.lblFirstGroupByFactor.Tag = "" Me.lblFirstGroupByFactor.Text = "Factor (Optional) :" ' @@ -250,10 +266,11 @@ 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, 4, 4, 4) Me.rdoSkim.Name = "rdoSkim" - Me.rdoSkim.Size = New System.Drawing.Size(100, 28) - Me.rdoSkim.TabIndex = 23 + Me.rdoSkim.Size = New System.Drawing.Size(150, 42) + Me.rdoSkim.TabIndex = 1 Me.rdoSkim.Text = "Skim" Me.rdoSkim.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSkim.UseVisualStyleBackColor = True @@ -261,19 +278,21 @@ 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.TabIndex = 37 + Me.lblThirdVariable.Size = New System.Drawing.Size(231, 22) + Me.lblThirdVariable.TabIndex = 13 Me.lblThirdVariable.Tag = "" Me.lblThirdVariable.Text = "Third Variable :" ' '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,10 +305,11 @@ 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, 4, 4, 4) Me.rdoTwoVariable.Name = "rdoTwoVariable" - Me.rdoTwoVariable.Size = New System.Drawing.Size(100, 28) - Me.rdoTwoVariable.TabIndex = 24 + 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 Me.rdoTwoVariable.UseVisualStyleBackColor = True @@ -297,9 +317,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, 4, 4, 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,10 +329,11 @@ 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.TabIndex = 54 + Me.lblMarginName.Size = New System.Drawing.Size(140, 22) + Me.lblMarginName.TabIndex = 19 Me.lblMarginName.Tag = "" Me.lblMarginName.Text = "Margin Name:" ' @@ -321,77 +343,80 @@ 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, 4, 4, 4) Me.grpDisplay.Name = "grpDisplay" - Me.grpDisplay.Size = New System.Drawing.Size(194, 115) - Me.grpDisplay.TabIndex = 56 + Me.grpDisplay.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpDisplay.Size = New System.Drawing.Size(291, 172) + 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(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 - 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.TabIndex = 56 + Me.lblFactorAsPercentage.Size = New System.Drawing.Size(231, 22) + Me.lblFactorAsPercentage.TabIndex = 2 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 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 = 58 + Me.ucrReceiverFirstVars.TabIndex = 6 Me.ucrReceiverFirstVars.ucrSelector = Nothing ' '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.TabIndex = 57 + 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.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.strNcFilePath = "" + Me.ucrReceiverPercentages.TabIndex = 3 + 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.Name = "ucrChkDisplayAsPercentage" + Me.ucrChkDisplayAsPercentage.Size = New System.Drawing.Size(214, 51) + Me.ucrChkDisplayAsPercentage.TabIndex = 1 ' 'ucrInputMarginName ' @@ -399,19 +424,19 @@ 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) + 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.TabIndex = 55 + 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) + 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.TabIndex = 52 + Me.ucrReorderSummary.Size = New System.Drawing.Size(291, 234) + Me.ucrReorderSummary.TabIndex = 16 Me.ucrReorderSummary.ucrDataFrameList = Nothing Me.ucrReorderSummary.ucrReceiver = Nothing ' @@ -419,44 +444,44 @@ 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) + 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.TabIndex = 53 + 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) + 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.TabIndex = 43 + 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.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(120, 20) + Me.ucrReceiverThreeVariableThirdVariable.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverThreeVariableThirdVariable.strNcFilePath = "" - Me.ucrReceiverThreeVariableThirdVariable.TabIndex = 38 + 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 @@ -465,13 +490,13 @@ Partial Class dlgDescribeTwoVariable ' Me.ucrReceiverSecondTwoVariableFactor.AutoSize = True Me.ucrReceiverSecondTwoVariableFactor.frmParent = Me - Me.ucrReceiverSecondTwoVariableFactor.Location = New System.Drawing.Point(310, 164) + 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(120, 20) + Me.ucrReceiverSecondTwoVariableFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverSecondTwoVariableFactor.strNcFilePath = "" - Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 25 + Me.ucrReceiverSecondTwoVariableFactor.TabIndex = 11 Me.ucrReceiverSecondTwoVariableFactor.ucrSelector = Nothing ' 'ucrSelectorDescribeTwoVar @@ -480,30 +505,30 @@ Partial Class dlgDescribeTwoVariable 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.TabIndex = 28 + 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) + 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.TabIndex = 22 + 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.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(120, 20) + Me.ucrReceiverThreeVariableSecondFactor.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverThreeVariableSecondFactor.strNcFilePath = "" Me.ucrReceiverThreeVariableSecondFactor.TabIndex = 36 Me.ucrReceiverThreeVariableSecondFactor.ucrSelector = Nothing @@ -512,11 +537,11 @@ Partial Class dlgDescribeTwoVariable ' 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 = 32 Me.ucrReceiverSkimrGroupByFactor.ucrSelector = Nothing @@ -525,27 +550,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) + 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.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.TabIndex = 59 + 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.ucrReceiverFirstVars) Me.Controls.Add(Me.ucrSaveTable) Me.Controls.Add(Me.grpDisplay) @@ -577,6 +603,7 @@ 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" diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index 24c80c64154..d9c7f478e63 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -65,7 +65,9 @@ Public Class ucrSelector LoadList() 'always return the focus to the first Receiver when re-opening the dialogue. If lstOrderedReceivers.Count > 0 Then - SetCurrentReceiver(lstOrderedReceivers(0)) + Dim lstVisibleReceivers = lstOrderedReceivers.Where(Function(ctrl) ctrl.Visible).ToList() + lstVisibleReceivers = lstVisibleReceivers.OrderBy(Function(ucr) ucr.TabIndex).ToList() + SetCurrentReceiver(lstVisibleReceivers(0)) End If End Sub From 395b21bf1d50898e0643000333b78759407d009f Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:33:16 +0100 Subject: [PATCH 03/22] Tidying up the Four variable model --- instat/dlgFourVariableModelling.Designer.vb | 14 +- instat/dlgFourVariableModelling.vb | 307 +++++++++++++------- 2 files changed, 210 insertions(+), 111 deletions(-) diff --git a/instat/dlgFourVariableModelling.Designer.vb b/instat/dlgFourVariableModelling.Designer.vb index ce87ae0c426..c2ea5402ad9 100644 --- a/instat/dlgFourVariableModelling.Designer.vb +++ b/instat/dlgFourVariableModelling.Designer.vb @@ -62,7 +62,6 @@ Partial Class dlgFourVariableModelling Me.cmdFirstExplanatoryFunction = New System.Windows.Forms.Button() Me.cmdSecondExplanatoryFunction = New System.Windows.Forms.Button() Me.cmdThirdExplanatoryFunction = New System.Windows.Forms.Button() - Me.UcrDialogDisabled1 = New instat.ucrDialogDisabled() Me.SuspendLayout() ' 'cmdModelOptions @@ -270,7 +269,7 @@ Partial Class dlgFourVariableModelling Me.ucrBaseFourVariableModelling.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrBaseFourVariableModelling.Location = New System.Drawing.Point(10, 406) Me.ucrBaseFourVariableModelling.Name = "ucrBaseFourVariableModelling" - Me.ucrBaseFourVariableModelling.Size = New System.Drawing.Size(405, 52) + Me.ucrBaseFourVariableModelling.Size = New System.Drawing.Size(408, 52) Me.ucrBaseFourVariableModelling.TabIndex = 23 ' 'ucrSaveModel @@ -318,22 +317,12 @@ Partial Class dlgFourVariableModelling Me.cmdThirdExplanatoryFunction.Text = "Function..." Me.cmdThirdExplanatoryFunction.UseVisualStyleBackColor = True ' - 'UcrDialogDisabled1 - ' - Me.UcrDialogDisabled1.AutoSize = True - Me.UcrDialogDisabled1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.UcrDialogDisabled1.Location = New System.Drawing.Point(125, 143) - Me.UcrDialogDisabled1.Name = "UcrDialogDisabled1" - Me.UcrDialogDisabled1.Size = New System.Drawing.Size(218, 117) - Me.UcrDialogDisabled1.TabIndex = 24 - ' 'dlgFourVariableModelling ' 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(546, 460) - Me.Controls.Add(Me.UcrDialogDisabled1) Me.Controls.Add(Me.cmdThirdExplanatoryFunction) Me.Controls.Add(Me.cmdSecondExplanatoryFunction) Me.Controls.Add(Me.cmdFirstExplanatoryFunction) @@ -394,5 +383,4 @@ Partial Class dlgFourVariableModelling Friend WithEvents cmdFirstExplanatoryFunction As Button Friend WithEvents cmdThirdExplanatoryFunction As Button Friend WithEvents cmdSecondExplanatoryFunction As Button - Friend WithEvents UcrDialogDisabled1 As ucrDialogDisabled End Class diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index 256923b4fc0..3a7ff40ce16 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -17,25 +17,29 @@ Imports instat.Translations Public Class dlgFourVariableModelling Public bFirstLoad As Boolean = True - Public bReset As Boolean = True - Public bRCodeSet As Boolean = False + Private bReset As Boolean = True Public bResetModelOptions As Boolean = False + Public bResetThirdFunction As Boolean = False Public bResetDisplayOptions As Boolean = False Public bResetFirstFunction As Boolean = False Public bResetSecondFunction As Boolean = False - Public bResetThirdFunction As Boolean = False + Public bRCodeSet As Boolean = False Public clsRCIFunction, clsRConvert, clsFamilyFunction, clsVisReg As New RFunction - Public clsRSingleModelFunction, clsRNumeric, clsGLM, clsLM, clsFormulaFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsFormulaOperator As ROperator - Private clsFirstPowerOperator, clsSecondPowerOperator, clsThirdPowerOperator As ROperator - Public clsSecoandndThirdExplanatoryOpertor, clsOverallExplanatoryOperator As New ROperator - Private clsAnovaFunction, clsLMOrGLM, clsLmer, clsGlmer As RFunction - Private clsFirstTransformFunction, clsSecondTransformFunction, clsThirdTransformFunction As New RFunction - Private dctPlotFunctions As New Dictionary(Of String, RFunction) + Public clsRSingleModelFunction, clsThirdTransformFunction, clsLmer, clsGlmer, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction + Public clsFormulaOperator As New ROperator + Public clsGLM, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction + Private clsExplanatoryOperator As New ROperator + Private clsFirstTransformFunction As New RFunction + Private clsFirstPowerOperator, clsThirdPowerOperator, clsSecoandndThirdExplanatoryOpertor, clsOverallExplanatoryOperator As New ROperator + Private clsSecondTransformFunction As New RFunction + Private clsSecondPowerOperator As New ROperator + + Private dctPlotFunctions As New Dictionary(Of String, RFunction) + Private Sub dlgFourVariableModelling_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() @@ -51,29 +55,33 @@ Public Class dlgFourVariableModelling End Sub Private Sub InitialiseDialog() - ucrBaseFourVariableModelling.iHelpTopicID = 385 + ucrBaseFourVariableModelling.clsRsyntax.iCallType = 2 + ucrBaseFourVariableModelling.iHelpTopicID = 385 ucrBaseFourVariableModelling.clsRsyntax.bExcludeAssignedFunctionOutput = False ucrSelectorFourVariableModelling.SetParameter(New RParameter("data", 0)) ucrSelectorFourVariableModelling.SetParameterIsrfunction() - ucrReceiverResponse.SetParameter(New RParameter("x", 1)) + 'The main parameter will be in the as.numeric() function since it's always present there + ucrReceiverResponse.SetParameter(New RParameter("x", 0)) ucrReceiverResponse.SetParameterIsString() ucrReceiverResponse.bWithQuotes = False ucrReceiverResponse.Selector = ucrSelectorFourVariableModelling - ucrReceiverFirstExplanatory.SetParameter(New RParameter("x", 2)) + 'The main parameter will be in the transformation function since it's always present there + ucrReceiverFirstExplanatory.SetParameter(New RParameter("x", 0)) ucrReceiverFirstExplanatory.SetParameterIsString() ucrReceiverFirstExplanatory.bWithQuotes = False ucrReceiverFirstExplanatory.Selector = ucrSelectorFourVariableModelling - ucrReceiverSecondExplanatory.SetParameter(New RParameter("x", 3)) + 'The main parameter will be in the transformation function since it's always present there + ucrReceiverSecondExplanatory.SetParameter(New RParameter("x", 0)) ucrReceiverSecondExplanatory.SetParameterIsString() ucrReceiverSecondExplanatory.bWithQuotes = False ucrReceiverSecondExplanatory.Selector = ucrSelectorFourVariableModelling - ucrReceiverThirdExplanatory.SetParameter(New RParameter("x", 4)) + ucrReceiverThirdExplanatory.SetParameter(New RParameter("x", 0)) ucrReceiverThirdExplanatory.SetParameterIsString() ucrReceiverThirdExplanatory.bWithQuotes = False ucrReceiverThirdExplanatory.Selector = ucrSelectorFourVariableModelling @@ -92,6 +100,10 @@ Public Class dlgFourVariableModelling ucrSaveModel.SetIsComboBox() ucrSaveModel.SetAssignToIfUncheckedValue("last_model") + ucrChkConvertToNumeric.SetText("Convert to Variate") + ucrChkConvertToNumeric.AddParameterIsRFunctionCondition(True, "y", True) + ucrChkConvertToNumeric.AddParameterIsRFunctionCondition(False, "y", False) + ucrInputModelOperators1.SetItems({"+", "*", ":", "/", "|"}) ucrInputModelOperators1.SetDropDownStyleAsNonEditable() @@ -99,19 +111,22 @@ Public Class dlgFourVariableModelling ucrInputModelOperators2.SetDropDownStyleAsNonEditable() ucrModelPreview.IsReadOnly = True + + 'temp hidden until working + 'cmdResponseFunction.Visible = False End Sub Private Sub SetDefaults() clsFamilyFunction = New RFunction - clsRNumeric = New RFunction + clsAsNumeric = New RFunction clsLM = New RFunction clsGLM = New RFunction + clsFirstTransformFunction = New RFunction + clsSecondTransformFunction = New RFunction clsFormulaFunction = New RFunction clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction - clsFirstTransformFunction = New RFunction - clsSecondTransformFunction = New RFunction clsThirdTransformFunction = New RFunction clsLmer = New RFunction clsLMOrGLM = New RFunction @@ -122,6 +137,14 @@ Public Class dlgFourVariableModelling clsResidualFunction = New RFunction clsFittedValuesFunction = New RFunction + clsFirstTransformFunction = New RFunction + clsFirstPowerOperator = New ROperator + clsSecondTransformFunction = New RFunction + clsSecondPowerOperator = New ROperator + + clsFormulaOperator = New ROperator + clsExplanatoryOperator = New ROperator + clsFirstPowerOperator = New ROperator clsSecondPowerOperator = New ROperator clsThirdPowerOperator = New ROperator @@ -129,8 +152,15 @@ Public Class dlgFourVariableModelling clsSecoandndThirdExplanatoryOpertor = New ROperator clsOverallExplanatoryOperator = New ROperator + clsRstandardFunction = New RFunction + clsHatvaluesFunction = New RFunction + clsResidualFunction = New RFunction + clsFittedValuesFunction = New RFunction + ucrSelectorFourVariableModelling.Reset() ucrReceiverResponse.SetMeAsReceiver() + ucrChkConvertToNumeric.Visible = False + ucrBaseFourVariableModelling.clsRsyntax.ClearCodes() clsSecoandndThirdExplanatoryOpertor.SetOperation("*") @@ -140,7 +170,7 @@ Public Class dlgFourVariableModelling ucrSaveModel.Reset() ucrModelPreview.Reset() - clsRNumeric.SetRCommand("as.numeric") + clsAsNumeric.SetRCommand("as.numeric") clsFormulaOperator = clsRegressionDefaults.clsDefaultFormulaOperator.Clone clsFormulaOperator.AddParameter("operator", clsROperatorParameter:=clsOverallExplanatoryOperator, iPosition:=1) @@ -150,50 +180,75 @@ Public Class dlgFourVariableModelling clsOverallExplanatoryOperator.AddParameter("operator2&3", clsROperatorParameter:=clsSecoandndThirdExplanatoryOpertor, iPosition:=1) clsOverallExplanatoryOperator.bBrackets = False + clsLM = clsRegressionDefaults.clsDefaultLmFunction.Clone() clsLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsLM.AddParameter("na.action", "na.exclude", iPosition:=4) + clsLM.bExcludeAssignedFunctionOutput = False + clsLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") + clsLmer.SetPackageName("lme4") clsLmer.SetRCommand("lmer") clsLmer.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGlmer.SetPackageName("lme4") clsGlmer.SetRCommand("glmer") clsGlmer.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) clsGlmer.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLM.bExcludeAssignedFunctionOutput = False + clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") + + clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsFirstPowerOperator.SetOperation("^") + clsFirstPowerOperator.AddParameter("power", 2, iPosition:=1) + clsFirstPowerOperator.bBrackets = False + + clsSecondPowerOperator.SetOperation("^") + clsSecondPowerOperator.AddParameter("power", 2, iPosition:=1) + clsSecondPowerOperator.bBrackets = False + 'Residual Plots dctPlotFunctions = New Dictionary(Of String, RFunction)(clsRegressionDefaults.dctModelPlotFunctions) 'Model clsFormulaFunction = clsRegressionDefaults.clsDefaultFormulaFunction.Clone - clsFormulaFunction.iCallType = 2 + clsFormulaFunction.bExcludeAssignedFunctionOutput = False 'Summary clsSummaryFunction = clsRegressionDefaults.clsDefaultSummary.Clone - clsSummaryFunction.iCallType = 2 + clsSummaryFunction.bExcludeAssignedFunctionOutput = False 'ANOVA clsAnovaFunction = clsRegressionDefaults.clsDefaultAnovaFunction.Clone - clsAnovaFunction.iCallType = 2 + clsAnovaFunction.bExcludeAssignedFunctionOutput = False 'Confidence Interval clsConfint = clsRegressionDefaults.clsDefaultConfint.Clone - clsConfint.iCallType = 2 + clsConfint.bExcludeAssignedFunctionOutput = False 'FitModel clsVisReg.SetPackageName("visreg") clsVisReg.SetRCommand("visreg") clsVisReg.AddParameter("type", Chr(34) & "conditional" & Chr(34)) + 'changed gg parameter to FALSE since when TRUE no plot is given (not compatible with ggplot2 package) clsVisReg.AddParameter("gg", "FALSE") - clsVisReg.iCallType = 3 clsVisReg.bExcludeAssignedFunctionOutput = False clsFirstPowerOperator.SetOperation("^") @@ -207,22 +262,15 @@ Public Class dlgFourVariableModelling clsThirdPowerOperator.SetOperation("^") clsThirdPowerOperator.AddParameter("power", 2, iPosition:=1) clsThirdPowerOperator.bBrackets = False - - clsLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsGLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsLmer.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsGlmer.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsResidualFunction.SetRCommand("residuals") clsFittedValuesFunction.SetRCommand("fitted.values") clsRstandardFunction.SetRCommand("rstandard") clsHatvaluesFunction.SetRCommand("hatvalues") + clsLMOrGLM = clsLmer ucrBaseFourVariableModelling.clsRsyntax.SetBaseRFunction(clsLmer) - ucrBaseFourVariableModelling.clsRsyntax.AddToAfterCodes(clsAnovaFunction, 1) ucrBaseFourVariableModelling.clsRsyntax.AddToAfterCodes(clsSummaryFunction, 2) - clsLMOrGLM = clsLmer bResetModelOptions = True bResetDisplayOptions = True @@ -233,9 +281,79 @@ Public Class dlgFourVariableModelling TestOKEnabled() End Sub + Private Sub assignToControlsChanged(ucrChangedControl As ucrCore) Handles ucrSaveModel.ControlValueChanged + + '--------------------------------------------------------------------- + 'model summaries outputs + + 'stats output formula for the model + clsFormulaFunction.AddParameter("x", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsFormulaFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + 'anova output summary for the model + clsAnovaFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsAnovaFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + 'estimates output for the model + clsSummaryFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsSummaryFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + + 'confidence output limits for the model + clsConfint.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsConfint.SetAssignToOutputObject(strRObjectToAssignTo:="last_summary", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Summary, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_summary") + + '--------------------------------------------------------------------- + 'column outputs + 'note set assign has not been set here because it's done at the sub dialog level + 'through individual save controls linked to this dialog data frame selector + + clsResidualFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsFittedValuesFunction.AddParameter("object", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsRstandardFunction.AddParameter("model", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsHatvaluesFunction.AddParameter("model", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + + '--------------------------------------------------------------------- + 'graphical outputs + + 'model plot output + clsVisReg.AddParameter("fit", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + clsVisReg.SetAssignToOutputObject(strRObjectToAssignTo:="last_graph", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Graph, + strRObjectFormatToAssignTo:=RObjectFormat.Image, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_graph") + + 'residual plots outputs + For Each kvp As KeyValuePair(Of String, RFunction) In dctPlotFunctions + kvp.Value.AddParameter("x", strParameterValue:=clsLMOrGLM.GetRObjectToAssignTo(), iPosition:=0) + kvp.Value.SetAssignToOutputObject(strRObjectToAssignTo:="last_graph", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Graph, + strRObjectFormatToAssignTo:=RObjectFormat.Image, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_graph") + Next + + End Sub + Private Sub SetRCodeForControls(bReset As Object) bRCodeSet = False - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) ucrSaveModel.AddAdditionalRCode(clsGlmer, 2) ucrSaveModel.AddAdditionalRCode(clsLmer, 3) @@ -246,12 +364,11 @@ Public Class dlgFourVariableModelling ucrInputModelOperators1.SetName(clsOverallExplanatoryOperator.strOperation) ucrInputModelOperators2.SetName(clsSecoandndThirdExplanatoryOpertor.strOperation) - ucrChkConvertToNumeric.SetRCode(clsFormulaOperator, bReset) ucrSelectorFourVariableModelling.SetRCode(clsLM, bReset) ucrSaveModel.SetRCode(clsLM, bReset) ucrDistributionChoice.SetRCode(clsFamilyFunction, bReset) - ucrReceiverResponse.SetRCode(clsRNumeric, bReset) + ucrReceiverResponse.SetRCode(clsAsNumeric, bReset) ucrReceiverFirstExplanatory.SetRCode(clsFirstTransformFunction, bReset) ucrReceiverSecondExplanatory.SetRCode(clsSecondTransformFunction, bReset) ucrReceiverThirdExplanatory.SetRCode(clsThirdTransformFunction, bReset) @@ -261,16 +378,13 @@ Public Class dlgFourVariableModelling SecondExplanatoryFunctionEnabled() ThirdExplanatoryFunctionEnabled() TestOKEnabled() - End Sub Public Sub TestOKEnabled() - ucrBaseFourVariableModelling.OKEnabled(False) ' temp. disabled - If (Not ucrReceiverResponse.IsEmpty()) AndAlso (Not ucrReceiverFirstExplanatory.IsEmpty()) AndAlso (Not ucrReceiverSecondExplanatory.IsEmpty()) AndAlso (Not ucrReceiverThirdExplanatory.IsEmpty()) AndAlso (ucrInputModelOperators1.GetText <> "") AndAlso (ucrInputModelOperators2.GetText <> "") Then - ' ucrBaseFourVariableModelling.OKEnabled(True) - UpdatePreview() - ' Else - ' ucrBaseFourVariableModelling.OKEnabled(False) + If Not ucrReceiverResponse.IsEmpty AndAlso Not ucrReceiverFirstExplanatory.IsEmpty AndAlso Not ucrReceiverSecondExplanatory.IsEmpty AndAlso Not ucrInputModelOperators1.IsEmpty AndAlso Not ucrInputModelOperators2.IsEmpty AndAlso Not ucrDistributionChoice.ucrInputDistributions.IsEmpty Then + ucrBaseFourVariableModelling.OKEnabled(True) + Else + ucrBaseFourVariableModelling.OKEnabled(False) End If End Sub @@ -286,15 +400,18 @@ Public Class dlgFourVariableModelling If bRCodeSet Then If Not ucrReceiverResponse.IsEmpty Then ucrDistributionChoice.RecieverDatatype(ucrSelectorFourVariableModelling.ucrAvailableDataFrames.cboAvailableDataFrames.Text, ucrReceiverResponse.GetVariableNames(bWithQuotes:=False)) - If ucrReceiverResponse.strCurrDataType = "numeric" Then ucrChkConvertToNumeric.Checked = False ucrChkConvertToNumeric.Visible = False + 'temp disabled + 'cmdResponseFunction.Visible = True Else ucrChkConvertToNumeric.Visible = True + 'temp disabled + 'cmdResponseFunction.Visible = False End If If ucrChkConvertToNumeric.Checked Then - clsFormulaOperator.AddParameter("y", clsRFunctionParameter:=clsRNumeric, iPosition:=0) + clsFormulaOperator.AddParameter("y", clsRFunctionParameter:=clsAsNumeric, iPosition:=0) ucrDistributionChoice.RecieverDatatype("numeric") Else clsFormulaOperator.AddParameter("y", ucrReceiverResponse.GetVariableNames(False), iPosition:=0) @@ -303,9 +420,10 @@ Public Class dlgFourVariableModelling End If Else ucrChkConvertToNumeric.Visible = False + 'temp disabled + 'cmdResponseFunction.Visible = False End If - - If ucrDistributionChoice.lstCurrentDistributions.Count = 0 Or ucrReceiverResponse.IsEmpty() Then + If ucrDistributionChoice.lstCurrentDistributions.Count = 0 OrElse ucrReceiverResponse.IsEmpty() Then ucrDistributionChoice.Enabled = False ucrDistributionChoice.ucrInputDistributions.SetName("") cmdModelOptions.Enabled = False @@ -313,25 +431,21 @@ Public Class dlgFourVariableModelling ucrDistributionChoice.Enabled = True cmdModelOptions.Enabled = True End If - ' UpdatePreview() + UpdatePreview() TestOKEnabled() End If End Sub - Private Sub FirstExplanatoryFunctionEnabled() - If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then - cmdFirstExplanatoryFunction.Enabled = True - Else - cmdFirstExplanatoryFunction.Enabled = False - End If + Private Sub ResponseControls_ControlValueChanged() Handles ucrReceiverResponse.ControlValueChanged, ucrChkConvertToNumeric.ControlValueChanged + SetBaseFunction() + ResponseConvert() + UpdatePreview() End Sub - Private Sub SecondExplanatoryFunctionEnabled() - If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then - cmdSecondExplanatoryFunction.Enabled = True - Else - cmdSecondExplanatoryFunction.Enabled = False - End If + Private Sub ucrBaseFourVariableModellingThreeVariableModelling_ClickReset(sender As Object, e As EventArgs) Handles ucrBaseFourVariableModelling.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() End Sub Private Sub ThirdExplanatoryFunctionEnabled() @@ -348,46 +462,18 @@ Public Class dlgFourVariableModelling TestOKEnabled() End Sub - Public Sub SetBaseFunction() + Private Sub SetBaseFunction() If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso Not ucrReceiverSecondExplanatory.IsEmpty AndAlso Not ucrReceiverResponse.IsEmpty Then - 'TODO: Include multinomial as an option And the appropriate function + If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal" And ucrInputModelOperators2.GetText <> "|") Then - 'sdgSimpleRegOptions.chkDisplayCLimits.Enabled = True - 'sdgSimpleRegOptions.lblConfLevel.Enabled = True - 'sdgSimpleRegOptions.nudDisplayCLevel.Enabled = True clsLMOrGLM = clsLM ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal" And ucrInputModelOperators2.GetText = "|") Then - ' sdgSimpleRegOptions.chkDisplayCLimits.Checked = False - ' sdgSimpleRegOptions.chkDisplayCLimits.Enabled = False - ' sdgSimpleRegOptions.lblConfLevel.Enabled = False - ' sdgSimpleRegOptions.nudDisplayCLevel.Enabled = False clsLMOrGLM = clsLmer ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag <> "Normal" And ucrInputModelOperators2.GetText = "|") Then - 'sdgSimpleRegOptions.chkDisplayCLimits.Checked = False - 'sdgSimpleRegOptions.chkDisplayCLimits.Enabled = False - ' sdgSimpleRegOptions.lblConfLevel.Enabled = False - 'sdgSimpleRegOptions.nudDisplayCLevel.Enabled = False clsLMOrGLM = clsGlmer Else - ' sdgSimpleRegOptions.chkDisplayCLimits.Enabled = True - ' sdgSimpleRegOptions.lblConfLevel.Enabled = True - 'sdgSimpleRegOptions.nudDisplayCLevel.Enabled = True clsLMOrGLM = clsGLM End If - clsFormulaFunction.AddParameter("x", clsRFunctionParameter:=clsLMOrGLM) - clsAnovaFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsSummaryFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsConfint.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsVisReg.AddParameter("fit", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - - For Each kvp As KeyValuePair(Of String, RFunction) In dctPlotFunctions - kvp.Value.AddParameter("x", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - Next - - clsResidualFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsFittedValuesFunction.AddParameter("object", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsRstandardFunction.AddParameter("model", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) - clsHatvaluesFunction.AddParameter("model", clsRFunctionParameter:=clsLMOrGLM, iPosition:=0) ucrBaseFourVariableModelling.clsRsyntax.SetBaseRFunction(clsLMOrGLM) End If End Sub @@ -399,6 +485,11 @@ Public Class dlgFourVariableModelling bResetDisplayOptions = False End Sub + Public Sub ucrFamily_cboDistributionsIndexChanged() Handles ucrDistributionChoice.DistributionsIndexChanged + SetBaseFunction() + clsFamilyFunction.RemoveParameterByName("link") + End Sub + Private Sub cmdModelOptions_Click(sender As Object, e As EventArgs) Handles cmdModelOptions.Click Dim clsTempParam As RParameter = Nothing @@ -415,20 +506,24 @@ Public Class dlgFourVariableModelling SetBaseFunction() End Sub - Private Sub cmdFirstFunction_Click(sender As Object, e As EventArgs) Handles cmdFirstExplanatoryFunction.Click + Private Sub cmdFirstExplanatoryFunction_Click(sender As Object, e As EventArgs) Handles cmdFirstExplanatoryFunction.Click sdgVariableTransformations.SetRCodeForControls(clsNewFormulaOperator:=clsOverallExplanatoryOperator, clsNewTransformParameter:=clsOverallExplanatoryOperator.GetParameter("var2"), clsNewTransformFunction:=clsFirstTransformFunction, clsNewPowerOperator:=clsFirstPowerOperator, strVariableName:=ucrReceiverFirstExplanatory.GetVariableNames(False), bReset:=bResetFirstFunction) sdgVariableTransformations.ShowDialog() bResetFirstFunction = False UpdatePreview() End Sub - Private Sub cmdSecondFunction_Click(sender As Object, e As EventArgs) Handles cmdSecondExplanatoryFunction.Click + Private Sub cmdSecondExplanatoryFunction_Click(sender As Object, e As EventArgs) Handles cmdSecondExplanatoryFunction.Click sdgVariableTransformations.SetRCodeForControls(clsNewFormulaOperator:=clsSecoandndThirdExplanatoryOpertor, clsNewTransformParameter:=clsSecoandndThirdExplanatoryOpertor.GetParameter("var3"), clsNewTransformFunction:=clsSecondTransformFunction, clsNewPowerOperator:=clsSecondPowerOperator, strVariableName:=ucrReceiverSecondExplanatory.GetVariableNames(False), bReset:=bResetSecondFunction) sdgVariableTransformations.ShowDialog() bResetSecondFunction = False UpdatePreview() End Sub + Private Sub ucrReceiverFirstExplanatory_contents() Handles ucrReceiverResponse.ControlContentsChanged, ucrReceiverFirstExplanatory.ControlContentsChanged, ucrReceiverSecondExplanatory.ControlContentsChanged, ucrInputModelOperators1.ControlContentsChanged, ucrInputModelOperators2.ControlContentsChanged, ucrReceiverThirdExplanatory.ControlContentsChanged + TestOKEnabled() + End Sub + Private Sub cmdThirdFunction_Click(sender As Object, e As EventArgs) Handles cmdThirdExplanatoryFunction.Click sdgVariableTransformations.SetRCodeForControls(clsNewFormulaOperator:=clsSecoandndThirdExplanatoryOpertor, clsNewTransformParameter:=clsSecoandndThirdExplanatoryOpertor.GetParameter("var4"), clsNewTransformFunction:=clsThirdTransformFunction, clsNewPowerOperator:=clsThirdPowerOperator, strVariableName:=ucrReceiverThirdExplanatory.GetVariableNames(False), bReset:=bResetThirdFunction) sdgVariableTransformations.ShowDialog() @@ -488,6 +583,7 @@ Public Class dlgFourVariableModelling ' UpdatePreview() End Sub + Private Sub ucrReceiverSecondExplanatory_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverSecondExplanatory.ControlValueChanged If bRCodeSet Then If Not ucrReceiverSecondExplanatory.IsEmpty Then @@ -498,7 +594,7 @@ Public Class dlgFourVariableModelling End If SetBaseFunction() SecondExplanatoryFunctionEnabled() - ' UpdatePreview() + UpdatePreview() End Sub Private Sub ucrReceiverThirdExplanatory_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverThirdExplanatory.ControlValueChanged @@ -511,13 +607,26 @@ Public Class dlgFourVariableModelling End If SetBaseFunction() ThirdExplanatoryFunctionEnabled() - ' UpdatePreview() + UpdatePreview() End Sub - Private Sub ucrReceiverFirstExplanatory_contents() Handles ucrReceiverResponse.ControlContentsChanged, ucrReceiverFirstExplanatory.ControlContentsChanged, ucrReceiverSecondExplanatory.ControlContentsChanged, ucrInputModelOperators1.ControlContentsChanged, ucrInputModelOperators2.ControlContentsChanged, ucrReceiverThirdExplanatory.ControlContentsChanged - TestOKEnabled() + Private Sub FirstExplanatoryFunctionEnabled() + If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then + cmdFirstExplanatoryFunction.Enabled = True + Else + cmdFirstExplanatoryFunction.Enabled = False + End If + End Sub + + Private Sub SecondExplanatoryFunctionEnabled() + If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then + cmdSecondExplanatoryFunction.Enabled = True + Else + cmdSecondExplanatoryFunction.Enabled = False + End If End Sub + Private Sub ucrInputModelOperators1_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputModelOperators1.ControlValueChanged SetBaseFunction() SetOverallExplanatoryOperator() @@ -529,4 +638,6 @@ Public Class dlgFourVariableModelling SetSecondandThirdExplanatoryOperator() UpdatePreview() End Sub + + End Class \ No newline at end of file From 14ffb31561a500024e22e9efb857fbceb71effe3 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 24 Nov 2023 02:28:38 +0300 Subject: [PATCH 04/22] null checking in sdgplots --- instat/sdgPlots.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/sdgPlots.vb b/instat/sdgPlots.vb index 53975f24814..2a231452e89 100644 --- a/instat/sdgPlots.vb +++ b/instat/sdgPlots.vb @@ -825,7 +825,7 @@ Public Class sdgPlots Private Function GetAesParameterArgValue(strAes As String) As String Dim strVariable As String = "" - If clsGlobalAesFunction.ContainsParameter(strAes) Then + If clsGlobalAesFunction IsNot Nothing AndAlso clsGlobalAesFunction.ContainsParameter(strAes) Then strVariable = clsGlobalAesFunction.GetParameter(strAes).strArgumentValue End If From 12d23ffd56aafb0bad4ab80eca24b7239da68c11 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 24 Nov 2023 02:46:33 +0300 Subject: [PATCH 05/22] more null checks --- instat/sdgPlots.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/sdgPlots.vb b/instat/sdgPlots.vb index 2a231452e89..3c2fa40586e 100644 --- a/instat/sdgPlots.vb +++ b/instat/sdgPlots.vb @@ -837,7 +837,7 @@ Public Class sdgPlots strAes = If(bIsX, "x", "y") Dim bIsFactor As Boolean = False - If clsGlobalAesFunction.ContainsParameter(strAes) Then + If clsGlobalAesFunction IsNot Nothing AndAlso clsGlobalAesFunction.ContainsParameter(strAes) Then Dim strCurrDataType As String = "" Dim clsGetDataType As New RFunction From 828115cf2a3b5bdadf85acbebf8a1798c095fe02 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Fri, 24 Nov 2023 12:40:06 +0100 Subject: [PATCH 06/22] Added AOV and tidy 4-variable modelling --- instat/clsDistribution.vb | 3 +- instat/clsRegressionDefaults.vb | 10 ++++++ instat/dlgFourVariableModelling.vb | 15 ++++++++- instat/ucrDistributions.vb | 52 ++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) diff --git a/instat/clsDistribution.vb b/instat/clsDistribution.vb index 0dcd630c5e7..190efbc2e62 100644 --- a/instat/clsDistribution.vb +++ b/instat/clsDistribution.vb @@ -25,6 +25,7 @@ Public Class Distribution Public strDFunctionName As String = "" Public strExactName As String = "" Public strGLMFunctionName As String = "" + Public strAOVFunctionName As String = "" Public bIncluded As Boolean = True Public bNumeric As Boolean = False @@ -77,7 +78,7 @@ Public Class Distribution End Sub Public Function IsDistributionFunction(strFunctionName As String) As Boolean - Dim strNames() As String = {strRFunctionName, strPFunctionName, strQFunctionName, strDFunctionName, strExactName, strGLMFunctionName} + Dim strNames() As String = {strRFunctionName, strPFunctionName, strQFunctionName, strDFunctionName, strExactName, strGLMFunctionName, strAOVFunctionName} Return strNames.Contains(strFunctionName) End Function End Class diff --git a/instat/clsRegressionDefaults.vb b/instat/clsRegressionDefaults.vb index fcc166aeff4..3756ced2223 100644 --- a/instat/clsRegressionDefaults.vb +++ b/instat/clsRegressionDefaults.vb @@ -67,6 +67,16 @@ Public Class clsRegressionDefaults End Get End Property + Public Shared ReadOnly Property clsDefaultAovFunction As RFunction + Get + + Dim clsDefaultAovFunc As New RFunction + + clsDefaultAovFunc.SetRCommand("aov") + Return clsDefaultAovFunc + End Get + End Property + Public Shared ReadOnly Property clsDefaultRGraphicsOperator As ROperator Get diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index 3a7ff40ce16..def5d9d542b 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -27,7 +27,7 @@ Public Class dlgFourVariableModelling Public clsRCIFunction, clsRConvert, clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsThirdTransformFunction, clsLmer, clsGlmer, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction Public clsFormulaOperator As New ROperator - Public clsGLM, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLM, clsAOV, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -120,6 +120,7 @@ Public Class dlgFourVariableModelling clsFamilyFunction = New RFunction clsAsNumeric = New RFunction clsLM = New RFunction + clsAOV = New RFunction clsGLM = New RFunction clsFirstTransformFunction = New RFunction clsSecondTransformFunction = New RFunction @@ -212,6 +213,14 @@ Public Class dlgFourVariableModelling strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, strObjectName:="last_model") + clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOV.bExcludeAssignedFunctionOutput = False + clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) @@ -357,10 +366,12 @@ Public Class dlgFourVariableModelling ucrSaveModel.AddAdditionalRCode(clsGLM, 1) ucrSaveModel.AddAdditionalRCode(clsGlmer, 2) ucrSaveModel.AddAdditionalRCode(clsLmer, 3) + ucrSaveModel.AddAdditionalRCode(clsAOV, 4) ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorFourVariableModelling.GetParameter(), 1) ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGlmer, ucrSelectorFourVariableModelling.GetParameter(), 2) ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsLmer, ucrSelectorFourVariableModelling.GetParameter(), 3) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorFourVariableModelling.GetParameter(), 4) ucrInputModelOperators1.SetName(clsOverallExplanatoryOperator.strOperation) ucrInputModelOperators2.SetName(clsSecoandndThirdExplanatoryOpertor.strOperation) @@ -471,6 +482,8 @@ Public Class dlgFourVariableModelling clsLMOrGLM = clsLmer ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag <> "Normal" And ucrInputModelOperators2.GetText = "|") Then clsLMOrGLM = clsGlmer + ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then + clsLMOrGLM = clsAOV Else clsLMOrGLM = clsGLM End If diff --git a/instat/ucrDistributions.vb b/instat/ucrDistributions.vb index c5421a64138..d22f5f3c680 100644 --- a/instat/ucrDistributions.vb +++ b/instat/ucrDistributions.vb @@ -126,6 +126,13 @@ Public Class ucrDistributions End Sub + Public Sub SetAOVDistributions() + + strDistributionType = "AOVFunctions" + SetDistributions() + + End Sub + Public Sub SetExactDistributions() ' this addition is temporary strDistributionType = "ExactSolution" SetDistributions() @@ -187,6 +194,39 @@ Public Class ucrDistributions End If End Select End If + Case "AOVFunctions" + If (Dist.strAOVFunctionName <> "") Then + Select Case strDataType + Case "logical" + If Dist.bTwoLevelFactor Then + bUse = True + End If + Case "numeric", "integer" + If Dist.bNumeric Then + bUse = True + End If + Case "positive integer" + If Dist.bPositiveInt Or Dist.bNumeric Then + bUse = True + End If + Case "two level numeric" + If Dist.bNumeric Or Dist.bTwoLevelFactor Then + bUse = True + End If + Case "two level factor" + If Dist.bTwoLevelFactor Then + bUse = True + End If + Case "factor" + If Dist.bFactor Then + bUse = True + End If + Case "ordered,factor" + If Dist.bFactor Then + bUse = True + End If + End Select + End If Case Else If Dist.strRName <> "" Then bUse = True @@ -239,6 +279,7 @@ Public Class ucrDistributions Dim clsGlmNegativeBinomialDist As New Distribution Dim clsPolarDist As New Distribution Dim clsMultinomDist As New Distribution + Dim clsNormalAovDist As New Distribution ' Normal distribution clsNormalDist.strNameTag = "Normal" @@ -257,6 +298,15 @@ Public Class ucrDistributions clsNormalDist.AddParameter("sd", "Standard_deviation", 1) lstAllDistributions.Add(clsNormalDist) + ' AOV distribution + clsNormalAovDist.strNameTag = "Normal_aov" + clsNormalAovDist.strRName = "aov" + clsNormalAovDist.strGLMFunctionName = "aov" + clsNormalAovDist.strAOVFunctionName = "aov" + clsNormalAovDist.bNumeric = True + clsNormalAovDist.bIsContinuous = True + lstAllDistributions.Add(clsNormalAovDist) + ' Exponential Distribution clsExponentialDist.strNameTag = "Exponential" clsExponentialDist.strRName = "exp" @@ -662,6 +712,8 @@ Public Class ucrDistributions clsCurrRFunction.SetRCommand(clsCurrDistribution.strQFunctionName) Case "GLMFunctions" clsCurrRFunction.SetRCommand(clsCurrDistribution.strGLMFunctionName) + Case "AOVFunctions" + clsCurrRFunction.SetRCommand(clsCurrDistribution.strAOVFunctionName) Case "ExactSolution" clsCurrRFunction.SetRCommand(clsCurrDistribution.strExactName) End Select From 6d4660649de35aa5151e7dddbc21ce98bcadd052 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 27 Nov 2023 06:54:37 +0100 Subject: [PATCH 07/22] Code changes --- instat/dlgFourVariableModelling.vb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index def5d9d542b..f470d536d4d 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -164,7 +164,7 @@ Public Class dlgFourVariableModelling ucrBaseFourVariableModelling.clsRsyntax.ClearCodes() - clsSecoandndThirdExplanatoryOpertor.SetOperation("*") + clsSecoandndThirdExplanatoryOpertor.SetOperation("+") clsSecoandndThirdExplanatoryOpertor.bBrackets = False ucrDistributionChoice.SetDataType("numeric") @@ -215,6 +215,7 @@ Public Class dlgFourVariableModelling clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) clsAOV.bExcludeAssignedFunctionOutput = False clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, @@ -460,7 +461,7 @@ Public Class dlgFourVariableModelling End Sub Private Sub ThirdExplanatoryFunctionEnabled() - If Not ucrReceiverThirdExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverThirdExplanatory.strCurrDataType) Then + If Not ucrReceiverThirdExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor"}.Contains(ucrReceiverThirdExplanatory.strCurrDataType) Then cmdThirdExplanatoryFunction.Enabled = True Else cmdThirdExplanatoryFunction.Enabled = False @@ -593,7 +594,7 @@ Public Class dlgFourVariableModelling End If SetBaseFunction() FirstExplanatoryFunctionEnabled() - ' UpdatePreview() + UpdatePreview() End Sub @@ -624,7 +625,7 @@ Public Class dlgFourVariableModelling End Sub Private Sub FirstExplanatoryFunctionEnabled() - If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then + If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then cmdFirstExplanatoryFunction.Enabled = True Else cmdFirstExplanatoryFunction.Enabled = False @@ -632,7 +633,7 @@ Public Class dlgFourVariableModelling End Sub Private Sub SecondExplanatoryFunctionEnabled() - If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then + If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then cmdSecondExplanatoryFunction.Enabled = True Else cmdSecondExplanatoryFunction.Enabled = False From 16fc892260573f4988e9afc4f0c239123d503e54 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 28 Nov 2023 09:43:34 +0100 Subject: [PATCH 08/22] Added AOV function into Two and Three Variable Modelling --- instat/dlgFourVariableModelling.vb | 6 +++--- instat/dlgThreeVariablesModelling.vb | 20 +++++++++++++++++--- instat/dlgTwoVariableFitModel.vb | 20 +++++++++++++++++++- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index f470d536d4d..a31535addb9 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -461,7 +461,7 @@ Public Class dlgFourVariableModelling End Sub Private Sub ThirdExplanatoryFunctionEnabled() - If Not ucrReceiverThirdExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor"}.Contains(ucrReceiverThirdExplanatory.strCurrDataType) Then + If Not ucrReceiverThirdExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverThirdExplanatory.strCurrDataType) Then cmdThirdExplanatoryFunction.Enabled = True Else cmdThirdExplanatoryFunction.Enabled = False @@ -625,7 +625,7 @@ Public Class dlgFourVariableModelling End Sub Private Sub FirstExplanatoryFunctionEnabled() - If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then + If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then cmdFirstExplanatoryFunction.Enabled = True Else cmdFirstExplanatoryFunction.Enabled = False @@ -633,7 +633,7 @@ Public Class dlgFourVariableModelling End Sub Private Sub SecondExplanatoryFunctionEnabled() - If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then + If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then cmdSecondExplanatoryFunction.Enabled = True Else cmdSecondExplanatoryFunction.Enabled = False diff --git a/instat/dlgThreeVariablesModelling.vb b/instat/dlgThreeVariablesModelling.vb index 9594ed22d51..5685720a081 100644 --- a/instat/dlgThreeVariablesModelling.vb +++ b/instat/dlgThreeVariablesModelling.vb @@ -27,7 +27,7 @@ Public Class dlgThreeVariableModelling Public clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction Public clsFormulaOperator As New ROperator - Public clsGLM, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLM, clsLM, clsAOV, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -112,6 +112,7 @@ Public Class dlgThreeVariableModelling clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction + clsAOV = New RFunction clsFirstTransformFunction = New RFunction @@ -155,6 +156,15 @@ Public Class dlgThreeVariableModelling strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, strObjectName:="last_model") + clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOV.bExcludeAssignedFunctionOutput = False + clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, + strObjectName:="last_model") clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) @@ -295,10 +305,12 @@ Public Class dlgThreeVariableModelling Private Sub SetRCodeForControls(bReset As Object) bRCodeSet = False + ucrSaveModel.AddAdditionalRCode(clsAOV, 1) ucrSaveModel.AddAdditionalRCode(clsGLM, 1) ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorThreeVariableModelling.GetParameter(), 1) ucrReceiverFirstExplanatory.AddAdditionalCodeParameterPair(clsFirstPowerOperator, New RParameter("x", 0), 1) ucrReceiverSecondExplanatory.AddAdditionalCodeParameterPair(clsSecondPowerOperator, New RParameter("x", 0), 1) + ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorThreeVariableModelling.GetParameter(), 1) ucrInputModelOperator.SetName(clsExplanatoryOperator.strOperation) ucrChkConvertToNumeric.SetRCode(clsFormulaOperator, bReset) @@ -396,6 +408,8 @@ Public Class dlgThreeVariableModelling If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM + ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then + clsLMOrGLM = clsAOV Else clsLMOrGLM = clsGLM End If @@ -474,7 +488,7 @@ Public Class dlgThreeVariableModelling End Sub Private Sub FirstExplanatoryFunctionEnabled() - If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then + If Not ucrReceiverFirstExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverFirstExplanatory.strCurrDataType) Then cmdFirstExplanatoryFunction.Enabled = True Else cmdFirstExplanatoryFunction.Enabled = False @@ -482,7 +496,7 @@ Public Class dlgThreeVariableModelling End Sub Private Sub SecondExplanatoryFunctionEnabled() - If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then + If Not ucrReceiverSecondExplanatory.IsEmpty AndAlso {"numeric", "integer", "factor", "logical"}.Contains(ucrReceiverSecondExplanatory.strCurrDataType) Then cmdSecondExplanatoryFunction.Enabled = True Else cmdSecondExplanatoryFunction.Enabled = False diff --git a/instat/dlgTwoVariableFitModel.vb b/instat/dlgTwoVariableFitModel.vb index 029f31c2e1d..ea10aa877e5 100644 --- a/instat/dlgTwoVariableFitModel.vb +++ b/instat/dlgTwoVariableFitModel.vb @@ -25,7 +25,7 @@ Public Class dlgTwoVariableFitModel Private clsVisReg, clsFamilyFunction As New RFunction Private clsTransformFunction As New RFunction Private clsBrokenStickFirstOperator, clsBrokenStickSecondOperator, clsBrokenStickThirdOperator, clsBrokenStickGeneralOperator As New ROperator - Private clsBrokenStickSecondOperFunction, clsBrokenStickIFunc As New RFunction + Private clsBrokenStickSecondOperFunction, clsAOV, clsBrokenStickIFunc As New RFunction Private clsSplineFunc As New RFunction 'Tests @@ -225,6 +225,7 @@ Public Class dlgTwoVariableFitModel clsWilcoxTestOperator = New ROperator clsVarTestOperator = New ROperator clsPropTestOperator = New ROperator + clsAOV = New RFunction ucrBase.clsRsyntax.ClearCodes() @@ -245,6 +246,16 @@ Public Class dlgTwoVariableFitModel strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, strObjectName:="last_model") + clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOV.bExcludeAssignedFunctionOutput = False + clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, + strObjectName:="last_model") + clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) @@ -567,6 +578,7 @@ Public Class dlgTwoVariableFitModel ucrSaveModels.AddAdditionalRCode(clsBarletteTestFunction, iAdditionalPairNo:=22) ucrSaveModels.AddAdditionalRCode(clsFlignerTestFunction, iAdditionalPairNo:=23) + ucrInputConfidenceInterval.AddAdditionalCodeParameterPair(clsWilcoxTestFunction, New RParameter("conf.level", iNewPosition:=2), iAdditionalPairNo:=1) ucrInputConfidenceInterval.AddAdditionalCodeParameterPair(clsVarTestFunction, New RParameter("conf.level", iNewPosition:=2), iAdditionalPairNo:=2) ucrInputConfidenceInterval.AddAdditionalCodeParameterPair(clsNumericAnsariTestFuntion, New RParameter("conf.level", iNewPosition:=2), iAdditionalPairNo:=3) @@ -583,6 +595,8 @@ Public Class dlgTwoVariableFitModel ucrInputNullHypothesis.AddAdditionalCodeParameterPair(clsWilcoxTestFunction, New RParameter("mu", iNewPosition:=4), iAdditionalPairNo:=1) ucrInputNullHypothesis.SetRCode(clsTtestFunction, bReset) 'General case controls + ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorSimpleReg.GetParameter(), 1) + ucrSaveModels.AddAdditionalRCode(clsAOV, 1) ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorSimpleReg.GetParameter(), 1) ucrReceiverResponse.SetRCode(clsAsNumeric, bReset) ucrReceiverExplanatory.SetRCode(clsTransformFunction, bReset) @@ -591,6 +605,7 @@ Public Class dlgTwoVariableFitModel ucrChkConvertToVariate.SetRCode(clsFormulaOperator) ucrSaveModels.SetRCode(clsLM, bReset) ucrDistributionChoice.SetRCode(clsFamilyFunction, bReset) + bRCodeSet = True End Sub @@ -646,12 +661,15 @@ Public Class dlgTwoVariableFitModel If rdoGeneralCase.Checked Then If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") Then clsLMOrGLM = clsLM + ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then + clsLMOrGLM = clsAOV Else clsLMOrGLM = clsGLM End If ucrBase.clsRsyntax.AddToAfterCodes(clsAnovaFunction, 1) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, 2) ucrBase.clsRsyntax.SetBaseRFunction(clsLMOrGLM) + ElseIf rdoTest.Checked Then ucrBase.clsRsyntax.RemoveFromAfterCodes(clsAnovaFunction) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsSummaryFunction) From 83cfc02672c35d886ead6e449299238d070d4ec0 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:40:01 +0100 Subject: [PATCH 09/22] Added the AOV function to the General model and fit mode dialogues --- instat/dlgFitModel.vb | 19 ++++++++++++++++++- instat/dlgOptionsByContextFItModel.vb | 18 ++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/instat/dlgFitModel.vb b/instat/dlgFitModel.vb index 70b4aab911c..d532187b981 100644 --- a/instat/dlgFitModel.vb +++ b/instat/dlgFitModel.vb @@ -28,7 +28,7 @@ Public Class dlgFitModel Public clsRestpvalFunction, clsFamilyFunction, clsRCIFunction, clsRConvert, clsAutoPlot, clsVisReg As New RFunction Public bResetModelOptions As Boolean = False Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsAnovaIIFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsGLM, clsLM, clsLMOrGLM, clsGLMNB, clsGLMPolr, clsGLMMultinom, clsAsNumeric As New RFunction + Public clsGLM, clsLM, clsLMOrGLM, clsGLMNB, clsAOV, clsGLMPolr, clsGLMMultinom, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -108,6 +108,7 @@ Public Class dlgFitModel clsHatvaluesFunction = New RFunction clsResidualFunction = New RFunction clsFittedValuesFunction = New RFunction + clsAOV = New RFunction ucrSelectorByDataFrameAddRemoveForFitModel.Reset() ucrModelName.Reset() @@ -135,6 +136,16 @@ Public Class dlgFitModel strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") + clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOV.bExcludeAssignedFunctionOutput = False + clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, + strObjectName:="last_model") + 'todo. where is clsGLM used? clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) @@ -327,12 +338,16 @@ Public Class dlgFitModel ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMPolr, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 3) ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMMultinom, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 4) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) + ucrModelName.AddAdditionalRCode(clsAOV, bReset) + ucrChkConvertToVariate.SetRCode(clsFormulaOperator, bReset) ucrReceiverResponseVar.SetRCode(clsRConvert, bReset) ucrReceiverExpressionFitModel.SetRCode(clsFormulaOperator, bReset) ucrSelectorByDataFrameAddRemoveForFitModel.SetRCode(clsLM, bReset) ucrModelName.SetRCode(clsLM, bReset) ucrFamily.SetRCode(clsFamilyFunction, bReset) + bRCodeSet = True ResponseConvert() End Sub @@ -503,6 +518,8 @@ Public Class dlgFitModel clsLMOrGLM = clsGLMPolr ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Multinomial") Then clsLMOrGLM = clsGLMMultinom + ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Normal_aov") Then + clsLMOrGLM = clsAOV Else clsLMOrGLM = clsGLM End If diff --git a/instat/dlgOptionsByContextFItModel.vb b/instat/dlgOptionsByContextFItModel.vb index 424447c7f5b..ff85368fd42 100644 --- a/instat/dlgOptionsByContextFItModel.vb +++ b/instat/dlgOptionsByContextFItModel.vb @@ -29,7 +29,7 @@ Public Class dlgOptionsByContextFitModel Public clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsGLM, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLM, clsLM, clsLMOrGLM, clsAOV, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -150,6 +150,7 @@ Public Class dlgOptionsByContextFitModel clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction + clsAOV = New RFunction clsModelFormula = New ROperator clsOverallInteractions = New ROperator @@ -204,6 +205,16 @@ Public Class dlgOptionsByContextFitModel clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOV.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) + clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOV.bExcludeAssignedFunctionOutput = False + clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, + strRObjectFormatToAssignTo:=RObjectFormat.Text, + strRDataFrameNameToAddObjectTo:=ucrSelectorFitModel.strCurrentDataFrame, + strObjectName:="last_model") + 'Residual Plots dctPlotFunctions = New Dictionary(Of String, RFunction)(clsRegressionDefaults.dctModelPlotFunctions) @@ -259,7 +270,8 @@ Public Class dlgOptionsByContextFitModel ucrSaveModel.AddAdditionalRCode(clsGLM, 1) ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorFitModel.GetParameter(), 1) - + ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorFitModel.GetParameter(), 1) + ucrSaveModel.AddAdditionalRCode(clsAOV, bReset) ucrReceiverContext1.SetRCode(clsContextsInteractions, bResetControls) ucrReceiverContext2.SetRCode(clsContextsInteractions, bResetControls) ucrReceiverContext3.SetRCode(clsContextsInteractions, bResetControls) @@ -359,6 +371,8 @@ Public Class dlgOptionsByContextFitModel If Not ucrReceiverResponse.IsEmpty Then If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM + ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then + clsLMOrGLM = clsAOV Else clsLMOrGLM = clsGLM End If From bcb05d234562fbbd688cf8ff410f92c2cc3d730e Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:39:25 +0100 Subject: [PATCH 10/22] Fixed odd bug in the fit Model --- instat/dlgFitModel.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/dlgFitModel.vb b/instat/dlgFitModel.vb index d532187b981..9a5392be192 100644 --- a/instat/dlgFitModel.vb +++ b/instat/dlgFitModel.vb @@ -457,7 +457,7 @@ Public Class dlgFitModel End Sub Private Sub UpdatePreview() - If Not ucrReceiverResponseVar.IsEmpty AndAlso Not ucrReceiverExpressionFitModel.IsEmpty Then + If Not ucrReceiverResponseVar.IsEmpty Then ucrInputModelPreview.SetName(clsFormulaOperator.ToScript()) Else ucrInputModelPreview.SetName("") @@ -551,7 +551,7 @@ Public Class dlgFitModel Private Sub ucrReceiverExpressionFitModel_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlValueChanged ChooseRFunction() - ResponseConvert() + 'ResponseConvert() ChooseAnovaFunction() End Sub @@ -567,7 +567,7 @@ Public Class dlgFitModel ResponseVariableType() End Sub - Private Sub ucrReceiverExpressionFitModel_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlContentsChanged, ucrReceiverResponseVar.ControlContentsChanged + Private Sub ucrReceiverExpressionFitModel_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpressionFitModel.ControlContentsChanged UpdatePreview() TestOKEnabled() End Sub From 5481a0adbd4f12bd48c5649823b775ab63638bd7 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:31:29 +0100 Subject: [PATCH 11/22] Code changes --- instat/clsRegressionDefaults.vb | 4 -- instat/dlgFitModel.vb | 94 +++++++++++++-------------- instat/dlgFourVariableModelling.vb | 58 ++++++++--------- instat/dlgOptionsByContextFItModel.vb | 38 +++++------ instat/dlgThreeVariablesModelling.vb | 42 ++++++------ instat/dlgTwoVariableFitModel.vb | 43 ++++++------ instat/ucrDistributions.vb | 2 - 7 files changed, 137 insertions(+), 144 deletions(-) diff --git a/instat/clsRegressionDefaults.vb b/instat/clsRegressionDefaults.vb index 3756ced2223..a7b2e4a0964 100644 --- a/instat/clsRegressionDefaults.vb +++ b/instat/clsRegressionDefaults.vb @@ -59,9 +59,7 @@ Public Class clsRegressionDefaults End Property Public Shared ReadOnly Property clsDefaultGlmFunction As RFunction Get - Dim clsDefaultGlmFunc As New RFunction - clsDefaultGlmFunc.SetRCommand("glm") Return clsDefaultGlmFunc End Get @@ -69,9 +67,7 @@ Public Class clsRegressionDefaults Public Shared ReadOnly Property clsDefaultAovFunction As RFunction Get - Dim clsDefaultAovFunc As New RFunction - clsDefaultAovFunc.SetRCommand("aov") Return clsDefaultAovFunc End Get diff --git a/instat/dlgFitModel.vb b/instat/dlgFitModel.vb index 9a5392be192..647967813f2 100644 --- a/instat/dlgFitModel.vb +++ b/instat/dlgFitModel.vb @@ -28,7 +28,7 @@ Public Class dlgFitModel Public clsRestpvalFunction, clsFamilyFunction, clsRCIFunction, clsRConvert, clsAutoPlot, clsVisReg As New RFunction Public bResetModelOptions As Boolean = False Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsAnovaIIFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsGLM, clsLM, clsLMOrGLM, clsGLMNB, clsAOV, clsGLMPolr, clsGLMMultinom, clsAsNumeric As New RFunction + Public clsGLMFunction, clsLM, clsLMOrGLM, clsGLMFunctionNB, clsAOVFunction, clsGLMFunctionPolr, clsGLMFunctionMultinom, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -95,10 +95,10 @@ Public Class dlgFitModel clsAutoPlot = New RFunction clsFormulaFunction = New RFunction clsLM = New RFunction - clsGLM = New RFunction - clsGLMNB = New RFunction - clsGLMPolr = New RFunction - clsGLMMultinom = New RFunction + clsGLMFunction = New RFunction + clsGLMFunctionNB = New RFunction + clsGLMFunctionPolr = New RFunction + clsGLMFunctionMultinom = New RFunction clsConfint = New RFunction clsAnovaFunction = New RFunction clsVisReg = New RFunction @@ -108,7 +108,7 @@ Public Class dlgFitModel clsHatvaluesFunction = New RFunction clsResidualFunction = New RFunction clsFittedValuesFunction = New RFunction - clsAOV = New RFunction + clsAOVFunction = New RFunction ucrSelectorByDataFrameAddRemoveForFitModel.Reset() ucrModelName.Reset() @@ -136,55 +136,55 @@ Public Class dlgFitModel strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() - clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) - clsAOV.bExcludeAssignedFunctionOutput = False - clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - 'todo. where is clsGLM used? - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + 'todo. where is clsGLMFunction used? + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) clsFamilyFunction = ucrFamily.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.bExcludeAssignedFunctionOutput = False - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.bExcludeAssignedFunctionOutput = False + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsGLMNB = clsRegressionDefaults.clsDefaultGLmNBFunction.Clone - clsGLMNB.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLMNB.bExcludeAssignedFunctionOutput = False - clsGLMNB.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunctionNB = clsRegressionDefaults.clsDefaultGLmNBFunction.Clone + clsGLMFunctionNB.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunctionNB.bExcludeAssignedFunctionOutput = False + clsGLMFunctionNB.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsGLMPolr = clsRegressionDefaults.clsDefaultGLmPolrFunction.Clone - clsGLMPolr.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLMPolr.bExcludeAssignedFunctionOutput = False - clsGLMPolr.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunctionPolr = clsRegressionDefaults.clsDefaultGLmPolrFunction.Clone + clsGLMFunctionPolr.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunctionPolr.bExcludeAssignedFunctionOutput = False + clsGLMFunctionPolr.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, strObjectName:="last_model") - clsGLMMultinom = clsRegressionDefaults.clsDefaultGLmMultinomFunction.Clone - clsGLMMultinom.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLMMultinom.bExcludeAssignedFunctionOutput = False - clsGLMMultinom.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunctionMultinom = clsRegressionDefaults.clsDefaultGLmMultinomFunction.Clone + clsGLMFunctionMultinom.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunctionMultinom.bExcludeAssignedFunctionOutput = False + clsGLMFunctionMultinom.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorByDataFrameAddRemoveForFitModel.strCurrentDataFrame, @@ -329,17 +329,17 @@ Public Class dlgFitModel Private Sub SetRCodeForControls(bReset As Boolean) bRCodeSet = False - ucrModelName.AddAdditionalRCode(clsGLMMultinom, bReset) - ucrModelName.AddAdditionalRCode(clsGLMPolr, bReset) - ucrModelName.AddAdditionalRCode(clsGLMNB, bReset) - ucrModelName.AddAdditionalRCode(clsGLM, bReset) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMNB, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 2) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMPolr, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 3) - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMMultinom, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 4) - - ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) - ucrModelName.AddAdditionalRCode(clsAOV, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunctionMultinom, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunctionPolr, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunctionNB, bReset) + ucrModelName.AddAdditionalRCode(clsGLMFunction, bReset) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunctionNB, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 2) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunctionPolr, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 3) + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsGLMFunctionMultinom, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 4) + + ucrSelectorByDataFrameAddRemoveForFitModel.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorByDataFrameAddRemoveForFitModel.GetParameter(), 1) + ucrModelName.AddAdditionalRCode(clsAOVFunction, bReset) ucrChkConvertToVariate.SetRCode(clsFormulaOperator, bReset) ucrReceiverResponseVar.SetRCode(clsRConvert, bReset) @@ -513,15 +513,15 @@ Public Class dlgFitModel If (ucrFamily.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Negative_Binomial_GLM") Then - clsLMOrGLM = clsGLMNB + clsLMOrGLM = clsGLMFunctionNB ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Ordered_Logistic") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then - clsLMOrGLM = clsGLMPolr + clsLMOrGLM = clsGLMFunctionPolr ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Multinomial") Then - clsLMOrGLM = clsGLMMultinom - ElseIf (ucrFamily.clsCurrDistribution.strNameTag = "Normal_aov") Then - clsLMOrGLM = clsAOV + clsLMOrGLM = clsGLMFunctionMultinom + ElseIf ucrFamily.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBase.clsRsyntax.SetBaseRFunction(clsLMOrGLM) diff --git a/instat/dlgFourVariableModelling.vb b/instat/dlgFourVariableModelling.vb index a31535addb9..319eff77da8 100644 --- a/instat/dlgFourVariableModelling.vb +++ b/instat/dlgFourVariableModelling.vb @@ -25,9 +25,9 @@ Public Class dlgFourVariableModelling Public bResetSecondFunction As Boolean = False Public bRCodeSet As Boolean = False Public clsRCIFunction, clsRConvert, clsFamilyFunction, clsVisReg As New RFunction - Public clsRSingleModelFunction, clsThirdTransformFunction, clsLmer, clsGlmer, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction + Public clsRSingleModelFunction, clsThirdTransformFunction, clsLmer, clsGLMFunctioner, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction Public clsFormulaOperator As New ROperator - Public clsGLM, clsAOV, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLMFunction, clsAOVFunction, clsLM, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -120,8 +120,8 @@ Public Class dlgFourVariableModelling clsFamilyFunction = New RFunction clsAsNumeric = New RFunction clsLM = New RFunction - clsAOV = New RFunction - clsGLM = New RFunction + clsAOVFunction = New RFunction + clsGLMFunction = New RFunction clsFirstTransformFunction = New RFunction clsSecondTransformFunction = New RFunction clsFormulaFunction = New RFunction @@ -131,7 +131,7 @@ Public Class dlgFourVariableModelling clsThirdTransformFunction = New RFunction clsLmer = New RFunction clsLMOrGLM = New RFunction - clsGlmer = New RFunction + clsGLMFunctioner = New RFunction clsRstandardFunction = New RFunction clsHatvaluesFunction = New RFunction @@ -197,34 +197,34 @@ Public Class dlgFourVariableModelling clsLmer.SetRCommand("lmer") clsLmer.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGlmer.SetPackageName("lme4") - clsGlmer.SetRCommand("glmer") - clsGlmer.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGlmer.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunctioner.SetPackageName("lme4") + clsGLMFunctioner.SetRCommand("glmer") + clsGLMFunctioner.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunctioner.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.bExcludeAssignedFunctionOutput = False - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.bExcludeAssignedFunctionOutput = False + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, strObjectName:="last_model") - clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() - clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) - clsAOV.bExcludeAssignedFunctionOutput = False - clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorFourVariableModelling.strCurrentDataFrame, strObjectName:="last_model") clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) clsFirstPowerOperator.SetOperation("^") clsFirstPowerOperator.AddParameter("power", 2, iPosition:=1) @@ -364,15 +364,15 @@ Public Class dlgFourVariableModelling Private Sub SetRCodeForControls(bReset As Object) bRCodeSet = False - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) - ucrSaveModel.AddAdditionalRCode(clsGlmer, 2) + ucrSaveModel.AddAdditionalRCode(clsGLMFunction, 1) + ucrSaveModel.AddAdditionalRCode(clsGLMFunctioner, 2) ucrSaveModel.AddAdditionalRCode(clsLmer, 3) - ucrSaveModel.AddAdditionalRCode(clsAOV, 4) + ucrSaveModel.AddAdditionalRCode(clsAOVFunction, 4) - ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorFourVariableModelling.GetParameter(), 1) - ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGlmer, ucrSelectorFourVariableModelling.GetParameter(), 2) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorFourVariableModelling.GetParameter(), 1) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsGLMFunctioner, ucrSelectorFourVariableModelling.GetParameter(), 2) ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsLmer, ucrSelectorFourVariableModelling.GetParameter(), 3) - ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorFourVariableModelling.GetParameter(), 4) + ucrSelectorFourVariableModelling.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorFourVariableModelling.GetParameter(), 4) ucrInputModelOperators1.SetName(clsOverallExplanatoryOperator.strOperation) ucrInputModelOperators2.SetName(clsSecoandndThirdExplanatoryOpertor.strOperation) @@ -482,11 +482,11 @@ Public Class dlgFourVariableModelling ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal" And ucrInputModelOperators2.GetText = "|") Then clsLMOrGLM = clsLmer ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag <> "Normal" And ucrInputModelOperators2.GetText = "|") Then - clsLMOrGLM = clsGlmer + clsLMOrGLM = clsGLMFunctioner ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then - clsLMOrGLM = clsAOV + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBaseFourVariableModelling.clsRsyntax.SetBaseRFunction(clsLMOrGLM) End If diff --git a/instat/dlgOptionsByContextFItModel.vb b/instat/dlgOptionsByContextFItModel.vb index ff85368fd42..774413160bc 100644 --- a/instat/dlgOptionsByContextFItModel.vb +++ b/instat/dlgOptionsByContextFItModel.vb @@ -29,7 +29,7 @@ Public Class dlgOptionsByContextFitModel Public clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction - Public clsGLM, clsLM, clsLMOrGLM, clsAOV, clsAsNumeric As New RFunction + Public clsGLMFunction, clsLM, clsLMOrGLM, clsAOVFunction, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -145,12 +145,12 @@ Public Class dlgOptionsByContextFitModel clsFamilyFunction = New RFunction clsAsNumeric = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsGLMFunction = New RFunction clsFormulaFunction = New RFunction clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction - clsAOV = New RFunction + clsAOVFunction = New RFunction clsModelFormula = New ROperator clsOverallInteractions = New ROperator @@ -199,17 +199,17 @@ Public Class dlgOptionsByContextFitModel clsLM = clsRegressionDefaults.clsDefaultLmFunction.Clone() clsLM.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) - clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() - clsAOV.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) - clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) - clsAOV.bExcludeAssignedFunctionOutput = False - clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsModelFormula, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorFitModel.strCurrentDataFrame, @@ -249,7 +249,7 @@ Public Class dlgOptionsByContextFitModel clsHatvaluesFunction.SetRCommand("hatvalues") clsLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) - clsGLM.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) + clsGLMFunction.SetAssignTo(ucrSaveModel.GetText, strTempDataframe:=ucrSelectorFitModel.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempModel:=ucrSaveModel.GetText, bAssignToIsPrefix:=True) ucrBase.clsRsyntax.SetBaseRFunction(clsLM) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True @@ -268,10 +268,10 @@ Public Class dlgOptionsByContextFitModel Private Sub SetRCodeForControls(bResetControls As Boolean) bRCodeSet = False - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) - ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorFitModel.GetParameter(), 1) - ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorFitModel.GetParameter(), 1) - ucrSaveModel.AddAdditionalRCode(clsAOV, bReset) + ucrSaveModel.AddAdditionalRCode(clsGLMFunction, 1) + ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorFitModel.GetParameter(), 1) + ucrSelectorFitModel.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorFitModel.GetParameter(), 1) + ucrSaveModel.AddAdditionalRCode(clsAOVFunction, bReset) ucrReceiverContext1.SetRCode(clsContextsInteractions, bResetControls) ucrReceiverContext2.SetRCode(clsContextsInteractions, bResetControls) ucrReceiverContext3.SetRCode(clsContextsInteractions, bResetControls) @@ -371,10 +371,10 @@ Public Class dlgOptionsByContextFitModel If Not ucrReceiverResponse.IsEmpty Then If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM - ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then - clsLMOrGLM = clsAOV + ElseIf ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If 'Update display functions to contain correct model diff --git a/instat/dlgThreeVariablesModelling.vb b/instat/dlgThreeVariablesModelling.vb index 5685720a081..80a2882f804 100644 --- a/instat/dlgThreeVariablesModelling.vb +++ b/instat/dlgThreeVariablesModelling.vb @@ -27,7 +27,7 @@ Public Class dlgThreeVariableModelling Public clsFamilyFunction, clsVisReg As New RFunction Public clsRSingleModelFunction, clsFormulaFunction, clsAnovaFunction, clsSummaryFunction, clsConfint As New RFunction Public clsFormulaOperator As New ROperator - Public clsGLM, clsLM, clsAOV, clsLMOrGLM, clsAsNumeric As New RFunction + Public clsGLMFunction, clsLM, clsAOVFunction, clsLMOrGLM, clsAsNumeric As New RFunction 'Saving Operators/Functions Private clsRstandardFunction, clsHatvaluesFunction, clsResidualFunction, clsFittedValuesFunction As New RFunction @@ -107,12 +107,12 @@ Public Class dlgThreeVariableModelling clsFamilyFunction = New RFunction clsAsNumeric = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsGLMFunction = New RFunction clsFormulaFunction = New RFunction clsSummaryFunction = New RFunction clsConfint = New RFunction clsVisReg = New RFunction - clsAOV = New RFunction + clsAOVFunction = New RFunction clsFirstTransformFunction = New RFunction @@ -156,21 +156,21 @@ Public Class dlgThreeVariableModelling strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, strObjectName:="last_model") - clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() - clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) - clsAOV.bExcludeAssignedFunctionOutput = False - clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, strObjectName:="last_model") - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone() - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.bExcludeAssignedFunctionOutput = False - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone() + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.bExcludeAssignedFunctionOutput = False + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorThreeVariableModelling.strCurrentDataFrame, @@ -178,7 +178,7 @@ Public Class dlgThreeVariableModelling clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) clsFirstPowerOperator.SetOperation("^") clsFirstPowerOperator.AddParameter("power", 2, iPosition:=1) @@ -305,12 +305,12 @@ Public Class dlgThreeVariableModelling Private Sub SetRCodeForControls(bReset As Object) bRCodeSet = False - ucrSaveModel.AddAdditionalRCode(clsAOV, 1) - ucrSaveModel.AddAdditionalRCode(clsGLM, 1) - ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorThreeVariableModelling.GetParameter(), 1) + ucrSaveModel.AddAdditionalRCode(clsAOVFunction, 1) + ucrSaveModel.AddAdditionalRCode(clsGLMFunction, 1) + ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorThreeVariableModelling.GetParameter(), 1) ucrReceiverFirstExplanatory.AddAdditionalCodeParameterPair(clsFirstPowerOperator, New RParameter("x", 0), 1) ucrReceiverSecondExplanatory.AddAdditionalCodeParameterPair(clsSecondPowerOperator, New RParameter("x", 0), 1) - ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorThreeVariableModelling.GetParameter(), 1) + ucrSelectorThreeVariableModelling.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorThreeVariableModelling.GetParameter(), 1) ucrInputModelOperator.SetName(clsExplanatoryOperator.strOperation) ucrChkConvertToNumeric.SetRCode(clsFormulaOperator, bReset) @@ -408,10 +408,10 @@ Public Class dlgThreeVariableModelling If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") AndAlso (Not clsFamilyFunction.ContainsParameter("link") OrElse clsFamilyFunction.GetParameter("link").strArgumentValue = Chr(34) & "identity" & Chr(34)) Then clsLMOrGLM = clsLM - ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then - clsLMOrGLM = clsAOV + ElseIf ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBase.clsRsyntax.SetBaseRFunction(clsLMOrGLM) End If diff --git a/instat/dlgTwoVariableFitModel.vb b/instat/dlgTwoVariableFitModel.vb index ea10aa877e5..da56404685a 100644 --- a/instat/dlgTwoVariableFitModel.vb +++ b/instat/dlgTwoVariableFitModel.vb @@ -25,7 +25,7 @@ Public Class dlgTwoVariableFitModel Private clsVisReg, clsFamilyFunction As New RFunction Private clsTransformFunction As New RFunction Private clsBrokenStickFirstOperator, clsBrokenStickSecondOperator, clsBrokenStickThirdOperator, clsBrokenStickGeneralOperator As New ROperator - Private clsBrokenStickSecondOperFunction, clsAOV, clsBrokenStickIFunc As New RFunction + Private clsBrokenStickSecondOperFunction, clsAOVFunction, clsBrokenStickIFunc As New RFunction Private clsSplineFunc As New RFunction 'Tests @@ -44,7 +44,7 @@ Public Class dlgTwoVariableFitModel 'General case codes Private clsFormulaOperator As New ROperator - Private clsGLM, clsLM, clsLMOrGLM, clsAsNumeric, clsPolynomialFunc As New RFunction + Private clsGLMFunction, clsLM, clsLMOrGLM, clsAsNumeric, clsPolynomialFunc As New RFunction Private clsMonthFunc, clsYearFunc, clsAsFactorFunc As New RFunction Private clsAttach As New RFunction Private clsDetach As New RFunction @@ -170,7 +170,7 @@ Public Class dlgTwoVariableFitModel clsFormulaOperator = New ROperator clsPolynomialFunc = New RFunction clsLM = New RFunction - clsGLM = New RFunction + clsGLMFunction = New RFunction clsAsNumeric = New RFunction clsFamilyFunction = New RFunction clsFormulaFunction = New RFunction @@ -225,7 +225,7 @@ Public Class dlgTwoVariableFitModel clsWilcoxTestOperator = New ROperator clsVarTestOperator = New ROperator clsPropTestOperator = New ROperator - clsAOV = New RFunction + clsAOVFunction = New RFunction ucrBase.clsRsyntax.ClearCodes() @@ -246,20 +246,20 @@ Public Class dlgTwoVariableFitModel strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, strObjectName:="last_model") - clsAOV = clsRegressionDefaults.clsDefaultAovFunction.Clone() - clsAOV.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) - clsAOV.AddParameter("na.action", "na.exclude", iPosition:=4) - clsAOV.bExcludeAssignedFunctionOutput = False - clsAOV.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsAOVFunction = clsRegressionDefaults.clsDefaultAovFunction.Clone() + clsAOVFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=0) + clsAOVFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsAOVFunction.bExcludeAssignedFunctionOutput = False + clsAOVFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, strObjectName:="last_model") - clsGLM = clsRegressionDefaults.clsDefaultGlmFunction.Clone - clsGLM.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) - clsGLM.AddParameter("na.action", "na.exclude", iPosition:=4) - clsGLM.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", + clsGLMFunction = clsRegressionDefaults.clsDefaultGlmFunction.Clone + clsGLMFunction.AddParameter("formula", clsROperatorParameter:=clsFormulaOperator, iPosition:=1) + clsGLMFunction.AddParameter("na.action", "na.exclude", iPosition:=4) + clsGLMFunction.SetAssignToOutputObject(strRObjectToAssignTo:="last_model", strRObjectTypeLabelToAssignTo:=RObjectTypeLabel.Model, strRObjectFormatToAssignTo:=RObjectFormat.Text, strRDataFrameNameToAddObjectTo:=ucrSelectorSimpleReg.strCurrentDataFrame, @@ -294,7 +294,7 @@ Public Class dlgTwoVariableFitModel clsAsNumeric.SetRCommand("as.numeric") clsFamilyFunction = ucrDistributionChoice.clsCurrRFunction - clsGLM.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) + clsGLMFunction.AddParameter("family", clsRFunctionParameter:=clsFamilyFunction) clsLMOrGLM = clsLM @@ -567,7 +567,7 @@ Public Class dlgTwoVariableFitModel ucrSaveModels.AddAdditionalRCode(clsPropTestFunction, iAdditionalPairNo:=11) ucrSaveModels.AddAdditionalRCode(clsTtestFunction, iAdditionalPairNo:=12) ucrSaveModels.AddAdditionalRCode(clsMcnemarTestFunction, iAdditionalPairNo:=13) - ucrSaveModels.AddAdditionalRCode(clsGLM, iAdditionalPairNo:=14) + ucrSaveModels.AddAdditionalRCode(clsGLMFunction, iAdditionalPairNo:=14) ucrSaveModels.AddAdditionalRCode(clsOnewayTestFunction, iAdditionalPairNo:=15) ucrSaveModels.AddAdditionalRCode(clsNumericTtestFunction, iAdditionalPairNo:=16) ucrSaveModels.AddAdditionalRCode(clsNumericVarTestFunction, iAdditionalPairNo:=17) @@ -578,7 +578,6 @@ Public Class dlgTwoVariableFitModel ucrSaveModels.AddAdditionalRCode(clsBarletteTestFunction, iAdditionalPairNo:=22) ucrSaveModels.AddAdditionalRCode(clsFlignerTestFunction, iAdditionalPairNo:=23) - ucrInputConfidenceInterval.AddAdditionalCodeParameterPair(clsWilcoxTestFunction, New RParameter("conf.level", iNewPosition:=2), iAdditionalPairNo:=1) ucrInputConfidenceInterval.AddAdditionalCodeParameterPair(clsVarTestFunction, New RParameter("conf.level", iNewPosition:=2), iAdditionalPairNo:=2) ucrInputConfidenceInterval.AddAdditionalCodeParameterPair(clsNumericAnsariTestFuntion, New RParameter("conf.level", iNewPosition:=2), iAdditionalPairNo:=3) @@ -595,9 +594,9 @@ Public Class dlgTwoVariableFitModel ucrInputNullHypothesis.AddAdditionalCodeParameterPair(clsWilcoxTestFunction, New RParameter("mu", iNewPosition:=4), iAdditionalPairNo:=1) ucrInputNullHypothesis.SetRCode(clsTtestFunction, bReset) 'General case controls - ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsAOV, ucrSelectorSimpleReg.GetParameter(), 1) - ucrSaveModels.AddAdditionalRCode(clsAOV, 1) - ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsGLM, ucrSelectorSimpleReg.GetParameter(), 1) + ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsAOVFunction, ucrSelectorSimpleReg.GetParameter(), 1) + ucrSaveModels.AddAdditionalRCode(clsAOVFunction, 1) + ucrSelectorSimpleReg.AddAdditionalCodeParameterPair(clsGLMFunction, ucrSelectorSimpleReg.GetParameter(), 1) ucrReceiverResponse.SetRCode(clsAsNumeric, bReset) ucrReceiverExplanatory.SetRCode(clsTransformFunction, bReset) ucrPnlModelType.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) @@ -661,10 +660,10 @@ Public Class dlgTwoVariableFitModel If rdoGeneralCase.Checked Then If (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal") Then clsLMOrGLM = clsLM - ElseIf (ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov") Then - clsLMOrGLM = clsAOV + ElseIf ucrDistributionChoice.clsCurrDistribution.strNameTag = "Normal_aov" Then + clsLMOrGLM = clsAOVFunction Else - clsLMOrGLM = clsGLM + clsLMOrGLM = clsGLMFunction End If ucrBase.clsRsyntax.AddToAfterCodes(clsAnovaFunction, 1) ucrBase.clsRsyntax.AddToAfterCodes(clsSummaryFunction, 2) diff --git a/instat/ucrDistributions.vb b/instat/ucrDistributions.vb index d22f5f3c680..6991056259b 100644 --- a/instat/ucrDistributions.vb +++ b/instat/ucrDistributions.vb @@ -127,10 +127,8 @@ Public Class ucrDistributions End Sub Public Sub SetAOVDistributions() - strDistributionType = "AOVFunctions" SetDistributions() - End Sub Public Sub SetExactDistributions() ' this addition is temporary From 66ec183a7bf8c90fca01fbadc129a6aafd37851b Mon Sep 17 00:00:00 2001 From: n-thony Date: Wed, 6 Dec 2023 11:21:58 +0300 Subject: [PATCH 12/22] minor code adjustement --- instat/ucrSelector.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index d9c7f478e63..c7d0c56e06e 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -65,9 +65,10 @@ Public Class ucrSelector LoadList() 'always return the focus to the first Receiver when re-opening the dialogue. If lstOrderedReceivers.Count > 0 Then - Dim lstVisibleReceivers = lstOrderedReceivers.Where(Function(ctrl) ctrl.Visible).ToList() + Dim lstVisibleReceivers As List(Of ucrReceiver) + lstVisibleReceivers = lstOrderedReceivers.Where(Function(ctrl) ctrl.Visible).ToList() lstVisibleReceivers = lstVisibleReceivers.OrderBy(Function(ucr) ucr.TabIndex).ToList() - SetCurrentReceiver(lstVisibleReceivers(0)) + SetCurrentReceiver(lstVisibleReceivers(0)) 'set the focus to the first Receiver in the dialogue. End If End Sub From c8f7a2d6ec3ec2501f058fad29611ff1ea589a64 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 6 Dec 2023 10:54:26 +0100 Subject: [PATCH 13/22] minor Change --- instat/frmMain.Designer.vb | 26 ++++++++++++++++---------- instat/frmMain.vb | 5 +++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 55609bdfb37..d297e046d6d 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -261,10 +261,10 @@ Partial Class frmMain Me.mnuClimaticDescribeSummarise23Variables = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeGraph23Variables = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator31 = New System.Windows.Forms.ToolStripSeparator() - Me.ToolStripSeparator17 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeSPISPEI = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeClimograph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeIDF = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator17 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeWindRose = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeWindPollutionRose = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeOtherRosePlots = New System.Windows.Forms.ToolStripMenuItem() @@ -678,6 +678,7 @@ 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.mnuClimaticDescribeTrendGraph = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -2139,7 +2140,7 @@ Partial Class frmMain ' 'mnuClimaticDescribe ' - Me.mnuClimaticDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticDescribeSummarise23Variables, Me.mnuClimaticDescribeGraph23Variables, Me.ToolStripSeparator31, Me.mnuClimaticDescribeSPISPEI, Me.mnuClimaticDescribeClimograph, Me.mnuClimaticDescribeIDF, Me.ToolStripSeparator17, Me.mnuClimaticDescribeWindRose, Me.mnuClimaticDescribeWindPollutionRose, Me.mnuClimaticDescribeOtherRosePlots}) + Me.mnuClimaticDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticDescribeSummarise23Variables, Me.mnuClimaticDescribeGraph23Variables, Me.ToolStripSeparator31, Me.mnuClimaticDescribeSPISPEI, Me.mnuClimaticDescribeClimograph, Me.mnuClimaticDescribeTrendGraph, Me.mnuClimaticDescribeIDF, Me.ToolStripSeparator17, Me.mnuClimaticDescribeWindRose, Me.mnuClimaticDescribeWindPollutionRose, Me.mnuClimaticDescribeOtherRosePlots}) Me.mnuClimaticDescribe.Name = "mnuClimaticDescribe" Me.mnuClimaticDescribe.Size = New System.Drawing.Size(212, 22) Me.mnuClimaticDescribe.Text = "Describe" @@ -2161,11 +2162,6 @@ Partial Class frmMain Me.ToolStripSeparator31.Name = "ToolStripSeparator31" Me.ToolStripSeparator31.Size = New System.Drawing.Size(208, 6) ' - 'ToolStripSeparator17 - ' - Me.ToolStripSeparator17.Name = "ToolStripSeparator17" - Me.ToolStripSeparator17.Size = New System.Drawing.Size(208, 6) - ' 'mnuClimaticDescribeSPISPEI ' Me.mnuClimaticDescribeSPISPEI.Name = "mnuClimaticDescribeSPISPEI" @@ -2186,6 +2182,11 @@ Partial Class frmMain Me.mnuClimaticDescribeIDF.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeIDF.Text = "IDF..." ' + 'ToolStripSeparator17 + ' + Me.ToolStripSeparator17.Name = "ToolStripSeparator17" + Me.ToolStripSeparator17.Size = New System.Drawing.Size(208, 6) + ' 'mnuClimaticDescribeWindRose ' Me.mnuClimaticDescribeWindRose.Name = "mnuClimaticDescribeWindRose" @@ -5071,6 +5072,12 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' + 'mnuClimaticDescribeTrendGraph + ' + Me.mnuClimaticDescribeTrendGraph.Name = "mnuClimaticDescribeTrendGraph" + Me.mnuClimaticDescribeTrendGraph.Size = New System.Drawing.Size(211, 22) + Me.mnuClimaticDescribeTrendGraph.Text = "Trend Graph..." + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -5084,9 +5091,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() @@ -5766,4 +5771,5 @@ Partial Class frmMain Friend WithEvents mnuClimaticDescribeWindRose As ToolStripMenuItem Friend WithEvents mnuClimaticDescribeWindPollutionRose As ToolStripMenuItem Friend WithEvents mnuClimaticDescribeOtherRosePlots As ToolStripMenuItem + Friend WithEvents mnuClimaticDescribeTrendGraph As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index d57cdd8e5c4..8948c8ce455 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2632,4 +2632,9 @@ Public Class frmMain Private Sub mnuClimaticDescribeOtherRosePlots_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeOtherRosePlots.Click dlgOtherRosePlots.ShowDialog() End Sub + + Private Sub mnuClimaticDescribeTrendGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeTrendGraph.Click + dlgPICSARainfall.enumPICSAMode = dlgPICSARainfall.PICSAMode.General + dlgPICSARainfall.ShowDialog() + End Sub End Class From 13b8b5fe5077699f5b9f450a597a2b0362506665 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 6 Dec 2023 10:55:37 +0100 Subject: [PATCH 14/22] minor change --- instat/frmMain.vb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 8948c8ce455..3a3eb1d1786 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2501,11 +2501,6 @@ Public Class frmMain dlgRandomSplit.ShowDialog() End Sub - Private Sub mnuClimaticPICSAGeneralGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticPICSAGeneralGraph.Click - dlgPICSARainfall.enumPICSAMode = dlgPICSARainfall.PICSAMode.General - dlgPICSARainfall.ShowDialog() - End Sub - 'Private Sub mnuOptionsByContextCropModel_Click(sender As Object, e As EventArgs) Handles mnuOptionsByContextCropModel.Click ' dlgApsimx.ShowDialog() 'End Sub From 003c3a0e8ca9c216143c6f12813e1bcb975dc900 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 6 Dec 2023 10:56:43 +0100 Subject: [PATCH 15/22] minor change --- instat/frmMain.Designer.vb | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index d297e046d6d..3df818787a2 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -263,6 +263,7 @@ Partial Class frmMain Me.ToolStripSeparator31 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeSPISPEI = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeClimograph = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuClimaticDescribeTrendGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeIDF = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator17 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeWindRose = New System.Windows.Forms.ToolStripMenuItem() @@ -278,7 +279,6 @@ Partial Class frmMain Me.mnuClimaticPICSA = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPICSARainfallGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPICSATemperatureGraph = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuClimaticPICSAGeneralGraph = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator73 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticPICSACumExeedenceGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticPICSACrops = New System.Windows.Forms.ToolStripMenuItem() @@ -678,7 +678,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.mnuClimaticDescribeTrendGraph = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -2175,6 +2174,12 @@ Partial Class frmMain Me.mnuClimaticDescribeClimograph.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeClimograph.Text = "Climograph..." ' + 'mnuClimaticDescribeTrendGraph + ' + Me.mnuClimaticDescribeTrendGraph.Name = "mnuClimaticDescribeTrendGraph" + Me.mnuClimaticDescribeTrendGraph.Size = New System.Drawing.Size(211, 22) + Me.mnuClimaticDescribeTrendGraph.Text = "Trend Graph..." + ' 'mnuClimaticDescribeIDF ' Me.mnuClimaticDescribeIDF.Enabled = False @@ -2250,7 +2255,7 @@ Partial Class frmMain ' 'mnuClimaticPICSA ' - Me.mnuClimaticPICSA.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticPICSARainfallGraph, Me.mnuClimaticPICSATemperatureGraph, Me.mnuClimaticPICSAGeneralGraph, Me.ToolStripSeparator73, Me.mnuClimaticPICSACumExeedenceGraph, Me.mnuClimaticPICSACrops}) + Me.mnuClimaticPICSA.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticPICSARainfallGraph, Me.mnuClimaticPICSATemperatureGraph, Me.ToolStripSeparator73, Me.mnuClimaticPICSACumExeedenceGraph, Me.mnuClimaticPICSACrops}) Me.mnuClimaticPICSA.Name = "mnuClimaticPICSA" Me.mnuClimaticPICSA.Size = New System.Drawing.Size(212, 22) Me.mnuClimaticPICSA.Text = "PICSA" @@ -2267,12 +2272,6 @@ Partial Class frmMain Me.mnuClimaticPICSATemperatureGraph.Size = New System.Drawing.Size(246, 22) Me.mnuClimaticPICSATemperatureGraph.Text = "Temperature Graph..." ' - 'mnuClimaticPICSAGeneralGraph - ' - Me.mnuClimaticPICSAGeneralGraph.Name = "mnuClimaticPICSAGeneralGraph" - Me.mnuClimaticPICSAGeneralGraph.Size = New System.Drawing.Size(246, 22) - Me.mnuClimaticPICSAGeneralGraph.Text = "General Graph..." - ' 'ToolStripSeparator73 ' Me.ToolStripSeparator73.Name = "ToolStripSeparator73" @@ -5072,12 +5071,6 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' - 'mnuClimaticDescribeTrendGraph - ' - Me.mnuClimaticDescribeTrendGraph.Name = "mnuClimaticDescribeTrendGraph" - Me.mnuClimaticDescribeTrendGraph.Size = New System.Drawing.Size(211, 22) - Me.mnuClimaticDescribeTrendGraph.Text = "Trend Graph..." - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -5703,8 +5696,6 @@ Partial Class frmMain Friend WithEvents mnuPrepareDataReshapeRandomSplit As ToolStripMenuItem - - Friend WithEvents mnuClimaticPICSAGeneralGraph As ToolStripMenuItem Friend WithEvents ToolStripSeparator73 As ToolStripSeparator Friend WithEvents mnuOptionsByContextCropModel As ToolStripMenuItem Friend WithEvents mnuOptionsByContextCropModelApsimxExamples As ToolStripMenuItem From 72d5f5bb8275ead4c4214340b5419c50a06c97df Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 6 Dec 2023 11:07:30 +0100 Subject: [PATCH 16/22] minor change --- instat/dlgSeasonalGraph.Designer.vb | 41 ++++++++++ instat/dlgSeasonalGraph.resx | 120 ++++++++++++++++++++++++++++ instat/dlgSeasonalGraph.vb | 3 + instat/frmMain.Designer.vb | 10 ++- instat/frmMain.vb | 4 + instat/instat.vbproj | 9 +++ 6 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 instat/dlgSeasonalGraph.Designer.vb create mode 100644 instat/dlgSeasonalGraph.resx create mode 100644 instat/dlgSeasonalGraph.vb diff --git a/instat/dlgSeasonalGraph.Designer.vb b/instat/dlgSeasonalGraph.Designer.vb new file mode 100644 index 00000000000..32effdb64af --- /dev/null +++ b/instat/dlgSeasonalGraph.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class dlgSeasonalGraph + Inherits System.Windows.Forms.Form + + 'Form remplace la méthode Dispose pour nettoyer la liste des composants. + _ + 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 + + 'Requise par le Concepteur Windows Form + Private components As System.ComponentModel.IContainer + + 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form + 'Elle peut être modifiée à l'aide du Concepteur Windows Form. + 'Ne la modifiez pas à l'aide de l'éditeur de code. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + '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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgSeasonalGraph" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Seasonal Graph" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgSeasonalGraph.resx b/instat/dlgSeasonalGraph.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgSeasonalGraph.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/dlgSeasonalGraph.vb b/instat/dlgSeasonalGraph.vb new file mode 100644 index 00000000000..57ef68e0d9f --- /dev/null +++ b/instat/dlgSeasonalGraph.vb @@ -0,0 +1,3 @@ +Public Class dlgSeasonalGraph + +End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 3df818787a2..16684103516 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -678,6 +678,7 @@ 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.mnuClimaticDescribeSeasonalGraph = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -2139,7 +2140,7 @@ Partial Class frmMain ' 'mnuClimaticDescribe ' - Me.mnuClimaticDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticDescribeSummarise23Variables, Me.mnuClimaticDescribeGraph23Variables, Me.ToolStripSeparator31, Me.mnuClimaticDescribeSPISPEI, Me.mnuClimaticDescribeClimograph, Me.mnuClimaticDescribeTrendGraph, Me.mnuClimaticDescribeIDF, Me.ToolStripSeparator17, Me.mnuClimaticDescribeWindRose, Me.mnuClimaticDescribeWindPollutionRose, Me.mnuClimaticDescribeOtherRosePlots}) + Me.mnuClimaticDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuClimaticDescribeSummarise23Variables, Me.mnuClimaticDescribeGraph23Variables, Me.ToolStripSeparator31, Me.mnuClimaticDescribeSPISPEI, Me.mnuClimaticDescribeClimograph, Me.mnuClimaticDescribeTrendGraph, Me.mnuClimaticDescribeSeasonalGraph, Me.mnuClimaticDescribeIDF, Me.ToolStripSeparator17, Me.mnuClimaticDescribeWindRose, Me.mnuClimaticDescribeWindPollutionRose, Me.mnuClimaticDescribeOtherRosePlots}) Me.mnuClimaticDescribe.Name = "mnuClimaticDescribe" Me.mnuClimaticDescribe.Size = New System.Drawing.Size(212, 22) Me.mnuClimaticDescribe.Text = "Describe" @@ -5071,6 +5072,12 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' + 'mnuClimaticDescribeSeasonalGraph + ' + Me.mnuClimaticDescribeSeasonalGraph.Name = "mnuClimaticDescribeSeasonalGraph" + Me.mnuClimaticDescribeSeasonalGraph.Size = New System.Drawing.Size(211, 22) + Me.mnuClimaticDescribeSeasonalGraph.Text = "Seasonal Graph..." + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -5763,4 +5770,5 @@ Partial Class frmMain Friend WithEvents mnuClimaticDescribeWindPollutionRose As ToolStripMenuItem Friend WithEvents mnuClimaticDescribeOtherRosePlots As ToolStripMenuItem Friend WithEvents mnuClimaticDescribeTrendGraph As ToolStripMenuItem + Friend WithEvents mnuClimaticDescribeSeasonalGraph As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 3a3eb1d1786..27eb531ec8a 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2632,4 +2632,8 @@ Public Class frmMain dlgPICSARainfall.enumPICSAMode = dlgPICSARainfall.PICSAMode.General dlgPICSARainfall.ShowDialog() End Sub + + Private Sub mnuClimaticDescribeSeasonalGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeSeasonalGraph.Click + dlgSeasonalGraph.ShowDialog() + End Sub End Class diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 4c289e05e77..a650e9eec1d 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -263,6 +263,12 @@ Form + + dlgSeasonalGraph.vb + + + Form + dlgSurvey.vb @@ -3071,6 +3077,9 @@ dlgSearch.vb + + dlgSeasonalGraph.vb + dlgSeasonalPlot.vb From 0a49f9dd6cd6f9f9ea08948ecabe647e83f91601 Mon Sep 17 00:00:00 2001 From: Sophie Malla Tatchum Date: Wed, 6 Dec 2023 11:10:08 +0100 Subject: [PATCH 17/22] Added an empty dialog --- instat/frmMain.Designer.vb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 16684103516..d5dc9e36a17 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -264,6 +264,7 @@ Partial Class frmMain Me.mnuClimaticDescribeSPISPEI = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeClimograph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeTrendGraph = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuClimaticDescribeSeasonalGraph = New System.Windows.Forms.ToolStripMenuItem() Me.mnuClimaticDescribeIDF = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator17 = New System.Windows.Forms.ToolStripSeparator() Me.mnuClimaticDescribeWindRose = New System.Windows.Forms.ToolStripMenuItem() @@ -678,7 +679,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.mnuClimaticDescribeSeasonalGraph = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -2181,6 +2181,13 @@ Partial Class frmMain Me.mnuClimaticDescribeTrendGraph.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeTrendGraph.Text = "Trend Graph..." ' + 'mnuClimaticDescribeSeasonalGraph + ' + Me.mnuClimaticDescribeSeasonalGraph.Enabled = False + Me.mnuClimaticDescribeSeasonalGraph.Name = "mnuClimaticDescribeSeasonalGraph" + Me.mnuClimaticDescribeSeasonalGraph.Size = New System.Drawing.Size(211, 22) + Me.mnuClimaticDescribeSeasonalGraph.Text = "Seasonal Graph..." + ' 'mnuClimaticDescribeIDF ' Me.mnuClimaticDescribeIDF.Enabled = False @@ -5072,12 +5079,6 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' - 'mnuClimaticDescribeSeasonalGraph - ' - Me.mnuClimaticDescribeSeasonalGraph.Name = "mnuClimaticDescribeSeasonalGraph" - Me.mnuClimaticDescribeSeasonalGraph.Size = New System.Drawing.Size(211, 22) - Me.mnuClimaticDescribeSeasonalGraph.Text = "Seasonal Graph..." - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) From 4c05087b8b8cce691cacd15779525cf67a394a63 Mon Sep 17 00:00:00 2001 From: n-thony Date: Thu, 7 Dec 2023 12:26:07 +0300 Subject: [PATCH 18/22] added a check to avoid crashing --- instat/ucrSelector.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instat/ucrSelector.vb b/instat/ucrSelector.vb index c7d0c56e06e..f858e4daddb 100644 --- a/instat/ucrSelector.vb +++ b/instat/ucrSelector.vb @@ -68,7 +68,9 @@ Public Class ucrSelector Dim lstVisibleReceivers As List(Of ucrReceiver) lstVisibleReceivers = lstOrderedReceivers.Where(Function(ctrl) ctrl.Visible).ToList() lstVisibleReceivers = lstVisibleReceivers.OrderBy(Function(ucr) ucr.TabIndex).ToList() - SetCurrentReceiver(lstVisibleReceivers(0)) 'set the focus to the first Receiver in the dialogue. + If lstVisibleReceivers.Count > 0 Then + SetCurrentReceiver(lstVisibleReceivers(0)) 'set the focus to the first Receiver in the dialogue. + End If End If End Sub From c2a80c9e71e6d9c8581b44de461a159d8d9914c1 Mon Sep 17 00:00:00 2001 From: n-thony Date: Thu, 7 Dec 2023 14:32:14 +0300 Subject: [PATCH 19/22] Added back 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 d5dc9e36a17..8b97727f1a8 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -5092,7 +5092,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 5fc67238f29d5c64a012e3cef4f0e79edbcc043e Mon Sep 17 00:00:00 2001 From: Barbra2020 Date: Mon, 11 Dec 2023 12:28:38 +0300 Subject: [PATCH 20/22] Changes to the code --- instat/dlgIDFCurves.Designer.vb | 41 +++++++++++ instat/dlgIDFCurves.resx | 120 ++++++++++++++++++++++++++++++++ instat/dlgIDFCurves.vb | 3 + instat/frmMain.Designer.vb | 4 +- instat/frmMain.vb | 4 ++ instat/instat.vbproj | 9 +++ 6 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 instat/dlgIDFCurves.Designer.vb create mode 100644 instat/dlgIDFCurves.resx create mode 100644 instat/dlgIDFCurves.vb diff --git a/instat/dlgIDFCurves.Designer.vb b/instat/dlgIDFCurves.Designer.vb new file mode 100644 index 00000000000..1569dccfe7c --- /dev/null +++ b/instat/dlgIDFCurves.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class dlgIDFCurves + 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.SuspendLayout() + ' + 'dlgIDFCurves + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(487, 450) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgIDFCurves" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "dlgIDFCurves" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgIDFCurves.resx b/instat/dlgIDFCurves.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgIDFCurves.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/dlgIDFCurves.vb b/instat/dlgIDFCurves.vb new file mode 100644 index 00000000000..e146ccf6d86 --- /dev/null +++ b/instat/dlgIDFCurves.vb @@ -0,0 +1,3 @@ +Public Class dlgIDFCurves + +End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 8b97727f1a8..d5dc9e36a17 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -5092,9 +5092,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() diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 27eb531ec8a..3d47b2e8971 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2636,4 +2636,8 @@ Public Class frmMain Private Sub mnuClimaticDescribeSeasonalGraph_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeSeasonalGraph.Click dlgSeasonalGraph.ShowDialog() End Sub + + Private Sub mnuClimaticDescribeIDF_Click(sender As Object, e As EventArgs) Handles mnuClimaticDescribeIDF.Click + dlgIDFCurves.ShowDialog() + End Sub End Class diff --git a/instat/instat.vbproj b/instat/instat.vbproj index a650e9eec1d..eb03c008b07 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -245,6 +245,12 @@ Form + + dlgIDFCurves.vb + + + Form + dlgImportFromPostgres.vb @@ -3044,6 +3050,9 @@ dlgHomogenization.vb + + dlgIDFCurves.vb + dlgImportERA5Data.vb From cf2dcea934facfcb9932c8045f14453cf19e67be Mon Sep 17 00:00:00 2001 From: Barbra2020 Date: Mon, 11 Dec 2023 12:38:32 +0300 Subject: [PATCH 21/22] changes to dialog --- instat/dlgIDFCurves.Designer.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgIDFCurves.Designer.vb b/instat/dlgIDFCurves.Designer.vb index 1569dccfe7c..f9af1238740 100644 --- a/instat/dlgIDFCurves.Designer.vb +++ b/instat/dlgIDFCurves.Designer.vb @@ -34,7 +34,7 @@ Partial Class dlgIDFCurves Me.MinimizeBox = False Me.Name = "dlgIDFCurves" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "dlgIDFCurves" + Me.Text = "IDF Curves" Me.ResumeLayout(False) End Sub From 0e74a35d809fa7a10000b2961d89149a1864828c Mon Sep 17 00:00:00 2001 From: Barbra2020 Date: Mon, 11 Dec 2023 13:13:47 +0300 Subject: [PATCH 22/22] changes to the code --- 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 d5dc9e36a17..8b97727f1a8 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -5092,7 +5092,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()