From 206f373244df4b74f1e3c20d96d790b05d2f6c27 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 12 Jul 2022 14:05:48 +0300 Subject: [PATCH 01/52] Improving the structure of the Evapotranspiration --- instat/dlgEvapotranspiration.Designer.vb | 158 +++++++++++------------ 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/instat/dlgEvapotranspiration.Designer.vb b/instat/dlgEvapotranspiration.Designer.vb index 95118d74cb9..62c559e915e 100644 --- a/instat/dlgEvapotranspiration.Designer.vb +++ b/instat/dlgEvapotranspiration.Designer.vb @@ -30,8 +30,6 @@ Partial Class dlgEvapotranspiration Me.lblCrop = New System.Windows.Forms.Label() Me.lblDate = New System.Windows.Forms.Label() Me.grpMissingDataOpts = New System.Windows.Forms.GroupBox() - Me.ucrChkInterpMissingEntries = New instat.ucrCheck() - Me.ucrChkInterpMissingDays = New instat.ucrCheck() Me.lblMissingMethod = New System.Windows.Forms.Label() Me.lblMaxMissingDays = New System.Windows.Forms.Label() Me.lblMaxDurationMissingData = New System.Windows.Forms.Label() @@ -39,18 +37,20 @@ Partial Class dlgEvapotranspiration Me.lblSolar = New System.Windows.Forms.Label() Me.lblRadiation = New System.Windows.Forms.Label() Me.grpWindSpeed = New System.Windows.Forms.GroupBox() - Me.ucrChkWind = New instat.ucrCheck() - Me.ucrReceiverWindSpeed = New instat.ucrReceiverSingle() Me.rdoHargreavesSamani = New System.Windows.Forms.RadioButton() Me.rdoPenmanMonteith = New System.Windows.Forms.RadioButton() Me.ucrNudMaxDurationMissingData = New instat.ucrNud() Me.ucrNudMaxMissingDays = New instat.ucrNud() Me.ucrInputMissingMethod = New instat.ucrInputComboBox() Me.ucrNudMaxMissingData = New instat.ucrNud() + Me.ucrChkWind = New instat.ucrCheck() + Me.ucrReceiverWindSpeed = New instat.ucrReceiverSingle() Me.ucrInputSolar = New instat.ucrInputComboBox() Me.ucrReceiverRadiation = New instat.ucrReceiverSingle() Me.ucrInputCrop = New instat.ucrInputComboBox() Me.ucrNewColName = New instat.ucrSave() + Me.ucrChkInterpMissingEntries = New instat.ucrCheck() + Me.ucrChkInterpMissingDays = New instat.ucrCheck() Me.ucrReceiverDate = New instat.ucrReceiverSingle() Me.ucrPnlMethod = New instat.UcrPanel() Me.ucrInputTimeStep = New instat.ucrInputComboBox() @@ -67,7 +67,7 @@ Partial Class dlgEvapotranspiration 'lblTmax ' Me.lblTmax.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTmax.Location = New System.Drawing.Point(321, 154) + Me.lblTmax.Location = New System.Drawing.Point(276, 138) Me.lblTmax.Name = "lblTmax" Me.lblTmax.Size = New System.Drawing.Size(44, 13) Me.lblTmax.TabIndex = 8 @@ -76,7 +76,7 @@ Partial Class dlgEvapotranspiration 'lblTmin ' Me.lblTmin.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTmin.Location = New System.Drawing.Point(321, 107) + Me.lblTmin.Location = New System.Drawing.Point(278, 93) Me.lblTmin.Name = "lblTmin" Me.lblTmin.Size = New System.Drawing.Size(39, 14) Me.lblTmin.TabIndex = 6 @@ -85,7 +85,7 @@ Partial Class dlgEvapotranspiration 'lblHumidityMax ' Me.lblHumidityMax.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHumidityMax.Location = New System.Drawing.Point(323, 195) + Me.lblHumidityMax.Location = New System.Drawing.Point(279, 179) Me.lblHumidityMax.Name = "lblHumidityMax" Me.lblHumidityMax.Size = New System.Drawing.Size(78, 17) Me.lblHumidityMax.TabIndex = 10 @@ -94,7 +94,7 @@ Partial Class dlgEvapotranspiration 'lblHumidityMin ' Me.lblHumidityMin.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHumidityMin.Location = New System.Drawing.Point(324, 240) + Me.lblHumidityMin.Location = New System.Drawing.Point(279, 216) Me.lblHumidityMin.Name = "lblHumidityMin" Me.lblHumidityMin.Size = New System.Drawing.Size(77, 17) Me.lblHumidityMin.TabIndex = 12 @@ -103,7 +103,7 @@ Partial Class dlgEvapotranspiration 'lblTimeStep ' Me.lblTimeStep.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTimeStep.Location = New System.Drawing.Point(5, 336) + Me.lblTimeStep.Location = New System.Drawing.Point(5, 312) Me.lblTimeStep.Name = "lblTimeStep" Me.lblTimeStep.Size = New System.Drawing.Size(58, 20) Me.lblTimeStep.TabIndex = 22 @@ -112,7 +112,7 @@ Partial Class dlgEvapotranspiration 'lblCrop ' Me.lblCrop.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblCrop.Location = New System.Drawing.Point(5, 523) + Me.lblCrop.Location = New System.Drawing.Point(5, 461) Me.lblCrop.Name = "lblCrop" Me.lblCrop.Size = New System.Drawing.Size(31, 20) Me.lblCrop.TabIndex = 30 @@ -121,7 +121,7 @@ Partial Class dlgEvapotranspiration 'lblDate ' Me.lblDate.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblDate.Location = New System.Drawing.Point(323, 64) + Me.lblDate.Location = New System.Drawing.Point(276, 57) Me.lblDate.Name = "lblDate" Me.lblDate.Size = New System.Drawing.Size(40, 14) Me.lblDate.TabIndex = 4 @@ -131,35 +131,17 @@ Partial Class dlgEvapotranspiration ' Me.grpMissingDataOpts.Controls.Add(Me.ucrChkInterpMissingEntries) Me.grpMissingDataOpts.Controls.Add(Me.ucrChkInterpMissingDays) - Me.grpMissingDataOpts.Location = New System.Drawing.Point(5, 362) + Me.grpMissingDataOpts.Location = New System.Drawing.Point(5, 338) Me.grpMissingDataOpts.Name = "grpMissingDataOpts" - Me.grpMissingDataOpts.Size = New System.Drawing.Size(198, 98) + Me.grpMissingDataOpts.Size = New System.Drawing.Size(198, 66) Me.grpMissingDataOpts.TabIndex = 24 Me.grpMissingDataOpts.TabStop = False Me.grpMissingDataOpts.Text = "Missing Data Options" ' - 'ucrChkInterpMissingEntries - ' - Me.ucrChkInterpMissingEntries.AutoSize = True - Me.ucrChkInterpMissingEntries.Checked = False - Me.ucrChkInterpMissingEntries.Location = New System.Drawing.Point(6, 56) - Me.ucrChkInterpMissingEntries.Name = "ucrChkInterpMissingEntries" - Me.ucrChkInterpMissingEntries.Size = New System.Drawing.Size(188, 23) - Me.ucrChkInterpMissingEntries.TabIndex = 5 - ' - 'ucrChkInterpMissingDays - ' - Me.ucrChkInterpMissingDays.AutoSize = True - Me.ucrChkInterpMissingDays.Checked = False - Me.ucrChkInterpMissingDays.Location = New System.Drawing.Point(6, 31) - Me.ucrChkInterpMissingDays.Name = "ucrChkInterpMissingDays" - Me.ucrChkInterpMissingDays.Size = New System.Drawing.Size(168, 23) - Me.ucrChkInterpMissingDays.TabIndex = 6 - ' 'lblMissingMethod ' Me.lblMissingMethod.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMissingMethod.Location = New System.Drawing.Point(5, 496) + Me.lblMissingMethod.Location = New System.Drawing.Point(5, 435) Me.lblMissingMethod.Name = "lblMissingMethod" Me.lblMissingMethod.Size = New System.Drawing.Size(107, 20) Me.lblMissingMethod.TabIndex = 28 @@ -168,7 +150,7 @@ Partial Class dlgEvapotranspiration 'lblMaxMissingDays ' Me.lblMaxMissingDays.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMaxMissingDays.Location = New System.Drawing.Point(5, 262) + Me.lblMaxMissingDays.Location = New System.Drawing.Point(5, 238) Me.lblMaxMissingDays.Name = "lblMaxMissingDays" Me.lblMaxMissingDays.Size = New System.Drawing.Size(100, 20) Me.lblMaxMissingDays.TabIndex = 16 @@ -177,7 +159,7 @@ Partial Class dlgEvapotranspiration 'lblMaxDurationMissingData ' Me.lblMaxDurationMissingData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMaxDurationMissingData.Location = New System.Drawing.Point(5, 285) + Me.lblMaxDurationMissingData.Location = New System.Drawing.Point(5, 261) Me.lblMaxDurationMissingData.Name = "lblMaxDurationMissingData" Me.lblMaxDurationMissingData.Size = New System.Drawing.Size(71, 17) Me.lblMaxDurationMissingData.TabIndex = 18 @@ -186,7 +168,7 @@ Partial Class dlgEvapotranspiration 'lblMaxPerctMissindData ' Me.lblMaxPerctMissindData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMaxPerctMissindData.Location = New System.Drawing.Point(5, 309) + Me.lblMaxPerctMissindData.Location = New System.Drawing.Point(5, 285) Me.lblMaxPerctMissindData.Name = "lblMaxPerctMissindData" Me.lblMaxPerctMissindData.Size = New System.Drawing.Size(100, 19) Me.lblMaxPerctMissindData.TabIndex = 20 @@ -195,7 +177,7 @@ Partial Class dlgEvapotranspiration 'lblSolar ' Me.lblSolar.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSolar.Location = New System.Drawing.Point(5, 469) + Me.lblSolar.Location = New System.Drawing.Point(5, 413) Me.lblSolar.Name = "lblSolar" Me.lblSolar.Size = New System.Drawing.Size(38, 18) Me.lblSolar.TabIndex = 26 @@ -204,7 +186,7 @@ Partial Class dlgEvapotranspiration 'lblRadiation ' Me.lblRadiation.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblRadiation.Location = New System.Drawing.Point(323, 285) + Me.lblRadiation.Location = New System.Drawing.Point(278, 255) Me.lblRadiation.Name = "lblRadiation" Me.lblRadiation.Size = New System.Drawing.Size(117, 17) Me.lblRadiation.TabIndex = 14 @@ -214,35 +196,13 @@ Partial Class dlgEvapotranspiration ' Me.grpWindSpeed.Controls.Add(Me.ucrChkWind) Me.grpWindSpeed.Controls.Add(Me.ucrReceiverWindSpeed) - Me.grpWindSpeed.Location = New System.Drawing.Point(210, 363) + Me.grpWindSpeed.Location = New System.Drawing.Point(208, 337) Me.grpWindSpeed.Name = "grpWindSpeed" - Me.grpWindSpeed.Size = New System.Drawing.Size(235, 97) + Me.grpWindSpeed.Size = New System.Drawing.Size(185, 65) Me.grpWindSpeed.TabIndex = 25 Me.grpWindSpeed.TabStop = False Me.grpWindSpeed.Text = "Wind Speed" ' - 'ucrChkWind - ' - Me.ucrChkWind.AutoSize = True - Me.ucrChkWind.Checked = False - Me.ucrChkWind.Location = New System.Drawing.Point(5, 31) - Me.ucrChkWind.Name = "ucrChkWind" - Me.ucrChkWind.Size = New System.Drawing.Size(103, 23) - Me.ucrChkWind.TabIndex = 0 - ' - 'ucrReceiverWindSpeed - ' - Me.ucrReceiverWindSpeed.AutoSize = True - Me.ucrReceiverWindSpeed.frmParent = Me - Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(109, 30) - Me.ucrReceiverWindSpeed.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverWindSpeed.Name = "ucrReceiverWindSpeed" - Me.ucrReceiverWindSpeed.Selector = Nothing - Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverWindSpeed.strNcFilePath = "" - Me.ucrReceiverWindSpeed.TabIndex = 2 - Me.ucrReceiverWindSpeed.ucrSelector = Nothing - ' 'rdoHargreavesSamani ' Me.rdoHargreavesSamani.Appearance = System.Windows.Forms.Appearance.Button @@ -282,7 +242,7 @@ Partial Class dlgEvapotranspiration Me.ucrNudMaxDurationMissingData.AutoSize = True Me.ucrNudMaxDurationMissingData.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxDurationMissingData.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxDurationMissingData.Location = New System.Drawing.Point(180, 309) + Me.ucrNudMaxDurationMissingData.Location = New System.Drawing.Point(180, 285) Me.ucrNudMaxDurationMissingData.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxDurationMissingData.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxDurationMissingData.Name = "ucrNudMaxDurationMissingData" @@ -295,7 +255,7 @@ Partial Class dlgEvapotranspiration Me.ucrNudMaxMissingDays.AutoSize = True Me.ucrNudMaxMissingDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxMissingDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxMissingDays.Location = New System.Drawing.Point(180, 262) + Me.ucrNudMaxMissingDays.Location = New System.Drawing.Point(180, 238) Me.ucrNudMaxMissingDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxMissingDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxMissingDays.Name = "ucrNudMaxMissingDays" @@ -309,7 +269,7 @@ Partial Class dlgEvapotranspiration Me.ucrInputMissingMethod.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputMissingMethod.GetSetSelectedIndex = -1 Me.ucrInputMissingMethod.IsReadOnly = False - Me.ucrInputMissingMethod.Location = New System.Drawing.Point(139, 493) + Me.ucrInputMissingMethod.Location = New System.Drawing.Point(139, 435) Me.ucrInputMissingMethod.Name = "ucrInputMissingMethod" Me.ucrInputMissingMethod.Size = New System.Drawing.Size(137, 21) Me.ucrInputMissingMethod.TabIndex = 29 @@ -319,7 +279,7 @@ Partial Class dlgEvapotranspiration Me.ucrNudMaxMissingData.AutoSize = True Me.ucrNudMaxMissingData.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxMissingData.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxMissingData.Location = New System.Drawing.Point(180, 285) + Me.ucrNudMaxMissingData.Location = New System.Drawing.Point(180, 261) Me.ucrNudMaxMissingData.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) Me.ucrNudMaxMissingData.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMaxMissingData.Name = "ucrNudMaxMissingData" @@ -327,13 +287,35 @@ Partial Class dlgEvapotranspiration Me.ucrNudMaxMissingData.TabIndex = 19 Me.ucrNudMaxMissingData.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' + 'ucrChkWind + ' + Me.ucrChkWind.AutoSize = True + Me.ucrChkWind.Checked = False + Me.ucrChkWind.Location = New System.Drawing.Point(5, 31) + Me.ucrChkWind.Name = "ucrChkWind" + Me.ucrChkWind.Size = New System.Drawing.Size(85, 23) + Me.ucrChkWind.TabIndex = 0 + ' + 'ucrReceiverWindSpeed + ' + Me.ucrReceiverWindSpeed.AutoSize = True + Me.ucrReceiverWindSpeed.frmParent = Nothing + Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(93, 31) + Me.ucrReceiverWindSpeed.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverWindSpeed.Name = "ucrReceiverWindSpeed" + Me.ucrReceiverWindSpeed.Selector = Nothing + Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(84, 20) + Me.ucrReceiverWindSpeed.strNcFilePath = "" + Me.ucrReceiverWindSpeed.TabIndex = 2 + Me.ucrReceiverWindSpeed.ucrSelector = Nothing + ' 'ucrInputSolar ' Me.ucrInputSolar.AddQuotesIfUnrecognised = True Me.ucrInputSolar.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputSolar.GetSetSelectedIndex = -1 Me.ucrInputSolar.IsReadOnly = False - Me.ucrInputSolar.Location = New System.Drawing.Point(139, 466) + Me.ucrInputSolar.Location = New System.Drawing.Point(139, 410) Me.ucrInputSolar.Name = "ucrInputSolar" Me.ucrInputSolar.Size = New System.Drawing.Size(137, 21) Me.ucrInputSolar.TabIndex = 27 @@ -342,7 +324,7 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverRadiation.AutoSize = True Me.ucrReceiverRadiation.frmParent = Me - Me.ucrReceiverRadiation.Location = New System.Drawing.Point(324, 304) + Me.ucrReceiverRadiation.Location = New System.Drawing.Point(279, 273) Me.ucrReceiverRadiation.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRadiation.Name = "ucrReceiverRadiation" Me.ucrReceiverRadiation.Selector = Nothing @@ -357,7 +339,7 @@ Partial Class dlgEvapotranspiration Me.ucrInputCrop.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputCrop.GetSetSelectedIndex = -1 Me.ucrInputCrop.IsReadOnly = False - Me.ucrInputCrop.Location = New System.Drawing.Point(139, 520) + Me.ucrInputCrop.Location = New System.Drawing.Point(139, 461) Me.ucrInputCrop.Name = "ucrInputCrop" Me.ucrInputCrop.Size = New System.Drawing.Size(137, 21) Me.ucrInputCrop.TabIndex = 31 @@ -365,17 +347,35 @@ Partial Class dlgEvapotranspiration 'ucrNewColName ' Me.ucrNewColName.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrNewColName.Location = New System.Drawing.Point(5, 555) + Me.ucrNewColName.Location = New System.Drawing.Point(5, 486) Me.ucrNewColName.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrNewColName.Name = "ucrNewColName" Me.ucrNewColName.Size = New System.Drawing.Size(388, 24) Me.ucrNewColName.TabIndex = 32 ' + 'ucrChkInterpMissingEntries + ' + Me.ucrChkInterpMissingEntries.AutoSize = True + Me.ucrChkInterpMissingEntries.Checked = False + Me.ucrChkInterpMissingEntries.Location = New System.Drawing.Point(6, 38) + Me.ucrChkInterpMissingEntries.Name = "ucrChkInterpMissingEntries" + Me.ucrChkInterpMissingEntries.Size = New System.Drawing.Size(188, 23) + Me.ucrChkInterpMissingEntries.TabIndex = 5 + ' + 'ucrChkInterpMissingDays + ' + Me.ucrChkInterpMissingDays.AutoSize = True + Me.ucrChkInterpMissingDays.Checked = False + Me.ucrChkInterpMissingDays.Location = New System.Drawing.Point(6, 16) + Me.ucrChkInterpMissingDays.Name = "ucrChkInterpMissingDays" + Me.ucrChkInterpMissingDays.Size = New System.Drawing.Size(168, 23) + Me.ucrChkInterpMissingDays.TabIndex = 6 + ' 'ucrReceiverDate ' Me.ucrReceiverDate.AutoSize = True Me.ucrReceiverDate.frmParent = Me - Me.ucrReceiverDate.Location = New System.Drawing.Point(324, 79) + Me.ucrReceiverDate.Location = New System.Drawing.Point(279, 73) Me.ucrReceiverDate.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDate.Name = "ucrReceiverDate" Me.ucrReceiverDate.Selector = Nothing @@ -398,7 +398,7 @@ Partial Class dlgEvapotranspiration Me.ucrInputTimeStep.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputTimeStep.GetSetSelectedIndex = -1 Me.ucrInputTimeStep.IsReadOnly = False - Me.ucrInputTimeStep.Location = New System.Drawing.Point(180, 335) + Me.ucrInputTimeStep.Location = New System.Drawing.Point(180, 311) Me.ucrInputTimeStep.Name = "ucrInputTimeStep" Me.ucrInputTimeStep.Size = New System.Drawing.Size(106, 21) Me.ucrInputTimeStep.TabIndex = 23 @@ -407,7 +407,7 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverHumidityMin.AutoSize = True Me.ucrReceiverHumidityMin.frmParent = Me - Me.ucrReceiverHumidityMin.Location = New System.Drawing.Point(324, 259) + Me.ucrReceiverHumidityMin.Location = New System.Drawing.Point(279, 235) Me.ucrReceiverHumidityMin.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverHumidityMin.Name = "ucrReceiverHumidityMin" Me.ucrReceiverHumidityMin.Selector = Nothing @@ -420,7 +420,7 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverHumidityMax.AutoSize = True Me.ucrReceiverHumidityMax.frmParent = Me - Me.ucrReceiverHumidityMax.Location = New System.Drawing.Point(324, 214) + Me.ucrReceiverHumidityMax.Location = New System.Drawing.Point(279, 196) Me.ucrReceiverHumidityMax.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverHumidityMax.Name = "ucrReceiverHumidityMax" Me.ucrReceiverHumidityMax.Selector = Nothing @@ -433,7 +433,7 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverTmin.AutoSize = True Me.ucrReceiverTmin.frmParent = Me - Me.ucrReceiverTmin.Location = New System.Drawing.Point(324, 124) + Me.ucrReceiverTmin.Location = New System.Drawing.Point(279, 107) Me.ucrReceiverTmin.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverTmin.Name = "ucrReceiverTmin" Me.ucrReceiverTmin.Selector = Nothing @@ -446,7 +446,7 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverTmax.AutoSize = True Me.ucrReceiverTmax.frmParent = Me - Me.ucrReceiverTmax.Location = New System.Drawing.Point(324, 169) + Me.ucrReceiverTmax.Location = New System.Drawing.Point(279, 153) Me.ucrReceiverTmax.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverTmax.Name = "ucrReceiverTmax" Me.ucrReceiverTmax.Selector = Nothing @@ -461,7 +461,7 @@ Partial Class dlgEvapotranspiration Me.ucrSelectorEvapotranspiration.bDropUnusedFilterLevels = False Me.ucrSelectorEvapotranspiration.bShowHiddenColumns = False Me.ucrSelectorEvapotranspiration.bUseCurrentFilter = True - Me.ucrSelectorEvapotranspiration.Location = New System.Drawing.Point(5, 65) + Me.ucrSelectorEvapotranspiration.Location = New System.Drawing.Point(5, 50) Me.ucrSelectorEvapotranspiration.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorEvapotranspiration.Name = "ucrSelectorEvapotranspiration" Me.ucrSelectorEvapotranspiration.Size = New System.Drawing.Size(213, 183) @@ -471,9 +471,9 @@ Partial Class dlgEvapotranspiration ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(5, 583) + Me.ucrBase.Location = New System.Drawing.Point(5, 514) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 33 ' 'dlgEvapotranspiration @@ -481,7 +481,7 @@ Partial Class dlgEvapotranspiration 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(452, 640) + Me.ClientSize = New System.Drawing.Size(410, 563) Me.Controls.Add(Me.rdoHargreavesSamani) Me.Controls.Add(Me.rdoPenmanMonteith) Me.Controls.Add(Me.lblMaxPerctMissindData) From 8ece42fa8125901a645c4525fa257da0c715205a Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:09:00 +0200 Subject: [PATCH 02/52] crop --- instat/dlgApsimx.Designer.vb | 56 ++++++++++++++++++++-- instat/dlgApsimx.vb | 92 ++++++++++++++++++++++++++++++++++-- instat/frmMain.Designer.vb | 29 +++++++----- instat/frmMain.vb | 7 ++- 4 files changed, 166 insertions(+), 18 deletions(-) diff --git a/instat/dlgApsimx.Designer.vb b/instat/dlgApsimx.Designer.vb index b01e2a045df..5391dd84703 100644 --- a/instat/dlgApsimx.Designer.vb +++ b/instat/dlgApsimx.Designer.vb @@ -22,23 +22,69 @@ Partial Class dlgApsimx 'Ne la modifiez pas à l'aide de l'éditeur de code. _ Private Sub InitializeComponent() + Me.ucrSaveFile = New instat.ucrSave() + Me.ucrChkSilent = New instat.ucrCheck() + Me.lblExampleList = New System.Windows.Forms.Label() Me.ucrBase = New instat.ucrButtons() + Me.ucrInputComboList = New instat.ucrInputComboBox() Me.SuspendLayout() ' + 'ucrSaveFile + ' + Me.ucrSaveFile.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveFile.Location = New System.Drawing.Point(7, 74) + Me.ucrSaveFile.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveFile.Name = "ucrSaveFile" + Me.ucrSaveFile.Size = New System.Drawing.Size(394, 23) + Me.ucrSaveFile.TabIndex = 36 + ' + 'ucrChkSilent + ' + Me.ucrChkSilent.AutoSize = True + Me.ucrChkSilent.Checked = False + Me.ucrChkSilent.Location = New System.Drawing.Point(7, 43) + Me.ucrChkSilent.Name = "ucrChkSilent" + Me.ucrChkSilent.Size = New System.Drawing.Size(138, 23) + Me.ucrChkSilent.TabIndex = 33 + ' + 'lblExampleList + ' + Me.lblExampleList.AutoSize = True + Me.lblExampleList.Location = New System.Drawing.Point(7, 17) + Me.lblExampleList.Name = "lblExampleList" + Me.lblExampleList.Size = New System.Drawing.Size(69, 13) + Me.lblExampleList.TabIndex = 32 + Me.lblExampleList.Text = "Example List:" + ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(12, 255) + Me.ucrBase.Location = New System.Drawing.Point(7, 105) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 1 + Me.ucrBase.TabIndex = 31 + ' + 'ucrInputComboList + ' + Me.ucrInputComboList.AddQuotesIfUnrecognised = True + Me.ucrInputComboList.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrInputComboList.GetSetSelectedIndex = -1 + Me.ucrInputComboList.IsReadOnly = False + Me.ucrInputComboList.Location = New System.Drawing.Point(82, 12) + Me.ucrInputComboList.Name = "ucrInputComboList" + Me.ucrInputComboList.Size = New System.Drawing.Size(219, 23) + Me.ucrInputComboList.TabIndex = 37 ' 'dlgApsimx ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(433, 310) + Me.ClientSize = New System.Drawing.Size(433, 163) + Me.Controls.Add(Me.ucrInputComboList) + Me.Controls.Add(Me.ucrSaveFile) + Me.Controls.Add(Me.ucrChkSilent) + Me.Controls.Add(Me.lblExampleList) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -51,5 +97,9 @@ Partial Class dlgApsimx End Sub + Friend WithEvents ucrSaveFile As ucrSave + Friend WithEvents ucrChkSilent As ucrCheck + Friend WithEvents lblExampleList As Label Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrInputComboList As ucrInputComboBox End Class diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 35a703db725..f5d2cd1a485 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -15,27 +15,113 @@ ' along with this program. If not, see . Imports instat.Translations +Imports System.IO + Public Class dlgApsimx Public bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private clsApsimxExampleFunction, clsApsimExampleFunction As New RFunction Private Sub dlgApsimx_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() - SetDefaults() bFirstLoad = False End If - TestOKEnabled() + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False autoTranslate(Me) + TestOKEnabled() End Sub Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 479 + + ucrInputComboList.IsReadOnly = True + + ucrChkSilent.SetText("Silent") + ucrChkSilent.SetParameter(New RParameter("silent", 1)) + ucrChkSilent.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkSilent.SetRDefault("FALSE") + + ucrSaveFile.SetSaveTypeAsDataFrame() + ucrSaveFile.SetLabelText("New Data Frame Name:") + ucrSaveFile.SetIsTextBox() + + Dim dctExamplesModels As New Dictionary(Of String, String) From { + {"Barley", Chr(34) & "Barley" & Chr(34)}, + {"ControlledEnvironment", Chr(34) & "ControlledEnvironment" & Chr(34)}, + {"Eucalyptus", Chr(34) & "Eucalyptus" & Chr(34)}, + {"EucalyptusRotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, + {"Maize", Chr(34) & "Maize" & Chr(34)}, + {"Oats", Chr(34) & "Oats" & Chr(34)}, + {"Rotation", Chr(34) & "Rotation" & Chr(34)}, + {"Soybean", Chr(34) & "Soybean" & Chr(34)}, + {"Sugarcane", Chr(34) & "Sugarcane" & Chr(34)}, + {"Wheat", Chr(34) & "Wheat" & Chr(34)}, + {"Sugar", Chr(34) & "Sugar" & Chr(34)}, + {"Potato", Chr(34) & "Potato" & Chr(34)}, + {"Millet", Chr(34) & "Millet" & Chr(34)}, + {"Centro", Chr(34) & "Centro" & Chr(34)}, + {"Canopy", Chr(34) & "Canopy" & Chr(34)}, + {"agpasture", Chr(34) & "agpasture" & Chr(34)} + } + + ucrInputComboList.SetParameter(New RParameter("example", 0)) + ucrInputComboList.SetItems(dctExamplesModels) + ucrInputComboList.SetDropDownStyleAsNonEditable() + + End Sub + + Private Sub SetDefaults() + clsApsimxExampleFunction = New RFunction + clsApsimExampleFunction = New RFunction + + clsApsimxExampleFunction.SetPackageName("apsimx") + clsApsimxExampleFunction.SetRCommand("apsimx_example") + clsApsimxExampleFunction.AddParameter("example", Chr(34) & "Barley" & Chr(34), iPosition:=0) + + clsApsimExampleFunction.SetPackageName("apsimx") + clsApsimExampleFunction.SetRCommand("apsim_example") + + ucrBase.clsRsyntax.SetBaseRFunction(clsApsimxExampleFunction) + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrChkSilent.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("silent", 1), iAdditionalPairNo:=1) + ucrInputComboList.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("example", 0), iAdditionalPairNo:=1) + ucrSaveFile.AddAdditionalRCode(clsApsimExampleFunction, bReset) + + ucrChkSilent.SetRCode(clsApsimxExampleFunction, bReset) + ucrSaveFile.SetRCode(clsApsimxExampleFunction, bReset) + ucrInputComboList.SetRCode(clsApsimxExampleFunction, bReset) End Sub Private Sub TestOKEnabled() + If ucrSaveFile.IsComplete Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + End Sub + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOKEnabled() End Sub - Private Sub SetDefaults() + Private Sub ucrInputPath_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveFile.ControlContentsChanged, ucrChkSilent.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrInputComboList_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboList.ControlValueChanged + If ucrInputComboList.GetText = "wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Rotation" OrElse ucrInputComboList.GetText = "Soybean" Then + ucrBase.clsRsyntax.SetBaseRFunction(clsApsimxExampleFunction) + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsApsimExampleFunction) + End If + ucrSaveFile.SetPrefix(ucrInputComboList.GetText) + End Sub End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index feb6985cb34..c4ae06d6886 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -676,6 +676,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.mnuOptionsByContextCropModelApsimxExamples = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -4650,7 +4651,7 @@ Partial Class frmMain ' Me.mnuOptionsByContextCheckData.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuOptionsByContextCheckDataDuplicateRows, Me.mnuOptionsByContextCheckDataCompareColumns, Me.ToolStripSeparator47, Me.mnuOptionsByContextCheckDataOneVariableSummarise, Me.mnuOptionsByContextCheckDataOneVariableGraph, Me.mnuOptionsByContextCheckDataOneVariableFrequencies}) Me.mnuOptionsByContextCheckData.Name = "mnuOptionsByContextCheckData" - Me.mnuOptionsByContextCheckData.Size = New System.Drawing.Size(146, 22) + Me.mnuOptionsByContextCheckData.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextCheckData.Text = "Check Data" ' 'mnuOptionsByContextCheckDataDuplicateRows @@ -4692,7 +4693,7 @@ Partial Class frmMain ' Me.mnuOptionsByContextDefine.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuOptionsByContextDefineOnStation, Me.mnuOptionsByContextDefineOnFarm}) Me.mnuOptionsByContextDefine.Name = "mnuOptionsByContextDefine" - Me.mnuOptionsByContextDefine.Size = New System.Drawing.Size(146, 22) + Me.mnuOptionsByContextDefine.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextDefine.Text = "Define" ' 'mnuOptionsByContextDefineOnStation @@ -4711,7 +4712,7 @@ Partial Class frmMain ' Me.mnuOptionsByContextPrepare.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuOptionsByContextPrepareCalculateDIfferenceBetweenOptions, Me.ToolStripSeparator48, Me.mnuOptionsByContextMergeAdditionalData, Me.mnuOptionsByContextPrepareStack, Me.mnuOptionsByContextPrepareUnstack}) Me.mnuOptionsByContextPrepare.Name = "mnuOptionsByContextPrepare" - Me.mnuOptionsByContextPrepare.Size = New System.Drawing.Size(146, 22) + Me.mnuOptionsByContextPrepare.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextPrepare.Text = "Prepare" ' 'mnuOptionsByContextPrepareCalculateDIfferenceBetweenOptions @@ -4747,7 +4748,7 @@ Partial Class frmMain ' Me.mnuOptionsByContextDescribe.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuOptionsByContextDescribeCompareTwoTreatments, Me.mnuOptionsByContextDescribeCompareMultipleTreatments, Me.mnuOptionsByContextDescribeBoxplot}) Me.mnuOptionsByContextDescribe.Name = "mnuOptionsByContextDescribe" - Me.mnuOptionsByContextDescribe.Size = New System.Drawing.Size(146, 22) + Me.mnuOptionsByContextDescribe.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextDescribe.Text = "Describe" ' 'mnuOptionsByContextDescribeCompareTwoTreatments @@ -4773,28 +4774,27 @@ Partial Class frmMain ' Me.mnuOptionsByContextModel.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuOptionsByContextModelFitModel, Me.mnuOptionsByContextGeneralFitModel}) Me.mnuOptionsByContextModel.Name = "mnuOptionsByContextModel" - Me.mnuOptionsByContextModel.Size = New System.Drawing.Size(146, 22) + Me.mnuOptionsByContextModel.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextModel.Text = "Model" ' 'mnuOptionsByContextModelFitModel ' Me.mnuOptionsByContextModelFitModel.Name = "mnuOptionsByContextModelFitModel" - Me.mnuOptionsByContextModelFitModel.Size = New System.Drawing.Size(176, 22) + Me.mnuOptionsByContextModelFitModel.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextModelFitModel.Text = "Fit Model..." ' 'mnuOptionsByContextGeneralFitModel ' Me.mnuOptionsByContextGeneralFitModel.Name = "mnuOptionsByContextGeneralFitModel" - Me.mnuOptionsByContextGeneralFitModel.Size = New System.Drawing.Size(176, 22) + Me.mnuOptionsByContextGeneralFitModel.Size = New System.Drawing.Size(180, 22) Me.mnuOptionsByContextGeneralFitModel.Text = "General Fit Model..." ' 'mnuOptionsByContextCropModel ' - Me.mnuOptionsByContextCropModel.Enabled = False + Me.mnuOptionsByContextCropModel.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuOptionsByContextCropModelApsimxExamples}) Me.mnuOptionsByContextCropModel.Name = "mnuOptionsByContextCropModel" - Me.mnuOptionsByContextCropModel.Size = New System.Drawing.Size(146, 22) - Me.mnuOptionsByContextCropModel.Text = "Crop Model..." - Me.mnuOptionsByContextCropModel.Visible = False + Me.mnuOptionsByContextCropModel.Size = New System.Drawing.Size(180, 22) + Me.mnuOptionsByContextCropModel.Text = "Crop Model" ' 'mnuTools ' @@ -5091,6 +5091,12 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' + 'mnuOptionsByContextCropModelApsimxExamples + ' + Me.mnuOptionsByContextCropModelApsimxExamples.Name = "mnuOptionsByContextCropModelApsimxExamples" + Me.mnuOptionsByContextCropModelApsimxExamples.Size = New System.Drawing.Size(180, 22) + Me.mnuOptionsByContextCropModelApsimxExamples.Text = "Apsimx Examples..." + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -5785,4 +5791,5 @@ Partial Class frmMain Friend WithEvents mnuClimaticPICSAGeneralGraph As ToolStripMenuItem Friend WithEvents ToolStripSeparator73 As ToolStripSeparator Friend WithEvents mnuOptionsByContextCropModel As ToolStripMenuItem + Friend WithEvents mnuOptionsByContextCropModelApsimxExamples As ToolStripMenuItem End Class diff --git a/instat/frmMain.vb b/instat/frmMain.vb index d385183ca1e..1ee89c5673b 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2463,7 +2463,12 @@ Public Class frmMain dlgPICSARainfall.ShowDialog() End Sub - Private Sub mnuOptionsByContextCropModel_Click(sender As Object, e As EventArgs) Handles mnuOptionsByContextCropModel.Click + 'Private Sub mnuOptionsByContextCropModel_Click(sender As Object, e As EventArgs) Handles mnuOptionsByContextCropModel.Click + ' dlgApsimx.ShowDialog() + 'End Sub + + Private Sub mnuOptionsByContextCropModelApsimxExamples_Click(sender As Object, e As EventArgs) Handles mnuOptionsByContextCropModelApsimxExamples.Click dlgApsimx.ShowDialog() + End Sub End Class From 88b2014427654d00cf12b82332d793013b36b14c Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:37:52 +0200 Subject: [PATCH 03/52] Apsim example --- instat/dlgApsimx.Designer.vb | 14 +++++++------- instat/dlgApsimx.vb | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/instat/dlgApsimx.Designer.vb b/instat/dlgApsimx.Designer.vb index 5391dd84703..9fcd0e38425 100644 --- a/instat/dlgApsimx.Designer.vb +++ b/instat/dlgApsimx.Designer.vb @@ -36,7 +36,7 @@ Partial Class dlgApsimx Me.ucrSaveFile.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveFile.Name = "ucrSaveFile" Me.ucrSaveFile.Size = New System.Drawing.Size(394, 23) - Me.ucrSaveFile.TabIndex = 36 + Me.ucrSaveFile.TabIndex = 3 ' 'ucrChkSilent ' @@ -45,7 +45,7 @@ Partial Class dlgApsimx Me.ucrChkSilent.Location = New System.Drawing.Point(7, 43) Me.ucrChkSilent.Name = "ucrChkSilent" Me.ucrChkSilent.Size = New System.Drawing.Size(138, 23) - Me.ucrChkSilent.TabIndex = 33 + Me.ucrChkSilent.TabIndex = 2 ' 'lblExampleList ' @@ -53,7 +53,7 @@ Partial Class dlgApsimx Me.lblExampleList.Location = New System.Drawing.Point(7, 17) Me.lblExampleList.Name = "lblExampleList" Me.lblExampleList.Size = New System.Drawing.Size(69, 13) - Me.lblExampleList.TabIndex = 32 + Me.lblExampleList.TabIndex = 0 Me.lblExampleList.Text = "Example List:" ' 'ucrBase @@ -63,7 +63,7 @@ Partial Class dlgApsimx Me.ucrBase.Location = New System.Drawing.Point(7, 105) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 31 + Me.ucrBase.TabIndex = 4 ' 'ucrInputComboList ' @@ -71,10 +71,10 @@ Partial Class dlgApsimx Me.ucrInputComboList.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputComboList.GetSetSelectedIndex = -1 Me.ucrInputComboList.IsReadOnly = False - Me.ucrInputComboList.Location = New System.Drawing.Point(82, 12) + Me.ucrInputComboList.Location = New System.Drawing.Point(99, 12) Me.ucrInputComboList.Name = "ucrInputComboList" Me.ucrInputComboList.Size = New System.Drawing.Size(219, 23) - Me.ucrInputComboList.TabIndex = 37 + Me.ucrInputComboList.TabIndex = 1 ' 'dlgApsimx ' @@ -91,7 +91,7 @@ Partial Class dlgApsimx Me.MinimizeBox = False Me.Name = "dlgApsimx" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Apsimx" + Me.Text = "Import Apsimx/Apsim Examples" Me.ResumeLayout(False) Me.PerformLayout() diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index f5d2cd1a485..3a4fbd33563 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -51,9 +51,9 @@ Public Class dlgApsimx Dim dctExamplesModels As New Dictionary(Of String, String) From { {"Barley", Chr(34) & "Barley" & Chr(34)}, - {"ControlledEnvironment", Chr(34) & "ControlledEnvironment" & Chr(34)}, + {"Controlled Environment", Chr(34) & "ControlledEnvironment" & Chr(34)}, {"Eucalyptus", Chr(34) & "Eucalyptus" & Chr(34)}, - {"EucalyptusRotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, + {"Eucalyptus Rotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, {"Maize", Chr(34) & "Maize" & Chr(34)}, {"Oats", Chr(34) & "Oats" & Chr(34)}, {"Rotation", Chr(34) & "Rotation" & Chr(34)}, @@ -117,7 +117,7 @@ Public Class dlgApsimx End Sub Private Sub ucrInputComboList_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboList.ControlValueChanged - If ucrInputComboList.GetText = "wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Rotation" OrElse ucrInputComboList.GetText = "Soybean" Then + If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Rotation" OrElse ucrInputComboList.GetText = "Soybean" Then ucrBase.clsRsyntax.SetBaseRFunction(clsApsimxExampleFunction) Else ucrBase.clsRsyntax.SetBaseRFunction(clsApsimExampleFunction) From 006969baf6d22edcf1c9123cf8c0f8b6167d46f7 Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Fri, 9 Sep 2022 09:50:12 +0200 Subject: [PATCH 04/52] apsimx --- instat/dlgApsimx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 3a4fbd33563..696606d65f1 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -51,9 +51,9 @@ Public Class dlgApsimx Dim dctExamplesModels As New Dictionary(Of String, String) From { {"Barley", Chr(34) & "Barley" & Chr(34)}, - {"Controlled Environment", Chr(34) & "ControlledEnvironment" & Chr(34)}, + {"ControlledEnvironment", Chr(34) & "ControlledEnvironment" & Chr(34)}, {"Eucalyptus", Chr(34) & "Eucalyptus" & Chr(34)}, - {"Eucalyptus Rotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, + {"EucalyptusRotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, {"Maize", Chr(34) & "Maize" & Chr(34)}, {"Oats", Chr(34) & "Oats" & Chr(34)}, {"Rotation", Chr(34) & "Rotation" & Chr(34)}, From 7411bbc6ead57090d9fec395e61f7db0bd61a037 Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Thu, 22 Sep 2022 13:48:50 +0200 Subject: [PATCH 05/52] minor code amendement --- instat/dlgApsimx.vb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 696606d65f1..82dc781b5e3 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -117,8 +117,18 @@ Public Class dlgApsimx End Sub Private Sub ucrInputComboList_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboList.ControlValueChanged - If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Rotation" OrElse ucrInputComboList.GetText = "Soybean" Then + Dim clsReportOperator As New ROperator + clsReportOperator.SetOperation("$") + clsReportOperator.AddParameter("left", "Rotation", iPosition:=0) + clsReportOperator.AddParameter("right", "Report", iPosition:=1) + clsReportOperator.bSpaceAroundOperation = False + clsReportOperator.SetAssignTo("Rotation") + If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Soybean" Then ucrBase.clsRsyntax.SetBaseRFunction(clsApsimxExampleFunction) + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsReportOperator) + ElseIf ucrInputComboList.GetText = "Rotation" Then + ucrBase.clsRsyntax.SetBaseROperator(clsReportOperator) + 'ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) Else ucrBase.clsRsyntax.SetBaseRFunction(clsApsimExampleFunction) End If From f30403c8350e3f85be1c3449151fed25a9c34e9c Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Thu, 22 Sep 2022 16:04:04 +0200 Subject: [PATCH 06/52] add dialog --- instat/dlgApsimx.Designer.vb | 41 ++++++++++++++++++--------- instat/dlgApsimx.vb | 55 ++++++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/instat/dlgApsimx.Designer.vb b/instat/dlgApsimx.Designer.vb index 9fcd0e38425..f76088c7da6 100644 --- a/instat/dlgApsimx.Designer.vb +++ b/instat/dlgApsimx.Designer.vb @@ -22,22 +22,14 @@ Partial Class dlgApsimx 'Ne la modifiez pas à l'aide de l'éditeur de code. _ Private Sub InitializeComponent() - Me.ucrSaveFile = New instat.ucrSave() Me.ucrChkSilent = New instat.ucrCheck() Me.lblExampleList = New System.Windows.Forms.Label() Me.ucrBase = New instat.ucrButtons() Me.ucrInputComboList = New instat.ucrInputComboBox() + Me.lblSaveData = New System.Windows.Forms.Label() + Me.ucrInputSaveData = New instat.ucrInputTextBox() Me.SuspendLayout() ' - 'ucrSaveFile - ' - Me.ucrSaveFile.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveFile.Location = New System.Drawing.Point(7, 74) - Me.ucrSaveFile.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveFile.Name = "ucrSaveFile" - Me.ucrSaveFile.Size = New System.Drawing.Size(394, 23) - Me.ucrSaveFile.TabIndex = 3 - ' 'ucrChkSilent ' Me.ucrChkSilent.AutoSize = True @@ -71,18 +63,39 @@ Partial Class dlgApsimx Me.ucrInputComboList.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputComboList.GetSetSelectedIndex = -1 Me.ucrInputComboList.IsReadOnly = False - Me.ucrInputComboList.Location = New System.Drawing.Point(99, 12) + Me.ucrInputComboList.Location = New System.Drawing.Point(135, 12) Me.ucrInputComboList.Name = "ucrInputComboList" Me.ucrInputComboList.Size = New System.Drawing.Size(219, 23) Me.ucrInputComboList.TabIndex = 1 ' + 'lblSaveData + ' + Me.lblSaveData.AutoSize = True + Me.lblSaveData.Location = New System.Drawing.Point(7, 79) + Me.lblSaveData.Name = "lblSaveData" + Me.lblSaveData.Size = New System.Drawing.Size(61, 13) + Me.lblSaveData.TabIndex = 5 + Me.lblSaveData.Text = "Save Data:" + ' + 'ucrInputSaveData + ' + Me.ucrInputSaveData.AddQuotesIfUnrecognised = True + Me.ucrInputSaveData.AutoSize = True + Me.ucrInputSaveData.IsMultiline = False + Me.ucrInputSaveData.IsReadOnly = False + Me.ucrInputSaveData.Location = New System.Drawing.Point(135, 75) + Me.ucrInputSaveData.Name = "ucrInputSaveData" + Me.ucrInputSaveData.Size = New System.Drawing.Size(137, 21) + Me.ucrInputSaveData.TabIndex = 6 + ' 'dlgApsimx ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(433, 163) + Me.Controls.Add(Me.ucrInputSaveData) + Me.Controls.Add(Me.lblSaveData) Me.Controls.Add(Me.ucrInputComboList) - Me.Controls.Add(Me.ucrSaveFile) Me.Controls.Add(Me.ucrChkSilent) Me.Controls.Add(Me.lblExampleList) Me.Controls.Add(Me.ucrBase) @@ -96,10 +109,10 @@ Partial Class dlgApsimx Me.PerformLayout() End Sub - - Friend WithEvents ucrSaveFile As ucrSave Friend WithEvents ucrChkSilent As ucrCheck Friend WithEvents lblExampleList As Label Friend WithEvents ucrBase As ucrButtons Friend WithEvents ucrInputComboList As ucrInputComboBox + Friend WithEvents lblSaveData As Label + Friend WithEvents ucrInputSaveData As ucrInputTextBox End Class diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 82dc781b5e3..463bb36c7d2 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -21,6 +21,8 @@ Public Class dlgApsimx Public bFirstLoad As Boolean = True Private bReset As Boolean = True Private clsApsimxExampleFunction, clsApsimExampleFunction As New RFunction + Private clsBaseFunction, clsDataListFunction As New RFunction + Private clsReportOperator As New ROperator Private Sub dlgApsimx_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() @@ -45,10 +47,6 @@ Public Class dlgApsimx ucrChkSilent.SetValuesCheckedAndUnchecked("TRUE", "FALSE") ucrChkSilent.SetRDefault("FALSE") - ucrSaveFile.SetSaveTypeAsDataFrame() - ucrSaveFile.SetLabelText("New Data Frame Name:") - ucrSaveFile.SetIsTextBox() - Dim dctExamplesModels As New Dictionary(Of String, String) From { {"Barley", Chr(34) & "Barley" & Chr(34)}, {"ControlledEnvironment", Chr(34) & "ControlledEnvironment" & Chr(34)}, @@ -77,7 +75,19 @@ Public Class dlgApsimx Private Sub SetDefaults() clsApsimxExampleFunction = New RFunction clsApsimExampleFunction = New RFunction + clsBaseFunction = New RFunction + clsDataListFunction = New RFunction + clsReportOperator = New ROperator + + clsReportOperator.SetOperation("$") + clsReportOperator.AddParameter("left", "Rotation", iPosition:=0) + clsReportOperator.AddParameter("right", "Report", iPosition:=1) + clsReportOperator.bSpaceAroundOperation = False + clsReportOperator.SetAssignTo("Rotation") + clsBaseFunction.SetRCommand("data_book$import_data") + clsBaseFunction.AddParameter("data_tables", clsRFunctionParameter:=clsDataListFunction, iPosition:=0) + clsDataListFunction.SetRCommand("list") clsApsimxExampleFunction.SetPackageName("apsimx") clsApsimxExampleFunction.SetRCommand("apsimx_example") clsApsimxExampleFunction.AddParameter("example", Chr(34) & "Barley" & Chr(34), iPosition:=0) @@ -85,21 +95,21 @@ Public Class dlgApsimx clsApsimExampleFunction.SetPackageName("apsimx") clsApsimExampleFunction.SetRCommand("apsim_example") - ucrBase.clsRsyntax.SetBaseRFunction(clsApsimxExampleFunction) + ucrBase.clsRsyntax.ClearCodes() + ucrBase.clsRsyntax.SetBaseRFunction(clsBaseFunction) End Sub Private Sub SetRCodeForControls(bReset As Boolean) ucrChkSilent.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("silent", 1), iAdditionalPairNo:=1) ucrInputComboList.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("example", 0), iAdditionalPairNo:=1) - ucrSaveFile.AddAdditionalRCode(clsApsimExampleFunction, bReset) + ucrChkSilent.SetRCode(clsApsimxExampleFunction, bReset) - ucrSaveFile.SetRCode(clsApsimxExampleFunction, bReset) ucrInputComboList.SetRCode(clsApsimxExampleFunction, bReset) End Sub Private Sub TestOKEnabled() - If ucrSaveFile.IsComplete Then + If ucrInputSaveData.GetText <> "" Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -112,26 +122,29 @@ Public Class dlgApsimx TestOKEnabled() End Sub - Private Sub ucrInputPath_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrSaveFile.ControlContentsChanged, ucrChkSilent.ControlContentsChanged + Private Sub ucrInputPath_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrChkSilent.ControlContentsChanged TestOKEnabled() End Sub Private Sub ucrInputComboList_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboList.ControlValueChanged - Dim clsReportOperator As New ROperator - clsReportOperator.SetOperation("$") - clsReportOperator.AddParameter("left", "Rotation", iPosition:=0) - clsReportOperator.AddParameter("right", "Report", iPosition:=1) - clsReportOperator.bSpaceAroundOperation = False - clsReportOperator.SetAssignTo("Rotation") + Dim strDataName As String = ucrInputComboList.GetText + ucrInputSaveData.SetText(strDataName) + clsApsimxExampleFunction.SetAssignTo(strDataName) + clsApsimExampleFunction.SetAssignTo(strDataName) + clsDataListFunction.ClearParameters() If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Soybean" Then - ucrBase.clsRsyntax.SetBaseRFunction(clsApsimxExampleFunction) - ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsReportOperator) + clsDataListFunction.AddParameter(ucrInputSaveData.GetText, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsReportOperator) ElseIf ucrInputComboList.GetText = "Rotation" Then - ucrBase.clsRsyntax.SetBaseROperator(clsReportOperator) - 'ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) + clsDataListFunction.AddParameter(strDataName, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsReportOperator, 1) Else - ucrBase.clsRsyntax.SetBaseRFunction(clsApsimExampleFunction) + clsDataListFunction.AddParameter(strDataName, clsRFunctionParameter:=clsApsimExampleFunction, iPosition:=0) + ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimExampleFunction, 0) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsReportOperator) End If - ucrSaveFile.SetPrefix(ucrInputComboList.GetText) + ucrBase.clsRsyntax.SetBaseRFunction(clsBaseFunction) End Sub End Class \ No newline at end of file From 76685c36f2fbb2f31dcbc58b475264abb6d673c1 Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Fri, 23 Sep 2022 12:02:19 +0200 Subject: [PATCH 07/52] Fixes Bug --- instat/dlgApsimx.Designer.vb | 6 +++--- instat/dlgApsimx.vb | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/instat/dlgApsimx.Designer.vb b/instat/dlgApsimx.Designer.vb index f76088c7da6..4361391bc5f 100644 --- a/instat/dlgApsimx.Designer.vb +++ b/instat/dlgApsimx.Designer.vb @@ -55,7 +55,7 @@ Partial Class dlgApsimx Me.ucrBase.Location = New System.Drawing.Point(7, 105) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) - Me.ucrBase.TabIndex = 4 + Me.ucrBase.TabIndex = 5 ' 'ucrInputComboList ' @@ -74,7 +74,7 @@ Partial Class dlgApsimx Me.lblSaveData.Location = New System.Drawing.Point(7, 79) Me.lblSaveData.Name = "lblSaveData" Me.lblSaveData.Size = New System.Drawing.Size(61, 13) - Me.lblSaveData.TabIndex = 5 + Me.lblSaveData.TabIndex = 3 Me.lblSaveData.Text = "Save Data:" ' 'ucrInputSaveData @@ -86,7 +86,7 @@ Partial Class dlgApsimx Me.ucrInputSaveData.Location = New System.Drawing.Point(135, 75) Me.ucrInputSaveData.Name = "ucrInputSaveData" Me.ucrInputSaveData.Size = New System.Drawing.Size(137, 21) - Me.ucrInputSaveData.TabIndex = 6 + Me.ucrInputSaveData.TabIndex = 4 ' 'dlgApsimx ' diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 463bb36c7d2..bf060243cd8 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -49,9 +49,9 @@ Public Class dlgApsimx Dim dctExamplesModels As New Dictionary(Of String, String) From { {"Barley", Chr(34) & "Barley" & Chr(34)}, - {"ControlledEnvironment", Chr(34) & "ControlledEnvironment" & Chr(34)}, + {"Controlled Environment", Chr(34) & "ControlledEnvironment" & Chr(34)}, {"Eucalyptus", Chr(34) & "Eucalyptus" & Chr(34)}, - {"EucalyptusRotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, + {"Eucalyptus Rotation", Chr(34) & "EucalyptusRotation" & Chr(34)}, {"Maize", Chr(34) & "Maize" & Chr(34)}, {"Oats", Chr(34) & "Oats" & Chr(34)}, {"Rotation", Chr(34) & "Rotation" & Chr(34)}, @@ -62,8 +62,7 @@ Public Class dlgApsimx {"Potato", Chr(34) & "Potato" & Chr(34)}, {"Millet", Chr(34) & "Millet" & Chr(34)}, {"Centro", Chr(34) & "Centro" & Chr(34)}, - {"Canopy", Chr(34) & "Canopy" & Chr(34)}, - {"agpasture", Chr(34) & "agpasture" & Chr(34)} + {"Canopy", Chr(34) & "Canopy" & Chr(34)} } ucrInputComboList.SetParameter(New RParameter("example", 0)) @@ -95,12 +94,11 @@ Public Class dlgApsimx clsApsimExampleFunction.SetPackageName("apsimx") clsApsimExampleFunction.SetRCommand("apsim_example") - ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseRFunction(clsBaseFunction) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrChkSilent.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("silent", 1), iAdditionalPairNo:=1) + ucrChkSilent.AddAdditionalCodeParameterPair(clsApsimExampleFunction, ucrChkSilent.GetParameter, iAdditionalPairNo:=1) ucrInputComboList.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("example", 0), iAdditionalPairNo:=1) @@ -127,12 +125,13 @@ Public Class dlgApsimx End Sub Private Sub ucrInputComboList_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboList.ControlValueChanged - Dim strDataName As String = ucrInputComboList.GetText + Dim strDataName As String = frmMain.clsRLink.MakeValidText(ucrInputComboList.GetText) ucrInputSaveData.SetText(strDataName) clsApsimxExampleFunction.SetAssignTo(strDataName) clsApsimExampleFunction.SetAssignTo(strDataName) clsDataListFunction.ClearParameters() - If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "ControlledEnvironment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "EucalyptusRotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Soybean" Then + ucrBase.clsRsyntax.ClearCodes() + If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "Controlled Environment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "Eucalyptus Rotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Soybean" Then clsDataListFunction.AddParameter(ucrInputSaveData.GetText, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) ucrBase.clsRsyntax.RemoveFromAfterCodes(clsReportOperator) From 2c6db5d844178bc804d44706c29208afd409273c Mon Sep 17 00:00:00 2001 From: MeSophie <106779233+MeSophie@users.noreply.github.com> Date: Fri, 30 Sep 2022 16:57:06 +0200 Subject: [PATCH 08/52] Delete empty line --- instat/dlgApsimx.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index bf060243cd8..831b44d3f54 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -101,7 +101,6 @@ Public Class dlgApsimx ucrChkSilent.AddAdditionalCodeParameterPair(clsApsimExampleFunction, ucrChkSilent.GetParameter, iAdditionalPairNo:=1) ucrInputComboList.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("example", 0), iAdditionalPairNo:=1) - ucrChkSilent.SetRCode(clsApsimxExampleFunction, bReset) ucrInputComboList.SetRCode(clsApsimxExampleFunction, bReset) End Sub From 52f66e04574d9421fb6d2665fc2866b9c751f604 Mon Sep 17 00:00:00 2001 From: ChrisMarsh82 <84872334+ChrisMarsh82@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:05:58 +0100 Subject: [PATCH 09/52] Added create installer to workflows This updates the current installer to allow it to be done through github workflows --- .github/workflows/CreateInstaller.yml | 193 +++++++++++++++ inno_install_script_32bit.iss | 42 ++++ inno_install_script_64bit.iss | 43 ++++ instat/clsRLink.vb | 2 +- instat/frmMain.Designer.vb | 2 +- .../static/InstatObject/R/InstallPackages.R | 224 ++++++++++++++++++ 6 files changed, 504 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/CreateInstaller.yml create mode 100644 inno_install_script_32bit.iss create mode 100644 inno_install_script_64bit.iss create mode 100644 instat/static/InstatObject/R/InstallPackages.R diff --git a/.github/workflows/CreateInstaller.yml b/.github/workflows/CreateInstaller.yml new file mode 100644 index 00000000000..e3161d66698 --- /dev/null +++ b/.github/workflows/CreateInstaller.yml @@ -0,0 +1,193 @@ + +name: Create 32 bit and 64 bit Installers + + + +on: + workflow_dispatch: + inputs: + major_version: + description: 'Major Version' + required: true + minor_version: + description: 'Minor Version' + required: true + build_no: + description: 'Build No' + required: true + +jobs: + + build: + + strategy: + matrix: + configuration: [Release] + + # running on 2019 so that .NET version 4.5 and lower can be used + runs-on: windows-2019 + + # set variables + env: + Solution_Name: Instat.sln # Replace with your solution name, i.e. MyWpfApp.sln. + Test_Project_Path: instat\instat.vbproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. + + # check out r-instat + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + # set up and restore NuGet packages + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.6 + + - name: Restore NuGet + run: nuget restore $env:Solution_Name + + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} + + # increment revision number + - name: Generate revision number + uses: einaregilsson/build-number@v3 + with: + token: ${{secrets.github_token}} + + #update version numbers in assembley + - name: set-version-assemblyinfo + uses: dannevesdantas/set-version-assemblyinfo@v.1.0.0 + with: + # Folder location to search for AssemblyInfo.cs/.vb files + path: instat\My Project\AssemblyInfo.vb + # optional, default is ${{ github.workspace }} + # Version number to set on [AssemblyVersion] and [AssemblyFileVersion] attributes of AssemblyInfo.cs/.vb files + version: "${{ inputs.major_version }}.${{ inputs.minor_version }}.${{ inputs.build_no }}" #.${env:BUILD_NUMBER}" + + # Create the app package by building and packaging the Windows Application Packaging project + - name: Create the app package + run: msbuild $env:Test_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + env: + Appx_Bundle: Always + Appx_Bundle_Platforms: x86|x64 + Appx_Package_Build_Mode: StoreUpload + Configuration: ${{ matrix.configuration }} + + # Build 32 bit installer without R + - name: Building the installer 32bit - No R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_32bit.iss" + shell: cmd + + # upload 32 bit installer without R + - name: Upload the 32 bit installer as an artifact + uses: actions/upload-artifact@v2 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/R-Instat_0.7.4_Installer_32.exe" + name: rinstat32NoR-innosetup + + # Build 64 bit installer without R + - name: Building the installer 64bit - No R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss" + shell: cmd + + # Upload 64 bit installer without R + - name: Upload the 64 bit installer as an artifact + uses: actions/upload-artifact@v2 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/R-Instat_Installer_64.exe" + name: rinstat64NoR-innosetup + + # check out R-Instat Data + - name: Checkout Instat Data + uses: actions/checkout@v2 + with: + repository: ' africanmathsinitiative/R-Instat-Data' + fetch-depth: 0 + path: 'InstatData' + + # Create directory and copy over InstatData (64bit) + - name: Make Library directory 64 bit + run: | + MKDIR instat\bin\Release\static\Library\ + + - name: Copy R-Instat Data 64 bit + run: | + ROBOCOPY InstatData\data\ instat\bin\Release\static\Library\ /E + continue-on-error: true + + # Create directory and copy over InstatData (32bit) + - name: Make Library directory 32 bit + run: | + MKDIR instat\bin\x64\Release\static\Library\ + + - name: Copy R-Instat Data 32 bit + run: | + ROBOCOPY InstatData\data\*.* instat\bin\x64\Release\static\Library\ /E + continue-on-error: true + + # check out R for R-Instat + - name: Checkout R for R-Instat + uses: actions/checkout@v2 + with: + repository: 'ChrisMarsh82/R-RInstat' + fetch-depth: 0 + path: 'R-RInstat' + + - name: Copy R 64 bit + run: | + ROBOCOPY R-RInstat\64Bit\ instat\bin\Release\static\ /E + continue-on-error: true + + - name: Copy R 32 bit + run: | + ROBOCOPY R-RInstat\32Bit\ instat\bin\x64\Release\static\ /E + continue-on-error: true + + - name: Install R packages (64 bit) + run: | + "instat\bin\Release\static\R\bin\Rscript.exe" "instat\static\InstatObject\R\InstallPackages.R" + shell: cmd + + - name: Install R packages (32 bit) + run: | + "instat\bin\x64\Release\static\R\bin\Rscript.exe" "instat\static\InstatObject\R\InstallPackages.R" + shell: cmd + + - name: Building the installer 64bit - With R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_64bit.iss" + shell: cmd + + - name: Building the installer 32bit - With R + run: | + "%programfiles(x86)%\Inno Setup 6\iscc.exe" "inno_install_script_32bit.iss" + shell: cmd + + - name: Upload the 64 bit installer with R as an artifact + uses: actions/upload-artifact@v2 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/R-Instat_Installer_64.exe" + name: rinstat64WithR-innosetup + + - name: Upload the 32 bit installer with R as an artifact + uses: actions/upload-artifact@v2 + if: ${{ github.event_name != 'pull_request' }} + with: + path: "Output/R-Instat_Installer_32.exe" + name: rinstat64WithR-innosetup + + diff --git a/inno_install_script_32bit.iss b/inno_install_script_32bit.iss new file mode 100644 index 00000000000..9c7689b98b3 --- /dev/null +++ b/inno_install_script_32bit.iss @@ -0,0 +1,42 @@ +; Script generated by the Inno Script Studio Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppVersion= {#GetStringFileInfo("instat\bin\Release\instat.exe", "FileVersion")} +AppId={{979E51D8-9BC4-418F-8D4D-9B44FEA869A6-{#SetupSetting("AppVersion")}} +AppName=R-Instat + +AppPublisher=African Maths Initiative +AppPublisherURL=http://r-instat.org/ +AppSupportURL=http://r-instat.org/ +AppUpdatesURL=http://r-instat.org/ +DefaultDirName={autopf}\R-Instat\ +DefaultGroupName=R-Instat +AllowNoIcons=yes +OutputBaseFilename=R-Instat_Installer_32 +SetupIconFile=.\instat\Resources\rinstat_icon_Hih_icon.ico +UninstallDisplayIcon=.\instat\Resources\rinstat_icon_Hih_icon.ico +Compression=lzma +SolidCompression=yes + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; +Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0 + +[Files] +Source: "instat\bin\x64\Release\instat.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "instat\bin\x64\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +;{#SetupSetting("AppVersion")} +Name: "{group}\R-Instat {#SetupSetting("AppVersion")}"; Filename: "{app}\instat.exe" +Name: "{group}\{cm:UninstallProgram,R-Instat}"; Filename: "{uninstallexe}" +Name: "{commondesktop}\R-Instat {#SetupSetting("AppVersion")}"; Filename: "{app}\instat.exe"; Tasks: desktopicon +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat {#SetupSetting("AppVersion")}"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon + +[Run] +Filename: "{app}\instat.exe"; Description: "{cm:LaunchProgram,R-Instat}"; Flags: nowait postinstall skipifsilent diff --git a/inno_install_script_64bit.iss b/inno_install_script_64bit.iss new file mode 100644 index 00000000000..eae4c890349 --- /dev/null +++ b/inno_install_script_64bit.iss @@ -0,0 +1,43 @@ +; Script generated by the Inno Script Studio Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppVersion= {#GetStringFileInfo("instat\bin\Release\instat.exe", "FileVersion")} +AppId={{5455FC1A-85BE-4679-B600-8A1A4FC3CDD9-{#SetupSetting("AppVersion")}} +AppName=R-Instat + +AppPublisher=African Maths Initiative +AppPublisherURL=http://r-instat.org/ +AppSupportURL=http://r-instat.org/ +AppUpdatesURL=http://r-instat.org/ +DefaultDirName={autopf}\R-Instat\ +DefaultGroupName=R-Instat +AllowNoIcons=yes +OutputBaseFilename=R-Instat_Installer_64 +SetupIconFile=.\instat\Resources\rinstat_icon_Hih_icon.ico +UninstallDisplayIcon=.\instat\Resources\rinstat_icon_Hih_icon.ico +Compression=lzma +SolidCompression=yes +ArchitecturesInstallIn64BitMode=x64 + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; +Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0 + +[Files] +Source: "instat\bin\Release\instat.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "instat\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +;{#SetupSetting("AppVersion")} +Name: "{group}\R-Instat {#SetupSetting("AppVersion")}"; Filename: "{app}\instat.exe" +Name: "{group}\{cm:UninstallProgram,R-Instat}"; Filename: "{uninstallexe}" +Name: "{commondesktop}\R-Instat {#SetupSetting("AppVersion")}"; Filename: "{app}\instat.exe"; Tasks: desktopicon +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat {#SetupSetting("AppVersion")}"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon + +[Run] +Filename: "{app}\instat.exe"; Description: "{cm:LaunchProgram,R-Instat}"; Flags: nowait postinstall skipifsilent diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 47cc3710ad3..ef16c08736a 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -218,7 +218,7 @@ Public Class RLink Dim iCurrentCallType As Integer Dim bClose As Boolean = False Dim strStaticPath = Path.GetFullPath("static") - Dim rHome = Path.Combine(strStaticPath, "R-" & strRBundledVersion) + Dim rHome = Path.Combine(strStaticPath, "R") Dim cpuArchitectureFolder = "i386" Try diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index 1f4c4d7c93b..301ffd4adff 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -5124,7 +5124,7 @@ 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.ToString Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.stsStrip.ResumeLayout(False) Me.stsStrip.PerformLayout() diff --git a/instat/static/InstatObject/R/InstallPackages.R b/instat/static/InstatObject/R/InstallPackages.R new file mode 100644 index 00000000000..18f88c3eaf5 --- /dev/null +++ b/instat/static/InstatObject/R/InstallPackages.R @@ -0,0 +1,224 @@ +# Packages including dependencies +# Generated from install_packages.R, do not edit manually! +packs <- c("abind", "agricolae", "agridat", + "AlgDesign", "animation", "arrangements", "ash", + "askpass", "assertthat", "automap", "backports", + "base64enc", "bayestestR", "BH", "bit", + "bit64", "bitops", "boot", "brew", "brio", + "broom", "bslib", "cachem", "callr", + "candisc", "car", "carData", "caret", + "cellranger", "changepoint", "checkmate", "chillR", + "chron", "circlize", "CircStats", "circular", + "class", "classInt", "cli", "clifro", + "climdex.pcic", "clipr", "clue", "cluster", + "cmsaf", "cmsafops", "cmsafvis", "codetools", + "colorRamps", "colorspace", "colourpicker", + "combinat", "commonmark", "corrplot", "corrr", + "countrycode", "cowplot", "cpp11", "crayon", + "credentials", "crosstalk", "curl", "DAAG", + "dae", "data.table", "datawizard", "date", + "DBI", "dendextend", "DEoptimR", "desc", + "DescTools", "devtools", "diffobj", "digest", + "distillery", "dotCall64", "dplyr", "dslabs", + "DT", "e1071", "ecmwfr", "effectsize", + "ellipse", "ellipsis", "emmeans", "EnvStats", + "estimability", "evaluate", "Evapotranspiration", + "Exact", "expm", "extraDistr", "extrafont", + "extrafontdb", "extRemes", "factoextra", "FactoMineR", + "fansi", "faraway", "farver", "fastDummies", + "fastmap", "fields", "filelock", "fitdistrplus", + "flashClust", "FNN", "fontawesome", "forcats", + "foreach", "forecast", "foreign", "formula.tools", + "Formula", "fracdiff", "fs", "future.apply", + "future", "gapminder", "gclus", "gcookbook", + "generics", "GenSA", "geosphere", "gert", + "getPass", "GGally", "ggalt", "ggdendro", + "ggeffects", "ggfittext", "ggforce", "ggformula", + "ggfortify", "ggmosaic", "ggplot2", "ggplotify", + "ggpmisc", "ggpp", "ggpubr", "ggrepel", + "ggridges", "ggsci", "ggsignif", "ggstance", + "ggtext", "ggthemes", "ggwordcloud", "gh", + "gitcreds", "gld", "GlobalOptions", "globals", + "glue", "gmp", "goftest", "gower", "gridExtra", + "gridGraphics", "gridtext", "gstat", "gtable", + "hardhat", "haven", "heplots", "hexbin", + "highr", "HistData", "Hmisc", "hms", + "htmlTable", "htmltools", "htmlwidgets", "httpuv", + "httr", "hunspell", "hydroGOF", "hydroTSM", + "imputeTS", "ini", "insight", "intervals", + "ipred", "isoband", "iterators", "janeaustenr", + "janitor", "jpeg", "jquerylib", "jsonlite", + "Kendall", "KernSmooth", "keyring", "klaR", + "knitr", "labeling", "labelled", "Lahman", + "later", "lattice", "latticeExtra", "lava", + "lazyeval", "leaflet.providers", "leaflet", + "leaps", "lemon", "lifecycle", "listenv", + "lme4", "lmodel2", "lmom", "lmomco", + "Lmoments", "lmtest", "lubridate", "magick", + "magrittr", "mapdata", "mapproj", "maps", + "maptools", "markdown", "MASS", "Matrix", + "MatrixModels", "mc2d", "memoise", "metR", + "mgcv", "mime", "miniUI", "minqa", "MKdescr", + "MKinfer", "mlbench", "ModelMetrics", "modelr", + "mosaic", "mosaicCore", "mosaicData", "munsell", + "mvtnorm", "ncdf4.helpers", "ncdf4", "nlme", + "nloptr", "nnet", "nortest", "numDeriv", + "nycflights13", "openair", "openssl", "openxlsx", + "operator.tools", "parallelly", "parameters", + "patchwork", "pbkrtest", "pbs", "PCICt", + "performance", "pillar", "pkgbuild", "pkgconfig", + "pkgload", "plotly", "plotrix", "pls", + "plyr", "png", "polyclip", "polynom", + "praise", "prettyunits", "pROC", "processx", + "prodlim", "productplots", "progress", "progressr", + "proj4", "promises", "proxy", "ps", "purrr", + "qap", "quadprog", "quantmod", "quantreg", + "questionr", "R.cache", "R.methodsS3", "R.oo", + "R.utils", "R6", "rainfarmr", "rappdirs", + "raster", "rasterVis", "rbibutils", "rcmdcheck", + "RColorBrewer", "rcorpora", "Rcpp", "RcppArmadillo", + "RcppEigen", "RcppRoll", "RCurl", "Rdpack", + "readODS", "readr", "readxl", "recipes", + "registry", "rematch", "rematch2", "remotes", + "repr", "reshape", "reshape2", "rgdal", + "rio", "rje", "rlang", "RMAWGEN", "RMySQL", + "robustbase", "rootSolve", "roxygen2", "rpart", + "rpivotTable", "rprojroot", "rrefine", "rstatix", + "rstudioapi", "rtf", "Rttf2pt1", "rversions", + "rvest", "rworldmap", "rworldxtra", "s2", + "sandwich", "sass", "scales", "scatterplot3d", + "SearchTrees", "selectr", "seriation", "sessioninfo", + "sf", "shades", "shape", "shiny", "shinyFiles", + "shinyjs", "shinythemes", "shinyWidgets", "signmedian.test", + "sjlabelled", "sjmisc", "sjPlot", "sjstats", + "skimr", "snakecase", "SnowballC", "sodium", + "sourcetools", "sp", "spacetime", "spam", + "SparseM", "SPEI", "splines2", "splus2R", + "SQUAREM", "statip", "stinepack", "stringdist", + "stringi", "stringr", "strucchange", "styler", + "survival", "svglite", "sys", "systemfonts", + "terra", "testthat", "texmex", "tibble", + "tidyr", "tidyselect", "tidytext", "timeDate", + "tokenizers", "treemapify", "trend", "tseries", + "TSP", "TTR", "tweenr", "tzdb", "units", + "urca", "usethis", "utf8", "vars", "vctrs", + "viridis", "viridisLite", "visdat", "visreg", + "vroom", "wakefield", "waldo", "weathermetrics", + "whisker", "withr", "wk", "xfun", "XML", + "xml2", "xopen", "xtable", "xts", "yaml", + "yulab.utils", "zip", "zoo", "zyp") + +versions <- c("1.4-5", "1.3-5", "1.20", "1.2.1", + "2.7", "1.1.9", "1.0-15", "1.1", "0.2.1", + "1.0-16", "1.4.1", "0.1-3", "0.12.1", + "1.78.0-0", "4.0.4", "4.0.5", "1.0-7", + "1.3-28", "1.0-7", "1.1.3", "0.8.0", + "0.3.1", "1.0.6", "3.7.0", "0.8-6", "3.0-13", + "3.0-5", "6.0-92", "1.1.0", "2.2.3", + "2.1.0", "0.72.7", "2.3-57", "0.4.15", + "0.2-6", "0.4-95", "7.3-20", "0.4-7", + "3.3.0", "3.2-5", "1.1-11", "0.8.0", + "0.3-61", "2.1.3", "3.4.2", "1.2.4", + "1.1.11", "0.2-18", "2.3.1", "2.0-3", + "1.1.1", "0.0-8", "1.8.0", "0.92", "0.4.3", + "1.4.0", "1.1.1", "0.4.2", "1.5.1", "1.3.2", + "1.2.0", "4.3.2", "1.25.3", "3.2-13", + "1.14.2", "0.4.1", "1.2-39", "1.1.2", + "1.15.2", "1.0-11", "1.4.1", "0.99.45", + "2.4.3", "0.3.5", "0.6.29", "1.2-1", + "1.0-1", "1.0.9", "0.7.4", "0.23", "1.7-11", + "1.3.0", "0.7.0", "0.4.3", "0.3.2", "1.7.4-1", + "2.7.0", "1.3", "0.15", "1.16", "3.1", + "0.999-6", "1.9.1", "0.18", "1.0", "2.1-2", + "1.0.7", "2.4", "1.0.3", "1.0.7", "2.1.0", + "1.6.3", "1.1.0", "13.3", "1.0.2", "1.1-8", + "1.01-2", "1.1.3.1", "0.2.2", "0.5.1", + "1.5.2", "8.16", "0.8-82", "1.7.1", "1.2-4", + "1.5-1", "1.5.2", "1.9.0", "1.26.1", + "0.3.0", "1.3.2", "2.0", "0.1.2", "1.1.7", + "1.5-14", "1.6.0", "0.2-2", "2.1.2", + "0.4.0", "0.1.23", "1.1.2", "0.9.1", + "0.3.3", "0.10.1", "0.4.14", "0.3.3", + "3.3.6", "0.1.0", "0.4.6", "0.4.4", "0.4.0", + "0.9.1", "0.5.3", "2.9", "0.6.3", "0.3.5", + "0.1.1", "4.2.4", "0.5.0", "1.3.0", "0.1.1", + "2.6.4", "0.1.2", "0.15.0", "1.6.2", + "0.6-5", "1.2-3", "1.0.0", "2.3", "0.5-1", + "0.1.4", "2.0-9", "0.3.0", "1.1.0", "2.5.0", + "1.3-9", "1.28.2", "0.9", "0.8-7", "4.7-0", + "1.1.1", "2.4.0", "0.5.2", "1.5.4", "1.6.5", + "1.4.3", "3.0.1", "0.4-0", "0.6-0", "3.2", + "0.3.1", "0.17.1", "0.15.2", "0.9-13", + "0.2.5", "1.0.14", "0.1.5", "2.1.0", + "0.1-9", "0.1.4", "1.8.0", "2.2.1", "2.23-20", + "1.3.0", "1.7-0", "1.39", "0.4.2", "2.9.1", + "10.0-1", "1.3.0", "0.20-45", "0.6-29", + "1.6.10", "0.2.2", "1.9.0", "2.1.1", + "3.1", "0.4.5", "1.0.1", "0.8.0", "1.1-29", + "1.7-3", "2.9", "2.3.7", "1.3-1", "0.9-40", + "1.8.0", "2.7.3", "2.0.3", "2.3.0", "1.2.8", + "3.4.0", "1.1-4", "1.1", "7.3-57", "1.4-1", + "0.5-0", "0.1-21", "2.0.1", "0.12.0", + "1.8-40", "0.12", "0.1.1.1", "1.2.4", + "0.7", "0.6", "2.1-3", "1.2.2.2", "0.1.8", + "1.8.3", "0.9.0", "0.20.2", "0.5.0", + "1.1-3", "0.3-6", "1.19", "3.1-157", + "2.0.3", "7.3-17", "1.0-4", "2016.8-1.1", + "1.0.2", "2.9-1", "2.0.2", "4.2.5", "1.6.3", + "1.32.0", "0.18.1", "1.1.1", "0.5.1", + "1.1", "0.5-4.1", "0.9.0", "1.7.0", "1.3.1", + "2.0.3", "1.2.4", "4.10.0", "3.8-2", + "2.8-0", "1.8.7", "0.1-7", "1.10-0", + "1.4-1", "1.0.0", "1.1.1", "1.18.0", + "3.6.0", "2019.11.13", "0.1.1", "1.2.2", + "0.10.1", "1.0-11", "1.2.0.1", "0.4-27", + "1.7.0", "0.3.4", "0.1-1", "1.5-8", "0.4.20", + "5.93", "0.7.7", "0.15.0", "1.8.1", "1.25.0", + "2.11.0", "2.5.1", "0.1", "0.3.3", "3.5-15", + "0.51.2", "2.2.8", "1.4.0", "1.1-3", + "2.0.0", "1.0.8.3", "0.11.1.1.0", "0.3.3.9.2", + "0.3.0", "1.98-1.7", "2.3.1", "1.7.0", + "2.1.2", "1.4.0", "0.2.0", "0.5-1", "1.0.1", + "2.1.2", "2.4.2", "1.1.4", "0.8.9", "1.4.4", + "1.5-32", "0.5.29", "1.11.0", "1.0.2", + "1.3.7", "0.10.23", "0.95-0", "1.8.2.3", + "7.2.0", "4.1.16", "0.3.0", "2.0.3", + "2.0.0", "0.7.0", "0.13", "0.4-14.1", + "1.3.10", "2.1.1", "1.0.2", "1.3-6", + "1.01", "1.0.7", "3.0-1", "0.4.1", "1.2.0", + "0.3-41", "0.5.3", "0.4-2", "1.3.5", + "1.2.2", "1.0-7", "1.4.0", "1.4.6", "1.7.1", + "0.9.2", "2.1.0", "1.2.0", "0.7.0", "1.5.1", + "1.2.0", "2.8.9", "2.8.10", "0.18.1", + "2.1.4", "0.11.0", "0.7.0", "1.2.1", + "0.1.7", "1.5-0", "1.2-7", "2.8-0", "1.81", + "1.7", "0.4.5", "1.3-3", "2021.1", "0.2.3", + "1.4", "0.9.8", "1.7.6", "1.4.0", "1.5-2", + "1.7.0", "3.3-1", "2.1.0", "3.4", "1.0.4", + "1.5-34", "3.1.4", "2.4.8", "3.1.7", + "1.2.0", "1.1.2", "0.3.3", "3043.102", + "0.2.1", "2.5.5", "1.1.4", "0.10-51", + "1.2-0", "0.24.3", "1.0.2", "0.3.0", + "0.8-0", "1.3-0", "2.1.6", "1.2.2", "1.5-6", + "0.4.1", "0.6.2", "0.4.0", "0.5.3", "2.7.0", + "1.5.7", "0.3.6", "0.4.0", "1.2.2", "0.4", + "2.5.0", "0.6.0", "0.31", "3.99-0.10", + "1.3.3", "1.0.0", "1.8-4", "0.12.1", + "2.3.5", "0.0.4", "2.2.0", "1.8-10", + "0.10-1.1") + +################################################## + +# Returns package names from packs which are not installed with the correct version +packages_not_installed <- function() { + success <- invisible(mapply(function(p, v) length(find.package(p, quiet = TRUE)) > 0 && compareVersion(as.character(packageVersion(p)), v) >= 0, packs, versions)) + return(names(success)[!success]) +} + +install.packages(packs, dependencies = FALSE, repos='http://cran.us.r-project.org') + +install.packages(packages_not_installed(), dependencies = FALSE, repos='http://cran.us.r-project.org') + +devtools::install_github("ianmoran11/mmtable2") + + From 3dee7ca7d9bd1cacf0263a6b433615f26068e921 Mon Sep 17 00:00:00 2001 From: Sophie Date: Thu, 10 Nov 2022 14:55:41 +0100 Subject: [PATCH 10/52] Added Missing Options on the Evapotranspiration Dialog. --- instat/dlgEvapotranspiration.Designer.vb | 218 +++++------------- instat/dlgEvapotranspiration.vb | 88 ++++--- instat/instat.vbproj | 9 + ...ssingOptionsEvapotranspiration.Designer.vb | 177 ++++++++++++++ .../sdgMissingOptionsEvapotranspiration.resx | 120 ++++++++++ instat/sdgMissingOptionsEvapotranspiration.vb | 61 +++++ 6 files changed, 482 insertions(+), 191 deletions(-) create mode 100644 instat/sdgMissingOptionsEvapotranspiration.Designer.vb create mode 100644 instat/sdgMissingOptionsEvapotranspiration.resx create mode 100644 instat/sdgMissingOptionsEvapotranspiration.vb diff --git a/instat/dlgEvapotranspiration.Designer.vb b/instat/dlgEvapotranspiration.Designer.vb index 36752fc97d6..7d1716fc75d 100644 --- a/instat/dlgEvapotranspiration.Designer.vb +++ b/instat/dlgEvapotranspiration.Designer.vb @@ -29,28 +29,20 @@ Partial Class dlgEvapotranspiration Me.lblTimeStep = New System.Windows.Forms.Label() Me.lblCrop = New System.Windows.Forms.Label() Me.lblDate = New System.Windows.Forms.Label() - Me.grpMissingDataOpts = New System.Windows.Forms.GroupBox() Me.lblMissingMethod = New System.Windows.Forms.Label() - Me.lblMaxMissingDays = New System.Windows.Forms.Label() - Me.lblMaxDurationMissingData = New System.Windows.Forms.Label() - Me.lblMaxPerctMissindData = New System.Windows.Forms.Label() Me.lblSolar = New System.Windows.Forms.Label() Me.lblRadiation = New System.Windows.Forms.Label() Me.grpWindSpeed = New System.Windows.Forms.GroupBox() Me.rdoHargreavesSamani = New System.Windows.Forms.RadioButton() Me.rdoPenmanMonteith = New System.Windows.Forms.RadioButton() - Me.ucrNudMaxDurationMissingData = New instat.ucrNud() - Me.ucrNudMaxMissingDays = New instat.ucrNud() + Me.cmdEvapOptions = New System.Windows.Forms.Button() Me.ucrInputMissingMethod = New instat.ucrInputComboBox() - Me.ucrNudMaxMissingData = New instat.ucrNud() Me.ucrChkWind = New instat.ucrCheck() Me.ucrReceiverWindSpeed = New instat.ucrReceiverSingle() Me.ucrInputSolar = New instat.ucrInputComboBox() Me.ucrReceiverRadiation = New instat.ucrReceiverSingle() Me.ucrInputCrop = New instat.ucrInputComboBox() Me.ucrNewColName = New instat.ucrSave() - Me.ucrChkInterpMissingEntries = New instat.ucrCheck() - Me.ucrChkInterpMissingDays = New instat.ucrCheck() Me.ucrReceiverDate = New instat.ucrReceiverSingle() Me.ucrPnlMethod = New instat.UcrPanel() Me.ucrInputTimeStep = New instat.ucrInputComboBox() @@ -60,59 +52,58 @@ Partial Class dlgEvapotranspiration Me.ucrReceiverTmax = New instat.ucrReceiverSingle() Me.ucrSelectorEvapotranspiration = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.grpMissingDataOpts.SuspendLayout() Me.grpWindSpeed.SuspendLayout() Me.SuspendLayout() ' 'lblTmax ' Me.lblTmax.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTmax.Location = New System.Drawing.Point(276, 138) + Me.lblTmax.Location = New System.Drawing.Point(311, 120) Me.lblTmax.Name = "lblTmax" - Me.lblTmax.Size = New System.Drawing.Size(44, 13) + Me.lblTmax.Size = New System.Drawing.Size(47, 13) Me.lblTmax.TabIndex = 8 Me.lblTmax.Text = "Tmax:" ' 'lblTmin ' Me.lblTmin.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTmin.Location = New System.Drawing.Point(278, 93) + Me.lblTmin.Location = New System.Drawing.Point(311, 85) Me.lblTmin.Name = "lblTmin" - Me.lblTmin.Size = New System.Drawing.Size(39, 14) + Me.lblTmin.Size = New System.Drawing.Size(42, 14) Me.lblTmin.TabIndex = 6 Me.lblTmin.Text = "Tmin:" ' 'lblHumidityMax ' Me.lblHumidityMax.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHumidityMax.Location = New System.Drawing.Point(279, 179) + Me.lblHumidityMax.Location = New System.Drawing.Point(311, 156) Me.lblHumidityMax.Name = "lblHumidityMax" - Me.lblHumidityMax.Size = New System.Drawing.Size(121, 19) + Me.lblHumidityMax.Size = New System.Drawing.Size(124, 19) Me.lblHumidityMax.TabIndex = 10 Me.lblHumidityMax.Text = "Humidity Max:" ' 'lblHumidityMin ' Me.lblHumidityMin.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblHumidityMin.Location = New System.Drawing.Point(279, 216) + Me.lblHumidityMin.Location = New System.Drawing.Point(311, 197) Me.lblHumidityMin.Name = "lblHumidityMin" - Me.lblHumidityMin.Size = New System.Drawing.Size(120, 19) + Me.lblHumidityMin.Size = New System.Drawing.Size(123, 19) Me.lblHumidityMin.TabIndex = 12 Me.lblHumidityMin.Text = "Humidity Min:" ' 'lblTimeStep ' Me.lblTimeStep.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblTimeStep.Location = New System.Drawing.Point(5, 312) + Me.lblTimeStep.Location = New System.Drawing.Point(2, 242) Me.lblTimeStep.Name = "lblTimeStep" - Me.lblTimeStep.Size = New System.Drawing.Size(134, 20) + Me.lblTimeStep.Size = New System.Drawing.Size(107, 20) Me.lblTimeStep.TabIndex = 22 Me.lblTimeStep.Text = "Time Step" ' 'lblCrop ' Me.lblCrop.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblCrop.Location = New System.Drawing.Point(5, 461) + Me.lblCrop.Location = New System.Drawing.Point(2, 344) Me.lblCrop.Name = "lblCrop" Me.lblCrop.Size = New System.Drawing.Size(71, 20) Me.lblCrop.TabIndex = 30 @@ -121,63 +112,25 @@ Partial Class dlgEvapotranspiration 'lblDate ' Me.lblDate.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblDate.Location = New System.Drawing.Point(276, 57) + Me.lblDate.Location = New System.Drawing.Point(311, 48) Me.lblDate.Name = "lblDate" - Me.lblDate.Size = New System.Drawing.Size(40, 14) + Me.lblDate.Size = New System.Drawing.Size(43, 14) Me.lblDate.TabIndex = 4 Me.lblDate.Text = "Date:" ' - 'grpMissingDataOpts - ' - Me.grpMissingDataOpts.Controls.Add(Me.ucrChkInterpMissingEntries) - Me.grpMissingDataOpts.Controls.Add(Me.ucrChkInterpMissingDays) - Me.grpMissingDataOpts.Location = New System.Drawing.Point(5, 338) - Me.grpMissingDataOpts.Name = "grpMissingDataOpts" - Me.grpMissingDataOpts.Size = New System.Drawing.Size(198, 66) - Me.grpMissingDataOpts.TabIndex = 24 - Me.grpMissingDataOpts.TabStop = False - Me.grpMissingDataOpts.Text = "Missing Data Options" - ' 'lblMissingMethod ' Me.lblMissingMethod.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMissingMethod.Location = New System.Drawing.Point(5, 435) + Me.lblMissingMethod.Location = New System.Drawing.Point(2, 310) Me.lblMissingMethod.Name = "lblMissingMethod" Me.lblMissingMethod.Size = New System.Drawing.Size(107, 20) Me.lblMissingMethod.TabIndex = 28 Me.lblMissingMethod.Text = "Missing Method" ' - 'lblMaxMissingDays - ' - Me.lblMaxMissingDays.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMaxMissingDays.Location = New System.Drawing.Point(5, 238) - Me.lblMaxMissingDays.Name = "lblMaxMissingDays" - Me.lblMaxMissingDays.Size = New System.Drawing.Size(169, 20) - Me.lblMaxMissingDays.TabIndex = 16 - Me.lblMaxMissingDays.Text = "Max Missing Days" - ' - 'lblMaxDurationMissingData - ' - Me.lblMaxDurationMissingData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMaxDurationMissingData.Location = New System.Drawing.Point(5, 261) - Me.lblMaxDurationMissingData.Name = "lblMaxDurationMissingData" - Me.lblMaxDurationMissingData.Size = New System.Drawing.Size(160, 20) - Me.lblMaxDurationMissingData.TabIndex = 18 - Me.lblMaxDurationMissingData.Text = "Max Duration Missing Data" - ' - 'lblMaxPerctMissindData - ' - Me.lblMaxPerctMissindData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblMaxPerctMissindData.Location = New System.Drawing.Point(5, 285) - Me.lblMaxPerctMissindData.Name = "lblMaxPerctMissindData" - Me.lblMaxPerctMissindData.Size = New System.Drawing.Size(169, 19) - Me.lblMaxPerctMissindData.TabIndex = 20 - Me.lblMaxPerctMissindData.Text = "Max Missing Data" - ' 'lblSolar ' Me.lblSolar.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblSolar.Location = New System.Drawing.Point(5, 413) + Me.lblSolar.Location = New System.Drawing.Point(2, 275) Me.lblSolar.Name = "lblSolar" Me.lblSolar.Size = New System.Drawing.Size(58, 18) Me.lblSolar.TabIndex = 26 @@ -186,9 +139,9 @@ Partial Class dlgEvapotranspiration 'lblRadiation ' Me.lblRadiation.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblRadiation.Location = New System.Drawing.Point(278, 255) + Me.lblRadiation.Location = New System.Drawing.Point(311, 237) Me.lblRadiation.Name = "lblRadiation" - Me.lblRadiation.Size = New System.Drawing.Size(117, 17) + Me.lblRadiation.Size = New System.Drawing.Size(120, 17) Me.lblRadiation.TabIndex = 14 Me.lblRadiation.Text = "Radiation:" ' @@ -196,9 +149,9 @@ Partial Class dlgEvapotranspiration ' Me.grpWindSpeed.Controls.Add(Me.ucrChkWind) Me.grpWindSpeed.Controls.Add(Me.ucrReceiverWindSpeed) - Me.grpWindSpeed.Location = New System.Drawing.Point(208, 337) + Me.grpWindSpeed.Location = New System.Drawing.Point(262, 286) Me.grpWindSpeed.Name = "grpWindSpeed" - Me.grpWindSpeed.Size = New System.Drawing.Size(185, 65) + Me.grpWindSpeed.Size = New System.Drawing.Size(191, 57) Me.grpWindSpeed.TabIndex = 25 Me.grpWindSpeed.TabStop = False Me.grpWindSpeed.Text = "Wind Speed" @@ -237,31 +190,15 @@ Partial Class dlgEvapotranspiration Me.rdoPenmanMonteith.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoPenmanMonteith.UseVisualStyleBackColor = True ' - 'ucrNudMaxDurationMissingData - ' - Me.ucrNudMaxDurationMissingData.AutoSize = True - Me.ucrNudMaxDurationMissingData.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudMaxDurationMissingData.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxDurationMissingData.Location = New System.Drawing.Point(180, 285) - Me.ucrNudMaxDurationMissingData.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudMaxDurationMissingData.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudMaxDurationMissingData.Name = "ucrNudMaxDurationMissingData" - Me.ucrNudMaxDurationMissingData.Size = New System.Drawing.Size(50, 20) - Me.ucrNudMaxDurationMissingData.TabIndex = 21 - Me.ucrNudMaxDurationMissingData.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' - 'ucrNudMaxMissingDays - ' - Me.ucrNudMaxMissingDays.AutoSize = True - Me.ucrNudMaxMissingDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudMaxMissingDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxMissingDays.Location = New System.Drawing.Point(180, 238) - Me.ucrNudMaxMissingDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudMaxMissingDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudMaxMissingDays.Name = "ucrNudMaxMissingDays" - Me.ucrNudMaxMissingDays.Size = New System.Drawing.Size(50, 20) - Me.ucrNudMaxMissingDays.TabIndex = 17 - Me.ucrNudMaxMissingDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) + 'cmdEvapOptions + ' + Me.cmdEvapOptions.Location = New System.Drawing.Point(314, 360) + Me.cmdEvapOptions.Name = "cmdEvapOptions" + Me.cmdEvapOptions.Size = New System.Drawing.Size(123, 23) + Me.cmdEvapOptions.TabIndex = 34 + Me.cmdEvapOptions.Tag = "Options" + Me.cmdEvapOptions.Text = "Missing Options" + Me.cmdEvapOptions.UseVisualStyleBackColor = True ' 'ucrInputMissingMethod ' @@ -269,42 +206,29 @@ Partial Class dlgEvapotranspiration Me.ucrInputMissingMethod.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputMissingMethod.GetSetSelectedIndex = -1 Me.ucrInputMissingMethod.IsReadOnly = False - Me.ucrInputMissingMethod.Location = New System.Drawing.Point(139, 435) + Me.ucrInputMissingMethod.Location = New System.Drawing.Point(109, 310) Me.ucrInputMissingMethod.Name = "ucrInputMissingMethod" Me.ucrInputMissingMethod.Size = New System.Drawing.Size(137, 21) Me.ucrInputMissingMethod.TabIndex = 29 ' - 'ucrNudMaxMissingData - ' - Me.ucrNudMaxMissingData.AutoSize = True - Me.ucrNudMaxMissingData.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudMaxMissingData.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - Me.ucrNudMaxMissingData.Location = New System.Drawing.Point(180, 261) - Me.ucrNudMaxMissingData.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudMaxMissingData.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudMaxMissingData.Name = "ucrNudMaxMissingData" - Me.ucrNudMaxMissingData.Size = New System.Drawing.Size(50, 20) - Me.ucrNudMaxMissingData.TabIndex = 19 - Me.ucrNudMaxMissingData.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' 'ucrChkWind ' Me.ucrChkWind.AutoSize = True Me.ucrChkWind.Checked = False Me.ucrChkWind.Location = New System.Drawing.Point(5, 31) Me.ucrChkWind.Name = "ucrChkWind" - Me.ucrChkWind.Size = New System.Drawing.Size(85, 23) + Me.ucrChkWind.Size = New System.Drawing.Size(108, 23) Me.ucrChkWind.TabIndex = 0 ' 'ucrReceiverWindSpeed ' Me.ucrReceiverWindSpeed.AutoSize = True Me.ucrReceiverWindSpeed.frmParent = Nothing - Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(93, 31) + Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(116, 31) Me.ucrReceiverWindSpeed.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverWindSpeed.Name = "ucrReceiverWindSpeed" Me.ucrReceiverWindSpeed.Selector = Nothing - Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(84, 20) + Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(72, 20) Me.ucrReceiverWindSpeed.strNcFilePath = "" Me.ucrReceiverWindSpeed.TabIndex = 2 Me.ucrReceiverWindSpeed.ucrSelector = Nothing @@ -315,7 +239,7 @@ Partial Class dlgEvapotranspiration Me.ucrInputSolar.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputSolar.GetSetSelectedIndex = -1 Me.ucrInputSolar.IsReadOnly = False - Me.ucrInputSolar.Location = New System.Drawing.Point(139, 410) + Me.ucrInputSolar.Location = New System.Drawing.Point(109, 275) Me.ucrInputSolar.Name = "ucrInputSolar" Me.ucrInputSolar.Size = New System.Drawing.Size(137, 21) Me.ucrInputSolar.TabIndex = 27 @@ -324,11 +248,11 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverRadiation.AutoSize = True Me.ucrReceiverRadiation.frmParent = Me - Me.ucrReceiverRadiation.Location = New System.Drawing.Point(279, 273) + Me.ucrReceiverRadiation.Location = New System.Drawing.Point(314, 254) Me.ucrReceiverRadiation.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRadiation.Name = "ucrReceiverRadiation" Me.ucrReceiverRadiation.Selector = Nothing - Me.ucrReceiverRadiation.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverRadiation.Size = New System.Drawing.Size(123, 20) Me.ucrReceiverRadiation.strNcFilePath = "" Me.ucrReceiverRadiation.TabIndex = 15 Me.ucrReceiverRadiation.ucrSelector = Nothing @@ -339,7 +263,7 @@ Partial Class dlgEvapotranspiration Me.ucrInputCrop.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputCrop.GetSetSelectedIndex = -1 Me.ucrInputCrop.IsReadOnly = False - Me.ucrInputCrop.Location = New System.Drawing.Point(139, 461) + Me.ucrInputCrop.Location = New System.Drawing.Point(109, 343) Me.ucrInputCrop.Name = "ucrInputCrop" Me.ucrInputCrop.Size = New System.Drawing.Size(137, 21) Me.ucrInputCrop.TabIndex = 31 @@ -347,39 +271,21 @@ Partial Class dlgEvapotranspiration 'ucrNewColName ' Me.ucrNewColName.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrNewColName.Location = New System.Drawing.Point(5, 486) + Me.ucrNewColName.Location = New System.Drawing.Point(5, 386) Me.ucrNewColName.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrNewColName.Name = "ucrNewColName" Me.ucrNewColName.Size = New System.Drawing.Size(388, 24) Me.ucrNewColName.TabIndex = 32 ' - 'ucrChkInterpMissingEntries - ' - Me.ucrChkInterpMissingEntries.AutoSize = True - Me.ucrChkInterpMissingEntries.Checked = False - Me.ucrChkInterpMissingEntries.Location = New System.Drawing.Point(6, 38) - Me.ucrChkInterpMissingEntries.Name = "ucrChkInterpMissingEntries" - Me.ucrChkInterpMissingEntries.Size = New System.Drawing.Size(188, 23) - Me.ucrChkInterpMissingEntries.TabIndex = 5 - ' - 'ucrChkInterpMissingDays - ' - Me.ucrChkInterpMissingDays.AutoSize = True - Me.ucrChkInterpMissingDays.Checked = False - Me.ucrChkInterpMissingDays.Location = New System.Drawing.Point(6, 16) - Me.ucrChkInterpMissingDays.Name = "ucrChkInterpMissingDays" - Me.ucrChkInterpMissingDays.Size = New System.Drawing.Size(168, 23) - Me.ucrChkInterpMissingDays.TabIndex = 6 - ' 'ucrReceiverDate ' Me.ucrReceiverDate.AutoSize = True Me.ucrReceiverDate.frmParent = Me - Me.ucrReceiverDate.Location = New System.Drawing.Point(279, 73) + Me.ucrReceiverDate.Location = New System.Drawing.Point(314, 63) Me.ucrReceiverDate.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDate.Name = "ucrReceiverDate" Me.ucrReceiverDate.Selector = Nothing - Me.ucrReceiverDate.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverDate.Size = New System.Drawing.Size(123, 20) Me.ucrReceiverDate.strNcFilePath = "" Me.ucrReceiverDate.TabIndex = 5 Me.ucrReceiverDate.ucrSelector = Nothing @@ -398,20 +304,20 @@ Partial Class dlgEvapotranspiration Me.ucrInputTimeStep.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputTimeStep.GetSetSelectedIndex = -1 Me.ucrInputTimeStep.IsReadOnly = False - Me.ucrInputTimeStep.Location = New System.Drawing.Point(180, 311) + Me.ucrInputTimeStep.Location = New System.Drawing.Point(109, 241) Me.ucrInputTimeStep.Name = "ucrInputTimeStep" - Me.ucrInputTimeStep.Size = New System.Drawing.Size(106, 21) + Me.ucrInputTimeStep.Size = New System.Drawing.Size(113, 21) Me.ucrInputTimeStep.TabIndex = 23 ' 'ucrReceiverHumidityMin ' Me.ucrReceiverHumidityMin.AutoSize = True Me.ucrReceiverHumidityMin.frmParent = Me - Me.ucrReceiverHumidityMin.Location = New System.Drawing.Point(279, 235) + Me.ucrReceiverHumidityMin.Location = New System.Drawing.Point(314, 216) Me.ucrReceiverHumidityMin.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverHumidityMin.Name = "ucrReceiverHumidityMin" Me.ucrReceiverHumidityMin.Selector = Nothing - Me.ucrReceiverHumidityMin.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverHumidityMin.Size = New System.Drawing.Size(123, 20) Me.ucrReceiverHumidityMin.strNcFilePath = "" Me.ucrReceiverHumidityMin.TabIndex = 13 Me.ucrReceiverHumidityMin.ucrSelector = Nothing @@ -420,11 +326,11 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverHumidityMax.AutoSize = True Me.ucrReceiverHumidityMax.frmParent = Me - Me.ucrReceiverHumidityMax.Location = New System.Drawing.Point(279, 196) + Me.ucrReceiverHumidityMax.Location = New System.Drawing.Point(314, 175) Me.ucrReceiverHumidityMax.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverHumidityMax.Name = "ucrReceiverHumidityMax" Me.ucrReceiverHumidityMax.Selector = Nothing - Me.ucrReceiverHumidityMax.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverHumidityMax.Size = New System.Drawing.Size(123, 20) Me.ucrReceiverHumidityMax.strNcFilePath = "" Me.ucrReceiverHumidityMax.TabIndex = 11 Me.ucrReceiverHumidityMax.ucrSelector = Nothing @@ -433,11 +339,11 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverTmin.AutoSize = True Me.ucrReceiverTmin.frmParent = Me - Me.ucrReceiverTmin.Location = New System.Drawing.Point(279, 107) + Me.ucrReceiverTmin.Location = New System.Drawing.Point(314, 99) Me.ucrReceiverTmin.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverTmin.Name = "ucrReceiverTmin" Me.ucrReceiverTmin.Selector = Nothing - Me.ucrReceiverTmin.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverTmin.Size = New System.Drawing.Size(123, 20) Me.ucrReceiverTmin.strNcFilePath = "" Me.ucrReceiverTmin.TabIndex = 7 Me.ucrReceiverTmin.ucrSelector = Nothing @@ -446,11 +352,11 @@ Partial Class dlgEvapotranspiration ' Me.ucrReceiverTmax.AutoSize = True Me.ucrReceiverTmax.frmParent = Me - Me.ucrReceiverTmax.Location = New System.Drawing.Point(279, 153) + Me.ucrReceiverTmax.Location = New System.Drawing.Point(314, 133) Me.ucrReceiverTmax.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverTmax.Name = "ucrReceiverTmax" Me.ucrReceiverTmax.Selector = Nothing - Me.ucrReceiverTmax.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverTmax.Size = New System.Drawing.Size(123, 20) Me.ucrReceiverTmax.strNcFilePath = "" Me.ucrReceiverTmax.TabIndex = 9 Me.ucrReceiverTmax.ucrSelector = Nothing @@ -471,7 +377,7 @@ Partial Class dlgEvapotranspiration ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(5, 514) + Me.ucrBase.Location = New System.Drawing.Point(5, 421) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 33 @@ -481,16 +387,11 @@ Partial Class dlgEvapotranspiration 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(410, 563) + Me.ClientSize = New System.Drawing.Size(453, 478) + Me.Controls.Add(Me.cmdEvapOptions) Me.Controls.Add(Me.rdoHargreavesSamani) Me.Controls.Add(Me.rdoPenmanMonteith) - Me.Controls.Add(Me.lblMaxPerctMissindData) - Me.Controls.Add(Me.ucrNudMaxDurationMissingData) - Me.Controls.Add(Me.ucrNudMaxMissingDays) - Me.Controls.Add(Me.lblMaxDurationMissingData) - Me.Controls.Add(Me.lblMaxMissingDays) Me.Controls.Add(Me.ucrInputMissingMethod) - Me.Controls.Add(Me.ucrNudMaxMissingData) Me.Controls.Add(Me.lblMissingMethod) Me.Controls.Add(Me.grpWindSpeed) Me.Controls.Add(Me.lblSolar) @@ -499,7 +400,6 @@ Partial Class dlgEvapotranspiration Me.Controls.Add(Me.ucrReceiverRadiation) Me.Controls.Add(Me.ucrInputCrop) Me.Controls.Add(Me.ucrNewColName) - Me.Controls.Add(Me.grpMissingDataOpts) Me.Controls.Add(Me.lblDate) Me.Controls.Add(Me.ucrReceiverDate) Me.Controls.Add(Me.ucrPnlMethod) @@ -522,8 +422,6 @@ Partial Class dlgEvapotranspiration Me.Name = "dlgEvapotranspiration" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Evapotranspiration" - Me.grpMissingDataOpts.ResumeLayout(False) - Me.grpMissingDataOpts.PerformLayout() Me.grpWindSpeed.ResumeLayout(False) Me.grpWindSpeed.PerformLayout() Me.ResumeLayout(False) @@ -547,15 +445,6 @@ Partial Class dlgEvapotranspiration Friend WithEvents ucrPnlMethod As UcrPanel Friend WithEvents ucrReceiverDate As ucrReceiverSingle Friend WithEvents lblDate As Label - Friend WithEvents grpMissingDataOpts As GroupBox - Friend WithEvents lblMaxMissingDays As Label - Friend WithEvents lblMaxDurationMissingData As Label - Friend WithEvents lblMaxPerctMissindData As Label - Friend WithEvents ucrChkInterpMissingEntries As ucrCheck - Friend WithEvents ucrChkInterpMissingDays As ucrCheck - Friend WithEvents ucrNudMaxMissingDays As ucrNud - Friend WithEvents ucrNudMaxDurationMissingData As ucrNud - Friend WithEvents ucrNudMaxMissingData As ucrNud Friend WithEvents ucrInputMissingMethod As ucrInputComboBox Friend WithEvents lblMissingMethod As Label Friend WithEvents ucrNewColName As ucrSave @@ -569,4 +458,5 @@ Partial Class dlgEvapotranspiration Friend WithEvents lblRadiation As Label Friend WithEvents rdoHargreavesSamani As RadioButton Friend WithEvents rdoPenmanMonteith As RadioButton + Friend WithEvents cmdEvapOptions As Button End Class \ No newline at end of file diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index c764a0f401f..4f10248b03c 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -23,15 +23,65 @@ Public Class dlgEvapotranspiration Private iBasicHeight As Integer Private iBaseMaxY As Integer Private iSaveMaxY As Integer + Private iEvapOptions As Integer Private clsETPenmanMonteith, clsHargreavesSamani, clsDataFunctionPM, clsDataFunctionHS, clsDataFunction, clsReadInputs, clsVector, clsMissingDataVector, clsVarnamesVectorPM, clsVarnamesVectorHS, clsLibraryEvap As New RFunction Private clsDayFunc, clsMonthFunc, clsYearFunc As New RFunction Private clsBaseOperator, clsDailyOperatorHS As New ROperator + Private Sub ucrReceiverHumidityMin_Load(sender As Object, e As EventArgs) Handles ucrReceiverHumidityMin.Load + + End Sub + + Private Sub lblDate_Click(sender As Object, e As EventArgs) Handles lblDate.Click + + End Sub + + Private Sub lblTmin_Click(sender As Object, e As EventArgs) Handles lblTmin.Click + + End Sub + + Private Sub ucrReceiverTmin_Load(sender As Object, e As EventArgs) Handles ucrReceiverTmin.Load + + End Sub + + Private Sub lblTmax_Click(sender As Object, e As EventArgs) Handles lblTmax.Click + + End Sub + + Private Sub ucrReceiverTmax_Load(sender As Object, e As EventArgs) Handles ucrReceiverTmax.Load + + End Sub + + Private Sub lblHumidityMax_Click(sender As Object, e As EventArgs) Handles lblHumidityMax.Click + + End Sub + + Private Sub ucrReceiverHumidityMax_Load(sender As Object, e As EventArgs) Handles ucrReceiverHumidityMax.Load + + End Sub + + Private Sub lblHumidityMin_Click(sender As Object, e As EventArgs) Handles lblHumidityMin.Click + + End Sub + + Private Sub ucrReceiverDate_Load(sender As Object, e As EventArgs) Handles ucrReceiverDate.Load + + End Sub + + Private Sub lblRadiation_Click(sender As Object, e As EventArgs) Handles lblRadiation.Click + + End Sub + + Private Sub ucrReceiverRadiation_Load(sender As Object, e As EventArgs) Handles ucrReceiverRadiation.Load + + End Sub + Private Sub dlgdlgEvapotranspiration_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then iBasicHeight = Me.Height iBaseMaxY = ucrBase.Location.Y iSaveMaxY = ucrNewColName.Location.Y + iEvapOptions = cmdEvapOptions.Location.Y InitialiseDialog() bFirstload = False End If @@ -118,16 +168,6 @@ Public Class dlgEvapotranspiration ucrChkWind.SetRDefault(Chr(34) & "yes" & Chr(34)) ' Missing Options - ucrChkInterpMissingDays.SetParameter(New RParameter("interp_missing_days", 5)) - ucrChkInterpMissingDays.SetValuesCheckedAndUnchecked("TRUE", "FALSE") - ucrChkInterpMissingDays.SetRDefault("FALSE") - ucrChkInterpMissingDays.SetText("Interpolate Missing Days") - - ucrChkInterpMissingEntries.SetParameter(New RParameter("interp_missing_entries", 6)) - ucrChkInterpMissingEntries.SetValuesCheckedAndUnchecked("TRUE", "FALSE") - ucrChkInterpMissingEntries.SetRDefault("FALSE") - ucrChkInterpMissingEntries.SetText("Interpolate Missing Entries") - ucrInputMissingMethod.SetParameter(New RParameter("missing_method", 8)) dctInputMissingMethod.Add("monthly average", Chr(34) & "monthly average" & Chr(34)) dctInputMissingMethod.Add("seasonal average", Chr(34) & "seasonal average" & Chr(34)) @@ -136,15 +176,6 @@ Public Class dlgEvapotranspiration ucrInputMissingMethod.SetItems(dctInputMissingMethod) ucrInputMissingMethod.SetDropDownStyleAsNonEditable() - ucrNudMaxMissingData.SetParameter(New RParameter("x", bNewIncludeArgumentName:=False)) - ucrNudMaxMissingData.SetMinMax(1, 99) - - ucrNudMaxMissingDays.SetParameter(New RParameter("y", bNewIncludeArgumentName:=False)) - ucrNudMaxMissingDays.SetMinMax(1, 99) - - ucrNudMaxDurationMissingData.SetParameter(New RParameter("z", bNewIncludeArgumentName:=False)) - ucrNudMaxDurationMissingData.SetMinMax(1, 99) - 'panel setting ucrPnlMethod.AddRadioButton(rdoPenmanMonteith) ucrPnlMethod.AddRadioButton(rdoHargreavesSamani) @@ -300,24 +331,19 @@ Public Class dlgEvapotranspiration ucrInputCrop.SetRCode(clsETPenmanMonteith, bReset) ucrChkWind.SetRCode(clsETPenmanMonteith, bReset) ucrNewColName.SetRCode(clsBaseOperator, bReset) - ucrNudMaxMissingData.SetRCode(clsMissingDataVector, bReset) - ucrNudMaxMissingDays.SetRCode(clsMissingDataVector, bReset) - ucrNudMaxDurationMissingData.SetRCode(clsMissingDataVector, bReset) - ucrChkInterpMissingDays.SetRCode(clsReadInputs, bReset) - ucrChkInterpMissingEntries.SetRCode(clsReadInputs, bReset) ucrInputMissingMethod.SetRCode(clsReadInputs, bReset) End Sub Private Sub TestOKEnabled() If rdoPenmanMonteith.Checked Then - If ucrNewColName.IsComplete AndAlso Not ucrReceiverDate.IsEmpty() AndAlso Not ucrReceiverTmax.IsEmpty() AndAlso Not ucrReceiverTmin.IsEmpty() AndAlso Not ucrReceiverHumidityMax.IsEmpty() AndAlso Not ucrReceiverHumidityMin.IsEmpty() AndAlso Not ucrReceiverRadiation.IsEmpty() AndAlso Not ucrInputTimeStep.IsEmpty AndAlso ucrNudMaxMissingData.GetText <> "" AndAlso ucrNudMaxMissingDays.GetText <> "" AndAlso ucrNudMaxDurationMissingData.GetText <> "" Then + If ucrNewColName.IsComplete AndAlso Not ucrReceiverDate.IsEmpty() AndAlso Not ucrReceiverTmax.IsEmpty() AndAlso Not ucrReceiverTmin.IsEmpty() AndAlso Not ucrReceiverHumidityMax.IsEmpty() AndAlso Not ucrReceiverHumidityMin.IsEmpty() AndAlso Not ucrReceiverRadiation.IsEmpty() AndAlso Not ucrInputTimeStep.IsEmpty Then ucrBase.OKEnabled(True) End If If ucrChkWind.Checked And ucrReceiverWindSpeed.IsEmpty Then ucrBase.OKEnabled(False) End If ElseIf rdoHargreavesSamani.Checked Then - If ucrNewColName.IsComplete AndAlso Not ucrReceiverDate.IsEmpty() AndAlso Not ucrReceiverTmax.IsEmpty() AndAlso Not ucrReceiverTmin.IsEmpty() AndAlso Not ucrInputTimeStep.IsEmpty() AndAlso ucrNudMaxMissingData.GetText <> "" AndAlso ucrNudMaxMissingDays.GetText <> "" AndAlso ucrNudMaxDurationMissingData.GetText <> "" Then + If ucrNewColName.IsComplete AndAlso Not ucrReceiverDate.IsEmpty() AndAlso Not ucrReceiverTmax.IsEmpty() AndAlso Not ucrReceiverTmin.IsEmpty() AndAlso Not ucrInputTimeStep.IsEmpty() Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) @@ -333,16 +359,24 @@ Public Class dlgEvapotranspiration TestOKEnabled() End Sub + Private Sub cmdEvapOptions_Click(sender As Object, e As EventArgs) Handles cmdEvapOptions.Click + sdgMissingOptionsEvapotranspiration.SetRFunction(clsReadInputs, clsMissingDataVector, bResetSubdialog) + bResetSubdialog = False + sdgMissingOptionsEvapotranspiration.ShowDialog() + End Sub + Private Sub DialogSize() If rdoPenmanMonteith.Checked Then Me.Size = New System.Drawing.Size(Me.Width, iBasicHeight) ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) ucrNewColName.Location = New Point(ucrNewColName.Location.X, iSaveMaxY) + cmdEvapOptions.Location = New Point(cmdEvapOptions.Location.X, iEvapOptions) ElseIf rdoHargreavesSamani.Checked Then ucrReceiverDate.SetMeAsReceiver() Me.Size = New System.Drawing.Size(Me.Width, iBasicHeight * 0.9) ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.15) ucrNewColName.Location = New Point(ucrNewColName.Location.X, iSaveMaxY / 1.183) + cmdEvapOptions.Location = New Point(cmdEvapOptions.Location.X, iEvapOptions / 1.187) End If End Sub @@ -413,7 +447,7 @@ Public Class dlgEvapotranspiration End Select End Sub - Private Sub ucrPnlMethod_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlContentsChanged, ucrNewColName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverTmax.ControlContentsChanged, ucrReceiverTmin.ControlContentsChanged, ucrReceiverHumidityMax.ControlContentsChanged, ucrReceiverHumidityMin.ControlContentsChanged, ucrReceiverRadiation.ControlContentsChanged, ucrReceiverWindSpeed.ControlContentsChanged, ucrInputTimeStep.ControlContentsChanged, ucrNudMaxMissingData.ControlContentsChanged, ucrNudMaxDurationMissingData.ControlContentsChanged, ucrNudMaxMissingDays.ControlContentsChanged, ucrChkWind.ControlContentsChanged + Private Sub ucrPnlMethod_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlContentsChanged, ucrNewColName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverTmax.ControlContentsChanged, ucrReceiverTmin.ControlContentsChanged, ucrReceiverHumidityMax.ControlContentsChanged, ucrReceiverHumidityMin.ControlContentsChanged, ucrReceiverRadiation.ControlContentsChanged, ucrReceiverWindSpeed.ControlContentsChanged, ucrInputTimeStep.ControlContentsChanged, ucrChkWind.ControlContentsChanged TestOKEnabled() End Sub End Class diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 70c71c81b92..8b48472f75c 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -1512,6 +1512,12 @@ Form + + sdgMissingOptionsEvapotranspiration.vb + + + Form + ucrAxes.vb @@ -4837,6 +4843,9 @@ dlgUseModel.vb + + sdgMissingOptionsEvapotranspiration.vb + ucrAdditionalLayers.vb diff --git a/instat/sdgMissingOptionsEvapotranspiration.Designer.vb b/instat/sdgMissingOptionsEvapotranspiration.Designer.vb new file mode 100644 index 00000000000..7ecd44dc19a --- /dev/null +++ b/instat/sdgMissingOptionsEvapotranspiration.Designer.vb @@ -0,0 +1,177 @@ + _ +Partial Class sdgMissingOptionsEvapotranspiration + 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.lblMaxPerctMissindData = New System.Windows.Forms.Label() + Me.lblMaxDurationMissingData = New System.Windows.Forms.Label() + Me.lblMaxMissingDays = New System.Windows.Forms.Label() + Me.grpMissingDataOpts = New System.Windows.Forms.GroupBox() + Me.ucrNudMaxDurationMissingData = New instat.ucrNud() + Me.ucrNudMaxMissingDays = New instat.ucrNud() + Me.ucrNudMaxMissingData = New instat.ucrNud() + Me.ucrChkInterpMissingEntries = New instat.ucrCheck() + Me.ucrChkInterpMissingDays = New instat.ucrCheck() + Me.ucrSdgButtons = New instat.ucrButtonsSubdialogue() + Me.grpMissingDataOpts.SuspendLayout() + Me.SuspendLayout() + ' + 'lblMaxPerctMissindData + ' + Me.lblMaxPerctMissindData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblMaxPerctMissindData.Location = New System.Drawing.Point(9, 69) + Me.lblMaxPerctMissindData.Name = "lblMaxPerctMissindData" + Me.lblMaxPerctMissindData.Size = New System.Drawing.Size(169, 19) + Me.lblMaxPerctMissindData.TabIndex = 29 + Me.lblMaxPerctMissindData.Text = "Max Missing Data" + ' + 'lblMaxDurationMissingData + ' + Me.lblMaxDurationMissingData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblMaxDurationMissingData.Location = New System.Drawing.Point(9, 45) + Me.lblMaxDurationMissingData.Name = "lblMaxDurationMissingData" + Me.lblMaxDurationMissingData.Size = New System.Drawing.Size(160, 20) + Me.lblMaxDurationMissingData.TabIndex = 27 + Me.lblMaxDurationMissingData.Text = "Max Duration Missing Data" + ' + 'lblMaxMissingDays + ' + Me.lblMaxMissingDays.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblMaxMissingDays.Location = New System.Drawing.Point(9, 22) + Me.lblMaxMissingDays.Name = "lblMaxMissingDays" + Me.lblMaxMissingDays.Size = New System.Drawing.Size(169, 20) + Me.lblMaxMissingDays.TabIndex = 25 + Me.lblMaxMissingDays.Text = "Max Missing Days" + ' + 'grpMissingDataOpts + ' + Me.grpMissingDataOpts.Controls.Add(Me.ucrChkInterpMissingEntries) + Me.grpMissingDataOpts.Controls.Add(Me.ucrChkInterpMissingDays) + Me.grpMissingDataOpts.Location = New System.Drawing.Point(9, 106) + Me.grpMissingDataOpts.Name = "grpMissingDataOpts" + Me.grpMissingDataOpts.Size = New System.Drawing.Size(198, 66) + Me.grpMissingDataOpts.TabIndex = 31 + Me.grpMissingDataOpts.TabStop = False + Me.grpMissingDataOpts.Text = "Missing Data Options" + ' + 'ucrNudMaxDurationMissingData + ' + Me.ucrNudMaxDurationMissingData.AutoSize = True + Me.ucrNudMaxDurationMissingData.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxDurationMissingData.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudMaxDurationMissingData.Location = New System.Drawing.Point(184, 69) + Me.ucrNudMaxDurationMissingData.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudMaxDurationMissingData.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxDurationMissingData.Name = "ucrNudMaxDurationMissingData" + Me.ucrNudMaxDurationMissingData.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxDurationMissingData.TabIndex = 30 + Me.ucrNudMaxDurationMissingData.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudMaxMissingDays + ' + Me.ucrNudMaxMissingDays.AutoSize = True + Me.ucrNudMaxMissingDays.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxMissingDays.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudMaxMissingDays.Location = New System.Drawing.Point(184, 22) + Me.ucrNudMaxMissingDays.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudMaxMissingDays.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxMissingDays.Name = "ucrNudMaxMissingDays" + Me.ucrNudMaxMissingDays.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxMissingDays.TabIndex = 26 + Me.ucrNudMaxMissingDays.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrNudMaxMissingData + ' + Me.ucrNudMaxMissingData.AutoSize = True + Me.ucrNudMaxMissingData.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxMissingData.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudMaxMissingData.Location = New System.Drawing.Point(184, 45) + Me.ucrNudMaxMissingData.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudMaxMissingData.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxMissingData.Name = "ucrNudMaxMissingData" + Me.ucrNudMaxMissingData.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxMissingData.TabIndex = 28 + Me.ucrNudMaxMissingData.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrChkInterpMissingEntries + ' + Me.ucrChkInterpMissingEntries.AutoSize = True + Me.ucrChkInterpMissingEntries.Checked = False + Me.ucrChkInterpMissingEntries.Location = New System.Drawing.Point(2, 38) + Me.ucrChkInterpMissingEntries.Name = "ucrChkInterpMissingEntries" + Me.ucrChkInterpMissingEntries.Size = New System.Drawing.Size(188, 23) + Me.ucrChkInterpMissingEntries.TabIndex = 5 + ' + 'ucrChkInterpMissingDays + ' + Me.ucrChkInterpMissingDays.AutoSize = True + Me.ucrChkInterpMissingDays.Checked = False + Me.ucrChkInterpMissingDays.Location = New System.Drawing.Point(2, 16) + Me.ucrChkInterpMissingDays.Name = "ucrChkInterpMissingDays" + Me.ucrChkInterpMissingDays.Size = New System.Drawing.Size(168, 23) + Me.ucrChkInterpMissingDays.TabIndex = 6 + ' + 'ucrSdgButtons + ' + Me.ucrSdgButtons.AutoSize = True + Me.ucrSdgButtons.Location = New System.Drawing.Point(0, 189) + Me.ucrSdgButtons.Name = "ucrSdgButtons" + Me.ucrSdgButtons.Size = New System.Drawing.Size(259, 29) + Me.ucrSdgButtons.TabIndex = 3 + ' + 'sdgMissingOptionsEvapotranspiration + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(241, 224) + Me.Controls.Add(Me.lblMaxPerctMissindData) + Me.Controls.Add(Me.ucrNudMaxDurationMissingData) + Me.Controls.Add(Me.ucrNudMaxMissingDays) + Me.Controls.Add(Me.lblMaxDurationMissingData) + Me.Controls.Add(Me.lblMaxMissingDays) + Me.Controls.Add(Me.ucrNudMaxMissingData) + Me.Controls.Add(Me.grpMissingDataOpts) + Me.Controls.Add(Me.ucrSdgButtons) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "sdgMissingOptionsEvapotranspiration" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Missing Options Evapotranspiration" + Me.grpMissingDataOpts.ResumeLayout(False) + Me.grpMissingDataOpts.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrSdgButtons As ucrButtonsSubdialogue + Friend WithEvents lblMaxPerctMissindData As Label + Friend WithEvents ucrNudMaxDurationMissingData As ucrNud + Friend WithEvents ucrNudMaxMissingDays As ucrNud + Friend WithEvents lblMaxDurationMissingData As Label + Friend WithEvents lblMaxMissingDays As Label + Friend WithEvents ucrNudMaxMissingData As ucrNud + Friend WithEvents grpMissingDataOpts As GroupBox + Friend WithEvents ucrChkInterpMissingEntries As ucrCheck + Friend WithEvents ucrChkInterpMissingDays As ucrCheck +End Class diff --git a/instat/sdgMissingOptionsEvapotranspiration.resx b/instat/sdgMissingOptionsEvapotranspiration.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/sdgMissingOptionsEvapotranspiration.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/sdgMissingOptionsEvapotranspiration.vb b/instat/sdgMissingOptionsEvapotranspiration.vb new file mode 100644 index 00000000000..b863a1fcdc9 --- /dev/null +++ b/instat/sdgMissingOptionsEvapotranspiration.vb @@ -0,0 +1,61 @@ +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . + +Imports instat.Translations +Public Class sdgMissingOptionsEvapotranspiration + Public bFirstLoad As Boolean = True + Public bControlsInitialised As Boolean = False + Public clsReadInputs, clsMissingDataVector As New RFunction + Private Sub sdgMissingOptionsEvapotranspiration_Load(sender As Object, e As EventArgs) Handles ucrSdgButtons.Load + autoTranslate(Me) + End Sub + + Public Sub InitialiseControls() + ucrChkInterpMissingDays.SetParameter(New RParameter("interp_missing_days", 5)) + ucrChkInterpMissingDays.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkInterpMissingDays.SetRDefault("FALSE") + ucrChkInterpMissingDays.SetText("Interpolate Missing Days") + + ucrChkInterpMissingEntries.SetParameter(New RParameter("interp_missing_entries", 6)) + ucrChkInterpMissingEntries.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkInterpMissingEntries.SetRDefault("FALSE") + ucrChkInterpMissingEntries.SetText("Interpolate Missing Entries") + + ucrNudMaxMissingData.SetParameter(New RParameter("x", bNewIncludeArgumentName:=False)) + ucrNudMaxMissingData.SetMinMax(1, 99) + + ucrNudMaxMissingDays.SetParameter(New RParameter("y", bNewIncludeArgumentName:=False)) + ucrNudMaxMissingDays.SetMinMax(1, 99) + + ucrNudMaxDurationMissingData.SetParameter(New RParameter("z", bNewIncludeArgumentName:=False)) + ucrNudMaxDurationMissingData.SetMinMax(1, 99) + End Sub + + Public Sub SetRFunction(clsNewReadInputs As RFunction, clsNewMissingDataVector As RFunction, Optional bReset As Boolean = False) + If Not bControlsInitialised Then + InitialiseControls() + End If + + clsReadInputs = clsNewReadInputs + clsMissingDataVector = clsNewMissingDataVector + + ucrChkInterpMissingDays.SetRCode(clsReadInputs, bReset, bCloneIfNeeded:=True) + ucrChkInterpMissingEntries.SetRCode(clsReadInputs, bReset, bCloneIfNeeded:=True) + ucrNudMaxMissingData.SetRCode(clsMissingDataVector, bReset, bCloneIfNeeded:=True) + ucrNudMaxMissingDays.SetRCode(clsMissingDataVector, bReset, bCloneIfNeeded:=True) + ucrNudMaxDurationMissingData.SetRCode(clsMissingDataVector, bReset, bCloneIfNeeded:=True) + End Sub +End Class \ No newline at end of file From 3f098e5a932c3f13c010b85952896e95fad51533 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Wed, 16 Nov 2022 15:37:14 +0300 Subject: [PATCH 11/52] Adding expand function --- instat/dlgStack.Designer.vb | 91 ++++++++++++++++++++++++++++++++++--- instat/dlgStack.vb | 67 +++++++++++++++++++++++---- 2 files changed, 144 insertions(+), 14 deletions(-) diff --git a/instat/dlgStack.Designer.vb b/instat/dlgStack.Designer.vb index dd0ccd9104d..115c044f0fa 100644 --- a/instat/dlgStack.Designer.vb +++ b/instat/dlgStack.Designer.vb @@ -76,6 +76,11 @@ Partial Class dlgStack Me.ucrChkStackMultipleSets = New instat.ucrCheck() Me.ucrFactorInto = New instat.ucrInputTextBox() Me.ucrChkToLowerCase = New instat.ucrCheck() + Me.rdoExpand = New System.Windows.Forms.RadioButton() + Me.ucrReceiverExpand = New instat.ucrReceiverMultiple() + Me.lblExpandFactor = New System.Windows.Forms.Label() + Me.ucrReceiverFrequency = New instat.ucrReceiverSingle() + Me.lblFrequencyVar = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'lblColumnsTostack @@ -119,9 +124,9 @@ Partial Class dlgStack Me.rdoPivotLonger.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoPivotLonger.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoPivotLonger.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoPivotLonger.Location = New System.Drawing.Point(109, 12) + Me.rdoPivotLonger.Location = New System.Drawing.Point(88, 12) Me.rdoPivotLonger.Name = "rdoPivotLonger" - Me.rdoPivotLonger.Size = New System.Drawing.Size(100, 28) + Me.rdoPivotLonger.Size = New System.Drawing.Size(95, 28) Me.rdoPivotLonger.TabIndex = 1 Me.rdoPivotLonger.Text = "Pivot Longer" Me.rdoPivotLonger.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -135,9 +140,9 @@ Partial Class dlgStack Me.rdoUnnest.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoUnnest.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoUnnest.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoUnnest.Location = New System.Drawing.Point(207, 12) + Me.rdoUnnest.Location = New System.Drawing.Point(181, 12) Me.rdoUnnest.Name = "rdoUnnest" - Me.rdoUnnest.Size = New System.Drawing.Size(100, 28) + Me.rdoUnnest.Size = New System.Drawing.Size(92, 28) Me.rdoUnnest.TabIndex = 2 Me.rdoUnnest.Text = "Unnest" Me.rdoUnnest.TextAlign = System.Drawing.ContentAlignment.MiddleCenter @@ -301,9 +306,9 @@ Partial Class dlgStack 'ucrPnlStack ' Me.ucrPnlStack.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlStack.Location = New System.Drawing.Point(87, 3) + Me.ucrPnlStack.Location = New System.Drawing.Point(63, 3) Me.ucrPnlStack.Name = "ucrPnlStack" - Me.ucrPnlStack.Size = New System.Drawing.Size(239, 49) + Me.ucrPnlStack.Size = New System.Drawing.Size(317, 49) Me.ucrPnlStack.TabIndex = 0 ' 'ucrSaveNewDataName @@ -471,12 +476,81 @@ Partial Class dlgStack Me.ucrChkToLowerCase.Size = New System.Drawing.Size(120, 23) Me.ucrChkToLowerCase.TabIndex = 17 ' + 'rdoExpand + ' + Me.rdoExpand.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoExpand.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExpand.FlatAppearance.BorderSize = 2 + Me.rdoExpand.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExpand.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoExpand.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoExpand.Location = New System.Drawing.Point(271, 12) + Me.rdoExpand.Name = "rdoExpand" + Me.rdoExpand.Size = New System.Drawing.Size(91, 28) + Me.rdoExpand.TabIndex = 34 + Me.rdoExpand.Text = "Expand" + Me.rdoExpand.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoExpand.UseVisualStyleBackColor = True + ' + 'ucrReceiverExpand + ' + Me.ucrReceiverExpand.AutoSize = True + Me.ucrReceiverExpand.frmParent = Me + Me.ucrReceiverExpand.Location = New System.Drawing.Point(262, 81) + Me.ucrReceiverExpand.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverExpand.Name = "ucrReceiverExpand" + Me.ucrReceiverExpand.Selector = Nothing + Me.ucrReceiverExpand.Size = New System.Drawing.Size(120, 103) + Me.ucrReceiverExpand.strNcFilePath = "" + Me.ucrReceiverExpand.TabIndex = 35 + Me.ucrReceiverExpand.ucrSelector = Nothing + ' + 'lblExpandFactor + ' + Me.lblExpandFactor.AutoSize = True + Me.lblExpandFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblExpandFactor.Location = New System.Drawing.Point(264, 64) + Me.lblExpandFactor.Name = "lblExpandFactor" + Me.lblExpandFactor.Size = New System.Drawing.Size(40, 13) + Me.lblExpandFactor.TabIndex = 36 + Me.lblExpandFactor.Tag = "Columns_to_Stack:" + Me.lblExpandFactor.Text = "Factor:" + ' + 'ucrReceiverFrequency + ' + Me.ucrReceiverFrequency.AutoSize = True + Me.ucrReceiverFrequency.frmParent = Me + Me.ucrReceiverFrequency.Location = New System.Drawing.Point(260, 202) + Me.ucrReceiverFrequency.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverFrequency.Name = "ucrReceiverFrequency" + Me.ucrReceiverFrequency.Selector = Nothing + Me.ucrReceiverFrequency.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverFrequency.strNcFilePath = "" + Me.ucrReceiverFrequency.TabIndex = 37 + Me.ucrReceiverFrequency.ucrSelector = Nothing + ' + 'lblFrequencyVar + ' + Me.lblFrequencyVar.AutoSize = True + Me.lblFrequencyVar.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFrequencyVar.Location = New System.Drawing.Point(264, 187) + Me.lblFrequencyVar.Name = "lblFrequencyVar" + Me.lblFrequencyVar.Size = New System.Drawing.Size(68, 13) + Me.lblFrequencyVar.TabIndex = 38 + Me.lblFrequencyVar.Tag = "Columns_to_Stack:" + Me.lblFrequencyVar.Text = "Frequencies:" + ' 'dlgStack ' 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(418, 447) + Me.Controls.Add(Me.lblFrequencyVar) + Me.Controls.Add(Me.ucrReceiverFrequency) + Me.Controls.Add(Me.lblExpandFactor) + Me.Controls.Add(Me.ucrReceiverExpand) + Me.Controls.Add(Me.rdoExpand) Me.Controls.Add(Me.ucrChkToLowerCase) Me.Controls.Add(Me.ucrInputNamesTo) Me.Controls.Add(Me.lblSets) @@ -562,4 +636,9 @@ Partial Class dlgStack Friend WithEvents ucrChkStackMultipleSets As ucrCheck Friend WithEvents ucrFactorInto As ucrInputTextBox Friend WithEvents lblFactorInto As Label + Friend WithEvents lblFrequencyVar As Label + Friend WithEvents ucrReceiverFrequency As ucrReceiverSingle + Friend WithEvents lblExpandFactor As Label + Friend WithEvents ucrReceiverExpand As ucrReceiverMultiple + Friend WithEvents rdoExpand As RadioButton End Class diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index d7ebb3e47a3..cae3e097cb5 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -21,6 +21,7 @@ Public Class dlgStack Private clsPivotLongerFunction As New RFunction Private clsSelectFunction As New RFunction Private clsReshapeFunction As New RFunction + Private clsExpandFunction As New RFunction Private clsSplitColumnsFunction As New RFunction Private clsPipeOperator As New ROperator Private bFirstLoad As Boolean = True @@ -47,8 +48,10 @@ Public Class dlgStack ucrPnlStack.AddRadioButton(rdoUnnest) ucrPnlStack.AddRadioButton(rdoPivotLonger) + ucrPnlStack.AddRadioButton(rdoExpand) ucrPnlStack.AddFunctionNamesCondition(rdoUnnest, "unnest_tokens") ucrPnlStack.AddFunctionNamesCondition(rdoPivotLonger, {"pivot_longer", "reshape"}) + ucrPnlStack.AddFunctionNamesCondition(rdoExpand, "expand.dft") ucrSelectorStack.SetParameter(New RParameter("tbl", 0)) ucrSelectorStack.SetParameterIsrfunction() @@ -61,6 +64,14 @@ Public Class dlgStack ucrReceiverColumnsToBeStack.Selector = ucrSelectorStack ucrReceiverColumnsToBeStack.SetParameterIsString() + ucrReceiverExpand.SetParameter(New RParameter("cols", 1)) + ucrReceiverExpand.Selector = ucrSelectorStack + ucrReceiverExpand.SetParameterIsString() + + ucrReceiverFrequency.SetParameter(New RParameter("freq", 2)) + ucrReceiverFrequency.Selector = ucrSelectorStack + ucrReceiverFrequency.SetParameterIsString() + ucrInputNamesTo.SetParameter(New RParameter("names_to", 3)) ucrInputNamesTo.SetRDefault(Chr(34) & "names" & Chr(34)) @@ -167,6 +178,8 @@ Public Class dlgStack ucrPnlStack.AddToLinkedControls({ucrInputNamesTo, ucrChkDropMissingValues, ucrFactorInto, ucrInputValuesTo, ucrChkStackMultipleSets, ucrReceiverColumnsToBeStack}, {rdoPivotLonger}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) ucrChkDropPrefix.AddToLinkedControls(ucrInputDropPrefix, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlStack.AddToLinkedControls(ucrChkDropPrefix, {rdoPivotLonger}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=False) + ucrPnlStack.AddToLinkedControls({ucrReceiverExpand, ucrReceiverFrequency}, {rdoExpand}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrReceiverTextColumn.SetLinkedDisplayControl(lblVariable) ucrReceiverColumnsToBeStack.SetLinkedDisplayControl(lblColumnsTostack) @@ -176,6 +189,8 @@ Public Class dlgStack ucrInputFormat.SetLinkedDisplayControl(lblFormat) ucrInputOutput.SetLinkedDisplayControl(lblOutput) ucrInputPattern.SetLinkedDisplayControl(lblPattern) + ucrReceiverExpand.SetLinkedDisplayControl(lblExpandFactor) + ucrReceiverFrequency.SetLinkedDisplayControl(lblFrequencyVar) ttPattern.SetToolTip(ucrInputPattern.txtInput, " ""Chapter [\d]"" for regex token or "" "" ") @@ -190,6 +205,7 @@ Public Class dlgStack clsUnnestTokensFunction = New RFunction clsSelectFunction = New RFunction clsReshapeFunction = New RFunction + clsExpandFunction = New RFunction clsSplitColumnsFunction = New RFunction clsPipeOperator = New ROperator @@ -217,6 +233,10 @@ Public Class dlgStack clsReshapeFunction.AddParameter("varying", clsRFunctionParameter:=clsSplitColumnsFunction, iPosition:=1) + clsExpandFunction.SetPackageName("vcdExtra") + clsExpandFunction.SetRCommand("expand.dft") + clsExpandFunction.AddParameter("as.is", "TRUE", iPosition:=0) + clsPipeOperator.SetOperation(" %>% ") clsPipeOperator.AddParameter("left", clsRFunctionParameter:=ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) clsPipeOperator.AddParameter("right", clsRFunctionParameter:=clsSelectFunction, iPosition:=1) @@ -227,12 +247,18 @@ Public Class dlgStack Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverColumnsToBeStack.AddAdditionalCodeParameterPair(clsSplitColumnsFunction, New RParameter("items", 0), iAdditionalPairNo:=1) ucrSelectorStack.AddAdditionalCodeParameterPair(clsReshapeFunction, New RParameter("data", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=1) + ucrSelectorStack.AddAdditionalCodeParameterPair(clsExpandFunction, New RParameter("x", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=2) + + ucrSaveNewDataName.AddAdditionalRCode(clsUnnestTokensFunction, iAdditionalPairNo:=1) + ucrSaveNewDataName.AddAdditionalRCode(clsExpandFunction, iAdditionalPairNo:=2) + ucrChkStackMultipleSets.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrNudNoSets.SetRCode(clsSplitColumnsFunction, bReset) ucrReceiverTextColumn.SetRCode(clsUnnestTokensFunction, bReset) ucrSelectorStack.SetRCode(clsUnnestTokensFunction, bReset) - ucrSaveNewDataName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + 'ucrSaveNewDataName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + ucrSaveNewDataName.SetRCode(clsPivotLongerFunction, bReset) ucrInputToken.SetRCode(clsUnnestTokensFunction, bReset) ucrInputFormat.SetRCode(clsUnnestTokensFunction, bReset) ucrChkToLowerCase.SetRCode(clsUnnestTokensFunction, bReset) @@ -249,6 +275,8 @@ Public Class dlgStack ucrInputDropPrefix.SetRCode(clsPivotLongerFunction, bReset) ucrChkDropPrefix.SetRCode(clsPivotLongerFunction, bReset) ucrFactorInto.SetRCode(clsReshapeFunction, bReset) + ucrReceiverFrequency.SetRCode(clsExpandFunction, bReset) + ucrReceiverExpand.SetRCode(clsExpandFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -260,7 +288,7 @@ Public Class dlgStack Else ucrBase.OKEnabled(True) End If - Else + ElseIf rdoPivotLonger.Checked Then If ucrReceiverColumnsToBeStack.IsEmpty OrElse Not ucrSaveNewDataName.IsComplete OrElse ucrInputNamesTo.IsEmpty OrElse ucrInputValuesTo.IsEmpty OrElse ucrFactorInto.IsEmpty OrElse @@ -269,7 +297,15 @@ Public Class dlgStack Else ucrBase.OKEnabled(True) End If + Else + If ucrReceiverExpand.IsEmpty OrElse ucrReceiverFrequency.IsEmpty OrElse Not ucrSaveNewDataName.IsComplete Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) + End If End If + + End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -289,18 +325,33 @@ Public Class dlgStack Exit Sub End If - ucrSaveNewDataName.SetPrefix(strDataframeName & If(rdoPivotLonger.Checked _ - , "_stacked", "_unnest")) + 'ucrSaveNewDataName.SetPrefix(strDataframeName & If(rdoPivotLonger.Checked _ + ', "_stacked", "_unnest")) + + If rdoPivotLonger.Checked Then + ucrSaveNewDataName.SetPrefix(strDataframeName & "_stacked") + ElseIf rdoUnnest.Checked Then + ucrSaveNewDataName.SetPrefix(strDataframeName & "__unnest") + Else + + ucrSaveNewDataName.SetPrefix(strDataframeName & "__expand") + + End If End Sub Private Sub ucrPnlStack_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlStack.ControlValueChanged SetDataFramePrefix() - ucrBase.clsRsyntax.SetBaseRFunction(If(rdoUnnest.Checked, clsUnnestTokensFunction _ - , clsPivotLongerFunction)) + 'ucrBase.clsRsyntax.SetBaseRFunction(If(rdoUnnest.Checked, clsUnnestTokensFunction _ + ', clsPivotLongerFunction)) If rdoUnnest.Checked Then ucrReceiverTextColumn.SetMeAsReceiver() - Else + ucrBase.clsRsyntax.SetBaseRFunction(clsUnnestTokensFunction) + ElseIf rdoPivotLonger.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsPivotLongerFunction) ucrReceiverColumnsToBeStack.SetMeAsReceiver() + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsExpandFunction) + ucrReceiverExpand.SetMeAsReceiver() End If End Sub @@ -357,7 +408,7 @@ Public Class dlgStack ucrInputDropPrefix.ControlContentsChanged, ucrFactorInto.ControlContentsChanged, ucrPnlStack.ControlContentsChanged, ucrInputFormat.ControlContentsChanged, ucrInputPattern.ControlContentsChanged, ucrChkCarryColumns.ControlContentsChanged, ucrReceiverColumnsToCarry.ControlContentsChanged, ucrChkDropMissingValues.ControlContentsChanged, ucrChkDropPrefix.ControlContentsChanged, - ucrChkStackMultipleSets.ControlContentsChanged + ucrChkStackMultipleSets.ControlContentsChanged, ucrReceiverFrequency.ControlContentsChanged, ucrReceiverExpand.ControlContentsChanged TestOKEnabled() End Sub From 1180921f2c577d75b97f08295949908f195ef2d5 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Thu, 17 Nov 2022 10:22:07 +0300 Subject: [PATCH 12/52] adding convert.type function --- instat/dlgStack.vb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index cae3e097cb5..029dec03e62 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -22,6 +22,7 @@ Public Class dlgStack Private clsSelectFunction As New RFunction Private clsReshapeFunction As New RFunction Private clsExpandFunction As New RFunction + Private clsTypeConvertFunction As New RFunction Private clsSplitColumnsFunction As New RFunction Private clsPipeOperator As New ROperator Private bFirstLoad As Boolean = True @@ -51,7 +52,7 @@ Public Class dlgStack ucrPnlStack.AddRadioButton(rdoExpand) ucrPnlStack.AddFunctionNamesCondition(rdoUnnest, "unnest_tokens") ucrPnlStack.AddFunctionNamesCondition(rdoPivotLonger, {"pivot_longer", "reshape"}) - ucrPnlStack.AddFunctionNamesCondition(rdoExpand, "expand.dft") + ucrPnlStack.AddFunctionNamesCondition(rdoExpand, {"expand.dft", "type.convert"}) ucrSelectorStack.SetParameter(New RParameter("tbl", 0)) ucrSelectorStack.SetParameterIsrfunction() @@ -206,6 +207,7 @@ Public Class dlgStack clsSelectFunction = New RFunction clsReshapeFunction = New RFunction clsExpandFunction = New RFunction + clsTypeConvertFunction = New RFunction clsSplitColumnsFunction = New RFunction clsPipeOperator = New ROperator @@ -235,7 +237,10 @@ Public Class dlgStack clsExpandFunction.SetPackageName("vcdExtra") clsExpandFunction.SetRCommand("expand.dft") - clsExpandFunction.AddParameter("as.is", "TRUE", iPosition:=0) + + clsTypeConvertFunction.SetRCommand("type.convert") + clsTypeConvertFunction.AddParameter("x", clsRFunctionParameter:=clsExpandFunction, iPosition:=0) + clsTypeConvertFunction.AddParameter("as.is", "FALSE", iPosition:=1) clsPipeOperator.SetOperation(" %>% ") clsPipeOperator.AddParameter("left", clsRFunctionParameter:=ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, iPosition:=0) @@ -250,7 +255,7 @@ Public Class dlgStack ucrSelectorStack.AddAdditionalCodeParameterPair(clsExpandFunction, New RParameter("x", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=2) ucrSaveNewDataName.AddAdditionalRCode(clsUnnestTokensFunction, iAdditionalPairNo:=1) - ucrSaveNewDataName.AddAdditionalRCode(clsExpandFunction, iAdditionalPairNo:=2) + ucrSaveNewDataName.AddAdditionalRCode(clsTypeConvertFunction, iAdditionalPairNo:=2) ucrChkStackMultipleSets.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrNudNoSets.SetRCode(clsSplitColumnsFunction, bReset) @@ -350,7 +355,7 @@ Public Class dlgStack ucrBase.clsRsyntax.SetBaseRFunction(clsPivotLongerFunction) ucrReceiverColumnsToBeStack.SetMeAsReceiver() Else - ucrBase.clsRsyntax.SetBaseRFunction(clsExpandFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsTypeConvertFunction) ucrReceiverExpand.SetMeAsReceiver() End If End Sub From e33d416f290585449282f0784a311a95e38f8b29 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Thu, 17 Nov 2022 11:29:37 +0300 Subject: [PATCH 13/52] changes made --- instat/dlgStack.Designer.vb | 24 ++++++++++++------------ instat/dlgStack.vb | 10 ---------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/instat/dlgStack.Designer.vb b/instat/dlgStack.Designer.vb index 115c044f0fa..557894785e6 100644 --- a/instat/dlgStack.Designer.vb +++ b/instat/dlgStack.Designer.vb @@ -124,7 +124,7 @@ Partial Class dlgStack Me.rdoPivotLonger.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoPivotLonger.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoPivotLonger.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoPivotLonger.Location = New System.Drawing.Point(88, 12) + Me.rdoPivotLonger.Location = New System.Drawing.Point(76, 12) Me.rdoPivotLonger.Name = "rdoPivotLonger" Me.rdoPivotLonger.Size = New System.Drawing.Size(95, 28) Me.rdoPivotLonger.TabIndex = 1 @@ -140,7 +140,7 @@ Partial Class dlgStack Me.rdoUnnest.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoUnnest.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoUnnest.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoUnnest.Location = New System.Drawing.Point(181, 12) + Me.rdoUnnest.Location = New System.Drawing.Point(169, 12) Me.rdoUnnest.Name = "rdoUnnest" Me.rdoUnnest.Size = New System.Drawing.Size(92, 28) Me.rdoUnnest.TabIndex = 2 @@ -306,9 +306,9 @@ Partial Class dlgStack 'ucrPnlStack ' Me.ucrPnlStack.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlStack.Location = New System.Drawing.Point(63, 3) + Me.ucrPnlStack.Location = New System.Drawing.Point(67, 3) Me.ucrPnlStack.Name = "ucrPnlStack" - Me.ucrPnlStack.Size = New System.Drawing.Size(317, 49) + Me.ucrPnlStack.Size = New System.Drawing.Size(299, 49) Me.ucrPnlStack.TabIndex = 0 ' 'ucrSaveNewDataName @@ -484,7 +484,7 @@ Partial Class dlgStack Me.rdoExpand.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoExpand.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoExpand.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoExpand.Location = New System.Drawing.Point(271, 12) + Me.rdoExpand.Location = New System.Drawing.Point(259, 12) Me.rdoExpand.Name = "rdoExpand" Me.rdoExpand.Size = New System.Drawing.Size(91, 28) Me.rdoExpand.TabIndex = 34 @@ -520,7 +520,7 @@ Partial Class dlgStack ' Me.ucrReceiverFrequency.AutoSize = True Me.ucrReceiverFrequency.frmParent = Me - Me.ucrReceiverFrequency.Location = New System.Drawing.Point(260, 202) + Me.ucrReceiverFrequency.Location = New System.Drawing.Point(262, 204) Me.ucrReceiverFrequency.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverFrequency.Name = "ucrReceiverFrequency" Me.ucrReceiverFrequency.Selector = Nothing @@ -533,7 +533,7 @@ Partial Class dlgStack ' Me.lblFrequencyVar.AutoSize = True Me.lblFrequencyVar.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblFrequencyVar.Location = New System.Drawing.Point(264, 187) + Me.lblFrequencyVar.Location = New System.Drawing.Point(262, 189) Me.lblFrequencyVar.Name = "lblFrequencyVar" Me.lblFrequencyVar.Size = New System.Drawing.Size(68, 13) Me.lblFrequencyVar.TabIndex = 38 @@ -546,8 +546,6 @@ Partial Class dlgStack Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(418, 447) - Me.Controls.Add(Me.lblFrequencyVar) - Me.Controls.Add(Me.ucrReceiverFrequency) Me.Controls.Add(Me.lblExpandFactor) Me.Controls.Add(Me.ucrReceiverExpand) Me.Controls.Add(Me.rdoExpand) @@ -556,7 +554,6 @@ Partial Class dlgStack Me.Controls.Add(Me.lblSets) Me.Controls.Add(Me.ucrNudNoSets) Me.Controls.Add(Me.ucrInputDropPrefix) - Me.Controls.Add(Me.ucrChkCarryAllColumns) Me.Controls.Add(Me.lblColumnsTostack) Me.Controls.Add(Me.lblVariable) Me.Controls.Add(Me.ucrInputOutput) @@ -574,8 +571,6 @@ Partial Class dlgStack Me.Controls.Add(Me.lblToken) Me.Controls.Add(Me.ucrInputFormat) Me.Controls.Add(Me.lblFormat) - Me.Controls.Add(Me.lblPattern) - Me.Controls.Add(Me.ucrInputPattern) Me.Controls.Add(Me.ucrChkPunctuation) Me.Controls.Add(Me.lblValuesTo) Me.Controls.Add(Me.ucrChkDropMissingValues) @@ -587,6 +582,11 @@ Partial Class dlgStack Me.Controls.Add(Me.ucrSaveNewDataName) Me.Controls.Add(Me.lblNamesTo) Me.Controls.Add(Me.lblFactorInto) + Me.Controls.Add(Me.ucrChkCarryAllColumns) + Me.Controls.Add(Me.lblPattern) + Me.Controls.Add(Me.ucrInputPattern) + Me.Controls.Add(Me.lblFrequencyVar) + Me.Controls.Add(Me.ucrReceiverFrequency) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 029dec03e62..87de72f05be 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -181,7 +181,6 @@ Public Class dlgStack ucrPnlStack.AddToLinkedControls(ucrChkDropPrefix, {rdoPivotLonger}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=False) ucrPnlStack.AddToLinkedControls({ucrReceiverExpand, ucrReceiverFrequency}, {rdoExpand}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrReceiverTextColumn.SetLinkedDisplayControl(lblVariable) ucrReceiverColumnsToBeStack.SetLinkedDisplayControl(lblColumnsTostack) ucrInputNamesTo.SetLinkedDisplayControl(lblNamesTo) @@ -262,7 +261,6 @@ Public Class dlgStack ucrReceiverTextColumn.SetRCode(clsUnnestTokensFunction, bReset) ucrSelectorStack.SetRCode(clsUnnestTokensFunction, bReset) - 'ucrSaveNewDataName.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrSaveNewDataName.SetRCode(clsPivotLongerFunction, bReset) ucrInputToken.SetRCode(clsUnnestTokensFunction, bReset) ucrInputFormat.SetRCode(clsUnnestTokensFunction, bReset) @@ -310,7 +308,6 @@ Public Class dlgStack End If End If - End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -330,24 +327,17 @@ Public Class dlgStack Exit Sub End If - 'ucrSaveNewDataName.SetPrefix(strDataframeName & If(rdoPivotLonger.Checked _ - ', "_stacked", "_unnest")) - If rdoPivotLonger.Checked Then ucrSaveNewDataName.SetPrefix(strDataframeName & "_stacked") ElseIf rdoUnnest.Checked Then ucrSaveNewDataName.SetPrefix(strDataframeName & "__unnest") Else - ucrSaveNewDataName.SetPrefix(strDataframeName & "__expand") - End If End Sub Private Sub ucrPnlStack_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlStack.ControlValueChanged SetDataFramePrefix() - 'ucrBase.clsRsyntax.SetBaseRFunction(If(rdoUnnest.Checked, clsUnnestTokensFunction _ - ', clsPivotLongerFunction)) If rdoUnnest.Checked Then ucrReceiverTextColumn.SetMeAsReceiver() ucrBase.clsRsyntax.SetBaseRFunction(clsUnnestTokensFunction) From 61bd88562dae4f73fb564c87a31d8aac2b741879 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Fri, 18 Nov 2022 12:07:52 +0300 Subject: [PATCH 14/52] making columns be dataframe --- instat/dlgStack.vb | 96 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 4 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 87de72f05be..daa48af72ac 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -24,9 +24,12 @@ Public Class dlgStack Private clsExpandFunction As New RFunction Private clsTypeConvertFunction As New RFunction Private clsSplitColumnsFunction As New RFunction + Private clsGetColumnNamesFunction As New RFunction Private clsPipeOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True + Private lstEditedVariables, lstAllVariables As New List(Of String) + Private bResettingDialogue As Boolean = False Private Sub dlgStack_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -65,9 +68,8 @@ Public Class dlgStack ucrReceiverColumnsToBeStack.Selector = ucrSelectorStack ucrReceiverColumnsToBeStack.SetParameterIsString() - ucrReceiverExpand.SetParameter(New RParameter("cols", 1)) ucrReceiverExpand.Selector = ucrSelectorStack - ucrReceiverExpand.SetParameterIsString() + ucrReceiverExpand.SetParameterIsRFunction() ucrReceiverFrequency.SetParameter(New RParameter("freq", 2)) ucrReceiverFrequency.Selector = ucrSelectorStack @@ -208,6 +210,7 @@ Public Class dlgStack clsExpandFunction = New RFunction clsTypeConvertFunction = New RFunction clsSplitColumnsFunction = New RFunction + clsGetColumnNamesFunction = New RFunction clsPipeOperator = New ROperator ucrSelectorStack.Reset() @@ -236,6 +239,7 @@ Public Class dlgStack clsExpandFunction.SetPackageName("vcdExtra") clsExpandFunction.SetRCommand("expand.dft") + clsExpandFunction.AddParameter("x", "columns", iPosition:=0) clsTypeConvertFunction.SetRCommand("type.convert") clsTypeConvertFunction.AddParameter("x", clsRFunctionParameter:=clsExpandFunction, iPosition:=0) @@ -251,7 +255,6 @@ Public Class dlgStack Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverColumnsToBeStack.AddAdditionalCodeParameterPair(clsSplitColumnsFunction, New RParameter("items", 0), iAdditionalPairNo:=1) ucrSelectorStack.AddAdditionalCodeParameterPair(clsReshapeFunction, New RParameter("data", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=1) - ucrSelectorStack.AddAdditionalCodeParameterPair(clsExpandFunction, New RParameter("x", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=2) ucrSaveNewDataName.AddAdditionalRCode(clsUnnestTokensFunction, iAdditionalPairNo:=1) ucrSaveNewDataName.AddAdditionalRCode(clsTypeConvertFunction, iAdditionalPairNo:=2) @@ -279,7 +282,6 @@ Public Class dlgStack ucrChkDropPrefix.SetRCode(clsPivotLongerFunction, bReset) ucrFactorInto.SetRCode(clsReshapeFunction, bReset) ucrReceiverFrequency.SetRCode(clsExpandFunction, bReset) - ucrReceiverExpand.SetRCode(clsExpandFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -311,9 +313,12 @@ Public Class dlgStack End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + bResettingDialogue = True SetDefaults() SetRCodeForControls(True) + UpdateSelector() TestOKEnabled() + bResettingDialogue = False End Sub Private Sub ucrSelectorStack_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorStack.ControlValueChanged @@ -338,6 +343,7 @@ Public Class dlgStack Private Sub ucrPnlStack_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlStack.ControlValueChanged SetDataFramePrefix() + FillLists() If rdoUnnest.Checked Then ucrReceiverTextColumn.SetMeAsReceiver() ucrBase.clsRsyntax.SetBaseRFunction(clsUnnestTokensFunction) @@ -415,4 +421,86 @@ Public Class dlgStack End If TestOKEnabled() End Sub + + Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged + ucrBase.clsRsyntax.lstBeforeCodes.Clear() + clsGetColumnNamesFunction = ucrReceiverExpand.GetVariables(True).Clone + clsGetColumnNamesFunction.SetAssignTo("columns") + ucrBase.clsRsyntax.AddToBeforeCodes(clsGetColumnNamesFunction) + If ucrReceiverExpand.IsEmpty AndAlso lstEditedVariables.Count > 0 Then + UpdateSelector() + ucrReceiverExpand.SetMeAsReceiver() + End If + If ucrReceiverExpand.IsEmpty Then + ucrReceiverFrequency.Clear() + End If + End Sub + + Private Sub UpdateSelector() + ClearSelector() + If bResettingDialogue Then + For i = 0 To lstAllVariables.Count - 1 + ucrSelectorStack.lstAvailableVariable.Items.Add(lstAllVariables.Item(i)) + ucrSelectorStack.lstAvailableVariable.Items(i).Tag = ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text + Next + Else + For i = 0 To lstEditedVariables.Count - 1 + ucrSelectorStack.lstAvailableVariable.Items.Add(lstEditedVariables.Item(i)) + ucrSelectorStack.lstAvailableVariable.Items(i).Tag = ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text + Next + End If + End Sub + + Private Sub ClearSelector() + ucrSelectorStack.lstAvailableVariable.Clear() + ucrSelectorStack.lstAvailableVariable.Groups.Clear() + ucrSelectorStack.lstAvailableVariable.Columns.Add("Variables") + End Sub + + Private Sub ucrReceiverFrequency_Enter(sender As Object, e As EventArgs) Handles ucrReceiverFrequency.Enter + Dim grps As New ListViewGroup + ClearSelector() + If Not ucrReceiverExpand.IsEmpty Then + If ucrReceiverExpand.GetVariableNamesList(False).Count > 1 Then + grps = New ListViewGroup(key:=ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text, + headerText:=ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text) + ucrSelectorStack.lstAvailableVariable.Groups.Add(grps) + End If + For j = 0 To ucrReceiverExpand.GetVariableNamesList(False).Count - 1 + ucrSelectorStack.lstAvailableVariable.Items.Add(ucrReceiverExpand.GetVariableNamesList(False)(j)) + ucrSelectorStack.lstAvailableVariable.Items(j).Tag = ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text + ucrSelectorStack.lstAvailableVariable.Items(j).ToolTipText = ucrReceiverExpand.GetVariableNamesList(False)(0) + Next + End If + End Sub + + Private Sub FillLists() + If Not bResettingDialogue Then + If ucrSelectorStack.lstAvailableVariable.Items.Count > 0 Then + lstEditedVariables.Clear() + lstAllVariables.Clear() + For Each lstv As ListViewItem In ucrSelectorStack.lstAvailableVariable.Items + lstAllVariables.Add(lstv.Text) + lstEditedVariables.Add(lstv.Text) + Next + End If + End If + End Sub + + Private Sub ucrSelectorStack_DataFrameChanged() Handles ucrSelectorStack.DataFrameChanged + FillLists() + End Sub + Private Sub ucrReceiverExpand_Enter(sender As Object, e As EventArgs) Handles ucrReceiverExpand.Enter + ResettingDialog() + 'If Not ucrReceiverColumnsToTranspose.IsEmpty AndAlso + ' ucrSelectorTransposeColumns.lstAvailableVariable.Items.Count > 0 Then + ' UpdateSelector() + 'End If + End Sub + + Private Sub ResettingDialog() + bResettingDialogue = True + UpdateSelector() + bResettingDialogue = False + End Sub End Class \ No newline at end of file From 50361e77eb45dbca28e6bab3e27349c80c2e3ed1 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Fri, 18 Nov 2022 13:41:36 +0300 Subject: [PATCH 15/52] minor change --- instat/dlgStack.Designer.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgStack.Designer.vb b/instat/dlgStack.Designer.vb index 557894785e6..8109eb74b1a 100644 --- a/instat/dlgStack.Designer.vb +++ b/instat/dlgStack.Designer.vb @@ -511,10 +511,10 @@ Partial Class dlgStack Me.lblExpandFactor.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.lblExpandFactor.Location = New System.Drawing.Point(264, 64) Me.lblExpandFactor.Name = "lblExpandFactor" - Me.lblExpandFactor.Size = New System.Drawing.Size(40, 13) + Me.lblExpandFactor.Size = New System.Drawing.Size(51, 13) Me.lblExpandFactor.TabIndex = 36 Me.lblExpandFactor.Tag = "Columns_to_Stack:" - Me.lblExpandFactor.Text = "Factor:" + Me.lblExpandFactor.Text = "Factor(s):" ' 'ucrReceiverFrequency ' From 5eece957feac7a07fe057a964f777ab9af51da00 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Sun, 20 Nov 2022 09:48:36 +0300 Subject: [PATCH 16/52] change --- instat/dlgStack.vb | 102 ++++++++++----------------------------------- 1 file changed, 21 insertions(+), 81 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index daa48af72ac..8a47bfced26 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -25,6 +25,7 @@ Public Class dlgStack Private clsTypeConvertFunction As New RFunction Private clsSplitColumnsFunction As New RFunction Private clsGetColumnNamesFunction As New RFunction + Private clsGetVariablesFunction As New RFunction Private clsPipeOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True @@ -68,8 +69,9 @@ Public Class dlgStack ucrReceiverColumnsToBeStack.Selector = ucrSelectorStack ucrReceiverColumnsToBeStack.SetParameterIsString() + ucrReceiverExpand.SetParameter(New RParameter("col_name", 1)) ucrReceiverExpand.Selector = ucrSelectorStack - ucrReceiverExpand.SetParameterIsRFunction() + ucrReceiverExpand.SetParameterIsString() ucrReceiverFrequency.SetParameter(New RParameter("freq", 2)) ucrReceiverFrequency.Selector = ucrSelectorStack @@ -211,6 +213,8 @@ Public Class dlgStack clsTypeConvertFunction = New RFunction clsSplitColumnsFunction = New RFunction clsGetColumnNamesFunction = New RFunction + clsGetVariablesFunction = New RFunction + clsPipeOperator = New ROperator ucrSelectorStack.Reset() @@ -237,9 +241,15 @@ Public Class dlgStack clsReshapeFunction.AddParameter("varying", clsRFunctionParameter:=clsSplitColumnsFunction, iPosition:=1) + 'clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetColumnNamesFunction, iPosition:=0) + + + clsExpandFunction.SetPackageName("vcdExtra") clsExpandFunction.SetRCommand("expand.dft") - clsExpandFunction.AddParameter("x", "columns", iPosition:=0) + + clsGetVariablesFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsTypeConvertFunction.SetRCommand("type.convert") clsTypeConvertFunction.AddParameter("x", clsRFunctionParameter:=clsExpandFunction, iPosition:=0) @@ -255,6 +265,8 @@ Public Class dlgStack Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverColumnsToBeStack.AddAdditionalCodeParameterPair(clsSplitColumnsFunction, New RParameter("items", 0), iAdditionalPairNo:=1) ucrSelectorStack.AddAdditionalCodeParameterPair(clsReshapeFunction, New RParameter("data", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=1) + ucrSelectorStack.AddAdditionalCodeParameterPair(clsExpandFunction, New RParameter("data", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) + ucrSaveNewDataName.AddAdditionalRCode(clsUnnestTokensFunction, iAdditionalPairNo:=1) ucrSaveNewDataName.AddAdditionalRCode(clsTypeConvertFunction, iAdditionalPairNo:=2) @@ -282,6 +294,7 @@ Public Class dlgStack ucrChkDropPrefix.SetRCode(clsPivotLongerFunction, bReset) ucrFactorInto.SetRCode(clsReshapeFunction, bReset) ucrReceiverFrequency.SetRCode(clsExpandFunction, bReset) + ucrReceiverExpand.SetRCode(clsGetColumnNamesFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -313,12 +326,9 @@ Public Class dlgStack End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset - bResettingDialogue = True SetDefaults() SetRCodeForControls(True) - UpdateSelector() TestOKEnabled() - bResettingDialogue = False End Sub Private Sub ucrSelectorStack_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorStack.ControlValueChanged @@ -343,7 +353,6 @@ Public Class dlgStack Private Sub ucrPnlStack_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlStack.ControlValueChanged SetDataFramePrefix() - FillLists() If rdoUnnest.Checked Then ucrReceiverTextColumn.SetMeAsReceiver() ucrBase.clsRsyntax.SetBaseRFunction(clsUnnestTokensFunction) @@ -422,85 +431,16 @@ Public Class dlgStack TestOKEnabled() End Sub - Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged - ucrBase.clsRsyntax.lstBeforeCodes.Clear() - clsGetColumnNamesFunction = ucrReceiverExpand.GetVariables(True).Clone - clsGetColumnNamesFunction.SetAssignTo("columns") - ucrBase.clsRsyntax.AddToBeforeCodes(clsGetColumnNamesFunction) - If ucrReceiverExpand.IsEmpty AndAlso lstEditedVariables.Count > 0 Then - UpdateSelector() - ucrReceiverExpand.SetMeAsReceiver() - End If - If ucrReceiverExpand.IsEmpty Then - ucrReceiverFrequency.Clear() - End If - End Sub - - Private Sub UpdateSelector() - ClearSelector() - If bResettingDialogue Then - For i = 0 To lstAllVariables.Count - 1 - ucrSelectorStack.lstAvailableVariable.Items.Add(lstAllVariables.Item(i)) - ucrSelectorStack.lstAvailableVariable.Items(i).Tag = ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text - Next - Else - For i = 0 To lstEditedVariables.Count - 1 - ucrSelectorStack.lstAvailableVariable.Items.Add(lstEditedVariables.Item(i)) - ucrSelectorStack.lstAvailableVariable.Items(i).Tag = ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text - Next - End If - End Sub - - Private Sub ClearSelector() - ucrSelectorStack.lstAvailableVariable.Clear() - ucrSelectorStack.lstAvailableVariable.Groups.Clear() - ucrSelectorStack.lstAvailableVariable.Columns.Add("Variables") + Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged, ucrSelectorStack.ControlValueChanged + GetVariables() End Sub - Private Sub ucrReceiverFrequency_Enter(sender As Object, e As EventArgs) Handles ucrReceiverFrequency.Enter - Dim grps As New ListViewGroup - ClearSelector() + Private Sub GetVariables() If Not ucrReceiverExpand.IsEmpty Then - If ucrReceiverExpand.GetVariableNamesList(False).Count > 1 Then - grps = New ListViewGroup(key:=ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text, - headerText:=ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text) - ucrSelectorStack.lstAvailableVariable.Groups.Add(grps) - End If - For j = 0 To ucrReceiverExpand.GetVariableNamesList(False).Count - 1 - ucrSelectorStack.lstAvailableVariable.Items.Add(ucrReceiverExpand.GetVariableNamesList(False)(j)) - ucrSelectorStack.lstAvailableVariable.Items(j).Tag = ucrSelectorStack.ucrAvailableDataFrames.cboAvailableDataFrames.Text - ucrSelectorStack.lstAvailableVariable.Items(j).ToolTipText = ucrReceiverExpand.GetVariableNamesList(False)(0) - Next - End If - End Sub + clsGetVariablesFunction.AddParameter("data_name", Chr(34) & ucrSelectorStack.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) + clsGetVariablesFunction.AddParameter("col_names", Chr(34) & ucrReceiverExpand.GetVariableNames(False) & Chr(34), iPosition:=1) + 'clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetColumnNamesFunction, iPosition:=0) - Private Sub FillLists() - If Not bResettingDialogue Then - If ucrSelectorStack.lstAvailableVariable.Items.Count > 0 Then - lstEditedVariables.Clear() - lstAllVariables.Clear() - For Each lstv As ListViewItem In ucrSelectorStack.lstAvailableVariable.Items - lstAllVariables.Add(lstv.Text) - lstEditedVariables.Add(lstv.Text) - Next - End If End If End Sub - - Private Sub ucrSelectorStack_DataFrameChanged() Handles ucrSelectorStack.DataFrameChanged - FillLists() - End Sub - Private Sub ucrReceiverExpand_Enter(sender As Object, e As EventArgs) Handles ucrReceiverExpand.Enter - ResettingDialog() - 'If Not ucrReceiverColumnsToTranspose.IsEmpty AndAlso - ' ucrSelectorTransposeColumns.lstAvailableVariable.Items.Count > 0 Then - ' UpdateSelector() - 'End If - End Sub - - Private Sub ResettingDialog() - bResettingDialogue = True - UpdateSelector() - bResettingDialogue = False - End Sub End Class \ No newline at end of file From 20aca23604630bbee20bd757acc5830c2491dbda Mon Sep 17 00:00:00 2001 From: Sophie Date: Sun, 20 Nov 2022 23:51:53 +0100 Subject: [PATCH 17/52] Minor modification on apsimx-example dialog. --- instat/dlgApsimx.vb | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 831b44d3f54..83c27763210 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -20,7 +20,7 @@ Imports System.IO Public Class dlgApsimx Public bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsApsimxExampleFunction, clsApsimExampleFunction As New RFunction + Private clsApsimxExampleFunction As New RFunction Private clsBaseFunction, clsDataListFunction As New RFunction Private clsReportOperator As New ROperator Private Sub dlgApsimx_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -57,13 +57,7 @@ Public Class dlgApsimx {"Rotation", Chr(34) & "Rotation" & Chr(34)}, {"Soybean", Chr(34) & "Soybean" & Chr(34)}, {"Sugarcane", Chr(34) & "Sugarcane" & Chr(34)}, - {"Wheat", Chr(34) & "Wheat" & Chr(34)}, - {"Sugar", Chr(34) & "Sugar" & Chr(34)}, - {"Potato", Chr(34) & "Potato" & Chr(34)}, - {"Millet", Chr(34) & "Millet" & Chr(34)}, - {"Centro", Chr(34) & "Centro" & Chr(34)}, - {"Canopy", Chr(34) & "Canopy" & Chr(34)} - } + {"Wheat", Chr(34) & "Wheat" & Chr(34)}} ucrInputComboList.SetParameter(New RParameter("example", 0)) ucrInputComboList.SetItems(dctExamplesModels) @@ -73,7 +67,6 @@ Public Class dlgApsimx Private Sub SetDefaults() clsApsimxExampleFunction = New RFunction - clsApsimExampleFunction = New RFunction clsBaseFunction = New RFunction clsDataListFunction = New RFunction clsReportOperator = New ROperator @@ -91,16 +84,10 @@ Public Class dlgApsimx clsApsimxExampleFunction.SetRCommand("apsimx_example") clsApsimxExampleFunction.AddParameter("example", Chr(34) & "Barley" & Chr(34), iPosition:=0) - clsApsimExampleFunction.SetPackageName("apsimx") - clsApsimExampleFunction.SetRCommand("apsim_example") - ucrBase.clsRsyntax.SetBaseRFunction(clsBaseFunction) End Sub Private Sub SetRCodeForControls(bReset As Boolean) - ucrChkSilent.AddAdditionalCodeParameterPair(clsApsimExampleFunction, ucrChkSilent.GetParameter, iAdditionalPairNo:=1) - ucrInputComboList.AddAdditionalCodeParameterPair(clsApsimExampleFunction, New RParameter("example", 0), iAdditionalPairNo:=1) - ucrChkSilent.SetRCode(clsApsimxExampleFunction, bReset) ucrInputComboList.SetRCode(clsApsimxExampleFunction, bReset) End Sub @@ -127,7 +114,6 @@ Public Class dlgApsimx Dim strDataName As String = frmMain.clsRLink.MakeValidText(ucrInputComboList.GetText) ucrInputSaveData.SetText(strDataName) clsApsimxExampleFunction.SetAssignTo(strDataName) - clsApsimExampleFunction.SetAssignTo(strDataName) clsDataListFunction.ClearParameters() ucrBase.clsRsyntax.ClearCodes() If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "Controlled Environment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "Eucalyptus Rotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Soybean" Then @@ -138,10 +124,6 @@ Public Class dlgApsimx clsDataListFunction.AddParameter(strDataName, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) ucrBase.clsRsyntax.AddToBeforeCodes(clsReportOperator, 1) - Else - clsDataListFunction.AddParameter(strDataName, clsRFunctionParameter:=clsApsimExampleFunction, iPosition:=0) - ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimExampleFunction, 0) - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsReportOperator) End If ucrBase.clsRsyntax.SetBaseRFunction(clsBaseFunction) End Sub From 2b31aad22ab25be22cd8e7d1cb874e5eaaac4630 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Mon, 21 Nov 2022 09:43:37 +0300 Subject: [PATCH 18/52] changes --- instat/dlgStack.vb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 8a47bfced26..2717dbdbb4d 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -436,11 +436,14 @@ Public Class dlgStack End Sub Private Sub GetVariables() - If Not ucrReceiverExpand.IsEmpty Then + Dim lstVariables As New List(Of String) + If ucrReceiverExpand.lstSelectedVariables.Items.Count > 0 Then + clsGetVariablesFunction.AddParameter("data_name", Chr(34) & ucrSelectorStack.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) clsGetVariablesFunction.AddParameter("col_names", Chr(34) & ucrReceiverExpand.GetVariableNames(False) & Chr(34), iPosition:=1) - 'clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetColumnNamesFunction, iPosition:=0) End If + 'clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetColumnNamesFunction, iPosition:=0) + End Sub End Class \ No newline at end of file From 0d57dbcc988dc3d33ced7426460d19cc95be8efc Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Mon, 21 Nov 2022 10:02:39 +0300 Subject: [PATCH 19/52] small change --- instat/dlgStack.vb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 2717dbdbb4d..122bbe25a8a 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -438,12 +438,15 @@ Public Class dlgStack Private Sub GetVariables() Dim lstVariables As New List(Of String) If ucrReceiverExpand.lstSelectedVariables.Items.Count > 0 Then + 'lstVariables.Clear() + lstVariables = ucrReceiverExpand.GetVariableNamesAsList() + 'For Each var In ucrSelectorStack + 'Next clsGetVariablesFunction.AddParameter("data_name", Chr(34) & ucrSelectorStack.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) clsGetVariablesFunction.AddParameter("col_names", Chr(34) & ucrReceiverExpand.GetVariableNames(False) & Chr(34), iPosition:=1) End If - 'clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetColumnNamesFunction, iPosition:=0) End Sub End Class \ No newline at end of file From dcfaf1aa45509872ee935cfa8f3b5228691385e5 Mon Sep 17 00:00:00 2001 From: Vitalis95 Date: Mon, 21 Nov 2022 11:31:06 +0300 Subject: [PATCH 20/52] get variables --- instat/dlgStack.vb | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 122bbe25a8a..cefa73f519d 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -24,13 +24,10 @@ Public Class dlgStack Private clsExpandFunction As New RFunction Private clsTypeConvertFunction As New RFunction Private clsSplitColumnsFunction As New RFunction - Private clsGetColumnNamesFunction As New RFunction Private clsGetVariablesFunction As New RFunction Private clsPipeOperator As New ROperator Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private lstEditedVariables, lstAllVariables As New List(Of String) - Private bResettingDialogue As Boolean = False Private Sub dlgStack_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then @@ -212,7 +209,6 @@ Public Class dlgStack clsExpandFunction = New RFunction clsTypeConvertFunction = New RFunction clsSplitColumnsFunction = New RFunction - clsGetColumnNamesFunction = New RFunction clsGetVariablesFunction = New RFunction clsPipeOperator = New ROperator @@ -241,15 +237,12 @@ Public Class dlgStack clsReshapeFunction.AddParameter("varying", clsRFunctionParameter:=clsSplitColumnsFunction, iPosition:=1) - 'clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetColumnNamesFunction, iPosition:=0) - - + clsGetVariablesFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsGetVariablesFunction.SetAssignTo("colnames") clsExpandFunction.SetPackageName("vcdExtra") clsExpandFunction.SetRCommand("expand.dft") - - clsGetVariablesFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") - + clsExpandFunction.AddParameter("x", clsRFunctionParameter:=clsGetVariablesFunction, iPosition:=0) clsTypeConvertFunction.SetRCommand("type.convert") clsTypeConvertFunction.AddParameter("x", clsRFunctionParameter:=clsExpandFunction, iPosition:=0) @@ -265,8 +258,6 @@ Public Class dlgStack Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverColumnsToBeStack.AddAdditionalCodeParameterPair(clsSplitColumnsFunction, New RParameter("items", 0), iAdditionalPairNo:=1) ucrSelectorStack.AddAdditionalCodeParameterPair(clsReshapeFunction, New RParameter("data", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0), iAdditionalPairNo:=1) - ucrSelectorStack.AddAdditionalCodeParameterPair(clsExpandFunction, New RParameter("data", ucrSelectorStack.ucrAvailableDataFrames.clsCurrDataFrame, 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) - ucrSaveNewDataName.AddAdditionalRCode(clsUnnestTokensFunction, iAdditionalPairNo:=1) ucrSaveNewDataName.AddAdditionalRCode(clsTypeConvertFunction, iAdditionalPairNo:=2) @@ -294,7 +285,6 @@ Public Class dlgStack ucrChkDropPrefix.SetRCode(clsPivotLongerFunction, bReset) ucrFactorInto.SetRCode(clsReshapeFunction, bReset) ucrReceiverFrequency.SetRCode(clsExpandFunction, bReset) - ucrReceiverExpand.SetRCode(clsGetColumnNamesFunction, bReset) End Sub Private Sub TestOKEnabled() @@ -431,22 +421,17 @@ Public Class dlgStack TestOKEnabled() End Sub - Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged, ucrSelectorStack.ControlValueChanged - GetVariables() - End Sub - - Private Sub GetVariables() + Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged, ucrReceiverFrequency.ControlValueChanged, ucrSelectorStack.ControlValueChanged Dim lstVariables As New List(Of String) If ucrReceiverExpand.lstSelectedVariables.Items.Count > 0 Then - 'lstVariables.Clear() lstVariables = ucrReceiverExpand.GetVariableNamesAsList() - 'For Each var In ucrSelectorStack + Dim strVarFrequency As String = ucrReceiverFrequency.GetVariableNames(False) + If Not ucrReceiverFrequency.IsEmpty AndAlso Not lstVariables.Contains(strVarFrequency) Then + lstVariables.Add(strVarFrequency) + End If - 'Next clsGetVariablesFunction.AddParameter("data_name", Chr(34) & ucrSelectorStack.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) - clsGetVariablesFunction.AddParameter("col_names", Chr(34) & ucrReceiverExpand.GetVariableNames(False) & Chr(34), iPosition:=1) - + clsGetVariablesFunction.AddParameter("col_names", frmMain.clsRLink.GetListAsRString(lstVariables, bWithQuotes:=True), iPosition:=1) End If - End Sub End Class \ No newline at end of file From 12985f1007f8b44296feb51b8e0d1ce982963d38 Mon Sep 17 00:00:00 2001 From: Sophie Date: Mon, 21 Nov 2022 15:10:48 +0100 Subject: [PATCH 21/52] Minor modification on Evapotranspiration code --- instat/dlgEvapotranspiration.vb | 73 +++++++++------------------------ 1 file changed, 19 insertions(+), 54 deletions(-) diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index 4f10248b03c..fcfddc3ae02 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -28,54 +28,6 @@ Public Class dlgEvapotranspiration Private clsDayFunc, clsMonthFunc, clsYearFunc As New RFunction Private clsBaseOperator, clsDailyOperatorHS As New ROperator - Private Sub ucrReceiverHumidityMin_Load(sender As Object, e As EventArgs) Handles ucrReceiverHumidityMin.Load - - End Sub - - Private Sub lblDate_Click(sender As Object, e As EventArgs) Handles lblDate.Click - - End Sub - - Private Sub lblTmin_Click(sender As Object, e As EventArgs) Handles lblTmin.Click - - End Sub - - Private Sub ucrReceiverTmin_Load(sender As Object, e As EventArgs) Handles ucrReceiverTmin.Load - - End Sub - - Private Sub lblTmax_Click(sender As Object, e As EventArgs) Handles lblTmax.Click - - End Sub - - Private Sub ucrReceiverTmax_Load(sender As Object, e As EventArgs) Handles ucrReceiverTmax.Load - - End Sub - - Private Sub lblHumidityMax_Click(sender As Object, e As EventArgs) Handles lblHumidityMax.Click - - End Sub - - Private Sub ucrReceiverHumidityMax_Load(sender As Object, e As EventArgs) Handles ucrReceiverHumidityMax.Load - - End Sub - - Private Sub lblHumidityMin_Click(sender As Object, e As EventArgs) Handles lblHumidityMin.Click - - End Sub - - Private Sub ucrReceiverDate_Load(sender As Object, e As EventArgs) Handles ucrReceiverDate.Load - - End Sub - - Private Sub lblRadiation_Click(sender As Object, e As EventArgs) Handles lblRadiation.Click - - End Sub - - Private Sub ucrReceiverRadiation_Load(sender As Object, e As EventArgs) Handles ucrReceiverRadiation.Load - - End Sub - Private Sub dlgdlgEvapotranspiration_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then iBasicHeight = Me.Height @@ -127,6 +79,9 @@ Public Class dlgEvapotranspiration ucrReceiverTmin.SetClimaticType("temp_min") ucrReceiverTmin.bAutoFill = True + ucrReceiverRadiation.SetParameter(New RParameter("Radiation", 8, bNewIncludeArgumentName:=False)) + ucrReceiverRadiation.SetParameterIsRFunction() + ucrReceiverHumidityMax.SetParameter(New RParameter("RHmax", 4)) ucrReceiverHumidityMax.SetParameterIsRFunction() 'ucrReceiverHumidityMax.bAutoFill = True @@ -137,8 +92,8 @@ Public Class dlgEvapotranspiration ucrReceiverWindSpeed.SetParameter(New RParameter("u2", 7)) ucrReceiverWindSpeed.SetParameterIsRFunction() - 'ucrReceiverWindSpeed.SetClimaticType("wind_speed") - 'ucrReceiverWindSpeed.bAutoFill = True + ucrReceiverWindSpeed.SetClimaticType("wind_speed") + ucrReceiverWindSpeed.bAutoFill = True ucrInputTimeStep.SetParameter(New RParameter("ts", 2)) dctInputTimeStep.Add("daily", Chr(34) & "daily" & Chr(34)) @@ -332,12 +287,16 @@ Public Class dlgEvapotranspiration ucrChkWind.SetRCode(clsETPenmanMonteith, bReset) ucrNewColName.SetRCode(clsBaseOperator, bReset) ucrInputMissingMethod.SetRCode(clsReadInputs, bReset) + + ucrReceiverRadiation.SetRCode(clsDataFunctionPM, bReset) End Sub Private Sub TestOKEnabled() If rdoPenmanMonteith.Checked Then If ucrNewColName.IsComplete AndAlso Not ucrReceiverDate.IsEmpty() AndAlso Not ucrReceiverTmax.IsEmpty() AndAlso Not ucrReceiverTmin.IsEmpty() AndAlso Not ucrReceiverHumidityMax.IsEmpty() AndAlso Not ucrReceiverHumidityMin.IsEmpty() AndAlso Not ucrReceiverRadiation.IsEmpty() AndAlso Not ucrInputTimeStep.IsEmpty Then ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) End If If ucrChkWind.Checked And ucrReceiverWindSpeed.IsEmpty Then ucrBase.OKEnabled(False) @@ -348,8 +307,6 @@ Public Class dlgEvapotranspiration Else ucrBase.OKEnabled(False) End If - Else - ucrBase.OKEnabled(False) End If End Sub @@ -393,6 +350,8 @@ Public Class dlgEvapotranspiration Private Sub ucrPnlMethod_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlValueChanged Method() DialogSize() + DataTypeRadiation() + If rdoPenmanMonteith.Checked Then clsBaseOperator.AddParameter("ET.PenmanMonteith", clsRFunctionParameter:=clsETPenmanMonteith, iPosition:=0) Else @@ -415,7 +374,10 @@ Public Class dlgEvapotranspiration End If End Sub - Private Sub ucrInputSolar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSolar.ControlValueChanged, ucrReceiverRadiation.ControlValueChanged + Private Sub ucrInputSolar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSolar.ControlValueChanged + DataTypeRadiation() + End Sub + Private Sub DataTypeRadiation() Select Case ucrInputSolar.GetText Case "sunshine hours" ucrReceiverRadiation.SetClimaticType("sunshine_hours") @@ -446,9 +408,12 @@ Public Class dlgEvapotranspiration clsDataFunctionPM.RemoveParameterByName("Rs") End Select End Sub - Private Sub ucrPnlMethod_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlContentsChanged, ucrNewColName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverTmax.ControlContentsChanged, ucrReceiverTmin.ControlContentsChanged, ucrReceiverHumidityMax.ControlContentsChanged, ucrReceiverHumidityMin.ControlContentsChanged, ucrReceiverRadiation.ControlContentsChanged, ucrReceiverWindSpeed.ControlContentsChanged, ucrInputTimeStep.ControlContentsChanged, ucrChkWind.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrReceiverRadiation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverRadiation.ControlValueChanged + DataTypeRadiation() + End Sub End Class From 2d33b242d9aced8f69a01aade6cf2a088af86727 Mon Sep 17 00:00:00 2001 From: Sophie Date: Tue, 22 Nov 2022 11:30:43 +0100 Subject: [PATCH 22/52] Minor modification on Evapotranspiration dialog. --- instat/dlgEvapotranspiration.Designer.vb | 75 +++++++---------- instat/dlgEvapotranspiration.vb | 80 +++++++++---------- ...ssingOptionsEvapotranspiration.Designer.vb | 42 +++++----- 3 files changed, 89 insertions(+), 108 deletions(-) diff --git a/instat/dlgEvapotranspiration.Designer.vb b/instat/dlgEvapotranspiration.Designer.vb index 7d1716fc75d..144623d8381 100644 --- a/instat/dlgEvapotranspiration.Designer.vb +++ b/instat/dlgEvapotranspiration.Designer.vb @@ -32,13 +32,10 @@ Partial Class dlgEvapotranspiration Me.lblMissingMethod = New System.Windows.Forms.Label() Me.lblSolar = New System.Windows.Forms.Label() Me.lblRadiation = New System.Windows.Forms.Label() - Me.grpWindSpeed = New System.Windows.Forms.GroupBox() Me.rdoHargreavesSamani = New System.Windows.Forms.RadioButton() Me.rdoPenmanMonteith = New System.Windows.Forms.RadioButton() Me.cmdEvapOptions = New System.Windows.Forms.Button() Me.ucrInputMissingMethod = New instat.ucrInputComboBox() - Me.ucrChkWind = New instat.ucrCheck() - Me.ucrReceiverWindSpeed = New instat.ucrReceiverSingle() Me.ucrInputSolar = New instat.ucrInputComboBox() Me.ucrReceiverRadiation = New instat.ucrReceiverSingle() Me.ucrInputCrop = New instat.ucrInputComboBox() @@ -52,7 +49,8 @@ Partial Class dlgEvapotranspiration Me.ucrReceiverTmax = New instat.ucrReceiverSingle() Me.ucrSelectorEvapotranspiration = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.grpWindSpeed.SuspendLayout() + Me.ucrReceiverWindSpeed = New instat.ucrReceiverSingle() + Me.ucrChkWind = New instat.ucrCheck() Me.SuspendLayout() ' 'lblTmax @@ -143,18 +141,7 @@ Partial Class dlgEvapotranspiration Me.lblRadiation.Name = "lblRadiation" Me.lblRadiation.Size = New System.Drawing.Size(120, 17) Me.lblRadiation.TabIndex = 14 - Me.lblRadiation.Text = "Radiation:" - ' - 'grpWindSpeed - ' - Me.grpWindSpeed.Controls.Add(Me.ucrChkWind) - Me.grpWindSpeed.Controls.Add(Me.ucrReceiverWindSpeed) - Me.grpWindSpeed.Location = New System.Drawing.Point(262, 286) - Me.grpWindSpeed.Name = "grpWindSpeed" - Me.grpWindSpeed.Size = New System.Drawing.Size(191, 57) - Me.grpWindSpeed.TabIndex = 25 - Me.grpWindSpeed.TabStop = False - Me.grpWindSpeed.Text = "Wind Speed" + Me.lblRadiation.Text = "Solar:" ' 'rdoHargreavesSamani ' @@ -192,7 +179,7 @@ Partial Class dlgEvapotranspiration ' 'cmdEvapOptions ' - Me.cmdEvapOptions.Location = New System.Drawing.Point(314, 360) + Me.cmdEvapOptions.Location = New System.Drawing.Point(314, 343) Me.cmdEvapOptions.Name = "cmdEvapOptions" Me.cmdEvapOptions.Size = New System.Drawing.Size(123, 23) Me.cmdEvapOptions.TabIndex = 34 @@ -211,28 +198,6 @@ Partial Class dlgEvapotranspiration Me.ucrInputMissingMethod.Size = New System.Drawing.Size(137, 21) Me.ucrInputMissingMethod.TabIndex = 29 ' - 'ucrChkWind - ' - Me.ucrChkWind.AutoSize = True - Me.ucrChkWind.Checked = False - Me.ucrChkWind.Location = New System.Drawing.Point(5, 31) - Me.ucrChkWind.Name = "ucrChkWind" - Me.ucrChkWind.Size = New System.Drawing.Size(108, 23) - Me.ucrChkWind.TabIndex = 0 - ' - 'ucrReceiverWindSpeed - ' - Me.ucrReceiverWindSpeed.AutoSize = True - Me.ucrReceiverWindSpeed.frmParent = Nothing - Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(116, 31) - Me.ucrReceiverWindSpeed.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverWindSpeed.Name = "ucrReceiverWindSpeed" - Me.ucrReceiverWindSpeed.Selector = Nothing - Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(72, 20) - Me.ucrReceiverWindSpeed.strNcFilePath = "" - Me.ucrReceiverWindSpeed.TabIndex = 2 - Me.ucrReceiverWindSpeed.ucrSelector = Nothing - ' 'ucrInputSolar ' Me.ucrInputSolar.AddQuotesIfUnrecognised = True @@ -382,18 +347,41 @@ Partial Class dlgEvapotranspiration Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 33 ' + 'ucrReceiverWindSpeed + ' + Me.ucrReceiverWindSpeed.AutoSize = True + Me.ucrReceiverWindSpeed.frmParent = Me + Me.ucrReceiverWindSpeed.Location = New System.Drawing.Point(314, 297) + Me.ucrReceiverWindSpeed.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverWindSpeed.Name = "ucrReceiverWindSpeed" + Me.ucrReceiverWindSpeed.Selector = Nothing + Me.ucrReceiverWindSpeed.Size = New System.Drawing.Size(123, 20) + Me.ucrReceiverWindSpeed.strNcFilePath = "" + Me.ucrReceiverWindSpeed.TabIndex = 2 + Me.ucrReceiverWindSpeed.ucrSelector = Nothing + ' + 'ucrChkWind + ' + Me.ucrChkWind.AutoSize = True + Me.ucrChkWind.Checked = False + Me.ucrChkWind.Location = New System.Drawing.Point(314, 277) + Me.ucrChkWind.Name = "ucrChkWind" + Me.ucrChkWind.Size = New System.Drawing.Size(123, 31) + Me.ucrChkWind.TabIndex = 0 + ' 'dlgEvapotranspiration ' 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(453, 478) + Me.Controls.Add(Me.ucrReceiverWindSpeed) + Me.Controls.Add(Me.ucrChkWind) Me.Controls.Add(Me.cmdEvapOptions) Me.Controls.Add(Me.rdoHargreavesSamani) Me.Controls.Add(Me.rdoPenmanMonteith) Me.Controls.Add(Me.ucrInputMissingMethod) Me.Controls.Add(Me.lblMissingMethod) - Me.Controls.Add(Me.grpWindSpeed) Me.Controls.Add(Me.lblSolar) Me.Controls.Add(Me.ucrInputSolar) Me.Controls.Add(Me.lblRadiation) @@ -422,8 +410,6 @@ Partial Class dlgEvapotranspiration Me.Name = "dlgEvapotranspiration" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Evapotranspiration" - Me.grpWindSpeed.ResumeLayout(False) - Me.grpWindSpeed.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -449,9 +435,6 @@ Partial Class dlgEvapotranspiration Friend WithEvents lblMissingMethod As Label Friend WithEvents ucrNewColName As ucrSave Friend WithEvents ucrReceiverTmax As ucrReceiverSingle - Friend WithEvents grpWindSpeed As GroupBox - Friend WithEvents ucrChkWind As ucrCheck - Friend WithEvents ucrReceiverWindSpeed As ucrReceiverSingle Friend WithEvents ucrInputSolar As ucrInputComboBox Friend WithEvents lblSolar As Label Friend WithEvents ucrReceiverRadiation As ucrReceiverSingle @@ -459,4 +442,6 @@ Partial Class dlgEvapotranspiration Friend WithEvents rdoHargreavesSamani As RadioButton Friend WithEvents rdoPenmanMonteith As RadioButton Friend WithEvents cmdEvapOptions As Button + Friend WithEvents ucrReceiverWindSpeed As ucrReceiverSingle + Friend WithEvents ucrChkWind As ucrCheck End Class \ No newline at end of file diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index fcfddc3ae02..9910657fdc4 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -27,6 +27,7 @@ Public Class dlgEvapotranspiration Private clsETPenmanMonteith, clsHargreavesSamani, clsDataFunctionPM, clsDataFunctionHS, clsDataFunction, clsReadInputs, clsVector, clsMissingDataVector, clsVarnamesVectorPM, clsVarnamesVectorHS, clsLibraryEvap As New RFunction Private clsDayFunc, clsMonthFunc, clsYearFunc As New RFunction Private clsBaseOperator, clsDailyOperatorHS As New ROperator + Private bRcodeSet As Boolean = True Private Sub dlgdlgEvapotranspiration_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstload Then @@ -79,7 +80,7 @@ Public Class dlgEvapotranspiration ucrReceiverTmin.SetClimaticType("temp_min") ucrReceiverTmin.bAutoFill = True - ucrReceiverRadiation.SetParameter(New RParameter("Radiation", 8, bNewIncludeArgumentName:=False)) + ucrReceiverRadiation.SetParameter(New RParameter("Solar", 8, bNewIncludeArgumentName:=False)) ucrReceiverRadiation.SetParameterIsRFunction() ucrReceiverHumidityMax.SetParameter(New RParameter("RHmax", 4)) @@ -106,7 +107,7 @@ Public Class dlgEvapotranspiration ucrInputSolar.SetRDefault(Chr(34) & "sunshine hours" & Chr(34)) dctInputSolar.Add("sunshine hours", Chr(34) & "sunshine hours" & Chr(34)) dctInputSolar.Add("cloud", Chr(34) & "cloud" & Chr(34)) - dctInputSolar.Add("data", Chr(34) & "data" & Chr(34)) + dctInputSolar.Add("radiation", Chr(34) & "radiation" & Chr(34)) ucrInputSolar.SetItems(dctInputSolar) ucrInputSolar.SetDropDownStyleAsNonEditable() @@ -147,7 +148,7 @@ Public Class dlgEvapotranspiration ucrPnlMethod.AddToLinkedControls(ucrInputSolar, {rdoPenmanMonteith}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethod.AddToLinkedControls(ucrInputMissingMethod, {rdoPenmanMonteith}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="monthly average") - ucrChkWind.SetLinkedDisplayControl(grpWindSpeed) + 'ucrChkWind.SetLinkedDisplayControl(grpWindSpeed) ucrReceiverRadiation.SetLinkedDisplayControl(lblRadiation) ucrReceiverHumidityMax.SetLinkedDisplayControl(lblHumidityMax) ucrReceiverHumidityMin.SetLinkedDisplayControl(lblHumidityMin) @@ -350,8 +351,6 @@ Public Class dlgEvapotranspiration Private Sub ucrPnlMethod_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlValueChanged Method() DialogSize() - DataTypeRadiation() - If rdoPenmanMonteith.Checked Then clsBaseOperator.AddParameter("ET.PenmanMonteith", clsRFunctionParameter:=clsETPenmanMonteith, iPosition:=0) Else @@ -375,45 +374,42 @@ Public Class dlgEvapotranspiration End Sub Private Sub ucrInputSolar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSolar.ControlValueChanged - DataTypeRadiation() - End Sub - Private Sub DataTypeRadiation() - Select Case ucrInputSolar.GetText - Case "sunshine hours" - ucrReceiverRadiation.SetClimaticType("sunshine_hours") - ucrReceiverRadiation.bAutoFill = True - clsVarnamesVectorPM.AddParameter("n", Chr(34) & "n" & Chr(34), bIncludeArgumentName:=False) - clsDataFunctionPM.AddParameter("n", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) - clsVarnamesVectorPM.RemoveParameterByName("Rs") - clsVarnamesVectorPM.RemoveParameterByName("Cd") - clsDataFunctionPM.RemoveParameterByName("Rs") - clsDataFunctionPM.RemoveParameterByName("cd") - Case "data" - ucrReceiverRadiation.SetClimaticType("radiation") - ucrReceiverRadiation.bAutoFill = True - clsVarnamesVectorPM.AddParameter("Rs", Chr(34) & "Rs" & Chr(34), bIncludeArgumentName:=False) - clsDataFunctionPM.AddParameter("Rs", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) - clsVarnamesVectorPM.RemoveParameterByName("n") - clsVarnamesVectorPM.RemoveParameterByName("Cd") - clsDataFunctionPM.RemoveParameterByName("n") - clsDataFunctionPM.RemoveParameterByName("cd") - Case "cloud" - ucrReceiverRadiation.SetClimaticType("cloud_cover") - ucrReceiverRadiation.bAutoFill = True - clsVarnamesVectorPM.AddParameter("Cd", Chr(34) & "Cd" & Chr(34), bIncludeArgumentName:=False) - clsDataFunctionPM.AddParameter("Cd", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) - clsVarnamesVectorPM.RemoveParameterByName("n") - clsVarnamesVectorPM.RemoveParameterByName("Rs") - clsDataFunctionPM.RemoveParameterByName("n") - clsDataFunctionPM.RemoveParameterByName("Rs") - End Select + If bRcodeSet Then + + + Select Case ucrInputSolar.GetText + Case "sunshine hours" + ucrReceiverRadiation.SetClimaticType("sunshine_hours") + ucrReceiverRadiation.bAutoFill = True + clsVarnamesVectorPM.AddParameter("n", Chr(34) & "n" & Chr(34), bIncludeArgumentName:=False) + clsDataFunctionPM.AddParameter("n", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) + clsVarnamesVectorPM.RemoveParameterByName("Rs") + clsVarnamesVectorPM.RemoveParameterByName("Cd") + clsDataFunctionPM.RemoveParameterByName("Rs") + clsDataFunctionPM.RemoveParameterByName("cd") + Case "radiation" + ucrReceiverRadiation.SetClimaticType("radiation") + ucrReceiverRadiation.bAutoFill = True + clsVarnamesVectorPM.AddParameter("Rs", Chr(34) & "Rs" & Chr(34), bIncludeArgumentName:=False) + clsDataFunctionPM.AddParameter("Rs", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) + clsVarnamesVectorPM.RemoveParameterByName("n") + clsVarnamesVectorPM.RemoveParameterByName("Cd") + clsDataFunctionPM.RemoveParameterByName("n") + clsDataFunctionPM.RemoveParameterByName("cd") + Case "cloud" + ucrReceiverRadiation.SetClimaticType("cloud_cover") + ucrReceiverRadiation.bAutoFill = True + clsVarnamesVectorPM.AddParameter("Cd", Chr(34) & "Cd" & Chr(34), bIncludeArgumentName:=False) + clsDataFunctionPM.AddParameter("Cd", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) + clsVarnamesVectorPM.RemoveParameterByName("n") + clsVarnamesVectorPM.RemoveParameterByName("Rs") + clsDataFunctionPM.RemoveParameterByName("n") + clsDataFunctionPM.RemoveParameterByName("Rs") + End Select + End If End Sub - Private Sub ucrPnlMethod_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlContentsChanged, ucrNewColName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverTmax.ControlContentsChanged, ucrReceiverTmin.ControlContentsChanged, ucrReceiverHumidityMax.ControlContentsChanged, ucrReceiverHumidityMin.ControlContentsChanged, ucrReceiverRadiation.ControlContentsChanged, ucrReceiverWindSpeed.ControlContentsChanged, ucrInputTimeStep.ControlContentsChanged, ucrChkWind.ControlContentsChanged + Private Sub ucrPnlMethod_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlContentsChanged, ucrNewColName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverTmax.ControlContentsChanged, ucrReceiverTmin.ControlContentsChanged, ucrReceiverHumidityMax.ControlContentsChanged, ucrReceiverHumidityMin.ControlContentsChanged, ucrReceiverRadiation.ControlContentsChanged, ucrReceiverWindSpeed.ControlContentsChanged, ucrInputTimeStep.ControlContentsChanged, ucrChkWind.ControlContentsChanged, ucrChkWind.ControlContentsChanged TestOKEnabled() End Sub - - Private Sub ucrReceiverRadiation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverRadiation.ControlValueChanged - DataTypeRadiation() - End Sub End Class diff --git a/instat/sdgMissingOptionsEvapotranspiration.Designer.vb b/instat/sdgMissingOptionsEvapotranspiration.Designer.vb index 7ecd44dc19a..89002ae7927 100644 --- a/instat/sdgMissingOptionsEvapotranspiration.Designer.vb +++ b/instat/sdgMissingOptionsEvapotranspiration.Designer.vb @@ -26,11 +26,11 @@ Partial Class sdgMissingOptionsEvapotranspiration Me.lblMaxDurationMissingData = New System.Windows.Forms.Label() Me.lblMaxMissingDays = New System.Windows.Forms.Label() Me.grpMissingDataOpts = New System.Windows.Forms.GroupBox() + Me.ucrChkInterpMissingEntries = New instat.ucrCheck() + Me.ucrChkInterpMissingDays = New instat.ucrCheck() Me.ucrNudMaxDurationMissingData = New instat.ucrNud() Me.ucrNudMaxMissingDays = New instat.ucrNud() Me.ucrNudMaxMissingData = New instat.ucrNud() - Me.ucrChkInterpMissingEntries = New instat.ucrCheck() - Me.ucrChkInterpMissingDays = New instat.ucrCheck() Me.ucrSdgButtons = New instat.ucrButtonsSubdialogue() Me.grpMissingDataOpts.SuspendLayout() Me.SuspendLayout() @@ -73,6 +73,24 @@ Partial Class sdgMissingOptionsEvapotranspiration Me.grpMissingDataOpts.TabStop = False Me.grpMissingDataOpts.Text = "Missing Data Options" ' + 'ucrChkInterpMissingEntries + ' + Me.ucrChkInterpMissingEntries.AutoSize = True + Me.ucrChkInterpMissingEntries.Checked = False + Me.ucrChkInterpMissingEntries.Location = New System.Drawing.Point(2, 38) + Me.ucrChkInterpMissingEntries.Name = "ucrChkInterpMissingEntries" + Me.ucrChkInterpMissingEntries.Size = New System.Drawing.Size(188, 23) + Me.ucrChkInterpMissingEntries.TabIndex = 5 + ' + 'ucrChkInterpMissingDays + ' + Me.ucrChkInterpMissingDays.AutoSize = True + Me.ucrChkInterpMissingDays.Checked = False + Me.ucrChkInterpMissingDays.Location = New System.Drawing.Point(2, 16) + Me.ucrChkInterpMissingDays.Name = "ucrChkInterpMissingDays" + Me.ucrChkInterpMissingDays.Size = New System.Drawing.Size(168, 23) + Me.ucrChkInterpMissingDays.TabIndex = 6 + ' 'ucrNudMaxDurationMissingData ' Me.ucrNudMaxDurationMissingData.AutoSize = True @@ -112,24 +130,6 @@ Partial Class sdgMissingOptionsEvapotranspiration Me.ucrNudMaxMissingData.TabIndex = 28 Me.ucrNudMaxMissingData.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrChkInterpMissingEntries - ' - Me.ucrChkInterpMissingEntries.AutoSize = True - Me.ucrChkInterpMissingEntries.Checked = False - Me.ucrChkInterpMissingEntries.Location = New System.Drawing.Point(2, 38) - Me.ucrChkInterpMissingEntries.Name = "ucrChkInterpMissingEntries" - Me.ucrChkInterpMissingEntries.Size = New System.Drawing.Size(188, 23) - Me.ucrChkInterpMissingEntries.TabIndex = 5 - ' - 'ucrChkInterpMissingDays - ' - Me.ucrChkInterpMissingDays.AutoSize = True - Me.ucrChkInterpMissingDays.Checked = False - Me.ucrChkInterpMissingDays.Location = New System.Drawing.Point(2, 16) - Me.ucrChkInterpMissingDays.Name = "ucrChkInterpMissingDays" - Me.ucrChkInterpMissingDays.Size = New System.Drawing.Size(168, 23) - Me.ucrChkInterpMissingDays.TabIndex = 6 - ' 'ucrSdgButtons ' Me.ucrSdgButtons.AutoSize = True @@ -142,7 +142,7 @@ Partial Class sdgMissingOptionsEvapotranspiration ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(241, 224) + Me.ClientSize = New System.Drawing.Size(245, 229) Me.Controls.Add(Me.lblMaxPerctMissindData) Me.Controls.Add(Me.ucrNudMaxDurationMissingData) Me.Controls.Add(Me.ucrNudMaxMissingDays) From 21b0b83750cac599eec79d04366c6deb02328722 Mon Sep 17 00:00:00 2001 From: Sophie Date: Fri, 25 Nov 2022 17:48:58 +0100 Subject: [PATCH 23/52] Minor modification on the code --- instat/dlgApsimx.vb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb index 83c27763210..8483e849e27 100644 --- a/instat/dlgApsimx.vb +++ b/instat/dlgApsimx.vb @@ -93,11 +93,7 @@ Public Class dlgApsimx End Sub Private Sub TestOKEnabled() - If ucrInputSaveData.GetText <> "" Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + ucrBase.OKEnabled(ucrInputSaveData.GetText <> "") End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -116,14 +112,12 @@ Public Class dlgApsimx clsApsimxExampleFunction.SetAssignTo(strDataName) clsDataListFunction.ClearParameters() ucrBase.clsRsyntax.ClearCodes() - If ucrInputComboList.GetText = "Wheat" OrElse ucrInputComboList.GetText = "Barley" OrElse ucrInputComboList.GetText = "Controlled Environment" OrElse ucrInputComboList.GetText = "Sugarcane" OrElse ucrInputComboList.GetText = "Eucalyptus" OrElse ucrInputComboList.GetText = "Eucalyptus Rotation" OrElse ucrInputComboList.GetText = "Maize" OrElse ucrInputComboList.GetText = "Oats" OrElse ucrInputComboList.GetText = "Soybean" Then - clsDataListFunction.AddParameter(ucrInputSaveData.GetText, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) - ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) - ucrBase.clsRsyntax.RemoveFromAfterCodes(clsReportOperator) - ElseIf ucrInputComboList.GetText = "Rotation" Then + If ucrInputComboList.GetText = "Rotation" Then clsDataListFunction.AddParameter(strDataName, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) ucrBase.clsRsyntax.AddToBeforeCodes(clsApsimxExampleFunction, 0) ucrBase.clsRsyntax.AddToBeforeCodes(clsReportOperator, 1) + Else + clsDataListFunction.AddParameter(ucrInputSaveData.GetText, clsRFunctionParameter:=clsApsimxExampleFunction, iPosition:=0) End If ucrBase.clsRsyntax.SetBaseRFunction(clsBaseFunction) End Sub From 2214c7adf87b8cd4a68ec58f708d4e995e771290 Mon Sep 17 00:00:00 2001 From: Vitalis95 <89011415+Vitalis95@users.noreply.github.com> Date: Sat, 26 Nov 2022 13:36:43 +0300 Subject: [PATCH 24/52] Update instat/dlgStack.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgStack.vb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index cefa73f519d..100c3ed70b4 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -306,11 +306,9 @@ Public Class dlgStack ucrBase.OKEnabled(True) End If Else - If ucrReceiverExpand.IsEmpty OrElse ucrReceiverFrequency.IsEmpty OrElse Not ucrSaveNewDataName.IsComplete Then - ucrBase.OKEnabled(False) - Else - ucrBase.OKEnabled(True) - End If + ucrBase.OKEnabled(Not ucrReceiverExpand.IsEmpty _ + AndAlso Not ucrReceiverFrequency.IsEmpty _ + AndAlso ucrSaveNewDataName.IsComplete) End If End Sub From 80fe837f6f285f9cf4df39746227d0adce635af3 Mon Sep 17 00:00:00 2001 From: Vitalis95 <89011415+Vitalis95@users.noreply.github.com> Date: Sat, 26 Nov 2022 13:37:04 +0300 Subject: [PATCH 25/52] Update instat/dlgStack.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgStack.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 100c3ed70b4..7b5c5beed1d 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -422,7 +422,7 @@ Public Class dlgStack Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged, ucrReceiverFrequency.ControlValueChanged, ucrSelectorStack.ControlValueChanged Dim lstVariables As New List(Of String) If ucrReceiverExpand.lstSelectedVariables.Items.Count > 0 Then - lstVariables = ucrReceiverExpand.GetVariableNamesAsList() + Dim lstVariables As List(Of String) = ucrReceiverExpand.GetVariableNamesAsList() Dim strVarFrequency As String = ucrReceiverFrequency.GetVariableNames(False) If Not ucrReceiverFrequency.IsEmpty AndAlso Not lstVariables.Contains(strVarFrequency) Then lstVariables.Add(strVarFrequency) From f9874f2385d6372a3f06c7c9932c69e2b208d547 Mon Sep 17 00:00:00 2001 From: Vitalis95 <89011415+Vitalis95@users.noreply.github.com> Date: Sat, 26 Nov 2022 13:37:24 +0300 Subject: [PATCH 26/52] Update instat/dlgStack.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgStack.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 7b5c5beed1d..dce76226d62 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -420,7 +420,6 @@ Public Class dlgStack End Sub Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged, ucrReceiverFrequency.ControlValueChanged, ucrSelectorStack.ControlValueChanged - Dim lstVariables As New List(Of String) If ucrReceiverExpand.lstSelectedVariables.Items.Count > 0 Then Dim lstVariables As List(Of String) = ucrReceiverExpand.GetVariableNamesAsList() Dim strVarFrequency As String = ucrReceiverFrequency.GetVariableNames(False) From 0499b4caddb3a4827ff5f0b33545652050cb2b5c Mon Sep 17 00:00:00 2001 From: Barbra2020 Date: Sat, 26 Nov 2022 13:57:56 +0300 Subject: [PATCH 27/52] changes suggested --- instat/dlgStack.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index dce76226d62..0a905dea0d4 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -420,15 +420,16 @@ Public Class dlgStack End Sub Private Sub ucrReceiverExpand_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverExpand.ControlValueChanged, ucrReceiverFrequency.ControlValueChanged, ucrSelectorStack.ControlValueChanged - If ucrReceiverExpand.lstSelectedVariables.Items.Count > 0 Then - Dim lstVariables As List(Of String) = ucrReceiverExpand.GetVariableNamesAsList() + If ucrReceiverExpand.lstSelectedVariables.Items.Count <= 0 Then + Exit Sub + End If + Dim lstVariables As List(Of String) = ucrReceiverExpand.GetVariableNamesAsList() Dim strVarFrequency As String = ucrReceiverFrequency.GetVariableNames(False) If Not ucrReceiverFrequency.IsEmpty AndAlso Not lstVariables.Contains(strVarFrequency) Then lstVariables.Add(strVarFrequency) End If clsGetVariablesFunction.AddParameter("data_name", Chr(34) & ucrSelectorStack.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) - clsGetVariablesFunction.AddParameter("col_names", frmMain.clsRLink.GetListAsRString(lstVariables, bWithQuotes:=True), iPosition:=1) - End If + clsGetVariablesFunction.AddParameter("col_names", frmMain.clsRLink.GetListAsRString(lstVariables, bWithQuotes:=True), iPosition:=1) End Sub End Class \ No newline at end of file From 04426fb5fa1167d7b184832aed271e1cc3e87ae1 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sun, 27 Nov 2022 11:08:34 +0300 Subject: [PATCH 28/52] made changes to saving of html files --- instat/UserControls/frmMaximiseOutput.vb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/instat/UserControls/frmMaximiseOutput.vb b/instat/UserControls/frmMaximiseOutput.vb index dcb0253abe3..c038b553691 100644 --- a/instat/UserControls/frmMaximiseOutput.vb +++ b/instat/UserControls/frmMaximiseOutput.vb @@ -74,6 +74,7 @@ Public Class frmMaximiseOutput End Sub Private Sub mnuSave_Click(sender As Object, e As EventArgs) Handles mnuSave.Click + 'copies displayed file to the destination folder selected by user Using dlgSaveFile As New SaveFileDialog dlgSaveFile.Title = "Save Output" dlgSaveFile.Filter = _strFileFilter @@ -83,15 +84,25 @@ Public Class frmMaximiseOutput _strFileDestinationDirectory = Path.GetDirectoryName(dlgSaveFile.FileName) - 'for htmls copy the html file with it's associated directory; css, javascript files etc If Path.GetExtension(_strDisplayedFileName).ToLower = ".html" Then - For Each foundDirectory As String In My.Computer.FileSystem.GetDirectories( + 'for html copy the html file associated directories, css, javascript files etc + For Each strFoundDirectory As String In My.Computer.FileSystem.GetDirectories( Path.GetDirectoryName(_strDisplayedFileName), FileIO.SearchOption.SearchTopLevelOnly, "*" & Path.GetFileNameWithoutExtension(_strDisplayedFileName) & "*") - My.Computer.FileSystem.CopyDirectory(foundDirectory, _strFileDestinationDirectory, True) + + 'create the destination folder first + Dim destDir As String = Path.Combine(_strFileDestinationDirectory, + Path.GetFileName(strFoundDirectory)) + If Not Directory.Exists(destDir) Then + Directory.CreateDirectory(destDir) + End If + My.Computer.FileSystem.CopyDirectory(strFoundDirectory, destDir, True) Next + 'then copy the html file + My.Computer.FileSystem.CopyFile(_strDisplayedFileName, dlgSaveFile.FileName, True) Else + 'for other files like text, images, just copy the file My.Computer.FileSystem.CopyFile(_strDisplayedFileName, dlgSaveFile.FileName, True) End If End If From 328da859fce521d3a50e29a5f893540a255f60f3 Mon Sep 17 00:00:00 2001 From: Barbra2020 Date: Mon, 28 Nov 2022 12:07:01 +0300 Subject: [PATCH 29/52] a change --- instat/dlgStack.vb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/instat/dlgStack.vb b/instat/dlgStack.vb index 0a905dea0d4..71fcef403ea 100644 --- a/instat/dlgStack.vb +++ b/instat/dlgStack.vb @@ -431,5 +431,12 @@ Public Class dlgStack clsGetVariablesFunction.AddParameter("data_name", Chr(34) & ucrSelectorStack.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) clsGetVariablesFunction.AddParameter("col_names", frmMain.clsRLink.GetListAsRString(lstVariables, bWithQuotes:=True), iPosition:=1) + + End Sub + + Private Sub ucrSelectorStack_DataFrameChanged() Handles ucrSelectorStack.ControlContentsChanged + If rdoExpand.Checked Then + ucrReceiverExpand.SetMeAsReceiver() + End If End Sub End Class \ No newline at end of file From 0704a332455a545c746149ec8ec951f664dcddce Mon Sep 17 00:00:00 2001 From: patowhiz Date: Mon, 28 Nov 2022 13:48:26 +0300 Subject: [PATCH 30/52] Added support for plotly plots --- instat/clsRLink.vb | 104 ++---------------- instat/frmMain.vb | 48 ++++++-- .../static/InstatObject/R/instat_object_R6.R | 31 ++++-- 3 files changed, 67 insertions(+), 116 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index 63f60c48dfb..d6e6dbb9e02 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -840,9 +840,9 @@ Public Class RLink Try - 'get the last R script command + 'get the last R script command. todo, this should eventually use the RScript library functions to identify the last R script command Dim strLastScript As String = GetRunnableCommandLines(strScript).LastOrDefault - If strLastScript IsNot Nothing AndAlso strLastScript.Contains("get_object") Then + If strLastScript IsNot Nothing AndAlso (strLastScript.Contains("get_object") OrElse strLastScript.Contains("get_last_object") OrElse strLastScript.Contains("view_object")) Then Try 'if object output should be returned as a file do the following. Dim strNewAssignedToScript As String = ConstructAssignTo(strTempAssignTo, strScript) @@ -865,74 +865,6 @@ Public Class RLink End Try ElseIf iCallType = 0 Then 'if script output should be ignored. to do. deprecated Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) - ElseIf iCallType = 3 Then - 'else if output should be returned as a graph. - 'todo. deprecate this block. currently used view last graph mainly and viewing graph objects dialog - - If strGraphDisplayOption = "view_output_window" OrElse strGraphDisplayOption = "view_separate_window" Then - 'run R command for taking a snapshot of the graph image - clsPNGFunction.SetPackageName("grDevices") - clsPNGFunction.SetRCommand("png") - clsPNGFunction.AddParameter("filename", Chr(34) & System.IO.Path.Combine(strTempGraphsDirectory & "/Graph.png").Replace("\", "/") & Chr(34)) - 'TODO make these options - clsPNGFunction.AddParameter("width", 4000) - clsPNGFunction.AddParameter("height", 4000) - clsPNGFunction.AddParameter("res", 500) - ' temporary solution to being unable to save graphs in a temporary location for display. - ' this can occur if System.IO.Path.GetTempPath() returns a path that is not writable. - bSuccess = Evaluate(clsPNGFunction.ToScript(), bSilent:=True, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) - If bSuccess Then - 'need to boost resolution of the devices, it's not as good as with ggsave. - Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) - 'switch of taking of graph snapshots - 'todo. not quite sure if this would work, otherwise find the right way to close the appropriate devices. - Evaluate("graphics.off()", bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) - - 'Get the graph images for display. - 'todo in future do the following - 'add an R script (maybe in the form of one of our methods) that copies divices to the temp directory, using the default device production... use dev.list() and dev.copy() with arguments device = the devices in the list and which = jpeg devices with different paths leading to the temp directory, using a paste() method to find different names for the files - 'clsEngine.Evaluate("ggsave(" & Chr(34) & strTempGraphsDirectory.Replace("\", "/") & "Graph.jpg" & Chr(34) & ")") - 'This sub is used to display graphics in the output window when necessary. - 'This sub is checking the temp directory "R_Instat_Temp_Graphs", created during setup to see if there are any graphs to display. If there are some, then it sends them to the output window, and removes them from the directory. - 'It is called from RLink at the end of RunScript. - Dim lstTempGraphFiles As ObjectModel.ReadOnlyCollection(Of String) - Dim iNumberOfFiles As Integer = -1 - strTempGraphsDirectory = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "R_Instat_Temp_Graphs") - Try - lstTempGraphFiles = FileIO.FileSystem.GetFiles(strTempGraphsDirectory) - Catch e As Exception - lstTempGraphFiles = Nothing - MsgBox(e.Message & Environment.NewLine & "A problem occured in getting the content of the temporary graphs directory: " & strTempGraphsDirectory & " Possible exceptions are described here: https://msdn.microsoft.com/en-us/library/kf41fdf4.aspx", MsgBoxStyle.Critical) - End Try - If lstTempGraphFiles IsNot Nothing AndAlso lstTempGraphFiles.Count > 0 Then - For Each strFileName As String In lstTempGraphFiles - If strGraphDisplayOption = "view_output_window" Then - clsOutputLogger.AddImageOutput(strFileName) - ElseIf strGraphDisplayOption = "view_separate_window" Then - Dim frmMaximiseOutput As New frmMaximiseOutput - frmMaximiseOutput.Show(strTemp) - End If - Try - My.Computer.FileSystem.DeleteFile(strFileName) - Catch e As Exception - MsgBox(e.Message & Environment.NewLine & "A problem occured in attempting to delete the temporary file: " & strFileName & " The possible exceptions are described here: https://msdn.microsoft.com/en-us/library/tdx72k4b.aspx", MsgBoxStyle.Critical) - End Try - Next - End If - Else - 'switch of taking of graph snapshots - 'todo. not quite sure if this would work, otherwise find the right way to close the appropriate devices. - Evaluate("graphics.off()", bSilent:=bSilent, bSeparateThread:=bSeparateThread, bShowWaitDialogOverride:=bShowWaitDialogOverride) - strGraphDisplayOption = "view_R_viewer" - MsgBox("A problem occured saving graphs in the temporary location " & strTempGraphsDirectory & vbNewLine & vbNewLine & "To ensure graphs can still be viewed, graphs will now appear in a pop up R viewer." & vbNewLine & "Restarting R-Instat and/or your machine usually resolves this. You can change this setting back in Tools > Options: 'Graph Display' if this later becomes resolved.", MsgBoxStyle.Exclamation) - 'will launch the R viewer - Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=False, bShowWaitDialogOverride:=bShowWaitDialogOverride) - End If - - ElseIf strGraphDisplayOption = "view_R_viewer" Then - Evaluate(strScript, bSilent:=bSilent, bSeparateThread:=False, bShowWaitDialogOverride:=bShowWaitDialogOverride) - End If - ElseIf iCallType = 1 OrElse iCallType = 4 Then 'else if script output should be stored in a temp variable ' TODO SJL In RInstat, iCallType only seems to be 0, 2 or 3. Are call types 1 and 4 used? Try @@ -1090,28 +1022,13 @@ Public Class RLink ''' ''' (Optional) If true then view last graph as plotly. '''-------------------------------------------------------------------------------------------- - Public Sub ViewLastGraph(Optional bAsPlotly As Boolean = False, - Optional bInRViewer As Boolean = False) + Public Sub ViewLastGraph(bAsPlotly As String) Dim clsLastGraph As New RFunction clsLastGraph.SetRCommand(strInstatDataObject & "$get_last_graph") clsLastGraph.AddParameter("print_graph", "FALSE", iPosition:=0) - If bAsPlotly Then - Dim clsViewObjectFunction As New RFunction - Dim clsInteractivePlot As New RFunction - - clsInteractivePlot.SetPackageName("plotly") - clsInteractivePlot.SetRCommand("ggplotly") - clsInteractivePlot.AddParameter("p", clsRFunctionParameter:=clsLastGraph, iPosition:=0) - - clsViewObjectFunction.SetRCommand("view_object") - clsViewObjectFunction.AddParameter(strParameterName:="object", - clsRFunctionParameter:=clsInteractivePlot) - clsViewObjectFunction.AddParameter(strParameterName:="object_format", - strParameterValue:=Chr(34) & RObjectFormat.Html & Chr(34)) - - RunScript(clsViewObjectFunction.ToScript(), bAddOutputInViewer:=False, strComment:="View last graph as Plotly", bSeparateThread:=False) - ElseIf bInRViewer Then - Dim strGlobalGraphDisplayOption As String + + + Dim strGlobalGraphDisplayOption As String 'store the current set graph display option, to restore after display strGlobalGraphDisplayOption = Me.strGraphDisplayOption Me.strGraphDisplayOption = "view_R_viewer" @@ -1119,14 +1036,7 @@ Public Class RLink RunScript(clsLastGraph.ToScript(), iCallType:=3, bAddOutputInViewer:=False, strComment:="View last graph", bSeparateThread:=False) 'restore the graph display option Me.strGraphDisplayOption = strGlobalGraphDisplayOption - Else - Dim clsViewObjectFunction As New RFunction - clsViewObjectFunction.SetRCommand("view_object") - clsViewObjectFunction.AddParameter(strParameterName:="object", clsRFunctionParameter:=clsLastGraph) - clsViewObjectFunction.AddParameter(strParameterName:="object_format", - strParameterValue:=Chr(34) & RObjectFormat.Image & Chr(34)) - RunScript(clsViewObjectFunction.ToScript(), bAddOutputInViewer:=False, strComment:="View last graph", bSeparateThread:=False) - End If + End Sub '''-------------------------------------------------------------------------------------------- diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 4af14c67edf..8b5d097826e 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2108,21 +2108,51 @@ Public Class frmMain End Sub Private Sub MnuLastGraph_ButtonClick(sender As Object, e As EventArgs) Handles mnuLastGraph.ButtonClick, mnuNormalViewer.Click - Me.Enabled = False - clsRLink.ViewLastGraph() - Me.Enabled = True + Dim clsLastGraph As New RFunction + clsLastGraph.SetRCommand(clsRLink.strInstatDataObject & "$get_last_object") + clsLastGraph.AddParameter("object_type_label", Chr(34) & RObjectTypeLabel.Graph & Chr(34), iPosition:=0) + + Dim clsViewObjectFunction As New RFunction + clsViewObjectFunction.SetRCommand("view_object") + clsViewObjectFunction.AddParameter("object", clsRFunctionParameter:=clsLastGraph) + clsViewObjectFunction.AddParameter("object_format", strParameterValue:=Chr(34) & RObjectFormat.Image & Chr(34)) + clsRLink.RunScript(clsLastGraph.ToScript(), strComment:="View last graph", bAddOutputInViewer:=False, bSeparateThread:=False) + End Sub Private Sub Mnuploty_Click(sender As Object, e As EventArgs) Handles mnuploty.Click - Me.Enabled = False - clsRLink.ViewLastGraph(bAsPlotly:=True) - Me.Enabled = True + Dim clsViewObjectFunction As New RFunction + Dim clsInteractivePlot As New RFunction + Dim clsLastGraph As New RFunction + + clsLastGraph.SetRCommand(clsRLink.strInstatDataObject & "$get_last_object") + clsLastGraph.AddParameter("object_type_label", strParameterValue:=Chr(34) & RObjectTypeLabel.Graph & Chr(34), iPosition:=0) + clsLastGraph.AddParameter("as_file", strParameterValue:="FALSE", iPosition:=1) + + clsInteractivePlot.SetPackageName("plotly") + clsInteractivePlot.SetRCommand("ggplotly") + clsInteractivePlot.AddParameter("p", clsRFunctionParameter:=clsLastGraph, iPosition:=0) + + clsViewObjectFunction.SetRCommand("view_object") + clsViewObjectFunction.AddParameter("object", clsRFunctionParameter:=clsInteractivePlot) + clsViewObjectFunction.AddParameter("object_format", strParameterValue:=Chr(34) & RObjectFormat.Html & Chr(34)) + + clsRLink.RunScript(clsViewObjectFunction.ToScript(), strComment:="View last graph as plotly", bAddOutputInViewer:=False, bSeparateThread:=False) + End Sub Private Sub MnuRViewer_Click(sender As Object, e As EventArgs) Handles mnuRViewer.Click - Me.Enabled = False - clsRLink.ViewLastGraph(bInRViewer:=True) - Me.Enabled = True + Dim clsLastGraph As New RFunction + Dim clsPrintGraph As New RFunction + clsLastGraph.SetRCommand(clsRLink.strInstatDataObject & "$get_last_object") + clsLastGraph.AddParameter("object_type_label", strParameterValue:=Chr(34) & RObjectTypeLabel.Graph & Chr(34), iPosition:=0) + clsLastGraph.AddParameter("as_file", strParameterValue:="FALSE", iPosition:=1) + + clsPrintGraph.SetRCommand("print") + clsPrintGraph.AddParameter("x", clsRFunctionParameter:=clsLastGraph, iPosition:=0) + + clsRLink.RunScript(clsPrintGraph.ToScript(), strComment:="View last graph in R viewer", bSeparateThread:=False) + End Sub Private Sub mnuModelFitModelOneVariable_Click(sender As Object, e As EventArgs) Handles mnuModelFitModelOneVariable.Click diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index b72654009d9..1151662b35d 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -660,7 +660,7 @@ DataBook$set("public", "get_objects", function(data_name, object_name, object_ty #returns NULL if object is not found #as explained in issue #7808 comments. New implementation is need to remove the internal parameter from the other "object" functions #if parameter internal is set to false, parameter object_type_label will have to be passed -#todo. parameter object_type_label and nternal can be removed as a parameter if all objects are saved in the same data book or structure +#todo. parameter object_type_label and internal can be removed as a parameter if all objects are saved in the same data book or structure DataBook$set("public", "get_object", function(data_name, object_name, object_type_label = "", as_file = TRUE, internal = TRUE) { if (!internal && identical(object_type_label,"graph") && exists(".graph_data_book")) { r_instant_object <- .graph_data_book$get_object(data_name = data_name, object_name = object_name, internal = TRUE) @@ -796,16 +796,27 @@ DataBook$set("public", "get_from_object", function(data_name, object_name, value } ) -DataBook$set("public", "get_last_graph", function(print_graph = TRUE, internal = FALSE) { - if (!internal && exists(".graph_data_book")) .graph_data_book$get_last_graph(print_graph = print_graph, internal = TRUE) - else { - if(!is.null(private$.last_graph) && length(private$.last_graph) == 2) { - graph_object <- self$get_object(data_name = private$.last_graph[1], object_name = private$.last_graph[2], as_file = FALSE) - if(print_graph){ - print(graph_object$object) - } - return(graph_object$object) +DataBook$set("public", "get_last_object", function(object_type_label, as_file = TRUE, internal = TRUE) { + if (!internal && exists(".graph_data_book")){ + return(.graph_data_book$get_last_object(object_type_label = object_type_label, as_file = as_file, internal = TRUE)) + }else { + r_instat_object <- NULL + if(object_type_label == "graph"){ + if(!is.null(private$.last_graph) && length(private$.last_graph) == 2) { + r_instat_object <- self$get_object(data_name = private$.last_graph[1], object_name = private$.last_graph[2], as_file = as_file) + } + }else{ + #todo. any other object type label } + + if(is.null(r_instat_object)){ + return() + }else if(as_file){ + return(r_instat_object) + }else{ + return(r_instat_object$object) + } + } } ) From 2eeb9f5952b007451fcf62448a4ade8f3f019dba Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Mon, 28 Nov 2022 13:08:17 +0100 Subject: [PATCH 31/52] Added random Sampling to probability keyboard in the calculator --- instat/ucrCalculator.Designer.vb | 268 +++++++++++++++++++++++++------ instat/ucrCalculator.vb | 97 +++++++++++ 2 files changed, 313 insertions(+), 52 deletions(-) diff --git a/instat/ucrCalculator.Designer.vb b/instat/ucrCalculator.Designer.vb index 23b1507838d..3a9e323a469 100644 --- a/instat/ucrCalculator.Designer.vb +++ b/instat/ucrCalculator.Designer.vb @@ -260,6 +260,13 @@ Partial Class ucrCalculator Me.cmdCos = New System.Windows.Forms.Button() Me.cmdSqrt = New System.Windows.Forms.Button() Me.grpSummary = New System.Windows.Forms.GroupBox() + Me.ContextMenuStripSummary = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.BaseToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() + Me.StatsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.StatipToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.E1071ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.RobustbaseToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.RasterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.grpFrequencies = New System.Windows.Forms.GroupBox() Me.cmdFreqQuantile = New System.Windows.Forms.Button() Me.cmdFreqPropn = New System.Windows.Forms.Button() @@ -470,13 +477,17 @@ Partial Class ucrCalculator Me.cmdbegin = New System.Windows.Forms.Button() Me.cmdAny1 = New System.Windows.Forms.Button() Me.cmdStringRHelp = New System.Windows.Forms.Button() - Me.ContextMenuStripSummary = New System.Windows.Forms.ContextMenuStrip(Me.components) - Me.BaseToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() - Me.StatsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.StatipToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.E1071ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.RobustbaseToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.RasterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.grpRandom = New System.Windows.Forms.GroupBox() + Me.cmdnbinomial = New System.Windows.Forms.Button() + Me.cmdRan_sample = New System.Windows.Forms.Button() + Me.cmdRan_beta = New System.Windows.Forms.Button() + Me.cmdRan_gamma = New System.Windows.Forms.Button() + Me.cmdpoisson = New System.Windows.Forms.Button() + Me.cmdbinomial = New System.Windows.Forms.Button() + Me.cmdbernouli = New System.Windows.Forms.Button() + Me.cmduni_integer = New System.Windows.Forms.Button() + Me.cmdRan_normal = New System.Windows.Forms.Button() + Me.cmduniform = New System.Windows.Forms.Button() Me.cmdSummaryRHelp = New instat.ucrSplitButton() Me.cmdIntegerRHelp = New instat.ucrSplitButton() Me.cmdTransformRHelp = New instat.ucrSplitButton() @@ -494,6 +505,7 @@ Partial Class ucrCalculator Me.grpWakefield.SuspendLayout() Me.grpMaths.SuspendLayout() Me.grpSummary.SuspendLayout() + Me.ContextMenuStripSummary.SuspendLayout() Me.grpFrequencies.SuspendLayout() Me.grpProbabilty.SuspendLayout() Me.grpTransform.SuspendLayout() @@ -503,7 +515,7 @@ Partial Class ucrCalculator Me.grpCircular.SuspendLayout() Me.grpModifier.SuspendLayout() Me.grpSymbols.SuspendLayout() - Me.ContextMenuStripSummary.SuspendLayout() + Me.grpRandom.SuspendLayout() Me.SuspendLayout() ' 'lblExpression @@ -3081,6 +3093,48 @@ Partial Class ucrCalculator Me.grpSummary.TabStop = False Me.grpSummary.Text = "Summary" ' + 'ContextMenuStripSummary + ' + Me.ContextMenuStripSummary.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BaseToolStripMenuItem1, Me.StatsToolStripMenuItem, Me.StatipToolStripMenuItem, Me.E1071ToolStripMenuItem, Me.RobustbaseToolStripMenuItem, Me.RasterToolStripMenuItem}) + Me.ContextMenuStripSummary.Name = "ContextMenuStripSummary" + Me.ContextMenuStripSummary.Size = New System.Drawing.Size(136, 136) + ' + 'BaseToolStripMenuItem1 + ' + Me.BaseToolStripMenuItem1.Name = "BaseToolStripMenuItem1" + Me.BaseToolStripMenuItem1.Size = New System.Drawing.Size(135, 22) + Me.BaseToolStripMenuItem1.Text = "Base" + ' + 'StatsToolStripMenuItem + ' + Me.StatsToolStripMenuItem.Name = "StatsToolStripMenuItem" + Me.StatsToolStripMenuItem.Size = New System.Drawing.Size(135, 22) + Me.StatsToolStripMenuItem.Text = "Stats" + ' + 'StatipToolStripMenuItem + ' + Me.StatipToolStripMenuItem.Name = "StatipToolStripMenuItem" + Me.StatipToolStripMenuItem.Size = New System.Drawing.Size(135, 22) + Me.StatipToolStripMenuItem.Text = "Statip" + ' + 'E1071ToolStripMenuItem + ' + Me.E1071ToolStripMenuItem.Name = "E1071ToolStripMenuItem" + Me.E1071ToolStripMenuItem.Size = New System.Drawing.Size(135, 22) + Me.E1071ToolStripMenuItem.Text = "e1071" + ' + 'RobustbaseToolStripMenuItem + ' + Me.RobustbaseToolStripMenuItem.Name = "RobustbaseToolStripMenuItem" + Me.RobustbaseToolStripMenuItem.Size = New System.Drawing.Size(135, 22) + Me.RobustbaseToolStripMenuItem.Text = "Robustbase" + ' + 'RasterToolStripMenuItem + ' + Me.RasterToolStripMenuItem.Name = "RasterToolStripMenuItem" + Me.RasterToolStripMenuItem.Size = New System.Drawing.Size(135, 22) + Me.RasterToolStripMenuItem.Text = "Raster" + ' 'grpFrequencies ' Me.grpFrequencies.Controls.Add(Me.cmdFreqQuantile) @@ -3608,6 +3662,7 @@ Partial Class ucrCalculator ' 'grpProbabilty ' + Me.grpProbabilty.Controls.Add(Me.grpRandom) Me.grpProbabilty.Controls.Add(Me.cmdProbRHelp) Me.grpProbabilty.Controls.Add(Me.cmdQnbin) Me.grpProbabilty.Controls.Add(Me.cmdQpois) @@ -3641,7 +3696,7 @@ Partial Class ucrCalculator Me.grpProbabilty.Controls.Add(Me.cmdDigamma) Me.grpProbabilty.Location = New System.Drawing.Point(434, 62) Me.grpProbabilty.Name = "grpProbabilty" - Me.grpProbabilty.Size = New System.Drawing.Size(316, 215) + Me.grpProbabilty.Size = New System.Drawing.Size(316, 307) Me.grpProbabilty.TabIndex = 187 Me.grpProbabilty.TabStop = False Me.grpProbabilty.Text = "Probability" @@ -5587,47 +5642,144 @@ Partial Class ucrCalculator Me.cmdStringRHelp.Text = "R Help" Me.cmdStringRHelp.UseVisualStyleBackColor = True ' - 'ContextMenuStripSummary - ' - Me.ContextMenuStripSummary.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BaseToolStripMenuItem1, Me.StatsToolStripMenuItem, Me.StatipToolStripMenuItem, Me.E1071ToolStripMenuItem, Me.RobustbaseToolStripMenuItem, Me.RasterToolStripMenuItem}) - Me.ContextMenuStripSummary.Name = "ContextMenuStripSummary" - Me.ContextMenuStripSummary.Size = New System.Drawing.Size(136, 136) - ' - 'BaseToolStripMenuItem1 - ' - Me.BaseToolStripMenuItem1.Name = "BaseToolStripMenuItem1" - Me.BaseToolStripMenuItem1.Size = New System.Drawing.Size(180, 22) - Me.BaseToolStripMenuItem1.Text = "Base" - ' - 'StatsToolStripMenuItem - ' - Me.StatsToolStripMenuItem.Name = "StatsToolStripMenuItem" - Me.StatsToolStripMenuItem.Size = New System.Drawing.Size(180, 22) - Me.StatsToolStripMenuItem.Text = "Stats" - ' - 'StatipToolStripMenuItem - ' - Me.StatipToolStripMenuItem.Name = "StatipToolStripMenuItem" - Me.StatipToolStripMenuItem.Size = New System.Drawing.Size(180, 22) - Me.StatipToolStripMenuItem.Text = "Statip" - ' - 'E1071ToolStripMenuItem - ' - Me.E1071ToolStripMenuItem.Name = "E1071ToolStripMenuItem" - Me.E1071ToolStripMenuItem.Size = New System.Drawing.Size(180, 22) - Me.E1071ToolStripMenuItem.Text = "e1071" - ' - 'RobustbaseToolStripMenuItem - ' - Me.RobustbaseToolStripMenuItem.Name = "RobustbaseToolStripMenuItem" - Me.RobustbaseToolStripMenuItem.Size = New System.Drawing.Size(180, 22) - Me.RobustbaseToolStripMenuItem.Text = "Robustbase" - ' - 'RasterToolStripMenuItem - ' - Me.RasterToolStripMenuItem.Name = "RasterToolStripMenuItem" - Me.RasterToolStripMenuItem.Size = New System.Drawing.Size(180, 22) - Me.RasterToolStripMenuItem.Text = "Raster" + 'grpRandom + ' + Me.grpRandom.Controls.Add(Me.cmdnbinomial) + Me.grpRandom.Controls.Add(Me.cmdRan_sample) + Me.grpRandom.Controls.Add(Me.cmdRan_beta) + Me.grpRandom.Controls.Add(Me.cmdRan_gamma) + Me.grpRandom.Controls.Add(Me.cmdpoisson) + Me.grpRandom.Controls.Add(Me.cmdbinomial) + Me.grpRandom.Controls.Add(Me.cmdbernouli) + Me.grpRandom.Controls.Add(Me.cmduni_integer) + Me.grpRandom.Controls.Add(Me.cmdRan_normal) + Me.grpRandom.Controls.Add(Me.cmduniform) + Me.grpRandom.Location = New System.Drawing.Point(4, 214) + Me.grpRandom.Name = "grpRandom" + Me.grpRandom.Size = New System.Drawing.Size(306, 84) + Me.grpRandom.TabIndex = 199 + Me.grpRandom.TabStop = False + Me.grpRandom.Text = "Random" + ' + 'cmdnbinomial + ' + Me.cmdnbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdnbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdnbinomial.Location = New System.Drawing.Point(116, 43) + Me.cmdnbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdnbinomial.Name = "cmdnbinomial" + Me.cmdnbinomial.Size = New System.Drawing.Size(72, 30) + Me.cmdnbinomial.TabIndex = 182 + Me.cmdnbinomial.Text = "nbinomial" + Me.cmdnbinomial.UseVisualStyleBackColor = True + ' + 'cmdRan_sample + ' + Me.cmdRan_sample.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_sample.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_sample.Location = New System.Drawing.Point(244, 43) + Me.cmdRan_sample.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_sample.Name = "cmdRan_sample" + Me.cmdRan_sample.Size = New System.Drawing.Size(57, 30) + Me.cmdRan_sample.TabIndex = 181 + Me.cmdRan_sample.Text = "sample" + Me.cmdRan_sample.UseVisualStyleBackColor = True + ' + 'cmdRan_beta + ' + Me.cmdRan_beta.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_beta.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_beta.Location = New System.Drawing.Point(188, 43) + Me.cmdRan_beta.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_beta.Name = "cmdRan_beta" + Me.cmdRan_beta.Size = New System.Drawing.Size(57, 30) + Me.cmdRan_beta.TabIndex = 180 + Me.cmdRan_beta.Text = "beta" + Me.cmdRan_beta.UseVisualStyleBackColor = True + ' + 'cmdRan_gamma + ' + Me.cmdRan_gamma.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_gamma.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_gamma.Location = New System.Drawing.Point(59, 43) + Me.cmdRan_gamma.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_gamma.Name = "cmdRan_gamma" + Me.cmdRan_gamma.Size = New System.Drawing.Size(58, 30) + Me.cmdRan_gamma.TabIndex = 179 + Me.cmdRan_gamma.Text = "gamma" + Me.cmdRan_gamma.UseVisualStyleBackColor = True + ' + 'cmdpoisson + ' + Me.cmdpoisson.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdpoisson.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdpoisson.Location = New System.Drawing.Point(3, 43) + Me.cmdpoisson.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdpoisson.Name = "cmdpoisson" + Me.cmdpoisson.Size = New System.Drawing.Size(57, 30) + Me.cmdpoisson.TabIndex = 177 + Me.cmdpoisson.Text = "poisson" + Me.cmdpoisson.UseVisualStyleBackColor = True + ' + 'cmdbinomial + ' + Me.cmdbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdbinomial.Location = New System.Drawing.Point(244, 14) + Me.cmdbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdbinomial.Name = "cmdbinomial" + Me.cmdbinomial.Size = New System.Drawing.Size(57, 30) + Me.cmdbinomial.TabIndex = 176 + Me.cmdbinomial.Text = "binomial" + Me.cmdbinomial.UseVisualStyleBackColor = True + ' + 'cmdbernouli + ' + Me.cmdbernouli.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdbernouli.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdbernouli.Location = New System.Drawing.Point(188, 14) + Me.cmdbernouli.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdbernouli.Name = "cmdbernouli" + Me.cmdbernouli.Size = New System.Drawing.Size(57, 30) + Me.cmdbernouli.TabIndex = 175 + Me.cmdbernouli.Text = "bernouli" + Me.cmdbernouli.UseVisualStyleBackColor = True + ' + 'cmduni_integer + ' + Me.cmduni_integer.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmduni_integer.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmduni_integer.Location = New System.Drawing.Point(116, 14) + Me.cmduni_integer.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmduni_integer.Name = "cmduni_integer" + Me.cmduni_integer.Size = New System.Drawing.Size(72, 30) + Me.cmduni_integer.TabIndex = 174 + Me.cmduni_integer.Text = "uni_integer" + Me.cmduni_integer.UseVisualStyleBackColor = True + ' + 'cmdRan_normal + ' + Me.cmdRan_normal.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_normal.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_normal.Location = New System.Drawing.Point(59, 14) + Me.cmdRan_normal.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_normal.Name = "cmdRan_normal" + Me.cmdRan_normal.Size = New System.Drawing.Size(58, 30) + Me.cmdRan_normal.TabIndex = 173 + Me.cmdRan_normal.Text = "normal" + Me.cmdRan_normal.UseVisualStyleBackColor = True + ' + 'cmduniform + ' + Me.cmduniform.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmduniform.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmduniform.Location = New System.Drawing.Point(3, 14) + Me.cmduniform.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmduniform.Name = "cmduniform" + Me.cmduniform.Size = New System.Drawing.Size(57, 30) + Me.cmduniform.TabIndex = 172 + Me.cmduniform.Text = "uniform" + Me.cmduniform.UseVisualStyleBackColor = True ' 'cmdSummaryRHelp ' @@ -5726,6 +5878,7 @@ Partial Class ucrCalculator Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True + Me.Controls.Add(Me.grpProbabilty) Me.Controls.Add(Me.grpSummary) Me.Controls.Add(Me.grpInteger) Me.Controls.Add(Me.grpTransform) @@ -5738,7 +5891,6 @@ Partial Class ucrCalculator Me.Controls.Add(Me.grpCircular) Me.Controls.Add(Me.grpTestString) Me.Controls.Add(Me.cmdWakefieldHelp) - Me.Controls.Add(Me.grpProbabilty) Me.Controls.Add(Me.cmdStringRHelp) Me.Controls.Add(Me.ucrSaveResultInto) Me.Controls.Add(Me.ucrTryCalculator) @@ -5763,6 +5915,7 @@ Partial Class ucrCalculator Me.grpMaths.ResumeLayout(False) Me.grpSummary.ResumeLayout(False) Me.grpSummary.PerformLayout() + Me.ContextMenuStripSummary.ResumeLayout(False) Me.grpFrequencies.ResumeLayout(False) Me.grpProbabilty.ResumeLayout(False) Me.grpTransform.ResumeLayout(False) @@ -5773,7 +5926,7 @@ Partial Class ucrCalculator Me.grpCircular.ResumeLayout(False) Me.grpModifier.ResumeLayout(False) Me.grpSymbols.ResumeLayout(False) - Me.ContextMenuStripSummary.ResumeLayout(False) + Me.grpRandom.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -6228,4 +6381,15 @@ Partial Class ucrCalculator Friend WithEvents E1071ToolStripMenuItem As ToolStripMenuItem Friend WithEvents RobustbaseToolStripMenuItem As ToolStripMenuItem Friend WithEvents RasterToolStripMenuItem As ToolStripMenuItem + Friend WithEvents grpRandom As GroupBox + Friend WithEvents cmdnbinomial As Button + Friend WithEvents cmdRan_sample As Button + Friend WithEvents cmdRan_beta As Button + Friend WithEvents cmdRan_gamma As Button + Friend WithEvents cmdpoisson As Button + Friend WithEvents cmdbinomial As Button + Friend WithEvents cmdbernouli As Button + Friend WithEvents cmduni_integer As Button + Friend WithEvents cmdRan_normal As Button + Friend WithEvents cmduniform As Button End Class diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index de9e18e1130..8503555a9eb 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -306,6 +306,18 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmdFreqSum, "complete the command by rep(d ,f) for data in variable called d and frequencies in f") ttCalculator.SetToolTip(cmdFreqVar, "complete the command by rep(d ,f) for data in variable called d and frequencies in f") + ttCalculator.SetToolTip(cmduniform, "Random sample from the uniform distribution between 0 & 1. Use say runif(n,5,10) to change the range") + ttCalculator.SetToolTip(cmdRan_normal, "Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd") + ttCalculator.SetToolTip(cmduni_integer, "Random integers between 1 and 5. Use say sample.int(3,n,TRUE,prob=c(6,3,1)) to sample 1 to 3 with defined probabilities.") + ttCalculator.SetToolTip(cmdbernouli, "Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.") + ttCalculator.SetToolTip(cmdbinomial, "Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions") + ttCalculator.SetToolTip(cmdpoisson, "Random Poisson sample with mean 1. Change the mean as required.") + ttCalculator.SetToolTip(cmdnbinomial, "Random geometric sample as given, i.e. number of failures before size=1 success. Change value of size (must remain positive) for other negative binomials.") + ttCalculator.SetToolTip(cmdRan_gamma, "Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square") + ttCalculator.SetToolTip(cmdRan_beta, "This special case is the uniform distribution between 0 and 1. Change shape1 > 0 and shape2 > 0 for different beta distributions.") + ttCalculator.SetToolTip(cmdRan_sample, "Random sample with replacement, from a given variable. Change replace to FALSE for a random permutation.") + + End Sub Public Sub Reset() @@ -4550,4 +4562,89 @@ Public Class ucrCalculator End If OpenHelpPage() End Sub + + Private Sub cmduniform_Click(sender As Object, e As EventArgs) Handles cmduniform.Click + Dim clsUniformFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsUniformFunction.SetRCommand("runif") + clsUniformFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsUniformFunction.ToScript, 0) + End Sub + + Private Sub cmdpoisson_Click(sender As Object, e As EventArgs) Handles cmdpoisson.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" rpois(n = , lamda = 1)", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rpois( , lamda = 1)", 1) + End If + End Sub + + Private Sub cmdRan_normal_Click(sender As Object, e As EventArgs) Handles cmdRan_normal.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" rnorm(n = )", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" rnorm()", 1) + End If + End Sub + + Private Sub cmduni_integer_Click(sender As Object, e As EventArgs) Handles cmduni_integer.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("sample.int(n = , size = 5, replace = TRUE)", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" sample.int( ,5,replace = TRUE)", 1) + End If + End Sub + + Private Sub cmdbernouli_Click(sender As Object, e As EventArgs) Handles cmdbernouli.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom(n = ,size = 1,prob = 0.5)", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom( ,1,prob=0.5)", 1) + End If + End Sub + + Private Sub cmdbinomial_Click(sender As Object, e As EventArgs) Handles cmdbinomial.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom(n = ,size = 3,prob = 0.5) ", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom( ,3,prob = 0.5) ", 1) + End If + End Sub + + Private Sub cmdnbinomial_Click(sender As Object, e As EventArgs) Handles cmdnbinomial.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rnbinom(n = ,size = 1,prob = 0.5)", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rnbinom( ,size = 1,prob = 0.5)", 1) + End If + End Sub + + Private Sub cmdRan_gamma_Click(sender As Object, e As EventArgs) Handles cmdRan_gamma.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rgamma(n = ,shape = 1,scale = 2) ", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rgamma( ,shape = 1,scale = 2) ", 1) + End If + End Sub + + Private Sub cmdRan_beta_Click(sender As Object, e As EventArgs) Handles cmdRan_beta.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbeta(n = ,shape1 = 1, shape2 = 1)", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbeta( ,shape1 = 1,shape2 = 1)", 1) + End If + End Sub + + Private Sub cmdRan_sample_Click(sender As Object, e As EventArgs) Handles cmdRan_sample.Click + If chkShowParameters.Checked Then + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("sample(size = ,n = ,replace=TRUE)", 1) + Else + ucrReceiverForCalculation.AddToReceiverAtCursorPosition("sample(size = , ,replace=TRUE)", 1) + End If + End Sub + End Class From 4218e4dce2a8ceae3718cedce804f2f08bec7de6 Mon Sep 17 00:00:00 2001 From: Sophie Date: Mon, 28 Nov 2022 14:22:45 +0100 Subject: [PATCH 32/52] minor code modification --- instat/dlgEvapotranspiration.vb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index 9910657fdc4..d19ef4ae5e3 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -85,11 +85,13 @@ Public Class dlgEvapotranspiration ucrReceiverHumidityMax.SetParameter(New RParameter("RHmax", 4)) ucrReceiverHumidityMax.SetParameterIsRFunction() - 'ucrReceiverHumidityMax.bAutoFill = True + ucrReceiverHumidityMax.SetClimaticType("hum_max") + ucrReceiverHumidityMax.bAutoFill = True ucrReceiverHumidityMin.SetParameter(New RParameter("RHmin", 5)) ucrReceiverHumidityMin.SetParameterIsRFunction() - 'ucrReceiverHumidityMin.bAutoFill = True + ucrReceiverHumidityMin.SetClimaticType("hum_min") + ucrReceiverHumidityMin.bAutoFill = True ucrReceiverWindSpeed.SetParameter(New RParameter("u2", 7)) ucrReceiverWindSpeed.SetParameterIsRFunction() From 760dda06443f9addd202269c7b150251cd840252 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 29 Nov 2022 10:20:12 +0300 Subject: [PATCH 33/52] added suggesions --- instat/UserControls/frmMaximiseOutput.vb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/instat/UserControls/frmMaximiseOutput.vb b/instat/UserControls/frmMaximiseOutput.vb index c038b553691..faee2d215eb 100644 --- a/instat/UserControls/frmMaximiseOutput.vb +++ b/instat/UserControls/frmMaximiseOutput.vb @@ -92,22 +92,18 @@ Public Class frmMaximiseOutput "*" & Path.GetFileNameWithoutExtension(_strDisplayedFileName) & "*") 'create the destination folder first - Dim destDir As String = Path.Combine(_strFileDestinationDirectory, + Dim strDestDir As String = Path.Combine(_strFileDestinationDirectory, Path.GetFileName(strFoundDirectory)) - If Not Directory.Exists(destDir) Then - Directory.CreateDirectory(destDir) + If Not Directory.Exists(strDestDir) Then + Directory.CreateDirectory(strDestDir) End If - My.Computer.FileSystem.CopyDirectory(strFoundDirectory, destDir, True) + My.Computer.FileSystem.CopyDirectory(strFoundDirectory, strDestDir, True) Next - 'then copy the html file - My.Computer.FileSystem.CopyFile(_strDisplayedFileName, dlgSaveFile.FileName, True) - Else - 'for other files like text, images, just copy the file - My.Computer.FileSystem.CopyFile(_strDisplayedFileName, dlgSaveFile.FileName, True) End If - End If - + 'then copy the file + My.Computer.FileSystem.CopyFile(_strDisplayedFileName, dlgSaveFile.FileName, True) + End If End Using End Sub From 3600b7e2708e150e3e129af1e96cdf88d3752ae3 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 29 Nov 2022 10:37:50 +0100 Subject: [PATCH 34/52] cosmetic changes --- instat/ucrCalculator.Designer.vb | 384 +++++++++++++++---------------- instat/ucrCalculator.vb | 4 +- 2 files changed, 194 insertions(+), 194 deletions(-) diff --git a/instat/ucrCalculator.Designer.vb b/instat/ucrCalculator.Designer.vb index 3a9e323a469..65e37100eed 100644 --- a/instat/ucrCalculator.Designer.vb +++ b/instat/ucrCalculator.Designer.vb @@ -112,6 +112,7 @@ Partial Class ucrCalculator Me.cmdGCD = New System.Windows.Forms.Button() Me.cmdGeneratePrimes = New System.Windows.Forms.Button() Me.cmdNthPrime = New System.Windows.Forms.Button() + Me.cmdIntegerRHelp = New instat.ucrSplitButton() Me.ContextMenuStripInteger = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.GmpToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.DescToolsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -260,6 +261,7 @@ Partial Class ucrCalculator Me.cmdCos = New System.Windows.Forms.Button() Me.cmdSqrt = New System.Windows.Forms.Button() Me.grpSummary = New System.Windows.Forms.GroupBox() + Me.cmdSummaryRHelp = New instat.ucrSplitButton() Me.ContextMenuStripSummary = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.BaseToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() Me.StatsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -312,6 +314,17 @@ Partial Class ucrCalculator Me.cmdSum = New System.Windows.Forms.Button() Me.cmdVar = New System.Windows.Forms.Button() Me.grpProbabilty = New System.Windows.Forms.GroupBox() + Me.grpRandom = New System.Windows.Forms.GroupBox() + Me.cmdnbinomial = New System.Windows.Forms.Button() + Me.cmdRan_sample = New System.Windows.Forms.Button() + Me.cmdRan_beta = New System.Windows.Forms.Button() + Me.cmdRan_gamma = New System.Windows.Forms.Button() + Me.cmdpoisson = New System.Windows.Forms.Button() + Me.cmdbinomial = New System.Windows.Forms.Button() + Me.cmdbernoulli = New System.Windows.Forms.Button() + Me.cmduni_integer = New System.Windows.Forms.Button() + Me.cmdRan_normal = New System.Windows.Forms.Button() + Me.cmduniform = New System.Windows.Forms.Button() Me.cmdProbRHelp = New System.Windows.Forms.Button() Me.cmdQnbin = New System.Windows.Forms.Button() Me.cmdQpois = New System.Windows.Forms.Button() @@ -344,6 +357,7 @@ Partial Class ucrCalculator Me.cmdBeta = New System.Windows.Forms.Button() Me.cmdDigamma = New System.Windows.Forms.Button() Me.grpTransform = New System.Windows.Forms.GroupBox() + Me.cmdTransformRHelp = New instat.ucrSplitButton() Me.ContextMenuStripTransform = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.BaseToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.DplyrToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -477,20 +491,6 @@ Partial Class ucrCalculator Me.cmdbegin = New System.Windows.Forms.Button() Me.cmdAny1 = New System.Windows.Forms.Button() Me.cmdStringRHelp = New System.Windows.Forms.Button() - Me.grpRandom = New System.Windows.Forms.GroupBox() - Me.cmdnbinomial = New System.Windows.Forms.Button() - Me.cmdRan_sample = New System.Windows.Forms.Button() - Me.cmdRan_beta = New System.Windows.Forms.Button() - Me.cmdRan_gamma = New System.Windows.Forms.Button() - Me.cmdpoisson = New System.Windows.Forms.Button() - Me.cmdbinomial = New System.Windows.Forms.Button() - Me.cmdbernouli = New System.Windows.Forms.Button() - Me.cmduni_integer = New System.Windows.Forms.Button() - Me.cmdRan_normal = New System.Windows.Forms.Button() - Me.cmduniform = New System.Windows.Forms.Button() - Me.cmdSummaryRHelp = New instat.ucrSplitButton() - Me.cmdIntegerRHelp = New instat.ucrSplitButton() - Me.cmdTransformRHelp = New instat.ucrSplitButton() Me.ucrSaveResultInto = New instat.ucrSave() Me.ucrTryCalculator = New instat.ucrTry() Me.ucrInputCalOptions = New instat.ucrInputComboBox() @@ -508,6 +508,7 @@ Partial Class ucrCalculator Me.ContextMenuStripSummary.SuspendLayout() Me.grpFrequencies.SuspendLayout() Me.grpProbabilty.SuspendLayout() + Me.grpRandom.SuspendLayout() Me.grpTransform.SuspendLayout() Me.ContextMenuStripTransform.SuspendLayout() Me.grpLogical.SuspendLayout() @@ -515,7 +516,6 @@ Partial Class ucrCalculator Me.grpCircular.SuspendLayout() Me.grpModifier.SuspendLayout() Me.grpSymbols.SuspendLayout() - Me.grpRandom.SuspendLayout() Me.SuspendLayout() ' 'lblExpression @@ -1370,6 +1370,18 @@ Partial Class ucrCalculator Me.cmdNthPrime.Text = "nth_prime" Me.cmdNthPrime.UseVisualStyleBackColor = True ' + 'cmdIntegerRHelp + ' + Me.cmdIntegerRHelp.AutoSize = True + Me.cmdIntegerRHelp.ContextMenuStrip = Me.ContextMenuStripInteger + Me.cmdIntegerRHelp.Location = New System.Drawing.Point(210, 289) + Me.cmdIntegerRHelp.Name = "cmdIntegerRHelp" + Me.cmdIntegerRHelp.Size = New System.Drawing.Size(91, 23) + Me.cmdIntegerRHelp.SplitMenuStrip = Me.ContextMenuStripInteger + Me.cmdIntegerRHelp.TabIndex = 16 + Me.cmdIntegerRHelp.Text = "R Help" + Me.cmdIntegerRHelp.UseVisualStyleBackColor = True + ' 'ContextMenuStripInteger ' Me.ContextMenuStripInteger.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.GmpToolStripMenuItem, Me.DescToolsToolStripMenuItem, Me.RutilsToolStripMenuItem, Me.PrimesToolStripMenuItem, Me.ZseqToolStripMenuItem, Me.UtilsToolStripMenuItem}) @@ -3093,6 +3105,18 @@ Partial Class ucrCalculator Me.grpSummary.TabStop = False Me.grpSummary.Text = "Summary" ' + 'cmdSummaryRHelp + ' + Me.cmdSummaryRHelp.AutoSize = True + Me.cmdSummaryRHelp.ContextMenuStrip = Me.ContextMenuStripSummary + Me.cmdSummaryRHelp.Location = New System.Drawing.Point(194, 164) + Me.cmdSummaryRHelp.Name = "cmdSummaryRHelp" + Me.cmdSummaryRHelp.Size = New System.Drawing.Size(91, 23) + Me.cmdSummaryRHelp.SplitMenuStrip = Me.ContextMenuStripSummary + Me.cmdSummaryRHelp.TabIndex = 185 + Me.cmdSummaryRHelp.Text = "R Help" + Me.cmdSummaryRHelp.UseVisualStyleBackColor = True + ' 'ContextMenuStripSummary ' Me.ContextMenuStripSummary.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BaseToolStripMenuItem1, Me.StatsToolStripMenuItem, Me.StatipToolStripMenuItem, Me.E1071ToolStripMenuItem, Me.RobustbaseToolStripMenuItem, Me.RasterToolStripMenuItem}) @@ -3701,6 +3725,145 @@ Partial Class ucrCalculator Me.grpProbabilty.TabStop = False Me.grpProbabilty.Text = "Probability" ' + 'grpRandom + ' + Me.grpRandom.Controls.Add(Me.cmdnbinomial) + Me.grpRandom.Controls.Add(Me.cmdRan_sample) + Me.grpRandom.Controls.Add(Me.cmdRan_beta) + Me.grpRandom.Controls.Add(Me.cmdRan_gamma) + Me.grpRandom.Controls.Add(Me.cmdpoisson) + Me.grpRandom.Controls.Add(Me.cmdbinomial) + Me.grpRandom.Controls.Add(Me.cmdbernoulli) + Me.grpRandom.Controls.Add(Me.cmduni_integer) + Me.grpRandom.Controls.Add(Me.cmdRan_normal) + Me.grpRandom.Controls.Add(Me.cmduniform) + Me.grpRandom.Location = New System.Drawing.Point(4, 214) + Me.grpRandom.Name = "grpRandom" + Me.grpRandom.Size = New System.Drawing.Size(306, 84) + Me.grpRandom.TabIndex = 199 + Me.grpRandom.TabStop = False + Me.grpRandom.Text = "Random" + ' + 'cmdnbinomial + ' + Me.cmdnbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdnbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdnbinomial.Location = New System.Drawing.Point(116, 43) + Me.cmdnbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdnbinomial.Name = "cmdnbinomial" + Me.cmdnbinomial.Size = New System.Drawing.Size(72, 30) + Me.cmdnbinomial.TabIndex = 182 + Me.cmdnbinomial.Text = "nbinomial" + Me.cmdnbinomial.UseVisualStyleBackColor = True + ' + 'cmdRan_sample + ' + Me.cmdRan_sample.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_sample.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_sample.Location = New System.Drawing.Point(244, 43) + Me.cmdRan_sample.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_sample.Name = "cmdRan_sample" + Me.cmdRan_sample.Size = New System.Drawing.Size(57, 30) + Me.cmdRan_sample.TabIndex = 181 + Me.cmdRan_sample.Text = "sample" + Me.cmdRan_sample.UseVisualStyleBackColor = True + ' + 'cmdRan_beta + ' + Me.cmdRan_beta.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_beta.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_beta.Location = New System.Drawing.Point(188, 43) + Me.cmdRan_beta.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_beta.Name = "cmdRan_beta" + Me.cmdRan_beta.Size = New System.Drawing.Size(57, 30) + Me.cmdRan_beta.TabIndex = 180 + Me.cmdRan_beta.Text = "beta" + Me.cmdRan_beta.UseVisualStyleBackColor = True + ' + 'cmdRan_gamma + ' + Me.cmdRan_gamma.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_gamma.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_gamma.Location = New System.Drawing.Point(59, 43) + Me.cmdRan_gamma.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_gamma.Name = "cmdRan_gamma" + Me.cmdRan_gamma.Size = New System.Drawing.Size(58, 30) + Me.cmdRan_gamma.TabIndex = 179 + Me.cmdRan_gamma.Text = "gamma" + Me.cmdRan_gamma.UseVisualStyleBackColor = True + ' + 'cmdpoisson + ' + Me.cmdpoisson.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdpoisson.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdpoisson.Location = New System.Drawing.Point(3, 43) + Me.cmdpoisson.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdpoisson.Name = "cmdpoisson" + Me.cmdpoisson.Size = New System.Drawing.Size(57, 30) + Me.cmdpoisson.TabIndex = 177 + Me.cmdpoisson.Text = "poisson" + Me.cmdpoisson.UseVisualStyleBackColor = True + ' + 'cmdbinomial + ' + Me.cmdbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdbinomial.Location = New System.Drawing.Point(244, 14) + Me.cmdbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdbinomial.Name = "cmdbinomial" + Me.cmdbinomial.Size = New System.Drawing.Size(57, 30) + Me.cmdbinomial.TabIndex = 176 + Me.cmdbinomial.Text = "binomial" + Me.cmdbinomial.UseVisualStyleBackColor = True + ' + 'cmdbernoulli + ' + Me.cmdbernoulli.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdbernoulli.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdbernoulli.Location = New System.Drawing.Point(188, 14) + Me.cmdbernoulli.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdbernoulli.Name = "cmdbernoulli" + Me.cmdbernoulli.Size = New System.Drawing.Size(57, 30) + Me.cmdbernoulli.TabIndex = 175 + Me.cmdbernoulli.Text = "bernoulli" + Me.cmdbernoulli.UseVisualStyleBackColor = True + ' + 'cmduni_integer + ' + Me.cmduni_integer.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmduni_integer.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmduni_integer.Location = New System.Drawing.Point(116, 14) + Me.cmduni_integer.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmduni_integer.Name = "cmduni_integer" + Me.cmduni_integer.Size = New System.Drawing.Size(72, 30) + Me.cmduni_integer.TabIndex = 174 + Me.cmduni_integer.Text = "uni_integer" + Me.cmduni_integer.UseVisualStyleBackColor = True + ' + 'cmdRan_normal + ' + Me.cmdRan_normal.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmdRan_normal.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmdRan_normal.Location = New System.Drawing.Point(59, 14) + Me.cmdRan_normal.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmdRan_normal.Name = "cmdRan_normal" + Me.cmdRan_normal.Size = New System.Drawing.Size(58, 30) + Me.cmdRan_normal.TabIndex = 173 + Me.cmdRan_normal.Text = "normal" + Me.cmdRan_normal.UseVisualStyleBackColor = True + ' + 'cmduniform + ' + Me.cmduniform.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) + Me.cmduniform.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.cmduniform.Location = New System.Drawing.Point(3, 14) + Me.cmduniform.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) + Me.cmduniform.Name = "cmduniform" + Me.cmduniform.Size = New System.Drawing.Size(57, 30) + Me.cmduniform.TabIndex = 172 + Me.cmduniform.Text = "uniform" + Me.cmduniform.UseVisualStyleBackColor = True + ' 'cmdProbRHelp ' Me.cmdProbRHelp.ImeMode = System.Windows.Forms.ImeMode.NoControl @@ -4110,6 +4273,18 @@ Partial Class ucrCalculator Me.grpTransform.TabStop = False Me.grpTransform.Text = "Transform" ' + 'cmdTransformRHelp + ' + Me.cmdTransformRHelp.AutoSize = True + Me.cmdTransformRHelp.ContextMenuStrip = Me.ContextMenuStripTransform + Me.cmdTransformRHelp.Location = New System.Drawing.Point(216, 195) + Me.cmdTransformRHelp.Name = "cmdTransformRHelp" + Me.cmdTransformRHelp.Size = New System.Drawing.Size(91, 23) + Me.cmdTransformRHelp.SplitMenuStrip = Me.ContextMenuStripTransform + Me.cmdTransformRHelp.TabIndex = 204 + Me.cmdTransformRHelp.Text = "R Help" + Me.cmdTransformRHelp.UseVisualStyleBackColor = True + ' 'ContextMenuStripTransform ' Me.ContextMenuStripTransform.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BaseToolStripMenuItem, Me.DplyrToolStripMenuItem, Me.ZooToolStripMenuItem}) @@ -5642,181 +5817,6 @@ Partial Class ucrCalculator Me.cmdStringRHelp.Text = "R Help" Me.cmdStringRHelp.UseVisualStyleBackColor = True ' - 'grpRandom - ' - Me.grpRandom.Controls.Add(Me.cmdnbinomial) - Me.grpRandom.Controls.Add(Me.cmdRan_sample) - Me.grpRandom.Controls.Add(Me.cmdRan_beta) - Me.grpRandom.Controls.Add(Me.cmdRan_gamma) - Me.grpRandom.Controls.Add(Me.cmdpoisson) - Me.grpRandom.Controls.Add(Me.cmdbinomial) - Me.grpRandom.Controls.Add(Me.cmdbernouli) - Me.grpRandom.Controls.Add(Me.cmduni_integer) - Me.grpRandom.Controls.Add(Me.cmdRan_normal) - Me.grpRandom.Controls.Add(Me.cmduniform) - Me.grpRandom.Location = New System.Drawing.Point(4, 214) - Me.grpRandom.Name = "grpRandom" - Me.grpRandom.Size = New System.Drawing.Size(306, 84) - Me.grpRandom.TabIndex = 199 - Me.grpRandom.TabStop = False - Me.grpRandom.Text = "Random" - ' - 'cmdnbinomial - ' - Me.cmdnbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdnbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdnbinomial.Location = New System.Drawing.Point(116, 43) - Me.cmdnbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdnbinomial.Name = "cmdnbinomial" - Me.cmdnbinomial.Size = New System.Drawing.Size(72, 30) - Me.cmdnbinomial.TabIndex = 182 - Me.cmdnbinomial.Text = "nbinomial" - Me.cmdnbinomial.UseVisualStyleBackColor = True - ' - 'cmdRan_sample - ' - Me.cmdRan_sample.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdRan_sample.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRan_sample.Location = New System.Drawing.Point(244, 43) - Me.cmdRan_sample.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdRan_sample.Name = "cmdRan_sample" - Me.cmdRan_sample.Size = New System.Drawing.Size(57, 30) - Me.cmdRan_sample.TabIndex = 181 - Me.cmdRan_sample.Text = "sample" - Me.cmdRan_sample.UseVisualStyleBackColor = True - ' - 'cmdRan_beta - ' - Me.cmdRan_beta.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdRan_beta.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRan_beta.Location = New System.Drawing.Point(188, 43) - Me.cmdRan_beta.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdRan_beta.Name = "cmdRan_beta" - Me.cmdRan_beta.Size = New System.Drawing.Size(57, 30) - Me.cmdRan_beta.TabIndex = 180 - Me.cmdRan_beta.Text = "beta" - Me.cmdRan_beta.UseVisualStyleBackColor = True - ' - 'cmdRan_gamma - ' - Me.cmdRan_gamma.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdRan_gamma.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRan_gamma.Location = New System.Drawing.Point(59, 43) - Me.cmdRan_gamma.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdRan_gamma.Name = "cmdRan_gamma" - Me.cmdRan_gamma.Size = New System.Drawing.Size(58, 30) - Me.cmdRan_gamma.TabIndex = 179 - Me.cmdRan_gamma.Text = "gamma" - Me.cmdRan_gamma.UseVisualStyleBackColor = True - ' - 'cmdpoisson - ' - Me.cmdpoisson.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdpoisson.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdpoisson.Location = New System.Drawing.Point(3, 43) - Me.cmdpoisson.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdpoisson.Name = "cmdpoisson" - Me.cmdpoisson.Size = New System.Drawing.Size(57, 30) - Me.cmdpoisson.TabIndex = 177 - Me.cmdpoisson.Text = "poisson" - Me.cmdpoisson.UseVisualStyleBackColor = True - ' - 'cmdbinomial - ' - Me.cmdbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdbinomial.Location = New System.Drawing.Point(244, 14) - Me.cmdbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdbinomial.Name = "cmdbinomial" - Me.cmdbinomial.Size = New System.Drawing.Size(57, 30) - Me.cmdbinomial.TabIndex = 176 - Me.cmdbinomial.Text = "binomial" - Me.cmdbinomial.UseVisualStyleBackColor = True - ' - 'cmdbernouli - ' - Me.cmdbernouli.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdbernouli.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdbernouli.Location = New System.Drawing.Point(188, 14) - Me.cmdbernouli.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdbernouli.Name = "cmdbernouli" - Me.cmdbernouli.Size = New System.Drawing.Size(57, 30) - Me.cmdbernouli.TabIndex = 175 - Me.cmdbernouli.Text = "bernouli" - Me.cmdbernouli.UseVisualStyleBackColor = True - ' - 'cmduni_integer - ' - Me.cmduni_integer.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmduni_integer.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmduni_integer.Location = New System.Drawing.Point(116, 14) - Me.cmduni_integer.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmduni_integer.Name = "cmduni_integer" - Me.cmduni_integer.Size = New System.Drawing.Size(72, 30) - Me.cmduni_integer.TabIndex = 174 - Me.cmduni_integer.Text = "uni_integer" - Me.cmduni_integer.UseVisualStyleBackColor = True - ' - 'cmdRan_normal - ' - Me.cmdRan_normal.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmdRan_normal.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRan_normal.Location = New System.Drawing.Point(59, 14) - Me.cmdRan_normal.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmdRan_normal.Name = "cmdRan_normal" - Me.cmdRan_normal.Size = New System.Drawing.Size(58, 30) - Me.cmdRan_normal.TabIndex = 173 - Me.cmdRan_normal.Text = "normal" - Me.cmdRan_normal.UseVisualStyleBackColor = True - ' - 'cmduniform - ' - Me.cmduniform.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) - Me.cmduniform.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmduniform.Location = New System.Drawing.Point(3, 14) - Me.cmduniform.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) - Me.cmduniform.Name = "cmduniform" - Me.cmduniform.Size = New System.Drawing.Size(57, 30) - Me.cmduniform.TabIndex = 172 - Me.cmduniform.Text = "uniform" - Me.cmduniform.UseVisualStyleBackColor = True - ' - 'cmdSummaryRHelp - ' - Me.cmdSummaryRHelp.AutoSize = True - Me.cmdSummaryRHelp.ContextMenuStrip = Me.ContextMenuStripSummary - Me.cmdSummaryRHelp.Location = New System.Drawing.Point(194, 164) - Me.cmdSummaryRHelp.Name = "cmdSummaryRHelp" - Me.cmdSummaryRHelp.Size = New System.Drawing.Size(91, 23) - Me.cmdSummaryRHelp.SplitMenuStrip = Me.ContextMenuStripSummary - Me.cmdSummaryRHelp.TabIndex = 185 - Me.cmdSummaryRHelp.Text = "R Help" - Me.cmdSummaryRHelp.UseVisualStyleBackColor = True - ' - 'cmdIntegerRHelp - ' - Me.cmdIntegerRHelp.AutoSize = True - Me.cmdIntegerRHelp.ContextMenuStrip = Me.ContextMenuStripInteger - Me.cmdIntegerRHelp.Location = New System.Drawing.Point(210, 289) - Me.cmdIntegerRHelp.Name = "cmdIntegerRHelp" - Me.cmdIntegerRHelp.Size = New System.Drawing.Size(91, 23) - Me.cmdIntegerRHelp.SplitMenuStrip = Me.ContextMenuStripInteger - Me.cmdIntegerRHelp.TabIndex = 16 - Me.cmdIntegerRHelp.Text = "R Help" - Me.cmdIntegerRHelp.UseVisualStyleBackColor = True - ' - 'cmdTransformRHelp - ' - Me.cmdTransformRHelp.AutoSize = True - Me.cmdTransformRHelp.ContextMenuStrip = Me.ContextMenuStripTransform - Me.cmdTransformRHelp.Location = New System.Drawing.Point(216, 195) - Me.cmdTransformRHelp.Name = "cmdTransformRHelp" - Me.cmdTransformRHelp.Size = New System.Drawing.Size(91, 23) - Me.cmdTransformRHelp.SplitMenuStrip = Me.ContextMenuStripTransform - Me.cmdTransformRHelp.TabIndex = 204 - Me.cmdTransformRHelp.Text = "R Help" - Me.cmdTransformRHelp.UseVisualStyleBackColor = True - ' 'ucrSaveResultInto ' Me.ucrSaveResultInto.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink @@ -5918,6 +5918,7 @@ Partial Class ucrCalculator Me.ContextMenuStripSummary.ResumeLayout(False) Me.grpFrequencies.ResumeLayout(False) Me.grpProbabilty.ResumeLayout(False) + Me.grpRandom.ResumeLayout(False) Me.grpTransform.ResumeLayout(False) Me.grpTransform.PerformLayout() Me.ContextMenuStripTransform.ResumeLayout(False) @@ -5926,7 +5927,6 @@ Partial Class ucrCalculator Me.grpCircular.ResumeLayout(False) Me.grpModifier.ResumeLayout(False) Me.grpSymbols.ResumeLayout(False) - Me.grpRandom.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -6388,7 +6388,7 @@ Partial Class ucrCalculator Friend WithEvents cmdRan_gamma As Button Friend WithEvents cmdpoisson As Button Friend WithEvents cmdbinomial As Button - Friend WithEvents cmdbernouli As Button + Friend WithEvents cmdbernoulli As Button Friend WithEvents cmduni_integer As Button Friend WithEvents cmdRan_normal As Button Friend WithEvents cmduniform As Button diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index 8503555a9eb..db9c5560199 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -309,7 +309,7 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmduniform, "Random sample from the uniform distribution between 0 & 1. Use say runif(n,5,10) to change the range") ttCalculator.SetToolTip(cmdRan_normal, "Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd") ttCalculator.SetToolTip(cmduni_integer, "Random integers between 1 and 5. Use say sample.int(3,n,TRUE,prob=c(6,3,1)) to sample 1 to 3 with defined probabilities.") - ttCalculator.SetToolTip(cmdbernouli, "Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.") + ttCalculator.SetToolTip(cmdbernoulli, "Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.") ttCalculator.SetToolTip(cmdbinomial, "Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions") ttCalculator.SetToolTip(cmdpoisson, "Random Poisson sample with mean 1. Change the mean as required.") ttCalculator.SetToolTip(cmdnbinomial, "Random geometric sample as given, i.e. number of failures before size=1 success. Change value of size (must remain positive) for other negative binomials.") @@ -4599,7 +4599,7 @@ Public Class ucrCalculator End If End Sub - Private Sub cmdbernouli_Click(sender As Object, e As EventArgs) Handles cmdbernouli.Click + Private Sub cmdbernouli_Click(sender As Object, e As EventArgs) Handles cmdbernoulli.Click If chkShowParameters.Checked Then ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom(n = ,size = 1,prob = 0.5)", 1) Else From 4753112a25ee07015b69419c61e46991dced8619 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 29 Nov 2022 10:40:12 +0100 Subject: [PATCH 35/52] changes --- instat/ucrCalculator.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index db9c5560199..54c576aadee 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -4599,7 +4599,7 @@ Public Class ucrCalculator End If End Sub - Private Sub cmdbernouli_Click(sender As Object, e As EventArgs) Handles cmdbernoulli.Click + Private Sub cmdbernoulli_Click(sender As Object, e As EventArgs) Handles cmdbernoulli.Click If chkShowParameters.Checked Then ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom(n = ,size = 1,prob = 0.5)", 1) Else From 022bc789b2e4eee846cf4f1c250e3e5b8626efb4 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 29 Nov 2022 12:53:26 +0100 Subject: [PATCH 36/52] Code changes --- instat/ucrCalculator.vb | 145 +++++++++++++++++++++++++++------------- 1 file changed, 99 insertions(+), 46 deletions(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index 54c576aadee..46877e9429f 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -4571,80 +4571,133 @@ Public Class ucrCalculator clsUniformFunction.SetRCommand("runif") clsUniformFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsUniformFunction.AddParameter("min", "0", iPosition:=1) + clsUniformFunction.AddParameter("max", "1", iPosition:=2) ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsUniformFunction.ToScript, 0) End Sub Private Sub cmdpoisson_Click(sender As Object, e As EventArgs) Handles cmdpoisson.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" rpois(n = , lamda = 1)", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rpois( , lamda = 1)", 1) - End If + Dim clsPoissonFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsPoissonFunction.SetRCommand("rpois") + clsPoissonFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsPoissonFunction.AddParameter("lamda", "1", iPosition:=1) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsPoissonFunction.ToScript, 0) End Sub Private Sub cmdRan_normal_Click(sender As Object, e As EventArgs) Handles cmdRan_normal.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" rnorm(n = )", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" rnorm()", 1) - End If + Dim clsNormalFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsNormalFunction.SetRCommand("rnorm") + clsNormalFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsNormalFunction.AddParameter("mean", "0", iPosition:=1) + clsNormalFunction.AddParameter("sd", "1", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsNormalFunction.ToScript, 0) End Sub Private Sub cmduni_integer_Click(sender As Object, e As EventArgs) Handles cmduni_integer.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("sample.int(n = , size = 5, replace = TRUE)", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition(" sample.int( ,5,replace = TRUE)", 1) - End If + Dim clsUnitegerFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsUnitegerFunction.SetRCommand("sample.int") + clsUnitegerFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsUnitegerFunction.AddParameter("size", "5", iPosition:=1) + clsUnitegerFunction.AddParameter("replace", "TRUE", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsUnitegerFunction.ToScript, 0) End Sub Private Sub cmdbernoulli_Click(sender As Object, e As EventArgs) Handles cmdbernoulli.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom(n = ,size = 1,prob = 0.5)", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom( ,1,prob=0.5)", 1) - End If + Dim clsBernoulliFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsBernoulliFunction.SetRCommand("rbinom") + clsBernoulliFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsBernoulliFunction.AddParameter("size", "1", iPosition:=1) + clsBernoulliFunction.AddParameter("prob", "0.5", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsBernoulliFunction.ToScript, 0) End Sub Private Sub cmdbinomial_Click(sender As Object, e As EventArgs) Handles cmdbinomial.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom(n = ,size = 3,prob = 0.5) ", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbinom( ,3,prob = 0.5) ", 1) - End If + Dim clsBinomialFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsBinomialFunction.SetRCommand("rbinom") + clsBinomialFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsBinomialFunction.AddParameter("size", "3", iPosition:=1) + clsBinomialFunction.AddParameter("prob", "0.5", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsBinomialFunction.ToScript, 0) End Sub Private Sub cmdnbinomial_Click(sender As Object, e As EventArgs) Handles cmdnbinomial.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rnbinom(n = ,size = 1,prob = 0.5)", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rnbinom( ,size = 1,prob = 0.5)", 1) - End If + Dim clsNbinomialFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsNbinomialFunction.SetRCommand("rnbinom") + clsNbinomialFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsNbinomialFunction.AddParameter("size", "1", iPosition:=1) + clsNbinomialFunction.AddParameter("prob", "0.5", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsNbinomialFunction.ToScript, 0) End Sub Private Sub cmdRan_gamma_Click(sender As Object, e As EventArgs) Handles cmdRan_gamma.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rgamma(n = ,shape = 1,scale = 2) ", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rgamma( ,shape = 1,scale = 2) ", 1) - End If + Dim clsGammaFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsGammaFunction.SetRCommand("rgamma") + clsGammaFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsGammaFunction.AddParameter("shape", "1", iPosition:=1) + clsGammaFunction.AddParameter("scale", "2", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsGammaFunction.ToScript, 0) End Sub Private Sub cmdRan_beta_Click(sender As Object, e As EventArgs) Handles cmdRan_beta.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbeta(n = ,shape1 = 1, shape2 = 1)", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("rbeta( ,shape1 = 1,shape2 = 1)", 1) - End If + Dim clsBetaFunction As New RFunction + + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsBetaFunction.SetRCommand("rbeta") + clsBetaFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsBetaFunction.AddParameter("shape1", "1", iPosition:=1) + clsBetaFunction.AddParameter("shape2", "1", iPosition:=2) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsBetaFunction.ToScript, 0) End Sub Private Sub cmdRan_sample_Click(sender As Object, e As EventArgs) Handles cmdRan_sample.Click - If chkShowParameters.Checked Then - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("sample(size = ,n = ,replace=TRUE)", 1) - Else - ucrReceiverForCalculation.AddToReceiverAtCursorPosition("sample(size = , ,replace=TRUE)", 1) - End If - End Sub + Dim clsSampleFunction As New RFunction + clsDataFunction.SetRCommand("nrow") + clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) + + clsSampleFunction.SetRCommand("sample") + clsSampleFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) + clsSampleFunction.AddParameter("replace", "TRUE", iPosition:=1) + + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsSampleFunction.ToScript, 0) + End Sub End Class From 040ea14b14d4990cf1ce130ebbe249d316051e64 Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Tue, 29 Nov 2022 11:54:47 +0000 Subject: [PATCH 37/52] Delete CNAME --- docs/CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 68887b1cb58..00000000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -r-instat.org \ No newline at end of file From bc124e1884dbecb280b12697b37fa8071df5d2bd Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Tue, 29 Nov 2022 11:54:53 +0000 Subject: [PATCH 38/52] Create CNAME --- docs/CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000000..68887b1cb58 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +r-instat.org \ No newline at end of file From 49e8d84360052cb003256031be4258545f240bc1 Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Tue, 29 Nov 2022 12:12:21 +0000 Subject: [PATCH 39/52] Delete CNAME --- docs/CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 68887b1cb58..00000000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -r-instat.org \ No newline at end of file From 854e29c490ce0a428afad532fd32536cc5bb704c Mon Sep 17 00:00:00 2001 From: Chris Marsh <84872334+ChrisMarsh82@users.noreply.github.com> Date: Tue, 29 Nov 2022 12:12:27 +0000 Subject: [PATCH 40/52] Create CNAME --- docs/CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000000..68887b1cb58 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +r-instat.org \ No newline at end of file From 5f3cf7cf12d4d82257a156093ecaddff4c0af864 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Tue, 29 Nov 2022 19:13:16 +0100 Subject: [PATCH 41/52] Design changes --- instat/ucrCalculator.Designer.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/ucrCalculator.Designer.vb b/instat/ucrCalculator.Designer.vb index 65e37100eed..02ebcac7755 100644 --- a/instat/ucrCalculator.Designer.vb +++ b/instat/ucrCalculator.Designer.vb @@ -3760,7 +3760,7 @@ Partial Class ucrCalculator ' Me.cmdRan_sample.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdRan_sample.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRan_sample.Location = New System.Drawing.Point(244, 43) + Me.cmdRan_sample.Location = New System.Drawing.Point(243, 43) Me.cmdRan_sample.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdRan_sample.Name = "cmdRan_sample" Me.cmdRan_sample.Size = New System.Drawing.Size(57, 30) @@ -3772,7 +3772,7 @@ Partial Class ucrCalculator ' Me.cmdRan_beta.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdRan_beta.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdRan_beta.Location = New System.Drawing.Point(188, 43) + Me.cmdRan_beta.Location = New System.Drawing.Point(187, 43) Me.cmdRan_beta.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdRan_beta.Name = "cmdRan_beta" Me.cmdRan_beta.Size = New System.Drawing.Size(57, 30) @@ -3808,7 +3808,7 @@ Partial Class ucrCalculator ' Me.cmdbinomial.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdbinomial.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdbinomial.Location = New System.Drawing.Point(244, 14) + Me.cmdbinomial.Location = New System.Drawing.Point(243, 14) Me.cmdbinomial.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdbinomial.Name = "cmdbinomial" Me.cmdbinomial.Size = New System.Drawing.Size(57, 30) @@ -3820,7 +3820,7 @@ Partial Class ucrCalculator ' Me.cmdbernoulli.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.cmdbernoulli.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdbernoulli.Location = New System.Drawing.Point(188, 14) + Me.cmdbernoulli.Location = New System.Drawing.Point(187, 14) Me.cmdbernoulli.Margin = New System.Windows.Forms.Padding(2, 3, 2, 3) Me.cmdbernoulli.Name = "cmdbernoulli" Me.cmdbernoulli.Size = New System.Drawing.Size(57, 30) From a472c6fa6f92953d4e8659ede628eb3abc3df442 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 30 Nov 2022 10:37:55 +0100 Subject: [PATCH 42/52] Code Changes --- instat/ucrCalculator.vb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index 46877e9429f..39b31210e63 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -4585,7 +4585,7 @@ Public Class ucrCalculator clsPoissonFunction.SetRCommand("rpois") clsPoissonFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) - clsPoissonFunction.AddParameter("lamda", "1", iPosition:=1) + clsPoissonFunction.AddParameter("lambda", "1", iPosition:=1) ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsPoissonFunction.ToScript, 0) End Sub @@ -4611,8 +4611,8 @@ Public Class ucrCalculator clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) clsUnitegerFunction.SetRCommand("sample.int") - clsUnitegerFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) - clsUnitegerFunction.AddParameter("size", "5", iPosition:=1) + clsUnitegerFunction.AddParameter("size", "5", iPosition:=0) + clsUnitegerFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=1) clsUnitegerFunction.AddParameter("replace", "TRUE", iPosition:=2) ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsUnitegerFunction.ToScript, 0) @@ -4695,8 +4695,9 @@ Public Class ucrCalculator clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) clsSampleFunction.SetRCommand("sample") - clsSampleFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=0) - clsSampleFunction.AddParameter("replace", "TRUE", iPosition:=1) + clsSampleFunction.AddParameter("size", "", iPosition:=0) + clsSampleFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=1) + clsSampleFunction.AddParameter("replace", "TRUE", iPosition:=2) ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsSampleFunction.ToScript, 0) End Sub From 8e6febdefd93207e4a2998b108487ec80147774a Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Wed, 30 Nov 2022 14:33:48 +0100 Subject: [PATCH 43/52] code Changes --- instat/ucrCalculator.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index 39b31210e63..ce8e139edb7 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -4611,8 +4611,8 @@ Public Class ucrCalculator clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) clsUnitegerFunction.SetRCommand("sample.int") - clsUnitegerFunction.AddParameter("size", "5", iPosition:=0) - clsUnitegerFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=1) + clsUnitegerFunction.AddParameter("n", "5", iPosition:=0) + clsUnitegerFunction.AddParameter("size", clsRFunctionParameter:=clsDataFunction, iPosition:=1) clsUnitegerFunction.AddParameter("replace", "TRUE", iPosition:=2) ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsUnitegerFunction.ToScript, 0) @@ -4695,8 +4695,8 @@ Public Class ucrCalculator clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) clsSampleFunction.SetRCommand("sample") - clsSampleFunction.AddParameter("size", "", iPosition:=0) - clsSampleFunction.AddParameter("n", clsRFunctionParameter:=clsDataFunction, iPosition:=1) + clsSampleFunction.AddParameter("n", "", iPosition:=0) + clsSampleFunction.AddParameter("size", clsRFunctionParameter:=clsDataFunction, iPosition:=1) clsSampleFunction.AddParameter("replace", "TRUE", iPosition:=2) ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsSampleFunction.ToScript, 0) From 6144f947f45a5799f84a7ef46c1a4775575e01d5 Mon Sep 17 00:00:00 2001 From: Derrick Agorhom <76208189+derekagorhom@users.noreply.github.com> Date: Thu, 1 Dec 2022 08:24:00 +0100 Subject: [PATCH 44/52] code changes --- instat/ucrCalculator.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index ce8e139edb7..ea27b65c4af 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -4695,10 +4695,10 @@ Public Class ucrCalculator clsDataFunction.AddParameter("x", ucrSelectorForCalculations.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, iPosition:=0) clsSampleFunction.SetRCommand("sample") - clsSampleFunction.AddParameter("n", "", iPosition:=0) + clsSampleFunction.AddParameter("x", " ", iPosition:=0) clsSampleFunction.AddParameter("size", clsRFunctionParameter:=clsDataFunction, iPosition:=1) clsSampleFunction.AddParameter("replace", "TRUE", iPosition:=2) - ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsSampleFunction.ToScript, 0) + ucrReceiverForCalculation.AddToReceiverAtCursorPosition(clsSampleFunction.ToScript, 36) End Sub End Class From b48c7d7bea383fccbf63fbab9a5690c3caa8b2a9 Mon Sep 17 00:00:00 2001 From: anastasia-mbithe Date: Thu, 1 Dec 2022 11:29:52 +0300 Subject: [PATCH 45/52] Added a new windows form for sdgSummaryThemes --- instat/instat.vbproj | 9 +++ instat/sdgSummaryThemes.Designer.vb | 41 ++++++++++ instat/sdgSummaryThemes.resx | 120 ++++++++++++++++++++++++++++ instat/sdgSummaryThemes.vb | 23 ++++++ 4 files changed, 193 insertions(+) create mode 100644 instat/sdgSummaryThemes.Designer.vb create mode 100644 instat/sdgSummaryThemes.resx create mode 100644 instat/sdgSummaryThemes.vb diff --git a/instat/instat.vbproj b/instat/instat.vbproj index f5070882585..72ba823f8a8 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -239,6 +239,12 @@ + + sdgSummaryThemes.vb + + + Form + frmMaximiseOutput.vb @@ -3075,6 +3081,9 @@ dlgThreeVariablePivotTable.vb + + sdgSummaryThemes.vb + frmMaximiseOutput.vb Designer diff --git a/instat/sdgSummaryThemes.Designer.vb b/instat/sdgSummaryThemes.Designer.vb new file mode 100644 index 00000000000..225ff102e01 --- /dev/null +++ b/instat/sdgSummaryThemes.Designer.vb @@ -0,0 +1,41 @@ + _ +Partial Class sdgSummaryThemes + 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() + ' + 'sdgSummaryThemes + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "sdgSummaryThemes" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "Themes" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/sdgSummaryThemes.resx b/instat/sdgSummaryThemes.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/sdgSummaryThemes.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/sdgSummaryThemes.vb b/instat/sdgSummaryThemes.vb new file mode 100644 index 00000000000..42235d690ee --- /dev/null +++ b/instat/sdgSummaryThemes.vb @@ -0,0 +1,23 @@ +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . + +Imports instat.Translations + +Public Class sdgSummaryThemes + Private Sub sdgSummaryThemes_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + End Sub +End Class \ No newline at end of file From 61c78468e3b203743c7963ff8aff5d1e80f856f9 Mon Sep 17 00:00:00 2001 From: lloyddewit <57253949+lloyddewit@users.noreply.github.com> Date: Thu, 1 Dec 2022 11:52:40 +0100 Subject: [PATCH 46/52] Update instat/ucrCalculator.vb --- instat/ucrCalculator.vb | 2 -- 1 file changed, 2 deletions(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index ea27b65c4af..e725907f8c5 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -316,8 +316,6 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmdRan_gamma, "Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square") ttCalculator.SetToolTip(cmdRan_beta, "This special case is the uniform distribution between 0 and 1. Change shape1 > 0 and shape2 > 0 for different beta distributions.") ttCalculator.SetToolTip(cmdRan_sample, "Random sample with replacement, from a given variable. Change replace to FALSE for a random permutation.") - - End Sub Public Sub Reset() From 9db735f0940b74b4c5f3e627dba2bb239373ffc7 Mon Sep 17 00:00:00 2001 From: lloyddewit <57253949+lloyddewit@users.noreply.github.com> Date: Thu, 1 Dec 2022 11:52:51 +0100 Subject: [PATCH 47/52] Update instat/ucrCalculator.vb --- instat/ucrCalculator.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index e725907f8c5..76e48baca47 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -307,13 +307,13 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmdFreqVar, "complete the command by rep(d ,f) for data in variable called d and frequencies in f") ttCalculator.SetToolTip(cmduniform, "Random sample from the uniform distribution between 0 & 1. Use say runif(n,5,10) to change the range") - ttCalculator.SetToolTip(cmdRan_normal, "Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd") + ttCalculator.SetToolTip(cmdRan_normal, "Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd.") ttCalculator.SetToolTip(cmduni_integer, "Random integers between 1 and 5. Use say sample.int(3,n,TRUE,prob=c(6,3,1)) to sample 1 to 3 with defined probabilities.") ttCalculator.SetToolTip(cmdbernoulli, "Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.") - ttCalculator.SetToolTip(cmdbinomial, "Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions") + ttCalculator.SetToolTip(cmdbinomial, "Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions".) ttCalculator.SetToolTip(cmdpoisson, "Random Poisson sample with mean 1. Change the mean as required.") ttCalculator.SetToolTip(cmdnbinomial, "Random geometric sample as given, i.e. number of failures before size=1 success. Change value of size (must remain positive) for other negative binomials.") - ttCalculator.SetToolTip(cmdRan_gamma, "Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square") + ttCalculator.SetToolTip(cmdRan_gamma, "Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square.") ttCalculator.SetToolTip(cmdRan_beta, "This special case is the uniform distribution between 0 and 1. Change shape1 > 0 and shape2 > 0 for different beta distributions.") ttCalculator.SetToolTip(cmdRan_sample, "Random sample with replacement, from a given variable. Change replace to FALSE for a random permutation.") End Sub From 6c8c09162818c73c9e0e07b9e1efe60414c0c432 Mon Sep 17 00:00:00 2001 From: lloyddewit Date: Thu, 1 Dec 2022 13:29:04 +0100 Subject: [PATCH 48/52] Fixed small build error --- instat/ucrCalculator.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/ucrCalculator.vb b/instat/ucrCalculator.vb index 76e48baca47..75f9749722d 100644 --- a/instat/ucrCalculator.vb +++ b/instat/ucrCalculator.vb @@ -310,7 +310,7 @@ Public Class ucrCalculator ttCalculator.SetToolTip(cmdRan_normal, "Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd.") ttCalculator.SetToolTip(cmduni_integer, "Random integers between 1 and 5. Use say sample.int(3,n,TRUE,prob=c(6,3,1)) to sample 1 to 3 with defined probabilities.") ttCalculator.SetToolTip(cmdbernoulli, "Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.") - ttCalculator.SetToolTip(cmdbinomial, "Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions".) + ttCalculator.SetToolTip(cmdbinomial, "Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions.") ttCalculator.SetToolTip(cmdpoisson, "Random Poisson sample with mean 1. Change the mean as required.") ttCalculator.SetToolTip(cmdnbinomial, "Random geometric sample as given, i.e. number of failures before size=1 success. Change value of size (must remain positive) for other negative binomials.") ttCalculator.SetToolTip(cmdRan_gamma, "Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square.") From a40a0884c5aae05cda64ce4c0bb1a496e74c1f7a Mon Sep 17 00:00:00 2001 From: Sophie Date: Thu, 1 Dec 2022 13:32:58 +0100 Subject: [PATCH 49/52] Minor code modification --- instat/dlgEvapotranspiration.vb | 72 ++++++++++++++------------------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index d19ef4ae5e3..5290d19973e 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -80,9 +80,6 @@ Public Class dlgEvapotranspiration ucrReceiverTmin.SetClimaticType("temp_min") ucrReceiverTmin.bAutoFill = True - ucrReceiverRadiation.SetParameter(New RParameter("Solar", 8, bNewIncludeArgumentName:=False)) - ucrReceiverRadiation.SetParameterIsRFunction() - ucrReceiverHumidityMax.SetParameter(New RParameter("RHmax", 4)) ucrReceiverHumidityMax.SetParameterIsRFunction() ucrReceiverHumidityMax.SetClimaticType("hum_max") @@ -150,7 +147,6 @@ Public Class dlgEvapotranspiration ucrPnlMethod.AddToLinkedControls(ucrInputSolar, {rdoPenmanMonteith}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethod.AddToLinkedControls(ucrInputMissingMethod, {rdoPenmanMonteith}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="monthly average") - 'ucrChkWind.SetLinkedDisplayControl(grpWindSpeed) ucrReceiverRadiation.SetLinkedDisplayControl(lblRadiation) ucrReceiverHumidityMax.SetLinkedDisplayControl(lblHumidityMax) ucrReceiverHumidityMin.SetLinkedDisplayControl(lblHumidityMin) @@ -229,7 +225,6 @@ Public Class dlgEvapotranspiration clsVarnamesVectorPM.AddParameter("Tmin", Chr(34) & "Tmin" & Chr(34), bIncludeArgumentName:=False) clsVarnamesVectorPM.AddParameter("RHmax", Chr(34) & "RHmax" & Chr(34), bIncludeArgumentName:=False) clsVarnamesVectorPM.AddParameter("RHmin", Chr(34) & "RHmin" & Chr(34), bIncludeArgumentName:=False) - 'clsVarnamesVectorPM.AddParameter("n", Chr(34) & "n" & Chr(34), bIncludeArgumentName:=False) clsVarnamesVectorHS.SetRCommand("c") @@ -290,8 +285,6 @@ Public Class dlgEvapotranspiration ucrChkWind.SetRCode(clsETPenmanMonteith, bReset) ucrNewColName.SetRCode(clsBaseOperator, bReset) ucrInputMissingMethod.SetRCode(clsReadInputs, bReset) - - ucrReceiverRadiation.SetRCode(clsDataFunctionPM, bReset) End Sub Private Sub TestOKEnabled() @@ -363,7 +356,6 @@ Public Class dlgEvapotranspiration Else clsBaseOperator.RemoveParameterByName("ET.HargreavesSamani") End If - End Sub Private Sub ucrReceiverWindSpeed_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverWindSpeed.ControlValueChanged, ucrChkWind.ControlValueChanged @@ -375,40 +367,36 @@ Public Class dlgEvapotranspiration End If End Sub - Private Sub ucrInputSolar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSolar.ControlValueChanged - If bRcodeSet Then - - - Select Case ucrInputSolar.GetText - Case "sunshine hours" - ucrReceiverRadiation.SetClimaticType("sunshine_hours") - ucrReceiverRadiation.bAutoFill = True - clsVarnamesVectorPM.AddParameter("n", Chr(34) & "n" & Chr(34), bIncludeArgumentName:=False) - clsDataFunctionPM.AddParameter("n", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) - clsVarnamesVectorPM.RemoveParameterByName("Rs") - clsVarnamesVectorPM.RemoveParameterByName("Cd") - clsDataFunctionPM.RemoveParameterByName("Rs") - clsDataFunctionPM.RemoveParameterByName("cd") - Case "radiation" - ucrReceiverRadiation.SetClimaticType("radiation") - ucrReceiverRadiation.bAutoFill = True - clsVarnamesVectorPM.AddParameter("Rs", Chr(34) & "Rs" & Chr(34), bIncludeArgumentName:=False) - clsDataFunctionPM.AddParameter("Rs", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) - clsVarnamesVectorPM.RemoveParameterByName("n") - clsVarnamesVectorPM.RemoveParameterByName("Cd") - clsDataFunctionPM.RemoveParameterByName("n") - clsDataFunctionPM.RemoveParameterByName("cd") - Case "cloud" - ucrReceiverRadiation.SetClimaticType("cloud_cover") - ucrReceiverRadiation.bAutoFill = True - clsVarnamesVectorPM.AddParameter("Cd", Chr(34) & "Cd" & Chr(34), bIncludeArgumentName:=False) - clsDataFunctionPM.AddParameter("Cd", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) - clsVarnamesVectorPM.RemoveParameterByName("n") - clsVarnamesVectorPM.RemoveParameterByName("Rs") - clsDataFunctionPM.RemoveParameterByName("n") - clsDataFunctionPM.RemoveParameterByName("Rs") - End Select - End If + Private Sub ucrInputSolar_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputSolar.ControlValueChanged, ucrReceiverRadiation.ControlValueChanged + Select Case ucrInputSolar.GetText + Case "sunshine hours" + ucrReceiverRadiation.SetClimaticType("sunshine_hours") + ucrReceiverRadiation.bAutoFill = True + clsVarnamesVectorPM.AddParameter("n", Chr(34) & "n" & Chr(34), bIncludeArgumentName:=False) + clsDataFunctionPM.AddParameter("n", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) + clsVarnamesVectorPM.RemoveParameterByName("Rs") + clsVarnamesVectorPM.RemoveParameterByName("Cd") + clsDataFunctionPM.RemoveParameterByName("Rs") + clsDataFunctionPM.RemoveParameterByName("cd") + Case "radiation" + ucrReceiverRadiation.SetClimaticType("radiation") + ucrReceiverRadiation.bAutoFill = True + clsVarnamesVectorPM.AddParameter("Rs", Chr(34) & "Rs" & Chr(34), bIncludeArgumentName:=False) + clsDataFunctionPM.AddParameter("Rs", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) + clsVarnamesVectorPM.RemoveParameterByName("n") + clsVarnamesVectorPM.RemoveParameterByName("Cd") + clsDataFunctionPM.RemoveParameterByName("n") + clsDataFunctionPM.RemoveParameterByName("cd") + Case "cloud" + ucrReceiverRadiation.SetClimaticType("cloud_cover") + ucrReceiverRadiation.bAutoFill = True + clsVarnamesVectorPM.AddParameter("Cd", Chr(34) & "Cd" & Chr(34), bIncludeArgumentName:=False) + clsDataFunctionPM.AddParameter("Cd", clsRFunctionParameter:=ucrReceiverRadiation.GetVariables(), iPosition:=6) + clsVarnamesVectorPM.RemoveParameterByName("n") + clsVarnamesVectorPM.RemoveParameterByName("Rs") + clsDataFunctionPM.RemoveParameterByName("n") + clsDataFunctionPM.RemoveParameterByName("Rs") + End Select End Sub Private Sub ucrPnlMethod_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethod.ControlContentsChanged, ucrNewColName.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverTmax.ControlContentsChanged, ucrReceiverTmin.ControlContentsChanged, ucrReceiverHumidityMax.ControlContentsChanged, ucrReceiverHumidityMin.ControlContentsChanged, ucrReceiverRadiation.ControlContentsChanged, ucrReceiverWindSpeed.ControlContentsChanged, ucrInputTimeStep.ControlContentsChanged, ucrChkWind.ControlContentsChanged, ucrChkWind.ControlContentsChanged TestOKEnabled() From 777730a1eb86fa39f6a090f66d7a61cfc86b5c48 Mon Sep 17 00:00:00 2001 From: lloyddewit <57253949+lloyddewit@users.noreply.github.com> Date: Thu, 1 Dec 2022 15:18:01 +0100 Subject: [PATCH 50/52] Update instat/sdgMissingOptionsEvapotranspiration.vb --- instat/sdgMissingOptionsEvapotranspiration.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/sdgMissingOptionsEvapotranspiration.vb b/instat/sdgMissingOptionsEvapotranspiration.vb index b863a1fcdc9..19373554b6f 100644 --- a/instat/sdgMissingOptionsEvapotranspiration.vb +++ b/instat/sdgMissingOptionsEvapotranspiration.vb @@ -4,7 +4,7 @@ ' This program is free software: you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation, either version 3 of the License, or -' (at your option) any later version. +' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of From bf097dc067967e64b3a6d4964283fd14da4a9de1 Mon Sep 17 00:00:00 2001 From: ChrisMarsh82 <84872334+ChrisMarsh82@users.noreply.github.com> Date: Thu, 1 Dec 2022 14:21:17 +0000 Subject: [PATCH 51/52] Removed white space to reset build checks --- instat/dlgEvapotranspiration.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/instat/dlgEvapotranspiration.vb b/instat/dlgEvapotranspiration.vb index 5290d19973e..f6aacfe15fd 100644 --- a/instat/dlgEvapotranspiration.vb +++ b/instat/dlgEvapotranspiration.vb @@ -13,7 +13,6 @@ ' ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . - Imports instat.Translations Public Class dlgEvapotranspiration From cc00e6dbd355b8639e51451f2a0d84ed91ec28cf Mon Sep 17 00:00:00 2001 From: ChrisMarsh82 <84872334+ChrisMarsh82@users.noreply.github.com> Date: Thu, 1 Dec 2022 21:18:58 +0000 Subject: [PATCH 52/52] updated r packages --- instat/clsRLink.vb | 2 +- .../static/InstatObject/R/InstallPackages.R | 351 ++++++++---------- instat/static/InstatObject/R/Rsetup.R | 351 ++++++++---------- 3 files changed, 293 insertions(+), 411 deletions(-) diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index aad5d6a8ac7..94ecf356ab4 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -152,7 +152,7 @@ Public Class RLink Private strRVersionRequired As String = strRVersionMajorRequired & "." & strRVersionMinorRequired & ".0" ''' The R bundled version. - Private strRBundledVersion As String = "4.1.2" + Private strRBundledVersion As String = "4.1.3" Private clsOutputLogger As clsOutputLogger diff --git a/instat/static/InstatObject/R/InstallPackages.R b/instat/static/InstatObject/R/InstallPackages.R index 18f88c3eaf5..9f3799c1420 100644 --- a/instat/static/InstatObject/R/InstallPackages.R +++ b/instat/static/InstatObject/R/InstallPackages.R @@ -1,211 +1,152 @@ # Packages including dependencies # Generated from install_packages.R, do not edit manually! -packs <- c("abind", "agricolae", "agridat", - "AlgDesign", "animation", "arrangements", "ash", - "askpass", "assertthat", "automap", "backports", - "base64enc", "bayestestR", "BH", "bit", - "bit64", "bitops", "boot", "brew", "brio", - "broom", "bslib", "cachem", "callr", - "candisc", "car", "carData", "caret", - "cellranger", "changepoint", "checkmate", "chillR", - "chron", "circlize", "CircStats", "circular", - "class", "classInt", "cli", "clifro", - "climdex.pcic", "clipr", "clue", "cluster", - "cmsaf", "cmsafops", "cmsafvis", "codetools", - "colorRamps", "colorspace", "colourpicker", - "combinat", "commonmark", "corrplot", "corrr", - "countrycode", "cowplot", "cpp11", "crayon", - "credentials", "crosstalk", "curl", "DAAG", - "dae", "data.table", "datawizard", "date", - "DBI", "dendextend", "DEoptimR", "desc", - "DescTools", "devtools", "diffobj", "digest", - "distillery", "dotCall64", "dplyr", "dslabs", - "DT", "e1071", "ecmwfr", "effectsize", - "ellipse", "ellipsis", "emmeans", "EnvStats", - "estimability", "evaluate", "Evapotranspiration", - "Exact", "expm", "extraDistr", "extrafont", - "extrafontdb", "extRemes", "factoextra", "FactoMineR", - "fansi", "faraway", "farver", "fastDummies", - "fastmap", "fields", "filelock", "fitdistrplus", - "flashClust", "FNN", "fontawesome", "forcats", - "foreach", "forecast", "foreign", "formula.tools", - "Formula", "fracdiff", "fs", "future.apply", - "future", "gapminder", "gclus", "gcookbook", - "generics", "GenSA", "geosphere", "gert", - "getPass", "GGally", "ggalt", "ggdendro", - "ggeffects", "ggfittext", "ggforce", "ggformula", - "ggfortify", "ggmosaic", "ggplot2", "ggplotify", - "ggpmisc", "ggpp", "ggpubr", "ggrepel", - "ggridges", "ggsci", "ggsignif", "ggstance", - "ggtext", "ggthemes", "ggwordcloud", "gh", - "gitcreds", "gld", "GlobalOptions", "globals", - "glue", "gmp", "goftest", "gower", "gridExtra", - "gridGraphics", "gridtext", "gstat", "gtable", - "hardhat", "haven", "heplots", "hexbin", - "highr", "HistData", "Hmisc", "hms", - "htmlTable", "htmltools", "htmlwidgets", "httpuv", - "httr", "hunspell", "hydroGOF", "hydroTSM", - "imputeTS", "ini", "insight", "intervals", - "ipred", "isoband", "iterators", "janeaustenr", - "janitor", "jpeg", "jquerylib", "jsonlite", - "Kendall", "KernSmooth", "keyring", "klaR", - "knitr", "labeling", "labelled", "Lahman", - "later", "lattice", "latticeExtra", "lava", - "lazyeval", "leaflet.providers", "leaflet", - "leaps", "lemon", "lifecycle", "listenv", - "lme4", "lmodel2", "lmom", "lmomco", - "Lmoments", "lmtest", "lubridate", "magick", - "magrittr", "mapdata", "mapproj", "maps", - "maptools", "markdown", "MASS", "Matrix", - "MatrixModels", "mc2d", "memoise", "metR", - "mgcv", "mime", "miniUI", "minqa", "MKdescr", - "MKinfer", "mlbench", "ModelMetrics", "modelr", - "mosaic", "mosaicCore", "mosaicData", "munsell", - "mvtnorm", "ncdf4.helpers", "ncdf4", "nlme", - "nloptr", "nnet", "nortest", "numDeriv", - "nycflights13", "openair", "openssl", "openxlsx", - "operator.tools", "parallelly", "parameters", - "patchwork", "pbkrtest", "pbs", "PCICt", - "performance", "pillar", "pkgbuild", "pkgconfig", - "pkgload", "plotly", "plotrix", "pls", - "plyr", "png", "polyclip", "polynom", - "praise", "prettyunits", "pROC", "processx", - "prodlim", "productplots", "progress", "progressr", - "proj4", "promises", "proxy", "ps", "purrr", - "qap", "quadprog", "quantmod", "quantreg", - "questionr", "R.cache", "R.methodsS3", "R.oo", - "R.utils", "R6", "rainfarmr", "rappdirs", - "raster", "rasterVis", "rbibutils", "rcmdcheck", - "RColorBrewer", "rcorpora", "Rcpp", "RcppArmadillo", - "RcppEigen", "RcppRoll", "RCurl", "Rdpack", - "readODS", "readr", "readxl", "recipes", - "registry", "rematch", "rematch2", "remotes", - "repr", "reshape", "reshape2", "rgdal", - "rio", "rje", "rlang", "RMAWGEN", "RMySQL", - "robustbase", "rootSolve", "roxygen2", "rpart", - "rpivotTable", "rprojroot", "rrefine", "rstatix", - "rstudioapi", "rtf", "Rttf2pt1", "rversions", - "rvest", "rworldmap", "rworldxtra", "s2", - "sandwich", "sass", "scales", "scatterplot3d", - "SearchTrees", "selectr", "seriation", "sessioninfo", - "sf", "shades", "shape", "shiny", "shinyFiles", - "shinyjs", "shinythemes", "shinyWidgets", "signmedian.test", - "sjlabelled", "sjmisc", "sjPlot", "sjstats", - "skimr", "snakecase", "SnowballC", "sodium", - "sourcetools", "sp", "spacetime", "spam", - "SparseM", "SPEI", "splines2", "splus2R", - "SQUAREM", "statip", "stinepack", "stringdist", - "stringi", "stringr", "strucchange", "styler", - "survival", "svglite", "sys", "systemfonts", - "terra", "testthat", "texmex", "tibble", - "tidyr", "tidyselect", "tidytext", "timeDate", - "tokenizers", "treemapify", "trend", "tseries", - "TSP", "TTR", "tweenr", "tzdb", "units", - "urca", "usethis", "utf8", "vars", "vctrs", - "viridis", "viridisLite", "visdat", "visreg", - "vroom", "wakefield", "waldo", "weathermetrics", - "whisker", "withr", "wk", "xfun", "XML", - "xml2", "xopen", "xtable", "xts", "yaml", - "yulab.utils", "zip", "zoo", "zyp") +packs <- c("abind", "agricolae", "agridat", "AlgDesign", "animation", + "anytime", "arrangements", "ash", "askpass", "assertthat", "automap", + "backports", "base64enc", "bayestestR", "BH", "bit", "bit64", + "bitops", "boot", "brew", "brio", "broom", "bslib", "ca", "cachem", + "callr", "candisc", "car", "carData", "caret", "cellranger", + "changepoint", "checkmate", "chillR", "chron", "circlize", "CircStats", + "circular", "class", "classInt", "cli", "clifro", "climdex.pcic", + "clipr", "clock", "clue", "cluster", "cmsaf", "cmsafops", "cmsafvis", + "codetools", "coin", "colorRamps", "colorspace", "colourpicker", + "combinat", "commonmark", "confintr", "corrplot", "corrr", "countrycode", + "cowplot", "cpp11", "crayon", "credentials", "crosstalk", "curl", + "DAAG", "dae", "data.table", "datawizard", "date", "DBI", "deldir", + "dendextend", "DEoptimR", "desc", "DescTools", "devtools", "diffobj", + "digest", "distillery", "dotCall64", "downlit", "dplyr", "dslabs", + "DT", "e1071", "ecmwfr", "effectsize", "ellipse", "ellipsis", + "emmeans", "EnvStats", "estimability", "evaluate", "Evapotranspiration", + "Exact", "exactRankTests", "expm", "extraDistr", "extrafont", + "extrafontdb", "extRemes", "factoextra", "FactoMineR", "fansi", + "faraway", "farver", "fastDummies", "fastmap", "fields", "filelock", + "fitdistrplus", "flashClust", "FNN", "fontawesome", "forcats", + "foreach", "forecast", "foreign", "formula.tools", "Formula", + "fracdiff", "fs", "future.apply", "future", "gapminder", "gclus", + "gcookbook", "generics", "GenSA", "geosphere", "gert", "getPass", + "GGally", "ggalt", "ggdendro", "ggeffects", "ggfittext", "ggforce", + "ggformula", "ggfortify", "ggmosaic", "ggplot2", "ggplotify", + "ggpmisc", "ggpp", "ggpubr", "ggrepel", "ggridges", "ggsci", + "ggsignif", "ggstance", "ggtext", "ggthemes", "ggwordcloud", + "gh", "gitcreds", "gld", "GlobalOptions", "globals", "glue", + "gmp", "gnm", "goftest", "gower", "gridExtra", "gridGraphics", + "gridtext", "gstat", "gtable", "hardhat", "haven", "heplots", + "hexbin", "highr", "HistData", "Hmisc", "hms", "htmlTable", "htmltools", + "htmlwidgets", "httpuv", "httr", "hunspell", "hydroGOF", "hydroTSM", + "imputeTS", "ini", "insight", "interp", "intervals", "ipred", + "isoband", "iterators", "janeaustenr", "janitor", "jpeg", "jquerylib", + "jsonlite", "Kendall", "KernSmooth", "keyring", "klaR", "knitr", + "labeling", "labelled", "Lahman", "later", "lattice", "latticeExtra", + "lava", "lazyeval", "leaflet.providers", "leaflet", "leaps", + "lemon", "libcoin", "lifecycle", "listenv", "lme4", "lmodel2", + "lmom", "lmomco", "Lmoments", "lmtest", "lubridate", "lwgeom", + "magick", "magrittr", "mapdata", "mapproj", "maps", "maptools", + "markdown", "MASS", "Matrix", "MatrixModels", "matrixStats", + "mc2d", "memoise", "metR", "mgcv", "mime", "miniUI", "minqa", + "MKdescr", "MKinfer", "mlbench", "ModelMetrics", "modelr", "modeltools", + "mosaic", "mosaicCore", "mosaicData", "multcomp", "multcompView", + "munsell", "mvtnorm", "ncdf4.helpers", "ncdf4", "nlme", "nloptr", + "nnet", "nortest", "numDeriv", "nycflights13", "openair", "openssl", + "openxlsx", "operator.tools", "parallelly", "parameters", "patchwork", + "pbkrtest", "pbs", "PCICt", "performance", "pillar", "pingr", + "pkgbuild", "pkgconfig", "pkgdown", "pkgload", "plotly", "plotrix", + "pls", "plyr", "png", "polyclip", "polynom", "praise", "prettyunits", + "pROC", "processx", "prodlim", "productplots", "profvis", "progress", + "progressr", "proj4", "promises", "proxy", "ps", "purrr", "qap", + "quadprog", "quantmod", "quantreg", "questionr", "qvcalc", "R.cache", + "R.methodsS3", "R.oo", "R.utils", "R6", "ragg", "rainfarmr", + "rappdirs", "raster", "rasterVis", "rbibutils", "rcmdcheck", + "RColorBrewer", "rcorpora", "Rcpp", "RcppArmadillo", "RcppEigen", + "RcppRoll", "RCurl", "Rdpack", "readODS", "readr", "readxl", + "recipes", "registry", "relimp", "rematch", "rematch2", "remotes", + "repr", "reshape", "reshape2", "rgdal", "rio", "rje", "rlang", + "rmarkdown", "RMAWGEN", "RMySQL", "robustbase", "rootSolve", + "roxygen2", "rpart", "rpivotTable", "rprojroot", "rrefine", "rstatix", + "rstudioapi", "rtf", "Rttf2pt1", "rversions", "rvest", "rworldmap", + "rworldxtra", "s2", "sandwich", "sass", "scales", "scatterplot3d", + "SearchTrees", "selectr", "seriation", "sessioninfo", "sf", "sftime", + "shades", "shape", "shiny", "shinyFiles", "shinyjs", "shinythemes", + "shinyWidgets", "signmedian.test", "sjlabelled", "sjmisc", "sjPlot", + "sjstats", "skimr", "snakecase", "SnowballC", "sodium", "sourcetools", + "sp", "spacetime", "spam", "SparseM", "SPEI", "splines2", "splus2R", + "SQUAREM", "stars", "statip", "stinepack", "stringdist", "stringi", + "stringr", "strucchange", "styler", "survival", "svglite", "sys", + "systemfonts", "terra", "testthat", "texmex", "textshaping", + "TH.data", "tibble", "tidyr", "tidyselect", "tidytext", "timechange", + "timeDate", "tinytex", "tokenizers", "treemapify", "trend", "tseries", + "TSP", "TTR", "tweenr", "tzdb", "units", "urca", "urlchecker", + "usethis", "utf8", "vars", "vcd", "vcdExtra", "vctrs", "viridis", + "viridisLite", "visdat", "visreg", "vroom", "wakefield", "waldo", + "weathermetrics", "whisker", "withr", "wk", "xfun", "XML", "xml2", + "xopen", "xtable", "xts", "yaml", "yulab.utils", "zip", "zoo", + "zyp") -versions <- c("1.4-5", "1.3-5", "1.20", "1.2.1", - "2.7", "1.1.9", "1.0-15", "1.1", "0.2.1", - "1.0-16", "1.4.1", "0.1-3", "0.12.1", - "1.78.0-0", "4.0.4", "4.0.5", "1.0-7", - "1.3-28", "1.0-7", "1.1.3", "0.8.0", - "0.3.1", "1.0.6", "3.7.0", "0.8-6", "3.0-13", - "3.0-5", "6.0-92", "1.1.0", "2.2.3", - "2.1.0", "0.72.7", "2.3-57", "0.4.15", - "0.2-6", "0.4-95", "7.3-20", "0.4-7", - "3.3.0", "3.2-5", "1.1-11", "0.8.0", - "0.3-61", "2.1.3", "3.4.2", "1.2.4", - "1.1.11", "0.2-18", "2.3.1", "2.0-3", - "1.1.1", "0.0-8", "1.8.0", "0.92", "0.4.3", - "1.4.0", "1.1.1", "0.4.2", "1.5.1", "1.3.2", - "1.2.0", "4.3.2", "1.25.3", "3.2-13", - "1.14.2", "0.4.1", "1.2-39", "1.1.2", - "1.15.2", "1.0-11", "1.4.1", "0.99.45", - "2.4.3", "0.3.5", "0.6.29", "1.2-1", - "1.0-1", "1.0.9", "0.7.4", "0.23", "1.7-11", - "1.3.0", "0.7.0", "0.4.3", "0.3.2", "1.7.4-1", - "2.7.0", "1.3", "0.15", "1.16", "3.1", - "0.999-6", "1.9.1", "0.18", "1.0", "2.1-2", - "1.0.7", "2.4", "1.0.3", "1.0.7", "2.1.0", - "1.6.3", "1.1.0", "13.3", "1.0.2", "1.1-8", - "1.01-2", "1.1.3.1", "0.2.2", "0.5.1", - "1.5.2", "8.16", "0.8-82", "1.7.1", "1.2-4", - "1.5-1", "1.5.2", "1.9.0", "1.26.1", - "0.3.0", "1.3.2", "2.0", "0.1.2", "1.1.7", - "1.5-14", "1.6.0", "0.2-2", "2.1.2", - "0.4.0", "0.1.23", "1.1.2", "0.9.1", - "0.3.3", "0.10.1", "0.4.14", "0.3.3", - "3.3.6", "0.1.0", "0.4.6", "0.4.4", "0.4.0", - "0.9.1", "0.5.3", "2.9", "0.6.3", "0.3.5", - "0.1.1", "4.2.4", "0.5.0", "1.3.0", "0.1.1", - "2.6.4", "0.1.2", "0.15.0", "1.6.2", - "0.6-5", "1.2-3", "1.0.0", "2.3", "0.5-1", - "0.1.4", "2.0-9", "0.3.0", "1.1.0", "2.5.0", - "1.3-9", "1.28.2", "0.9", "0.8-7", "4.7-0", - "1.1.1", "2.4.0", "0.5.2", "1.5.4", "1.6.5", - "1.4.3", "3.0.1", "0.4-0", "0.6-0", "3.2", - "0.3.1", "0.17.1", "0.15.2", "0.9-13", - "0.2.5", "1.0.14", "0.1.5", "2.1.0", - "0.1-9", "0.1.4", "1.8.0", "2.2.1", "2.23-20", - "1.3.0", "1.7-0", "1.39", "0.4.2", "2.9.1", - "10.0-1", "1.3.0", "0.20-45", "0.6-29", - "1.6.10", "0.2.2", "1.9.0", "2.1.1", - "3.1", "0.4.5", "1.0.1", "0.8.0", "1.1-29", - "1.7-3", "2.9", "2.3.7", "1.3-1", "0.9-40", - "1.8.0", "2.7.3", "2.0.3", "2.3.0", "1.2.8", - "3.4.0", "1.1-4", "1.1", "7.3-57", "1.4-1", - "0.5-0", "0.1-21", "2.0.1", "0.12.0", - "1.8-40", "0.12", "0.1.1.1", "1.2.4", - "0.7", "0.6", "2.1-3", "1.2.2.2", "0.1.8", - "1.8.3", "0.9.0", "0.20.2", "0.5.0", - "1.1-3", "0.3-6", "1.19", "3.1-157", - "2.0.3", "7.3-17", "1.0-4", "2016.8-1.1", - "1.0.2", "2.9-1", "2.0.2", "4.2.5", "1.6.3", - "1.32.0", "0.18.1", "1.1.1", "0.5.1", - "1.1", "0.5-4.1", "0.9.0", "1.7.0", "1.3.1", - "2.0.3", "1.2.4", "4.10.0", "3.8-2", - "2.8-0", "1.8.7", "0.1-7", "1.10-0", - "1.4-1", "1.0.0", "1.1.1", "1.18.0", - "3.6.0", "2019.11.13", "0.1.1", "1.2.2", - "0.10.1", "1.0-11", "1.2.0.1", "0.4-27", - "1.7.0", "0.3.4", "0.1-1", "1.5-8", "0.4.20", - "5.93", "0.7.7", "0.15.0", "1.8.1", "1.25.0", - "2.11.0", "2.5.1", "0.1", "0.3.3", "3.5-15", - "0.51.2", "2.2.8", "1.4.0", "1.1-3", - "2.0.0", "1.0.8.3", "0.11.1.1.0", "0.3.3.9.2", - "0.3.0", "1.98-1.7", "2.3.1", "1.7.0", - "2.1.2", "1.4.0", "0.2.0", "0.5-1", "1.0.1", - "2.1.2", "2.4.2", "1.1.4", "0.8.9", "1.4.4", - "1.5-32", "0.5.29", "1.11.0", "1.0.2", - "1.3.7", "0.10.23", "0.95-0", "1.8.2.3", - "7.2.0", "4.1.16", "0.3.0", "2.0.3", - "2.0.0", "0.7.0", "0.13", "0.4-14.1", - "1.3.10", "2.1.1", "1.0.2", "1.3-6", - "1.01", "1.0.7", "3.0-1", "0.4.1", "1.2.0", - "0.3-41", "0.5.3", "0.4-2", "1.3.5", - "1.2.2", "1.0-7", "1.4.0", "1.4.6", "1.7.1", - "0.9.2", "2.1.0", "1.2.0", "0.7.0", "1.5.1", - "1.2.0", "2.8.9", "2.8.10", "0.18.1", - "2.1.4", "0.11.0", "0.7.0", "1.2.1", - "0.1.7", "1.5-0", "1.2-7", "2.8-0", "1.81", - "1.7", "0.4.5", "1.3-3", "2021.1", "0.2.3", - "1.4", "0.9.8", "1.7.6", "1.4.0", "1.5-2", - "1.7.0", "3.3-1", "2.1.0", "3.4", "1.0.4", - "1.5-34", "3.1.4", "2.4.8", "3.1.7", - "1.2.0", "1.1.2", "0.3.3", "3043.102", - "0.2.1", "2.5.5", "1.1.4", "0.10-51", - "1.2-0", "0.24.3", "1.0.2", "0.3.0", - "0.8-0", "1.3-0", "2.1.6", "1.2.2", "1.5-6", - "0.4.1", "0.6.2", "0.4.0", "0.5.3", "2.7.0", - "1.5.7", "0.3.6", "0.4.0", "1.2.2", "0.4", - "2.5.0", "0.6.0", "0.31", "3.99-0.10", - "1.3.3", "1.0.0", "1.8-4", "0.12.1", - "2.3.5", "0.0.4", "2.2.0", "1.8-10", - "0.10-1.1") +versions <- c("1.4-5", "1.3-5", "1.21", "1.2.1", "2.7", "0.3.9", + "1.1.9", "1.0-15", "1.1", "0.2.1", "1.0-16", "1.4.1", "0.1-3", + "0.13.0", "1.78.0-0", "4.0.5", "4.0.5", "1.0-7", "1.3-28.1", + "1.0-8", "1.1.3", "1.0.1", "0.4.1", "0.71.1", "1.0.6", "3.7.3", + "0.8-6", "3.1-1", "3.0-5", "6.0-93", "1.1.0", "2.2.4", "2.1.0", + "0.72.8", "2.3-58", "0.4.15", "0.2-6", "0.4-95", "7.3-20", "0.4-8", + "3.4.1", "3.2-5", "1.1-11", "0.8.0", "0.6.1", "0.3-63", "2.1.4", + "3.4.4", "1.2.6", "1.1.12", "0.2-18", "1.4-2", "2.3.1", "2.0-3", + "1.2.0", "0.0-8", "1.8.1", "0.2.0", "0.92", "0.4.4", "1.4.0", + "1.1.1", "0.4.3", "1.5.2", "1.3.2", "1.2.0", "4.3.3", "1.25.4", + "3.2-13", "1.14.6", "0.6.4", "1.2-40", "1.1.3", "1.0-6", "1.16.0", + "1.0-11", "1.4.2", "0.99.47", "2.4.4", "0.3.5", "0.6.30", "1.2-1", + "1.0-2", "0.4.2", "1.0.10", "0.7.4", "0.26", "1.7-12", "1.4.0", + "0.8.2", "0.4.3", "0.3.2", "1.8.2", "2.7.0", "1.4.1", "0.18", + "1.16", "3.2", "0.8-35", "0.999-6", "1.9.1", "0.18", "1.0", "2.1-3", + "1.0.7", "2.6", "1.0.3", "1.0.8", "2.1.1", "1.6.3", "1.1.0", + "14.1", "1.0.2", "1.1-8", "1.01-2", "1.1.3.1", "0.4.0", "0.5.2", + "1.5.2", "8.19", "0.8-83", "1.7.1", "1.2-4", "1.5-2", "1.5.2", + "1.10.0", "1.29.0", "0.3.0", "1.3.2", "2.0", "0.1.3", "1.1.7", + "1.5-18", "1.9.1", "0.2-2", "2.1.2", "0.4.0", "0.1.23", "1.1.4", + "0.9.1", "0.4.1", "0.10.2", "0.4.15", "0.3.3", "3.4.0", "0.1.0", + "0.5.1", "0.4.5", "0.5.0", "0.9.2", "0.5.4", "2.9", "0.6.4", + "0.3.6", "0.1.2", "4.2.4", "0.5.0", "1.3.1", "0.1.2", "2.6.6", + "0.1.2", "0.16.2", "1.6.2", "0.6-8", "1.1-2", "1.2-3", "1.0.0", + "2.3", "0.5-1", "0.1.5", "2.1-0", "0.3.1", "1.2.0", "2.5.1", + "1.4-2", "1.28.2", "0.9", "0.8-7", "4.7-2", "1.1.2", "2.4.1", + "0.5.3", "1.5.4", "1.6.6", "1.4.4", "3.0.2", "0.4-0", "0.6-0", + "3.3", "0.3.1", "0.18.8", "1.1-3", "0.15.2", "0.9-13", "0.2.6", + "1.0.14", "1.0.0", "2.1.0", "0.1-10", "0.1.4", "1.8.3", "2.2.1", + "2.23-20", "1.3.1", "1.7-1", "1.41", "0.4.2", "2.10.0", "10.0-1", + "1.3.0", "0.20-45", "0.6-30", "1.7.0", "0.2.2", "1.9.0", "2.1.1", + "3.1", "0.4.5", "1.0-9", "1.0.3", "0.8.0", "1.1-31", "1.7-3", + "2.9", "2.4.7", "1.3-1", "0.9-40", "1.9.0", "0.2-10", "2.7.3", + "2.0.3", "2.3.1", "1.2.9", "3.4.1", "1.1-5", "1.4", "7.3-58.1", + "1.5-3", "0.5-1", "0.63.0", "0.1-22", "2.0.1", "0.13.0", "1.8-41", + "0.12", "0.1.1.1", "1.2.5", "0.8", "0.9", "2.1-3", "1.2.2.2", + "0.1.10", "0.2-23", "1.8.4.2", "0.9.2.1", "0.20.3", "1.4-20", + "0.1-8", "0.5.0", "1.1-3", "0.3-6", "1.19", "3.1-160", "2.0.3", + "7.3-18", "1.0-4", "2016.8-1.1", "1.0.2", "2.12", "2.0.4", "4.2.5.1", + "1.6.3", "1.32.1", "0.20.0", "1.1.2", "0.5.1", "1.1", "0.5-4.3", + "0.10.1", "1.8.1", "2.0.2", "1.4.0", "2.0.3", "2.0.6", "1.3.2", + "4.10.1", "3.8-2", "2.8-1", "1.8.8", "0.1-8", "1.10-4", "1.4-1", + "1.0.0", "1.1.1", "1.18.0", "3.8.0", "2019.11.13", "0.1.1", "0.3.7", + "1.2.2", "0.11.0", "1.0-12", "1.2.0.1", "0.4-27", "1.7.2", "0.3.5", + "0.1-2", "1.5-8", "0.4.20", "5.94", "0.7.7", "1.0.2", "0.16.0", + "1.8.2", "1.25.0", "2.12.2", "2.5.1", "1.2.4", "0.1", "0.3.3", + "3.6-11", "0.51.4", "2.2.10", "1.4.0", "1.1-3", "2.0.0", "1.0.9", + "0.11.4.2.1", "0.3.3.9.3", "0.3.0", "1.98-1.9", "2.4", "1.7.0", + "2.1.3", "1.4.1", "1.0.3", "0.5-1", "1.0-5", "1.0.1", "2.1.2", + "2.4.2", "1.1.4", "0.8.9", "1.4.4", "1.5-32", "0.5.29", "1.12.1", + "1.0.6", "2.18", "1.3.7", "0.10.24", "0.95-0", "1.8.2.3", "7.2.2", + "4.1.19", "0.3.0", "2.0.3", "2.1.0", "0.7.1", "0.14", "0.4-14.1", + "1.3.11", "2.1.2", "1.0.3", "1.3-6", "1.01", "1.1.1", "3.0-2", + "0.4.4", "1.2.1", "0.3-42", "0.5.5", "0.4-2", "1.4.0", "1.2.2", + "1.0-9", "0.2-0", "1.4.0", "1.4.6", "1.7.3", "0.9.3", "2.1.0", + "1.2.0", "0.7.5", "1.5.1", "1.2.0", "2.8.9", "2.8.12", "0.18.2", + "2.1.4", "0.11.0", "0.7.0", "1.2.1", "0.1.7", "1.5-1", "1.2-8", + "2.9-1", "1.81", "1.7", "0.4.6", "1.3-3", "2021.1", "0.6-0", + "0.2.3", "1.4", "0.9.10", "1.7.6", "1.4.1", "1.5-3", "1.8.1", + "3.4-0", "2.1.0", "3.4.1", "1.0.4", "1.6-41", "3.1.5", "2.4.8", + "0.3.6", "1.1-1", "3.1.8", "1.2.1", "1.2.0", "0.3.4", "0.1.1", + "4021.106", "0.42", "0.2.3", "2.5.5", "1.1.4", "0.10-52", "1.2-1", + "0.24.3", "2.0.2", "0.3.0", "0.8-0", "1.3-3", "1.0.1", "2.1.6", + "1.2.2", "1.5-6", "1.4-10", "0.8-0", "0.5.1", "0.6.2", "0.4.1", + "0.5.3", "2.7.0", "1.6.0", "0.3.6", "0.4.0", "1.2.2", "0.4", + "2.5.0", "0.7.0", "0.35", "3.99-0.12", "1.3.3", "1.0.0", "1.8-4", + "0.12.2", "2.3.6", "0.0.5", "2.2.2", "1.8-11", "0.10-1.1") ################################################## diff --git a/instat/static/InstatObject/R/Rsetup.R b/instat/static/InstatObject/R/Rsetup.R index 5525e365604..4d06a48fae0 100644 --- a/instat/static/InstatObject/R/Rsetup.R +++ b/instat/static/InstatObject/R/Rsetup.R @@ -1,214 +1,155 @@ # Packages including dependencies # Generated from install_packages.R, do not edit manually! -packs <- c("abind", "agricolae", "agridat", - "AlgDesign", "animation", "arrangements", "ash", - "askpass", "assertthat", "automap", "backports", - "base64enc", "bayestestR", "BH", "bit", - "bit64", "bitops", "boot", "brew", "brio", - "broom", "bslib", "cachem", "callr", - "candisc", "car", "carData", "caret", - "cellranger", "changepoint", "checkmate", "chillR", - "chron", "circlize", "CircStats", "circular", - "class", "classInt", "cli", "clifro", - "climdex.pcic", "clipr", "clue", "cluster", - "cmsaf", "cmsafops", "cmsafvis", "codetools", - "colorRamps", "colorspace", "colourpicker", - "combinat", "commonmark", "corrplot", "corrr", - "countrycode", "cowplot", "cpp11", "crayon", - "credentials", "crosstalk", "curl", "DAAG", - "dae", "data.table", "datawizard", "date", - "DBI", "dendextend", "DEoptimR", "desc", - "DescTools", "devtools", "diffobj", "digest", - "distillery", "dotCall64", "dplyr", "dslabs", - "DT", "e1071", "ecmwfr", "effectsize", - "ellipse", "ellipsis", "emmeans", "EnvStats", - "estimability", "evaluate", "Evapotranspiration", - "Exact", "expm", "extraDistr", "extrafont", - "extrafontdb", "extRemes", "factoextra", "FactoMineR", - "fansi", "faraway", "farver", "fastDummies", - "fastmap", "fields", "filelock", "fitdistrplus", - "flashClust", "FNN", "fontawesome", "forcats", - "foreach", "forecast", "foreign", "formula.tools", - "Formula", "fracdiff", "fs", "future.apply", - "future", "gapminder", "gclus", "gcookbook", - "generics", "GenSA", "geosphere", "gert", - "getPass", "GGally", "ggalt", "ggdendro", - "ggeffects", "ggfittext", "ggforce", "ggformula", - "ggfortify", "ggmosaic", "ggplot2", "ggplotify", - "ggpmisc", "ggpp", "ggpubr", "ggrepel", - "ggridges", "ggsci", "ggsignif", "ggstance", - "ggtext", "ggthemes", "ggwordcloud", "gh", - "gitcreds", "gld", "GlobalOptions", "globals", - "glue", "gmp", "goftest", "gower", "gridExtra", - "gridGraphics", "gridtext", "gstat", "gtable", - "hardhat", "haven", "heplots", "hexbin", - "highr", "HistData", "Hmisc", "hms", - "htmlTable", "htmltools", "htmlwidgets", "httpuv", - "httr", "hunspell", "hydroGOF", "hydroTSM", - "imputeTS", "ini", "insight", "intervals", - "ipred", "isoband", "iterators", "janeaustenr", - "janitor", "jpeg", "jquerylib", "jsonlite", - "Kendall", "KernSmooth", "keyring", "klaR", - "knitr", "labeling", "labelled", "Lahman", - "later", "lattice", "latticeExtra", "lava", - "lazyeval", "leaflet.providers", "leaflet", - "leaps", "lemon", "lifecycle", "listenv", - "lme4", "lmodel2", "lmom", "lmomco", - "Lmoments", "lmtest", "lubridate", "magick", - "magrittr", "mapdata", "mapproj", "maps", - "maptools", "markdown", "MASS", "Matrix", - "MatrixModels", "mc2d", "memoise", "metR", - "mgcv", "mime", "miniUI", "minqa", "MKdescr", - "MKinfer", "mlbench", "ModelMetrics", "modelr", - "mosaic", "mosaicCore", "mosaicData", "munsell", - "mvtnorm", "ncdf4.helpers", "ncdf4", "nlme", - "nloptr", "nnet", "nortest", "numDeriv", - "nycflights13", "openair", "openssl", "openxlsx", - "operator.tools", "parallelly", "parameters", - "patchwork", "pbkrtest", "pbs", "PCICt", - "performance", "pillar", "pkgbuild", "pkgconfig", - "pkgload", "plotly", "plotrix", "pls", - "plyr", "png", "polyclip", "polynom", - "praise", "prettyunits", "pROC", "processx", - "prodlim", "productplots", "progress", "progressr", - "proj4", "promises", "proxy", "ps", "purrr", - "qap", "quadprog", "quantmod", "quantreg", - "questionr", "R.cache", "R.methodsS3", "R.oo", - "R.utils", "R6", "rainfarmr", "rappdirs", - "raster", "rasterVis", "rbibutils", "rcmdcheck", - "RColorBrewer", "rcorpora", "Rcpp", "RcppArmadillo", - "RcppEigen", "RcppRoll", "RCurl", "Rdpack", - "readODS", "readr", "readxl", "recipes", - "registry", "rematch", "rematch2", "remotes", - "repr", "reshape", "reshape2", "rgdal", - "rio", "rje", "rlang", "RMAWGEN", "RMySQL", - "robustbase", "rootSolve", "roxygen2", "rpart", - "rpivotTable", "rprojroot", "rrefine", "rstatix", - "rstudioapi", "rtf", "Rttf2pt1", "rversions", - "rvest", "rworldmap", "rworldxtra", "s2", - "sandwich", "sass", "scales", "scatterplot3d", - "SearchTrees", "selectr", "seriation", "sessioninfo", - "sf", "shades", "shape", "shiny", "shinyFiles", - "shinyjs", "shinythemes", "shinyWidgets", "signmedian.test", - "sjlabelled", "sjmisc", "sjPlot", "sjstats", - "skimr", "snakecase", "SnowballC", "sodium", - "sourcetools", "sp", "spacetime", "spam", - "SparseM", "SPEI", "splines2", "splus2R", - "SQUAREM", "statip", "stinepack", "stringdist", - "stringi", "stringr", "strucchange", "styler", - "survival", "svglite", "sys", "systemfonts", - "terra", "testthat", "texmex", "tibble", - "tidyr", "tidyselect", "tidytext", "timeDate", - "tokenizers", "treemapify", "trend", "tseries", - "TSP", "TTR", "tweenr", "tzdb", "units", - "urca", "usethis", "utf8", "vars", "vctrs", - "viridis", "viridisLite", "visdat", "visreg", - "vroom", "wakefield", "waldo", "weathermetrics", - "whisker", "withr", "wk", "xfun", "XML", - "xml2", "xopen", "xtable", "xts", "yaml", - "yulab.utils", "zip", "zoo", "zyp", +packs <- c("abind", "agricolae", "agridat", "AlgDesign", "animation", + "anytime", "arrangements", "ash", "askpass", "assertthat", "automap", + "backports", "base64enc", "bayestestR", "BH", "bit", "bit64", + "bitops", "boot", "brew", "brio", "broom", "bslib", "ca", "cachem", + "callr", "candisc", "car", "carData", "caret", "cellranger", + "changepoint", "checkmate", "chillR", "chron", "circlize", "CircStats", + "circular", "class", "classInt", "cli", "clifro", "climdex.pcic", + "clipr", "clock", "clue", "cluster", "cmsaf", "cmsafops", "cmsafvis", + "codetools", "coin", "colorRamps", "colorspace", "colourpicker", + "combinat", "commonmark", "confintr", "corrplot", "corrr", "countrycode", + "cowplot", "cpp11", "crayon", "credentials", "crosstalk", "curl", + "DAAG", "dae", "data.table", "datawizard", "date", "DBI", "deldir", + "dendextend", "DEoptimR", "desc", "DescTools", "devtools", "diffobj", + "digest", "distillery", "dotCall64", "downlit", "dplyr", "dslabs", + "DT", "e1071", "ecmwfr", "effectsize", "ellipse", "ellipsis", + "emmeans", "EnvStats", "estimability", "evaluate", "Evapotranspiration", + "Exact", "exactRankTests", "expm", "extraDistr", "extrafont", + "extrafontdb", "extRemes", "factoextra", "FactoMineR", "fansi", + "faraway", "farver", "fastDummies", "fastmap", "fields", "filelock", + "fitdistrplus", "flashClust", "FNN", "fontawesome", "forcats", + "foreach", "forecast", "foreign", "formula.tools", "Formula", + "fracdiff", "fs", "future.apply", "future", "gapminder", "gclus", + "gcookbook", "generics", "GenSA", "geosphere", "gert", "getPass", + "GGally", "ggalt", "ggdendro", "ggeffects", "ggfittext", "ggforce", + "ggformula", "ggfortify", "ggmosaic", "ggplot2", "ggplotify", + "ggpmisc", "ggpp", "ggpubr", "ggrepel", "ggridges", "ggsci", + "ggsignif", "ggstance", "ggtext", "ggthemes", "ggwordcloud", + "gh", "gitcreds", "gld", "GlobalOptions", "globals", "glue", + "gmp", "gnm", "goftest", "gower", "gridExtra", "gridGraphics", + "gridtext", "gstat", "gtable", "hardhat", "haven", "heplots", + "hexbin", "highr", "HistData", "Hmisc", "hms", "htmlTable", "htmltools", + "htmlwidgets", "httpuv", "httr", "hunspell", "hydroGOF", "hydroTSM", + "imputeTS", "ini", "insight", "interp", "intervals", "ipred", + "isoband", "iterators", "janeaustenr", "janitor", "jpeg", "jquerylib", + "jsonlite", "Kendall", "KernSmooth", "keyring", "klaR", "knitr", + "labeling", "labelled", "Lahman", "later", "lattice", "latticeExtra", + "lava", "lazyeval", "leaflet.providers", "leaflet", "leaps", + "lemon", "libcoin", "lifecycle", "listenv", "lme4", "lmodel2", + "lmom", "lmomco", "Lmoments", "lmtest", "lubridate", "lwgeom", + "magick", "magrittr", "mapdata", "mapproj", "maps", "maptools", + "markdown", "MASS", "Matrix", "MatrixModels", "matrixStats", + "mc2d", "memoise", "metR", "mgcv", "mime", "miniUI", "minqa", + "MKdescr", "MKinfer", "mlbench", "ModelMetrics", "modelr", "modeltools", + "mosaic", "mosaicCore", "mosaicData", "multcomp", "multcompView", + "munsell", "mvtnorm", "ncdf4.helpers", "ncdf4", "nlme", "nloptr", + "nnet", "nortest", "numDeriv", "nycflights13", "openair", "openssl", + "openxlsx", "operator.tools", "parallelly", "parameters", "patchwork", + "pbkrtest", "pbs", "PCICt", "performance", "pillar", "pingr", + "pkgbuild", "pkgconfig", "pkgdown", "pkgload", "plotly", "plotrix", + "pls", "plyr", "png", "polyclip", "polynom", "praise", "prettyunits", + "pROC", "processx", "prodlim", "productplots", "profvis", "progress", + "progressr", "proj4", "promises", "proxy", "ps", "purrr", "qap", + "quadprog", "quantmod", "quantreg", "questionr", "qvcalc", "R.cache", + "R.methodsS3", "R.oo", "R.utils", "R6", "ragg", "rainfarmr", + "rappdirs", "raster", "rasterVis", "rbibutils", "rcmdcheck", + "RColorBrewer", "rcorpora", "Rcpp", "RcppArmadillo", "RcppEigen", + "RcppRoll", "RCurl", "Rdpack", "readODS", "readr", "readxl", + "recipes", "registry", "relimp", "rematch", "rematch2", "remotes", + "repr", "reshape", "reshape2", "rgdal", "rio", "rje", "rlang", + "rmarkdown", "RMAWGEN", "RMySQL", "robustbase", "rootSolve", + "roxygen2", "rpart", "rpivotTable", "rprojroot", "rrefine", "rstatix", + "rstudioapi", "rtf", "Rttf2pt1", "rversions", "rvest", "rworldmap", + "rworldxtra", "s2", "sandwich", "sass", "scales", "scatterplot3d", + "SearchTrees", "selectr", "seriation", "sessioninfo", "sf", "sftime", + "shades", "shape", "shiny", "shinyFiles", "shinyjs", "shinythemes", + "shinyWidgets", "signmedian.test", "sjlabelled", "sjmisc", "sjPlot", + "sjstats", "skimr", "snakecase", "SnowballC", "sodium", "sourcetools", + "sp", "spacetime", "spam", "SparseM", "SPEI", "splines2", "splus2R", + "SQUAREM", "stars", "statip", "stinepack", "stringdist", "stringi", + "stringr", "strucchange", "styler", "survival", "svglite", "sys", + "systemfonts", "terra", "testthat", "texmex", "textshaping", + "TH.data", "tibble", "tidyr", "tidyselect", "tidytext", "timechange", + "timeDate", "tinytex", "tokenizers", "treemapify", "trend", "tseries", + "TSP", "TTR", "tweenr", "tzdb", "units", "urca", "urlchecker", + "usethis", "utf8", "vars", "vcd", "vcdExtra", "vctrs", "viridis", + "viridisLite", "visdat", "visreg", "vroom", "wakefield", "waldo", + "weathermetrics", "whisker", "withr", "wk", "xfun", "XML", "xml2", + "xopen", "xtable", "xts", "yaml", "yulab.utils", "zip", "zoo", + "zyp", # mmtable2 package from GitHub added manually to list # install with devtools::install_github("ianmoran11/mmtable2") "mmtable2") -versions <- c("1.4-5", "1.3-5", "1.20", "1.2.1", - "2.7", "1.1.9", "1.0-15", "1.1", "0.2.1", - "1.0-16", "1.4.1", "0.1-3", "0.12.1", - "1.78.0-0", "4.0.4", "4.0.5", "1.0-7", - "1.3-28", "1.0-7", "1.1.3", "0.8.0", - "0.3.1", "1.0.6", "3.7.0", "0.8-6", "3.0-13", - "3.0-5", "6.0-92", "1.1.0", "2.2.3", - "2.1.0", "0.72.7", "2.3-57", "0.4.15", - "0.2-6", "0.4-95", "7.3-20", "0.4-7", - "3.3.0", "3.2-5", "1.1-11", "0.8.0", - "0.3-61", "2.1.3", "3.4.2", "1.2.4", - "1.1.11", "0.2-18", "2.3.1", "2.0-3", - "1.1.1", "0.0-8", "1.8.0", "0.92", "0.4.3", - "1.4.0", "1.1.1", "0.4.2", "1.5.1", "1.3.2", - "1.2.0", "4.3.2", "1.25.3", "3.2-13", - "1.14.2", "0.4.1", "1.2-39", "1.1.2", - "1.15.2", "1.0-11", "1.4.1", "0.99.45", - "2.4.3", "0.3.5", "0.6.29", "1.2-1", - "1.0-1", "1.0.9", "0.7.4", "0.23", "1.7-11", - "1.3.0", "0.7.0", "0.4.3", "0.3.2", "1.7.4-1", - "2.7.0", "1.3", "0.15", "1.16", "3.1", - "0.999-6", "1.9.1", "0.18", "1.0", "2.1-2", - "1.0.7", "2.4", "1.0.3", "1.0.7", "2.1.0", - "1.6.3", "1.1.0", "13.3", "1.0.2", "1.1-8", - "1.01-2", "1.1.3.1", "0.2.2", "0.5.1", - "1.5.2", "8.16", "0.8-82", "1.7.1", "1.2-4", - "1.5-1", "1.5.2", "1.9.0", "1.26.1", - "0.3.0", "1.3.2", "2.0", "0.1.2", "1.1.7", - "1.5-14", "1.6.0", "0.2-2", "2.1.2", - "0.4.0", "0.1.23", "1.1.2", "0.9.1", - "0.3.3", "0.10.1", "0.4.14", "0.3.3", - "3.3.6", "0.1.0", "0.4.6", "0.4.4", "0.4.0", - "0.9.1", "0.5.3", "2.9", "0.6.3", "0.3.5", - "0.1.1", "4.2.4", "0.5.0", "1.3.0", "0.1.1", - "2.6.4", "0.1.2", "0.15.0", "1.6.2", - "0.6-5", "1.2-3", "1.0.0", "2.3", "0.5-1", - "0.1.4", "2.0-9", "0.3.0", "1.1.0", "2.5.0", - "1.3-9", "1.28.2", "0.9", "0.8-7", "4.7-0", - "1.1.1", "2.4.0", "0.5.2", "1.5.4", "1.6.5", - "1.4.3", "3.0.1", "0.4-0", "0.6-0", "3.2", - "0.3.1", "0.17.1", "0.15.2", "0.9-13", - "0.2.5", "1.0.14", "0.1.5", "2.1.0", - "0.1-9", "0.1.4", "1.8.0", "2.2.1", "2.23-20", - "1.3.0", "1.7-0", "1.39", "0.4.2", "2.9.1", - "10.0-1", "1.3.0", "0.20-45", "0.6-29", - "1.6.10", "0.2.2", "1.9.0", "2.1.1", - "3.1", "0.4.5", "1.0.1", "0.8.0", "1.1-29", - "1.7-3", "2.9", "2.3.7", "1.3-1", "0.9-40", - "1.8.0", "2.7.3", "2.0.3", "2.3.0", "1.2.8", - "3.4.0", "1.1-4", "1.1", "7.3-57", "1.4-1", - "0.5-0", "0.1-21", "2.0.1", "0.12.0", - "1.8-40", "0.12", "0.1.1.1", "1.2.4", - "0.7", "0.6", "2.1-3", "1.2.2.2", "0.1.8", - "1.8.3", "0.9.0", "0.20.2", "0.5.0", - "1.1-3", "0.3-6", "1.19", "3.1-157", - "2.0.3", "7.3-17", "1.0-4", "2016.8-1.1", - "1.0.2", "2.9-1", "2.0.2", "4.2.5", "1.6.3", - "1.32.0", "0.18.1", "1.1.1", "0.5.1", - "1.1", "0.5-4.1", "0.9.0", "1.7.0", "1.3.1", - "2.0.3", "1.2.4", "4.10.0", "3.8-2", - "2.8-0", "1.8.7", "0.1-7", "1.10-0", - "1.4-1", "1.0.0", "1.1.1", "1.18.0", - "3.6.0", "2019.11.13", "0.1.1", "1.2.2", - "0.10.1", "1.0-11", "1.2.0.1", "0.4-27", - "1.7.0", "0.3.4", "0.1-1", "1.5-8", "0.4.20", - "5.93", "0.7.7", "0.15.0", "1.8.1", "1.25.0", - "2.11.0", "2.5.1", "0.1", "0.3.3", "3.5-15", - "0.51.2", "2.2.8", "1.4.0", "1.1-3", - "2.0.0", "1.0.8.3", "0.11.1.1.0", "0.3.3.9.2", - "0.3.0", "1.98-1.7", "2.3.1", "1.7.0", - "2.1.2", "1.4.0", "0.2.0", "0.5-1", "1.0.1", - "2.1.2", "2.4.2", "1.1.4", "0.8.9", "1.4.4", - "1.5-32", "0.5.29", "1.11.0", "1.0.2", - "1.3.7", "0.10.23", "0.95-0", "1.8.2.3", - "7.2.0", "4.1.16", "0.3.0", "2.0.3", - "2.0.0", "0.7.0", "0.13", "0.4-14.1", - "1.3.10", "2.1.1", "1.0.2", "1.3-6", - "1.01", "1.0.7", "3.0-1", "0.4.1", "1.2.0", - "0.3-41", "0.5.3", "0.4-2", "1.3.5", - "1.2.2", "1.0-7", "1.4.0", "1.4.6", "1.7.1", - "0.9.2", "2.1.0", "1.2.0", "0.7.0", "1.5.1", - "1.2.0", "2.8.9", "2.8.10", "0.18.1", - "2.1.4", "0.11.0", "0.7.0", "1.2.1", - "0.1.7", "1.5-0", "1.2-7", "2.8-0", "1.81", - "1.7", "0.4.5", "1.3-3", "2021.1", "0.2.3", - "1.4", "0.9.8", "1.7.6", "1.4.0", "1.5-2", - "1.7.0", "3.3-1", "2.1.0", "3.4", "1.0.4", - "1.5-34", "3.1.4", "2.4.8", "3.1.7", - "1.2.0", "1.1.2", "0.3.3", "3043.102", - "0.2.1", "2.5.5", "1.1.4", "0.10-51", - "1.2-0", "0.24.3", "1.0.2", "0.3.0", - "0.8-0", "1.3-0", "2.1.6", "1.2.2", "1.5-6", - "0.4.1", "0.6.2", "0.4.0", "0.5.3", "2.7.0", - "1.5.7", "0.3.6", "0.4.0", "1.2.2", "0.4", - "2.5.0", "0.6.0", "0.31", "3.99-0.10", - "1.3.3", "1.0.0", "1.8-4", "0.12.1", - "2.3.5", "0.0.4", "2.2.0", "1.8-10", - "0.10-1.1", +versions <- c("1.4-5", "1.3-5", "1.21", "1.2.1", "2.7", "0.3.9", + "1.1.9", "1.0-15", "1.1", "0.2.1", "1.0-16", "1.4.1", "0.1-3", + "0.13.0", "1.78.0-0", "4.0.5", "4.0.5", "1.0-7", "1.3-28.1", + "1.0-8", "1.1.3", "1.0.1", "0.4.1", "0.71.1", "1.0.6", "3.7.3", + "0.8-6", "3.1-1", "3.0-5", "6.0-93", "1.1.0", "2.2.4", "2.1.0", + "0.72.8", "2.3-58", "0.4.15", "0.2-6", "0.4-95", "7.3-20", "0.4-8", + "3.4.1", "3.2-5", "1.1-11", "0.8.0", "0.6.1", "0.3-63", "2.1.4", + "3.4.4", "1.2.6", "1.1.12", "0.2-18", "1.4-2", "2.3.1", "2.0-3", + "1.2.0", "0.0-8", "1.8.1", "0.2.0", "0.92", "0.4.4", "1.4.0", + "1.1.1", "0.4.3", "1.5.2", "1.3.2", "1.2.0", "4.3.3", "1.25.4", + "3.2-13", "1.14.6", "0.6.4", "1.2-40", "1.1.3", "1.0-6", "1.16.0", + "1.0-11", "1.4.2", "0.99.47", "2.4.4", "0.3.5", "0.6.30", "1.2-1", + "1.0-2", "0.4.2", "1.0.10", "0.7.4", "0.26", "1.7-12", "1.4.0", + "0.8.2", "0.4.3", "0.3.2", "1.8.2", "2.7.0", "1.4.1", "0.18", + "1.16", "3.2", "0.8-35", "0.999-6", "1.9.1", "0.18", "1.0", "2.1-3", + "1.0.7", "2.6", "1.0.3", "1.0.8", "2.1.1", "1.6.3", "1.1.0", + "14.1", "1.0.2", "1.1-8", "1.01-2", "1.1.3.1", "0.4.0", "0.5.2", + "1.5.2", "8.19", "0.8-83", "1.7.1", "1.2-4", "1.5-2", "1.5.2", + "1.10.0", "1.29.0", "0.3.0", "1.3.2", "2.0", "0.1.3", "1.1.7", + "1.5-18", "1.9.1", "0.2-2", "2.1.2", "0.4.0", "0.1.23", "1.1.4", + "0.9.1", "0.4.1", "0.10.2", "0.4.15", "0.3.3", "3.4.0", "0.1.0", + "0.5.1", "0.4.5", "0.5.0", "0.9.2", "0.5.4", "2.9", "0.6.4", + "0.3.6", "0.1.2", "4.2.4", "0.5.0", "1.3.1", "0.1.2", "2.6.6", + "0.1.2", "0.16.2", "1.6.2", "0.6-8", "1.1-2", "1.2-3", "1.0.0", + "2.3", "0.5-1", "0.1.5", "2.1-0", "0.3.1", "1.2.0", "2.5.1", + "1.4-2", "1.28.2", "0.9", "0.8-7", "4.7-2", "1.1.2", "2.4.1", + "0.5.3", "1.5.4", "1.6.6", "1.4.4", "3.0.2", "0.4-0", "0.6-0", + "3.3", "0.3.1", "0.18.8", "1.1-3", "0.15.2", "0.9-13", "0.2.6", + "1.0.14", "1.0.0", "2.1.0", "0.1-10", "0.1.4", "1.8.3", "2.2.1", + "2.23-20", "1.3.1", "1.7-1", "1.41", "0.4.2", "2.10.0", "10.0-1", + "1.3.0", "0.20-45", "0.6-30", "1.7.0", "0.2.2", "1.9.0", "2.1.1", + "3.1", "0.4.5", "1.0-9", "1.0.3", "0.8.0", "1.1-31", "1.7-3", + "2.9", "2.4.7", "1.3-1", "0.9-40", "1.9.0", "0.2-10", "2.7.3", + "2.0.3", "2.3.1", "1.2.9", "3.4.1", "1.1-5", "1.4", "7.3-58.1", + "1.5-3", "0.5-1", "0.63.0", "0.1-22", "2.0.1", "0.13.0", "1.8-41", + "0.12", "0.1.1.1", "1.2.5", "0.8", "0.9", "2.1-3", "1.2.2.2", + "0.1.10", "0.2-23", "1.8.4.2", "0.9.2.1", "0.20.3", "1.4-20", + "0.1-8", "0.5.0", "1.1-3", "0.3-6", "1.19", "3.1-160", "2.0.3", + "7.3-18", "1.0-4", "2016.8-1.1", "1.0.2", "2.12", "2.0.4", "4.2.5.1", + "1.6.3", "1.32.1", "0.20.0", "1.1.2", "0.5.1", "1.1", "0.5-4.3", + "0.10.1", "1.8.1", "2.0.2", "1.4.0", "2.0.3", "2.0.6", "1.3.2", + "4.10.1", "3.8-2", "2.8-1", "1.8.8", "0.1-8", "1.10-4", "1.4-1", + "1.0.0", "1.1.1", "1.18.0", "3.8.0", "2019.11.13", "0.1.1", "0.3.7", + "1.2.2", "0.11.0", "1.0-12", "1.2.0.1", "0.4-27", "1.7.2", "0.3.5", + "0.1-2", "1.5-8", "0.4.20", "5.94", "0.7.7", "1.0.2", "0.16.0", + "1.8.2", "1.25.0", "2.12.2", "2.5.1", "1.2.4", "0.1", "0.3.3", + "3.6-11", "0.51.4", "2.2.10", "1.4.0", "1.1-3", "2.0.0", "1.0.9", + "0.11.4.2.1", "0.3.3.9.3", "0.3.0", "1.98-1.9", "2.4", "1.7.0", + "2.1.3", "1.4.1", "1.0.3", "0.5-1", "1.0-5", "1.0.1", "2.1.2", + "2.4.2", "1.1.4", "0.8.9", "1.4.4", "1.5-32", "0.5.29", "1.12.1", + "1.0.6", "2.18", "1.3.7", "0.10.24", "0.95-0", "1.8.2.3", "7.2.2", + "4.1.19", "0.3.0", "2.0.3", "2.1.0", "0.7.1", "0.14", "0.4-14.1", + "1.3.11", "2.1.2", "1.0.3", "1.3-6", "1.01", "1.1.1", "3.0-2", + "0.4.4", "1.2.1", "0.3-42", "0.5.5", "0.4-2", "1.4.0", "1.2.2", + "1.0-9", "0.2-0", "1.4.0", "1.4.6", "1.7.3", "0.9.3", "2.1.0", + "1.2.0", "0.7.5", "1.5.1", "1.2.0", "2.8.9", "2.8.12", "0.18.2", + "2.1.4", "0.11.0", "0.7.0", "1.2.1", "0.1.7", "1.5-1", "1.2-8", + "2.9-1", "1.81", "1.7", "0.4.6", "1.3-3", "2021.1", "0.6-0", + "0.2.3", "1.4", "0.9.10", "1.7.6", "1.4.1", "1.5-3", "1.8.1", + "3.4-0", "2.1.0", "3.4.1", "1.0.4", "1.6-41", "3.1.5", "2.4.8", + "0.3.6", "1.1-1", "3.1.8", "1.2.1", "1.2.0", "0.3.4", "0.1.1", + "4021.106", "0.42", "0.2.3", "2.5.5", "1.1.4", "0.10-52", "1.2-1", + "0.24.3", "2.0.2", "0.3.0", "0.8-0", "1.3-3", "1.0.1", "2.1.6", + "1.2.2", "1.5-6", "1.4-10", "0.8-0", "0.5.1", "0.6.2", "0.4.1", + "0.5.3", "2.7.0", "1.6.0", "0.3.6", "0.4.0", "1.2.2", "0.4", + "2.5.0", "0.7.0", "0.35", "3.99-0.12", "1.3.3", "1.0.0", "1.8-4", + "0.12.2", "2.3.6", "0.0.5", "2.2.2", "1.8-11", "0.10-1.1", # mmtable2 package from GitHub added manually to list "0.1.3" )