From d8e703df7ff841e8e6638b1a7ebe5ebe7d28fe07 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 21 Aug 2020 12:34:02 +0300 Subject: [PATCH 001/102] a wrapper to patch climatic element using ChillR function --- instat/static/InstatObject/R/data_object_R6.R | 28 +++++++++++++++++-- .../static/InstatObject/R/instat_object_R6.R | 9 +++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 4f7216f4070..356afb5cfed 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2143,9 +2143,9 @@ DataSheet$set("public","set_contrasts_of_factor", function(col_name, new_contras #This method gets a date column and extracts part of the information such as year, month, week, weekday etc(depending on which parameters are set) and creates their respective new column(s) DataSheet$set("public","split_date", function(col_name = "", year_val = FALSE, year_name = FALSE, leap_year = FALSE, month_val = FALSE, month_abbr = FALSE, month_name = FALSE, week_val = FALSE, week_abbr = FALSE, week_name = FALSE, weekday_val = FALSE, weekday_abbr = FALSE, weekday_name = FALSE, day = FALSE, day_in_month = FALSE, day_in_year = FALSE, day_in_year_366 = FALSE, pentad_val = FALSE, pentad_abbr = FALSE, dekad_val = FALSE, dekad_abbr = FALSE, quarter_val = FALSE, quarter_abbr = FALSE, with_year = FALSE, s_start_month = 1, s_start_day_in_month = 1, days_in_month = FALSE) { - col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) + col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) if(!lubridate::is.Date(col_data)) stop("This column must be a date or time!") - + s_shift <- s_start_day_in_month > 1 || s_start_month > 1 is_climatic <- self$is_climatic_data() @@ -3628,3 +3628,27 @@ DataSheet$set("public", "get_variable_sets", function(set_names, force_as_list) return(out) } ) + +DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE){ + if(missing(date_col_name))stop("date is missing with no default") + if(missing(var))stop("var is missing with no default") + if(missing(vars))stop("vars is missing with no default") + date_col <- self$get_columns_from_data(date_col_name, use_current_filter = FALSE) + if(!lubridate::is.Date(date_col)) stop("This column must be a date or time!") + var_col <- self$get_columns_from_data(var, use_current_filter = FALSE) + Year <- lubridate::year(date_col); Month <- lubridate::month(date_col); Day <- lubridate::day(date_col) + weather <- data.frame(Year, Month, Day, var_col) + colnames(weather)[4] <- var + patch_weather <- list() + for (i in seq_along(vars)) { + col <- self$get_columns_from_data(vars[i], use_current_filter = FALSE) + patch_weather[[i]] <- data.frame(Year, Month, Day, col) + colnames(patch_weather[[i]])[4] <- var + } + out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) + self$add_columns_to_data(col_name = paste0(var,"_Infilled"), col_data = out[[1]][,var]) + if(print_summary) print(out[[2]]) +} +) + + diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index aa50fc516a3..230cfa1668b 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2086,4 +2086,11 @@ DataBook$set("public","package_check", function(package) { } } } -) \ No newline at end of file +) + +DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE) { + self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, print_summary = print_summary) +} +) + + \ No newline at end of file From 61872ef53e53b1ad5e687c57b1ab17f446ce83ce Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 21 Aug 2020 12:34:50 +0300 Subject: [PATCH 002/102] adding and aligning controls --- instat/dlgInfillMissingValues.Designer.vb | 122 ++++- instat/dlgInfillMissingValues.resx | 546 ++++++++++++++-------- 2 files changed, 472 insertions(+), 196 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index 689566dfdf0..2acd709be36 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -32,7 +32,6 @@ Partial Class dlgInfillMissingValues Me.lblElement = New System.Windows.Forms.Label() Me.rdoSingle = New System.Windows.Forms.RadioButton() Me.rdoMultiple = New System.Windows.Forms.RadioButton() - Me.rdoNeighbouring = New System.Windows.Forms.RadioButton() Me.grpMethods = New System.Windows.Forms.GroupBox() Me.grpStartEnd = New System.Windows.Forms.GroupBox() Me.rdoExtendFill = New System.Windows.Forms.RadioButton() @@ -41,6 +40,17 @@ Partial Class dlgInfillMissingValues Me.lblFunction = New System.Windows.Forms.Label() Me.lblRows = New System.Windows.Forms.Label() Me.lblStation = New System.Windows.Forms.Label() + Me.lblDate = New System.Windows.Forms.Label() + Me.lblEstimated = New System.Windows.Forms.Label() + Me.lblObserved = New System.Windows.Forms.Label() + Me.ucrInputStdBias = New instat.ucrInputTextBox() + Me.ucrInputMeanBias = New instat.ucrInputTextBox() + Me.ucrChkStdBias = New instat.ucrCheck() + Me.ucrChkMeanBias = New instat.ucrCheck() + Me.ucrChkPrintSummary = New instat.ucrCheck() + Me.ucrReceiverObserved = New instat.ucrReceiverSingle() + Me.ucrReceiverEstimatedElements = New instat.ucrReceiverMultiple() + Me.ucrReceiverDate = New instat.ucrReceiverSingle() Me.ucrInputConstant = New instat.ucrInputTextBox() Me.ucrReceiverByFactor = New instat.ucrReceiverMultiple() Me.ucrReceiverStation = New instat.ucrReceiverSingle() @@ -129,16 +139,6 @@ Partial Class dlgInfillMissingValues Me.rdoMultiple.TabStop = True Me.rdoMultiple.UseVisualStyleBackColor = True ' - 'rdoNeighbouring - ' - resources.ApplyResources(Me.rdoNeighbouring, "rdoNeighbouring") - Me.rdoNeighbouring.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoNeighbouring.FlatAppearance.BorderSize = 2 - Me.rdoNeighbouring.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoNeighbouring.Name = "rdoNeighbouring" - Me.rdoNeighbouring.TabStop = True - Me.rdoNeighbouring.UseVisualStyleBackColor = True - ' 'grpMethods ' Me.grpMethods.Controls.Add(Me.rdoNaStructTS) @@ -195,6 +195,82 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblStation, "lblStation") Me.lblStation.Name = "lblStation" ' + 'lblDate + ' + resources.ApplyResources(Me.lblDate, "lblDate") + Me.lblDate.Name = "lblDate" + ' + 'lblEstimated + ' + resources.ApplyResources(Me.lblEstimated, "lblEstimated") + Me.lblEstimated.Name = "lblEstimated" + ' + 'lblObserved + ' + resources.ApplyResources(Me.lblObserved, "lblObserved") + Me.lblObserved.Name = "lblObserved" + ' + 'ucrInputStdBias + ' + Me.ucrInputStdBias.AddQuotesIfUnrecognised = True + Me.ucrInputStdBias.IsMultiline = False + Me.ucrInputStdBias.IsReadOnly = False + resources.ApplyResources(Me.ucrInputStdBias, "ucrInputStdBias") + Me.ucrInputStdBias.Name = "ucrInputStdBias" + ' + 'ucrInputMeanBias + ' + Me.ucrInputMeanBias.AddQuotesIfUnrecognised = True + Me.ucrInputMeanBias.IsMultiline = False + Me.ucrInputMeanBias.IsReadOnly = False + resources.ApplyResources(Me.ucrInputMeanBias, "ucrInputMeanBias") + Me.ucrInputMeanBias.Name = "ucrInputMeanBias" + ' + 'ucrChkStdBias + ' + Me.ucrChkStdBias.Checked = False + resources.ApplyResources(Me.ucrChkStdBias, "ucrChkStdBias") + Me.ucrChkStdBias.Name = "ucrChkStdBias" + ' + 'ucrChkMeanBias + ' + Me.ucrChkMeanBias.Checked = False + resources.ApplyResources(Me.ucrChkMeanBias, "ucrChkMeanBias") + Me.ucrChkMeanBias.Name = "ucrChkMeanBias" + ' + 'ucrChkPrintSummary + ' + Me.ucrChkPrintSummary.Checked = False + resources.ApplyResources(Me.ucrChkPrintSummary, "ucrChkPrintSummary") + Me.ucrChkPrintSummary.Name = "ucrChkPrintSummary" + ' + 'ucrReceiverObserved + ' + Me.ucrReceiverObserved.frmParent = Me + resources.ApplyResources(Me.ucrReceiverObserved, "ucrReceiverObserved") + Me.ucrReceiverObserved.Name = "ucrReceiverObserved" + Me.ucrReceiverObserved.Selector = Nothing + Me.ucrReceiverObserved.strNcFilePath = "" + Me.ucrReceiverObserved.ucrSelector = Nothing + ' + 'ucrReceiverEstimatedElements + ' + Me.ucrReceiverEstimatedElements.frmParent = Me + resources.ApplyResources(Me.ucrReceiverEstimatedElements, "ucrReceiverEstimatedElements") + Me.ucrReceiverEstimatedElements.Name = "ucrReceiverEstimatedElements" + Me.ucrReceiverEstimatedElements.Selector = Nothing + Me.ucrReceiverEstimatedElements.strNcFilePath = "" + Me.ucrReceiverEstimatedElements.ucrSelector = Nothing + ' + 'ucrReceiverDate + ' + Me.ucrReceiverDate.frmParent = Me + resources.ApplyResources(Me.ucrReceiverDate, "ucrReceiverDate") + Me.ucrReceiverDate.Name = "ucrReceiverDate" + Me.ucrReceiverDate.Selector = Nothing + Me.ucrReceiverDate.strNcFilePath = "" + Me.ucrReceiverDate.ucrSelector = Nothing + ' 'ucrInputConstant ' Me.ucrInputConstant.AddQuotesIfUnrecognised = True @@ -319,6 +395,17 @@ Partial Class dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrInputStdBias) + Me.Controls.Add(Me.ucrInputMeanBias) + Me.Controls.Add(Me.ucrChkStdBias) + Me.Controls.Add(Me.ucrChkMeanBias) + Me.Controls.Add(Me.ucrChkPrintSummary) + Me.Controls.Add(Me.lblObserved) + Me.Controls.Add(Me.ucrReceiverObserved) + Me.Controls.Add(Me.lblEstimated) + Me.Controls.Add(Me.ucrReceiverEstimatedElements) + Me.Controls.Add(Me.lblDate) + Me.Controls.Add(Me.ucrReceiverDate) Me.Controls.Add(Me.lblValue) Me.Controls.Add(Me.lblStation) Me.Controls.Add(Me.ucrInputConstant) @@ -335,7 +422,6 @@ Partial Class dlgInfillMissingValues Me.Controls.Add(Me.lblFunction) Me.Controls.Add(Me.ucrSaveNewColumn) Me.Controls.Add(Me.ucrInputComboFunction) - Me.Controls.Add(Me.rdoNeighbouring) Me.Controls.Add(Me.rdoMultiple) Me.Controls.Add(Me.rdoSingle) Me.Controls.Add(Me.lblElement) @@ -367,7 +453,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents rdoNaLocf As RadioButton Friend WithEvents rdoNaStructTS As RadioButton Friend WithEvents lblElement As Label - Friend WithEvents rdoNeighbouring As RadioButton Friend WithEvents rdoMultiple As RadioButton Friend WithEvents rdoSingle As RadioButton Friend WithEvents ucrPnlOptions As UcrPanel @@ -392,4 +477,15 @@ Partial Class dlgInfillMissingValues Friend WithEvents lblStation As Label Friend WithEvents ucrReceiverByFactor As ucrReceiverMultiple Friend WithEvents ucrReceiverStation As ucrReceiverSingle + Friend WithEvents lblDate As Label + Friend WithEvents ucrReceiverDate As ucrReceiverSingle + Friend WithEvents lblEstimated As Label + Friend WithEvents ucrReceiverEstimatedElements As ucrReceiverMultiple + Friend WithEvents lblObserved As Label + Friend WithEvents ucrReceiverObserved As ucrReceiverSingle + Friend WithEvents ucrChkPrintSummary As ucrCheck + Friend WithEvents ucrChkStdBias As ucrCheck + Friend WithEvents ucrChkMeanBias As ucrCheck + Friend WithEvents ucrInputStdBias As ucrInputTextBox + Friend WithEvents ucrInputMeanBias As ucrInputTextBox End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 789284c8a41..6b3e091202c 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -328,7 +328,7 @@ $this - 19 + 29 Button @@ -340,7 +340,7 @@ NoControl - 66, 29 + 112, 29 103, 27 @@ -364,7 +364,7 @@ $this - 18 + 28 Button @@ -376,7 +376,7 @@ NoControl - 268, 29 + 214, 29 103, 27 @@ -400,43 +400,16 @@ $this - 17 - - - Button - - - Flat - - - NoControl - - - 167, 29 - - - 103, 27 + 27 - - 2 - - - Neighbouring - - - MiddleCenter - - - rdoNeighbouring - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 6, 15 - - $this + + 177, 71 - - 16 + + 17 ucrPnlMethods @@ -472,67 +445,7 @@ $this - 24 - - - rdoExtendFill - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpStartEnd - - - 0 - - - rdoLeaveAsMissing - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpStartEnd - - - 1 - - - ucrPnlStartEnd - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpStartEnd - - - 2 - - - 228, 317 - - - 181, 66 - - - 15 - - - Start and End - - - grpStartEnd - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 12 + 34 True @@ -594,6 +507,51 @@ 1 + + 6, 15 + + + 118, 44 + + + 18 + + + ucrPnlStartEnd + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpStartEnd + + + 2 + + + 228, 317 + + + 181, 66 + + + 15 + + + Start and End + + + grpStartEnd + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 23 + True @@ -622,7 +580,7 @@ $this - 0 + 11 True @@ -652,7 +610,7 @@ $this - 13 + 24 True @@ -682,7 +640,7 @@ $this - 7 + 18 True @@ -712,8 +670,260 @@ $this + 12 + + + True + + + NoControl + + + 281, 82 + + + 33, 13 + + + 30 + + + Date: + + + lblDate + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + True + + + NoControl + + + 283, 191 + + + 56, 13 + + + 32 + + + Estimated: + + + lblEstimated + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + True + + + NoControl + + + 281, 133 + + + 56, 13 + + + 34 + + + Observed: + + + lblObserved + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 144, 309 + + + 47, 21 + + + 39 + + + ucrInputStdBias + + + instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + + + 144, 286 + + + 47, 21 + + + 40 + + + ucrInputMeanBias + + + instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + 1 + + 14, 309 + + + 127, 20 + + + 37 + + + ucrChkStdBias + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 2 + + + 14, 286 + + + 127, 20 + + + 38 + + + ucrChkMeanBias + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + + + 14, 263 + + + 146, 20 + + + 36 + + + ucrChkPrintSummary + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 4 + + + True + + + 6, 13 + + + 421, 540 + + + 281, 207 + + + 0, 0, 0, 0 + + + 120, 100 + + + 31 + + + ucrReceiverEstimatedElements + + + instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 8 + + + 281, 98 + + + 0, 0, 0, 0 + + + 120, 20 + + + 29 + + + ucrReceiverDate + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 10 + 279, 384 @@ -733,16 +943,31 @@ $this - 2 + 13 - - True - - - 6, 13 + + 281, 207 - - 421, 540 + + 0, 0, 0, 0 + + + 120, 100 + + + 10 + + + ucrReceiverByFactor + + + instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 14 281, 98 @@ -766,7 +991,7 @@ $this - 4 + 15 146, 427 @@ -787,7 +1012,7 @@ $this - 5 + 16 223, 427 @@ -808,7 +1033,7 @@ $this - 6 + 17 110, 279 @@ -829,7 +1054,7 @@ $this - 8 + 19 12, 280 @@ -850,7 +1075,7 @@ $this - 9 + 20 281, 184 @@ -871,7 +1096,7 @@ $this - 10 + 21 12, 427 @@ -892,7 +1117,7 @@ $this - 11 + 22 12, 455 @@ -916,7 +1141,7 @@ $this - 14 + 25 66, 426 @@ -937,7 +1162,7 @@ $this - 15 + 26 281, 149 @@ -961,7 +1186,7 @@ $this - 20 + 30 12, 483 @@ -982,7 +1207,7 @@ $this - 21 + 31 12, 75 @@ -1006,13 +1231,13 @@ $this - 22 + 32 - 49, 12 + 95, 12 - 120, 58 + 230, 58 0 @@ -1027,10 +1252,7 @@ $this - 23 - - - NoControl + 33 CenterScreen @@ -1044,70 +1266,28 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 281, 207 + + 281, 149 - + 0, 0, 0, 0 - - 120, 100 + + 120, 20 - - 10 + + 33 - - ucrReceiverByFactor + + ucrReceiverObserved - - instat.ucrReceiverMultiple, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 3 - - - 6, 15 - - - 118, 44 - - - 18 - - - ucrPnlStartEnd - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpStartEnd - - - 2 - - - 6, 15 - - - 177, 71 - - - 17 - - - ucrPnlMethods - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpMethods - - + 6 \ No newline at end of file From 121199f6ab583d71566c44cece5b728971989e1d Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 21 Aug 2020 12:54:00 +0300 Subject: [PATCH 003/102] adding and disabling non working station receiver --- instat/dlgInfillMissingValues.Designer.vb | 20 ++ instat/dlgInfillMissingValues.resx | 322 ++++++++++++++-------- 2 files changed, 232 insertions(+), 110 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index 2acd709be36..88ebb287220 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -43,6 +43,8 @@ Partial Class dlgInfillMissingValues Me.lblDate = New System.Windows.Forms.Label() Me.lblEstimated = New System.Windows.Forms.Label() Me.lblObserved = New System.Windows.Forms.Label() + Me.lblMultipleStation = New System.Windows.Forms.Label() + Me.ucrReceiverMultipleStation = New instat.ucrReceiverSingle() Me.ucrInputStdBias = New instat.ucrInputTextBox() Me.ucrInputMeanBias = New instat.ucrInputTextBox() Me.ucrChkStdBias = New instat.ucrCheck() @@ -210,6 +212,20 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblObserved, "lblObserved") Me.lblObserved.Name = "lblObserved" ' + 'lblMultipleStation + ' + resources.ApplyResources(Me.lblMultipleStation, "lblMultipleStation") + Me.lblMultipleStation.Name = "lblMultipleStation" + ' + 'ucrReceiverMultipleStation + ' + Me.ucrReceiverMultipleStation.frmParent = Me + resources.ApplyResources(Me.ucrReceiverMultipleStation, "ucrReceiverMultipleStation") + Me.ucrReceiverMultipleStation.Name = "ucrReceiverMultipleStation" + Me.ucrReceiverMultipleStation.Selector = Nothing + Me.ucrReceiverMultipleStation.strNcFilePath = "" + Me.ucrReceiverMultipleStation.ucrSelector = Nothing + ' 'ucrInputStdBias ' Me.ucrInputStdBias.AddQuotesIfUnrecognised = True @@ -395,6 +411,8 @@ Partial Class dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblMultipleStation) + Me.Controls.Add(Me.ucrReceiverMultipleStation) Me.Controls.Add(Me.ucrInputStdBias) Me.Controls.Add(Me.ucrInputMeanBias) Me.Controls.Add(Me.ucrChkStdBias) @@ -488,4 +506,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrChkMeanBias As ucrCheck Friend WithEvents ucrInputStdBias As ucrInputTextBox Friend WithEvents ucrInputMeanBias As ucrInputTextBox + Friend WithEvents lblMultipleStation As Label + Friend WithEvents ucrReceiverMultipleStation As ucrReceiverSingle End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 6b3e091202c..3596a2c1191 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -328,7 +328,7 @@ $this - 29 + 31 Button @@ -364,7 +364,7 @@ $this - 28 + 30 Button @@ -400,16 +400,7 @@ $this - 27 - - - 6, 15 - - - 177, 71 - - - 17 + 29 ucrPnlMethods @@ -445,7 +436,67 @@ $this - 34 + 36 + + + rdoExtendFill + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpStartEnd + + + 0 + + + rdoLeaveAsMissing + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpStartEnd + + + 1 + + + ucrPnlStartEnd + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpStartEnd + + + 2 + + + 228, 317 + + + 181, 66 + + + 15 + + + Start and End + + + grpStartEnd + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 25 True @@ -507,51 +558,6 @@ 1 - - 6, 15 - - - 118, 44 - - - 18 - - - ucrPnlStartEnd - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpStartEnd - - - 2 - - - 228, 317 - - - 181, 66 - - - 15 - - - Start and End - - - grpStartEnd - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 23 - True @@ -580,7 +586,7 @@ $this - 11 + 13 True @@ -610,7 +616,7 @@ $this - 24 + 26 True @@ -640,7 +646,7 @@ $this - 18 + 20 True @@ -670,7 +676,7 @@ $this - 12 + 14 True @@ -679,7 +685,7 @@ NoControl - 281, 82 + 282, 125 33, 13 @@ -700,7 +706,7 @@ $this - 9 + 11 True @@ -709,7 +715,7 @@ NoControl - 283, 191 + 283, 210 56, 13 @@ -730,7 +736,7 @@ $this - 7 + 9 True @@ -739,7 +745,7 @@ NoControl - 281, 133 + 282, 167 56, 13 @@ -760,7 +766,46 @@ $this - 5 + 7 + + + True + + + NoControl + + + 282, 83 + + + 43, 13 + + + 42 + + + Station: + + + lblMultipleStation + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 421, 540 144, 309 @@ -781,7 +826,7 @@ $this - 0 + 2 144, 286 @@ -802,7 +847,7 @@ $this - 1 + 3 14, 309 @@ -823,7 +868,7 @@ $this - 2 + 4 14, 286 @@ -844,7 +889,7 @@ $this - 3 + 5 14, 263 @@ -865,19 +910,34 @@ $this - 4 + 6 - - True - - - 6, 13 + + 281, 182 - - 421, 540 + + 0, 0, 0, 0 + + + 120, 20 + + + 33 + + + ucrReceiverObserved + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 8 - 281, 207 + 281, 224 0, 0, 0, 0 @@ -898,10 +958,10 @@ $this - 8 + 10 - 281, 98 + 281, 140 0, 0, 0, 0 @@ -922,7 +982,7 @@ $this - 10 + 12 279, 384 @@ -943,7 +1003,7 @@ $this - 13 + 15 281, 207 @@ -967,7 +1027,7 @@ $this - 14 + 16 281, 98 @@ -991,7 +1051,7 @@ $this - 15 + 17 146, 427 @@ -1012,7 +1072,7 @@ $this - 16 + 18 223, 427 @@ -1033,7 +1093,7 @@ $this - 17 + 19 110, 279 @@ -1054,7 +1114,7 @@ $this - 19 + 21 12, 280 @@ -1075,7 +1135,7 @@ $this - 20 + 22 281, 184 @@ -1096,7 +1156,7 @@ $this - 21 + 23 12, 427 @@ -1117,7 +1177,7 @@ $this - 22 + 24 12, 455 @@ -1141,7 +1201,7 @@ $this - 25 + 27 66, 426 @@ -1162,7 +1222,7 @@ $this - 26 + 28 281, 149 @@ -1186,7 +1246,7 @@ $this - 30 + 32 12, 483 @@ -1207,7 +1267,7 @@ $this - 31 + 33 12, 75 @@ -1231,7 +1291,7 @@ $this - 32 + 34 95, 12 @@ -1252,7 +1312,7 @@ $this - 33 + 35 CenterScreen @@ -1266,28 +1326,70 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 281, 149 + + 281, 98 - + 0, 0, 0, 0 - + 120, 20 - - 33 + + 41 - - ucrReceiverObserved + + ucrReceiverMultipleStation - + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - + + 1 + + + 6, 15 + + + 118, 44 + + + 18 + + + ucrPnlStartEnd + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpStartEnd + + + 2 + + + 6, 15 + + + 177, 71 + + + 17 + + + ucrPnlMethods + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpMethods + + 6 \ No newline at end of file From 268242a5d9b3e0b966cbfcca74186593484b82b5 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 21 Aug 2020 12:55:08 +0300 Subject: [PATCH 004/102] implementing patch_climate_element function --- instat/dlgInfillMissingValues.vb | 114 ++++++++++++++++++++++++++++--- 1 file changed, 103 insertions(+), 11 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 6e7d737c3f4..d24f03255ca 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -19,12 +19,15 @@ Imports instat.Translations Public Class dlgInfillMissingValues Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsApproximateFunction, clsAggregateFunction, clsNaLocfFunction, clsSplineFunction, clsNaFillFunction, clsStructTSFunction, clsZooRegFunction, clsSetSeedFunction, clsAveFunction As New RFunction + Private iDialogHeight As Integer + Private iBaseMaxY + Private clsApproximateFunction, clsAggregateFunction, clsNaLocfFunction, clsSplineFunction, clsNaFillFunction, clsStructTSFunction, clsZooRegFunction, clsSetSeedFunction, clsAveFunction, clsPatchClimateElementFunction As New RFunction Private clsBracketOperator As New ROperator - Private clsNewObject As New RCodeStructure Private Sub dlgInfillMissingValues_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstLoad Then + iDialogHeight = Me.Height + iBaseMaxY = ucrBase.Location.Y InitialiseDialog() bFirstLoad = False End If @@ -39,10 +42,14 @@ Public Class dlgInfillMissingValues Private Sub InitialiseDialog() Dim dctFunctionNames As New Dictionary(Of String, String) - rdoNeighbouring.Enabled = False - rdoMultiple.Enabled = False + 'TODO:Enabled once working, added now for display purposes and therefore show the intention! + ucrReceiverMultipleStation.Enabled = False + lblMultipleStation.Enabled = False + ucrPnlOptions.AddRadioButton(rdoSingle) + ucrPnlOptions.AddRadioButton(rdoMultiple) ucrPnlOptions.AddFunctionNamesCondition(rdoSingle, {"ave", "na.aggregate"}) + ucrPnlOptions.AddFunctionNamesCondition(rdoMultiple, {"patch_climate_element"}) ucrPnlMethods.AddRadioButton(rdoNaAggregate) ucrPnlMethods.AddRadioButton(rdoNaApproximate) @@ -61,6 +68,9 @@ Public Class dlgInfillMissingValues ucrPnlStartEnd.AddRadioButton(rdoLeaveAsMissing) ucrPnlStartEnd.AddRadioButton(rdoExtendFill) + ucrSelectorInfillMissing.SetParameter(New RParameter("data_name", 0)) + ucrSelectorInfillMissing.SetParameterIsString() + ucrReceiverElement.SetParameter(New RParameter("x", 0)) ucrReceiverElement.Selector = ucrSelectorInfillMissing ucrReceiverElement.SetParameterIsRFunction() @@ -113,6 +123,22 @@ Public Class dlgInfillMissingValues ucrChkSetSeed.AddRSyntaxContainsFunctionNamesCondition(True, {"set.seed"}) ucrChkSetSeed.AddRSyntaxContainsFunctionNamesCondition(False, {"set.seed"}, False) + ucrReceiverDate.SetParameter(New RParameter("date_col_name", 1)) + ucrReceiverDate.Selector = ucrSelectorInfillMissing + ucrReceiverDate.SetClimaticType("date") + ucrReceiverDate.SetParameterIsString() + ucrReceiverDate.bAutoFill = True + + ucrReceiverObserved.SetParameter(New RParameter("var", 2)) + ucrReceiverObserved.Selector = ucrSelectorInfillMissing + ucrReceiverObserved.SetParameterIsString() + ucrReceiverObserved.SetDataType("numeric", bStrict:=True) + + ucrReceiverEstimatedElements.SetParameter(New RParameter("vars", 3)) + ucrReceiverEstimatedElements.Selector = ucrSelectorInfillMissing + ucrReceiverEstimatedElements.SetParameterIsString() + ucrReceiverEstimatedElements.SetDataType("numeric", bStrict:=True) + ucrPnlStartEnd.AddToLinkedControls(ucrInputConstant, {rdoLeaveAsMissing, rdoExtendFill}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrInputComboFunction, {rdoNaAggregate}, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrReceiverStation, {rdoNaApproximate, rdoNaFill, rdoNaSpline, rdoNaLocf, rdoNaStructTS}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -123,15 +149,46 @@ Public Class dlgInfillMissingValues ucrChkMaxGap.AddToLinkedControls(ucrNudMaximum, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.AddToLinkedControls(ucrChkSetSeed, {"Sample"}, bNewLinkedHideIfParameterMissing:=True) ucrChkSetSeed.AddToLinkedControls(ucrNudSetSeed, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) + ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkPrintSummary, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) + ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) ucrInputComboFunction.SetLinkedDisplayControl(lblFunction) ucrPnlStartEnd.SetLinkedDisplayControl(grpStartEnd) ucrNudMaximum.SetLinkedDisplayControl(lblRows) ucrReceiverStation.SetLinkedDisplayControl(lblStation) ucrInputConstant.SetLinkedDisplayControl(lblValue) + ucrReceiverDate.SetLinkedDisplayControl(lblDate) + ucrReceiverEstimatedElements.SetLinkedDisplayControl(lblEstimated) + ucrReceiverElement.SetLinkedDisplayControl(lblElement) + ucrPnlMethods.SetLinkedDisplayControl(grpMethods) + ucrReceiverObserved.SetLinkedDisplayControl(lblObserved) + ucrReceiverMultipleStation.SetLinkedDisplayControl(lblMultipleStation) + ucrSaveNewColumn.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveNewColumn.SetSaveTypeAsColumn() ucrSaveNewColumn.SetIsComboBox() ucrSaveNewColumn.SetLabelText("New Column Name:") + + ucrChkPrintSummary.SetParameter(New RParameter("print_summary", 6)) + ucrChkPrintSummary.SetText("Print summary") + ucrChkPrintSummary.SetRDefault("FALSE") + + ucrChkMeanBias.SetText("Maximum mean bias:") + ucrChkMeanBias.AddParameterPresentCondition(True, "max_mean_bias") + ucrChkMeanBias.AddParameterPresentCondition(False, "max_mean_bias", False) + + ucrChkStdBias.SetText("Maximum stdev bias:") + ucrChkStdBias.AddParameterPresentCondition(True, "max_stdev_bias") + ucrChkStdBias.AddParameterPresentCondition(False, "max_stdev_bias", False) + + ucrInputMeanBias.SetParameter(New RParameter("max_mean_bias", 4)) + ucrInputMeanBias.AddQuotesIfUnrecognised = False + ucrInputMeanBias.SetValidationTypeAsNumeric() + + ucrInputStdBias.SetParameter(New RParameter("max_stdev_bias", 5)) + ucrInputStdBias.AddQuotesIfUnrecognised = False + ucrInputStdBias.SetValidationTypeAsNumeric() End Sub Private Sub SetDefaults() @@ -144,6 +201,7 @@ Public Class dlgInfillMissingValues clsZooRegFunction = New RFunction clsSetSeedFunction = New RFunction clsAveFunction = New RFunction + clsPatchClimateElementFunction = New RFunction clsBracketOperator = New ROperator @@ -154,6 +212,7 @@ Public Class dlgInfillMissingValues rdoLeaveAsMissing.Checked = True rdoNaApproximate.Checked = True ucrInputConstant.SetName("0") + rdoSingle.Checked = True clsApproximateFunction.SetPackageName("zoo") clsApproximateFunction.SetRCommand("na.approx") @@ -198,8 +257,9 @@ Public Class dlgInfillMissingValues clsBracketOperator.bBrackets = False clsBracketOperator.bSpaceAroundOperation = False + clsPatchClimateElementFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$patch_climate_element") + ucrBase.clsRsyntax.ClearCodes() - clsNewObject = clsAggregateFunction ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) End Sub @@ -215,8 +275,7 @@ Public Class dlgInfillMissingValues ucrReceiverElement.SetRCode(clsAveFunction, bReset) ucrReceiverStation.SetRCode(clsAveFunction, bReset) ucrReceiverByFactor.SetRCode(clsAggregateFunction, bReset) - ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - 'ucrPnlMethods.SetRCode(clsNewObject, bReset) + 'ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrInputComboFunction.SetRCode(clsAggregateFunction, bReset) ucrChkCopyFromBelow.SetRCode(clsNaLocfFunction, bReset) ucrChkBy.SetRCode(clsAggregateFunction, bReset) @@ -224,6 +283,15 @@ Public Class dlgInfillMissingValues ucrChkMaxGap.SetRCode(clsApproximateFunction, bReset) ucrNudSetSeed.SetRCode(clsSetSeedFunction, bReset) ucrChkSetSeed.SetRSyntax(ucrBase.clsRsyntax, bReset) + ucrSelectorInfillMissing.SetRCode(clsPatchClimateElementFunction, bReset) + ucrReceiverDate.SetRCode(clsPatchClimateElementFunction, bReset) + ucrReceiverObserved.SetRCode(clsPatchClimateElementFunction, bReset) + ucrReceiverEstimatedElements.SetRCode(clsPatchClimateElementFunction, bReset) + ucrChkPrintSummary.SetRCode(clsPatchClimateElementFunction, bReset) + ucrInputMeanBias.SetRCode(clsPatchClimateElementFunction, bReset) + ucrInputStdBias.SetRCode(clsPatchClimateElementFunction, bReset) + ucrChkMeanBias.SetRCode(clsPatchClimateElementFunction, bReset) + ucrChkStdBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) @@ -232,7 +300,6 @@ Public Class dlgInfillMissingValues Private Sub ucrPnlMethods_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethods.ControlValueChanged, ucrReceiverElement.ControlValueChanged ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) - clsNewObject = clsBracketOperator If rdoNaApproximate.Checked Then ucrSaveNewColumn.SetPrefix("Int_" & ucrReceiverElement.GetVariableNames(False)) clsBracketOperator.AddParameter("right", clsRFunctionParameter:=clsApproximateFunction, iPosition:=1) @@ -240,7 +307,6 @@ Public Class dlgInfillMissingValues ucrReceiverElement.SetMeAsReceiver() ucrSaveNewColumn.SetPrefix("Typ_" & ucrReceiverElement.GetVariableNames(False)) ucrBase.clsRsyntax.SetBaseRFunction(clsAggregateFunction) - clsNewObject = clsAggregateFunction ElseIf rdoNaFill.Checked Then ucrSaveNewColumn.SetPrefix("Con_" & ucrReceiverElement.GetVariableNames(False)) clsBracketOperator.AddParameter("right", clsRFunctionParameter:=clsNaFillFunction, iPosition:=1) @@ -293,7 +359,9 @@ Public Class dlgInfillMissingValues End Sub Private Sub TestOkEnabled() - If ucrReceiverElement.IsEmpty OrElse Not ucrSaveNewColumn.IsComplete OrElse (rdoNaFill.Checked AndAlso ((rdoLeaveAsMissing.Checked OrElse rdoExtendFill.Checked) AndAlso ucrInputConstant.IsEmpty)) Then + If rdoSingle.Checked AndAlso (ucrReceiverElement.IsEmpty OrElse Not ucrSaveNewColumn.IsComplete OrElse (rdoNaFill.Checked AndAlso ((rdoLeaveAsMissing.Checked OrElse rdoExtendFill.Checked) AndAlso ucrInputConstant.IsEmpty))) Then + ucrBase.OKEnabled(False) + ElseIf rdoMultiple.Checked AndAlso (ucrReceiverDate.IsEmpty OrElse ucrReceiverObserved.IsEmpty OrElse ucrReceiverEstimatedElements.IsEmpty OrElse (ucrChkMeanBias.Checked AndAlso ucrInputMeanBias.IsEmpty) OrElse (ucrChkStdBias.Checked AndAlso ucrInputStdBias.IsEmpty)) Then ucrBase.OKEnabled(False) Else ucrBase.OKEnabled(True) @@ -306,7 +374,31 @@ Public Class dlgInfillMissingValues TestOkEnabled() End Sub - Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged + Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged + If rdoMultiple.Checked Then + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.77) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.4) + ucrReceiverObserved.SetMeAsReceiver() + ucrBase.clsRsyntax.SetBaseRFunction(clsPatchClimateElementFunction) + Else + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) + ucrReceiverElement.SetMeAsReceiver() + ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) + End If + End Sub + + Private Sub ucrChkPrintSummary_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPrintSummary.ControlValueChanged, ucrPnlOptions.ControlValueChanged + If rdoMultiple.Checked AndAlso ucrChkPrintSummary.Checked Then + ucrBase.clsRsyntax.iCallType = 2 + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + Else + ucrBase.clsRsyntax.iCallType = 0 + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True + End If + End Sub + + Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged TestOkEnabled() End Sub End Class \ No newline at end of file From 94436f06309f1e8765fde1b390c8ec598d434110 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 21 Aug 2020 14:05:57 +0300 Subject: [PATCH 005/102] minor edit --- instat/static/InstatObject/R/data_object_R6.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 356afb5cfed..02a0f2aa6f5 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -2143,9 +2143,8 @@ DataSheet$set("public","set_contrasts_of_factor", function(col_name, new_contras #This method gets a date column and extracts part of the information such as year, month, week, weekday etc(depending on which parameters are set) and creates their respective new column(s) DataSheet$set("public","split_date", function(col_name = "", year_val = FALSE, year_name = FALSE, leap_year = FALSE, month_val = FALSE, month_abbr = FALSE, month_name = FALSE, week_val = FALSE, week_abbr = FALSE, week_name = FALSE, weekday_val = FALSE, weekday_abbr = FALSE, weekday_name = FALSE, day = FALSE, day_in_month = FALSE, day_in_year = FALSE, day_in_year_366 = FALSE, pentad_val = FALSE, pentad_abbr = FALSE, dekad_val = FALSE, dekad_abbr = FALSE, quarter_val = FALSE, quarter_abbr = FALSE, with_year = FALSE, s_start_month = 1, s_start_day_in_month = 1, days_in_month = FALSE) { - col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) + col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) if(!lubridate::is.Date(col_data)) stop("This column must be a date or time!") - s_shift <- s_start_day_in_month > 1 || s_start_month > 1 is_climatic <- self$is_climatic_data() From 96d23dffee5d98ec964c2be262e091a61eec0136 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sat, 22 Aug 2020 18:03:12 +0300 Subject: [PATCH 006/102] checking print summary checkbox by default --- instat/dlgInfillMissingValues.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index d24f03255ca..5b449ced315 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -172,7 +172,6 @@ Public Class dlgInfillMissingValues ucrChkPrintSummary.SetParameter(New RParameter("print_summary", 6)) ucrChkPrintSummary.SetText("Print summary") - ucrChkPrintSummary.SetRDefault("FALSE") ucrChkMeanBias.SetText("Maximum mean bias:") ucrChkMeanBias.AddParameterPresentCondition(True, "max_mean_bias") @@ -258,6 +257,7 @@ Public Class dlgInfillMissingValues clsBracketOperator.bSpaceAroundOperation = False clsPatchClimateElementFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$patch_climate_element") + clsPatchClimateElementFunction.AddParameter("print_summary", "TRUE", iPosition:=6) ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) From c3f045daeb664e304ffbba0f51914b59fc0640bd Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sat, 22 Aug 2020 18:03:52 +0300 Subject: [PATCH 007/102] changing the default mean Bias and Std Bias to 5 and 2.5 respectively --- instat/dlgInfillMissingValues.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 5b449ced315..409005c4edf 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -151,8 +151,8 @@ Public Class dlgInfillMissingValues ucrChkSetSeed.AddToLinkedControls(ucrNudSetSeed, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkPrintSummary, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) - ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) + ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=5) + ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) ucrInputComboFunction.SetLinkedDisplayControl(lblFunction) ucrPnlStartEnd.SetLinkedDisplayControl(grpStartEnd) ucrNudMaximum.SetLinkedDisplayControl(lblRows) From 7be9746d2863a7d7e99d13592ee0a2c909e02535 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sat, 22 Aug 2020 18:42:35 +0300 Subject: [PATCH 008/102] added column name as a parameter --- instat/static/InstatObject/R/data_object_R6.R | 4 ++-- instat/static/InstatObject/R/instat_object_R6.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 02a0f2aa6f5..f4c4c18d651 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3628,7 +3628,7 @@ DataSheet$set("public", "get_variable_sets", function(set_names, force_as_list) } ) -DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE){ +DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE, column_name){ if(missing(date_col_name))stop("date is missing with no default") if(missing(var))stop("var is missing with no default") if(missing(vars))stop("vars is missing with no default") @@ -3645,7 +3645,7 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va colnames(patch_weather[[i]])[4] <- var } out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) - self$add_columns_to_data(col_name = paste0(var,"_Infilled"), col_data = out[[1]][,var]) + self$add_columns_to_data(col_name = column_name, col_data = out[[1]][,var]) if(print_summary) print(out[[2]]) } ) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 230cfa1668b..a7cf4e5b015 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2088,8 +2088,8 @@ DataBook$set("public","package_check", function(package) { } ) -DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE) { - self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, print_summary = print_summary) +DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE, column_name) { + self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, print_summary = print_summary, column_name = column_name) } ) From ec4d11103c811bf22fac805ed3f60afc39e02b37 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sat, 22 Aug 2020 18:42:58 +0300 Subject: [PATCH 009/102] adding input for a column name --- instat/dlgInfillMissingValues.Designer.vb | 39 ++- instat/dlgInfillMissingValues.resx | 279 +++++++++++----------- 2 files changed, 170 insertions(+), 148 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index 88ebb287220..c6c59e3eeec 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -33,9 +33,11 @@ Partial Class dlgInfillMissingValues Me.rdoSingle = New System.Windows.Forms.RadioButton() Me.rdoMultiple = New System.Windows.Forms.RadioButton() Me.grpMethods = New System.Windows.Forms.GroupBox() + Me.ucrPnlMethods = New instat.UcrPanel() Me.grpStartEnd = New System.Windows.Forms.GroupBox() Me.rdoExtendFill = New System.Windows.Forms.RadioButton() Me.rdoLeaveAsMissing = New System.Windows.Forms.RadioButton() + Me.ucrPnlStartEnd = New instat.UcrPanel() Me.lblValue = New System.Windows.Forms.Label() Me.lblFunction = New System.Windows.Forms.Label() Me.lblRows = New System.Windows.Forms.Label() @@ -44,6 +46,7 @@ Partial Class dlgInfillMissingValues Me.lblEstimated = New System.Windows.Forms.Label() Me.lblObserved = New System.Windows.Forms.Label() Me.lblMultipleStation = New System.Windows.Forms.Label() + Me.lblNewColumnName = New System.Windows.Forms.Label() Me.ucrReceiverMultipleStation = New instat.ucrReceiverSingle() Me.ucrInputStdBias = New instat.ucrInputTextBox() Me.ucrInputMeanBias = New instat.ucrInputTextBox() @@ -62,14 +65,13 @@ Partial Class dlgInfillMissingValues Me.ucrChkMaxGap = New instat.ucrCheck() Me.ucrChkBy = New instat.ucrCheck() Me.ucrChkCopyFromBelow = New instat.ucrCheck() - Me.ucrPnlStartEnd = New instat.UcrPanel() Me.ucrSaveNewColumn = New instat.ucrSave() Me.ucrInputComboFunction = New instat.ucrInputComboBox() Me.ucrReceiverElement = New instat.ucrReceiverSingle() Me.ucrBase = New instat.ucrButtons() Me.ucrSelectorInfillMissing = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrPnlOptions = New instat.UcrPanel() - Me.ucrPnlMethods = New instat.UcrPanel() + Me.ucrInputNewColumnName = New instat.ucrInputTextBox() Me.grpMethods.SuspendLayout() Me.grpStartEnd.SuspendLayout() Me.SuspendLayout() @@ -154,6 +156,11 @@ Partial Class dlgInfillMissingValues Me.grpMethods.Name = "grpMethods" Me.grpMethods.TabStop = False ' + 'ucrPnlMethods + ' + resources.ApplyResources(Me.ucrPnlMethods, "ucrPnlMethods") + Me.ucrPnlMethods.Name = "ucrPnlMethods" + ' 'grpStartEnd ' Me.grpStartEnd.Controls.Add(Me.rdoExtendFill) @@ -177,6 +184,11 @@ Partial Class dlgInfillMissingValues Me.rdoLeaveAsMissing.TabStop = True Me.rdoLeaveAsMissing.UseVisualStyleBackColor = True ' + 'ucrPnlStartEnd + ' + resources.ApplyResources(Me.ucrPnlStartEnd, "ucrPnlStartEnd") + Me.ucrPnlStartEnd.Name = "ucrPnlStartEnd" + ' 'lblValue ' resources.ApplyResources(Me.lblValue, "lblValue") @@ -217,6 +229,11 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblMultipleStation, "lblMultipleStation") Me.lblMultipleStation.Name = "lblMultipleStation" ' + 'lblNewColumnName + ' + resources.ApplyResources(Me.lblNewColumnName, "lblNewColumnName") + Me.lblNewColumnName.Name = "lblNewColumnName" + ' 'ucrReceiverMultipleStation ' Me.ucrReceiverMultipleStation.frmParent = Me @@ -357,11 +374,6 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.ucrChkCopyFromBelow, "ucrChkCopyFromBelow") Me.ucrChkCopyFromBelow.Name = "ucrChkCopyFromBelow" ' - 'ucrPnlStartEnd - ' - resources.ApplyResources(Me.ucrPnlStartEnd, "ucrPnlStartEnd") - Me.ucrPnlStartEnd.Name = "ucrPnlStartEnd" - ' 'ucrSaveNewColumn ' resources.ApplyResources(Me.ucrSaveNewColumn, "ucrSaveNewColumn") @@ -402,16 +414,21 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.ucrPnlOptions, "ucrPnlOptions") Me.ucrPnlOptions.Name = "ucrPnlOptions" ' - 'ucrPnlMethods + 'ucrInputNewColumnName ' - resources.ApplyResources(Me.ucrPnlMethods, "ucrPnlMethods") - Me.ucrPnlMethods.Name = "ucrPnlMethods" + Me.ucrInputNewColumnName.AddQuotesIfUnrecognised = True + Me.ucrInputNewColumnName.IsMultiline = False + Me.ucrInputNewColumnName.IsReadOnly = False + resources.ApplyResources(Me.ucrInputNewColumnName, "ucrInputNewColumnName") + Me.ucrInputNewColumnName.Name = "ucrInputNewColumnName" ' 'dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrInputNewColumnName) Me.Controls.Add(Me.lblMultipleStation) + Me.Controls.Add(Me.lblNewColumnName) Me.Controls.Add(Me.ucrReceiverMultipleStation) Me.Controls.Add(Me.ucrInputStdBias) Me.Controls.Add(Me.ucrInputMeanBias) @@ -508,4 +525,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrInputMeanBias As ucrInputTextBox Friend WithEvents lblMultipleStation As Label Friend WithEvents ucrReceiverMultipleStation As ucrReceiverSingle + Friend WithEvents ucrInputNewColumnName As ucrInputTextBox + Friend WithEvents lblNewColumnName As Label End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 3596a2c1191..861827424b1 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -328,7 +328,7 @@ $this - 31 + 33 Button @@ -364,7 +364,7 @@ $this - 30 + 32 Button @@ -400,7 +400,16 @@ $this - 29 + 31 + + + 6, 15 + + + 177, 71 + + + 17 ucrPnlMethods @@ -436,67 +445,7 @@ $this - 36 - - - rdoExtendFill - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpStartEnd - - - 0 - - - rdoLeaveAsMissing - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpStartEnd - - - 1 - - - ucrPnlStartEnd - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpStartEnd - - - 2 - - - 228, 317 - - - 181, 66 - - - 15 - - - Start and End - - - grpStartEnd - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 25 + 38 True @@ -558,6 +507,51 @@ 1 + + 6, 15 + + + 118, 44 + + + 18 + + + ucrPnlStartEnd + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpStartEnd + + + 2 + + + 228, 317 + + + 181, 66 + + + 15 + + + Start and End + + + grpStartEnd + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 27 + True @@ -586,7 +580,7 @@ $this - 13 + 15 True @@ -616,7 +610,7 @@ $this - 26 + 28 True @@ -646,7 +640,7 @@ $this - 20 + 22 True @@ -676,7 +670,7 @@ $this - 14 + 16 True @@ -706,7 +700,7 @@ $this - 11 + 13 True @@ -736,7 +730,7 @@ $this - 9 + 11 True @@ -766,7 +760,7 @@ $this - 7 + 9 True @@ -796,7 +790,37 @@ $this - 0 + 1 + + + True + + + NoControl + + + 9, 337 + + + 101, 13 + + + 43 + + + New Column Name: + + + lblNewColumnName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 True @@ -807,6 +831,27 @@ 421, 540 + + 113, 333 + + + 137, 21 + + + 18 + + + ucrInputNewColumnName + + + instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + 144, 309 @@ -826,7 +871,7 @@ $this - 2 + 4 144, 286 @@ -847,7 +892,7 @@ $this - 3 + 5 14, 309 @@ -868,7 +913,7 @@ $this - 4 + 6 14, 286 @@ -889,7 +934,7 @@ $this - 5 + 7 14, 263 @@ -910,7 +955,7 @@ $this - 6 + 8 281, 182 @@ -934,7 +979,7 @@ $this - 8 + 10 281, 224 @@ -958,7 +1003,7 @@ $this - 10 + 12 281, 140 @@ -982,7 +1027,7 @@ $this - 12 + 14 279, 384 @@ -1003,7 +1048,7 @@ $this - 15 + 17 281, 207 @@ -1027,7 +1072,7 @@ $this - 16 + 18 281, 98 @@ -1051,7 +1096,7 @@ $this - 17 + 19 146, 427 @@ -1072,7 +1117,7 @@ $this - 18 + 20 223, 427 @@ -1093,7 +1138,7 @@ $this - 19 + 21 110, 279 @@ -1114,7 +1159,7 @@ $this - 21 + 23 12, 280 @@ -1135,7 +1180,7 @@ $this - 22 + 24 281, 184 @@ -1156,7 +1201,7 @@ $this - 23 + 25 12, 427 @@ -1177,7 +1222,7 @@ $this - 24 + 26 12, 455 @@ -1201,7 +1246,7 @@ $this - 27 + 29 66, 426 @@ -1222,7 +1267,7 @@ $this - 28 + 30 281, 149 @@ -1246,7 +1291,7 @@ $this - 32 + 34 12, 483 @@ -1267,7 +1312,7 @@ $this - 33 + 35 12, 75 @@ -1291,7 +1336,7 @@ $this - 34 + 36 95, 12 @@ -1312,7 +1357,7 @@ $this - 35 + 37 CenterScreen @@ -1348,48 +1393,6 @@ $this - 1 - - - 6, 15 - - - 118, 44 - - - 18 - - - ucrPnlStartEnd - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpStartEnd - - - 2 - - - 6, 15 - - - 177, 71 - - - 17 - - - ucrPnlMethods - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpMethods - - - 6 + 3 \ No newline at end of file From 645048d814e043c690d4f92349fcc46cc1fd6d8c Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sat, 22 Aug 2020 18:43:41 +0300 Subject: [PATCH 010/102] setting up column name input --- instat/dlgInfillMissingValues.vb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 409005c4edf..330bcd315f9 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -149,7 +149,7 @@ Public Class dlgInfillMissingValues ucrChkMaxGap.AddToLinkedControls(ucrNudMaximum, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.AddToLinkedControls(ucrChkSetSeed, {"Sample"}, bNewLinkedHideIfParameterMissing:=True) ucrChkSetSeed.AddToLinkedControls(ucrNudSetSeed, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) - ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkPrintSummary, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkPrintSummary, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=5) ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) @@ -164,6 +164,7 @@ Public Class dlgInfillMissingValues ucrPnlMethods.SetLinkedDisplayControl(grpMethods) ucrReceiverObserved.SetLinkedDisplayControl(lblObserved) ucrReceiverMultipleStation.SetLinkedDisplayControl(lblMultipleStation) + ucrInputNewColumnName.SetLinkedDisplayControl(lblNewColumnName) ucrSaveNewColumn.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveNewColumn.SetSaveTypeAsColumn() @@ -188,6 +189,9 @@ Public Class dlgInfillMissingValues ucrInputStdBias.SetParameter(New RParameter("max_stdev_bias", 5)) ucrInputStdBias.AddQuotesIfUnrecognised = False ucrInputStdBias.SetValidationTypeAsNumeric() + + ucrInputNewColumnName.SetParameter(New RParameter("column_name", 7)) + ucrInputNewColumnName.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) End Sub Private Sub SetDefaults() @@ -292,6 +296,7 @@ Public Class dlgInfillMissingValues ucrInputStdBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrChkMeanBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrChkStdBias.SetRCode(clsPatchClimateElementFunction, bReset) + ucrInputNewColumnName.SetRCode(clsPatchClimateElementFunction, bReset) ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) @@ -376,8 +381,8 @@ Public Class dlgInfillMissingValues Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged If rdoMultiple.Checked Then - Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.77) - ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.4) + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.8) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.32) ucrReceiverObserved.SetMeAsReceiver() ucrBase.clsRsyntax.SetBaseRFunction(clsPatchClimateElementFunction) Else @@ -398,7 +403,14 @@ Public Class dlgInfillMissingValues End If End Sub + Private Sub ucrReceiverObserved_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverObserved.ControlValueChanged + If Not ucrReceiverObserved.IsEmpty Then + ucrInputNewColumnName.SetName(ucrReceiverObserved.GetVariableNames(False) & "_Infilled") + End If + End Sub + Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged TestOkEnabled() End Sub + End Class \ No newline at end of file From 1c597fdf363a0384955dd1c3b77cf43932567ddc Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sat, 22 Aug 2020 18:46:27 +0300 Subject: [PATCH 011/102] modified testOk to include column name input --- instat/dlgInfillMissingValues.vb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 330bcd315f9..9dde1c5d561 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -366,7 +366,7 @@ Public Class dlgInfillMissingValues Private Sub TestOkEnabled() If rdoSingle.Checked AndAlso (ucrReceiverElement.IsEmpty OrElse Not ucrSaveNewColumn.IsComplete OrElse (rdoNaFill.Checked AndAlso ((rdoLeaveAsMissing.Checked OrElse rdoExtendFill.Checked) AndAlso ucrInputConstant.IsEmpty))) Then ucrBase.OKEnabled(False) - ElseIf rdoMultiple.Checked AndAlso (ucrReceiverDate.IsEmpty OrElse ucrReceiverObserved.IsEmpty OrElse ucrReceiverEstimatedElements.IsEmpty OrElse (ucrChkMeanBias.Checked AndAlso ucrInputMeanBias.IsEmpty) OrElse (ucrChkStdBias.Checked AndAlso ucrInputStdBias.IsEmpty)) Then + ElseIf rdoMultiple.Checked AndAlso (ucrReceiverDate.IsEmpty OrElse ucrReceiverObserved.IsEmpty OrElse ucrReceiverEstimatedElements.IsEmpty OrElse (ucrChkMeanBias.Checked AndAlso ucrInputMeanBias.IsEmpty) OrElse (ucrChkStdBias.Checked AndAlso ucrInputStdBias.IsEmpty) OrElse ucrInputNewColumnName.IsEmpty) Then ucrBase.OKEnabled(False) Else ucrBase.OKEnabled(True) @@ -409,8 +409,7 @@ Public Class dlgInfillMissingValues End If End Sub - Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged + Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged, ucrInputNewColumnName.ControlContentsChanged TestOkEnabled() End Sub - End Class \ No newline at end of file From c1d7bc9fb31e738386a0937afa7fa6e8531b330d Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 23 Aug 2020 11:19:24 +0300 Subject: [PATCH 012/102] Bug fix: removed running of set.seed function when multiple radio button is checked --- instat/dlgInfillMissingValues.vb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 9dde1c5d561..7b64190e14b 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -346,18 +346,14 @@ Public Class dlgInfillMissingValues End If End Sub - Private Sub ucrInputComboFunction_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboFunction.ControlValueChanged, ucrPnlMethods.ControlValueChanged, ucrChkSetSeed.ControlValueChanged - If rdoNaAggregate.Checked Then - If ucrChkSetSeed.Checked Then - Select Case ucrInputComboFunction.GetValue() - Case "Sample" - ucrBase.clsRsyntax.AddToBeforeCodes(clsSetSeedFunction, 0) - Case Else - ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSetSeedFunction) - End Select - Else - ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSetSeedFunction) - End If + Private Sub ucrInputComboFunction_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboFunction.ControlValueChanged, ucrPnlMethods.ControlValueChanged, ucrChkSetSeed.ControlValueChanged, ucrPnlOptions.ControlValueChanged + If rdoSingle.Checked AndAlso rdoNaAggregate.Checked AndAlso ucrChkSetSeed.Checked Then + Select Case ucrInputComboFunction.GetValue() + Case "Sample" + ucrBase.clsRsyntax.AddToBeforeCodes(clsSetSeedFunction, 0) + Case Else + ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSetSeedFunction) + End Select Else ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSetSeedFunction) End If From c773488b608cd5878a908648378b444298db0a84 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 23 Aug 2020 13:41:56 +0300 Subject: [PATCH 013/102] removed print_summary=always print summary --- instat/static/InstatObject/R/data_object_R6.R | 4 ++-- instat/static/InstatObject/R/instat_object_R6.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index f4c4c18d651..48312694ace 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3628,7 +3628,7 @@ DataSheet$set("public", "get_variable_sets", function(set_names, force_as_list) } ) -DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE, column_name){ +DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name){ if(missing(date_col_name))stop("date is missing with no default") if(missing(var))stop("var is missing with no default") if(missing(vars))stop("vars is missing with no default") @@ -3646,7 +3646,7 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va } out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) self$add_columns_to_data(col_name = column_name, col_data = out[[1]][,var]) - if(print_summary) print(out[[2]]) + return(out[[2]]) } ) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index a7cf4e5b015..9137d92516e 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2088,8 +2088,8 @@ DataBook$set("public","package_check", function(package) { } ) -DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, print_summary = FALSE, column_name) { - self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, print_summary = print_summary, column_name = column_name) +DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name) { + self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name) } ) From efd5652a1b3fba7b70394dda05093ff1ddad418c Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 23 Aug 2020 13:42:17 +0300 Subject: [PATCH 014/102] removed print summary checkbox --- instat/dlgInfillMissingValues.Designer.vb | 9 --- instat/dlgInfillMissingValues.resx | 81 +++++++++-------------- 2 files changed, 30 insertions(+), 60 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index c6c59e3eeec..e8c3375a0d5 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -52,7 +52,6 @@ Partial Class dlgInfillMissingValues Me.ucrInputMeanBias = New instat.ucrInputTextBox() Me.ucrChkStdBias = New instat.ucrCheck() Me.ucrChkMeanBias = New instat.ucrCheck() - Me.ucrChkPrintSummary = New instat.ucrCheck() Me.ucrReceiverObserved = New instat.ucrReceiverSingle() Me.ucrReceiverEstimatedElements = New instat.ucrReceiverMultiple() Me.ucrReceiverDate = New instat.ucrReceiverSingle() @@ -271,12 +270,6 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.ucrChkMeanBias, "ucrChkMeanBias") Me.ucrChkMeanBias.Name = "ucrChkMeanBias" ' - 'ucrChkPrintSummary - ' - Me.ucrChkPrintSummary.Checked = False - resources.ApplyResources(Me.ucrChkPrintSummary, "ucrChkPrintSummary") - Me.ucrChkPrintSummary.Name = "ucrChkPrintSummary" - ' 'ucrReceiverObserved ' Me.ucrReceiverObserved.frmParent = Me @@ -434,7 +427,6 @@ Partial Class dlgInfillMissingValues Me.Controls.Add(Me.ucrInputMeanBias) Me.Controls.Add(Me.ucrChkStdBias) Me.Controls.Add(Me.ucrChkMeanBias) - Me.Controls.Add(Me.ucrChkPrintSummary) Me.Controls.Add(Me.lblObserved) Me.Controls.Add(Me.ucrReceiverObserved) Me.Controls.Add(Me.lblEstimated) @@ -518,7 +510,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrReceiverEstimatedElements As ucrReceiverMultiple Friend WithEvents lblObserved As Label Friend WithEvents ucrReceiverObserved As ucrReceiverSingle - Friend WithEvents ucrChkPrintSummary As ucrCheck Friend WithEvents ucrChkStdBias As ucrCheck Friend WithEvents ucrChkMeanBias As ucrCheck Friend WithEvents ucrInputStdBias As ucrInputTextBox diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 861827424b1..e1eb873bf94 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -328,7 +328,7 @@ $this - 33 + 32 Button @@ -364,7 +364,7 @@ $this - 32 + 31 Button @@ -400,7 +400,7 @@ $this - 31 + 30 6, 15 @@ -445,7 +445,7 @@ $this - 38 + 37 True @@ -550,7 +550,7 @@ $this - 27 + 26 True @@ -580,7 +580,7 @@ $this - 15 + 14 True @@ -610,7 +610,7 @@ $this - 28 + 27 True @@ -640,7 +640,7 @@ $this - 22 + 21 True @@ -670,7 +670,7 @@ $this - 16 + 15 True @@ -700,7 +700,7 @@ $this - 13 + 12 True @@ -730,7 +730,7 @@ $this - 11 + 10 True @@ -760,7 +760,7 @@ $this - 9 + 8 True @@ -936,27 +936,6 @@ 7 - - 14, 263 - - - 146, 20 - - - 36 - - - ucrChkPrintSummary - - - instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 8 - 281, 182 @@ -979,7 +958,7 @@ $this - 10 + 9 281, 224 @@ -1003,7 +982,7 @@ $this - 12 + 11 281, 140 @@ -1027,7 +1006,7 @@ $this - 14 + 13 279, 384 @@ -1048,7 +1027,7 @@ $this - 17 + 16 281, 207 @@ -1072,7 +1051,7 @@ $this - 18 + 17 281, 98 @@ -1096,7 +1075,7 @@ $this - 19 + 18 146, 427 @@ -1117,7 +1096,7 @@ $this - 20 + 19 223, 427 @@ -1138,7 +1117,7 @@ $this - 21 + 20 110, 279 @@ -1159,7 +1138,7 @@ $this - 23 + 22 12, 280 @@ -1180,7 +1159,7 @@ $this - 24 + 23 281, 184 @@ -1201,7 +1180,7 @@ $this - 25 + 24 12, 427 @@ -1222,7 +1201,7 @@ $this - 26 + 25 12, 455 @@ -1246,7 +1225,7 @@ $this - 29 + 28 66, 426 @@ -1267,7 +1246,7 @@ $this - 30 + 29 281, 149 @@ -1291,7 +1270,7 @@ $this - 34 + 33 12, 483 @@ -1312,7 +1291,7 @@ $this - 35 + 34 12, 75 @@ -1336,7 +1315,7 @@ $this - 36 + 35 95, 12 @@ -1357,7 +1336,7 @@ $this - 37 + 36 CenterScreen From 8443b86d4c132bd6be91a667561bcf3b648755b9 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 23 Aug 2020 13:42:51 +0300 Subject: [PATCH 015/102] removed redundant code and Bug fixes --- instat/dlgInfillMissingValues.vb | 55 +++++++++++--------------------- 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 7b64190e14b..a2ac92458af 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -21,7 +21,7 @@ Public Class dlgInfillMissingValues Private bReset As Boolean = True Private iDialogHeight As Integer Private iBaseMaxY - Private clsApproximateFunction, clsAggregateFunction, clsNaLocfFunction, clsSplineFunction, clsNaFillFunction, clsStructTSFunction, clsZooRegFunction, clsSetSeedFunction, clsAveFunction, clsPatchClimateElementFunction As New RFunction + Private clsApproximateFunction, clsAggregateFunction, clsNaLocfFunction, clsSplineFunction, clsNaFillFunction, clsStructTSFunction, clsSetSeedFunction, clsAveFunction, clsPatchClimateElementFunction As New RFunction Private clsBracketOperator As New ROperator Private Sub dlgInfillMissingValues_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) @@ -49,7 +49,7 @@ Public Class dlgInfillMissingValues ucrPnlOptions.AddRadioButton(rdoSingle) ucrPnlOptions.AddRadioButton(rdoMultiple) ucrPnlOptions.AddFunctionNamesCondition(rdoSingle, {"ave", "na.aggregate"}) - ucrPnlOptions.AddFunctionNamesCondition(rdoMultiple, {"patch_climate_element"}) + ucrPnlOptions.AddFunctionNamesCondition(rdoMultiple, {frmMain.clsRLink.strInstatDataObject & "$patch_climate_element"}) ucrPnlMethods.AddRadioButton(rdoNaAggregate) ucrPnlMethods.AddRadioButton(rdoNaApproximate) @@ -149,7 +149,7 @@ Public Class dlgInfillMissingValues ucrChkMaxGap.AddToLinkedControls(ucrNudMaximum, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.AddToLinkedControls(ucrChkSetSeed, {"Sample"}, bNewLinkedHideIfParameterMissing:=True) ucrChkSetSeed.AddToLinkedControls(ucrNudSetSeed, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) - ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkPrintSummary, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=5) ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) @@ -171,9 +171,6 @@ Public Class dlgInfillMissingValues ucrSaveNewColumn.SetIsComboBox() ucrSaveNewColumn.SetLabelText("New Column Name:") - ucrChkPrintSummary.SetParameter(New RParameter("print_summary", 6)) - ucrChkPrintSummary.SetText("Print summary") - ucrChkMeanBias.SetText("Maximum mean bias:") ucrChkMeanBias.AddParameterPresentCondition(True, "max_mean_bias") ucrChkMeanBias.AddParameterPresentCondition(False, "max_mean_bias", False) @@ -201,7 +198,6 @@ Public Class dlgInfillMissingValues clsSplineFunction = New RFunction clsNaFillFunction = New RFunction clsStructTSFunction = New RFunction - clsZooRegFunction = New RFunction clsSetSeedFunction = New RFunction clsAveFunction = New RFunction clsPatchClimateElementFunction = New RFunction @@ -215,7 +211,6 @@ Public Class dlgInfillMissingValues rdoLeaveAsMissing.Checked = True rdoNaApproximate.Checked = True ucrInputConstant.SetName("0") - rdoSingle.Checked = True clsApproximateFunction.SetPackageName("zoo") clsApproximateFunction.SetRCommand("na.approx") @@ -226,6 +221,7 @@ Public Class dlgInfillMissingValues clsAggregateFunction.SetPackageName("zoo") clsAggregateFunction.SetRCommand("na.aggregate") clsAggregateFunction.AddParameter("FUN", "summary_mean", iPosition:=2) + clsAggregateFunction.AddParameter("maxgap", 10, iPosition:=5) clsSetSeedFunction.SetRCommand("set.seed") @@ -247,11 +243,6 @@ Public Class dlgInfillMissingValues clsStructTSFunction.AddParameter("model", Chr(34) & "StructTS" & Chr(34), iPosition:=1) clsStructTSFunction.AddParameter("smooth", "TRUE", iPosition:=2) - clsZooRegFunction.SetPackageName("zoo") - clsZooRegFunction.SetRCommand("zooreg") - clsZooRegFunction.AddParameter("frequency", 2, iPosition:=0) - clsZooRegFunction.AddParameter("x", "x", iPosition:=0, bIncludeArgumentName:=False) - clsAveFunction.SetPackageName("stats") clsAveFunction.SetRCommand("ave") @@ -261,7 +252,6 @@ Public Class dlgInfillMissingValues clsBracketOperator.bSpaceAroundOperation = False clsPatchClimateElementFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$patch_climate_element") - clsPatchClimateElementFunction.AddParameter("print_summary", "TRUE", iPosition:=6) ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) @@ -279,7 +269,6 @@ Public Class dlgInfillMissingValues ucrReceiverElement.SetRCode(clsAveFunction, bReset) ucrReceiverStation.SetRCode(clsAveFunction, bReset) ucrReceiverByFactor.SetRCode(clsAggregateFunction, bReset) - 'ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) ucrInputComboFunction.SetRCode(clsAggregateFunction, bReset) ucrChkCopyFromBelow.SetRCode(clsNaLocfFunction, bReset) ucrChkBy.SetRCode(clsAggregateFunction, bReset) @@ -291,7 +280,6 @@ Public Class dlgInfillMissingValues ucrReceiverDate.SetRCode(clsPatchClimateElementFunction, bReset) ucrReceiverObserved.SetRCode(clsPatchClimateElementFunction, bReset) ucrReceiverEstimatedElements.SetRCode(clsPatchClimateElementFunction, bReset) - ucrChkPrintSummary.SetRCode(clsPatchClimateElementFunction, bReset) ucrInputMeanBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrInputStdBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrChkMeanBias.SetRCode(clsPatchClimateElementFunction, bReset) @@ -301,17 +289,16 @@ Public Class dlgInfillMissingValues ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) ucrSaveNewColumn.SetRCode(clsAveFunction, bReset) + + ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub ucrPnlMethods_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethods.ControlValueChanged, ucrReceiverElement.ControlValueChanged - ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) If rdoNaApproximate.Checked Then ucrSaveNewColumn.SetPrefix("Int_" & ucrReceiverElement.GetVariableNames(False)) clsBracketOperator.AddParameter("right", clsRFunctionParameter:=clsApproximateFunction, iPosition:=1) ElseIf rdoNaAggregate.Checked Then - ucrReceiverElement.SetMeAsReceiver() ucrSaveNewColumn.SetPrefix("Typ_" & ucrReceiverElement.GetVariableNames(False)) - ucrBase.clsRsyntax.SetBaseRFunction(clsAggregateFunction) ElseIf rdoNaFill.Checked Then ucrSaveNewColumn.SetPrefix("Con_" & ucrReceiverElement.GetVariableNames(False)) clsBracketOperator.AddParameter("right", clsRFunctionParameter:=clsNaFillFunction, iPosition:=1) @@ -375,27 +362,23 @@ Public Class dlgInfillMissingValues TestOkEnabled() End Sub - Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged - If rdoMultiple.Checked Then - Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.8) - ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.32) - ucrReceiverObserved.SetMeAsReceiver() - ucrBase.clsRsyntax.SetBaseRFunction(clsPatchClimateElementFunction) - Else + Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged, ucrPnlMethods.ControlValueChanged + If rdoSingle.Checked Then Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) ucrReceiverElement.SetMeAsReceiver() - ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) - End If - End Sub - - Private Sub ucrChkPrintSummary_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPrintSummary.ControlValueChanged, ucrPnlOptions.ControlValueChanged - If rdoMultiple.Checked AndAlso ucrChkPrintSummary.Checked Then - ucrBase.clsRsyntax.iCallType = 2 - ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - Else ucrBase.clsRsyntax.iCallType = 0 - ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True + If rdoNaAggregate.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsAggregateFunction) + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) + End If + ElseIf rdoMultiple.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsPatchClimateElementFunction) + ucrBase.clsRsyntax.iCallType = 2 + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.8) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.32) + ucrReceiverObserved.SetMeAsReceiver() End If End Sub From 367b53ea3e0687643162591397d427db371632c4 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 23 Aug 2020 13:43:50 +0300 Subject: [PATCH 016/102] Tab Order --- instat/dlgInfillMissingValues.resx | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index e1eb873bf94..1ec448202d0 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -382,7 +382,7 @@ 103, 27 - 3 + 2 Multiple @@ -430,7 +430,7 @@ 210, 99 - 14 + 21 Methods @@ -535,7 +535,7 @@ 181, 66 - 15 + 22 Start and End @@ -565,7 +565,7 @@ 37, 13 - 28 + 23 Value: @@ -625,7 +625,7 @@ 35, 13 - 13 + 18 row(s) @@ -685,7 +685,7 @@ 33, 13 - 30 + 6 Date: @@ -715,7 +715,7 @@ 56, 13 - 32 + 11 Estimated: @@ -745,7 +745,7 @@ 56, 13 - 34 + 9 Observed: @@ -775,7 +775,7 @@ 43, 13 - 42 + 4 Station: @@ -859,7 +859,7 @@ 47, 21 - 39 + 20 ucrInputStdBias @@ -880,7 +880,7 @@ 47, 21 - 40 + 17 ucrInputMeanBias @@ -901,7 +901,7 @@ 127, 20 - 37 + 19 ucrChkStdBias @@ -922,7 +922,7 @@ 127, 20 - 38 + 13 ucrChkMeanBias @@ -946,7 +946,7 @@ 120, 20 - 33 + 10 ucrReceiverObserved @@ -970,7 +970,7 @@ 120, 100 - 31 + 12 ucrReceiverEstimatedElements @@ -994,7 +994,7 @@ 120, 20 - 29 + 7 ucrReceiverDate @@ -1015,7 +1015,7 @@ 47, 21 - 19 + 24 ucrInputConstant @@ -1084,7 +1084,7 @@ 76, 20 - 18 + 27 ucrChkSetSeed @@ -1105,7 +1105,7 @@ 48, 20 - 19 + 28 ucrNudSetSeed @@ -1126,7 +1126,7 @@ 48, 20 - 12 + 15 ucrNudMaximum @@ -1147,7 +1147,7 @@ 96, 20 - 11 + 14 ucrChkMaxGap @@ -1189,7 +1189,7 @@ 110, 20 - 16 + 25 ucrChkCopyFromBelow @@ -1213,7 +1213,7 @@ 302, 25 - 20 + 29 ucrSaveNewColumn @@ -1234,7 +1234,7 @@ 66, 21 - 17 + 26 ucrInputComboFunction @@ -1279,7 +1279,7 @@ 410, 52 - 21 + 30 ucrBase @@ -1303,7 +1303,7 @@ 210, 180 - 4 + 3 ucrSelectorInfillMissing @@ -1360,7 +1360,7 @@ 120, 20 - 41 + 5 ucrReceiverMultipleStation From 50c6a14baf68fe8668510cadc5539e53799d307d Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 14:19:16 +0300 Subject: [PATCH 017/102] adding wrapper to imputeTS graphics options --- instat/static/InstatObject/R/data_object_R6.R | 47 +++++++++++++++++++ .../static/InstatObject/R/instat_object_R6.R | 5 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 48312694ace..057b0816fc0 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3650,4 +3650,51 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va } ) +DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461){ + curr_data <- self$get_data_frame() + if(!missing(station_col_name)){station_col <- self$get_columns_from_data(station_col_name);station_names <- unique(station_col)} + if(!missing(element_col_name)){element_col <- self$get_columns_from_data(element_col_name)} + if(!missing(element_col_name_imputed)){element_imputed_col <- self$get_columns_from_data(element_col_name_imputed)} + if(!(type %in% c("distribution", "gapsize", "interval", "imputation"))) stop(type, " must be either distribution, gapsize or imputation") + plt_list <- list() + if(type == "distribution"){ + if(!missing(station_col_name)){ + for (i in seq_along(station_names)) { + temp_data <- curr_data[station_col==station_names[i],] + plt_list[[i]] <- imputeTS::ggplot_na_distribution(x = temp_data[,element_col_name], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab) + } + }else{ + imputeTS::ggplot_na_distribution(x = element_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab) + } + }else if (type == "gapsize"){ + if(!missing(station_col_name)){ + for (i in seq_along(station_names)) { + temp_data <- curr_data[station_col==station_names[i],] + plt_list[[i]] <- imputeTS::ggplot_na_gapsize(x = temp_data[,element_col_name], include_total = TRUE, title =paste0(station_names[i], ":Occurrence of gap sizes"), xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) + } + }else{ + imputeTS::ggplot_na_gapsize(x = element_col, include_total = TRUE, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) + } + }else if(type == "interval"){ + if(!missing(station_col_name)){ + for (i in seq_along(station_names)) { + temp_data <- curr_data[station_col==station_names[i],] + plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[,element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size) + } + }else{ + imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size) + } + }else if (type == "imputation"){ + if(!missing(station_col_name)){ + for (i in seq_along(station_names)) { + temp_data <- curr_data[station_col==station_names[i],] + plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[,element_col_name], x_with_imputations = temp_data[,element_col_name_imputed], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend) + } + }else{ + imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend) + } + } + if(!missing(station_col_name)) gridExtra::grid.arrange(grobs = plt_list, ncol = ncol) +} +) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 9137d92516e..3af596f4046 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2093,4 +2093,7 @@ DataBook$set("public","patch_climate_element", function(data_name, date_col_name } ) - \ No newline at end of file +DataBook$set("public","visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size) { + self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed =element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size) +} +) From be7cddb5ea13a5c4b5a9007dc2ae05e74d878b3b Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 14:20:04 +0300 Subject: [PATCH 018/102] designer fixes: adding controls required for displaying graphics --- instat/dlgInfillMissingValues.Designer.vb | 238 +++++++- instat/dlgInfillMissingValues.resx | 650 +++++++++++++++++++--- 2 files changed, 771 insertions(+), 117 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index e8c3375a0d5..023a3ee1316 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -30,8 +30,8 @@ Partial Class dlgInfillMissingValues Me.rdoNaAggregate = New System.Windows.Forms.RadioButton() Me.rdoNaApproximate = New System.Windows.Forms.RadioButton() Me.lblElement = New System.Windows.Forms.Label() - Me.rdoSingle = New System.Windows.Forms.RadioButton() - Me.rdoMultiple = New System.Windows.Forms.RadioButton() + Me.rdoFitSingle = New System.Windows.Forms.RadioButton() + Me.rdoFitMultiple = New System.Windows.Forms.RadioButton() Me.grpMethods = New System.Windows.Forms.GroupBox() Me.ucrPnlMethods = New instat.UcrPanel() Me.grpStartEnd = New System.Windows.Forms.GroupBox() @@ -47,6 +47,18 @@ Partial Class dlgInfillMissingValues Me.lblObserved = New System.Windows.Forms.Label() Me.lblMultipleStation = New System.Windows.Forms.Label() Me.lblNewColumnName = New System.Windows.Forms.Label() + Me.rdoDisplay = New System.Windows.Forms.RadioButton() + Me.rdoShow = New System.Windows.Forms.RadioButton() + Me.lblFacetColumns = New System.Windows.Forms.Label() + Me.lblImputed = New System.Windows.Forms.Label() + Me.lblDisplayElement = New System.Windows.Forms.Label() + Me.lblDisplayDate = New System.Windows.Forms.Label() + Me.ucrSaveGraph = New instat.ucrSave() + Me.ucrNudFacetColumns = New instat.ucrNud() + Me.ucrReceiverImputed = New instat.ucrReceiverSingle() + Me.ucrReceiverDisplayObserved = New instat.ucrReceiverSingle() + Me.ucrReceiverDisplayShowDate = New instat.ucrReceiverSingle() + Me.ucrInputNewColumnName = New instat.ucrInputTextBox() Me.ucrReceiverMultipleStation = New instat.ucrReceiverSingle() Me.ucrInputStdBias = New instat.ucrInputTextBox() Me.ucrInputMeanBias = New instat.ucrInputTextBox() @@ -70,7 +82,13 @@ Partial Class dlgInfillMissingValues Me.ucrBase = New instat.ucrButtons() Me.ucrSelectorInfillMissing = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrPnlOptions = New instat.UcrPanel() - Me.ucrInputNewColumnName = New instat.ucrInputTextBox() + Me.ucrChkAddLegend = New instat.ucrCheck() + Me.ucrInputComboType = New instat.ucrInputComboBox() + Me.lblType = New System.Windows.Forms.Label() + Me.ucrChkFlipCordinates = New instat.ucrCheck() + Me.cmdDisplayOptions = New System.Windows.Forms.Button() + Me.ucrInputIntervalSize = New instat.ucrInputTextBox() + Me.lblIntervalSize = New System.Windows.Forms.Label() Me.grpMethods.SuspendLayout() Me.grpStartEnd.SuspendLayout() Me.SuspendLayout() @@ -122,25 +140,25 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblElement, "lblElement") Me.lblElement.Name = "lblElement" ' - 'rdoSingle + 'rdoFitSingle ' - resources.ApplyResources(Me.rdoSingle, "rdoSingle") - Me.rdoSingle.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoSingle.FlatAppearance.BorderSize = 2 - Me.rdoSingle.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoSingle.Name = "rdoSingle" - Me.rdoSingle.TabStop = True - Me.rdoSingle.UseVisualStyleBackColor = True + resources.ApplyResources(Me.rdoFitSingle, "rdoFitSingle") + Me.rdoFitSingle.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFitSingle.FlatAppearance.BorderSize = 2 + Me.rdoFitSingle.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFitSingle.Name = "rdoFitSingle" + Me.rdoFitSingle.TabStop = True + Me.rdoFitSingle.UseVisualStyleBackColor = True ' - 'rdoMultiple + 'rdoFitMultiple ' - resources.ApplyResources(Me.rdoMultiple, "rdoMultiple") - Me.rdoMultiple.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoMultiple.FlatAppearance.BorderSize = 2 - Me.rdoMultiple.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoMultiple.Name = "rdoMultiple" - Me.rdoMultiple.TabStop = True - Me.rdoMultiple.UseVisualStyleBackColor = True + resources.ApplyResources(Me.rdoFitMultiple, "rdoFitMultiple") + Me.rdoFitMultiple.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFitMultiple.FlatAppearance.BorderSize = 2 + Me.rdoFitMultiple.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoFitMultiple.Name = "rdoFitMultiple" + Me.rdoFitMultiple.TabStop = True + Me.rdoFitMultiple.UseVisualStyleBackColor = True ' 'grpMethods ' @@ -233,6 +251,96 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblNewColumnName, "lblNewColumnName") Me.lblNewColumnName.Name = "lblNewColumnName" ' + 'rdoDisplay + ' + resources.ApplyResources(Me.rdoDisplay, "rdoDisplay") + Me.rdoDisplay.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDisplay.FlatAppearance.BorderSize = 2 + Me.rdoDisplay.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDisplay.Name = "rdoDisplay" + Me.rdoDisplay.TabStop = True + Me.rdoDisplay.UseVisualStyleBackColor = True + ' + 'rdoShow + ' + resources.ApplyResources(Me.rdoShow, "rdoShow") + Me.rdoShow.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoShow.FlatAppearance.BorderSize = 2 + Me.rdoShow.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoShow.Name = "rdoShow" + Me.rdoShow.TabStop = True + Me.rdoShow.UseVisualStyleBackColor = True + ' + 'lblFacetColumns + ' + resources.ApplyResources(Me.lblFacetColumns, "lblFacetColumns") + Me.lblFacetColumns.Name = "lblFacetColumns" + ' + 'lblImputed + ' + resources.ApplyResources(Me.lblImputed, "lblImputed") + Me.lblImputed.Name = "lblImputed" + ' + 'lblDisplayElement + ' + resources.ApplyResources(Me.lblDisplayElement, "lblDisplayElement") + Me.lblDisplayElement.Name = "lblDisplayElement" + ' + 'lblDisplayDate + ' + resources.ApplyResources(Me.lblDisplayDate, "lblDisplayDate") + Me.lblDisplayDate.Name = "lblDisplayDate" + ' + 'ucrSaveGraph + ' + resources.ApplyResources(Me.ucrSaveGraph, "ucrSaveGraph") + Me.ucrSaveGraph.Name = "ucrSaveGraph" + ' + 'ucrNudFacetColumns + ' + Me.ucrNudFacetColumns.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFacetColumns.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + resources.ApplyResources(Me.ucrNudFacetColumns, "ucrNudFacetColumns") + Me.ucrNudFacetColumns.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudFacetColumns.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudFacetColumns.Name = "ucrNudFacetColumns" + Me.ucrNudFacetColumns.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrReceiverImputed + ' + Me.ucrReceiverImputed.frmParent = Me + resources.ApplyResources(Me.ucrReceiverImputed, "ucrReceiverImputed") + Me.ucrReceiverImputed.Name = "ucrReceiverImputed" + Me.ucrReceiverImputed.Selector = Nothing + Me.ucrReceiverImputed.strNcFilePath = "" + Me.ucrReceiverImputed.ucrSelector = Nothing + ' + 'ucrReceiverDisplayObserved + ' + Me.ucrReceiverDisplayObserved.frmParent = Me + resources.ApplyResources(Me.ucrReceiverDisplayObserved, "ucrReceiverDisplayObserved") + Me.ucrReceiverDisplayObserved.Name = "ucrReceiverDisplayObserved" + Me.ucrReceiverDisplayObserved.Selector = Nothing + Me.ucrReceiverDisplayObserved.strNcFilePath = "" + Me.ucrReceiverDisplayObserved.ucrSelector = Nothing + ' + 'ucrReceiverDisplayShowDate + ' + Me.ucrReceiverDisplayShowDate.frmParent = Me + resources.ApplyResources(Me.ucrReceiverDisplayShowDate, "ucrReceiverDisplayShowDate") + Me.ucrReceiverDisplayShowDate.Name = "ucrReceiverDisplayShowDate" + Me.ucrReceiverDisplayShowDate.Selector = Nothing + Me.ucrReceiverDisplayShowDate.strNcFilePath = "" + Me.ucrReceiverDisplayShowDate.ucrSelector = Nothing + ' + 'ucrInputNewColumnName + ' + Me.ucrInputNewColumnName.AddQuotesIfUnrecognised = True + Me.ucrInputNewColumnName.IsMultiline = False + Me.ucrInputNewColumnName.IsReadOnly = False + resources.ApplyResources(Me.ucrInputNewColumnName, "ucrInputNewColumnName") + Me.ucrInputNewColumnName.Name = "ucrInputNewColumnName" + ' 'ucrReceiverMultipleStation ' Me.ucrReceiverMultipleStation.frmParent = Me @@ -407,18 +515,72 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.ucrPnlOptions, "ucrPnlOptions") Me.ucrPnlOptions.Name = "ucrPnlOptions" ' - 'ucrInputNewColumnName + 'ucrChkAddLegend ' - Me.ucrInputNewColumnName.AddQuotesIfUnrecognised = True - Me.ucrInputNewColumnName.IsMultiline = False - Me.ucrInputNewColumnName.IsReadOnly = False - resources.ApplyResources(Me.ucrInputNewColumnName, "ucrInputNewColumnName") - Me.ucrInputNewColumnName.Name = "ucrInputNewColumnName" + Me.ucrChkAddLegend.Checked = False + resources.ApplyResources(Me.ucrChkAddLegend, "ucrChkAddLegend") + Me.ucrChkAddLegend.Name = "ucrChkAddLegend" + ' + 'ucrInputComboType + ' + Me.ucrInputComboType.AddQuotesIfUnrecognised = True + Me.ucrInputComboType.GetSetSelectedIndex = -1 + Me.ucrInputComboType.IsReadOnly = False + resources.ApplyResources(Me.ucrInputComboType, "ucrInputComboType") + Me.ucrInputComboType.Name = "ucrInputComboType" + ' + 'lblType + ' + resources.ApplyResources(Me.lblType, "lblType") + Me.lblType.Name = "lblType" + ' + 'ucrChkFlipCordinates + ' + Me.ucrChkFlipCordinates.Checked = False + resources.ApplyResources(Me.ucrChkFlipCordinates, "ucrChkFlipCordinates") + Me.ucrChkFlipCordinates.Name = "ucrChkFlipCordinates" + ' + 'cmdDisplayOptions + ' + resources.ApplyResources(Me.cmdDisplayOptions, "cmdDisplayOptions") + Me.cmdDisplayOptions.Name = "cmdDisplayOptions" + Me.cmdDisplayOptions.UseVisualStyleBackColor = True + ' + 'ucrInputIntervalSize + ' + Me.ucrInputIntervalSize.AddQuotesIfUnrecognised = True + Me.ucrInputIntervalSize.IsMultiline = False + Me.ucrInputIntervalSize.IsReadOnly = False + resources.ApplyResources(Me.ucrInputIntervalSize, "ucrInputIntervalSize") + Me.ucrInputIntervalSize.Name = "ucrInputIntervalSize" + ' + 'lblIntervalSize + ' + resources.ApplyResources(Me.lblIntervalSize, "lblIntervalSize") + Me.lblIntervalSize.Name = "lblIntervalSize" ' 'dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblIntervalSize) + Me.Controls.Add(Me.ucrInputIntervalSize) + Me.Controls.Add(Me.cmdDisplayOptions) + Me.Controls.Add(Me.ucrChkFlipCordinates) + Me.Controls.Add(Me.lblType) + Me.Controls.Add(Me.ucrInputComboType) + Me.Controls.Add(Me.ucrChkAddLegend) + Me.Controls.Add(Me.ucrSaveGraph) + Me.Controls.Add(Me.lblDisplayDate) + Me.Controls.Add(Me.lblDisplayElement) + Me.Controls.Add(Me.lblImputed) + Me.Controls.Add(Me.lblFacetColumns) + Me.Controls.Add(Me.ucrNudFacetColumns) + Me.Controls.Add(Me.ucrReceiverImputed) + Me.Controls.Add(Me.ucrReceiverDisplayObserved) + Me.Controls.Add(Me.ucrReceiverDisplayShowDate) + Me.Controls.Add(Me.rdoShow) + Me.Controls.Add(Me.rdoDisplay) Me.Controls.Add(Me.ucrInputNewColumnName) Me.Controls.Add(Me.lblMultipleStation) Me.Controls.Add(Me.lblNewColumnName) @@ -449,8 +611,8 @@ Partial Class dlgInfillMissingValues Me.Controls.Add(Me.lblFunction) Me.Controls.Add(Me.ucrSaveNewColumn) Me.Controls.Add(Me.ucrInputComboFunction) - Me.Controls.Add(Me.rdoMultiple) - Me.Controls.Add(Me.rdoSingle) + Me.Controls.Add(Me.rdoFitMultiple) + Me.Controls.Add(Me.rdoFitSingle) Me.Controls.Add(Me.lblElement) Me.Controls.Add(Me.ucrReceiverElement) Me.Controls.Add(Me.ucrBase) @@ -480,8 +642,8 @@ Partial Class dlgInfillMissingValues Friend WithEvents rdoNaLocf As RadioButton Friend WithEvents rdoNaStructTS As RadioButton Friend WithEvents lblElement As Label - Friend WithEvents rdoMultiple As RadioButton - Friend WithEvents rdoSingle As RadioButton + Friend WithEvents rdoFitMultiple As RadioButton + Friend WithEvents rdoFitSingle As RadioButton Friend WithEvents ucrPnlOptions As UcrPanel Friend WithEvents ucrPnlMethods As UcrPanel Friend WithEvents grpMethods As GroupBox @@ -518,4 +680,22 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrReceiverMultipleStation As ucrReceiverSingle Friend WithEvents ucrInputNewColumnName As ucrInputTextBox Friend WithEvents lblNewColumnName As Label + Friend WithEvents rdoShow As RadioButton + Friend WithEvents rdoDisplay As RadioButton + Friend WithEvents ucrReceiverDisplayObserved As ucrReceiverSingle + Friend WithEvents ucrReceiverDisplayShowDate As ucrReceiverSingle + Friend WithEvents ucrReceiverImputed As ucrReceiverSingle + Friend WithEvents ucrNudFacetColumns As ucrNud + Friend WithEvents lblFacetColumns As Label + Friend WithEvents lblImputed As Label + Friend WithEvents lblDisplayDate As Label + Friend WithEvents lblDisplayElement As Label + Friend WithEvents ucrSaveGraph As ucrSave + Friend WithEvents ucrChkAddLegend As ucrCheck + Friend WithEvents lblType As Label + Friend WithEvents ucrInputComboType As ucrInputComboBox + Friend WithEvents ucrChkFlipCordinates As ucrCheck + Friend WithEvents cmdDisplayOptions As Button + Friend WithEvents lblIntervalSize As Label + Friend WithEvents ucrInputIntervalSize As ucrInputTextBox End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 1ec448202d0..1d40931e255 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -328,79 +328,79 @@ $this - 32 + 50 - + Button - + Flat - + NoControl - + 112, 29 - - 103, 27 + + 95, 27 - + 1 - - Single + + Fit Single - + MiddleCenter - - rdoSingle + + rdoFitSingle - + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 31 + + 49 - + Button - + Flat - + NoControl - - 214, 29 + + 205, 29 - - 103, 27 + + 95, 27 - + 2 - - Multiple + + Fit Multiple - + MiddleCenter - - rdoMultiple + + rdoFitMultiple - + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 30 + + 48 6, 15 @@ -445,7 +445,7 @@ $this - 37 + 55 True @@ -532,7 +532,7 @@ 228, 317 - 181, 66 + 183, 66 22 @@ -550,7 +550,7 @@ $this - 26 + 44 True @@ -580,7 +580,7 @@ $this - 14 + 32 True @@ -610,7 +610,7 @@ $this - 27 + 45 True @@ -640,7 +640,7 @@ $this - 21 + 39 True @@ -670,7 +670,7 @@ $this - 15 + 33 True @@ -679,7 +679,7 @@ NoControl - 282, 125 + 281, 125 33, 13 @@ -700,7 +700,7 @@ $this - 12 + 30 True @@ -709,7 +709,7 @@ NoControl - 283, 210 + 281, 210 56, 13 @@ -730,7 +730,7 @@ $this - 10 + 28 True @@ -739,7 +739,7 @@ NoControl - 282, 167 + 281, 167 56, 13 @@ -760,7 +760,7 @@ $this - 8 + 26 True @@ -769,7 +769,7 @@ NoControl - 282, 83 + 281, 83 43, 13 @@ -790,7 +790,7 @@ $this - 1 + 19 True @@ -820,7 +820,244 @@ $this - 2 + 20 + + + Button + + + Flat + + + NoControl + + + 19, 29 + + + 95, 27 + + + 44 + + + Display + + + MiddleCenter + + + rdoDisplay + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 17 + + + Button + + + Flat + + + NoControl + + + 298, 29 + + + 95, 27 + + + 45 + + + Show + + + MiddleCenter + + + rdoShow + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 16 + + + True + + + NoControl + + + 281, 254 + + + 86, 13 + + + 50 + + + Facet Column(s): + + + lblFacetColumns + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + True + + + NoControl + + + 281, 208 + + + 48, 13 + + + 51 + + + Imputed: + + + lblImputed + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + True + + + NoControl + + + 281, 166 + + + 48, 13 + + + 52 + + + Element: + + + lblDisplayElement + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + True + + + NoControl + + + 281, 125 + + + 33, 13 + + + 53 + + + Date: + + + lblDisplayDate + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 12, 296 + + + 4, 5, 4, 5 + + + 255, 24 + + + 55 + + + ucrSaveGraph + + + instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 7 + + + 368, 252 + + + 48, 20 + + + 49 + + + ucrNudFacetColumns + + + instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 12 True @@ -831,6 +1068,219 @@ 421, 540 + + True + + + 281, 297 + + + 68, 13 + + + 62 + + + Interval Size: + + + lblIntervalSize + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 352, 294 + + + 62, 21 + + + 61 + + + ucrInputIntervalSize + + + instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 1 + + + False + + + 13, 258 + + + 119, 23 + + + 60 + + + Display Options + + + cmdDisplayOptions + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 281, 295 + + + 134, 20 + + + 59 + + + ucrChkFlipCordinates + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + + + True + + + 281, 208 + + + 34, 13 + + + 58 + + + Type: + + + lblType + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 281, 224 + + + 120, 21 + + + 57 + + + ucrInputComboType + + + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 + + + 281, 272 + + + 134, 20 + + + 56 + + + ucrChkAddLegend + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 6 + + + 281, 182 + + + 0, 0, 0, 0 + + + 120, 20 + + + 47 + + + ucrReceiverDisplayObserved + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 14 + + + 281, 139 + + + 0, 0, 0, 0 + + + 120, 20 + + + 46 + + + ucrReceiverDisplayShowDate + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 15 + 113, 333 @@ -850,7 +1300,31 @@ $this - 0 + 18 + + + 281, 98 + + + 0, 0, 0, 0 + + + 120, 20 + + + 5 + + + ucrReceiverMultipleStation + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 21 144, 309 @@ -871,7 +1345,7 @@ $this - 4 + 22 144, 286 @@ -892,7 +1366,7 @@ $this - 5 + 23 14, 309 @@ -913,7 +1387,7 @@ $this - 6 + 24 14, 286 @@ -934,7 +1408,7 @@ $this - 7 + 25 281, 182 @@ -958,7 +1432,7 @@ $this - 9 + 27 281, 224 @@ -982,7 +1456,7 @@ $this - 11 + 29 281, 140 @@ -1006,7 +1480,7 @@ $this - 13 + 31 279, 384 @@ -1027,7 +1501,7 @@ $this - 16 + 34 281, 207 @@ -1051,7 +1525,7 @@ $this - 17 + 35 281, 98 @@ -1075,7 +1549,7 @@ $this - 18 + 36 146, 427 @@ -1096,7 +1570,7 @@ $this - 19 + 37 223, 427 @@ -1117,7 +1591,7 @@ $this - 20 + 38 110, 279 @@ -1138,7 +1612,7 @@ $this - 22 + 40 12, 280 @@ -1159,7 +1633,7 @@ $this - 23 + 41 281, 184 @@ -1180,7 +1654,7 @@ $this - 24 + 42 12, 427 @@ -1201,7 +1675,7 @@ $this - 25 + 43 12, 455 @@ -1225,7 +1699,7 @@ $this - 28 + 46 66, 426 @@ -1246,7 +1720,7 @@ $this - 29 + 47 281, 149 @@ -1270,7 +1744,7 @@ $this - 33 + 51 12, 483 @@ -1291,7 +1765,7 @@ $this - 34 + 52 12, 75 @@ -1315,13 +1789,13 @@ $this - 35 + 53 - 95, 12 + 12, 12 - 230, 58 + 397, 58 0 @@ -1336,13 +1810,13 @@ $this - 36 + 54 CenterScreen - Infill Missing Values + Missing Values dlgInfillMissingValues @@ -1350,28 +1824,28 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 281, 98 + + 281, 224 - + 0, 0, 0, 0 - + 120, 20 - - 5 + + 48 - - ucrReceiverMultipleStation + + ucrReceiverImputed - + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 3 + + 13 \ No newline at end of file From d9da5ad7050a54cdfc734d1305501347aeb74089 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 14:20:57 +0300 Subject: [PATCH 019/102] implementation of imputeTS graphical options --- instat/dlgInfillMissingValues.vb | 166 +++++++++++++++++++++++++++---- 1 file changed, 148 insertions(+), 18 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index a2ac92458af..3d8c5928795 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -15,13 +15,12 @@ ' along with this program. If not, see . Imports instat.Translations - Public Class dlgInfillMissingValues Private bFirstLoad As Boolean = True Private bReset As Boolean = True Private iDialogHeight As Integer Private iBaseMaxY - Private clsApproximateFunction, clsAggregateFunction, clsNaLocfFunction, clsSplineFunction, clsNaFillFunction, clsStructTSFunction, clsSetSeedFunction, clsAveFunction, clsPatchClimateElementFunction As New RFunction + Private clsApproximateFunction, clsAggregateFunction, clsNaLocfFunction, clsSplineFunction, clsNaFillFunction, clsStructTSFunction, clsSetSeedFunction, clsAveFunction, clsPatchClimateElementFunction, clsVisualizeElementNa As New RFunction Private clsBracketOperator As New ROperator Private Sub dlgInfillMissingValues_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) @@ -41,15 +40,22 @@ Public Class dlgInfillMissingValues Private Sub InitialiseDialog() Dim dctFunctionNames As New Dictionary(Of String, String) + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False 'TODO:Enabled once working, added now for display purposes and therefore show the intention! ucrReceiverMultipleStation.Enabled = False lblMultipleStation.Enabled = False - ucrPnlOptions.AddRadioButton(rdoSingle) - ucrPnlOptions.AddRadioButton(rdoMultiple) - ucrPnlOptions.AddFunctionNamesCondition(rdoSingle, {"ave", "na.aggregate"}) - ucrPnlOptions.AddFunctionNamesCondition(rdoMultiple, {frmMain.clsRLink.strInstatDataObject & "$patch_climate_element"}) + ucrPnlOptions.AddRadioButton(rdoDisplay) + ucrPnlOptions.AddRadioButton(rdoFitSingle) + ucrPnlOptions.AddRadioButton(rdoFitMultiple) + ucrPnlOptions.AddRadioButton(rdoShow) + + ucrPnlOptions.AddFunctionNamesCondition(rdoFitSingle, {"ave", "na.aggregate"}) + ucrPnlOptions.AddFunctionNamesCondition(rdoFitMultiple, {frmMain.clsRLink.strInstatDataObject & "$patch_climate_element"}) + ucrPnlOptions.AddFunctionNamesCondition({rdoDisplay, rdoShow}, frmMain.clsRLink.strInstatDataObject & "visualize_element_na") + ucrPnlOptions.AddParameterValuesCondition(rdoDisplay, "type", "distribution") + ucrPnlOptions.AddParameterValuesCondition(rdoShow, "type", "imputations") ucrPnlMethods.AddRadioButton(rdoNaAggregate) ucrPnlMethods.AddRadioButton(rdoNaApproximate) @@ -139,6 +145,22 @@ Public Class dlgInfillMissingValues ucrReceiverEstimatedElements.SetParameterIsString() ucrReceiverEstimatedElements.SetDataType("numeric", bStrict:=True) + ucrReceiverDisplayShowDate.SetParameter(New RParameter("x_axis_labels_col_name", 4)) + ucrReceiverDisplayShowDate.Selector = ucrSelectorInfillMissing + ucrReceiverDisplayShowDate.SetParameterIsString() + ucrReceiverDisplayShowDate.SetClimaticType("date") + ucrReceiverDisplayShowDate.bAutoFill = True + + ucrReceiverDisplayObserved.SetParameter(New RParameter("element_col_name", 1)) + ucrReceiverDisplayObserved.Selector = ucrSelectorInfillMissing + ucrReceiverDisplayObserved.SetParameterIsString() + ucrReceiverDisplayObserved.SetDataType("numeric", bStrict:=True) + + ucrReceiverImputed.SetParameter(New RParameter("element_col_name_imputed", 2)) + ucrReceiverImputed.Selector = ucrSelectorInfillMissing + ucrReceiverImputed.SetParameterIsString() + ucrReceiverImputed.SetDataType("numeric", bStrict:=True) + ucrPnlStartEnd.AddToLinkedControls(ucrInputConstant, {rdoLeaveAsMissing, rdoExtendFill}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrInputComboFunction, {rdoNaAggregate}, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrReceiverStation, {rdoNaApproximate, rdoNaFill, rdoNaSpline, rdoNaLocf, rdoNaStructTS}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -149,10 +171,15 @@ Public Class dlgInfillMissingValues ucrChkMaxGap.AddToLinkedControls(ucrNudMaximum, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.AddToLinkedControls(ucrChkSetSeed, {"Sample"}, bNewLinkedHideIfParameterMissing:=True) ucrChkSetSeed.AddToLinkedControls(ucrNudSetSeed, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) - ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoFitMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoFitSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=5) ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) + ucrPnlOptions.AddToLinkedControls({ucrReceiverStation, ucrSaveGraph, ucrReceiverDisplayShowDate, ucrReceiverDisplayObserved}, {rdoDisplay, rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverImputed}, {rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrInputComboType}, {rdoDisplay}, bNewLinkedHideIfParameterMissing:=True) + ucrInputComboType.AddToLinkedControls({ucrChkFlipCordinates}, {"Gap size"}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrInputComboType.AddToLinkedControls({ucrInputIntervalSize}, {"Intervals"}, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.SetLinkedDisplayControl(lblFunction) ucrPnlStartEnd.SetLinkedDisplayControl(grpStartEnd) ucrNudMaximum.SetLinkedDisplayControl(lblRows) @@ -165,6 +192,11 @@ Public Class dlgInfillMissingValues ucrReceiverObserved.SetLinkedDisplayControl(lblObserved) ucrReceiverMultipleStation.SetLinkedDisplayControl(lblMultipleStation) ucrInputNewColumnName.SetLinkedDisplayControl(lblNewColumnName) + ucrReceiverDisplayShowDate.SetLinkedDisplayControl(lblDisplayDate) + ucrReceiverDisplayObserved.SetLinkedDisplayControl(lblDisplayElement) + ucrReceiverImputed.SetLinkedDisplayControl(lblImputed) + ucrInputComboType.SetLinkedDisplayControl(lblType) + ucrInputIntervalSize.SetLinkedDisplayControl(lblIntervalSize) ucrSaveNewColumn.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveNewColumn.SetSaveTypeAsColumn() @@ -189,6 +221,33 @@ Public Class dlgInfillMissingValues ucrInputNewColumnName.SetParameter(New RParameter("column_name", 7)) ucrInputNewColumnName.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) + + ucrNudFacetColumns.SetParameter(New RParameter("ncol", 4)) + ucrNudFacetColumns.SetMinMax(iNewMin:=1) + + ucrChkAddLegend.SetParameter(New RParameter("legend", 9)) + ucrChkAddLegend.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkAddLegend.SetText("Add legend") + ucrChkAddLegend.SetRDefault("TRUE") + + ucrChkFlipCordinates.SetParameter(New RParameter("orientation", 10)) + ucrChkFlipCordinates.SetValuesCheckedAndUnchecked(Chr(34) & "horizontal" & Chr(34), Chr(34) & "vertical" & Chr(34)) + ucrChkFlipCordinates.SetText("Flip coordinates") + ucrChkFlipCordinates.SetRDefault(Chr(34) & "horizontal" & Chr(34)) + + ucrInputComboType.SetItems({"Distribution", "Gap size", "Intervals"}) + ucrInputComboType.SetDropDownStyleAsNonEditable() + + ucrInputIntervalSize.SetParameter(New RParameter("interval_size", 11)) + ucrInputIntervalSize.SetValidationTypeAsNumeric() + ucrInputIntervalSize.AddQuotesIfUnrecognised = False + + ucrSaveGraph.SetPrefix("lineplot") + ucrSaveGraph.SetSaveTypeAsGraph() + ucrSaveGraph.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) + ucrSaveGraph.SetCheckBoxText("Save Graph") + ucrSaveGraph.SetIsComboBox() + ucrSaveGraph.SetAssignToIfUncheckedValue("last_graph") End Sub Private Sub SetDefaults() @@ -201,16 +260,21 @@ Public Class dlgInfillMissingValues clsSetSeedFunction = New RFunction clsAveFunction = New RFunction clsPatchClimateElementFunction = New RFunction + clsVisualizeElementNa = New RFunction clsBracketOperator = New ROperator ucrSelectorInfillMissing.Reset() ucrReceiverElement.SetMeAsReceiver() ucrSaveNewColumn.Reset() + 'Temp fix: Set panel conditions properly! rdoLeaveAsMissing.Checked = True rdoNaApproximate.Checked = True ucrInputConstant.SetName("0") + rdoDisplay.Checked = True + ucrChkMaxGap.Checked = True + ucrInputComboType.cboInput.SelectedItem = "Distribution" clsApproximateFunction.SetPackageName("zoo") clsApproximateFunction.SetRCommand("na.approx") @@ -253,8 +317,15 @@ Public Class dlgInfillMissingValues clsPatchClimateElementFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$patch_climate_element") + clsVisualizeElementNa.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$visualize_element_na") + clsVisualizeElementNa.AddParameter("data_name", Chr(34) & ucrSelectorInfillMissing.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) + clsVisualizeElementNa.AddParameter("type", Chr(34) & "distribution" & Chr(34), iPosition:=8) + clsVisualizeElementNa.AddParameter("interval_size", 1461, iPosition:=11) + clsVisualizeElementNa.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorInfillMissing.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") + clsVisualizeElementNa.AddParameter("ncol", 1, iPosition:=4) + ucrBase.clsRsyntax.ClearCodes() - ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) + ucrBase.clsRsyntax.SetBaseRFunction(clsVisualizeElementNa) End Sub Private Sub SetRcodeForControls(bReset As Boolean) @@ -273,7 +344,7 @@ Public Class dlgInfillMissingValues ucrChkCopyFromBelow.SetRCode(clsNaLocfFunction, bReset) ucrChkBy.SetRCode(clsAggregateFunction, bReset) ucrNudMaximum.SetRCode(clsApproximateFunction, bReset) - ucrChkMaxGap.SetRCode(clsApproximateFunction, bReset) + 'ucrChkMaxGap.SetRCode(clsApproximateFunction, bReset) ucrNudSetSeed.SetRCode(clsSetSeedFunction, bReset) ucrChkSetSeed.SetRSyntax(ucrBase.clsRsyntax, bReset) ucrSelectorInfillMissing.SetRCode(clsPatchClimateElementFunction, bReset) @@ -285,12 +356,20 @@ Public Class dlgInfillMissingValues ucrChkMeanBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrChkStdBias.SetRCode(clsPatchClimateElementFunction, bReset) ucrInputNewColumnName.SetRCode(clsPatchClimateElementFunction, bReset) + ucrReceiverDisplayObserved.SetRCode(clsVisualizeElementNa, bReset) + ucrReceiverDisplayShowDate.SetRCode(clsVisualizeElementNa, bReset) + ucrReceiverImputed.SetRCode(clsVisualizeElementNa, bReset) + ucrNudFacetColumns.SetRCode(clsVisualizeElementNa, bReset) + ucrChkAddLegend.SetRCode(clsVisualizeElementNa, bReset) + ucrChkFlipCordinates.SetRCode(clsVisualizeElementNa, bReset) + ucrInputIntervalSize.SetRCode(clsVisualizeElementNa, bReset) ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) ucrSaveNewColumn.SetRCode(clsAveFunction, bReset) + ucrSaveGraph.SetRCode(clsVisualizeElementNa, bReset) - ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) + 'ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) End Sub Private Sub ucrPnlMethods_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlMethods.ControlValueChanged, ucrReceiverElement.ControlValueChanged @@ -334,7 +413,7 @@ Public Class dlgInfillMissingValues End Sub Private Sub ucrInputComboFunction_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboFunction.ControlValueChanged, ucrPnlMethods.ControlValueChanged, ucrChkSetSeed.ControlValueChanged, ucrPnlOptions.ControlValueChanged - If rdoSingle.Checked AndAlso rdoNaAggregate.Checked AndAlso ucrChkSetSeed.Checked Then + If rdoFitSingle.Checked AndAlso rdoNaAggregate.Checked AndAlso ucrChkSetSeed.Checked Then Select Case ucrInputComboFunction.GetValue() Case "Sample" ucrBase.clsRsyntax.AddToBeforeCodes(clsSetSeedFunction, 0) @@ -347,9 +426,11 @@ Public Class dlgInfillMissingValues End Sub Private Sub TestOkEnabled() - If rdoSingle.Checked AndAlso (ucrReceiverElement.IsEmpty OrElse Not ucrSaveNewColumn.IsComplete OrElse (rdoNaFill.Checked AndAlso ((rdoLeaveAsMissing.Checked OrElse rdoExtendFill.Checked) AndAlso ucrInputConstant.IsEmpty))) Then + If rdoFitSingle.Checked AndAlso (ucrReceiverElement.IsEmpty OrElse Not ucrSaveNewColumn.IsComplete OrElse (rdoNaFill.Checked AndAlso ((rdoLeaveAsMissing.Checked OrElse rdoExtendFill.Checked) AndAlso ucrInputConstant.IsEmpty))) Then ucrBase.OKEnabled(False) - ElseIf rdoMultiple.Checked AndAlso (ucrReceiverDate.IsEmpty OrElse ucrReceiverObserved.IsEmpty OrElse ucrReceiverEstimatedElements.IsEmpty OrElse (ucrChkMeanBias.Checked AndAlso ucrInputMeanBias.IsEmpty) OrElse (ucrChkStdBias.Checked AndAlso ucrInputStdBias.IsEmpty) OrElse ucrInputNewColumnName.IsEmpty) Then + ElseIf rdoFitMultiple.Checked AndAlso (ucrReceiverDate.IsEmpty OrElse ucrReceiverObserved.IsEmpty OrElse ucrReceiverEstimatedElements.IsEmpty OrElse (ucrChkMeanBias.Checked AndAlso ucrInputMeanBias.IsEmpty) OrElse (ucrChkStdBias.Checked AndAlso ucrInputStdBias.IsEmpty) OrElse ucrInputNewColumnName.IsEmpty) Then + ucrBase.OKEnabled(False) + ElseIf (rdoShow.Checked AndAlso ucrReceiverImputed.IsEmpty) OrElse (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso (ucrReceiverDisplayShowDate.IsEmpty OrElse ucrReceiverDisplayObserved.IsEmpty OrElse Not ucrSaveGraph.IsComplete) Then ucrBase.OKEnabled(False) Else ucrBase.OKEnabled(True) @@ -362,8 +443,33 @@ Public Class dlgInfillMissingValues TestOkEnabled() End Sub - Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged, ucrPnlMethods.ControlValueChanged - If rdoSingle.Checked Then + Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged, ucrPnlMethods.ControlValueChanged, ucrInputComboType.ControlValueChanged + If rdoDisplay.Checked OrElse rdoShow.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsVisualizeElementNa) + ucrBase.clsRsyntax.iCallType = 3 + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.72) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.5) + ucrReceiverDisplayObserved.SetMeAsReceiver() + If rdoDisplay.Checked Then + Select Case ucrInputComboType.GetText + Case "Distribution" + ucrChkAddLegend.Visible = False + clsVisualizeElementNa.AddParameter("type", Chr(34) & "distribution" & Chr(34), iPosition:=8) + Case "Gap size" + ucrChkAddLegend.Visible = True + clsVisualizeElementNa.AddParameter("type", Chr(34) & "gapsize" & Chr(34), iPosition:=8) + Case "Intervals" + ucrChkAddLegend.Visible = True + clsVisualizeElementNa.AddParameter("type", Chr(34) & "interval" & Chr(34), iPosition:=8) + End Select + ElseIf rdoShow.Checked Then + ucrChkAddLegend.Visible = True + clsVisualizeElementNa.AddParameter("type", Chr(34) & "imputation" & Chr(34), iPosition:=8) + End If + cmdDisplayOptions.Visible = True + ElseIf rdoFitSingle.Checked Then + ucrChkAddLegend.Visible = False + cmdDisplayOptions.Visible = False Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight) ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY) ucrReceiverElement.SetMeAsReceiver() @@ -373,7 +479,9 @@ Public Class dlgInfillMissingValues Else ucrBase.clsRsyntax.SetBaseRFunction(clsAveFunction) End If - ElseIf rdoMultiple.Checked Then + ElseIf rdoFitMultiple.Checked Then + ucrChkAddLegend.Visible = False + cmdDisplayOptions.Visible = False ucrBase.clsRsyntax.SetBaseRFunction(clsPatchClimateElementFunction) ucrBase.clsRsyntax.iCallType = 2 Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.8) @@ -388,7 +496,29 @@ Public Class dlgInfillMissingValues End If End Sub - Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged, ucrInputNewColumnName.ControlContentsChanged + Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged + If Not ucrReceiverStation.IsEmpty Then + clsVisualizeElementNa.AddParameter("station_col_name", ucrReceiverStation.GetVariableNames(), iPosition:=3) + Else + clsVisualizeElementNa.RemoveParameterByName("station_col_name") + End If + End Sub + + Private Sub ucrSelectorInfillMissing_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorInfillMissing.ControlValueChanged + clsVisualizeElementNa.AddParameter("data_name", Chr(34) & ucrSelectorInfillMissing.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) + End Sub + + Private Sub ucrReceiverStation_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged + If (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverStation.IsEmpty Then + ucrNudFacetColumns.Visible = True + lblFacetColumns.Visible = True + Else + ucrNudFacetColumns.Visible = False + lblFacetColumns.Visible = False + End If + End Sub + + Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged, ucrInputNewColumnName.ControlContentsChanged, ucrReceiverImputed.ControlContentsChanged, ucrReceiverDisplayShowDate.ControlContentsChanged, ucrReceiverDisplayObserved.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged TestOkEnabled() End Sub End Class \ No newline at end of file From 735d9c8c58351120304535f89ea0987f72ee4da9 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 19:57:17 +0300 Subject: [PATCH 020/102] Bug fix: save and then return graph. Implemented chillR option for multiple stations at a time --- instat/static/InstatObject/R/data_object_R6.R | 75 ++++++++++++------- .../static/InstatObject/R/instat_object_R6.R | 4 +- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 057b0816fc0..fc0f0c00a56 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3628,25 +3628,53 @@ DataSheet$set("public", "get_variable_sets", function(set_names, force_as_list) } ) -DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name){ +DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name){ if(missing(date_col_name))stop("date is missing with no default") if(missing(var))stop("var is missing with no default") if(missing(vars))stop("vars is missing with no default") date_col <- self$get_columns_from_data(date_col_name, use_current_filter = FALSE) if(!lubridate::is.Date(date_col)) stop("This column must be a date or time!") - var_col <- self$get_columns_from_data(var, use_current_filter = FALSE) - Year <- lubridate::year(date_col); Month <- lubridate::month(date_col); Day <- lubridate::day(date_col) - weather <- data.frame(Year, Month, Day, var_col) - colnames(weather)[4] <- var - patch_weather <- list() - for (i in seq_along(vars)) { - col <- self$get_columns_from_data(vars[i], use_current_filter = FALSE) - patch_weather[[i]] <- data.frame(Year, Month, Day, col) - colnames(patch_weather[[i]])[4] <- var - } - out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) - self$add_columns_to_data(col_name = column_name, col_data = out[[1]][,var]) - return(out[[2]]) + curr_data <- self$get_data_frame() + if(!missing(station_col_name)) { + station_col <- self$get_columns_from_data(station_col_name, use_current_filter = FALSE) + station_names <- unique(station_col) + list_out <- list() + for (i in seq_along(station_names)) { + temp_data <- curr_data[station_col==station_names[i],] + var_col <- temp_data[,var] + date_col <- temp_data[,date_col_name] + Year <- lubridate::year(date_col); Month <- lubridate::month(date_col); Day <- lubridate::day(date_col) + weather <- data.frame(Year, Month, Day, var_col) + colnames(weather)[4] <- var + patch_weather <- list() + for (j in seq_along(vars)) { + col <- temp_data[,vars[j]] + patch_weather[[j]] <- data.frame(Year, Month, Day, col) + colnames(patch_weather[[j]])[4] <- var + } + out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) + list_out[[i]] <- out[[1]][,var] + print(out[[2]]) + } + }else{ + var_col <- self$get_columns_from_data(var, use_current_filter = FALSE) + Year <- lubridate::year(date_col); Month <- lubridate::month(date_col); Day <- lubridate::day(date_col) + weather <- data.frame(Year, Month, Day, var_col) + colnames(weather)[4] <- var + patch_weather <- list() + for (i in seq_along(vars)) { + col <- self$get_columns_from_data(vars[i], use_current_filter = FALSE) + patch_weather[[i]] <- data.frame(Year, Month, Day, col) + colnames(patch_weather[[i]])[4] <- var + } + } + if(!missing(station_col_name)) {col <- unlist(list_out)} + else{ + out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) + col <- out[[1]][,var] + print(out[[2]]) + } + self$add_columns_to_data(col_name = column_name, col_data = col) } ) @@ -3663,38 +3691,31 @@ DataSheet$set("public", "visualize_element_na", function(element_col_name, eleme temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_distribution(x = temp_data[,element_col_name], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab) } - }else{ - imputeTS::ggplot_na_distribution(x = element_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab) - } + }else{plt <- imputeTS::ggplot_na_distribution(x = element_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab)} }else if (type == "gapsize"){ if(!missing(station_col_name)){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_gapsize(x = temp_data[,element_col_name], include_total = TRUE, title =paste0(station_names[i], ":Occurrence of gap sizes"), xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) } - }else{ - imputeTS::ggplot_na_gapsize(x = element_col, include_total = TRUE, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) - } + }else{plt <- imputeTS::ggplot_na_gapsize(x = element_col, include_total = TRUE, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation)} }else if(type == "interval"){ if(!missing(station_col_name)){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[,element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size) } - }else{ - imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size) - } + }else{plt <- imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size)} }else if (type == "imputation"){ if(!missing(station_col_name)){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[,element_col_name], x_with_imputations = temp_data[,element_col_name_imputed], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend) } - }else{ - imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend) - } + }else{plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend)} } - if(!missing(station_col_name)) gridExtra::grid.arrange(grobs = plt_list, ncol = ncol) + if(!missing(station_col_name)) {gridExtra::grid.arrange(grobs = plt_list, ncol = ncol)} + else{return(plt)} } ) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 3af596f4046..d94a8d9333c 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2088,8 +2088,8 @@ DataBook$set("public","package_check", function(package) { } ) -DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name) { - self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name) +DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name = station_col_name) { + self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name, station_col_name = station_col_name) } ) From 5e5822b0c0c4312c107c829619f59859898fc384 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 19:57:31 +0300 Subject: [PATCH 021/102] designer amendments --- instat/dlgInfillMissingValues.Designer.vb | 40 ++-- instat/dlgInfillMissingValues.resx | 262 +++++++++++++--------- 2 files changed, 175 insertions(+), 127 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index 023a3ee1316..f53189ceba3 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -45,7 +45,6 @@ Partial Class dlgInfillMissingValues Me.lblDate = New System.Windows.Forms.Label() Me.lblEstimated = New System.Windows.Forms.Label() Me.lblObserved = New System.Windows.Forms.Label() - Me.lblMultipleStation = New System.Windows.Forms.Label() Me.lblNewColumnName = New System.Windows.Forms.Label() Me.rdoDisplay = New System.Windows.Forms.RadioButton() Me.rdoShow = New System.Windows.Forms.RadioButton() @@ -59,7 +58,6 @@ Partial Class dlgInfillMissingValues Me.ucrReceiverDisplayObserved = New instat.ucrReceiverSingle() Me.ucrReceiverDisplayShowDate = New instat.ucrReceiverSingle() Me.ucrInputNewColumnName = New instat.ucrInputTextBox() - Me.ucrReceiverMultipleStation = New instat.ucrReceiverSingle() Me.ucrInputStdBias = New instat.ucrInputTextBox() Me.ucrInputMeanBias = New instat.ucrInputTextBox() Me.ucrChkStdBias = New instat.ucrCheck() @@ -89,6 +87,8 @@ Partial Class dlgInfillMissingValues Me.cmdDisplayOptions = New System.Windows.Forms.Button() Me.ucrInputIntervalSize = New instat.ucrInputTextBox() Me.lblIntervalSize = New System.Windows.Forms.Label() + Me.ucrReceiverDispMultShowStation = New instat.ucrReceiverSingle() + Me.lblDispMultShowStation = New System.Windows.Forms.Label() Me.grpMethods.SuspendLayout() Me.grpStartEnd.SuspendLayout() Me.SuspendLayout() @@ -241,11 +241,6 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblObserved, "lblObserved") Me.lblObserved.Name = "lblObserved" ' - 'lblMultipleStation - ' - resources.ApplyResources(Me.lblMultipleStation, "lblMultipleStation") - Me.lblMultipleStation.Name = "lblMultipleStation" - ' 'lblNewColumnName ' resources.ApplyResources(Me.lblNewColumnName, "lblNewColumnName") @@ -341,15 +336,6 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.ucrInputNewColumnName, "ucrInputNewColumnName") Me.ucrInputNewColumnName.Name = "ucrInputNewColumnName" ' - 'ucrReceiverMultipleStation - ' - Me.ucrReceiverMultipleStation.frmParent = Me - resources.ApplyResources(Me.ucrReceiverMultipleStation, "ucrReceiverMultipleStation") - Me.ucrReceiverMultipleStation.Name = "ucrReceiverMultipleStation" - Me.ucrReceiverMultipleStation.Selector = Nothing - Me.ucrReceiverMultipleStation.strNcFilePath = "" - Me.ucrReceiverMultipleStation.ucrSelector = Nothing - ' 'ucrInputStdBias ' Me.ucrInputStdBias.AddQuotesIfUnrecognised = True @@ -559,10 +545,26 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblIntervalSize, "lblIntervalSize") Me.lblIntervalSize.Name = "lblIntervalSize" ' + 'ucrReceiverDispMultShowStation + ' + Me.ucrReceiverDispMultShowStation.frmParent = Me + resources.ApplyResources(Me.ucrReceiverDispMultShowStation, "ucrReceiverDispMultShowStation") + Me.ucrReceiverDispMultShowStation.Name = "ucrReceiverDispMultShowStation" + Me.ucrReceiverDispMultShowStation.Selector = Nothing + Me.ucrReceiverDispMultShowStation.strNcFilePath = "" + Me.ucrReceiverDispMultShowStation.ucrSelector = Nothing + ' + 'lblDispMultShowStation + ' + resources.ApplyResources(Me.lblDispMultShowStation, "lblDispMultShowStation") + Me.lblDispMultShowStation.Name = "lblDispMultShowStation" + ' 'dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblDispMultShowStation) + Me.Controls.Add(Me.ucrReceiverDispMultShowStation) Me.Controls.Add(Me.lblIntervalSize) Me.Controls.Add(Me.ucrInputIntervalSize) Me.Controls.Add(Me.cmdDisplayOptions) @@ -582,9 +584,7 @@ Partial Class dlgInfillMissingValues Me.Controls.Add(Me.rdoShow) Me.Controls.Add(Me.rdoDisplay) Me.Controls.Add(Me.ucrInputNewColumnName) - Me.Controls.Add(Me.lblMultipleStation) Me.Controls.Add(Me.lblNewColumnName) - Me.Controls.Add(Me.ucrReceiverMultipleStation) Me.Controls.Add(Me.ucrInputStdBias) Me.Controls.Add(Me.ucrInputMeanBias) Me.Controls.Add(Me.ucrChkStdBias) @@ -676,8 +676,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrChkMeanBias As ucrCheck Friend WithEvents ucrInputStdBias As ucrInputTextBox Friend WithEvents ucrInputMeanBias As ucrInputTextBox - Friend WithEvents lblMultipleStation As Label - Friend WithEvents ucrReceiverMultipleStation As ucrReceiverSingle Friend WithEvents ucrInputNewColumnName As ucrInputTextBox Friend WithEvents lblNewColumnName As Label Friend WithEvents rdoShow As RadioButton @@ -698,4 +696,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents cmdDisplayOptions As Button Friend WithEvents lblIntervalSize As Label Friend WithEvents ucrInputIntervalSize As ucrInputTextBox + Friend WithEvents lblDispMultShowStation As Label + Friend WithEvents ucrReceiverDispMultShowStation As ucrReceiverSingle End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 1d40931e255..fec50a46bbc 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -402,15 +402,6 @@ 48 - - 6, 15 - - - 177, 71 - - - 17 - ucrPnlMethods @@ -447,6 +438,87 @@ 55 + + 6, 15 + + + 177, 71 + + + 17 + + + ucrPnlMethods + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpMethods + + + 6 + + + rdoExtendFill + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpStartEnd + + + 0 + + + rdoLeaveAsMissing + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpStartEnd + + + 1 + + + ucrPnlStartEnd + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpStartEnd + + + 2 + + + 228, 317 + + + 183, 66 + + + 22 + + + Start and End + + + grpStartEnd + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 44 + True @@ -528,30 +600,6 @@ 2 - - 228, 317 - - - 183, 66 - - - 22 - - - Start and End - - - grpStartEnd - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 44 - True @@ -762,36 +810,6 @@ 26 - - True - - - NoControl - - - 281, 83 - - - 43, 13 - - - 4 - - - Station: - - - lblMultipleStation - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 19 - True @@ -820,7 +838,7 @@ $this - 20 + 21 Button @@ -856,7 +874,7 @@ $this - 17 + 19 Button @@ -892,7 +910,7 @@ $this - 16 + 18 True @@ -922,7 +940,7 @@ $this - 11 + 13 True @@ -952,7 +970,7 @@ $this - 10 + 12 True @@ -982,7 +1000,7 @@ $this - 9 + 11 True @@ -1012,7 +1030,7 @@ $this - 8 + 10 12, 296 @@ -1036,7 +1054,7 @@ $this - 7 + 9 368, 252 @@ -1057,7 +1075,7 @@ $this - 12 + 14 True @@ -1068,6 +1086,60 @@ 421, 540 + + True + + + NoControl + + + 278, 82 + + + 43, 13 + + + 64 + + + Station: + + + lblDispMultShowStation + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 281, 98 + + + 0, 0, 0, 0 + + + 120, 20 + + + 63 + + + ucrReceiverDispMultShowStation + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 1 + True @@ -1093,7 +1165,7 @@ $this - 0 + 2 352, 294 @@ -1114,7 +1186,7 @@ $this - 1 + 3 False @@ -1141,7 +1213,7 @@ $this - 2 + 4 281, 295 @@ -1162,7 +1234,7 @@ $this - 3 + 5 True @@ -1189,7 +1261,7 @@ $this - 4 + 6 281, 224 @@ -1210,7 +1282,7 @@ $this - 5 + 7 281, 272 @@ -1231,7 +1303,7 @@ $this - 6 + 8 281, 182 @@ -1255,7 +1327,7 @@ $this - 14 + 16 281, 139 @@ -1279,7 +1351,7 @@ $this - 15 + 17 113, 333 @@ -1300,31 +1372,7 @@ $this - 18 - - - 281, 98 - - - 0, 0, 0, 0 - - - 120, 20 - - - 5 - - - ucrReceiverMultipleStation - - - instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 21 + 20 144, 309 @@ -1846,6 +1894,6 @@ $this - 13 + 15 \ No newline at end of file From 65dd15c53f24f9d83a2fe97fe3615b9bdebb88d7 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 19:58:57 +0300 Subject: [PATCH 022/102] linking station receiver properly and ensured that multiple stations at a time works for fit multiple options --- instat/dlgInfillMissingValues.vb | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 3d8c5928795..8bbd7fc4fa4 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -42,10 +42,6 @@ Public Class dlgInfillMissingValues Dim dctFunctionNames As New Dictionary(Of String, String) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False - 'TODO:Enabled once working, added now for display purposes and therefore show the intention! - ucrReceiverMultipleStation.Enabled = False - lblMultipleStation.Enabled = False - ucrPnlOptions.AddRadioButton(rdoDisplay) ucrPnlOptions.AddRadioButton(rdoFitSingle) ucrPnlOptions.AddRadioButton(rdoFitMultiple) @@ -89,6 +85,13 @@ Public Class dlgInfillMissingValues ucrReceiverStation.bUseFilteredData = False ucrReceiverStation.bAutoFill = True + ucrReceiverDispMultShowStation.SetParameter(New RParameter("station_col_name", 3)) + ucrReceiverDispMultShowStation.Selector = ucrSelectorInfillMissing + ucrReceiverDispMultShowStation.SetParameterIsString() + ucrReceiverDispMultShowStation.SetClimaticType("station") + ucrReceiverDispMultShowStation.bUseFilteredData = False + ucrReceiverDispMultShowStation.bAutoFill = True + ucrInputConstant.SetValidationTypeAsNumeric() ucrInputConstant.AddQuotesIfUnrecognised = False @@ -171,11 +174,12 @@ Public Class dlgInfillMissingValues ucrChkMaxGap.AddToLinkedControls(ucrNudMaximum, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.AddToLinkedControls(ucrChkSetSeed, {"Sample"}, bNewLinkedHideIfParameterMissing:=True) ucrChkSetSeed.AddToLinkedControls(ucrNudSetSeed, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) - ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements, ucrReceiverMultipleStation}, {rdoFitMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverDate, ucrChkMeanBias, ucrChkStdBias, ucrReceiverObserved, ucrInputNewColumnName, ucrReceiverEstimatedElements}, {rdoFitMultiple}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrChkBy, ucrChkMaxGap, ucrPnlMethods, ucrReceiverElement, ucrSaveNewColumn}, {rdoFitSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrChkMeanBias.AddToLinkedControls(ucrInputMeanBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=5) ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) - ucrPnlOptions.AddToLinkedControls({ucrReceiverStation, ucrSaveGraph, ucrReceiverDisplayShowDate, ucrReceiverDisplayObserved}, {rdoDisplay, rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrSaveGraph, ucrReceiverDisplayShowDate, ucrReceiverDisplayObserved}, {rdoDisplay, rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverDispMultShowStation}, {rdoDisplay, rdoFitMultiple, rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrReceiverImputed}, {rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrInputComboType}, {rdoDisplay}, bNewLinkedHideIfParameterMissing:=True) ucrInputComboType.AddToLinkedControls({ucrChkFlipCordinates}, {"Gap size"}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -190,13 +194,13 @@ Public Class dlgInfillMissingValues ucrReceiverElement.SetLinkedDisplayControl(lblElement) ucrPnlMethods.SetLinkedDisplayControl(grpMethods) ucrReceiverObserved.SetLinkedDisplayControl(lblObserved) - ucrReceiverMultipleStation.SetLinkedDisplayControl(lblMultipleStation) ucrInputNewColumnName.SetLinkedDisplayControl(lblNewColumnName) ucrReceiverDisplayShowDate.SetLinkedDisplayControl(lblDisplayDate) ucrReceiverDisplayObserved.SetLinkedDisplayControl(lblDisplayElement) ucrReceiverImputed.SetLinkedDisplayControl(lblImputed) ucrInputComboType.SetLinkedDisplayControl(lblType) ucrInputIntervalSize.SetLinkedDisplayControl(lblIntervalSize) + ucrReceiverDispMultShowStation.SetLinkedDisplayControl(lblDispMultShowStation) ucrSaveNewColumn.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveNewColumn.SetSaveTypeAsColumn() @@ -336,6 +340,7 @@ Public Class dlgInfillMissingValues ucrNudMaximum.AddAdditionalCodeParameterPair(clsNaLocfFunction, ucrNudMaximum.GetParameter(), iAdditionalPairNo:=3) ucrNudMaximum.AddAdditionalCodeParameterPair(clsNaFillFunction, ucrNudMaximum.GetParameter(), iAdditionalPairNo:=4) ucrNudMaximum.AddAdditionalCodeParameterPair(clsStructTSFunction, ucrNudMaximum.GetParameter(), iAdditionalPairNo:=5) + ucrReceiverDispMultShowStation.AddAdditionalCodeParameterPair(clsPatchClimateElementFunction, New RParameter("station_col_name", 7), iAdditionalPairNo:=1) ucrReceiverElement.SetRCode(clsAveFunction, bReset) ucrReceiverStation.SetRCode(clsAveFunction, bReset) @@ -363,6 +368,7 @@ Public Class dlgInfillMissingValues ucrChkAddLegend.SetRCode(clsVisualizeElementNa, bReset) ucrChkFlipCordinates.SetRCode(clsVisualizeElementNa, bReset) ucrInputIntervalSize.SetRCode(clsVisualizeElementNa, bReset) + ucrReceiverDispMultShowStation.SetRCode(clsVisualizeElementNa, bReset) ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) @@ -482,6 +488,7 @@ Public Class dlgInfillMissingValues ElseIf rdoFitMultiple.Checked Then ucrChkAddLegend.Visible = False cmdDisplayOptions.Visible = False + ucrReceiverStation.Visible = True ucrBase.clsRsyntax.SetBaseRFunction(clsPatchClimateElementFunction) ucrBase.clsRsyntax.iCallType = 2 Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.8) @@ -496,20 +503,12 @@ Public Class dlgInfillMissingValues End If End Sub - Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged - If Not ucrReceiverStation.IsEmpty Then - clsVisualizeElementNa.AddParameter("station_col_name", ucrReceiverStation.GetVariableNames(), iPosition:=3) - Else - clsVisualizeElementNa.RemoveParameterByName("station_col_name") - End If - End Sub - Private Sub ucrSelectorInfillMissing_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorInfillMissing.ControlValueChanged clsVisualizeElementNa.AddParameter("data_name", Chr(34) & ucrSelectorInfillMissing.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) End Sub - Private Sub ucrReceiverStation_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged - If (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverStation.IsEmpty Then + Private Sub ucrReceiverDispMultShowStation_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDispMultShowStation.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged + If (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverDispMultShowStation.IsEmpty Then ucrNudFacetColumns.Visible = True lblFacetColumns.Visible = True Else From 78b26dcbe2c1ef203fbe5b3c3a52b21086907c8c Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 21:46:13 +0300 Subject: [PATCH 023/102] adding x_with_truth as a parameter --- instat/static/InstatObject/R/data_object_R6.R | 6 +++--- instat/static/InstatObject/R/instat_object_R6.R | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index fc0f0c00a56..65b764bd60e 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3678,7 +3678,7 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va } ) -DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461){ +DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461, x_with_truth = NULL){ curr_data <- self$get_data_frame() if(!missing(station_col_name)){station_col <- self$get_columns_from_data(station_col_name);station_names <- unique(station_col)} if(!missing(element_col_name)){element_col <- self$get_columns_from_data(element_col_name)} @@ -3710,9 +3710,9 @@ DataSheet$set("public", "visualize_element_na", function(element_col_name, eleme if(!missing(station_col_name)){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] - plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[,element_col_name], x_with_imputations = temp_data[,element_col_name_imputed], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend) + plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[,element_col_name], x_with_imputations = temp_data[,element_col_name_imputed], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth) } - }else{plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend)} + }else{plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth)} } if(!missing(station_col_name)) {gridExtra::grid.arrange(grobs = plt_list, ncol = ncol)} else{return(plt)} diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index d94a8d9333c..7630017348d 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2093,7 +2093,7 @@ DataBook$set("public","patch_climate_element", function(data_name, date_col_name } ) -DataBook$set("public","visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size) { - self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed =element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size) +DataBook$set("public","visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL) { + self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed =element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth) } ) From 0f8254fedd4b1d59c0ac43dde419e07b2be74cde Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 21:46:51 +0300 Subject: [PATCH 024/102] realignments and adding receiver for the True values --- instat/dlgInfillMissingValues.Designer.vb | 20 +++ instat/dlgInfillMissingValues.resx | 201 ++++++++++++++-------- 2 files changed, 149 insertions(+), 72 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index f53189ceba3..447e36397df 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -89,6 +89,8 @@ Partial Class dlgInfillMissingValues Me.lblIntervalSize = New System.Windows.Forms.Label() Me.ucrReceiverDispMultShowStation = New instat.ucrReceiverSingle() Me.lblDispMultShowStation = New System.Windows.Forms.Label() + Me.ucrReceiverTrueValues = New instat.ucrReceiverSingle() + Me.lblTrueValues = New System.Windows.Forms.Label() Me.grpMethods.SuspendLayout() Me.grpStartEnd.SuspendLayout() Me.SuspendLayout() @@ -559,10 +561,26 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblDispMultShowStation, "lblDispMultShowStation") Me.lblDispMultShowStation.Name = "lblDispMultShowStation" ' + 'ucrReceiverTrueValues + ' + Me.ucrReceiverTrueValues.frmParent = Me + resources.ApplyResources(Me.ucrReceiverTrueValues, "ucrReceiverTrueValues") + Me.ucrReceiverTrueValues.Name = "ucrReceiverTrueValues" + Me.ucrReceiverTrueValues.Selector = Nothing + Me.ucrReceiverTrueValues.strNcFilePath = "" + Me.ucrReceiverTrueValues.ucrSelector = Nothing + ' + 'lblTrueValues + ' + resources.ApplyResources(Me.lblTrueValues, "lblTrueValues") + Me.lblTrueValues.Name = "lblTrueValues" + ' 'dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrReceiverTrueValues) + Me.Controls.Add(Me.lblTrueValues) Me.Controls.Add(Me.lblDispMultShowStation) Me.Controls.Add(Me.ucrReceiverDispMultShowStation) Me.Controls.Add(Me.lblIntervalSize) @@ -698,4 +716,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrInputIntervalSize As ucrInputTextBox Friend WithEvents lblDispMultShowStation As Label Friend WithEvents ucrReceiverDispMultShowStation As ucrReceiverSingle + Friend WithEvents lblTrueValues As Label + Friend WithEvents ucrReceiverTrueValues As ucrReceiverSingle End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index fec50a46bbc..f3838f2636f 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -328,7 +328,7 @@ $this - 50 + 52 Button @@ -364,7 +364,7 @@ $this - 49 + 51 Button @@ -400,7 +400,7 @@ $this - 48 + 50 ucrPnlMethods @@ -436,7 +436,7 @@ $this - 55 + 57 6, 15 @@ -517,7 +517,7 @@ $this - 44 + 46 True @@ -628,7 +628,7 @@ $this - 32 + 34 True @@ -658,7 +658,7 @@ $this - 45 + 47 True @@ -688,7 +688,7 @@ $this - 39 + 41 True @@ -718,7 +718,7 @@ $this - 33 + 35 True @@ -748,7 +748,7 @@ $this - 30 + 32 True @@ -778,7 +778,7 @@ $this - 28 + 30 True @@ -787,7 +787,7 @@ NoControl - 281, 167 + 281, 168 56, 13 @@ -808,7 +808,7 @@ $this - 26 + 28 True @@ -838,7 +838,7 @@ $this - 21 + 23 Button @@ -874,7 +874,7 @@ $this - 19 + 21 Button @@ -910,7 +910,7 @@ $this - 18 + 20 True @@ -919,7 +919,7 @@ NoControl - 281, 254 + 281, 306 86, 13 @@ -940,7 +940,7 @@ $this - 13 + 15 True @@ -970,7 +970,7 @@ $this - 12 + 14 True @@ -1000,7 +1000,7 @@ $this - 11 + 13 True @@ -1009,7 +1009,7 @@ NoControl - 281, 125 + 281, 127 33, 13 @@ -1030,10 +1030,10 @@ $this - 10 + 12 - 12, 296 + 12, 337 4, 5, 4, 5 @@ -1054,10 +1054,10 @@ $this - 9 + 11 - 368, 252 + 368, 303 48, 20 @@ -1075,7 +1075,7 @@ $this - 14 + 16 True @@ -1086,6 +1086,60 @@ 421, 540 + + 281, 271 + + + 0, 0, 0, 0 + + + 120, 20 + + + 48 + + + ucrReceiverTrueValues + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + + + True + + + NoControl + + + 279, 255 + + + 112, 13 + + + 65 + + + True Values(Optional): + + + lblTrueValues + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + True @@ -1114,7 +1168,7 @@ $this - 0 + 2 281, 98 @@ -1138,13 +1192,16 @@ $this - 1 + 3 True + + NoControl + - 281, 297 + 12, 311 68, 13 @@ -1165,10 +1222,10 @@ $this - 2 + 4 - 352, 294 + 83, 308 62, 21 @@ -1186,7 +1243,7 @@ $this - 3 + 5 False @@ -1213,13 +1270,13 @@ $this - 4 + 6 - 281, 295 + 12, 310 - 134, 20 + 132, 20 59 @@ -1234,13 +1291,13 @@ $this - 5 + 7 True - 281, 208 + 281, 211 34, 13 @@ -1261,10 +1318,10 @@ $this - 6 + 8 - 281, 224 + 281, 227 120, 21 @@ -1282,10 +1339,10 @@ $this - 7 + 9 - 281, 272 + 12, 286 134, 20 @@ -1303,10 +1360,10 @@ $this - 8 + 10 - 281, 182 + 281, 184 0, 0, 0, 0 @@ -1327,10 +1384,10 @@ $this - 16 + 18 - 281, 139 + 281, 141 0, 0, 0, 0 @@ -1351,7 +1408,7 @@ $this - 17 + 19 113, 333 @@ -1372,7 +1429,7 @@ $this - 20 + 22 144, 309 @@ -1393,7 +1450,7 @@ $this - 22 + 24 144, 286 @@ -1414,7 +1471,7 @@ $this - 23 + 25 14, 309 @@ -1435,7 +1492,7 @@ $this - 24 + 26 14, 286 @@ -1456,10 +1513,10 @@ $this - 25 + 27 - 281, 182 + 281, 185 0, 0, 0, 0 @@ -1480,7 +1537,7 @@ $this - 27 + 29 281, 224 @@ -1504,7 +1561,7 @@ $this - 29 + 31 281, 140 @@ -1528,7 +1585,7 @@ $this - 31 + 33 279, 384 @@ -1549,7 +1606,7 @@ $this - 34 + 36 281, 207 @@ -1573,7 +1630,7 @@ $this - 35 + 37 281, 98 @@ -1597,7 +1654,7 @@ $this - 36 + 38 146, 427 @@ -1618,7 +1675,7 @@ $this - 37 + 39 223, 427 @@ -1639,7 +1696,7 @@ $this - 38 + 40 110, 279 @@ -1660,7 +1717,7 @@ $this - 40 + 42 12, 280 @@ -1681,7 +1738,7 @@ $this - 41 + 43 281, 184 @@ -1702,7 +1759,7 @@ $this - 42 + 44 12, 427 @@ -1723,7 +1780,7 @@ $this - 43 + 45 12, 455 @@ -1747,7 +1804,7 @@ $this - 46 + 48 66, 426 @@ -1768,7 +1825,7 @@ $this - 47 + 49 281, 149 @@ -1792,7 +1849,7 @@ $this - 51 + 53 12, 483 @@ -1813,7 +1870,7 @@ $this - 52 + 54 12, 75 @@ -1837,7 +1894,7 @@ $this - 53 + 55 12, 12 @@ -1858,7 +1915,7 @@ $this - 54 + 56 CenterScreen @@ -1873,7 +1930,7 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 281, 224 + 281, 225 0, 0, 0, 0 @@ -1894,6 +1951,6 @@ $this - 15 + 17 \ No newline at end of file From f58d14e4726d4dc5eff7e6908eb7b060f10cda3b Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 6 Sep 2020 21:47:48 +0300 Subject: [PATCH 025/102] setting up true values receiver and dialog resizing --- instat/dlgInfillMissingValues.vb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 8bbd7fc4fa4..53a1029b512 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -164,6 +164,11 @@ Public Class dlgInfillMissingValues ucrReceiverImputed.SetParameterIsString() ucrReceiverImputed.SetDataType("numeric", bStrict:=True) + ucrReceiverTrueValues.SetParameter(New RParameter("x_with_truth", 12)) + ucrReceiverTrueValues.Selector = ucrSelectorInfillMissing + ucrReceiverTrueValues.SetParameterIsRFunction() + ucrReceiverTrueValues.SetDataType("numeric", bStrict:=True) + ucrPnlStartEnd.AddToLinkedControls(ucrInputConstant, {rdoLeaveAsMissing, rdoExtendFill}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrInputComboFunction, {rdoNaAggregate}, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrReceiverStation, {rdoNaApproximate, rdoNaFill, rdoNaSpline, rdoNaLocf, rdoNaStructTS}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -180,7 +185,7 @@ Public Class dlgInfillMissingValues ucrChkStdBias.AddToLinkedControls(ucrInputStdBias, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) ucrPnlOptions.AddToLinkedControls({ucrSaveGraph, ucrReceiverDisplayShowDate, ucrReceiverDisplayObserved}, {rdoDisplay, rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrReceiverDispMultShowStation}, {rdoDisplay, rdoFitMultiple, rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrPnlOptions.AddToLinkedControls({ucrReceiverImputed}, {rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrReceiverImputed, ucrReceiverTrueValues}, {rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrInputComboType}, {rdoDisplay}, bNewLinkedHideIfParameterMissing:=True) ucrInputComboType.AddToLinkedControls({ucrChkFlipCordinates}, {"Gap size"}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboType.AddToLinkedControls({ucrInputIntervalSize}, {"Intervals"}, bNewLinkedHideIfParameterMissing:=True) @@ -201,6 +206,7 @@ Public Class dlgInfillMissingValues ucrInputComboType.SetLinkedDisplayControl(lblType) ucrInputIntervalSize.SetLinkedDisplayControl(lblIntervalSize) ucrReceiverDispMultShowStation.SetLinkedDisplayControl(lblDispMultShowStation) + ucrReceiverTrueValues.SetLinkedDisplayControl(lblTrueValues) ucrSaveNewColumn.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveNewColumn.SetSaveTypeAsColumn() @@ -246,7 +252,7 @@ Public Class dlgInfillMissingValues ucrInputIntervalSize.SetValidationTypeAsNumeric() ucrInputIntervalSize.AddQuotesIfUnrecognised = False - ucrSaveGraph.SetPrefix("lineplot") + ucrSaveGraph.SetPrefix("missingplot") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveGraph.SetCheckBoxText("Save Graph") @@ -369,6 +375,7 @@ Public Class dlgInfillMissingValues ucrChkFlipCordinates.SetRCode(clsVisualizeElementNa, bReset) ucrInputIntervalSize.SetRCode(clsVisualizeElementNa, bReset) ucrReceiverDispMultShowStation.SetRCode(clsVisualizeElementNa, bReset) + ucrReceiverTrueValues.SetRCode(clsVisualizeElementNa, bReset) ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) @@ -453,8 +460,8 @@ Public Class dlgInfillMissingValues If rdoDisplay.Checked OrElse rdoShow.Checked Then ucrBase.clsRsyntax.SetBaseRFunction(clsVisualizeElementNa) ucrBase.clsRsyntax.iCallType = 3 - Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.72) - ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.5) + Me.Size = New System.Drawing.Size(Me.Width, iDialogHeight * 0.8) + ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.33) ucrReceiverDisplayObserved.SetMeAsReceiver() If rdoDisplay.Checked Then Select Case ucrInputComboType.GetText From 28b27b3b1dbdaf6e052fa48ba0ca0249f13608b4 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 10:14:48 +0300 Subject: [PATCH 026/102] Adding basic keyboard to Enter dialog --- instat/dlgEnter.Designer.vb | 330 +++++---- instat/dlgEnter.resx | 1253 ++++++++++++++++++++--------------- instat/dlgEnter.vb | 105 ++- 3 files changed, 991 insertions(+), 697 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index f8638d9e5cf..79bb9263451 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -42,22 +42,6 @@ Partial Class dlgEnter Me.chkShowEnterArguments = New System.Windows.Forms.CheckBox() Me.lblData = New System.Windows.Forms.Label() Me.chkSaveEnterResultInto = New System.Windows.Forms.CheckBox() - Me.cmd1 = New System.Windows.Forms.Button() - Me.cmdSquareBrackets = New System.Windows.Forms.Button() - Me.cmd0 = New System.Windows.Forms.Button() - Me.cmd2 = New System.Windows.Forms.Button() - Me.cmdClear = New System.Windows.Forms.Button() - Me.cmd3 = New System.Windows.Forms.Button() - Me.cmd4 = New System.Windows.Forms.Button() - Me.cmd5 = New System.Windows.Forms.Button() - Me.cmd6 = New System.Windows.Forms.Button() - Me.cmd7 = New System.Windows.Forms.Button() - Me.cmd8 = New System.Windows.Forms.Button() - Me.cmd9 = New System.Windows.Forms.Button() - Me.cmdMinus = New System.Windows.Forms.Button() - Me.cmdDelete = New System.Windows.Forms.Button() - Me.cmdBrackets = New System.Windows.Forms.Button() - Me.grpEnterKeybord1 = New System.Windows.Forms.GroupBox() Me.cmdMissingValues = New System.Windows.Forms.Button() Me.cmdExponential = New System.Windows.Forms.Button() Me.cmdConcantenateFunction = New System.Windows.Forms.Button() @@ -79,8 +63,28 @@ Partial Class dlgEnter Me.ucrBase = New instat.ucrButtons() Me.ucrTryModelling = New instat.ucrTry() Me.btnExample = New System.Windows.Forms.Button() - Me.grpEnterKeybord1.SuspendLayout() + Me.grpBasic = New System.Windows.Forms.GroupBox() + Me.cmdClear = New System.Windows.Forms.Button() + Me.Button1 = New System.Windows.Forms.Button() + Me.cmdBrackets = New System.Windows.Forms.Button() + Me.cmdPower = New System.Windows.Forms.Button() + Me.cmdDivide = New System.Windows.Forms.Button() + Me.cmdPlus = New System.Windows.Forms.Button() + Me.cmdMinus = New System.Windows.Forms.Button() + Me.cmdMultiply = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.cmd9 = New System.Windows.Forms.Button() + Me.cmd8 = New System.Windows.Forms.Button() + Me.cmd7 = New System.Windows.Forms.Button() + Me.cmd6 = New System.Windows.Forms.Button() + Me.cmd5 = New System.Windows.Forms.Button() + Me.cmd4 = New System.Windows.Forms.Button() + Me.cmd3 = New System.Windows.Forms.Button() + Me.cmd2 = New System.Windows.Forms.Button() + Me.cmd0 = New System.Windows.Forms.Button() + Me.cmd1 = New System.Windows.Forms.Button() Me.grpEnterKeyboard2.SuspendLayout() + Me.grpBasic.SuspendLayout() Me.SuspendLayout() ' 'chkShowEnterArguments @@ -101,118 +105,6 @@ Partial Class dlgEnter Me.chkSaveEnterResultInto.Name = "chkSaveEnterResultInto" Me.chkSaveEnterResultInto.UseVisualStyleBackColor = True ' - 'cmd1 - ' - resources.ApplyResources(Me.cmd1, "cmd1") - Me.cmd1.Name = "cmd1" - Me.cmd1.UseVisualStyleBackColor = True - ' - 'cmdSquareBrackets - ' - resources.ApplyResources(Me.cmdSquareBrackets, "cmdSquareBrackets") - Me.cmdSquareBrackets.Name = "cmdSquareBrackets" - Me.cmdSquareBrackets.UseVisualStyleBackColor = True - ' - 'cmd0 - ' - resources.ApplyResources(Me.cmd0, "cmd0") - Me.cmd0.Name = "cmd0" - Me.cmd0.UseVisualStyleBackColor = True - ' - 'cmd2 - ' - resources.ApplyResources(Me.cmd2, "cmd2") - Me.cmd2.Name = "cmd2" - Me.cmd2.UseVisualStyleBackColor = True - ' - 'cmdClear - ' - resources.ApplyResources(Me.cmdClear, "cmdClear") - Me.cmdClear.Name = "cmdClear" - Me.cmdClear.UseVisualStyleBackColor = True - ' - 'cmd3 - ' - resources.ApplyResources(Me.cmd3, "cmd3") - Me.cmd3.Name = "cmd3" - Me.cmd3.UseVisualStyleBackColor = True - ' - 'cmd4 - ' - resources.ApplyResources(Me.cmd4, "cmd4") - Me.cmd4.Name = "cmd4" - Me.cmd4.UseVisualStyleBackColor = True - ' - 'cmd5 - ' - resources.ApplyResources(Me.cmd5, "cmd5") - Me.cmd5.Name = "cmd5" - Me.cmd5.UseVisualStyleBackColor = True - ' - 'cmd6 - ' - resources.ApplyResources(Me.cmd6, "cmd6") - Me.cmd6.Name = "cmd6" - Me.cmd6.UseVisualStyleBackColor = True - ' - 'cmd7 - ' - resources.ApplyResources(Me.cmd7, "cmd7") - Me.cmd7.Name = "cmd7" - Me.cmd7.UseVisualStyleBackColor = True - ' - 'cmd8 - ' - resources.ApplyResources(Me.cmd8, "cmd8") - Me.cmd8.Name = "cmd8" - Me.cmd8.UseVisualStyleBackColor = True - ' - 'cmd9 - ' - resources.ApplyResources(Me.cmd9, "cmd9") - Me.cmd9.Name = "cmd9" - Me.cmd9.UseVisualStyleBackColor = True - ' - 'cmdMinus - ' - resources.ApplyResources(Me.cmdMinus, "cmdMinus") - Me.cmdMinus.Name = "cmdMinus" - Me.cmdMinus.UseVisualStyleBackColor = True - ' - 'cmdDelete - ' - resources.ApplyResources(Me.cmdDelete, "cmdDelete") - Me.cmdDelete.Name = "cmdDelete" - Me.cmdDelete.Tag = "Del" - Me.cmdDelete.UseVisualStyleBackColor = True - ' - 'cmdBrackets - ' - resources.ApplyResources(Me.cmdBrackets, "cmdBrackets") - Me.cmdBrackets.Name = "cmdBrackets" - Me.cmdBrackets.UseVisualStyleBackColor = True - ' - 'grpEnterKeybord1 - ' - Me.grpEnterKeybord1.Controls.Add(Me.cmdBrackets) - Me.grpEnterKeybord1.Controls.Add(Me.cmdDelete) - Me.grpEnterKeybord1.Controls.Add(Me.cmdMinus) - Me.grpEnterKeybord1.Controls.Add(Me.cmd9) - Me.grpEnterKeybord1.Controls.Add(Me.cmd8) - Me.grpEnterKeybord1.Controls.Add(Me.cmd7) - Me.grpEnterKeybord1.Controls.Add(Me.cmd6) - Me.grpEnterKeybord1.Controls.Add(Me.cmd5) - Me.grpEnterKeybord1.Controls.Add(Me.cmd4) - Me.grpEnterKeybord1.Controls.Add(Me.cmd3) - Me.grpEnterKeybord1.Controls.Add(Me.cmdClear) - Me.grpEnterKeybord1.Controls.Add(Me.cmd2) - Me.grpEnterKeybord1.Controls.Add(Me.cmd0) - Me.grpEnterKeybord1.Controls.Add(Me.cmdSquareBrackets) - Me.grpEnterKeybord1.Controls.Add(Me.cmd1) - resources.ApplyResources(Me.grpEnterKeybord1, "grpEnterKeybord1") - Me.grpEnterKeybord1.Name = "grpEnterKeybord1" - Me.grpEnterKeybord1.TabStop = False - ' 'cmdMissingValues ' resources.ApplyResources(Me.cmdMissingValues, "cmdMissingValues") @@ -322,6 +214,7 @@ Partial Class dlgEnter 'ucrSaveEnterResultInto ' Me.ucrSaveEnterResultInto.AddQuotesIfUnrecognised = True + Me.ucrSaveEnterResultInto.GetSetSelectedIndex = -1 Me.ucrSaveEnterResultInto.IsReadOnly = False resources.ApplyResources(Me.ucrSaveEnterResultInto, "ucrSaveEnterResultInto") Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" @@ -358,10 +251,150 @@ Partial Class dlgEnter Me.btnExample.Name = "btnExample" Me.btnExample.UseVisualStyleBackColor = True ' + 'grpBasic + ' + Me.grpBasic.Controls.Add(Me.cmdClear) + Me.grpBasic.Controls.Add(Me.Button1) + Me.grpBasic.Controls.Add(Me.cmdBrackets) + Me.grpBasic.Controls.Add(Me.cmdPower) + Me.grpBasic.Controls.Add(Me.cmdDivide) + Me.grpBasic.Controls.Add(Me.cmdPlus) + Me.grpBasic.Controls.Add(Me.cmdMinus) + Me.grpBasic.Controls.Add(Me.cmdMultiply) + Me.grpBasic.Controls.Add(Me.Button2) + Me.grpBasic.Controls.Add(Me.cmd9) + Me.grpBasic.Controls.Add(Me.cmd8) + Me.grpBasic.Controls.Add(Me.cmd7) + Me.grpBasic.Controls.Add(Me.cmd6) + Me.grpBasic.Controls.Add(Me.cmd5) + Me.grpBasic.Controls.Add(Me.cmd4) + Me.grpBasic.Controls.Add(Me.cmd3) + Me.grpBasic.Controls.Add(Me.cmd2) + Me.grpBasic.Controls.Add(Me.cmd0) + Me.grpBasic.Controls.Add(Me.cmd1) + resources.ApplyResources(Me.grpBasic, "grpBasic") + Me.grpBasic.Name = "grpBasic" + Me.grpBasic.TabStop = False + ' + 'cmdClear + ' + resources.ApplyResources(Me.cmdClear, "cmdClear") + Me.cmdClear.Name = "cmdClear" + Me.cmdClear.UseVisualStyleBackColor = True + ' + 'Button1 + ' + resources.ApplyResources(Me.Button1, "Button1") + Me.Button1.Name = "Button1" + Me.Button1.UseVisualStyleBackColor = True + ' + 'cmdBrackets + ' + resources.ApplyResources(Me.cmdBrackets, "cmdBrackets") + Me.cmdBrackets.Name = "cmdBrackets" + Me.cmdBrackets.UseVisualStyleBackColor = True + ' + 'cmdPower + ' + resources.ApplyResources(Me.cmdPower, "cmdPower") + Me.cmdPower.Name = "cmdPower" + Me.cmdPower.UseVisualStyleBackColor = True + ' + 'cmdDivide + ' + resources.ApplyResources(Me.cmdDivide, "cmdDivide") + Me.cmdDivide.Name = "cmdDivide" + Me.cmdDivide.UseVisualStyleBackColor = True + ' + 'cmdPlus + ' + resources.ApplyResources(Me.cmdPlus, "cmdPlus") + Me.cmdPlus.Name = "cmdPlus" + Me.cmdPlus.UseVisualStyleBackColor = True + ' + 'cmdMinus + ' + resources.ApplyResources(Me.cmdMinus, "cmdMinus") + Me.cmdMinus.Name = "cmdMinus" + Me.cmdMinus.UseVisualStyleBackColor = True + ' + 'cmdMultiply + ' + resources.ApplyResources(Me.cmdMultiply, "cmdMultiply") + Me.cmdMultiply.Name = "cmdMultiply" + Me.cmdMultiply.UseVisualStyleBackColor = True + ' + 'Button2 + ' + resources.ApplyResources(Me.Button2, "Button2") + Me.Button2.Name = "Button2" + Me.Button2.UseVisualStyleBackColor = True + ' + 'cmd9 + ' + resources.ApplyResources(Me.cmd9, "cmd9") + Me.cmd9.Name = "cmd9" + Me.cmd9.UseVisualStyleBackColor = True + ' + 'cmd8 + ' + resources.ApplyResources(Me.cmd8, "cmd8") + Me.cmd8.Name = "cmd8" + Me.cmd8.UseVisualStyleBackColor = True + ' + 'cmd7 + ' + resources.ApplyResources(Me.cmd7, "cmd7") + Me.cmd7.Name = "cmd7" + Me.cmd7.UseVisualStyleBackColor = True + ' + 'cmd6 + ' + resources.ApplyResources(Me.cmd6, "cmd6") + Me.cmd6.Name = "cmd6" + Me.cmd6.UseVisualStyleBackColor = True + ' + 'cmd5 + ' + resources.ApplyResources(Me.cmd5, "cmd5") + Me.cmd5.Name = "cmd5" + Me.cmd5.UseVisualStyleBackColor = True + ' + 'cmd4 + ' + resources.ApplyResources(Me.cmd4, "cmd4") + Me.cmd4.Name = "cmd4" + Me.cmd4.UseVisualStyleBackColor = True + ' + 'cmd3 + ' + resources.ApplyResources(Me.cmd3, "cmd3") + Me.cmd3.Name = "cmd3" + Me.cmd3.UseVisualStyleBackColor = True + ' + 'cmd2 + ' + resources.ApplyResources(Me.cmd2, "cmd2") + Me.cmd2.Name = "cmd2" + Me.cmd2.UseVisualStyleBackColor = True + ' + 'cmd0 + ' + resources.ApplyResources(Me.cmd0, "cmd0") + Me.cmd0.Name = "cmd0" + Me.cmd0.UseVisualStyleBackColor = True + ' + 'cmd1 + ' + resources.ApplyResources(Me.cmd1, "cmd1") + Me.cmd1.Name = "cmd1" + Me.cmd1.UseVisualStyleBackColor = True + ' 'dlgEnter ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.grpBasic) Me.Controls.Add(Me.btnExample) Me.Controls.Add(Me.ucrTryModelling) Me.Controls.Add(Me.grpEnterKeyboard2) @@ -369,7 +402,6 @@ Partial Class dlgEnter Me.Controls.Add(Me.chkSaveEnterResultInto) Me.Controls.Add(Me.ucrDataFrameEnter) Me.Controls.Add(Me.chkShowEnterArguments) - Me.Controls.Add(Me.grpEnterKeybord1) Me.Controls.Add(Me.lblData) Me.Controls.Add(Me.ucrReceiverForEnterCalculation) Me.Controls.Add(Me.ucrBase) @@ -377,8 +409,8 @@ Partial Class dlgEnter Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgEnter" - Me.grpEnterKeybord1.ResumeLayout(False) Me.grpEnterKeyboard2.ResumeLayout(False) + Me.grpBasic.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -391,22 +423,6 @@ Partial Class dlgEnter Friend WithEvents ucrDataFrameEnter As ucrDataFrame Friend WithEvents ucrSaveEnterResultInto As ucrInputComboBox Friend WithEvents chkSaveEnterResultInto As CheckBox - Friend WithEvents cmd1 As Button - Friend WithEvents cmdSquareBrackets As Button - Friend WithEvents cmd0 As Button - Friend WithEvents cmd2 As Button - Friend WithEvents cmdClear As Button - Friend WithEvents cmd3 As Button - Friend WithEvents cmd4 As Button - Friend WithEvents cmd5 As Button - Friend WithEvents cmd6 As Button - Friend WithEvents cmd7 As Button - Friend WithEvents cmd8 As Button - Friend WithEvents cmd9 As Button - Friend WithEvents cmdMinus As Button - Friend WithEvents cmdDelete As Button - Friend WithEvents cmdBrackets As Button - Friend WithEvents grpEnterKeybord1 As GroupBox Friend WithEvents cmdMissingValues As Button Friend WithEvents cmdExponential As Button Friend WithEvents cmdConcantenateFunction As Button @@ -424,4 +440,24 @@ Partial Class dlgEnter Friend WithEvents grpEnterKeyboard2 As GroupBox Friend WithEvents ucrTryModelling As ucrTry Friend WithEvents btnExample As Button + Friend WithEvents grpBasic As GroupBox + Friend WithEvents cmdClear As Button + Friend WithEvents Button1 As Button + Friend WithEvents cmdBrackets As Button + Friend WithEvents cmdPower As Button + Friend WithEvents cmdDivide As Button + Friend WithEvents cmdPlus As Button + Friend WithEvents cmdMinus As Button + Friend WithEvents cmdMultiply As Button + Friend WithEvents Button2 As Button + Friend WithEvents cmd9 As Button + Friend WithEvents cmd8 As Button + Friend WithEvents cmd7 As Button + Friend WithEvents cmd6 As Button + Friend WithEvents cmd5 As Button + Friend WithEvents cmd4 As Button + Friend WithEvents cmd3 As Button + Friend WithEvents cmd2 As Button + Friend WithEvents cmd0 As Button + Friend WithEvents cmd1 As Button End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 0e9f98a7ce9..25ecbfaf477 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -144,7 +144,7 @@ $this - 6 + 7 True @@ -202,919 +202,1102 @@ $this - 4 - - - 4, 76 - - - 2, 3, 2, 3 - - - 45, 30 - - - 117 - - - 1 - - - cmd1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeybord1 - - - 14 + 5 - - 144, 14 + + 106, 14 - + 2, 3, 2, 3 - + 45, 30 - - 141 + + 142 - - [ ] + + NA - - cmdSquareBrackets + + cmdMissingValues - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 13 - - 51, 107 + + Microsoft Sans Serif, 8.25pt - + + 7, 109 + + 2, 3, 2, 3 - + 45, 30 - - 118 + + 143 - - 0 + + E - - cmd0 + + cmdExponential - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 12 - - 51, 76 + + 56, 14 - + 2, 3, 2, 3 - + 45, 30 - - 119 + + 145 - - 2 + + c( ) - - cmd2 + + cmdConcantenateFunction - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 11 - - Microsoft Sans Serif, 6.75pt + + Microsoft Sans Serif, 8.25pt - - 144, 76 + + 56, 109 - + 2, 3, 2, 3 - - 45, 61 + + 45, 30 - - 144 + + 146 - - Clear + + seq2 - - cmdClear + + cmdSequence2 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 10 - - 97, 76 + + Microsoft Sans Serif, 8.25pt - + + 56, 77 + + 2, 3, 2, 3 - + 45, 30 - - 120 + + 147 - - 3 + + seq - - cmd3 + + cmdSequenceFunction - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 9 - - 4, 45 + + Microsoft Sans Serif, 8.25pt - + + 56, 45 + + 2, 3, 2, 3 - + 45, 30 - - 121 + + 148 - - 4 + + rep - - cmd4 + + cmdRepelicationFunction - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 8 - - 51, 45 + + 154, 14 - + 2, 3, 2, 3 - - 45, 30 + + 45, 61 - - 122 + + 149 - - 5 + + LTRS - - cmd5 + + cmdLETTERS - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 7 - - 97, 45 + + 106, 45 - + 2, 3, 2, 3 - + 45, 30 - - 123 + + 149 - - 6 + + pi - - cmd6 + + cmdPi - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 6 - - 4, 14 + + 7, 14 - + 2, 3, 2, 3 - + 45, 30 - - 124 + + 149 - - 7 + + . - - cmd7 + + cmdDot - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 5 - - 51, 14 + + 106, 108 - + 2, 3, 2, 3 - + 45, 30 - - 125 + + 150 - - 8 + + mon+ - - cmd8 + + cmdMonthPlus - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 4 - - 97, 14 + + 154, 77 - + 2, 3, 2, 3 - - 45, 30 + + 45, 61 - - 126 + + 152 - - 9 + + ltrs - - cmd9 + + cmdLetters2 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 3 - - 144, 45 + + 7, 45 - + 2, 3, 2, 3 - + 45, 30 - - 129 + + 152 - - - + + , - - cmdMinus + + cmdComma - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 2 - - Microsoft Sans Serif, 8.25pt - - - 4, 107 + + 106, 77 - + 2, 3, 2, 3 - + 45, 30 - - 132 + + 151 - - Del + + mon- - - cmdDelete + + cmdMonthMinus - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 1 - - 97, 107 + + 7, 77 - + 2, 3, 2, 3 - + 45, 30 - - 136 + + 151 - - ( ) + + : - - cmdBrackets + + cmdColon - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + 0 - - 163, 48 + + 364, 48 - + 2, 3, 2, 3 - + 2, 3, 2, 3 - - 194, 149 + + 204, 149 - - 154 + + 159 - - grpEnterKeybord1 + + grpEnterKeyboard2 - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 7 + + 3 - - 106, 14 + + 124, 244 - + 2, 3, 2, 3 - - 45, 30 + + 266, 22 - - 142 + + 158 - - NA + + ucrSaveEnterResultInto - - cmdMissingValues + + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - grpEnterKeyboard2 + + 4 - - 13 + + 11, 55 - - Microsoft Sans Serif, 8.25pt + + 0, 0, 0, 0 - - 7, 109 + + 150, 40 - + + 156 + + + ucrDataFrameEnter + + + instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 6 + + + True + + + 6, 13 + + + 573, 336 + + + NoControl + + + 151, 71 + + 2, 3, 2, 3 - - 45, 30 + + 49, 60 - - 143 + + 190 - - E + + Clear - - cmdExponential + + cmdClear - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 12 + + 0 - - 56, 14 + + Microsoft Sans Serif, 12pt - + + NoControl + + + 3, 100 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 145 + + 138 - - c( ) + + , - - cmdConcantenateFunction + + Button1 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 11 + + 1 - - Microsoft Sans Serif, 8.25pt + + NoControl - - 56, 109 + + 77, 100 - + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 146 + + 136 - - seq2 + + ( ) - - cmdSequence2 + + cmdBrackets - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 10 + + 2 - - Microsoft Sans Serif, 8.25pt + + Microsoft Sans Serif, 14.25pt - - 56, 77 + + NoControl - + + 151, 42 + + 2, 3, 2, 3 - - 45, 30 + + 49, 30 - - 147 + + 133 - - seq + + ^ - - cmdSequenceFunction + + cmdPower - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 9 + + 3 - - Microsoft Sans Serif, 8.25pt + + Microsoft Sans Serif, 14.25pt - - 56, 45 + + NoControl - + + 114, 13 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 148 + + 131 - - rep + + / - - cmdRepelicationFunction + + cmdDivide - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 8 + + 4 - - 154, 14 + + Microsoft Sans Serif, 14.25pt - + + NoControl + + + 114, 100 + + 2, 3, 2, 3 - - 45, 61 + + 38, 30 - - 149 + + 130 - - LTRS + + + - - cmdLETTERS + + cmdPlus - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 7 + + 5 - - 106, 45 + + Microsoft Sans Serif, 14.25pt - + + NoControl + + + 114, 71 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 149 + + 129 - - pi + + - - - cmdPi + + cmdMinus - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - + 6 - - 7, 14 + + Microsoft Sans Serif, 14.25pt - + + NoControl + + + 114, 42 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 149 + + 128 - + + * + + + cmdMultiply + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 7 + + + Microsoft Sans Serif, 14.25pt + + + NoControl + + + 151, 13 + + + 2, 3, 2, 3 + + + 49, 30 + + + 127 + + . - - cmdDot + + Button2 - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 8 + + + NoControl + + + 77, 13 + + + 2, 3, 2, 3 + + + 38, 30 + + + 126 + + + 9 + + + cmd9 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 9 + + + NoControl + + + 40, 13 + + + 2, 3, 2, 3 + + + 38, 30 + + + 125 + + + 8 + + + cmd8 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 10 + + + NoControl + + + 3, 13 + + + 2, 3, 2, 3 + + + 38, 30 + + + 124 + + + 7 + + + cmd7 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 5 + + 11 - - 106, 108 + + NoControl - + + 77, 42 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 150 + + 123 - - mon+ + + 6 - - cmdMonthPlus + + cmd6 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 4 + + 12 - - 154, 77 + + NoControl - + + 40, 42 + + 2, 3, 2, 3 - - 45, 61 + + 38, 30 - - 152 + + 122 - - ltrs + + 5 - - cmdLetters2 + + cmd5 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 3 + + 13 - - 7, 45 + + NoControl - + + 3, 42 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 152 + + 121 - - , + + 4 - - cmdComma + + cmd4 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 2 + + 14 - - 106, 77 + + NoControl - + + 77, 71 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 151 + + 120 - - mon- + + 3 - - cmdMonthMinus + + cmd3 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 1 + + 15 - - 7, 77 + + NoControl - + + 40, 71 + + 2, 3, 2, 3 - - 45, 30 + + 38, 30 - - 151 + + 119 - - : + + 2 - - cmdColon + + cmd2 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 + + grpBasic - - 0 + + 16 - - 364, 48 + + NoControl - - 2, 3, 2, 3 + + 40, 100 - + 2, 3, 2, 3 - - 204, 149 + + 38, 30 - - 159 + + 118 - - grpEnterKeyboard2 + + 0 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + cmd0 - - $this + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 2 + + grpBasic - - 124, 244 + + 17 - + + NoControl + + + 3, 71 + + 2, 3, 2, 3 - - 266, 22 + + 38, 30 - - 158 + + 117 - - ucrSaveEnterResultInto + + 1 - - instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + cmd1 - - $this + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3 + + grpBasic - - 11, 55 + + 18 - - 0, 0, 0, 0 + + 160, 57 - - 150, 40 + + 2, 3, 2, 3 - - 156 + + 2, 3, 2, 3 - - ucrDataFrameEnter + + 205, 134 - - instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + 180 - - $this + + Basic - - 5 + + grpBasic - - True - - - 6, 13 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 573, 336 + + $this + + + 0 NoControl @@ -1144,7 +1327,7 @@ $this - 0 + 1 3, 202 @@ -1165,7 +1348,7 @@ $this - 1 + 2 11, 278 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 05181d4d519..5d5a60bd3bf 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -119,51 +119,51 @@ Public Class dlgEnter SetDefaults() TestOKEnabled() End Sub - Private Sub cmd0_Click(sender As Object, e As EventArgs) Handles cmd0.Click + Private Sub cmd0_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("0") TestOKEnabled() End Sub - Private Sub cmd1_Click(sender As Object, e As EventArgs) Handles cmd1.Click + Private Sub cmd1_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("1") TestOKEnabled() End Sub - Private Sub md2_Click(sender As Object, e As EventArgs) Handles cmd2.Click + Private Sub md2_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("2") TestOKEnabled() End Sub - Private Sub cmd3_Click(sender As Object, e As EventArgs) Handles cmd3.Click + Private Sub cmd3_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("3") TestOKEnabled() End Sub - Private Sub cmd4_Click(sender As Object, e As EventArgs) Handles cmd4.Click + Private Sub cmd4_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("4") TestOKEnabled() End Sub - Private Sub cmd5_Click(sender As Object, e As EventArgs) Handles cmd5.Click + Private Sub cmd5_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("5") TestOKEnabled() End Sub - Private Sub cmd6_Click(sender As Object, e As EventArgs) Handles cmd6.Click + Private Sub cmd6_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("6") TestOKEnabled() End Sub - Private Sub cmd7_Click(sender As Object, e As EventArgs) Handles cmd7.Click + Private Sub cmd7_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("7") TestOKEnabled() End Sub - Private Sub cmd8_Click(sender As Object, e As EventArgs) Handles cmd8.Click + Private Sub cmd8_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("8") TestOKEnabled() End Sub - Private Sub cmd9_Click(sender As Object, e As EventArgs) Handles cmd9.Click + Private Sub cmd9_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("9") TestOKEnabled() End Sub @@ -181,11 +181,11 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdBrackets_Click(sender As Object, e As EventArgs) Handles cmdBrackets.Click + Private Sub cmdBrackets_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("( )", 2) TestOKEnabled() End Sub - Private Sub cmdMinus_Click(sender As Object, e As EventArgs) Handles cmdMinus.Click + Private Sub cmdMinus_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("-") TestOKEnabled() End Sub @@ -194,7 +194,7 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(",") TestOKEnabled() End Sub - Private Sub cmdDelete_Click_1(sender As Object, e As EventArgs) Handles cmdDelete.Click + Private Sub cmdDelete_Click_1(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.Backspace() TestOKEnabled() End Sub @@ -207,7 +207,7 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("NA") End Sub - Private Sub cmdSquareBrackets_Click_1(sender As Object, e As EventArgs) Handles cmdSquareBrackets.Click + Private Sub cmdSquareBrackets_Click_1(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("[ ]", 2) TestOKEnabled() End Sub @@ -249,7 +249,7 @@ Public Class dlgEnter End If TestOKEnabled() End Sub - Private Sub cmdClear_Click_1(sender As Object, e As EventArgs) Handles cmdClear.Click + Private Sub cmdClear_Click_1(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.Clear() TestOKEnabled() End Sub @@ -334,4 +334,79 @@ Public Class dlgEnter objPopup.SetSize(ucrReceiverForEnterCalculation.Width, ucrReceiverForEnterCalculation.Height + 100) objPopup.Show(ucrReceiverForEnterCalculation) End Sub + Private Sub cmd7_Click_1(sender As Object, e As EventArgs) Handles cmd7.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("7") + End Sub + + Private Sub cmd8_Click_1(sender As Object, e As EventArgs) Handles cmd8.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("8") + End Sub + + Private Sub cmd9_Click_1(sender As Object, e As EventArgs) Handles cmd9.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("9") + End Sub + + Private Sub cmdDivide_Click(sender As Object, e As EventArgs) Handles cmdDivide.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("/") + End Sub + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(".") + End Sub + + Private Sub cmd4_Click_1(sender As Object, e As EventArgs) Handles cmd4.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("4") + End Sub + + Private Sub cmd5_Click_1(sender As Object, e As EventArgs) Handles cmd5.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("5") + End Sub + + Private Sub cmd6_Click_1(sender As Object, e As EventArgs) Handles cmd6.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("6") + End Sub + + Private Sub cmdMultiply_Click(sender As Object, e As EventArgs) Handles cmdMultiply.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("*") + End Sub + + Private Sub cmdPower_Click(sender As Object, e As EventArgs) Handles cmdPower.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("^") + End Sub + + Private Sub cmd1_Click_1(sender As Object, e As EventArgs) Handles cmd1.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("1") + End Sub + + Private Sub cmd2_Click(sender As Object, e As EventArgs) Handles cmd2.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("2") + End Sub + + Private Sub cmd3_Click_1(sender As Object, e As EventArgs) Handles cmd3.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("3") + End Sub + + Private Sub cmdMinus_Click_1(sender As Object, e As EventArgs) Handles cmdMinus.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("-") + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(",") + End Sub + + Private Sub cmd0_Click_1(sender As Object, e As EventArgs) Handles cmd0.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("0") + End Sub + + Private Sub cmdBrackets_Click_1(sender As Object, e As EventArgs) Handles cmdBrackets.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("()") + End Sub + + Private Sub cmdPlus_Click(sender As Object, e As EventArgs) Handles cmdPlus.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("+") + End Sub + + Private Sub cmdClear_Click(sender As Object, e As EventArgs) Handles cmdClear.Click + ucrReceiverForEnterCalculation.Clear() + End Sub End Class From 0425f458251b8a638736d143e3f19b265fcaa7b8 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 11:49:24 +0300 Subject: [PATCH 027/102] Adding new keys to the existing Enter keyboard --- instat/dlgEnter.Designer.vb | 55 +++------ instat/dlgEnter.resx | 231 +++++++++++++++--------------------- instat/dlgEnter.vb | 21 ---- 3 files changed, 111 insertions(+), 196 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 79bb9263451..a1af51855f7 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -45,18 +45,15 @@ Partial Class dlgEnter Me.cmdMissingValues = New System.Windows.Forms.Button() Me.cmdExponential = New System.Windows.Forms.Button() Me.cmdConcantenateFunction = New System.Windows.Forms.Button() - Me.cmdSequence2 = New System.Windows.Forms.Button() Me.cmdSequenceFunction = New System.Windows.Forms.Button() Me.cmdRepelicationFunction = New System.Windows.Forms.Button() Me.cmdLETTERS = New System.Windows.Forms.Button() Me.cmdPi = New System.Windows.Forms.Button() - Me.cmdDot = New System.Windows.Forms.Button() - Me.cmdMonthPlus = New System.Windows.Forms.Button() Me.cmdLetters2 = New System.Windows.Forms.Button() - Me.cmdComma = New System.Windows.Forms.Button() Me.cmdMonthMinus = New System.Windows.Forms.Button() Me.cmdColon = New System.Windows.Forms.Button() Me.grpEnterKeyboard2 = New System.Windows.Forms.GroupBox() + Me.cmdFactor = New System.Windows.Forms.Button() Me.ucrSaveEnterResultInto = New instat.ucrInputComboBox() Me.ucrDataFrameEnter = New instat.ucrDataFrame() Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() @@ -83,6 +80,7 @@ Partial Class dlgEnter Me.cmd2 = New System.Windows.Forms.Button() Me.cmd0 = New System.Windows.Forms.Button() Me.cmd1 = New System.Windows.Forms.Button() + Me.Button3 = New System.Windows.Forms.Button() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -123,12 +121,6 @@ Partial Class dlgEnter Me.cmdConcantenateFunction.Name = "cmdConcantenateFunction" Me.cmdConcantenateFunction.UseVisualStyleBackColor = True ' - 'cmdSequence2 - ' - resources.ApplyResources(Me.cmdSequence2, "cmdSequence2") - Me.cmdSequence2.Name = "cmdSequence2" - Me.cmdSequence2.UseVisualStyleBackColor = True - ' 'cmdSequenceFunction ' resources.ApplyResources(Me.cmdSequenceFunction, "cmdSequenceFunction") @@ -154,31 +146,12 @@ Partial Class dlgEnter Me.cmdPi.Name = "cmdPi" Me.cmdPi.UseVisualStyleBackColor = True ' - 'cmdDot - ' - resources.ApplyResources(Me.cmdDot, "cmdDot") - Me.cmdDot.Name = "cmdDot" - Me.cmdDot.UseVisualStyleBackColor = True - ' - 'cmdMonthPlus - ' - resources.ApplyResources(Me.cmdMonthPlus, "cmdMonthPlus") - Me.cmdMonthPlus.Name = "cmdMonthPlus" - Me.cmdMonthPlus.UseVisualStyleBackColor = True - ' 'cmdLetters2 ' resources.ApplyResources(Me.cmdLetters2, "cmdLetters2") Me.cmdLetters2.Name = "cmdLetters2" Me.cmdLetters2.UseVisualStyleBackColor = True ' - 'cmdComma - ' - resources.ApplyResources(Me.cmdComma, "cmdComma") - Me.cmdComma.Name = "cmdComma" - Me.cmdComma.Tag = "" - Me.cmdComma.UseVisualStyleBackColor = True - ' 'cmdMonthMinus ' resources.ApplyResources(Me.cmdMonthMinus, "cmdMonthMinus") @@ -193,17 +166,15 @@ Partial Class dlgEnter ' 'grpEnterKeyboard2 ' + Me.grpEnterKeyboard2.Controls.Add(Me.Button3) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdFactor) Me.grpEnterKeyboard2.Controls.Add(Me.cmdColon) Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonthMinus) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdComma) Me.grpEnterKeyboard2.Controls.Add(Me.cmdLetters2) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonthPlus) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdDot) Me.grpEnterKeyboard2.Controls.Add(Me.cmdPi) Me.grpEnterKeyboard2.Controls.Add(Me.cmdLETTERS) Me.grpEnterKeyboard2.Controls.Add(Me.cmdRepelicationFunction) Me.grpEnterKeyboard2.Controls.Add(Me.cmdSequenceFunction) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdSequence2) Me.grpEnterKeyboard2.Controls.Add(Me.cmdConcantenateFunction) Me.grpEnterKeyboard2.Controls.Add(Me.cmdExponential) Me.grpEnterKeyboard2.Controls.Add(Me.cmdMissingValues) @@ -211,6 +182,12 @@ Partial Class dlgEnter Me.grpEnterKeyboard2.Name = "grpEnterKeyboard2" Me.grpEnterKeyboard2.TabStop = False ' + 'cmdFactor + ' + resources.ApplyResources(Me.cmdFactor, "cmdFactor") + Me.cmdFactor.Name = "cmdFactor" + Me.cmdFactor.UseVisualStyleBackColor = True + ' 'ucrSaveEnterResultInto ' Me.ucrSaveEnterResultInto.AddQuotesIfUnrecognised = True @@ -390,6 +367,12 @@ Partial Class dlgEnter Me.cmd1.Name = "cmd1" Me.cmd1.UseVisualStyleBackColor = True ' + 'Button3 + ' + resources.ApplyResources(Me.Button3, "Button3") + Me.Button3.Name = "Button3" + Me.Button3.UseVisualStyleBackColor = True + ' 'dlgEnter ' resources.ApplyResources(Me, "$this") @@ -426,15 +409,11 @@ Partial Class dlgEnter Friend WithEvents cmdMissingValues As Button Friend WithEvents cmdExponential As Button Friend WithEvents cmdConcantenateFunction As Button - Friend WithEvents cmdSequence2 As Button Friend WithEvents cmdSequenceFunction As Button Friend WithEvents cmdRepelicationFunction As Button Friend WithEvents cmdLETTERS As Button Friend WithEvents cmdPi As Button - Friend WithEvents cmdDot As Button - Friend WithEvents cmdMonthPlus As Button Friend WithEvents cmdLetters2 As Button - Friend WithEvents cmdComma As Button Friend WithEvents cmdMonthMinus As Button Friend WithEvents cmdColon As Button Friend WithEvents grpEnterKeyboard2 As GroupBox @@ -460,4 +439,6 @@ Partial Class dlgEnter Friend WithEvents cmd2 As Button Friend WithEvents cmd0 As Button Friend WithEvents cmd1 As Button + Friend WithEvents cmdFactor As Button + Friend WithEvents Button3 As Button End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 25ecbfaf477..2b523d6f3e6 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -205,7 +205,7 @@ 5 - 106, 14 + 134, 7 2, 3, 2, 3 @@ -229,13 +229,13 @@ grpEnterKeyboard2 - 13 + 11 Microsoft Sans Serif, 8.25pt - 7, 109 + 46, 7 2, 3, 2, 3 @@ -259,10 +259,10 @@ grpEnterKeyboard2 - 12 + 10 - 56, 14 + 90, 7 2, 3, 2, 3 @@ -286,43 +286,13 @@ grpEnterKeyboard2 - 11 - - - Microsoft Sans Serif, 8.25pt - - - 56, 109 - - - 2, 3, 2, 3 - - - 45, 30 - - - 146 - - - seq2 - - - cmdSequence2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 10 + 9 Microsoft Sans Serif, 8.25pt - 56, 77 + 46, 36 2, 3, 2, 3 @@ -346,13 +316,13 @@ grpEnterKeyboard2 - 9 + 8 Microsoft Sans Serif, 8.25pt - 56, 45 + 2, 36 2, 3, 2, 3 @@ -376,22 +346,22 @@ grpEnterKeyboard2 - 8 + 7 - 154, 14 + 2, 65 2, 3, 2, 3 - 45, 61 + 74, 27 149 - LTRS + LETTERS cmdLETTERS @@ -403,10 +373,10 @@ grpEnterKeyboard2 - 7 + 6 - 106, 45 + 90, 36 2, 3, 2, 3 @@ -430,76 +400,22 @@ grpEnterKeyboard2 - 6 - - - 7, 14 - - - 2, 3, 2, 3 - - - 45, 30 - - - 149 - - - . - - - cmdDot - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - 5 - - 106, 108 - - - 2, 3, 2, 3 - - - 45, 30 - - - 150 - - - mon+ - - - cmdMonthPlus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 4 - - 154, 77 + 75, 65 2, 3, 2, 3 - 45, 61 + 61, 26 152 - ltrs + letters cmdLetters2 @@ -511,49 +427,22 @@ grpEnterKeyboard2 - 3 - - - 7, 45 - - - 2, 3, 2, 3 - - - 45, 30 - - - 152 - - - , - - - cmdComma - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 2 + 4 - 106, 77 + 134, 36 2, 3, 2, 3 - 45, 30 + 53, 30 151 - mon- + months cmdMonthMinus @@ -565,10 +454,10 @@ grpEnterKeyboard2 - 1 + 3 - 7, 77 + 2, 7 2, 3, 2, 3 @@ -592,10 +481,76 @@ grpEnterKeyboard2 + 2 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 53, 97 + + + 2, 3, 2, 3 + + + 45, 30 + + + 154 + + + factor + + + Button3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + 0 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 4, 98 + + + 2, 3, 2, 3 + + + 45, 30 + + + 153 + + + factor + + + cmdFactor + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 1 + - 364, 48 + 382, 48 2, 3, 2, 3 @@ -676,7 +631,7 @@ 6, 13 - 573, 336 + 593, 336 NoControl @@ -1270,7 +1225,7 @@ 18 - 160, 57 + 172, 46 2, 3, 2, 3 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 5d5a60bd3bf..19643b5d8e6 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -176,10 +176,6 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("NA") TestOKEnabled() End Sub - Private Sub cmdDot_Click(sender As Object, e As EventArgs) Handles cmdDot.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(".") - TestOKEnabled() - End Sub Private Sub cmdBrackets_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("( )", 2) @@ -190,10 +186,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdComma_Click(sender As Object, e As EventArgs) Handles cmdComma.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(",") - TestOKEnabled() - End Sub Private Sub cmdDelete_Click_1(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.Backspace() TestOKEnabled() @@ -241,14 +233,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdSequence2_Click_1(sender As Object, e As EventArgs) Handles cmdSequence2.Click - Dim length As Integer = ucrDataFrameEnter.iDataFrameLength - If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq(from= ,to= ,length= )", 15) - Else ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq( )", 2) - End If - TestOKEnabled() - End Sub Private Sub cmdClear_Click_1(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.Clear() TestOKEnabled() @@ -269,11 +253,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdMonthPlus_Click(sender As Object, e As EventArgs) Handles cmdMonthPlus.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("month.name") - TestOKEnabled() - End Sub - Private Sub ucrSaveEnterResultInto_NameChanged() Handles ucrSaveEnterResultInto.NameChanged SaveResults() End Sub From 7df13301ee5e695f288480ed1f16929f04ea1bed Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 11:55:18 +0300 Subject: [PATCH 028/102] modifying the existing keyboard --- instat/dlgEnter.Designer.vb | 55 +++++++++--- instat/dlgEnter.resx | 167 ++++++++++++++++++++++++++++-------- instat/dlgEnter.vb | 2 +- 3 files changed, 175 insertions(+), 49 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index a1af51855f7..5e2ff3de901 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -50,7 +50,7 @@ Partial Class dlgEnter Me.cmdLETTERS = New System.Windows.Forms.Button() Me.cmdPi = New System.Windows.Forms.Button() Me.cmdLetters2 = New System.Windows.Forms.Button() - Me.cmdMonthMinus = New System.Windows.Forms.Button() + Me.cmdMonths = New System.Windows.Forms.Button() Me.cmdColon = New System.Windows.Forms.Button() Me.grpEnterKeyboard2 = New System.Windows.Forms.GroupBox() Me.cmdFactor = New System.Windows.Forms.Button() @@ -80,7 +80,10 @@ Partial Class dlgEnter Me.cmd2 = New System.Windows.Forms.Button() Me.cmd0 = New System.Windows.Forms.Button() Me.cmd1 = New System.Windows.Forms.Button() - Me.Button3 = New System.Windows.Forms.Button() + Me.cmdDate = New System.Windows.Forms.Button() + Me.cmdDay = New System.Windows.Forms.Button() + Me.cmdMonth = New System.Windows.Forms.Button() + Me.cmdRunif = New System.Windows.Forms.Button() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -152,11 +155,11 @@ Partial Class dlgEnter Me.cmdLetters2.Name = "cmdLetters2" Me.cmdLetters2.UseVisualStyleBackColor = True ' - 'cmdMonthMinus + 'cmdMonths ' - resources.ApplyResources(Me.cmdMonthMinus, "cmdMonthMinus") - Me.cmdMonthMinus.Name = "cmdMonthMinus" - Me.cmdMonthMinus.UseVisualStyleBackColor = True + resources.ApplyResources(Me.cmdMonths, "cmdMonths") + Me.cmdMonths.Name = "cmdMonths" + Me.cmdMonths.UseVisualStyleBackColor = True ' 'cmdColon ' @@ -166,10 +169,13 @@ Partial Class dlgEnter ' 'grpEnterKeyboard2 ' - Me.grpEnterKeyboard2.Controls.Add(Me.Button3) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdRunif) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonth) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdDay) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdDate) Me.grpEnterKeyboard2.Controls.Add(Me.cmdFactor) Me.grpEnterKeyboard2.Controls.Add(Me.cmdColon) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonthMinus) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonths) Me.grpEnterKeyboard2.Controls.Add(Me.cmdLetters2) Me.grpEnterKeyboard2.Controls.Add(Me.cmdPi) Me.grpEnterKeyboard2.Controls.Add(Me.cmdLETTERS) @@ -367,11 +373,29 @@ Partial Class dlgEnter Me.cmd1.Name = "cmd1" Me.cmd1.UseVisualStyleBackColor = True ' - 'Button3 + 'cmdDate ' - resources.ApplyResources(Me.Button3, "Button3") - Me.Button3.Name = "Button3" - Me.Button3.UseVisualStyleBackColor = True + resources.ApplyResources(Me.cmdDate, "cmdDate") + Me.cmdDate.Name = "cmdDate" + Me.cmdDate.UseVisualStyleBackColor = True + ' + 'cmdDay + ' + resources.ApplyResources(Me.cmdDay, "cmdDay") + Me.cmdDay.Name = "cmdDay" + Me.cmdDay.UseVisualStyleBackColor = True + ' + 'cmdMonth + ' + resources.ApplyResources(Me.cmdMonth, "cmdMonth") + Me.cmdMonth.Name = "cmdMonth" + Me.cmdMonth.UseVisualStyleBackColor = True + ' + 'cmdRunif + ' + resources.ApplyResources(Me.cmdRunif, "cmdRunif") + Me.cmdRunif.Name = "cmdRunif" + Me.cmdRunif.UseVisualStyleBackColor = True ' 'dlgEnter ' @@ -414,7 +438,7 @@ Partial Class dlgEnter Friend WithEvents cmdLETTERS As Button Friend WithEvents cmdPi As Button Friend WithEvents cmdLetters2 As Button - Friend WithEvents cmdMonthMinus As Button + Friend WithEvents cmdMonths As Button Friend WithEvents cmdColon As Button Friend WithEvents grpEnterKeyboard2 As GroupBox Friend WithEvents ucrTryModelling As ucrTry @@ -440,5 +464,8 @@ Partial Class dlgEnter Friend WithEvents cmd0 As Button Friend WithEvents cmd1 As Button Friend WithEvents cmdFactor As Button - Friend WithEvents Button3 As Button + Friend WithEvents cmdDate As Button + Friend WithEvents cmdDay As Button + Friend WithEvents cmdMonth As Button + Friend WithEvents cmdRunif As Button End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 2b523d6f3e6..9f216708336 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -229,7 +229,7 @@ grpEnterKeyboard2 - 11 + 14 Microsoft Sans Serif, 8.25pt @@ -259,7 +259,7 @@ grpEnterKeyboard2 - 10 + 13 90, 7 @@ -286,7 +286,7 @@ grpEnterKeyboard2 - 9 + 12 Microsoft Sans Serif, 8.25pt @@ -316,7 +316,7 @@ grpEnterKeyboard2 - 8 + 11 Microsoft Sans Serif, 8.25pt @@ -346,7 +346,7 @@ grpEnterKeyboard2 - 7 + 10 2, 65 @@ -373,7 +373,7 @@ grpEnterKeyboard2 - 6 + 9 90, 36 @@ -400,7 +400,7 @@ grpEnterKeyboard2 - 5 + 8 75, 65 @@ -427,34 +427,34 @@ grpEnterKeyboard2 - 4 + 7 - + 134, 36 - + 2, 3, 2, 3 - + 53, 30 - + 151 - + months - - cmdMonthMinus + + cmdMonths - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpEnterKeyboard2 - - 3 + + 6 2, 7 @@ -481,40 +481,139 @@ grpEnterKeyboard2 + 5 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 151, 99 + + + 2, 3, 2, 3 + + + 45, 30 + + + 157 + + + runif + + + cmdRunif + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 0 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 142, 69 + + + 2, 3, 2, 3 + + + 45, 30 + + + 156 + + + month + + + cmdMonth + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 1 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 102, 97 + + + 2, 3, 2, 3 + + + 45, 30 + + + 155 + + + day + + + cmdDay + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + 2 - + Microsoft Sans Serif, 8.25pt - + NoControl - + 53, 97 - + 2, 3, 2, 3 - + 45, 30 - + 154 - - factor + + date - - Button3 + + cmdDate - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpEnterKeyboard2 - - 0 + + 3 Microsoft Sans Serif, 8.25pt @@ -547,7 +646,7 @@ grpEnterKeyboard2 - 1 + 4 382, 48 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 19643b5d8e6..79f3a20e912 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -248,7 +248,7 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdMonthMinus_Click(sender As Object, e As EventArgs) Handles cmdMonthMinus.Click + Private Sub cmdMonthMinus_Click(sender As Object, e As EventArgs) Handles cmdMonths.Click ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("month.abb") TestOKEnabled() End Sub From fc35898c31371de0fb81cf4b88814b1f986746be Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 12:39:40 +0300 Subject: [PATCH 029/102] Modification of the keyboard --- instat/dlgEnter.Designer.vb | 9 + instat/dlgEnter.resx | 839 +++++++++++++++++++++++++----------- 2 files changed, 595 insertions(+), 253 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 5e2ff3de901..2ebc77f3969 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -84,6 +84,7 @@ Partial Class dlgEnter Me.cmdDay = New System.Windows.Forms.Button() Me.cmdMonth = New System.Windows.Forms.Button() Me.cmdRunif = New System.Windows.Forms.Button() + Me.cmdRnorm = New System.Windows.Forms.Button() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -169,6 +170,7 @@ Partial Class dlgEnter ' 'grpEnterKeyboard2 ' + Me.grpEnterKeyboard2.Controls.Add(Me.cmdRnorm) Me.grpEnterKeyboard2.Controls.Add(Me.cmdRunif) Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonth) Me.grpEnterKeyboard2.Controls.Add(Me.cmdDay) @@ -397,6 +399,12 @@ Partial Class dlgEnter Me.cmdRunif.Name = "cmdRunif" Me.cmdRunif.UseVisualStyleBackColor = True ' + 'cmdRnorm + ' + resources.ApplyResources(Me.cmdRnorm, "cmdRnorm") + Me.cmdRnorm.Name = "cmdRnorm" + Me.cmdRnorm.UseVisualStyleBackColor = True + ' 'dlgEnter ' resources.ApplyResources(Me, "$this") @@ -468,4 +476,5 @@ Partial Class dlgEnter Friend WithEvents cmdDay As Button Friend WithEvents cmdMonth As Button Friend WithEvents cmdRunif As Button + Friend WithEvents cmdRnorm As Button End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 9f216708336..fe2e75a88f7 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -205,13 +205,13 @@ 5 - 134, 7 + 130, 68 2, 3, 2, 3 - 45, 30 + 65, 30 142 @@ -229,19 +229,19 @@ grpEnterKeyboard2 - 14 + 15 Microsoft Sans Serif, 8.25pt - 46, 7 + 2, 39 2, 3, 2, 3 - 45, 30 + 65, 30 143 @@ -259,16 +259,16 @@ grpEnterKeyboard2 - 13 + 14 - 90, 7 + 66, 10 2, 3, 2, 3 - 45, 30 + 65, 30 145 @@ -286,19 +286,19 @@ grpEnterKeyboard2 - 12 + 13 Microsoft Sans Serif, 8.25pt - 46, 36 + 194, 97 2, 3, 2, 3 - 45, 30 + 65, 30 147 @@ -316,19 +316,19 @@ grpEnterKeyboard2 - 11 + 12 Microsoft Sans Serif, 8.25pt - 2, 36 + 2, 97 2, 3, 2, 3 - 45, 30 + 65, 30 148 @@ -346,16 +346,16 @@ grpEnterKeyboard2 - 10 + 11 - 2, 65 + 130, 39 2, 3, 2, 3 - 74, 27 + 65, 30 149 @@ -373,16 +373,16 @@ grpEnterKeyboard2 - 9 + 10 - 90, 36 + 194, 68 2, 3, 2, 3 - 45, 30 + 65, 30 149 @@ -400,16 +400,16 @@ grpEnterKeyboard2 - 8 + 9 - 75, 65 + 194, 39 2, 3, 2, 3 - 61, 26 + 65, 30 152 @@ -427,16 +427,16 @@ grpEnterKeyboard2 - 7 + 8 - 134, 36 + 66, 68 2, 3, 2, 3 - 53, 30 + 65, 30 151 @@ -454,16 +454,16 @@ grpEnterKeyboard2 - 6 + 7 - 2, 7 + 2, 10 2, 3, 2, 3 - 45, 30 + 65, 30 151 @@ -481,28 +481,19 @@ grpEnterKeyboard2 - 5 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 151, 99 + 6 - - 2, 3, 2, 3 + + cmdRnorm - - 45, 30 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 157 + + grpEnterKeyboard2 - - runif + + 0 cmdRunif @@ -514,28 +505,7 @@ grpEnterKeyboard2 - 0 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 142, 69 - - - 2, 3, 2, 3 - - - 45, 30 - - - 156 - - - month + 1 cmdMonth @@ -547,28 +517,7 @@ grpEnterKeyboard2 - 1 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 102, 97 - - - 2, 3, 2, 3 - - - 45, 30 - - - 155 - - - day + 2 cmdDay @@ -580,39 +529,57 @@ grpEnterKeyboard2 - 2 + 3 - - Microsoft Sans Serif, 8.25pt + + cmdDate - - NoControl + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 53, 97 + + grpEnterKeyboard2 - - 2, 3, 2, 3 + + 4 - - 45, 30 + + cmdFactor - - 154 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - date + + grpEnterKeyboard2 - - cmdDate + + 5 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 382, 45 - + + 2, 3, 2, 3 + + + 2, 3, 2, 3 + + + 263, 134 + + + 159 + + grpEnterKeyboard2 - + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 3 @@ -622,13 +589,13 @@ NoControl - 4, 98 + 66, 39 2, 3, 2, 3 - 45, 30 + 65, 30 153 @@ -646,91 +613,430 @@ grpEnterKeyboard2 + 5 + + + 124, 244 + + + 2, 3, 2, 3 + + + 266, 22 + + + 158 + + + ucrSaveEnterResultInto + + + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + 4 - - 382, 48 + + 11, 55 - + + 0, 0, 0, 0 + + + 150, 40 + + + 156 + + + ucrDataFrameEnter + + + instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 6 + + + True + + + 6, 13 + + + 648, 336 + + + cmdClear + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 0 + + + Button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 1 + + + cmdBrackets + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 2 + + + cmdPower + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 3 + + + cmdDivide + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 4 + + + cmdPlus + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 5 + + + cmdMinus + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 6 + + + cmdMultiply + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 7 + + + Button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 8 + + + cmd9 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 9 + + + cmd8 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 10 + + + cmd7 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 11 + + + cmd6 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 12 + + + cmd5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 13 + + + cmd4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 14 + + + cmd3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 15 + + + cmd2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 16 + + + cmd0 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 17 + + + cmd1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 18 + + + 172, 46 + + 2, 3, 2, 3 - + 2, 3, 2, 3 - - 204, 149 + + 205, 134 - - 159 + + 180 - - grpEnterKeyboard2 + + Basic - + + grpBasic + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 3 + + 0 + + + NoControl + + + 301, 16 + + + 2, 2, 2, 2 + + + 64, 22 + + + 161 + + + Examples + + + btnExample + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3, 202 + + + 480, 33 + + + 160 + + + ucrTryModelling + + + instat.ucrTry, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this - - 124, 244 + + 2 - - 2, 3, 2, 3 + + 11, 278 - - 266, 22 + + 452, 52 - - 158 + + 0 - - ucrSaveEnterResultInto + + ucrBase - - instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 4 + + 10 - - 11, 55 + + CenterScreen - - 0, 0, 0, 0 + + Enter - - 150, 40 + + dlgEnter - - 156 + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ucrDataFrameEnter + + 44, 16 - - instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + 2, 3, 2, 3 - - $this + + 254, 28 - - 6 + + 153 - - True - - - 6, 13 + + ucrReceiverForEnterCalculation - - 593, 336 + + instat.ucrReceiverExpression, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 9 NoControl @@ -1323,142 +1629,169 @@ 18 - - 172, 46 + + Microsoft Sans Serif, 8.25pt - - 2, 3, 2, 3 + + NoControl - + + 130, 10 + + 2, 3, 2, 3 - - 205, 134 + + 65, 30 - - 180 + + 154 - - Basic + + date - - grpBasic + + cmdDate - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + grpEnterKeyboard2 - - 0 + + 4 - + + Microsoft Sans Serif, 8.25pt + + NoControl - - 301, 16 + + 194, 10 - - 2, 2, 2, 2 + + 2, 3, 2, 3 - - 64, 22 + + 65, 30 - - 161 + + 155 - - Examples + + day - - btnExample + + cmdDay - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + grpEnterKeyboard2 - - 1 + + 3 - - 3, 202 + + Microsoft Sans Serif, 8.25pt - - 480, 33 + + NoControl - - 160 + + 2, 68 - - ucrTryModelling + + 2, 3, 2, 3 - - instat.ucrTry, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + 65, 30 - - $this + + 156 - + + month + + + cmdMonth + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + 2 - - 11, 278 + + Microsoft Sans Serif, 8.25pt - - 452, 52 + + NoControl - - 0 + + 130, 97 - - ucrBase + + 2, 3, 2, 3 - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + 65, 30 - - $this + + 157 - - 10 + + runif - - CenterScreen + + cmdRunif - - Enter + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - dlgEnter + + grpEnterKeyboard2 - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 - - 44, 16 + + Microsoft Sans Serif, 8.25pt - + + NoControl + + + 66, 97 + + 2, 3, 2, 3 - - 254, 28 + + 65, 30 - - 153 + + 158 - - ucrReceiverForEnterCalculation + + rnorm - - instat.ucrReceiverExpression, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + cmdRnorm - - $this + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 9 + + grpEnterKeyboard2 + + + 0 \ No newline at end of file From a04deedf93b3cc2c51da2897994519294ef97b64 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 12:49:57 +0300 Subject: [PATCH 030/102] Modifying the enter keyboard --- instat/dlgEnter.resx | 330 +++++++++++++++++-------------------------- instat/dlgEnter.vb | 8 ++ 2 files changed, 137 insertions(+), 201 deletions(-) diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index fe2e75a88f7..032e0bbcb4c 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -456,6 +456,9 @@ 7 + + Microsoft Sans Serif, 14.25pt + 2, 10 @@ -483,6 +486,27 @@ 6 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 66, 97 + + + 2, 3, 2, 3 + + + 65, 30 + + + 158 + + + rnorm + cmdRnorm @@ -495,6 +519,27 @@ 0 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 130, 97 + + + 2, 3, 2, 3 + + + 65, 30 + + + 157 + + + runif + cmdRunif @@ -507,6 +552,27 @@ 1 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 2, 68 + + + 2, 3, 2, 3 + + + 65, 30 + + + 156 + + + month + cmdMonth @@ -519,6 +585,27 @@ 2 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 194, 10 + + + 2, 3, 2, 3 + + + 65, 30 + + + 155 + + + day + cmdDay @@ -531,6 +618,27 @@ 3 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 130, 10 + + + 2, 3, 2, 3 + + + 65, 30 + + + 154 + + + date + cmdDate @@ -543,6 +651,27 @@ 4 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 66, 39 + + + 2, 3, 2, 3 + + + 65, 30 + + + 153 + + + factor + cmdFactor @@ -582,39 +711,6 @@ 3 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 66, 39 - - - 2, 3, 2, 3 - - - 65, 30 - - - 153 - - - factor - - - cmdFactor - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 5 - 124, 244 @@ -915,9 +1011,6 @@ 180 - - Basic - grpBasic @@ -1629,169 +1722,4 @@ 18 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 130, 10 - - - 2, 3, 2, 3 - - - 65, 30 - - - 154 - - - date - - - cmdDate - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 4 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 194, 10 - - - 2, 3, 2, 3 - - - 65, 30 - - - 155 - - - day - - - cmdDay - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 3 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 2, 68 - - - 2, 3, 2, 3 - - - 65, 30 - - - 156 - - - month - - - cmdMonth - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 2 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 130, 97 - - - 2, 3, 2, 3 - - - 65, 30 - - - 157 - - - runif - - - cmdRunif - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 1 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 66, 97 - - - 2, 3, 2, 3 - - - 65, 30 - - - 158 - - - rnorm - - - cmdRnorm - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 0 - \ No newline at end of file diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 79f3a20e912..68dbb71cee5 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -388,4 +388,12 @@ Public Class dlgEnter Private Sub cmdClear_Click(sender As Object, e As EventArgs) Handles cmdClear.Click ucrReceiverForEnterCalculation.Clear() End Sub + + Private Sub cmdDate_Click(sender As Object, e As EventArgs) Handles cmdDate.Click + If chkShowEnterArguments.Checked Then + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')") + Else + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 3) + End If + End Sub End Class From 2aced1a7d5e388027d82117c9905bdcc5e324c4e Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 12:58:23 +0300 Subject: [PATCH 031/102] Modification to the enter keyboard --- instat/dlgEnter.vb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 68dbb71cee5..58877ae55d1 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -396,4 +396,24 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 3) End If End Sub + + Private Sub cmdDay_Click(sender As Object, e As EventArgs) Handles cmdDay.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("'day'") + End Sub + + Private Sub cmdFactor_Click(sender As Object, e As EventArgs) Handles cmdFactor.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("factor( )", 2) + End Sub + + Private Sub cmdMonth_Click(sender As Object, e As EventArgs) Handles cmdMonth.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("'month'") + End Sub + + Private Sub cmdRnorm_Click(sender As Object, e As EventArgs) Handles cmdRnorm.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" rnorm( )", 2) + End Sub + + Private Sub cmdRunif_Click(sender As Object, e As EventArgs) Handles cmdRunif.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" runif( )", 2) + End Sub End Class From d6152e11a6881a79838a4537deb922d9e3007ae1 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 13:01:00 +0300 Subject: [PATCH 032/102] Replaced the save control --- instat/dlgEnter.Designer.vb | 28 +-- instat/dlgEnter.resx | 399 ++++++++++++++++++++---------------- instat/dlgEnter.vb | 6 +- 3 files changed, 233 insertions(+), 200 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 2ebc77f3969..2535fe923ad 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -41,7 +41,6 @@ Partial Class dlgEnter Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgEnter)) Me.chkShowEnterArguments = New System.Windows.Forms.CheckBox() Me.lblData = New System.Windows.Forms.Label() - Me.chkSaveEnterResultInto = New System.Windows.Forms.CheckBox() Me.cmdMissingValues = New System.Windows.Forms.Button() Me.cmdExponential = New System.Windows.Forms.Button() Me.cmdConcantenateFunction = New System.Windows.Forms.Button() @@ -54,7 +53,6 @@ Partial Class dlgEnter Me.cmdColon = New System.Windows.Forms.Button() Me.grpEnterKeyboard2 = New System.Windows.Forms.GroupBox() Me.cmdFactor = New System.Windows.Forms.Button() - Me.ucrSaveEnterResultInto = New instat.ucrInputComboBox() Me.ucrDataFrameEnter = New instat.ucrDataFrame() Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() Me.ucrBase = New instat.ucrButtons() @@ -85,6 +83,7 @@ Partial Class dlgEnter Me.cmdMonth = New System.Windows.Forms.Button() Me.cmdRunif = New System.Windows.Forms.Button() Me.cmdRnorm = New System.Windows.Forms.Button() + Me.UcrSave1 = New instat.ucrSave() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -101,12 +100,6 @@ Partial Class dlgEnter Me.lblData.Name = "lblData" Me.lblData.Tag = "Data" ' - 'chkSaveEnterResultInto - ' - resources.ApplyResources(Me.chkSaveEnterResultInto, "chkSaveEnterResultInto") - Me.chkSaveEnterResultInto.Name = "chkSaveEnterResultInto" - Me.chkSaveEnterResultInto.UseVisualStyleBackColor = True - ' 'cmdMissingValues ' resources.ApplyResources(Me.cmdMissingValues, "cmdMissingValues") @@ -196,14 +189,6 @@ Partial Class dlgEnter Me.cmdFactor.Name = "cmdFactor" Me.cmdFactor.UseVisualStyleBackColor = True ' - 'ucrSaveEnterResultInto - ' - Me.ucrSaveEnterResultInto.AddQuotesIfUnrecognised = True - Me.ucrSaveEnterResultInto.GetSetSelectedIndex = -1 - Me.ucrSaveEnterResultInto.IsReadOnly = False - resources.ApplyResources(Me.ucrSaveEnterResultInto, "ucrSaveEnterResultInto") - Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" - ' 'ucrDataFrameEnter ' Me.ucrDataFrameEnter.bDropUnusedFilterLevels = False @@ -405,16 +390,20 @@ Partial Class dlgEnter Me.cmdRnorm.Name = "cmdRnorm" Me.cmdRnorm.UseVisualStyleBackColor = True ' + 'UcrSave1 + ' + resources.ApplyResources(Me.UcrSave1, "UcrSave1") + Me.UcrSave1.Name = "UcrSave1" + ' 'dlgEnter ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.UcrSave1) Me.Controls.Add(Me.grpBasic) Me.Controls.Add(Me.btnExample) Me.Controls.Add(Me.ucrTryModelling) Me.Controls.Add(Me.grpEnterKeyboard2) - Me.Controls.Add(Me.ucrSaveEnterResultInto) - Me.Controls.Add(Me.chkSaveEnterResultInto) Me.Controls.Add(Me.ucrDataFrameEnter) Me.Controls.Add(Me.chkShowEnterArguments) Me.Controls.Add(Me.lblData) @@ -436,8 +425,6 @@ Partial Class dlgEnter Friend WithEvents lblData As Label Friend WithEvents ucrReceiverForEnterCalculation As ucrReceiverExpression Friend WithEvents ucrDataFrameEnter As ucrDataFrame - Friend WithEvents ucrSaveEnterResultInto As ucrInputComboBox - Friend WithEvents chkSaveEnterResultInto As CheckBox Friend WithEvents cmdMissingValues As Button Friend WithEvents cmdExponential As Button Friend WithEvents cmdConcantenateFunction As Button @@ -477,4 +464,5 @@ Partial Class dlgEnter Friend WithEvents cmdMonth As Button Friend WithEvents cmdRunif As Button Friend WithEvents cmdRnorm As Button + Friend WithEvents UcrSave1 As ucrSave End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 032e0bbcb4c..9ae7745ceb1 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -144,7 +144,7 @@ $this - 7 + 6 True @@ -175,34 +175,7 @@ $this - 8 - - - 11, 248 - - - 2, 3, 2, 3 - - - 110, 17 - - - 157 - - - Save Result Into: - - - chkSaveEnterResultInto - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 + 7 130, 68 @@ -486,27 +459,6 @@ 6 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 66, 97 - - - 2, 3, 2, 3 - - - 65, 30 - - - 158 - - - rnorm - cmdRnorm @@ -519,27 +471,6 @@ 0 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 130, 97 - - - 2, 3, 2, 3 - - - 65, 30 - - - 157 - - - runif - cmdRunif @@ -552,27 +483,6 @@ 1 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 2, 68 - - - 2, 3, 2, 3 - - - 65, 30 - - - 156 - - - month - cmdMonth @@ -585,27 +495,6 @@ 2 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 194, 10 - - - 2, 3, 2, 3 - - - 65, 30 - - - 155 - - - day - cmdDay @@ -618,27 +507,6 @@ 3 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 130, 10 - - - 2, 3, 2, 3 - - - 65, 30 - - - 154 - - - date - cmdDate @@ -651,27 +519,6 @@ 4 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 66, 39 - - - 2, 3, 2, 3 - - - 65, 30 - - - 153 - - - factor - cmdFactor @@ -709,31 +556,40 @@ $this - 3 + 4 - - 124, 244 + + Microsoft Sans Serif, 8.25pt + + + NoControl - + + 66, 39 + + 2, 3, 2, 3 - - 266, 22 + + 65, 30 - - 158 + + 153 - - ucrSaveEnterResultInto + + factor - - instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + cmdFactor - - $this + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 4 + + grpEnterKeyboard2 + + + 5 11, 55 @@ -757,7 +613,7 @@ $this - 6 + 5 True @@ -768,6 +624,30 @@ 648, 336 + + 3, 236 + + + 4, 5, 4, 5 + + + 351, 34 + + + 181 + + + UcrSave1 + + + instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 0 + cmdClear @@ -1021,7 +901,7 @@ $this - 0 + 1 NoControl @@ -1051,7 +931,7 @@ $this - 1 + 2 3, 202 @@ -1072,7 +952,7 @@ $this - 2 + 3 11, 278 @@ -1093,7 +973,7 @@ $this - 10 + 9 CenterScreen @@ -1129,7 +1009,7 @@ $this - 9 + 8 NoControl @@ -1722,4 +1602,169 @@ 18 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 130, 10 + + + 2, 3, 2, 3 + + + 65, 30 + + + 154 + + + date + + + cmdDate + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 4 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 194, 10 + + + 2, 3, 2, 3 + + + 65, 30 + + + 155 + + + day + + + cmdDay + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 3 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 2, 68 + + + 2, 3, 2, 3 + + + 65, 30 + + + 156 + + + month + + + cmdMonth + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 2 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 130, 97 + + + 2, 3, 2, 3 + + + 65, 30 + + + 157 + + + runif + + + cmdRunif + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 1 + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 66, 97 + + + 2, 3, 2, 3 + + + 65, 30 + + + 158 + + + rnorm + + + cmdRnorm + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpEnterKeyboard2 + + + 0 + \ No newline at end of file diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 58877ae55d1..2f17d115eb4 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -253,15 +253,15 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub ucrSaveEnterResultInto_NameChanged() Handles ucrSaveEnterResultInto.NameChanged + Private Sub ucrSaveEnterResultInto_NameChanged() SaveResults() End Sub - Private Sub ucrSaveEnterResultInto_ContentsChanged() Handles ucrSaveEnterResultInto.ContentsChanged + Private Sub ucrSaveEnterResultInto_ContentsChanged() TestOKEnabled() End Sub - Private Sub chkSaveEnterResultInto_CheckedChanged(sender As Object, e As EventArgs) Handles chkSaveEnterResultInto.CheckedChanged + Private Sub chkSaveEnterResultInto_CheckedChanged(sender As Object, e As EventArgs) If chkSaveEnterResultInto.Checked Then ucrSaveEnterResultInto.Visible = True Else From 4cc10fc9a6972b1091a65f0aa1a33edb35563665 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 14:03:17 +0300 Subject: [PATCH 033/102] Adding a new save control --- instat/dlgEnter.Designer.vb | 12 ++++++------ instat/dlgEnter.resx | 18 +++++++++--------- instat/dlgEnter.vb | 30 +++++++++--------------------- 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 2535fe923ad..def214d492f 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -83,7 +83,7 @@ Partial Class dlgEnter Me.cmdMonth = New System.Windows.Forms.Button() Me.cmdRunif = New System.Windows.Forms.Button() Me.cmdRnorm = New System.Windows.Forms.Button() - Me.UcrSave1 = New instat.ucrSave() + Me.ucrSaveEnterResultInto = New instat.ucrSave() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -390,16 +390,16 @@ Partial Class dlgEnter Me.cmdRnorm.Name = "cmdRnorm" Me.cmdRnorm.UseVisualStyleBackColor = True ' - 'UcrSave1 + 'ucrSaveEnterResultInto ' - resources.ApplyResources(Me.UcrSave1, "UcrSave1") - Me.UcrSave1.Name = "UcrSave1" + resources.ApplyResources(Me.ucrSaveEnterResultInto, "ucrSaveEnterResultInto") + Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" ' 'dlgEnter ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.UcrSave1) + Me.Controls.Add(Me.ucrSaveEnterResultInto) Me.Controls.Add(Me.grpBasic) Me.Controls.Add(Me.btnExample) Me.Controls.Add(Me.ucrTryModelling) @@ -464,5 +464,5 @@ Partial Class dlgEnter Friend WithEvents cmdMonth As Button Friend WithEvents cmdRunif As Button Friend WithEvents cmdRnorm As Button - Friend WithEvents UcrSave1 As ucrSave + Friend WithEvents ucrSaveEnterResultInto As ucrSave End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 9ae7745ceb1..e0de5be5f32 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -624,28 +624,28 @@ 648, 336 - + 3, 236 - + 4, 5, 4, 5 - + 351, 34 - + 181 - - UcrSave1 + + ucrSaveEnterResultInto - + instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - + 0 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 2f17d115eb4..f4f5a5a4b5b 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -51,38 +51,35 @@ Public Class dlgEnter clsDetach.AddParameter("name", clsRFunctionParameter:=ucrDataFrameEnter.clsCurrDataFrame) clsDetach.AddParameter("unload", "TRUE") ucrBase.clsRsyntax.SetCommandString("") - ucrSaveEnterResultInto.SetItemsTypeAsColumns() - ucrSaveEnterResultInto.SetDefaultTypeAsColumn() + ucrSaveEnterResultInto.SetSaveTypeAsColumn() + ucrSaveEnterResultInto.SetPrefix("Enter") + ucrSaveEnterResultInto.SetIsTextBox() ucrSaveEnterResultInto.SetDataFrameSelector(ucrDataFrameEnter) - ucrSaveEnterResultInto.SetValidationTypeAsRVariable() + ucrSaveEnterResultInto.SetLabelText("Enter Result Into:") + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) ucrBase.clsRsyntax.AddToAfterCodes(clsDetach) End Sub Private Sub SetDefaults() chkShowEnterArguments.Checked = False ucrDataFrameEnter.Reset() - chkSaveEnterResultInto.Checked = True - ucrSaveEnterResultInto.SetPrefix("Enter") ucrReceiverForEnterCalculation.Clear() ucrTryModelling.SetRSyntax(ucrBase.clsRsyntax) + ucrSaveEnterResultInto.SetRCode(ucrBase.clsRsyntax.SetCommandString(""), bReset:=False) End Sub Private Sub ReopenDialog() SaveResults() End Sub Private Sub TestOKEnabled() - If Not ucrReceiverForEnterCalculation.IsEmpty Then - If chkSaveEnterResultInto.Checked AndAlso Not ucrSaveEnterResultInto.IsEmpty Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + If Not ucrReceiverForEnterCalculation.IsEmpty AndAlso ucrSaveEnterResultInto.IsComplete Then + ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) End If End Sub Private Sub SaveResults() - If chkSaveEnterResultInto.Checked Then + If ucrSaveEnterResultInto.IsComplete Then ucrBase.clsRsyntax.SetAssignTo(ucrSaveEnterResultInto.GetText(), strTempColumn:=ucrSaveEnterResultInto.GetText(), strTempDataframe:=ucrDataFrameEnter.cboAvailableDataFrames.Text, bRequireCorrectLength:=False) ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True ucrBase.clsRsyntax.iCallType = 0 @@ -261,15 +258,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub chkSaveEnterResultInto_CheckedChanged(sender As Object, e As EventArgs) - If chkSaveEnterResultInto.Checked Then - ucrSaveEnterResultInto.Visible = True - Else - ucrSaveEnterResultInto.Visible = False - End If - SaveResults() - End Sub - ''' ''' displays a popup with example commands just above the input receiver ''' From 5ab0ced42fbb7bed38075445a6ed7072636b1cf7 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Tue, 8 Sep 2020 14:25:35 +0300 Subject: [PATCH 034/102] Setting the properties of the new save control --- instat/dlgEnter.vb | 60 +++------------------------------------------- 1 file changed, 3 insertions(+), 57 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index f4f5a5a4b5b..879f93a06ba 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -65,7 +65,7 @@ Public Class dlgEnter ucrDataFrameEnter.Reset() ucrReceiverForEnterCalculation.Clear() ucrTryModelling.SetRSyntax(ucrBase.clsRsyntax) - ucrSaveEnterResultInto.SetRCode(ucrBase.clsRsyntax.SetCommandString(""), bReset:=False) + ucrSaveEnterResultInto.SetRCode(ucrBase.clsRsyntax.clsBaseCommandString) End Sub Private Sub ReopenDialog() SaveResults() @@ -116,59 +116,12 @@ Public Class dlgEnter SetDefaults() TestOKEnabled() End Sub - Private Sub cmd0_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("0") - TestOKEnabled() - End Sub - Private Sub cmd1_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("1") - TestOKEnabled() - End Sub - - Private Sub md2_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("2") - TestOKEnabled() - End Sub - - Private Sub cmd3_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("3") - TestOKEnabled() - End Sub - - Private Sub cmd4_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("4") - TestOKEnabled() - End Sub - - Private Sub cmd5_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("5") - TestOKEnabled() - End Sub - - Private Sub cmd6_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("6") - TestOKEnabled() - End Sub - - Private Sub cmd7_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("7") - TestOKEnabled() - End Sub - - Private Sub cmd8_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("8") - TestOKEnabled() - End Sub - - Private Sub cmd9_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("9") - TestOKEnabled() - End Sub Private Sub cmdColon_Click(sender As Object, e As EventArgs) Handles cmdColon.Click ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(":") TestOKEnabled() End Sub + Private Sub cmdMissingValues_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("NA") TestOKEnabled() @@ -178,15 +131,12 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("( )", 2) TestOKEnabled() End Sub + Private Sub cmdMinus_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("-") TestOKEnabled() End Sub - Private Sub cmdDelete_Click_1(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.Backspace() - TestOKEnabled() - End Sub Private Sub cmdPi_Click(sender As Object, e As EventArgs) Handles cmdPi.Click ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("pi") TestOKEnabled() @@ -230,10 +180,6 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdClear_Click_1(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.Clear() - TestOKEnabled() - End Sub Private Sub cmdLETTERS_Click(sender As Object, e As EventArgs) Handles cmdLETTERS.Click ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("LETTERS") From 764575cfa2d769717772f1b669b84480323e4a36 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Tue, 8 Sep 2020 19:39:26 +0300 Subject: [PATCH 035/102] added measure parameter and fixed bug when a filter is applied when patching climatic element --- instat/static/InstatObject/R/data_object_R6.R | 8 ++++---- instat/static/InstatObject/R/instat_object_R6.R | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 65b764bd60e..da48aeb9436 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3634,7 +3634,7 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va if(missing(vars))stop("vars is missing with no default") date_col <- self$get_columns_from_data(date_col_name, use_current_filter = FALSE) if(!lubridate::is.Date(date_col)) stop("This column must be a date or time!") - curr_data <- self$get_data_frame() + curr_data <- self$get_data_frame(use_current_filter = FALSE) if(!missing(station_col_name)) { station_col <- self$get_columns_from_data(station_col_name, use_current_filter = FALSE) station_names <- unique(station_col) @@ -3678,7 +3678,7 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va } ) -DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461, x_with_truth = NULL){ +DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461, x_with_truth = NULL, measure = "percent"){ curr_data <- self$get_data_frame() if(!missing(station_col_name)){station_col <- self$get_columns_from_data(station_col_name);station_names <- unique(station_col)} if(!missing(element_col_name)){element_col <- self$get_columns_from_data(element_col_name)} @@ -3703,9 +3703,9 @@ DataSheet$set("public", "visualize_element_na", function(element_col_name, eleme if(!missing(station_col_name)){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] - plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[,element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size) + plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[,element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size, measure = measure) } - }else{plt <- imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size)} + }else{plt <- imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size, measure = measure)} }else if (type == "imputation"){ if(!missing(station_col_name)){ for (i in seq_along(station_names)) { diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 7630017348d..5eb28e7b33d 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2093,7 +2093,7 @@ DataBook$set("public","patch_climate_element", function(data_name, date_col_name } ) -DataBook$set("public","visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL) { - self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed =element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth) +DataBook$set("public","visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL, measure = "percent") { + self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed =element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth, measure = measure) } ) From 748c9d0ca304c409a1a51b5d35192824e9629e5e Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Tue, 8 Sep 2020 19:40:18 +0300 Subject: [PATCH 036/102] adding measure control(counts and percentages) --- instat/dlgInfillMissingValues.Designer.vb | 19 + instat/dlgInfillMissingValues.resx | 400 +++++++++++----------- 2 files changed, 222 insertions(+), 197 deletions(-) diff --git a/instat/dlgInfillMissingValues.Designer.vb b/instat/dlgInfillMissingValues.Designer.vb index 447e36397df..1c34e842630 100644 --- a/instat/dlgInfillMissingValues.Designer.vb +++ b/instat/dlgInfillMissingValues.Designer.vb @@ -91,6 +91,8 @@ Partial Class dlgInfillMissingValues Me.lblDispMultShowStation = New System.Windows.Forms.Label() Me.ucrReceiverTrueValues = New instat.ucrReceiverSingle() Me.lblTrueValues = New System.Windows.Forms.Label() + Me.ucrInputComboMeasure = New instat.ucrInputComboBox() + Me.lblPercentCount = New System.Windows.Forms.Label() Me.grpMethods.SuspendLayout() Me.grpStartEnd.SuspendLayout() Me.SuspendLayout() @@ -575,10 +577,25 @@ Partial Class dlgInfillMissingValues resources.ApplyResources(Me.lblTrueValues, "lblTrueValues") Me.lblTrueValues.Name = "lblTrueValues" ' + 'ucrInputComboMeasure + ' + Me.ucrInputComboMeasure.AddQuotesIfUnrecognised = True + Me.ucrInputComboMeasure.GetSetSelectedIndex = -1 + Me.ucrInputComboMeasure.IsReadOnly = False + resources.ApplyResources(Me.ucrInputComboMeasure, "ucrInputComboMeasure") + Me.ucrInputComboMeasure.Name = "ucrInputComboMeasure" + ' + 'lblPercentCount + ' + resources.ApplyResources(Me.lblPercentCount, "lblPercentCount") + Me.lblPercentCount.Name = "lblPercentCount" + ' 'dlgInfillMissingValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.lblPercentCount) + Me.Controls.Add(Me.ucrInputComboMeasure) Me.Controls.Add(Me.ucrReceiverTrueValues) Me.Controls.Add(Me.lblTrueValues) Me.Controls.Add(Me.lblDispMultShowStation) @@ -718,4 +735,6 @@ Partial Class dlgInfillMissingValues Friend WithEvents ucrReceiverDispMultShowStation As ucrReceiverSingle Friend WithEvents lblTrueValues As Label Friend WithEvents ucrReceiverTrueValues As ucrReceiverSingle + Friend WithEvents ucrInputComboMeasure As ucrInputComboBox + Friend WithEvents lblPercentCount As Label End Class diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index f3838f2636f..65a9d97399e 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -307,7 +307,7 @@ NoControl - 281, 132 + 281, 110 48, 13 @@ -328,7 +328,7 @@ $this - 52 + 54 Button @@ -340,7 +340,7 @@ NoControl - 112, 29 + 112, 7 95, 27 @@ -364,7 +364,7 @@ $this - 51 + 53 Button @@ -376,7 +376,7 @@ NoControl - 205, 29 + 205, 7 95, 27 @@ -400,7 +400,16 @@ $this - 50 + 52 + + + 6, 15 + + + 177, 71 + + + 17 ucrPnlMethods @@ -415,7 +424,7 @@ 6 - 12, 317 + 12, 295 210, 99 @@ -436,88 +445,7 @@ $this - 57 - - - 6, 15 - - - 177, 71 - - - 17 - - - ucrPnlMethods - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpMethods - - - 6 - - - rdoExtendFill - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpStartEnd - - - 0 - - - rdoLeaveAsMissing - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpStartEnd - - - 1 - - - ucrPnlStartEnd - - - instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - grpStartEnd - - - 2 - - - 228, 317 - - - 183, 66 - - - 22 - - - Start and End - - - grpStartEnd - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 46 + 59 True @@ -600,6 +528,30 @@ 2 + + 228, 295 + + + 183, 66 + + + 22 + + + Start and End + + + grpStartEnd + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 48 + True @@ -607,7 +559,7 @@ NoControl - 236, 387 + 236, 365 37, 13 @@ -628,7 +580,7 @@ $this - 34 + 36 True @@ -637,7 +589,7 @@ NoControl - 12, 430 + 12, 408 51, 13 @@ -658,7 +610,7 @@ $this - 47 + 49 True @@ -667,7 +619,7 @@ NoControl - 159, 283 + 159, 261 35, 13 @@ -688,7 +640,7 @@ $this - 41 + 43 True @@ -697,7 +649,7 @@ NoControl - 281, 82 + 281, 60 43, 13 @@ -718,7 +670,7 @@ $this - 35 + 37 True @@ -727,7 +679,7 @@ NoControl - 281, 125 + 281, 103 33, 13 @@ -748,7 +700,7 @@ $this - 32 + 34 True @@ -757,7 +709,7 @@ NoControl - 281, 210 + 281, 188 56, 13 @@ -778,7 +730,7 @@ $this - 30 + 32 True @@ -787,7 +739,7 @@ NoControl - 281, 168 + 281, 146 56, 13 @@ -808,7 +760,7 @@ $this - 28 + 30 True @@ -817,7 +769,7 @@ NoControl - 9, 337 + 9, 315 101, 13 @@ -838,7 +790,7 @@ $this - 23 + 25 Button @@ -850,7 +802,7 @@ NoControl - 19, 29 + 19, 7 95, 27 @@ -874,7 +826,7 @@ $this - 21 + 23 Button @@ -886,7 +838,7 @@ NoControl - 298, 29 + 298, 7 95, 27 @@ -910,7 +862,7 @@ $this - 20 + 22 True @@ -919,7 +871,7 @@ NoControl - 281, 306 + 281, 284 86, 13 @@ -940,7 +892,7 @@ $this - 15 + 17 True @@ -949,7 +901,7 @@ NoControl - 281, 208 + 281, 186 48, 13 @@ -970,7 +922,7 @@ $this - 14 + 16 True @@ -979,7 +931,7 @@ NoControl - 281, 166 + 281, 144 48, 13 @@ -1000,7 +952,7 @@ $this - 13 + 15 True @@ -1009,7 +961,7 @@ NoControl - 281, 127 + 281, 105 33, 13 @@ -1030,10 +982,10 @@ $this - 12 + 14 - 12, 337 + 12, 325 4, 5, 4, 5 @@ -1054,10 +1006,10 @@ $this - 11 + 13 - 368, 303 + 368, 281 48, 20 @@ -1075,7 +1027,7 @@ $this - 16 + 18 True @@ -1084,10 +1036,61 @@ 6, 13 - 421, 540 + 421, 514 + + + True + + + NoControl + + + 278, 233 + + + 51, 13 + + + 67 + + + Measure: + + + lblPercentCount + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 281, 249 + + + 120, 21 + + + 66 + + + ucrInputComboMeasure + + + instat.ucrInputComboBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 1 - 281, 271 + 281, 249 0, 0, 0, 0 @@ -1108,7 +1111,7 @@ $this - 0 + 2 True @@ -1117,7 +1120,7 @@ NoControl - 279, 255 + 279, 233 112, 13 @@ -1138,7 +1141,7 @@ $this - 1 + 3 True @@ -1147,7 +1150,7 @@ NoControl - 278, 82 + 278, 60 43, 13 @@ -1168,10 +1171,10 @@ $this - 2 + 4 - 281, 98 + 281, 76 0, 0, 0, 0 @@ -1192,7 +1195,7 @@ $this - 3 + 5 True @@ -1201,7 +1204,7 @@ NoControl - 12, 311 + 12, 289 68, 13 @@ -1222,10 +1225,10 @@ $this - 4 + 6 - 83, 308 + 83, 286 62, 21 @@ -1243,13 +1246,13 @@ $this - 5 + 7 False - 13, 258 + 13, 236 119, 23 @@ -1270,10 +1273,10 @@ $this - 6 + 8 - 12, 310 + 12, 288 132, 20 @@ -1291,13 +1294,13 @@ $this - 7 + 9 True - 281, 211 + 281, 189 34, 13 @@ -1318,10 +1321,10 @@ $this - 8 + 10 - 281, 227 + 281, 205 120, 21 @@ -1339,10 +1342,10 @@ $this - 9 + 11 - 12, 286 + 12, 264 134, 20 @@ -1360,10 +1363,10 @@ $this - 10 + 12 - 281, 184 + 281, 162 0, 0, 0, 0 @@ -1384,10 +1387,10 @@ $this - 18 + 20 - 281, 141 + 281, 119 0, 0, 0, 0 @@ -1408,10 +1411,10 @@ $this - 19 + 21 - 113, 333 + 113, 311 137, 21 @@ -1429,10 +1432,10 @@ $this - 22 + 24 - 144, 309 + 144, 287 47, 21 @@ -1450,10 +1453,10 @@ $this - 24 + 26 - 144, 286 + 144, 264 47, 21 @@ -1471,10 +1474,10 @@ $this - 25 + 27 - 14, 309 + 14, 287 127, 20 @@ -1492,10 +1495,10 @@ $this - 26 + 28 - 14, 286 + 14, 264 127, 20 @@ -1513,10 +1516,10 @@ $this - 27 + 29 - 281, 185 + 281, 163 0, 0, 0, 0 @@ -1537,10 +1540,10 @@ $this - 29 + 31 - 281, 224 + 281, 202 0, 0, 0, 0 @@ -1561,10 +1564,10 @@ $this - 31 + 33 - 281, 140 + 281, 118 0, 0, 0, 0 @@ -1585,10 +1588,10 @@ $this - 33 + 35 - 279, 384 + 279, 362 47, 21 @@ -1606,10 +1609,10 @@ $this - 36 + 38 - 281, 207 + 281, 185 0, 0, 0, 0 @@ -1630,10 +1633,10 @@ $this - 37 + 39 - 281, 98 + 281, 76 0, 0, 0, 0 @@ -1654,10 +1657,10 @@ $this - 38 + 40 - 146, 427 + 146, 405 76, 20 @@ -1675,10 +1678,10 @@ $this - 39 + 41 - 223, 427 + 223, 405 48, 20 @@ -1696,10 +1699,10 @@ $this - 40 + 42 - 110, 279 + 110, 257 48, 20 @@ -1717,10 +1720,10 @@ $this - 42 + 44 - 12, 280 + 12, 258 96, 20 @@ -1738,10 +1741,10 @@ $this - 43 + 45 - 281, 184 + 281, 162 103, 20 @@ -1759,10 +1762,10 @@ $this - 44 + 46 - 12, 427 + 12, 405 110, 20 @@ -1780,10 +1783,10 @@ $this - 45 + 47 - 12, 455 + 12, 433 4, 5, 4, 5 @@ -1804,10 +1807,10 @@ $this - 48 + 50 - 66, 426 + 66, 404 66, 21 @@ -1825,10 +1828,10 @@ $this - 49 + 51 - 281, 149 + 281, 127 0, 0, 0, 0 @@ -1849,10 +1852,10 @@ $this - 53 + 55 - 12, 483 + 12, 461 410, 52 @@ -1870,10 +1873,10 @@ $this - 54 + 56 - 12, 75 + 12, 53 0, 0, 0, 0 @@ -1894,13 +1897,13 @@ $this - 55 + 57 - 12, 12 + 15, 7 - 397, 58 + 378, 27 0 @@ -1915,7 +1918,10 @@ $this - 56 + 58 + + + NoControl CenterScreen @@ -1930,7 +1936,7 @@ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 281, 225 + 281, 203 0, 0, 0, 0 @@ -1951,6 +1957,6 @@ $this - 17 + 19 \ No newline at end of file From 520e19cfb36b2a830cb440fa0567d0c8edaf314b Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Tue, 8 Sep 2020 19:41:08 +0300 Subject: [PATCH 037/102] implementation of measures: counts & percentages --- instat/dlgInfillMissingValues.vb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 53a1029b512..d6d2df98b0b 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -188,7 +188,7 @@ Public Class dlgInfillMissingValues ucrPnlOptions.AddToLinkedControls({ucrReceiverImputed, ucrReceiverTrueValues}, {rdoShow}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlOptions.AddToLinkedControls({ucrInputComboType}, {rdoDisplay}, bNewLinkedHideIfParameterMissing:=True) ucrInputComboType.AddToLinkedControls({ucrChkFlipCordinates}, {"Gap size"}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrInputComboType.AddToLinkedControls({ucrInputIntervalSize}, {"Intervals"}, bNewLinkedHideIfParameterMissing:=True) + ucrInputComboType.AddToLinkedControls({ucrInputIntervalSize, ucrInputComboMeasure}, {"Intervals"}, bNewLinkedHideIfParameterMissing:=True) ucrInputComboFunction.SetLinkedDisplayControl(lblFunction) ucrPnlStartEnd.SetLinkedDisplayControl(grpStartEnd) ucrNudMaximum.SetLinkedDisplayControl(lblRows) @@ -207,6 +207,7 @@ Public Class dlgInfillMissingValues ucrInputIntervalSize.SetLinkedDisplayControl(lblIntervalSize) ucrReceiverDispMultShowStation.SetLinkedDisplayControl(lblDispMultShowStation) ucrReceiverTrueValues.SetLinkedDisplayControl(lblTrueValues) + ucrInputComboMeasure.SetLinkedDisplayControl(lblPercentCount) ucrSaveNewColumn.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) ucrSaveNewColumn.SetSaveTypeAsColumn() @@ -252,6 +253,13 @@ Public Class dlgInfillMissingValues ucrInputIntervalSize.SetValidationTypeAsNumeric() ucrInputIntervalSize.AddQuotesIfUnrecognised = False + ucrInputComboMeasure.SetParameter(New RParameter("measure", 12)) + Dim dctMeasures As New Dictionary(Of String, String) + dctMeasures.Add("Percentages", Chr(34) & "percent" & Chr(34)) + dctMeasures.Add("Counts", Chr(34) & "count" & Chr(34)) + ucrInputComboMeasure.SetItems(dctMeasures) + ucrInputComboMeasure.SetDropDownStyleAsNonEditable() + ucrSaveGraph.SetPrefix("missingplot") ucrSaveGraph.SetSaveTypeAsGraph() ucrSaveGraph.SetDataFrameSelector(ucrSelectorInfillMissing.ucrAvailableDataFrames) @@ -331,6 +339,7 @@ Public Class dlgInfillMissingValues clsVisualizeElementNa.AddParameter("data_name", Chr(34) & ucrSelectorInfillMissing.ucrAvailableDataFrames.strCurrDataFrame & Chr(34), iPosition:=0) clsVisualizeElementNa.AddParameter("type", Chr(34) & "distribution" & Chr(34), iPosition:=8) clsVisualizeElementNa.AddParameter("interval_size", 1461, iPosition:=11) + clsVisualizeElementNa.AddParameter("measure", Chr(34) & "percent" & Chr(34), iPosition:=12) clsVisualizeElementNa.SetAssignTo("last_graph", strTempDataframe:=ucrSelectorInfillMissing.ucrAvailableDataFrames.cboAvailableDataFrames.Text, strTempGraph:="last_graph") clsVisualizeElementNa.AddParameter("ncol", 1, iPosition:=4) @@ -376,6 +385,7 @@ Public Class dlgInfillMissingValues ucrInputIntervalSize.SetRCode(clsVisualizeElementNa, bReset) ucrReceiverDispMultShowStation.SetRCode(clsVisualizeElementNa, bReset) ucrReceiverTrueValues.SetRCode(clsVisualizeElementNa, bReset) + ucrInputComboMeasure.SetRCode(clsVisualizeElementNa, bReset) ucrSaveNewColumn.AddAdditionalRCode(clsAggregateFunction, iAdditionalPairNo:=1) From 70764820b9f7c90b272084120fdf7d86dc18fab2 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Tue, 8 Sep 2020 21:25:47 +0300 Subject: [PATCH 038/102] adding a check to allow combined plot when there are multiple stations --- instat/dlgInfillMissingValues.resx | 116 +++++++++++++----- instat/static/InstatObject/R/data_object_R6.R | 10 +- 2 files changed, 87 insertions(+), 39 deletions(-) diff --git a/instat/dlgInfillMissingValues.resx b/instat/dlgInfillMissingValues.resx index 65a9d97399e..ced08370e33 100644 --- a/instat/dlgInfillMissingValues.resx +++ b/instat/dlgInfillMissingValues.resx @@ -402,15 +402,6 @@ 52 - - 6, 15 - - - 177, 71 - - - 17 - ucrPnlMethods @@ -447,6 +438,87 @@ 59 + + 6, 15 + + + 177, 71 + + + 17 + + + ucrPnlMethods + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpMethods + + + 6 + + + rdoExtendFill + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpStartEnd + + + 0 + + + rdoLeaveAsMissing + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpStartEnd + + + 1 + + + ucrPnlStartEnd + + + instat.UcrPanel, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + grpStartEnd + + + 2 + + + 228, 295 + + + 183, 66 + + + 22 + + + Start and End + + + grpStartEnd + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 48 + True @@ -528,30 +600,6 @@ 2 - - 228, 295 - - - 183, 66 - - - 22 - - - Start and End - - - grpStartEnd - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 48 - True @@ -985,7 +1033,7 @@ 14 - 12, 325 + 12, 318 4, 5, 4, 5 diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index da48aeb9436..c7186796b57 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3686,35 +3686,35 @@ DataSheet$set("public", "visualize_element_na", function(element_col_name, eleme if(!(type %in% c("distribution", "gapsize", "interval", "imputation"))) stop(type, " must be either distribution, gapsize or imputation") plt_list <- list() if(type == "distribution"){ - if(!missing(station_col_name)){ + if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_distribution(x = temp_data[,element_col_name], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab) } }else{plt <- imputeTS::ggplot_na_distribution(x = element_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab)} }else if (type == "gapsize"){ - if(!missing(station_col_name)){ + if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_gapsize(x = temp_data[,element_col_name], include_total = TRUE, title =paste0(station_names[i], ":Occurrence of gap sizes"), xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) } }else{plt <- imputeTS::ggplot_na_gapsize(x = element_col, include_total = TRUE, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation)} }else if(type == "interval"){ - if(!missing(station_col_name)){ + if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[,element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size, measure = measure) } }else{plt <- imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size, measure = measure)} }else if (type == "imputation"){ - if(!missing(station_col_name)){ + if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ for (i in seq_along(station_names)) { temp_data <- curr_data[station_col==station_names[i],] plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[,element_col_name], x_with_imputations = temp_data[,element_col_name_imputed], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth) } }else{plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth)} } - if(!missing(station_col_name)) {gridExtra::grid.arrange(grobs = plt_list, ncol = ncol)} + if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1) {gridExtra::grid.arrange(grobs = plt_list, ncol = ncol)} else{return(plt)} } ) From 79e44089176662e876ba700aa85b68a276acf368 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Wed, 9 Sep 2020 16:02:31 +0300 Subject: [PATCH 039/102] Added more examples to the list View --- instat/dlgEnter.Designer.vb | 70 ++-- instat/dlgEnter.resx | 786 +++++++++++------------------------- instat/dlgEnter.vb | 6 + 3 files changed, 284 insertions(+), 578 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index def214d492f..e2915267433 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -52,6 +52,11 @@ Partial Class dlgEnter Me.cmdMonths = New System.Windows.Forms.Button() Me.cmdColon = New System.Windows.Forms.Button() Me.grpEnterKeyboard2 = New System.Windows.Forms.GroupBox() + Me.cmdRnorm = New System.Windows.Forms.Button() + Me.cmdRunif = New System.Windows.Forms.Button() + Me.cmdMonth = New System.Windows.Forms.Button() + Me.cmdDay = New System.Windows.Forms.Button() + Me.cmdDate = New System.Windows.Forms.Button() Me.cmdFactor = New System.Windows.Forms.Button() Me.ucrDataFrameEnter = New instat.ucrDataFrame() Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() @@ -78,11 +83,6 @@ Partial Class dlgEnter Me.cmd2 = New System.Windows.Forms.Button() Me.cmd0 = New System.Windows.Forms.Button() Me.cmd1 = New System.Windows.Forms.Button() - Me.cmdDate = New System.Windows.Forms.Button() - Me.cmdDay = New System.Windows.Forms.Button() - Me.cmdMonth = New System.Windows.Forms.Button() - Me.cmdRunif = New System.Windows.Forms.Button() - Me.cmdRnorm = New System.Windows.Forms.Button() Me.ucrSaveEnterResultInto = New instat.ucrSave() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() @@ -183,6 +183,36 @@ Partial Class dlgEnter Me.grpEnterKeyboard2.Name = "grpEnterKeyboard2" Me.grpEnterKeyboard2.TabStop = False ' + 'cmdRnorm + ' + resources.ApplyResources(Me.cmdRnorm, "cmdRnorm") + Me.cmdRnorm.Name = "cmdRnorm" + Me.cmdRnorm.UseVisualStyleBackColor = True + ' + 'cmdRunif + ' + resources.ApplyResources(Me.cmdRunif, "cmdRunif") + Me.cmdRunif.Name = "cmdRunif" + Me.cmdRunif.UseVisualStyleBackColor = True + ' + 'cmdMonth + ' + resources.ApplyResources(Me.cmdMonth, "cmdMonth") + Me.cmdMonth.Name = "cmdMonth" + Me.cmdMonth.UseVisualStyleBackColor = True + ' + 'cmdDay + ' + resources.ApplyResources(Me.cmdDay, "cmdDay") + Me.cmdDay.Name = "cmdDay" + Me.cmdDay.UseVisualStyleBackColor = True + ' + 'cmdDate + ' + resources.ApplyResources(Me.cmdDate, "cmdDate") + Me.cmdDate.Name = "cmdDate" + Me.cmdDate.UseVisualStyleBackColor = True + ' 'cmdFactor ' resources.ApplyResources(Me.cmdFactor, "cmdFactor") @@ -360,36 +390,6 @@ Partial Class dlgEnter Me.cmd1.Name = "cmd1" Me.cmd1.UseVisualStyleBackColor = True ' - 'cmdDate - ' - resources.ApplyResources(Me.cmdDate, "cmdDate") - Me.cmdDate.Name = "cmdDate" - Me.cmdDate.UseVisualStyleBackColor = True - ' - 'cmdDay - ' - resources.ApplyResources(Me.cmdDay, "cmdDay") - Me.cmdDay.Name = "cmdDay" - Me.cmdDay.UseVisualStyleBackColor = True - ' - 'cmdMonth - ' - resources.ApplyResources(Me.cmdMonth, "cmdMonth") - Me.cmdMonth.Name = "cmdMonth" - Me.cmdMonth.UseVisualStyleBackColor = True - ' - 'cmdRunif - ' - resources.ApplyResources(Me.cmdRunif, "cmdRunif") - Me.cmdRunif.Name = "cmdRunif" - Me.cmdRunif.UseVisualStyleBackColor = True - ' - 'cmdRnorm - ' - resources.ApplyResources(Me.cmdRnorm, "cmdRnorm") - Me.cmdRnorm.Name = "cmdRnorm" - Me.cmdRnorm.UseVisualStyleBackColor = True - ' 'ucrSaveEnterResultInto ' resources.ApplyResources(Me.ucrSaveEnterResultInto, "ucrSaveEnterResultInto") diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index e0de5be5f32..58baf2fc5b9 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -123,7 +123,7 @@ - 371, 18 + 303, 18 106, 17 @@ -459,6 +459,27 @@ 6 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 66, 97 + + + 2, 3, 2, 3 + + + 65, 30 + + + 158 + + + rnorm + cmdRnorm @@ -471,6 +492,27 @@ 0 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 130, 97 + + + 2, 3, 2, 3 + + + 65, 30 + + + 157 + + + runif + cmdRunif @@ -483,6 +525,27 @@ 1 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 2, 68 + + + 2, 3, 2, 3 + + + 65, 30 + + + 156 + + + month + cmdMonth @@ -495,6 +558,27 @@ 2 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 194, 10 + + + 2, 3, 2, 3 + + + 65, 30 + + + 155 + + + day + cmdDay @@ -507,6 +591,27 @@ 3 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 130, 10 + + + 2, 3, 2, 3 + + + 65, 30 + + + 154 + + + date + cmdDate @@ -519,6 +624,27 @@ 4 + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 66, 39 + + + 2, 3, 2, 3 + + + 65, 30 + + + 153 + + + factor + cmdFactor @@ -558,39 +684,6 @@ 4 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 66, 39 - - - 2, 3, 2, 3 - - - 65, 30 - - - 153 - - - factor - - - cmdFactor - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 5 - 11, 55 @@ -603,413 +696,50 @@ 156 - - ucrDataFrameEnter - - - instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - - - True - - - 6, 13 - - - 648, 336 - - - 3, 236 - - - 4, 5, 4, 5 - - - 351, 34 - - - 181 - - - ucrSaveEnterResultInto - - - instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 0 - - - cmdClear - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 0 - - - Button1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 1 - - - cmdBrackets - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 2 - - - cmdPower - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 3 - - - cmdDivide - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 4 - - - cmdPlus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 5 - - - cmdMinus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 6 - - - cmdMultiply - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 7 - - - Button2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 8 - - - cmd9 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 9 - - - cmd8 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 10 - - - cmd7 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 11 - - - cmd6 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 12 - - - cmd5 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 13 - - - cmd4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 14 - - - cmd3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 15 - - - cmd2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 16 - - - cmd0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 17 - - - cmd1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 18 - - - 172, 46 - - - 2, 3, 2, 3 - - - 2, 3, 2, 3 - - - 205, 134 - - - 180 - - - grpBasic - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - NoControl - - - 301, 16 - - - 2, 2, 2, 2 - - - 64, 22 - - - 161 - - - Examples - - - btnExample - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 3, 202 - - - 480, 33 - - - 160 - - - ucrTryModelling - - - instat.ucrTry, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 3 - - - 11, 278 - - - 452, 52 - - - 0 - - - ucrBase - - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this + + ucrDataFrameEnter - - 9 + + instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - CenterScreen + + $this - - Enter + + 5 - - dlgEnter + + True + + + 6, 13 - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 648, 336 - - 44, 16 + + 13, 243 - - 2, 3, 2, 3 + + 4, 5, 4, 5 - - 254, 28 + + 306, 23 - - 153 + + 181 - - ucrReceiverForEnterCalculation + + ucrSaveEnterResultInto - - instat.ucrReceiverExpression, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 8 + + 0 NoControl @@ -1602,169 +1332,139 @@ 18 - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 130, 10 + + 172, 46 - + 2, 3, 2, 3 - - 65, 30 - - - 154 + + 2, 3, 2, 3 - - date + + 205, 134 - - cmdDate + + 180 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + grpBasic - - grpEnterKeyboard2 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 4 + + $this - - Microsoft Sans Serif, 8.25pt + + 1 - + NoControl - - 194, 10 + + 419, 13 - - 2, 3, 2, 3 + + 2, 2, 2, 2 - - 65, 30 + + 64, 22 - - 155 + + 161 - - day + + Examples - - cmdDay + + btnExample - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - grpEnterKeyboard2 - - - 3 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 2, 68 - - - 2, 3, 2, 3 - - - 65, 30 + + $this - - 156 + + 2 - - month + + 3, 202 - - cmdMonth + + 480, 33 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 160 - - grpEnterKeyboard2 + + ucrTryModelling - - 2 + + instat.ucrTry, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - Microsoft Sans Serif, 8.25pt + + $this - - NoControl + + 3 - - 130, 97 + + 11, 278 - - 2, 3, 2, 3 + + 452, 52 - - 65, 30 + + 0 - - 157 + + ucrBase - - runif + + instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - cmdRunif + + $this - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 9 - - grpEnterKeyboard2 + + CenterScreen - - 1 + + Enter - - Microsoft Sans Serif, 8.25pt + + dlgEnter - - NoControl + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 66, 97 + + 44, 16 - + 2, 3, 2, 3 - - 65, 30 - - - 158 + + 254, 28 - - rnorm + + 153 - - cmdRnorm + + ucrReceiverForEnterCalculation - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + instat.ucrReceiverExpression, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - grpEnterKeyboard2 + + $this - - 0 + + 8 \ No newline at end of file diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 879f93a06ba..35403f6cf98 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -234,6 +234,12 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"month.abb"})) lstView.Items.Item(3).ToolTipText = "month.abb" 'todo. sensible tooltip here. + lstView.Items.Add(New ListViewItem({"4.5"})) + lstView.Items.Item(4).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. + + lstView.Items.Add(New ListViewItem({"'Nairobi'"})) + lstView.Items.Item(5).ToolTipText = "a single text repeated for the data frame" + AddHandler lstView.DoubleClick, Sub() If lstView.SelectedItems.Count > 0 Then From 868137a03cb0e14f4a6bae20dc67f2f6f84b6c30 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Wed, 9 Sep 2020 16:13:38 +0300 Subject: [PATCH 040/102] Adding more examples to the list view --- instat/dlgEnter.vb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 35403f6cf98..18bee3145c3 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -238,7 +238,21 @@ Public Class dlgEnter lstView.Items.Item(4).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. lstView.Items.Add(New ListViewItem({"'Nairobi'"})) - lstView.Items.Item(5).ToolTipText = "a single text repeated for the data frame" + lstView.Items.Item(5).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. + + lstView.Items.Add(New ListViewItem({"c(2,3,4)*1.5E02"})) + lstView.Items.Item(6).ToolTipText = "gives 300, 450, 600 then repeated for the data frame" 'todo. Sensible tooltip here + + lstView.Items.Add(New ListViewItem({"factor(c(1,2,3))"})) + lstView.Items.Item(7).ToolTipText = "values 1 to 3 with the variable made into a factor" 'todo. Sensible tooltip here + + lstView.Items.Add(New ListViewItem({"factor(rep(LETTERS[1:4],c(4,3,1,1)))"})) + lstView.Items.Item(8).ToolTipText = "Gives A,A,A,A, B,B,B,C,D as a factor" + + lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,2)))"})) + lstView.Items.Item(9).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA" + + AddHandler lstView.DoubleClick, Sub() From 8741d18635d2f1e38cbcd5ef1884424235ca9a95 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Wed, 9 Sep 2020 16:17:57 +0300 Subject: [PATCH 041/102] Added more examples to the list view --- instat/dlgEnter.vb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 18bee3145c3..c19ba1d1d33 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -252,6 +252,12 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,2)))"})) lstView.Items.Item(9).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA" + lstView.Items.Add(New ListViewItem({"c(1:4,10,rep(15,3),20)"})) + lstView.Items.Item(10).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" + + lstView.Items.Item(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15)"})) + lstView.Items.Item(11).ToolTipText = "A set of sequences, giving 1,3,5 10,11,12, 15" + From b414a5f8eccbc2f22965b1f34a6b1e2b24e151fb Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Wed, 9 Sep 2020 16:24:51 +0300 Subject: [PATCH 042/102] Added more examples to the list view --- instat/dlgEnter.vb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index c19ba1d1d33..24f24a9bcf9 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -255,9 +255,15 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"c(1:4,10,rep(15,3),20)"})) lstView.Items.Item(10).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" - lstView.Items.Item(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15)"})) + lstView.Items.Add(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15)"})) lstView.Items.Item(11).ToolTipText = "A set of sequences, giving 1,3,5 10,11,12, 15" + lstView.Items.Add(New ListViewItem({"runif(3,c(0,5,10),c(1,10,20))"})) + lstView.Items.Item(12).ToolTipText = "Random uniform data from 3 different uniform distributions)" + + lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1940/12/1'),'quarter')"})) + lstView.Items.Item(13).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" + From 47bf827bcecf6452d8fb98d3e62b0e57200e5a8e Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Wed, 9 Sep 2020 17:31:41 +0300 Subject: [PATCH 043/102] Swapping the checkbox and the example button --- instat/dlgEnter.Designer.vb | 60 ++++++------ instat/dlgEnter.resx | 182 +++++++++++++++++++++--------------- instat/dlgEnter.vb | 6 +- 3 files changed, 140 insertions(+), 108 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index e2915267433..3736f187669 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -58,10 +58,6 @@ Partial Class dlgEnter Me.cmdDay = New System.Windows.Forms.Button() Me.cmdDate = New System.Windows.Forms.Button() Me.cmdFactor = New System.Windows.Forms.Button() - Me.ucrDataFrameEnter = New instat.ucrDataFrame() - Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() - Me.ucrBase = New instat.ucrButtons() - Me.ucrTryModelling = New instat.ucrTry() Me.btnExample = New System.Windows.Forms.Button() Me.grpBasic = New System.Windows.Forms.GroupBox() Me.cmdClear = New System.Windows.Forms.Button() @@ -84,6 +80,10 @@ Partial Class dlgEnter Me.cmd0 = New System.Windows.Forms.Button() Me.cmd1 = New System.Windows.Forms.Button() Me.ucrSaveEnterResultInto = New instat.ucrSave() + Me.ucrTryModelling = New instat.ucrTry() + Me.ucrDataFrameEnter = New instat.ucrDataFrame() + Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() + Me.ucrBase = New instat.ucrButtons() Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -219,32 +219,6 @@ Partial Class dlgEnter Me.cmdFactor.Name = "cmdFactor" Me.cmdFactor.UseVisualStyleBackColor = True ' - 'ucrDataFrameEnter - ' - Me.ucrDataFrameEnter.bDropUnusedFilterLevels = False - Me.ucrDataFrameEnter.bUseCurrentFilter = True - resources.ApplyResources(Me.ucrDataFrameEnter, "ucrDataFrameEnter") - Me.ucrDataFrameEnter.Name = "ucrDataFrameEnter" - ' - 'ucrReceiverForEnterCalculation - ' - Me.ucrReceiverForEnterCalculation.frmParent = Me - resources.ApplyResources(Me.ucrReceiverForEnterCalculation, "ucrReceiverForEnterCalculation") - Me.ucrReceiverForEnterCalculation.Name = "ucrReceiverForEnterCalculation" - Me.ucrReceiverForEnterCalculation.Selector = Nothing - Me.ucrReceiverForEnterCalculation.strNcFilePath = "" - Me.ucrReceiverForEnterCalculation.ucrSelector = Nothing - ' - 'ucrBase - ' - resources.ApplyResources(Me.ucrBase, "ucrBase") - Me.ucrBase.Name = "ucrBase" - ' - 'ucrTryModelling - ' - resources.ApplyResources(Me.ucrTryModelling, "ucrTryModelling") - Me.ucrTryModelling.Name = "ucrTryModelling" - ' 'btnExample ' resources.ApplyResources(Me.btnExample, "btnExample") @@ -395,6 +369,32 @@ Partial Class dlgEnter resources.ApplyResources(Me.ucrSaveEnterResultInto, "ucrSaveEnterResultInto") Me.ucrSaveEnterResultInto.Name = "ucrSaveEnterResultInto" ' + 'ucrTryModelling + ' + resources.ApplyResources(Me.ucrTryModelling, "ucrTryModelling") + Me.ucrTryModelling.Name = "ucrTryModelling" + ' + 'ucrDataFrameEnter + ' + Me.ucrDataFrameEnter.bDropUnusedFilterLevels = False + Me.ucrDataFrameEnter.bUseCurrentFilter = True + resources.ApplyResources(Me.ucrDataFrameEnter, "ucrDataFrameEnter") + Me.ucrDataFrameEnter.Name = "ucrDataFrameEnter" + ' + 'ucrReceiverForEnterCalculation + ' + Me.ucrReceiverForEnterCalculation.frmParent = Me + resources.ApplyResources(Me.ucrReceiverForEnterCalculation, "ucrReceiverForEnterCalculation") + Me.ucrReceiverForEnterCalculation.Name = "ucrReceiverForEnterCalculation" + Me.ucrReceiverForEnterCalculation.Selector = Nothing + Me.ucrReceiverForEnterCalculation.strNcFilePath = "" + Me.ucrReceiverForEnterCalculation.ucrSelector = Nothing + ' + 'ucrBase + ' + resources.ApplyResources(Me.ucrBase, "ucrBase") + Me.ucrBase.Name = "ucrBase" + ' 'dlgEnter ' resources.ApplyResources(Me, "$this") diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 58baf2fc5b9..7d1b8898e6a 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -121,18 +121,22 @@ True + + + NoControl + - 303, 18 + 307, 18 - 106, 17 + 109, 17 155 - Show Arguments + Show Parameters chkShowEnterArguments @@ -149,10 +153,12 @@ True + + NoControl + 10, 20 - 2, 0, 2, 0 @@ -177,6 +183,9 @@ 7 + + NoControl + 130, 68 @@ -207,6 +216,9 @@ Microsoft Sans Serif, 8.25pt + + NoControl + 2, 39 @@ -234,6 +246,9 @@ 14 + + NoControl + 66, 10 @@ -264,6 +279,9 @@ Microsoft Sans Serif, 8.25pt + + NoControl + 194, 97 @@ -294,6 +312,9 @@ Microsoft Sans Serif, 8.25pt + + NoControl + 2, 97 @@ -321,6 +342,9 @@ 11 + + NoControl + 130, 39 @@ -348,6 +372,9 @@ 10 + + NoControl + 194, 68 @@ -375,6 +402,9 @@ 9 + + NoControl + 194, 39 @@ -402,6 +432,9 @@ 8 + + NoControl + 66, 68 @@ -432,6 +465,9 @@ Microsoft Sans Serif, 14.25pt + + NoControl + 2, 10 @@ -658,7 +694,7 @@ 5 - 382, 45 + 379, 50 2, 3, 2, 3 @@ -684,62 +720,35 @@ 4 - - 11, 55 - - - 0, 0, 0, 0 - - - 150, 40 - - - 156 - - - ucrDataFrameEnter - - - instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - - - True - - - 6, 13 + + NoControl - - 648, 336 + + 419, 16 - - 13, 243 + + 2, 2, 2, 2 - - 4, 5, 4, 5 + + 64, 22 - - 306, 23 + + 161 - - 181 + + Examples - - ucrSaveEnterResultInto + + btnExample - - instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 0 + + 2 NoControl @@ -1333,7 +1342,7 @@ 18 - 172, 46 + 170, 51 2, 3, 2, 3 @@ -1359,35 +1368,29 @@ 1 - - NoControl - - - 419, 13 - - - 2, 2, 2, 2 + + 11, 243 - - 64, 22 + + 4, 5, 4, 5 - - 161 + + 308, 23 - - Examples + + 181 - - btnExample + + ucrSaveEnterResultInto - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 2 + + 0 3, 202 @@ -1410,6 +1413,39 @@ 3 + + 11, 55 + + + 0, 0, 0, 0 + + + 150, 40 + + + 156 + + + ucrDataFrameEnter + + + instat.ucrDataFrame, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 + + + True + + + 6, 13 + + + 645, 336 + 11, 278 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 24f24a9bcf9..1aef2cc83b2 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -356,11 +356,7 @@ Public Class dlgEnter End Sub Private Sub cmdDate_Click(sender As Object, e As EventArgs) Handles cmdDate.Click - If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')") - Else - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 3) - End If + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 2) End Sub Private Sub cmdDay_Click(sender As Object, e As EventArgs) Handles cmdDay.Click From 31d999a2ffecda900c5b2568cd1ef0b6666453f9 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Sat, 12 Sep 2020 02:08:58 +0300 Subject: [PATCH 044/102] importing dly files, text files with multiple missing values, reseting select all checkbox --- instat/dlgImportDataset.vb | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/instat/dlgImportDataset.vb b/instat/dlgImportDataset.vb index 1ff57c07e6e..b84c021eaac 100644 --- a/instat/dlgImportDataset.vb +++ b/instat/dlgImportDataset.vb @@ -295,9 +295,6 @@ Public Class dlgImportDataset ucrChkColumnNamesText.SetParameter(New RParameter("col_names"), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkColumnNamesText.SetRDefault("TRUE") - ucrInputMissingValueStringText.SetParameter(New RParameter("na")) - ucrInputMissingValueStringText.SetRDefault(Chr(34) & "NA" & Chr(34)) - ucrNudRowsToSkipText.SetParameter(New RParameter("skip")) ucrNudRowsToSkipText.Minimum = 0 ucrNudRowsToSkipText.SetRDefault(0) @@ -386,6 +383,12 @@ Public Class dlgImportDataset strFilePathR = "" strFileType = "" + dctSelectedExcelSheets.Clear() + clbSheets.Items.Clear() 'reset this here. Not set by R code + ucrInputMissingValueStringExcel.SetName("") 'reset this here. Not set by R code + ucrInputMissingValueStringCSV.SetName("") 'reset this here. Not set by R code + ucrInputMissingValueStringText.SetName("") 'reset this here. Not set by R code + ucrNudPreviewLines.Value = 10 ucrPanelFixedWidthText.Hide() @@ -413,9 +416,6 @@ Public Class dlgImportDataset SetDefaults() SetRCodeForControls(True) RefreshFrameView() - dctSelectedExcelSheets.Clear() - clbSheets.Items.Clear() 'reset this here. Not set by R code - ucrInputMissingValueStringExcel.SetText("") 'reset this here. Not set by R code TestOkEnabled() End Sub @@ -434,7 +434,7 @@ Public Class dlgImportDataset 'Loads the open dialog on load and click Public Sub GetFileFromOpenDialog() Using dlgOpen As New OpenFileDialog - dlgOpen.Filter = "All Data files|*.csv;*.txt;*.xls;*.xlsx;*.RDS;*.sav;*.tsv;*.csvy;*.feather;*.psv;*.RData;*.json;*.yml;*.dta;*.dbf;*.arff;*.R;*.sas7bdat;*.xpt;*.mtp;*.rec;*.syd;*.dif;*.ods;*.xml;*.html|Comma separated files|*.csv|Text data file|*.txt|Excel files|*.xls;*.xlsx|R Data Structure files|*.RDS|SPSS files|*.sav|Tab separated files|*.tsv|CSV with a YAML metadata header|*.csvy|Feather R/Python interchange format|*.feather|Pipe separates files|*.psv|Saved R objects|*.RData|JSON|*.json|YAML|*.yml|Stata files|*.dta|XBASE database files|*.dbf|Weka Attribute-Relation File Format|*.arff|R syntax object|*.R|SAS Files|*.sas7bdat|SAS XPORT|*.xpt|Minitab Files|*.mtp|Epiinfo Files|*.rec|Systat Files|*.syd|Data Interchange Format|*.dif|OpenDocument Spreadsheet|*.ods|Shallow XML documents|*.xml|Single-table HTML documents|*.html;|All files|*.*;" + dlgOpen.Filter = "All Data files|*.csv;*.txt;*.xls;*.xlsx;*.RDS;*.sav;*.tsv;*.csvy;*.feather;*.psv;*.RData;*.json;*.yml;*.dta;*.dbf;*.arff;*.R;*.sas7bdat;*.xpt;*.mtp;*.rec;*.syd;*.dif;*.ods;*.xml;*.html;*.dly|Comma separated files|*.csv|Text data file|*.txt|Excel files|*.xls;*.xlsx|R Data Structure files|*.RDS|SPSS files|*.sav|Tab separated files|*.tsv|CSV with a YAML metadata header|*.csvy|Feather R/Python interchange format|*.feather|Pipe separates files|*.psv|Saved R objects|*.RData|JSON|*.json|YAML|*.yml|Stata files|*.dta|XBASE database files|*.dbf|Weka Attribute-Relation File Format|*.arff|R syntax object|*.R|SAS Files|*.sas7bdat|SAS XPORT|*.xpt|Minitab Files|*.mtp|Epiinfo Files|*.rec|Systat Files|*.syd|Data Interchange Format|*.dif|OpenDocument Spreadsheet|*.ods|Shallow XML documents|*.xml|Single-table HTML documents|*.html|DLY|*.html|All files|*.*" dlgOpen.Multiselect = False If bFromLibrary Then dlgOpen.Title = "Import from Library" @@ -498,7 +498,6 @@ Public Class dlgImportDataset ucrPanelFixedWidthText.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) 'TEXT CONTROLS ucrChkColumnNamesText.SetRCode(clsImportFixedWidthText, bReset) - ucrInputMissingValueStringText.SetRCode(clsImportFixedWidthText, bReset) ucrNudRowsToSkipText.SetRCode(clsImportFixedWidthText, bReset) ucrNudMaxRowsText.SetRCode(clsImportFixedWidthText, bReset) ucrChkMaxRowsText.SetRCode(clsImportFixedWidthText, bReset) @@ -606,8 +605,14 @@ Public Class dlgImportDataset grpCSV.Text = "Import Text Options" grpCSV.Location = New System.Drawing.Point(9, 99) 'set the location of the groupbox to adjust gaps in the form UI grpCSV.Show() - ElseIf strFileExt = ".csv" Then + ElseIf strFileExt = ".csv" OrElse strFileExt = ".dly" Then + 'treat dly files as csv. override the extension using format parameter strFileType = "CSV" + If strFileExt = ".dly" Then + clsImportCSV.AddParameter("format", Chr(34) & "csv" & Chr(34)) + Else + clsImportCSV.RemoveParameterByName("format") + End If ucrBase.clsRsyntax.SetBaseRFunction(clsImportCSV) grpCSV.Text = "Import CSV Options" grpCSV.Location = New System.Drawing.Point(9, 50) 'set the location of the groupbox to adjust gaps in the form UI @@ -700,13 +705,12 @@ Public Class dlgImportDataset If {"TXT", "CSV", "XLSX", "XLS"}.Contains(strFileType) AndAlso Not ucrInputFilePath.IsEmpty() Then If strFileType = "TXT" Then If rdoSeparatortext.Checked Then - 'for separtor we use the function used for csv + 'for separator we use the function used for csv clsTempImport = clsImportCSV.Clone() strRowMaxParamName = "nrows" Else clsTempImport = clsImportFixedWidthText.Clone() strRowMaxParamName = "n_max" - clsTempImport.AddParameter("na", Chr(34) & ucrInputMissingValueStringText.GetText & Chr(34)) End If ElseIf strFileType = "CSV" Then @@ -826,13 +830,19 @@ Public Class dlgImportDataset For Each strSelected As String In lstCheckedItems For i As Integer = 0 To clbSheets.Items.Count - 1 If strSelected = clbSheets.Items(i).ToString Then + bSupressSheetChange = True clbSheets.SetItemChecked(i, True) + bSupressSheetChange = False 'sheet names are expected to be unique so exit inner for loop Exit For End If Next Next End If + 'set checked status of select all checkbox + bSupressCheckAllSheets = True + ucrChkSheetsCheckAll.Checked = chrSheets IsNot Nothing AndAlso clbSheets.CheckedItems.Count = chrSheets.Count + bSupressCheckAllSheets = False End Sub Private Sub lblRowVector_Click(sender As Object, e As EventArgs) @@ -865,7 +875,7 @@ Public Class dlgImportDataset RefreshFrameView() End Sub - Private Sub Controls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTrimWSExcel.ControlValueChanged, ucrNudRowsToSkipExcel.ControlValueChanged, ucrChkColumnNamesExcel.ControlValueChanged, ucrChkColumnNamesText.ControlValueChanged, ucrNudRowsToSkipText.ControlValueChanged, ucrChkMaxRowsText.ControlValueChanged, ucrChkMaxRowsCSV.ControlValueChanged, ucrChkMaxRowsExcel.ControlValueChanged, ucrNudMaxRowsText.ControlValueChanged, ucrNudMaxRowsCSV.ControlValueChanged, ucrNudMaxRowsExcel.ControlValueChanged, ucrChkStringsAsFactorsCSV.ControlValueChanged, ucrInputMissingValueStringCSV.ControlValueChanged, ucrInputEncodingCSV.ControlValueChanged, ucrInputSeparatorCSV.ControlValueChanged, ucrInputHeadersCSV.ControlValueChanged, ucrInputDecimalCSV.ControlValueChanged, ucrNudRowsToSkipCSV.ControlValueChanged + Private Sub Controls_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkTrimWSExcel.ControlValueChanged, ucrNudRowsToSkipExcel.ControlValueChanged, ucrChkColumnNamesExcel.ControlValueChanged, ucrChkColumnNamesText.ControlValueChanged, ucrNudRowsToSkipText.ControlValueChanged, ucrChkMaxRowsText.ControlValueChanged, ucrChkMaxRowsCSV.ControlValueChanged, ucrChkMaxRowsExcel.ControlValueChanged, ucrNudMaxRowsText.ControlValueChanged, ucrNudMaxRowsCSV.ControlValueChanged, ucrNudMaxRowsExcel.ControlValueChanged, ucrChkStringsAsFactorsCSV.ControlValueChanged, ucrInputEncodingCSV.ControlValueChanged, ucrInputSeparatorCSV.ControlValueChanged, ucrInputHeadersCSV.ControlValueChanged, ucrInputDecimalCSV.ControlValueChanged, ucrNudRowsToSkipCSV.ControlValueChanged RefreshFrameView() End Sub @@ -878,6 +888,13 @@ Public Class dlgImportDataset clsImportExcel.AddParameter("na", GetMissingValueRString(ucrInputMissingValueStringExcel.GetText())) ElseIf strFileType = "CSV" Then clsImportCSV.AddParameter("na.strings", GetMissingValueRString(ucrInputMissingValueStringCSV.GetText())) + ElseIf strFileType = "TXT" Then + 'for separator we use the function used for csv + If rdoSeparatortext.Checked Then + clsImportCSV.AddParameter("na.strings", GetMissingValueRString(ucrInputMissingValueStringCSV.GetText())) + Else + clsImportFixedWidthText.AddParameter("na", GetMissingValueRString(ucrInputMissingValueStringText.GetText())) + End If End If RefreshFrameView() End Sub From 05b7192773f3687b22b5e9fa5aba208ef9cad6a9 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Mon, 14 Sep 2020 15:19:50 +0300 Subject: [PATCH 045/102] gridExtra::grid.arrange() to patchwork::wrap_plots() --- instat/static/InstatObject/R/data_object_R6.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index c7186796b57..f972a934884 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3714,7 +3714,7 @@ DataSheet$set("public", "visualize_element_na", function(element_col_name, eleme } }else{plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth)} } - if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1) {gridExtra::grid.arrange(grobs = plt_list, ncol = ncol)} + if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1) {patchwork::wrap_plots(plt_list, ncol = ncol)} else{return(plt)} } ) From a390c090d3c7a414bdb0ca8c3726e83d225f2ec1 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Mon, 21 Sep 2020 09:52:47 +0300 Subject: [PATCH 046/102] tidyverse stylling --- instat/static/InstatObject/R/data_object_R6.R | 140 ++++++++++-------- 1 file changed, 81 insertions(+), 59 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index f972a934884..4f51e7b56e5 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3628,37 +3628,41 @@ DataSheet$set("public", "get_variable_sets", function(set_names, force_as_list) } ) -DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name){ - if(missing(date_col_name))stop("date is missing with no default") - if(missing(var))stop("var is missing with no default") - if(missing(vars))stop("vars is missing with no default") +DataSheet$set("public", "patch_climate_element", function(date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name) { + if (missing(date_col_name)) stop("date is missing with no default") + if (missing(var)) stop("var is missing with no default") + if (missing(vars)) stop("vars is missing with no default") date_col <- self$get_columns_from_data(date_col_name, use_current_filter = FALSE) - if(!lubridate::is.Date(date_col)) stop("This column must be a date or time!") + if (!lubridate::is.Date(date_col)) stop("This column must be a date or time!") curr_data <- self$get_data_frame(use_current_filter = FALSE) - if(!missing(station_col_name)) { + if (!missing(station_col_name)) { station_col <- self$get_columns_from_data(station_col_name, use_current_filter = FALSE) station_names <- unique(station_col) list_out <- list() for (i in seq_along(station_names)) { - temp_data <- curr_data[station_col==station_names[i],] - var_col <- temp_data[,var] - date_col <- temp_data[,date_col_name] - Year <- lubridate::year(date_col); Month <- lubridate::month(date_col); Day <- lubridate::day(date_col) + temp_data <- curr_data[station_col == station_names[i], ] + var_col <- temp_data[, var] + date_col <- temp_data[, date_col_name] + Year <- lubridate::year(date_col) + Month <- lubridate::month(date_col) + Day <- lubridate::day(date_col) weather <- data.frame(Year, Month, Day, var_col) colnames(weather)[4] <- var patch_weather <- list() - for (j in seq_along(vars)) { - col <- temp_data[,vars[j]] - patch_weather[[j]] <- data.frame(Year, Month, Day, col) - colnames(patch_weather[[j]])[4] <- var - } - out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) - list_out[[i]] <- out[[1]][,var] - print(out[[2]]) + for (j in seq_along(vars)) { + col <- temp_data[, vars[j]] + patch_weather[[j]] <- data.frame(Year, Month, Day, col) + colnames(patch_weather[[j]])[4] <- var + } + out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) + list_out[[i]] <- out[[1]][, var] + print(out[[2]]) } - }else{ + } else { var_col <- self$get_columns_from_data(var, use_current_filter = FALSE) - Year <- lubridate::year(date_col); Month <- lubridate::month(date_col); Day <- lubridate::day(date_col) + Year <- lubridate::year(date_col) + Month <- lubridate::month(date_col) + Day <- lubridate::day(date_col) weather <- data.frame(Year, Month, Day, var_col) colnames(weather)[4] <- var patch_weather <- list() @@ -3668,54 +3672,72 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va colnames(patch_weather[[i]])[4] <- var } } - if(!missing(station_col_name)) {col <- unlist(list_out)} - else{ + if (!missing(station_col_name)) { + col <- unlist(list_out) + } + else { out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) - col <- out[[1]][,var] + col <- out[[1]][, var] print(out[[2]]) - } + } self$add_columns_to_data(col_name = column_name, col_data = col) -} -) +}) -DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461, x_with_truth = NULL, measure = "percent"){ +DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461, x_with_truth = NULL, measure = "percent") { curr_data <- self$get_data_frame() - if(!missing(station_col_name)){station_col <- self$get_columns_from_data(station_col_name);station_names <- unique(station_col)} - if(!missing(element_col_name)){element_col <- self$get_columns_from_data(element_col_name)} - if(!missing(element_col_name_imputed)){element_imputed_col <- self$get_columns_from_data(element_col_name_imputed)} - if(!(type %in% c("distribution", "gapsize", "interval", "imputation"))) stop(type, " must be either distribution, gapsize or imputation") + if (!missing(station_col_name)) { + station_col <- self$get_columns_from_data(station_col_name) + station_names <- unique(station_col) + } + if (!missing(element_col_name)) { + element_col <- self$get_columns_from_data(element_col_name) + } + if (!missing(element_col_name_imputed)) { + element_imputed_col <- self$get_columns_from_data(element_col_name_imputed) + } + if (!(type %in% c("distribution", "gapsize", "interval", "imputation"))) stop(type, " must be either distribution, gapsize or imputation") plt_list <- list() - if(type == "distribution"){ - if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ + if (type == "distribution") { + if (!missing(station_col_name) && dplyr::n_distinct(station_names) > 1) { for (i in seq_along(station_names)) { - temp_data <- curr_data[station_col==station_names[i],] - plt_list[[i]] <- imputeTS::ggplot_na_distribution(x = temp_data[,element_col_name], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab) + temp_data <- curr_data[station_col == station_names[i], ] + plt_list[[i]] <- imputeTS::ggplot_na_distribution(x = temp_data[, element_col_name], x_axis_labels = temp_data[, x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab) } - }else{plt <- imputeTS::ggplot_na_distribution(x = element_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab)} - }else if (type == "gapsize"){ - if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ + } else { + plt <- imputeTS::ggplot_na_distribution(x = element_col, x_axis_labels = curr_data[, x_axis_labels_col_name], xlab = xlab, ylab = ylab) + } + } else if (type == "gapsize") { + if (!missing(station_col_name) && dplyr::n_distinct(station_names) > 1) { for (i in seq_along(station_names)) { - temp_data <- curr_data[station_col==station_names[i],] - plt_list[[i]] <- imputeTS::ggplot_na_gapsize(x = temp_data[,element_col_name], include_total = TRUE, title =paste0(station_names[i], ":Occurrence of gap sizes"), xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) - } - }else{plt <- imputeTS::ggplot_na_gapsize(x = element_col, include_total = TRUE, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation)} - }else if(type == "interval"){ - if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ - for (i in seq_along(station_names)) { - temp_data <- curr_data[station_col==station_names[i],] - plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[,element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size, measure = measure) - } - }else{plt <- imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size, measure = measure)} - }else if (type == "imputation"){ - if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1){ + temp_data <- curr_data[station_col == station_names[i], ] + plt_list[[i]] <- imputeTS::ggplot_na_gapsize(x = temp_data[, element_col_name], include_total = TRUE, title = paste0(station_names[i], ":Occurrence of gap sizes"), xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) + } + } else { + plt <- imputeTS::ggplot_na_gapsize(x = element_col, include_total = TRUE, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation) + } + } else if (type == "interval") { + if (!missing(station_col_name) && dplyr::n_distinct(station_names) > 1) { for (i in seq_along(station_names)) { - temp_data <- curr_data[station_col==station_names[i],] - plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[,element_col_name], x_with_imputations = temp_data[,element_col_name_imputed], x_axis_labels = temp_data[,x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth) + temp_data <- curr_data[station_col == station_names[i], ] + plt_list[[i]] <- imputeTS::ggplot_na_intervals(x = temp_data[, element_col_name], title = paste0(station_names[i], ":Missing Values per Interval"), ylab = ylab, interval_size = interval_size, measure = measure) } - }else{plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[,x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth)} + } else { + plt <- imputeTS::ggplot_na_intervals(x = element_col, ylab = ylab, interval_size = interval_size, measure = measure) + } + } else if (type == "imputation") { + if (!missing(station_col_name) && dplyr::n_distinct(station_names) > 1) { + for (i in seq_along(station_names)) { + temp_data <- curr_data[station_col == station_names[i], ] + plt_list[[i]] <- imputeTS::ggplot_na_imputations(x_with_na = temp_data[, element_col_name], x_with_imputations = temp_data[, element_col_name_imputed], x_axis_labels = temp_data[, x_axis_labels_col_name], title = station_names[i], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth) + } + } else { + plt <- imputeTS::ggplot_na_imputations(x_with_na = element_col, x_with_imputations = element_imputed_col, x_axis_labels = curr_data[, x_axis_labels_col_name], xlab = xlab, ylab = ylab, legend = legend, x_with_truth = x_with_truth) + } } - if(!missing(station_col_name) && dplyr::n_distinct(station_names)>1) {patchwork::wrap_plots(plt_list, ncol = ncol)} - else{return(plt)} -} -) - + if (!missing(station_col_name) && dplyr::n_distinct(station_names) > 1) { + patchwork::wrap_plots(plt_list, ncol = ncol) + } + else { + return(plt) + } +}) From 4b28910ebc94184d318f140e9093adeacde9f241 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Mon, 21 Sep 2020 09:55:15 +0300 Subject: [PATCH 047/102] tidyverse styling --- instat/static/InstatObject/R/instat_object_R6.R | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 5eb28e7b33d..6fdcba25ae5 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2088,12 +2088,10 @@ DataBook$set("public","package_check", function(package) { } ) -DataBook$set("public","patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name = station_col_name) { - self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name,var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name, station_col_name = station_col_name) -} -) +DataBook$set("public", "patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name = station_col_name) { + self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name, var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name, station_col_name = station_col_name) +}) -DataBook$set("public","visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL, measure = "percent") { - self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed =element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth, measure = measure) -} -) +DataBook$set("public", "visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL, measure = "percent") { + self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed = element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth, measure = measure) +}) From 42c0ea5f98780b2329baa8bd71f33b12420d841a Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 10:17:50 +0300 Subject: [PATCH 048/102] Modifications to enter second keyboard --- instat/dlgEnter.resx | 41 ++++++++++++++++++++++------------------- instat/dlgEnter.vb | 12 ------------ 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 7d1b8898e6a..831178e9039 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -187,7 +187,7 @@ NoControl - 130, 68 + 130, 100 2, 3, 2, 3 @@ -220,7 +220,7 @@ NoControl - 2, 39 + 2, 72 2, 3, 2, 3 @@ -250,7 +250,7 @@ NoControl - 66, 10 + 66, 44 2, 3, 2, 3 @@ -283,7 +283,7 @@ NoControl - 194, 97 + 194, 131 2, 3, 2, 3 @@ -316,7 +316,7 @@ NoControl - 2, 97 + 2, 131 2, 3, 2, 3 @@ -346,7 +346,7 @@ NoControl - 130, 39 + 130, 72 2, 3, 2, 3 @@ -376,7 +376,7 @@ NoControl - 194, 68 + 194, 100 2, 3, 2, 3 @@ -406,7 +406,7 @@ NoControl - 194, 39 + 66, 7 2, 3, 2, 3 @@ -436,7 +436,7 @@ NoControl - 66, 68 + 66, 100 2, 3, 2, 3 @@ -463,13 +463,13 @@ 7 - Microsoft Sans Serif, 14.25pt + Microsoft Sans Serif, 8.25pt NoControl - 2, 10 + 2, 7 2, 3, 2, 3 @@ -481,7 +481,7 @@ 151 - : + [:] cmdColon @@ -502,7 +502,7 @@ NoControl - 66, 97 + 66, 131 2, 3, 2, 3 @@ -535,7 +535,7 @@ NoControl - 130, 97 + 130, 131 2, 3, 2, 3 @@ -568,7 +568,7 @@ NoControl - 2, 68 + 2, 100 2, 3, 2, 3 @@ -601,7 +601,7 @@ NoControl - 194, 10 + 194, 68 2, 3, 2, 3 @@ -634,7 +634,7 @@ NoControl - 130, 10 + 130, 44 2, 3, 2, 3 @@ -667,7 +667,7 @@ NoControl - 66, 39 + 130, 7 2, 3, 2, 3 @@ -703,7 +703,7 @@ 2, 3, 2, 3 - 263, 134 + 264, 170 159 @@ -1467,6 +1467,9 @@ 9 + + NoControl + CenterScreen diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 1aef2cc83b2..c56bc54a99f 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -222,18 +222,6 @@ Public Class dlgEnter lstView.Columns.Add("Commands", 450) 'add rows of sample commands - lstView.Items.Add(New ListViewItem({"seq(9 )"})) - lstView.Items.Item(0).ToolTipText = "seq(9 )" 'todo. sensible tooltip here. - - lstView.Items.Add(New ListViewItem({"LETTERS"})) - lstView.Items.Item(1).ToolTipText = "LETTERS" 'todo. sensible tooltip here. - - lstView.Items.Add(New ListViewItem({"month.name"})) - lstView.Items.Item(2).ToolTipText = "month.name" 'todo. sensible tooltip here. - - lstView.Items.Add(New ListViewItem({"month.abb"})) - lstView.Items.Item(3).ToolTipText = "month.abb" 'todo. sensible tooltip here. - lstView.Items.Add(New ListViewItem({"4.5"})) lstView.Items.Item(4).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. From 3af9704e090ff437bc942c88a6eebe214b6c7345 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 10:23:22 +0300 Subject: [PATCH 049/102] Modifications to the second enter keyboard --- instat/dlgEnter.resx | 294 ++++++++++++++++++++++++++++++++++++++----- instat/dlgEnter.vb | 2 +- 2 files changed, 262 insertions(+), 34 deletions(-) diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 831178e9039..339fe943e36 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -250,7 +250,7 @@ NoControl - 66, 44 + 199, 43 2, 3, 2, 3 @@ -316,7 +316,7 @@ NoControl - 2, 131 + 2, 36 2, 3, 2, 3 @@ -436,7 +436,7 @@ NoControl - 66, 100 + 66, 36 2, 3, 2, 3 @@ -601,7 +601,7 @@ NoControl - 194, 68 + 130, 36 2, 3, 2, 3 @@ -613,7 +613,7 @@ 155 - day + text cmdDay @@ -634,7 +634,7 @@ NoControl - 130, 44 + 71, 95 2, 3, 2, 3 @@ -750,6 +750,261 @@ 2 + + cmdClear + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 0 + + + Button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 1 + + + cmdBrackets + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 2 + + + cmdPower + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 3 + + + cmdDivide + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 4 + + + cmdPlus + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 5 + + + cmdMinus + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 6 + + + cmdMultiply + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 7 + + + Button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 8 + + + cmd9 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 9 + + + cmd8 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 10 + + + cmd7 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 11 + + + cmd6 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 12 + + + cmd5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 13 + + + cmd4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 14 + + + cmd3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 15 + + + cmd2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 16 + + + cmd0 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 17 + + + cmd1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpBasic + + + 18 + + + 170, 51 + + + 2, 3, 2, 3 + + + 2, 3, 2, 3 + + + 205, 134 + + + 180 + + + grpBasic + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + NoControl @@ -1341,33 +1596,6 @@ 18 - - 170, 51 - - - 2, 3, 2, 3 - - - 2, 3, 2, 3 - - - 205, 134 - - - 180 - - - grpBasic - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - 11, 243 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index c56bc54a99f..c6cd3d20fde 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -348,7 +348,7 @@ Public Class dlgEnter End Sub Private Sub cmdDay_Click(sender As Object, e As EventArgs) Handles cmdDay.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("'day'") + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.character(c( ))") End Sub Private Sub cmdFactor_Click(sender As Object, e As EventArgs) Handles cmdFactor.Click From 13355112c3018e776d31609a7f4bc2628a927423 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 11:02:28 +0300 Subject: [PATCH 050/102] Modification to enter dialog second keyboard --- instat/dlgEnter.Designer.vb | 64 +---- instat/dlgEnter.resx | 512 ++++++------------------------------ instat/dlgEnter.vb | 16 +- 3 files changed, 98 insertions(+), 494 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 3736f187669..16db69c651e 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -41,22 +41,18 @@ Partial Class dlgEnter Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgEnter)) Me.chkShowEnterArguments = New System.Windows.Forms.CheckBox() Me.lblData = New System.Windows.Forms.Label() - Me.cmdMissingValues = New System.Windows.Forms.Button() + Me.cmdQuotes = New System.Windows.Forms.Button() Me.cmdExponential = New System.Windows.Forms.Button() Me.cmdConcantenateFunction = New System.Windows.Forms.Button() Me.cmdSequenceFunction = New System.Windows.Forms.Button() Me.cmdRepelicationFunction = New System.Windows.Forms.Button() - Me.cmdLETTERS = New System.Windows.Forms.Button() + Me.cmdLogical = New System.Windows.Forms.Button() Me.cmdPi = New System.Windows.Forms.Button() Me.cmdLetters2 = New System.Windows.Forms.Button() Me.cmdMonths = New System.Windows.Forms.Button() Me.cmdColon = New System.Windows.Forms.Button() Me.grpEnterKeyboard2 = New System.Windows.Forms.GroupBox() - Me.cmdRnorm = New System.Windows.Forms.Button() - Me.cmdRunif = New System.Windows.Forms.Button() - Me.cmdMonth = New System.Windows.Forms.Button() Me.cmdDay = New System.Windows.Forms.Button() - Me.cmdDate = New System.Windows.Forms.Button() Me.cmdFactor = New System.Windows.Forms.Button() Me.btnExample = New System.Windows.Forms.Button() Me.grpBasic = New System.Windows.Forms.GroupBox() @@ -100,11 +96,11 @@ Partial Class dlgEnter Me.lblData.Name = "lblData" Me.lblData.Tag = "Data" ' - 'cmdMissingValues + 'cmdQuotes ' - resources.ApplyResources(Me.cmdMissingValues, "cmdMissingValues") - Me.cmdMissingValues.Name = "cmdMissingValues" - Me.cmdMissingValues.UseVisualStyleBackColor = True + resources.ApplyResources(Me.cmdQuotes, "cmdQuotes") + Me.cmdQuotes.Name = "cmdQuotes" + Me.cmdQuotes.UseVisualStyleBackColor = True ' 'cmdExponential ' @@ -131,11 +127,11 @@ Partial Class dlgEnter Me.cmdRepelicationFunction.Name = "cmdRepelicationFunction" Me.cmdRepelicationFunction.UseVisualStyleBackColor = True ' - 'cmdLETTERS + 'cmdLogical ' - resources.ApplyResources(Me.cmdLETTERS, "cmdLETTERS") - Me.cmdLETTERS.Name = "cmdLETTERS" - Me.cmdLETTERS.UseVisualStyleBackColor = True + resources.ApplyResources(Me.cmdLogical, "cmdLogical") + Me.cmdLogical.Name = "cmdLogical" + Me.cmdLogical.UseVisualStyleBackColor = True ' 'cmdPi ' @@ -163,56 +159,28 @@ Partial Class dlgEnter ' 'grpEnterKeyboard2 ' - Me.grpEnterKeyboard2.Controls.Add(Me.cmdRnorm) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdRunif) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonth) Me.grpEnterKeyboard2.Controls.Add(Me.cmdDay) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdDate) Me.grpEnterKeyboard2.Controls.Add(Me.cmdFactor) Me.grpEnterKeyboard2.Controls.Add(Me.cmdColon) Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonths) Me.grpEnterKeyboard2.Controls.Add(Me.cmdLetters2) Me.grpEnterKeyboard2.Controls.Add(Me.cmdPi) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdLETTERS) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdLogical) Me.grpEnterKeyboard2.Controls.Add(Me.cmdRepelicationFunction) Me.grpEnterKeyboard2.Controls.Add(Me.cmdSequenceFunction) Me.grpEnterKeyboard2.Controls.Add(Me.cmdConcantenateFunction) Me.grpEnterKeyboard2.Controls.Add(Me.cmdExponential) - Me.grpEnterKeyboard2.Controls.Add(Me.cmdMissingValues) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdQuotes) resources.ApplyResources(Me.grpEnterKeyboard2, "grpEnterKeyboard2") Me.grpEnterKeyboard2.Name = "grpEnterKeyboard2" Me.grpEnterKeyboard2.TabStop = False ' - 'cmdRnorm - ' - resources.ApplyResources(Me.cmdRnorm, "cmdRnorm") - Me.cmdRnorm.Name = "cmdRnorm" - Me.cmdRnorm.UseVisualStyleBackColor = True - ' - 'cmdRunif - ' - resources.ApplyResources(Me.cmdRunif, "cmdRunif") - Me.cmdRunif.Name = "cmdRunif" - Me.cmdRunif.UseVisualStyleBackColor = True - ' - 'cmdMonth - ' - resources.ApplyResources(Me.cmdMonth, "cmdMonth") - Me.cmdMonth.Name = "cmdMonth" - Me.cmdMonth.UseVisualStyleBackColor = True - ' 'cmdDay ' resources.ApplyResources(Me.cmdDay, "cmdDay") Me.cmdDay.Name = "cmdDay" Me.cmdDay.UseVisualStyleBackColor = True ' - 'cmdDate - ' - resources.ApplyResources(Me.cmdDate, "cmdDate") - Me.cmdDate.Name = "cmdDate" - Me.cmdDate.UseVisualStyleBackColor = True - ' 'cmdFactor ' resources.ApplyResources(Me.cmdFactor, "cmdFactor") @@ -425,12 +393,12 @@ Partial Class dlgEnter Friend WithEvents lblData As Label Friend WithEvents ucrReceiverForEnterCalculation As ucrReceiverExpression Friend WithEvents ucrDataFrameEnter As ucrDataFrame - Friend WithEvents cmdMissingValues As Button + Friend WithEvents cmdQuotes As Button Friend WithEvents cmdExponential As Button Friend WithEvents cmdConcantenateFunction As Button Friend WithEvents cmdSequenceFunction As Button Friend WithEvents cmdRepelicationFunction As Button - Friend WithEvents cmdLETTERS As Button + Friend WithEvents cmdLogical As Button Friend WithEvents cmdPi As Button Friend WithEvents cmdLetters2 As Button Friend WithEvents cmdMonths As Button @@ -459,10 +427,6 @@ Partial Class dlgEnter Friend WithEvents cmd0 As Button Friend WithEvents cmd1 As Button Friend WithEvents cmdFactor As Button - Friend WithEvents cmdDate As Button Friend WithEvents cmdDay As Button - Friend WithEvents cmdMonth As Button - Friend WithEvents cmdRunif As Button - Friend WithEvents cmdRnorm As Button Friend WithEvents ucrSaveEnterResultInto As ucrSave End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 339fe943e36..9c7136ee036 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -183,35 +183,35 @@ 7 - + NoControl - - 130, 100 + + 130, 97 - + 2, 3, 2, 3 - + 65, 30 - + 142 - - NA + + "" - - cmdMissingValues + + cmdQuotes - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpEnterKeyboard2 - - 15 + + 11 Microsoft Sans Serif, 8.25pt @@ -220,7 +220,7 @@ NoControl - 2, 72 + 66, 97 2, 3, 2, 3 @@ -244,13 +244,13 @@ grpEnterKeyboard2 - 14 + 10 NoControl - 199, 43 + 2, 97 2, 3, 2, 3 @@ -274,7 +274,7 @@ grpEnterKeyboard2 - 13 + 9 Microsoft Sans Serif, 8.25pt @@ -283,7 +283,7 @@ NoControl - 194, 131 + 2, 68 2, 3, 2, 3 @@ -307,7 +307,7 @@ grpEnterKeyboard2 - 12 + 8 Microsoft Sans Serif, 8.25pt @@ -316,7 +316,7 @@ NoControl - 2, 36 + 2, 39 2, 3, 2, 3 @@ -340,43 +340,43 @@ grpEnterKeyboard2 - 11 + 7 - + NoControl - - 130, 72 + + 130, 68 - + 2, 3, 2, 3 - + 65, 30 - + 149 - - LETTERS + + logical - - cmdLETTERS + + cmdLogical - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpEnterKeyboard2 - - 10 + + 6 NoControl - 194, 100 + 66, 68 2, 3, 2, 3 @@ -400,13 +400,13 @@ grpEnterKeyboard2 - 9 + 5 NoControl - 66, 7 + 66, 10 2, 3, 2, 3 @@ -430,13 +430,13 @@ grpEnterKeyboard2 - 8 + 4 NoControl - 66, 36 + 66, 39 2, 3, 2, 3 @@ -460,7 +460,7 @@ grpEnterKeyboard2 - 7 + 3 Microsoft Sans Serif, 8.25pt @@ -469,7 +469,7 @@ NoControl - 2, 7 + 2, 10 2, 3, 2, 3 @@ -493,105 +493,6 @@ grpEnterKeyboard2 - 6 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 66, 131 - - - 2, 3, 2, 3 - - - 65, 30 - - - 158 - - - rnorm - - - cmdRnorm - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 0 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 130, 131 - - - 2, 3, 2, 3 - - - 65, 30 - - - 157 - - - runif - - - cmdRunif - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 1 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 2, 100 - - - 2, 3, 2, 3 - - - 65, 30 - - - 156 - - - month - - - cmdMonth - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - 2 @@ -601,7 +502,7 @@ NoControl - 130, 36 + 130, 39 2, 3, 2, 3 @@ -625,40 +526,7 @@ grpEnterKeyboard2 - 3 - - - Microsoft Sans Serif, 8.25pt - - - NoControl - - - 71, 95 - - - 2, 3, 2, 3 - - - 65, 30 - - - 154 - - - date - - - cmdDate - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpEnterKeyboard2 - - - 4 + 0 Microsoft Sans Serif, 8.25pt @@ -667,7 +535,7 @@ NoControl - 130, 7 + 130, 10 2, 3, 2, 3 @@ -691,7 +559,7 @@ grpEnterKeyboard2 - 5 + 1 379, 50 @@ -703,7 +571,7 @@ 2, 3, 2, 3 - 264, 170 + 201, 132 159 @@ -750,261 +618,6 @@ 2 - - cmdClear - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 0 - - - Button1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 1 - - - cmdBrackets - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 2 - - - cmdPower - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 3 - - - cmdDivide - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 4 - - - cmdPlus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 5 - - - cmdMinus - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 6 - - - cmdMultiply - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 7 - - - Button2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 8 - - - cmd9 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 9 - - - cmd8 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 10 - - - cmd7 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 11 - - - cmd6 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 12 - - - cmd5 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 13 - - - cmd4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 14 - - - cmd3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 15 - - - cmd2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 16 - - - cmd0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 17 - - - cmd1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpBasic - - - 18 - - - 170, 51 - - - 2, 3, 2, 3 - - - 2, 3, 2, 3 - - - 205, 134 - - - 180 - - - grpBasic - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - NoControl @@ -1596,6 +1209,33 @@ 18 + + 170, 51 + + + 2, 3, 2, 3 + + + 2, 3, 2, 3 + + + 205, 134 + + + 180 + + + grpBasic + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + 11, 243 @@ -1672,7 +1312,7 @@ 6, 13 - 645, 336 + 583, 336 11, 278 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index c6cd3d20fde..10e92d4bc85 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -142,8 +142,8 @@ Public Class dlgEnter TestOKEnabled() End Sub - Private Sub cmdMissingValues_Click_1(sender As Object, e As EventArgs) Handles cmdMissingValues.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("NA") + Private Sub cmdMissingValues_Click_1(sender As Object, e As EventArgs) Handles cmdQuotes.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("""") End Sub Private Sub cmdSquareBrackets_Click_1(sender As Object, e As EventArgs) @@ -181,8 +181,8 @@ Public Class dlgEnter End Sub - Private Sub cmdLETTERS_Click(sender As Object, e As EventArgs) Handles cmdLETTERS.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("LETTERS") + Private Sub cmdLETTERS_Click(sender As Object, e As EventArgs) Handles cmdLogical.Click + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.logical(c( ))") TestOKEnabled() End Sub @@ -343,7 +343,7 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.Clear() End Sub - Private Sub cmdDate_Click(sender As Object, e As EventArgs) Handles cmdDate.Click + Private Sub cmdDate_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 2) End Sub @@ -355,15 +355,15 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("factor( )", 2) End Sub - Private Sub cmdMonth_Click(sender As Object, e As EventArgs) Handles cmdMonth.Click + Private Sub cmdMonth_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("'month'") End Sub - Private Sub cmdRnorm_Click(sender As Object, e As EventArgs) Handles cmdRnorm.Click + Private Sub cmdRnorm_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" rnorm( )", 2) End Sub - Private Sub cmdRunif_Click(sender As Object, e As EventArgs) Handles cmdRunif.Click + Private Sub cmdRunif_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" runif( )", 2) End Sub End Class From 6d853625845aa80ffcbb29a257f8996e89c3e950 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 11:43:42 +0300 Subject: [PATCH 051/102] Modifications to enter dialog --- instat/dlgEnter.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 10e92d4bc85..8b721893f9d 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -143,7 +143,7 @@ Public Class dlgEnter End Sub Private Sub cmdMissingValues_Click_1(sender As Object, e As EventArgs) Handles cmdQuotes.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("""") + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("""""", 3) End Sub Private Sub cmdSquareBrackets_Click_1(sender As Object, e As EventArgs) @@ -182,7 +182,7 @@ Public Class dlgEnter Private Sub cmdLETTERS_Click(sender As Object, e As EventArgs) Handles cmdLogical.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.logical(c( ))") + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.logical(c( ))", 4) TestOKEnabled() End Sub @@ -352,7 +352,7 @@ Public Class dlgEnter End Sub Private Sub cmdFactor_Click(sender As Object, e As EventArgs) Handles cmdFactor.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("factor( )", 2) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("forcats::as_factor( )", 2) End Sub Private Sub cmdMonth_Click(sender As Object, e As EventArgs) From 92252e8b50be3b6b902cc51592f47c64ed118581 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 11:49:45 +0300 Subject: [PATCH 052/102] Modifying the exampls --- instat/dlgEnter.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 8b721893f9d..201545e5f1f 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -234,8 +234,8 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"factor(c(1,2,3))"})) lstView.Items.Item(7).ToolTipText = "values 1 to 3 with the variable made into a factor" 'todo. Sensible tooltip here - lstView.Items.Add(New ListViewItem({"factor(rep(LETTERS[1:4],c(4,3,1,1)))"})) - lstView.Items.Item(8).ToolTipText = "Gives A,A,A,A, B,B,B,C,D as a factor" + lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1],c(4,3,1,1)))"})) + lstView.Items.Item(8).ToolTipText = "Gives D,D,D,D,C,C,C,B,A as a fa ctor" lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,2)))"})) lstView.Items.Item(9).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA" From a548fd408cb2045657a8a4162a3134a3b4800511 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 11:57:08 +0300 Subject: [PATCH 053/102] Adding tooltips for the keys --- instat/dlgEnter.Designer.vb | 6 ++++++ instat/dlgEnter.resx | 15 ++++++++++++--- instat/dlgEnter.vb | 9 ++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 16db69c651e..61ea4ca860d 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -38,6 +38,7 @@ Partial Class dlgEnter 'Do not modify it using the code editor. Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgEnter)) Me.chkShowEnterArguments = New System.Windows.Forms.CheckBox() Me.lblData = New System.Windows.Forms.Label() @@ -80,6 +81,7 @@ Partial Class dlgEnter Me.ucrDataFrameEnter = New instat.ucrDataFrame() Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() Me.ucrBase = New instat.ucrButtons() + Me.ttEnter = New System.Windows.Forms.ToolTip(Me.components) Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -363,6 +365,9 @@ Partial Class dlgEnter resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' + 'ttEnter + ' + ' 'dlgEnter ' resources.ApplyResources(Me, "$this") @@ -429,4 +434,5 @@ Partial Class dlgEnter Friend WithEvents cmdFactor As Button Friend WithEvents cmdDay As Button Friend WithEvents ucrSaveEnterResultInto As ucrSave + Friend WithEvents ttEnter As ToolTip End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 9c7136ee036..1bfdbf29990 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -1308,6 +1308,9 @@ True + + 25 + 6, 13 @@ -1335,15 +1338,18 @@ 9 - - NoControl - CenterScreen Enter + + ttEnter + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + dlgEnter @@ -1374,4 +1380,7 @@ 8 + + 17, 5 + \ No newline at end of file diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 201545e5f1f..a872adbed01 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -57,6 +57,9 @@ Public Class dlgEnter ucrSaveEnterResultInto.SetDataFrameSelector(ucrDataFrameEnter) ucrSaveEnterResultInto.SetLabelText("Enter Result Into:") + 'Adding tooltips for the buttons + ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) ucrBase.clsRsyntax.AddToAfterCodes(clsDetach) End Sub @@ -118,7 +121,7 @@ Public Class dlgEnter End Sub Private Sub cmdColon_Click(sender As Object, e As EventArgs) Handles cmdColon.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(":") + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("[:]", 3) TestOKEnabled() End Sub @@ -366,4 +369,8 @@ Public Class dlgEnter Private Sub cmdRunif_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" runif( )", 2) End Sub + + Private Sub ToolTip1_Popup(sender As Object, e As PopupEventArgs) Handles ttEnter.Popup + + End Sub End Class From 94920e19e980ea9ff7147fd1a2eb637b80664cee Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 12:03:58 +0300 Subject: [PATCH 054/102] Adding tooltips for the keys --- instat/dlgEnter.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index a872adbed01..7535f596376 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -59,6 +59,8 @@ Public Class dlgEnter 'Adding tooltips for the buttons ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") + ttEnter.SetToolTip(cmdLetters2, "he letters, e.g. letters[1:4] gives a, b, c, d. Type LETTERS[1:4] for A, B, C, D.") + ttEnter.SetToolTip(cmdFactor, "e.g. forcats::as_factor(""B"",""c"",""A"") to make the contents into a factor variable with the levels in the order as entered, so here B is the lowest level.") ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) ucrBase.clsRsyntax.AddToAfterCodes(clsDetach) From 03a3d4f6414192ee6f1cab3ea9401095688585ea Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 12:16:29 +0300 Subject: [PATCH 055/102] Adding tooltips for the keys --- instat/dlgEnter.Designer.vb | 14 +++++++------- instat/dlgEnter.resx | 24 ++++++++++++------------ instat/dlgEnter.vb | 7 +++++-- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 61ea4ca860d..4cee6abc52c 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -53,7 +53,7 @@ Partial Class dlgEnter Me.cmdMonths = New System.Windows.Forms.Button() Me.cmdColon = New System.Windows.Forms.Button() Me.grpEnterKeyboard2 = New System.Windows.Forms.GroupBox() - Me.cmdDay = New System.Windows.Forms.Button() + Me.cmdText = New System.Windows.Forms.Button() Me.cmdFactor = New System.Windows.Forms.Button() Me.btnExample = New System.Windows.Forms.Button() Me.grpBasic = New System.Windows.Forms.GroupBox() @@ -161,7 +161,7 @@ Partial Class dlgEnter ' 'grpEnterKeyboard2 ' - Me.grpEnterKeyboard2.Controls.Add(Me.cmdDay) + Me.grpEnterKeyboard2.Controls.Add(Me.cmdText) Me.grpEnterKeyboard2.Controls.Add(Me.cmdFactor) Me.grpEnterKeyboard2.Controls.Add(Me.cmdColon) Me.grpEnterKeyboard2.Controls.Add(Me.cmdMonths) @@ -177,11 +177,11 @@ Partial Class dlgEnter Me.grpEnterKeyboard2.Name = "grpEnterKeyboard2" Me.grpEnterKeyboard2.TabStop = False ' - 'cmdDay + 'cmdText ' - resources.ApplyResources(Me.cmdDay, "cmdDay") - Me.cmdDay.Name = "cmdDay" - Me.cmdDay.UseVisualStyleBackColor = True + resources.ApplyResources(Me.cmdText, "cmdText") + Me.cmdText.Name = "cmdText" + Me.cmdText.UseVisualStyleBackColor = True ' 'cmdFactor ' @@ -432,7 +432,7 @@ Partial Class dlgEnter Friend WithEvents cmd0 As Button Friend WithEvents cmd1 As Button Friend WithEvents cmdFactor As Button - Friend WithEvents cmdDay As Button + Friend WithEvents cmdText As Button Friend WithEvents ucrSaveEnterResultInto As ucrSave Friend WithEvents ttEnter As ToolTip End Class diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 1bfdbf29990..5e7d94ff86a 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -495,37 +495,37 @@ 2 - + Microsoft Sans Serif, 8.25pt - + NoControl - + 130, 39 - + 2, 3, 2, 3 - + 65, 30 - + 155 - + text - - cmdDay + + cmdText - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + grpEnterKeyboard2 - + 0 diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 7535f596376..f2045b49830 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -61,7 +61,10 @@ Public Class dlgEnter ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") ttEnter.SetToolTip(cmdLetters2, "he letters, e.g. letters[1:4] gives a, b, c, d. Type LETTERS[1:4] for A, B, C, D.") ttEnter.SetToolTip(cmdFactor, "e.g. forcats::as_factor(""B"",""c"",""A"") to make the contents into a factor variable with the levels in the order as entered, so here B is the lowest level.") - + ttEnter.SetToolTip(cmdRepelicationFunction, "Repeat of a sequence, e.g. rep(c(2,3,4), each=2) gives 2,2,3,3,4,4.") + ttEnter.SetToolTip(cmdMonths, "month.abb[1:4] is ""Jan2"", ""Feb"", ""Mar"", ""Apr"". Type month.name for full month names.") + ttEnter.SetToolTip(cmdText, "Define a character variable, e.g. as.character(c(3,5,""a"",""b"")).") + ttEnter.SetToolTip(cmdSequenceFunction, "Sequences, given either as seq(1,5,2) to give 1,3,5 or as seq(1,5,length=3) to give the same.") ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) ucrBase.clsRsyntax.AddToAfterCodes(clsDetach) End Sub @@ -352,7 +355,7 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 2) End Sub - Private Sub cmdDay_Click(sender As Object, e As EventArgs) Handles cmdDay.Click + Private Sub cmdDay_Click(sender As Object, e As EventArgs) Handles cmdText.Click ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.character(c( ))") End Sub From d2da4699ec50fc2b52653d67c8990e1c6d9ec7b8 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 12:23:12 +0300 Subject: [PATCH 056/102] Adding tooltips for the keys --- instat/dlgEnter.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index f2045b49830..ca34d09c364 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -65,6 +65,11 @@ Public Class dlgEnter ttEnter.SetToolTip(cmdMonths, "month.abb[1:4] is ""Jan2"", ""Feb"", ""Mar"", ""Apr"". Type month.name for full month names.") ttEnter.SetToolTip(cmdText, "Define a character variable, e.g. as.character(c(3,5,""a"",""b"")).") ttEnter.SetToolTip(cmdSequenceFunction, "Sequences, given either as seq(1,5,2) to give 1,3,5 or as seq(1,5,length=3) to give the same.") + ttEnter.SetToolTip(cmdPi, "The number pi = 3.14.") + ttEnter.SetToolTip(cmdLogical, " Define a logical variable, e.g. as.logical(0,1,0,10,-5) gives FALSE, TRUE, FALSE, TRUE, TRUE.") + ttEnter.SetToolTip(cmdConcantenateFunction, "Combines arguments to form a single vector, e.g. c(1:3 8) is 1, 2, 3, 8.") + ttEnter.SetToolTip(cmdExponential, "For scientific notation, e.g. 1.5E-1 = 0.15.") + ucrBase.clsRsyntax.AddToBeforeCodes(clsAttach) ucrBase.clsRsyntax.AddToAfterCodes(clsDetach) End Sub From 7f8be28bd053fd88a92571a4201d8a9cc9de2516 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 12:49:51 +0300 Subject: [PATCH 057/102] Modifications to enter keyboard --- instat/dlgEnter.vb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index ca34d09c364..63cd546ec2e 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -59,7 +59,7 @@ Public Class dlgEnter 'Adding tooltips for the buttons ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") - ttEnter.SetToolTip(cmdLetters2, "he letters, e.g. letters[1:4] gives a, b, c, d. Type LETTERS[1:4] for A, B, C, D.") + ttEnter.SetToolTip(cmdLetters2, "The letters, e.g. letters[1:4] gives a, b, c, d. Type LETTERS[1:4] for A, B, C, D.") ttEnter.SetToolTip(cmdFactor, "e.g. forcats::as_factor(""B"",""c"",""A"") to make the contents into a factor variable with the levels in the order as entered, so here B is the lowest level.") ttEnter.SetToolTip(cmdRepelicationFunction, "Repeat of a sequence, e.g. rep(c(2,3,4), each=2) gives 2,2,3,3,4,4.") ttEnter.SetToolTip(cmdMonths, "month.abb[1:4] is ""Jan2"", ""Feb"", ""Mar"", ""Apr"". Type month.name for full month names.") @@ -187,7 +187,7 @@ Public Class dlgEnter Private Sub cmdSequenceFunction_Click_1(sender As Object, e As EventArgs) Handles cmdSequenceFunction.Click If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq(from= ,to= ,by= )", 11) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq(from= ,to= ,by= ,length = )", 22) Else ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq( )", 2) End If TestOKEnabled() @@ -195,7 +195,7 @@ Public Class dlgEnter Private Sub cmdLETTERS_Click(sender As Object, e As EventArgs) Handles cmdLogical.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.logical(c( ))", 4) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.logical(c( ))", 3) TestOKEnabled() End Sub @@ -356,12 +356,8 @@ Public Class dlgEnter ucrReceiverForEnterCalculation.Clear() End Sub - Private Sub cmdDate_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.date('')", 2) - End Sub - Private Sub cmdDay_Click(sender As Object, e As EventArgs) Handles cmdText.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.character(c( ))") + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("as.character(c( ))", 2) End Sub Private Sub cmdFactor_Click(sender As Object, e As EventArgs) Handles cmdFactor.Click @@ -379,8 +375,4 @@ Public Class dlgEnter Private Sub cmdRunif_Click(sender As Object, e As EventArgs) ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" runif( )", 2) End Sub - - Private Sub ToolTip1_Popup(sender As Object, e As PopupEventArgs) Handles ttEnter.Popup - - End Sub End Class From 9c339ff9cf0e560000a864ea06fcecca094cb526 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 9 Oct 2020 13:39:35 +0300 Subject: [PATCH 058/102] Modifications to enter keyboard --- instat/dlgEnter.vb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 63cd546ec2e..b8505bcf1df 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -156,7 +156,7 @@ Public Class dlgEnter End Sub Private Sub cmdMissingValues_Click_1(sender As Object, e As EventArgs) Handles cmdQuotes.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("""""", 3) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("""", 2) End Sub Private Sub cmdSquareBrackets_Click_1(sender As Object, e As EventArgs) @@ -236,34 +236,34 @@ Public Class dlgEnter 'add rows of sample commands lstView.Items.Add(New ListViewItem({"4.5"})) - lstView.Items.Item(4).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. + lstView.Items.Item(0).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. lstView.Items.Add(New ListViewItem({"'Nairobi'"})) - lstView.Items.Item(5).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. + lstView.Items.Item(1).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. lstView.Items.Add(New ListViewItem({"c(2,3,4)*1.5E02"})) - lstView.Items.Item(6).ToolTipText = "gives 300, 450, 600 then repeated for the data frame" 'todo. Sensible tooltip here + lstView.Items.Item(2).ToolTipText = "gives 300, 450, 600 then repeated for the data frame" 'todo. Sensible tooltip here lstView.Items.Add(New ListViewItem({"factor(c(1,2,3))"})) - lstView.Items.Item(7).ToolTipText = "values 1 to 3 with the variable made into a factor" 'todo. Sensible tooltip here + lstView.Items.Item(3).ToolTipText = "values 1 to 3 with the variable made into a factor" 'todo. Sensible tooltip here lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1],c(4,3,1,1)))"})) - lstView.Items.Item(8).ToolTipText = "Gives D,D,D,D,C,C,C,B,A as a fa ctor" + lstView.Items.Item(4).ToolTipText = "Gives D,D,D,D,C,C,C,B,A as a fa ctor" lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,2)))"})) - lstView.Items.Item(9).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA" + lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA" lstView.Items.Add(New ListViewItem({"c(1:4,10,rep(15,3),20)"})) - lstView.Items.Item(10).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" + lstView.Items.Item(6).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" lstView.Items.Add(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15)"})) - lstView.Items.Item(11).ToolTipText = "A set of sequences, giving 1,3,5 10,11,12, 15" + lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 1,3,5 10,11,12, 15" lstView.Items.Add(New ListViewItem({"runif(3,c(0,5,10),c(1,10,20))"})) - lstView.Items.Item(12).ToolTipText = "Random uniform data from 3 different uniform distributions)" + lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)" lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1940/12/1'),'quarter')"})) - lstView.Items.Item(13).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" + lstView.Items.Item(9).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" From 806060abfdc9e5a2dd9ca44057ace761ae70ca3d Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Mon, 12 Oct 2020 12:31:02 +0300 Subject: [PATCH 059/102] Arranging the keys and the general layout of the keyboard --- instat/dlgEnter.Designer.vb | 5 +-- instat/dlgEnter.resx | 62 ++++++++++++++++++------------------- instat/dlgEnter.vb | 8 ++--- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/instat/dlgEnter.Designer.vb b/instat/dlgEnter.Designer.vb index 4cee6abc52c..60b36d55ce3 100644 --- a/instat/dlgEnter.Designer.vb +++ b/instat/dlgEnter.Designer.vb @@ -76,12 +76,12 @@ Partial Class dlgEnter Me.cmd2 = New System.Windows.Forms.Button() Me.cmd0 = New System.Windows.Forms.Button() Me.cmd1 = New System.Windows.Forms.Button() + Me.ttEnter = New System.Windows.Forms.ToolTip(Me.components) Me.ucrSaveEnterResultInto = New instat.ucrSave() Me.ucrTryModelling = New instat.ucrTry() Me.ucrDataFrameEnter = New instat.ucrDataFrame() Me.ucrReceiverForEnterCalculation = New instat.ucrReceiverExpression() Me.ucrBase = New instat.ucrButtons() - Me.ttEnter = New System.Windows.Forms.ToolTip(Me.components) Me.grpEnterKeyboard2.SuspendLayout() Me.grpBasic.SuspendLayout() Me.SuspendLayout() @@ -365,9 +365,6 @@ Partial Class dlgEnter resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' - 'ttEnter - ' - ' 'dlgEnter ' resources.ApplyResources(Me, "$this") diff --git a/instat/dlgEnter.resx b/instat/dlgEnter.resx index 5e7d94ff86a..7f86255ba66 100644 --- a/instat/dlgEnter.resx +++ b/instat/dlgEnter.resx @@ -187,19 +187,19 @@ NoControl - 130, 97 + 100, 101 2, 3, 2, 3 - 65, 30 + 49, 30 142 - "" + " " cmdQuotes @@ -220,13 +220,13 @@ NoControl - 66, 97 + 52, 101 2, 3, 2, 3 - 65, 30 + 49, 30 143 @@ -250,13 +250,13 @@ NoControl - 2, 97 + 4, 101 2, 3, 2, 3 - 65, 30 + 49, 30 145 @@ -283,13 +283,13 @@ NoControl - 2, 68 + 4, 72 2, 3, 2, 3 - 65, 30 + 49, 30 147 @@ -316,13 +316,13 @@ NoControl - 2, 39 + 4, 43 2, 3, 2, 3 - 65, 30 + 49, 30 148 @@ -346,13 +346,13 @@ NoControl - 130, 68 + 100, 72 2, 3, 2, 3 - 65, 30 + 49, 30 149 @@ -376,13 +376,13 @@ NoControl - 66, 68 + 52, 72 2, 3, 2, 3 - 65, 30 + 49, 30 149 @@ -406,13 +406,13 @@ NoControl - 66, 10 + 52, 14 2, 3, 2, 3 - 65, 30 + 49, 30 152 @@ -436,13 +436,13 @@ NoControl - 66, 39 + 52, 43 2, 3, 2, 3 - 65, 30 + 49, 30 151 @@ -469,13 +469,13 @@ NoControl - 2, 10 + 4, 14 2, 3, 2, 3 - 65, 30 + 49, 30 151 @@ -502,13 +502,13 @@ NoControl - 130, 39 + 100, 43 2, 3, 2, 3 - 65, 30 + 49, 30 155 @@ -535,13 +535,13 @@ NoControl - 130, 10 + 100, 14 2, 3, 2, 3 - 65, 30 + 49, 30 153 @@ -562,7 +562,7 @@ 1 - 379, 50 + 378, 50 2, 3, 2, 3 @@ -571,7 +571,7 @@ 2, 3, 2, 3 - 201, 132 + 156, 134 159 @@ -1236,6 +1236,9 @@ 1 + + 17, 5 + 11, 243 @@ -1315,7 +1318,7 @@ 6, 13 - 583, 336 + 538, 336 11, 278 @@ -1380,7 +1383,4 @@ 8 - - 17, 5 - \ No newline at end of file diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index b8505bcf1df..956bb0bc506 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -131,7 +131,7 @@ Public Class dlgEnter End Sub Private Sub cmdColon_Click(sender As Object, e As EventArgs) Handles cmdColon.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("[:]", 3) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("[:]", 1) TestOKEnabled() End Sub @@ -156,7 +156,7 @@ Public Class dlgEnter End Sub Private Sub cmdMissingValues_Click_1(sender As Object, e As EventArgs) Handles cmdQuotes.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("""", 2) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(Chr(34) & "" & Chr(34), 1) End Sub Private Sub cmdSquareBrackets_Click_1(sender As Object, e As EventArgs) @@ -235,10 +235,10 @@ Public Class dlgEnter lstView.Columns.Add("Commands", 450) 'add rows of sample commands - lstView.Items.Add(New ListViewItem({"4.5"})) + lstView.Items.Add(New ListViewItem({"c(4.5)"})) lstView.Items.Item(0).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. - lstView.Items.Add(New ListViewItem({"'Nairobi'"})) + lstView.Items.Add(New ListViewItem({"c('Nairobi')"})) lstView.Items.Item(1).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. lstView.Items.Add(New ListViewItem({"c(2,3,4)*1.5E02"})) From e463ff4c64174fee398fd274500d0fc96b245dfa Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 18 Oct 2020 14:23:16 +0300 Subject: [PATCH 060/102] explicit return --- instat/static/InstatObject/R/data_object_R6.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 4f51e7b56e5..e5f286908b2 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3735,7 +3735,7 @@ DataSheet$set("public", "visualize_element_na", function(element_col_name, eleme } } if (!missing(station_col_name) && dplyr::n_distinct(station_names) > 1) { - patchwork::wrap_plots(plt_list, ncol = ncol) + return(patchwork::wrap_plots(plt_list, ncol = ncol)) } else { return(plt) From 23fa2c1070262a0335570805194b02828bf62e24 Mon Sep 17 00:00:00 2001 From: Shadrack Kibet Date: Sun, 18 Oct 2020 14:24:20 +0300 Subject: [PATCH 061/102] Update instat/dlgInfillMissingValues.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/dlgInfillMissingValues.vb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index d6d2df98b0b..be203f8e3ba 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -525,16 +525,11 @@ Public Class dlgInfillMissingValues End Sub Private Sub ucrReceiverDispMultShowStation_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDispMultShowStation.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged - If (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverDispMultShowStation.IsEmpty Then - ucrNudFacetColumns.Visible = True - lblFacetColumns.Visible = True - Else - ucrNudFacetColumns.Visible = False - lblFacetColumns.Visible = False - End If + ucrNudFacetColumns.Visible = (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverDispMultShowStation.IsEmpty + lblFacetColumns.Visible = ucrNudFacetColumns.Visible End Sub Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged, ucrInputNewColumnName.ControlContentsChanged, ucrReceiverImputed.ControlContentsChanged, ucrReceiverDisplayShowDate.ControlContentsChanged, ucrReceiverDisplayObserved.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged TestOkEnabled() End Sub -End Class \ No newline at end of file +End Class From 3f839fcdd0de56a0ca897a6b134244ffe590f58b Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 18 Oct 2020 14:52:08 +0300 Subject: [PATCH 062/102] select case to if else --- instat/dlgInfillMissingValues.vb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index be203f8e3ba..e8f94f29c2d 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -436,13 +436,8 @@ Public Class dlgInfillMissingValues End Sub Private Sub ucrInputComboFunction_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputComboFunction.ControlValueChanged, ucrPnlMethods.ControlValueChanged, ucrChkSetSeed.ControlValueChanged, ucrPnlOptions.ControlValueChanged - If rdoFitSingle.Checked AndAlso rdoNaAggregate.Checked AndAlso ucrChkSetSeed.Checked Then - Select Case ucrInputComboFunction.GetValue() - Case "Sample" - ucrBase.clsRsyntax.AddToBeforeCodes(clsSetSeedFunction, 0) - Case Else - ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSetSeedFunction) - End Select + If rdoFitSingle.Checked AndAlso rdoNaAggregate.Checked AndAlso ucrChkSetSeed.Checked AndAlso ucrInputComboFunction.GetText = "Sample" Then + ucrBase.clsRsyntax.AddToBeforeCodes(clsSetSeedFunction, 0) Else ucrBase.clsRsyntax.RemoveFromBeforeCodes(clsSetSeedFunction) End If From 2582a05870487fbeb9195d912b6de713a3a2aa13 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 18 Oct 2020 14:53:22 +0300 Subject: [PATCH 063/102] adding developer error --- instat/dlgInfillMissingValues.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index e8f94f29c2d..9e44049f7d9 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -479,6 +479,8 @@ Public Class dlgInfillMissingValues Case "Intervals" ucrChkAddLegend.Visible = True clsVisualizeElementNa.AddParameter("type", Chr(34) & "interval" & Chr(34), iPosition:=8) + Case Else + MsgBox("Developer error: Parameter must be among the cases. Modify setup such that " & ucrInputComboType.GetText & " is included in the cases.") End Select ElseIf rdoShow.Checked Then ucrChkAddLegend.Visible = True From 1c9c04a70884a2d912f6a49fcd17026b7fc5a634 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 18 Oct 2020 21:06:23 +0300 Subject: [PATCH 064/102] appropriate naming of sub --- instat/dlgInfillMissingValues.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 9e44049f7d9..6c17f61cf83 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -33,7 +33,7 @@ Public Class dlgInfillMissingValues If bReset Then SetDefaults() End If - SetRcodeForControls(bReset) + SetRCodeForControls(bReset) bReset = False TestOkEnabled() End Sub @@ -347,7 +347,7 @@ Public Class dlgInfillMissingValues ucrBase.clsRsyntax.SetBaseRFunction(clsVisualizeElementNa) End Sub - Private Sub SetRcodeForControls(bReset As Boolean) + Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverElement.AddAdditionalCodeParameterPair(clsAggregateFunction, New RParameter("object", 0), iAdditionalPairNo:=1) ucrNudMaximum.AddAdditionalCodeParameterPair(clsAggregateFunction, ucrNudMaximum.GetParameter(), iAdditionalPairNo:=1) @@ -457,7 +457,7 @@ Public Class dlgInfillMissingValues Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset SetDefaults() - SetRcodeForControls(True) + SetRCodeForControls(True) TestOkEnabled() End Sub From d938d2ca1a03a9451a58b61260a5404c40129964 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Mon, 19 Oct 2020 10:08:36 +0300 Subject: [PATCH 065/102] Removing brackets for the two single elements (4.5) and Nairobi --- instat/dlgEnter.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 956bb0bc506..341bab0a22a 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -235,10 +235,10 @@ Public Class dlgEnter lstView.Columns.Add("Commands", 450) 'add rows of sample commands - lstView.Items.Add(New ListViewItem({"c(4.5)"})) + lstView.Items.Add(New ListViewItem({"4.5"})) lstView.Items.Item(0).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. - lstView.Items.Add(New ListViewItem({"c('Nairobi')"})) + lstView.Items.Add(New ListViewItem({"'Nairobi'"})) lstView.Items.Item(1).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. lstView.Items.Add(New ListViewItem({"c(2,3,4)*1.5E02"})) From 356dd836a4e43db23b92ad498569ef932ac130bb Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Wed, 21 Oct 2020 11:17:53 +0300 Subject: [PATCH 066/102] added a check to avoid developer error when type is empty --- instat/dlgInfillMissingValues.vb | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 6c17f61cf83..d1fe05428d6 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -469,21 +469,23 @@ Public Class dlgInfillMissingValues ucrBase.Location = New Point(ucrBase.Location.X, iBaseMaxY / 1.33) ucrReceiverDisplayObserved.SetMeAsReceiver() If rdoDisplay.Checked Then - Select Case ucrInputComboType.GetText - Case "Distribution" - ucrChkAddLegend.Visible = False - clsVisualizeElementNa.AddParameter("type", Chr(34) & "distribution" & Chr(34), iPosition:=8) - Case "Gap size" - ucrChkAddLegend.Visible = True - clsVisualizeElementNa.AddParameter("type", Chr(34) & "gapsize" & Chr(34), iPosition:=8) - Case "Intervals" - ucrChkAddLegend.Visible = True - clsVisualizeElementNa.AddParameter("type", Chr(34) & "interval" & Chr(34), iPosition:=8) - Case Else - MsgBox("Developer error: Parameter must be among the cases. Modify setup such that " & ucrInputComboType.GetText & " is included in the cases.") - End Select + If ucrInputComboType.GetText <> "" Then + Select Case ucrInputComboType.GetText + Case "Distribution" + ucrChkAddLegend.Visible = False + clsVisualizeElementNa.AddParameter("type", Chr(34) & "distribution" & Chr(34), iPosition:=8) + Case "Gap size" + ucrChkAddLegend.Visible = True + clsVisualizeElementNa.AddParameter("type", Chr(34) & "gapsize" & Chr(34), iPosition:=8) + Case "Intervals" + ucrChkAddLegend.Visible = True + clsVisualizeElementNa.AddParameter("type", Chr(34) & "interval" & Chr(34), iPosition:=8) + Case Else + MsgBox("Developer error: Parameter must be among the cases. Modify setup such that " & ucrInputComboType.GetText & " is included among the cases.") + End Select + End If ElseIf rdoShow.Checked Then - ucrChkAddLegend.Visible = True + ucrChkAddLegend.Visible = True clsVisualizeElementNa.AddParameter("type", Chr(34) & "imputation" & Chr(34), iPosition:=8) End If cmdDisplayOptions.Visible = True From c466f6db02ce90343328d993ef846661ddc9fcba Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Wed, 21 Oct 2020 11:40:31 +0300 Subject: [PATCH 067/102] visibility on reopen --- instat/dlgInfillMissingValues.vb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index d1fe05428d6..63d92b9c50d 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -524,8 +524,9 @@ Public Class dlgInfillMissingValues End Sub Private Sub ucrReceiverDispMultShowStation_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDispMultShowStation.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged - ucrNudFacetColumns.Visible = (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverDispMultShowStation.IsEmpty - lblFacetColumns.Visible = ucrNudFacetColumns.Visible + Dim bVisible As Boolean = (rdoDisplay.Checked OrElse rdoShow.Checked) AndAlso Not ucrReceiverDispMultShowStation.IsEmpty + ucrNudFacetColumns.Visible = bVisible + lblFacetColumns.Visible = bVisible End Sub Private Sub ucrReceiverElement_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveNewColumn.ControlContentsChanged, ucrPnlStartEnd.ControlContentsChanged, ucrInputConstant.ControlContentsChanged, ucrPnlMethods.ControlContentsChanged, ucrPnlOptions.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrReceiverObserved.ControlContentsChanged, ucrReceiverEstimatedElements.ControlContentsChanged, ucrChkMeanBias.ControlContentsChanged, ucrInputMeanBias.ControlContentsChanged, ucrChkStdBias.ControlContentsChanged, ucrInputStdBias.ControlContentsChanged, ucrInputNewColumnName.ControlContentsChanged, ucrReceiverImputed.ControlContentsChanged, ucrReceiverDisplayShowDate.ControlContentsChanged, ucrReceiverDisplayObserved.ControlContentsChanged, ucrSaveGraph.ControlContentsChanged From a50042b725d7053afa50854af79291c948451c0f Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Thu, 22 Oct 2020 09:40:53 +0300 Subject: [PATCH 068/102] Minor changes on the examples --- instat/dlgEnter.vb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 341bab0a22a..c0be7addc70 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -250,19 +250,19 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1],c(4,3,1,1)))"})) lstView.Items.Item(4).ToolTipText = "Gives D,D,D,D,C,C,C,B,A as a fa ctor" - lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,2)))"})) - lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA" + lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,3)))"})) + lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA, NA" lstView.Items.Add(New ListViewItem({"c(1:4,10,rep(15,3),20)"})) lstView.Items.Item(6).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" - lstView.Items.Add(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15)"})) - lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 1,3,5 10,11,12, 15" + lstView.Items.Add(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15, 15)"})) + lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0,1,3,5 10,11,12, 15, 15" lstView.Items.Add(New ListViewItem({"runif(3,c(0,5,10),c(1,10,20))"})) lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)" - lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1940/12/1'),'quarter')"})) + lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1937/12/1'),'quarter')"})) lstView.Items.Item(9).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" From 8b6bed6e6de6d6dc00590cbbc54bcb2fb485062c Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Thu, 22 Oct 2020 10:00:16 +0300 Subject: [PATCH 069/102] Added a comma --- instat/dlgEnter.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index c0be7addc70..a09e6a76eef 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -257,7 +257,7 @@ Public Class dlgEnter lstView.Items.Item(6).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" lstView.Items.Add(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15, 15)"})) - lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0,1,3,5 10,11,12, 15, 15" + lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0,1,3,5,10,11,12, 15, 15" lstView.Items.Add(New ListViewItem({"runif(3,c(0,5,10),c(1,10,20))"})) lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)" From 5379ab605d2ff5bf6a17b3b569e06e06f5a9b5ac Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Thu, 22 Oct 2020 12:23:39 +0300 Subject: [PATCH 070/102] Spacing --- instat/dlgEnter.vb | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index a09e6a76eef..24b8c43a06b 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -60,13 +60,13 @@ Public Class dlgEnter 'Adding tooltips for the buttons ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") ttEnter.SetToolTip(cmdLetters2, "The letters, e.g. letters[1:4] gives a, b, c, d. Type LETTERS[1:4] for A, B, C, D.") - ttEnter.SetToolTip(cmdFactor, "e.g. forcats::as_factor(""B"",""c"",""A"") to make the contents into a factor variable with the levels in the order as entered, so here B is the lowest level.") - ttEnter.SetToolTip(cmdRepelicationFunction, "Repeat of a sequence, e.g. rep(c(2,3,4), each=2) gives 2,2,3,3,4,4.") + ttEnter.SetToolTip(cmdFactor, "e.g. forcats::as_factor(""B"", ""c"", ""A"") to make the contents into a factor variable with the levels in the order as entered, so here B is the lowest level.") + ttEnter.SetToolTip(cmdRepelicationFunction, "Repeat of a sequence, e.g. rep(c(2,3,4), each=2) gives 2, 2, 3, 3, 4, 4.") ttEnter.SetToolTip(cmdMonths, "month.abb[1:4] is ""Jan2"", ""Feb"", ""Mar"", ""Apr"". Type month.name for full month names.") - ttEnter.SetToolTip(cmdText, "Define a character variable, e.g. as.character(c(3,5,""a"",""b"")).") - ttEnter.SetToolTip(cmdSequenceFunction, "Sequences, given either as seq(1,5,2) to give 1,3,5 or as seq(1,5,length=3) to give the same.") + ttEnter.SetToolTip(cmdText, "Define a character variable, e.g. as.character(c(3, 5, ""a"", ""b"")).") + ttEnter.SetToolTip(cmdSequenceFunction, "Sequences, given either as seq(1, 5, 2) to give 1,3,5 or as seq(1,5,length=3) to give the same.") ttEnter.SetToolTip(cmdPi, "The number pi = 3.14.") - ttEnter.SetToolTip(cmdLogical, " Define a logical variable, e.g. as.logical(0,1,0,10,-5) gives FALSE, TRUE, FALSE, TRUE, TRUE.") + ttEnter.SetToolTip(cmdLogical, " Define a logical variable, e.g. as.logical(0, 1, 0, 10, -5) gives FALSE, TRUE, FALSE, TRUE, TRUE.") ttEnter.SetToolTip(cmdConcantenateFunction, "Combines arguments to form a single vector, e.g. c(1:3 8) is 1, 2, 3, 8.") ttEnter.SetToolTip(cmdExponential, "For scientific notation, e.g. 1.5E-1 = 0.15.") @@ -131,7 +131,7 @@ Public Class dlgEnter End Sub Private Sub cmdColon_Click(sender As Object, e As EventArgs) Handles cmdColon.Click - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("[:]", 1) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("[:]", 2) TestOKEnabled() End Sub @@ -241,28 +241,28 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"'Nairobi'"})) lstView.Items.Item(1).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. - lstView.Items.Add(New ListViewItem({"c(2,3,4)*1.5E02"})) + lstView.Items.Add(New ListViewItem({"c(2, 3, 4)*1.5E02"})) lstView.Items.Item(2).ToolTipText = "gives 300, 450, 600 then repeated for the data frame" 'todo. Sensible tooltip here - lstView.Items.Add(New ListViewItem({"factor(c(1,2,3))"})) + lstView.Items.Add(New ListViewItem({"factor(c(1, 2, 3))"})) lstView.Items.Item(3).ToolTipText = "values 1 to 3 with the variable made into a factor" 'todo. Sensible tooltip here - lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1],c(4,3,1,1)))"})) - lstView.Items.Item(4).ToolTipText = "Gives D,D,D,D,C,C,C,B,A as a fa ctor" + lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1], c(4, 3, 1, 1)))"})) + lstView.Items.Item(4).ToolTipText = "Gives D, D, D, D, C, C, C, B, A as a factor" - lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA),c(2,1,2,1,3)))"})) + lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA), c(2, 1, 2, 1, 3)))"})) lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA, NA" - lstView.Items.Add(New ListViewItem({"c(1:4,10,rep(15,3),20)"})) - lstView.Items.Item(6).ToolTipText = "A sequence of values 1,2,3,4,10,15,15,15,20" + lstView.Items.Add(New ListViewItem({"c(1:4, 10, rep(15, 3), 20)"})) + lstView.Items.Item(6).ToolTipText = "A sequence of values 1, 2, 3, 4, 10, 15, 15, 15, 20" - lstView.Items.Add(New ListViewItem({"c(0,seq(1,5,2 ),seq(10,12),15, 15)"})) - lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0,1,3,5,10,11,12, 15, 15" + lstView.Items.Add(New ListViewItem({"c(0,seq(1, 5, 2 ), seq(10, 12), 15, 15)"})) + lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0, 1, 3, 5, 10, 11, 12, 15, 15" - lstView.Items.Add(New ListViewItem({"runif(3,c(0,5,10),c(1,10,20))"})) + lstView.Items.Add(New ListViewItem({"runif(3, c(0, 5, 10), c(1, 10, 20))"})) lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)" - lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1937/12/1'),'quarter')"})) + lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1937/12/1'), 'quarter')"})) lstView.Items.Item(9).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" From 018fa21693b7919d5dc60a55b8a639f325d2916d Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Thu, 22 Oct 2020 13:45:14 +0300 Subject: [PATCH 071/102] Changed the prefix first letter --- instat/dlgEnter.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 24b8c43a06b..31903b39270 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -52,7 +52,7 @@ Public Class dlgEnter clsDetach.AddParameter("unload", "TRUE") ucrBase.clsRsyntax.SetCommandString("") ucrSaveEnterResultInto.SetSaveTypeAsColumn() - ucrSaveEnterResultInto.SetPrefix("Enter") + ucrSaveEnterResultInto.SetPrefix("enter") ucrSaveEnterResultInto.SetIsTextBox() ucrSaveEnterResultInto.SetDataFrameSelector(ucrDataFrameEnter) ucrSaveEnterResultInto.SetLabelText("Enter Result Into:") @@ -250,7 +250,7 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1], c(4, 3, 1, 1)))"})) lstView.Items.Item(4).ToolTipText = "Gives D, D, D, D, C, C, C, B, A as a factor" - lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7],NA), c(2, 1, 2, 1, 3)))"})) + lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7], NA), c(2, 1, 2, 1, 3)))"})) lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA, NA" lstView.Items.Add(New ListViewItem({"c(1:4, 10, rep(15, 3), 20)"})) @@ -262,7 +262,7 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"runif(3, c(0, 5, 10), c(1, 10, 20))"})) lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)" - lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'),as.Date('1937/12/1'), 'quarter')"})) + lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'), as.Date('1937/12/1'), 'quarter')"})) lstView.Items.Item(9).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" From d740a19e7ff754b90057633527a60f9fe568f4be Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Thu, 22 Oct 2020 16:13:56 +0300 Subject: [PATCH 072/102] Adding and removing spaces --- instat/dlgEnter.vb | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 31903b39270..7b2bc12fe94 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -61,11 +61,11 @@ Public Class dlgEnter ttEnter.SetToolTip(cmdColon, "A subset, e.g. letters[1:4] gives a, b, c, d.") ttEnter.SetToolTip(cmdLetters2, "The letters, e.g. letters[1:4] gives a, b, c, d. Type LETTERS[1:4] for A, B, C, D.") ttEnter.SetToolTip(cmdFactor, "e.g. forcats::as_factor(""B"", ""c"", ""A"") to make the contents into a factor variable with the levels in the order as entered, so here B is the lowest level.") - ttEnter.SetToolTip(cmdRepelicationFunction, "Repeat of a sequence, e.g. rep(c(2,3,4), each=2) gives 2, 2, 3, 3, 4, 4.") + ttEnter.SetToolTip(cmdRepelicationFunction, "Repeat of a sequence, e.g. rep(c(2, 3, 4), each=2) gives 2, 2, 3, 3, 4, 4.") ttEnter.SetToolTip(cmdMonths, "month.abb[1:4] is ""Jan2"", ""Feb"", ""Mar"", ""Apr"". Type month.name for full month names.") ttEnter.SetToolTip(cmdText, "Define a character variable, e.g. as.character(c(3, 5, ""a"", ""b"")).") - ttEnter.SetToolTip(cmdSequenceFunction, "Sequences, given either as seq(1, 5, 2) to give 1,3,5 or as seq(1,5,length=3) to give the same.") - ttEnter.SetToolTip(cmdPi, "The number pi = 3.14.") + ttEnter.SetToolTip(cmdSequenceFunction, "Sequences, given either as seq(1, 5, 2) to give 1, 3, 5 or as seq(1, 5, length = 3) to give the same.") + ttEnter.SetToolTip(cmdPi, "The number pi = 3.14...") ttEnter.SetToolTip(cmdLogical, " Define a logical variable, e.g. as.logical(0, 1, 0, 10, -5) gives FALSE, TRUE, FALSE, TRUE, TRUE.") ttEnter.SetToolTip(cmdConcantenateFunction, "Combines arguments to form a single vector, e.g. c(1:3 8) is 1, 2, 3, 8.") ttEnter.SetToolTip(cmdExponential, "For scientific notation, e.g. 1.5E-1 = 0.15.") @@ -170,7 +170,7 @@ Public Class dlgEnter End Sub Private Sub cmdConcantenateFunction_Click_1(sender As Object, e As EventArgs) Handles cmdConcantenateFunction.Click If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("c( ,recursive=FALSE)", 17) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("c( ,recursive = FALSE)", 19) Else ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("c( )", 2) End If @@ -179,7 +179,7 @@ Public Class dlgEnter Private Sub cmdRepelicationFunction_Click_1(sender As Object, e As EventArgs) Handles cmdRepelicationFunction.Click If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("rep(x= ,times= ,length= ,each= )", 25) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("rep(x = , times = , length = , each = )", 32) Else ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("rep( )", 2) End If TestOKEnabled() @@ -187,7 +187,7 @@ Public Class dlgEnter Private Sub cmdSequenceFunction_Click_1(sender As Object, e As EventArgs) Handles cmdSequenceFunction.Click If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq(from= ,to= ,by= ,length = )", 22) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq(from = , to = , by = , length = )", 27) Else ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("seq( )", 2) End If TestOKEnabled() @@ -236,31 +236,31 @@ Public Class dlgEnter 'add rows of sample commands lstView.Items.Add(New ListViewItem({"4.5"})) - lstView.Items.Item(0).ToolTipText = "A single number repeated for the data frame" 'todo. sensible tooltip here. + lstView.Items.Item(0).ToolTipText = "A single number repeated for the data frame." 'todo. sensible tooltip here. lstView.Items.Add(New ListViewItem({"'Nairobi'"})) - lstView.Items.Item(1).ToolTipText = "a single text repeated for the data frame" 'todo. Sensible tooltip here. + lstView.Items.Item(1).ToolTipText = "A single text repeated for the data frame." 'todo. Sensible tooltip here. lstView.Items.Add(New ListViewItem({"c(2, 3, 4)*1.5E02"})) - lstView.Items.Item(2).ToolTipText = "gives 300, 450, 600 then repeated for the data frame" 'todo. Sensible tooltip here + lstView.Items.Item(2).ToolTipText = "Gives 300, 450, 600 then repeated for the data frame." 'todo. Sensible tooltip here lstView.Items.Add(New ListViewItem({"factor(c(1, 2, 3))"})) - lstView.Items.Item(3).ToolTipText = "values 1 to 3 with the variable made into a factor" 'todo. Sensible tooltip here + lstView.Items.Item(3).ToolTipText = "Values 1 to 3 with the variable made into a factor ." 'todo. Sensible tooltip here - lstView.Items.Add(New ListViewItem({" forcats::as_factor(rep(LETTERS[4:1], c(4, 3, 1, 1)))"})) - lstView.Items.Item(4).ToolTipText = "Gives D, D, D, D, C, C, C, B, A as a factor" + lstView.Items.Add(New ListViewItem({"forcats::as_factor(rep(LETTERS[4:1], c(4, 3, 1, 1)))"})) + lstView.Items.Item(4).ToolTipText = "Gives D, D, D, D, C, C, C, B, A as a factor." lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7], NA), c(2, 1, 2, 1, 3)))"})) - lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA, NA" + lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA, NA." lstView.Items.Add(New ListViewItem({"c(1:4, 10, rep(15, 3), 20)"})) - lstView.Items.Item(6).ToolTipText = "A sequence of values 1, 2, 3, 4, 10, 15, 15, 15, 20" + lstView.Items.Item(6).ToolTipText = "A sequence of values 1, 2, 3, 4, 10, 15, 15, 15, 20." lstView.Items.Add(New ListViewItem({"c(0,seq(1, 5, 2 ), seq(10, 12), 15, 15)"})) - lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0, 1, 3, 5, 10, 11, 12, 15, 15" + lstView.Items.Item(7).ToolTipText = "A set of sequences, giving 0, 1, 3, 5, 10, 11, 12, 15, 15." lstView.Items.Add(New ListViewItem({"runif(3, c(0, 5, 10), c(1, 10, 20))"})) - lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)" + lstView.Items.Item(8).ToolTipText = "Random uniform data from 3 different uniform distributions)." lstView.Items.Add(New ListViewItem({"seq(as.Date('1935/3/1'), as.Date('1937/12/1'), 'quarter')"})) lstView.Items.Item(9).ToolTipText = "A sequence of dates from 1935/3/1, 1935/6/1 ...)" @@ -369,10 +369,10 @@ Public Class dlgEnter End Sub Private Sub cmdRnorm_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" rnorm( )", 2) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("rnorm( )", 2) End Sub Private Sub cmdRunif_Click(sender As Object, e As EventArgs) - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition(" runif( )", 2) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("runif( )", 2) End Sub End Class From beafb23530d288f4b34d03a6d3778fa3fec085c7 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Thu, 22 Oct 2020 18:11:13 +0300 Subject: [PATCH 073/102] Replaced single quotes with double quotes --- instat/dlgEnter.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 7b2bc12fe94..4190b98b2ea 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -170,7 +170,7 @@ Public Class dlgEnter End Sub Private Sub cmdConcantenateFunction_Click_1(sender As Object, e As EventArgs) Handles cmdConcantenateFunction.Click If chkShowEnterArguments.Checked Then - ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("c( ,recursive = FALSE)", 19) + ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("c( , recursive = FALSE)", 20) Else ucrReceiverForEnterCalculation.AddToReceiverAtCursorPosition("c( )", 2) End If @@ -238,7 +238,7 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"4.5"})) lstView.Items.Item(0).ToolTipText = "A single number repeated for the data frame." 'todo. sensible tooltip here. - lstView.Items.Add(New ListViewItem({"'Nairobi'"})) + lstView.Items.Add(New ListViewItem({"""Nairobi"""})) lstView.Items.Item(1).ToolTipText = "A single text repeated for the data frame." 'todo. Sensible tooltip here. lstView.Items.Add(New ListViewItem({"c(2, 3, 4)*1.5E02"})) From c2cb32f15a53dac0bba09373f639a7f174f1c51e Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Fri, 23 Oct 2020 11:03:10 +0100 Subject: [PATCH 074/102] Update Download.html --- docs/Download.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Download.html b/docs/Download.html index 65a727250ba..5ee67399179 100644 --- a/docs/Download.html +++ b/docs/Download.html @@ -79,7 +79,7 @@

Download R-Instat


-

R-Instat 0.6.2 Installer (.exe 483MB)

+

R-Instat 0.6.3 Installer (.exe 550MB)

R-Instat is currently a Windows only application. However, it can be accessed on Mac or Linux through use of a Virtual Windows Machine.

Installation & Documentation

From c65abbbb6644e39732bf271180c91c2ae336d0de Mon Sep 17 00:00:00 2001 From: patowhiz Date: Mon, 26 Oct 2020 00:55:09 +0300 Subject: [PATCH 075/102] Backend changes. Extended the adding of columns fucntionality. Removed bug in the calculation script --- .../R/Backend_Components/calculations.R | 6 +++--- instat/static/InstatObject/R/data_object_R6.R | 20 ++++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/instat/static/InstatObject/R/Backend_Components/calculations.R b/instat/static/InstatObject/R/Backend_Components/calculations.R index 334e9c112f0..d2cef35718a 100644 --- a/instat/static/InstatObject/R/Backend_Components/calculations.R +++ b/instat/static/InstatObject/R/Backend_Components/calculations.R @@ -699,10 +699,10 @@ DataBook$set("public", "save_calc_output", function(calc, curr_data_list, previo stop("Cannot save output from this calculation because the data frame does not have any defined keys.") } } - else { - # If no summary or join, then simply add result as new column + else { + # If no summary or join, then simply add result as new column # Because no join was required, the rows should match 1-1 in both data frames - self$add_columns_to_data(calc_from_data_name, calc$result_name, curr_data_list[[c_data_label]][[calc$result_name]]) + self$add_columns_to_data(data_name = calc_from_data_name, col_name = calc$result_name, col_data = curr_data_list[[c_data_label]][[calc$result_name]]) to_data_name <- calc_from_data_name if(calc$name %in% self$get_calculation_names(to_data_name)) { calc$name <- next_default_item(calc$name, self$get_calculation_names(to_data_name)) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 42e7bf59123..253bdaa903c 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -570,9 +570,23 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, if(!replaced) { if(before && ind == 1) self$set_data(dplyr::select(self$get_data_frame(use_current_filter = FALSE) , c((previous_length + 1):(previous_length + num_cols), 1:previous_length))) else if(before || ind != previous_length + 1) self$set_data(dplyr::select(self$get_data_frame(use_current_filter = FALSE) , c(1:(ind - 1), (previous_length + 1):(previous_length + num_cols), ind:previous_length))) - } - else { - if(!missing(before) || !missing(adjacent_column)) warning("Cannot reposition when one or move new columns replaces an old column.") + }else { + #get the adjacent position to be used in appending the new column names + if(before) { + if(missing(adjacent_column)) adjacent_position = 0 + else adjacent_position = which(self$get_column_names() == adjacent_column) - 1 + }else{ + if(missing(adjacent_column)) adjacent_position = self$get_column_count() + else adjacent_position = which(self$get_column_names() == adjacent_column) + } + #replace existing names with empty placeholders. Maintains the indices. + temp_all_col_names <- replace(self$get_column_names(), self$get_column_names() %in% new_col_names, "" ) + #append the newly added column names after the set position + new_col_names_order <- append(temp_all_col_names, new_col_names, adjacent_position) + #remove all empty characters placeholders to get final reordered column names + new_col_names_order <- new_col_names_order[! new_col_names_order %in% c("")] + #only do reordering if the column names order differ + if(!all( all_col_names == new_col_list) ) self$reorder_columns_in_data(col_order=new_col_names_order) } } ) From 12c18fc59546450ca011dcbb99b914b81cc31a7d Mon Sep 17 00:00:00 2001 From: patowhiz Date: Mon, 26 Oct 2020 01:21:17 +0300 Subject: [PATCH 076/102] initial design changes --- instat/dlgFindNonnumericValues.Designer.vb | 8 + instat/dlgFindNonnumericValues.resx | 164 +++++++++------------ 2 files changed, 78 insertions(+), 94 deletions(-) diff --git a/instat/dlgFindNonnumericValues.Designer.vb b/instat/dlgFindNonnumericValues.Designer.vb index f788c8071bc..fd7d6049050 100644 --- a/instat/dlgFindNonnumericValues.Designer.vb +++ b/instat/dlgFindNonnumericValues.Designer.vb @@ -31,6 +31,7 @@ Partial Class dlgFindNonnumericValues Me.ucrBase = New instat.ucrButtons() Me.ucrInputColumnName = New instat.ucrInputTextBox() Me.lblColumnName = New System.Windows.Forms.Label() + Me.ucrSaveColumn = New instat.ucrSave() Me.SuspendLayout() ' 'lblColumn @@ -85,10 +86,16 @@ Partial Class dlgFindNonnumericValues resources.ApplyResources(Me.lblColumnName, "lblColumnName") Me.lblColumnName.Name = "lblColumnName" ' + 'ucrSaveColumn + ' + resources.ApplyResources(Me.ucrSaveColumn, "ucrSaveColumn") + Me.ucrSaveColumn.Name = "ucrSaveColumn" + ' 'dlgFindNonnumericValues ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.ucrSaveColumn) Me.Controls.Add(Me.ucrInputColumnName) Me.Controls.Add(Me.ucrChkFilterNonumerics) Me.Controls.Add(Me.ucrChkShowSummary) @@ -113,4 +120,5 @@ Partial Class dlgFindNonnumericValues Friend WithEvents ucrChkFilterNonumerics As ucrCheck Friend WithEvents ucrInputColumnName As ucrInputTextBox Friend WithEvents lblColumnName As Label + Friend WithEvents ucrSaveColumn As ucrSave End Class diff --git a/instat/dlgFindNonnumericValues.resx b/instat/dlgFindNonnumericValues.resx index d9cb02bcee9..91b0f0775fa 100644 --- a/instat/dlgFindNonnumericValues.resx +++ b/instat/dlgFindNonnumericValues.resx @@ -148,7 +148,7 @@ $this - 3 + 4 10, 222 @@ -169,7 +169,7 @@ $this - 1 + 2 10, 196 @@ -190,7 +190,7 @@ $this - 2 + 3 True @@ -199,91 +199,52 @@ 6, 13 - 417, 333 + 664, 333 - - ucrInputColumnName + + 240, 196 - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + 4, 5, 4, 5 - - $this + + 403, 21 - - 0 + + 8 - - ucrSelectorShowNonNumericValues + + ucrSaveColumn - - instat.ucrSelectorByDataFrameAddRemove, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrSave, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 5 - - - ucrBase + + 0 - - instat.ucrButtons, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + 92, 247 - - $this + + 137, 21 - + 6 - - lblColumnName - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - - - CenterScreen - - - Find Non-Numeric Values - - - dlgFindNonnumericValues - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 240, 60 - - - 0, 0, 0, 0 - - - 120, 20 - - - 2 - - - ucrReceiverColumn + + ucrInputColumnName - - instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 4 + + 1 10, 10 @@ -307,7 +268,7 @@ $this - 5 + 6 10, 274 @@ -328,28 +289,7 @@ $this - 6 - - - 92, 247 - - - 137, 21 - - - 6 - - - ucrInputColumnName - - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 0 + 7 7, 250 @@ -373,6 +313,42 @@ $this - 7 + 8 + + + CenterScreen + + + Find Non-Numeric Values + + + dlgFindNonnumericValues + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 240, 60 + + + 0, 0, 0, 0 + + + 120, 20 + + + 2 + + + ucrReceiverColumn + + + instat.ucrReceiverSingle, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 \ No newline at end of file From 439622faa23868bfd791648dde3de9185a43d9a1 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Mon, 26 Oct 2020 18:16:29 +0300 Subject: [PATCH 077/102] changes to dlgFindNonnumericValues. Designer and code --- instat/dlgFindNonnumericValues.Designer.vb | 19 ------ instat/dlgFindNonnumericValues.resx | 63 +++---------------- instat/dlgFindNonnumericValues.vb | 33 ++++++---- instat/static/InstatObject/R/data_object_R6.R | 2 +- 4 files changed, 30 insertions(+), 87 deletions(-) diff --git a/instat/dlgFindNonnumericValues.Designer.vb b/instat/dlgFindNonnumericValues.Designer.vb index fd7d6049050..2d495c39473 100644 --- a/instat/dlgFindNonnumericValues.Designer.vb +++ b/instat/dlgFindNonnumericValues.Designer.vb @@ -29,8 +29,6 @@ Partial Class dlgFindNonnumericValues Me.ucrReceiverColumn = New instat.ucrReceiverSingle() Me.ucrSelectorShowNonNumericValues = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.ucrInputColumnName = New instat.ucrInputTextBox() - Me.lblColumnName = New System.Windows.Forms.Label() Me.ucrSaveColumn = New instat.ucrSave() Me.SuspendLayout() ' @@ -73,19 +71,6 @@ Partial Class dlgFindNonnumericValues resources.ApplyResources(Me.ucrBase, "ucrBase") Me.ucrBase.Name = "ucrBase" ' - 'ucrInputColumnName - ' - Me.ucrInputColumnName.AddQuotesIfUnrecognised = True - Me.ucrInputColumnName.IsMultiline = False - Me.ucrInputColumnName.IsReadOnly = False - resources.ApplyResources(Me.ucrInputColumnName, "ucrInputColumnName") - Me.ucrInputColumnName.Name = "ucrInputColumnName" - ' - 'lblColumnName - ' - resources.ApplyResources(Me.lblColumnName, "lblColumnName") - Me.lblColumnName.Name = "lblColumnName" - ' 'ucrSaveColumn ' resources.ApplyResources(Me.ucrSaveColumn, "ucrSaveColumn") @@ -96,14 +81,12 @@ Partial Class dlgFindNonnumericValues resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.Controls.Add(Me.ucrSaveColumn) - Me.Controls.Add(Me.ucrInputColumnName) Me.Controls.Add(Me.ucrChkFilterNonumerics) Me.Controls.Add(Me.ucrChkShowSummary) Me.Controls.Add(Me.lblColumn) Me.Controls.Add(Me.ucrReceiverColumn) Me.Controls.Add(Me.ucrSelectorShowNonNumericValues) Me.Controls.Add(Me.ucrBase) - Me.Controls.Add(Me.lblColumnName) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MinimizeBox = False Me.Name = "dlgFindNonnumericValues" @@ -118,7 +101,5 @@ Partial Class dlgFindNonnumericValues Friend WithEvents ucrChkShowSummary As ucrCheck Friend WithEvents ucrReceiverColumn As ucrReceiverSingle Friend WithEvents ucrChkFilterNonumerics As ucrCheck - Friend WithEvents ucrInputColumnName As ucrInputTextBox - Friend WithEvents lblColumnName As Label Friend WithEvents ucrSaveColumn As ucrSave End Class diff --git a/instat/dlgFindNonnumericValues.resx b/instat/dlgFindNonnumericValues.resx index 91b0f0775fa..cafe4d7c834 100644 --- a/instat/dlgFindNonnumericValues.resx +++ b/instat/dlgFindNonnumericValues.resx @@ -148,10 +148,10 @@ $this - 4 + 3 - 10, 222 + 10, 221 314, 20 @@ -169,7 +169,7 @@ $this - 2 + 1 10, 196 @@ -190,7 +190,7 @@ $this - 3 + 2 True @@ -199,10 +199,10 @@ 6, 13 - 664, 333 + 419, 333 - 240, 196 + 10, 247 4, 5, 4, 5 @@ -225,27 +225,6 @@ 0 - - 92, 247 - - - 137, 21 - - - 6 - - - ucrInputColumnName - - - instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 1 - 10, 10 @@ -268,7 +247,7 @@ $this - 6 + 5 10, 274 @@ -289,31 +268,7 @@ $this - 7 - - - 7, 250 - - - 90, 18 - - - 5 - - - Logical Column: - - - lblColumnName - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 8 + 6 CenterScreen @@ -349,6 +304,6 @@ $this - 5 + 4 \ No newline at end of file diff --git a/instat/dlgFindNonnumericValues.vb b/instat/dlgFindNonnumericValues.vb index 22de9318a8f..1dc2d7d9f7d 100644 --- a/instat/dlgFindNonnumericValues.vb +++ b/instat/dlgFindNonnumericValues.vb @@ -14,6 +14,7 @@ ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . +Imports instat Imports instat.Translations Public Class dlgFindNonnumericValues Public bFirstLoad As Boolean = True @@ -42,7 +43,7 @@ Public Class dlgFindNonnumericValues ucrBase.iHelpTopicID = 545 ucrSelectorShowNonNumericValues.SetParameter(New RParameter("data_name", 0)) ucrSelectorShowNonNumericValues.SetParameterIsString() - + ucrReceiverColumn.Selector = ucrSelectorShowNonNumericValues ucrSelectorShowNonNumericValues.bUseCurrentFilter = False @@ -52,8 +53,12 @@ Public Class dlgFindNonnumericValues ucrReceiverColumn.SetIncludedDataTypes({"character"}) ucrReceiverColumn.strSelectorHeading = "characters" - ucrInputColumnName.SetParameter(New RParameter("result_name", 3)) - ucrInputColumnName.SetDataFrameSelector(ucrSelectorShowNonNumericValues.ucrAvailableDataFrames) + 'save control + ucrSaveColumn.SetPrefix("nonum") + ucrSaveColumn.SetSaveTypeAsColumn() + ucrSaveColumn.SetIsTextBox() + ucrSaveColumn.SetLabelText("Logical Column:") + ucrSaveColumn.SetDataFrameSelector(ucrSelectorShowNonNumericValues.ucrAvailableDataFrames) ucrChkShowSummary.SetText("Display summary") ucrChkShowSummary.AddRSyntaxContainsFunctionNamesCondition(True, {"summary"}) @@ -78,6 +83,7 @@ Public Class dlgFindNonnumericValues ucrReceiverColumn.SetMeAsReceiver() ucrSelectorShowNonNumericValues.Reset() + ucrSaveColumn.Reset() ucrBase.clsRsyntax.ClearCodes() clsIsNaFunction.SetRCommand("is.na") @@ -127,22 +133,15 @@ Public Class dlgFindNonnumericValues Private Sub SetRCodeForControls(bReset As Boolean) ucrReceiverColumn.AddAdditionalCodeParameterPair(clsAsNumericFunction, New RParameter("x", 1), iAdditionalPairNo:=1) - ucrInputColumnName.AddAdditionalCodeParameterPair(clsGetColumnsFunction, New RParameter("col_names", 1), iAdditionalPairNo:=1) - ucrInputColumnName.AddAdditionalCodeParameterPair(clsNonNumericFilterFunc, New RParameter("function_exp", 1), iAdditionalPairNo:=2) - ucrReceiverColumn.SetRCode(clsIsNaFunction, bReset) - ucrInputColumnName.SetRCode(clsNonNumericCalcFunc, bReset) + ucrSaveColumn.SetRCode(clsGetColumnsFunction, bReset) ucrChkShowSummary.SetRSyntax(ucrBase.clsRsyntax, bReset) ucrChkFilterNonumerics.SetRCode(clsCurrRunCalc, bReset) ucrSelectorShowNonNumericValues.SetRCode(clsGetColumnsFunction, bReset) End Sub Private Sub TestOKEnabled() - If Not ucrReceiverColumn.IsEmpty AndAlso Not ucrInputColumnName.IsEmpty Then - ucrBase.OKEnabled(True) - Else - ucrBase.OKEnabled(False) - End If + ucrBase.OKEnabled(Not ucrReceiverColumn.IsEmpty AndAlso ucrSaveColumn.IsComplete) End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -176,7 +175,15 @@ Public Class dlgFindNonnumericValues clsRunCalcFunction.AddParameter("calc", clsRFunctionParameter:=clsCurrRunCalc) End Sub - Private Sub ucrReceiverColumn_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverColumn.ControlContentsChanged, ucrInputColumnName.ControlContentsChanged + Private Sub ucrReceiverColumn_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverColumn.ControlContentsChanged, ucrSaveColumn.ControlContentsChanged TestOKEnabled() End Sub + + Private Sub ucrSaveColumn_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSaveColumn.ControlValueChanged + 'change the parameter values + clsNonNumericCalcFunc.AddParameter(strParameterName:="result_name", strParameterValue:=Chr(34) & ucrSaveColumn.GetText & Chr(34), iPosition:=3) + clsNonNumericFilterFunc.AddParameter(strParameterName:="function_exp", strParameterValue:=Chr(34) & ucrSaveColumn.GetText & Chr(34), iPosition:=1) + clsGetColumnsFunction.AddParameter(strParameterName:="col_names", strParameterValue:=Chr(34) & ucrSaveColumn.GetText & Chr(34), iPosition:=1) + End Sub + End Class diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 253bdaa903c..76068bca444 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -586,7 +586,7 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, #remove all empty characters placeholders to get final reordered column names new_col_names_order <- new_col_names_order[! new_col_names_order %in% c("")] #only do reordering if the column names order differ - if(!all( all_col_names == new_col_list) ) self$reorder_columns_in_data(col_order=new_col_names_order) + if(!all( self$get_column_names() == new_col_names_order) ) self$reorder_columns_in_data(col_order=new_col_names_order) } } ) From 4d5f62b7201d0ce72b6b46709de39cc01c62c8e3 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 27 Oct 2020 16:37:56 +0300 Subject: [PATCH 078/102] added suggestions --- instat/dlgImportDataset.vb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/instat/dlgImportDataset.vb b/instat/dlgImportDataset.vb index b84c021eaac..3d1c145d5f9 100644 --- a/instat/dlgImportDataset.vb +++ b/instat/dlgImportDataset.vb @@ -434,7 +434,7 @@ Public Class dlgImportDataset 'Loads the open dialog on load and click Public Sub GetFileFromOpenDialog() Using dlgOpen As New OpenFileDialog - dlgOpen.Filter = "All Data files|*.csv;*.txt;*.xls;*.xlsx;*.RDS;*.sav;*.tsv;*.csvy;*.feather;*.psv;*.RData;*.json;*.yml;*.dta;*.dbf;*.arff;*.R;*.sas7bdat;*.xpt;*.mtp;*.rec;*.syd;*.dif;*.ods;*.xml;*.html;*.dly|Comma separated files|*.csv|Text data file|*.txt|Excel files|*.xls;*.xlsx|R Data Structure files|*.RDS|SPSS files|*.sav|Tab separated files|*.tsv|CSV with a YAML metadata header|*.csvy|Feather R/Python interchange format|*.feather|Pipe separates files|*.psv|Saved R objects|*.RData|JSON|*.json|YAML|*.yml|Stata files|*.dta|XBASE database files|*.dbf|Weka Attribute-Relation File Format|*.arff|R syntax object|*.R|SAS Files|*.sas7bdat|SAS XPORT|*.xpt|Minitab Files|*.mtp|Epiinfo Files|*.rec|Systat Files|*.syd|Data Interchange Format|*.dif|OpenDocument Spreadsheet|*.ods|Shallow XML documents|*.xml|Single-table HTML documents|*.html|DLY|*.html|All files|*.*" + dlgOpen.Filter = "All Data files|*.csv;*.txt;*.xls;*.xlsx;*.RDS;*.sav;*.tsv;*.csvy;*.feather;*.psv;*.RData;*.json;*.yml;*.dta;*.dbf;*.arff;*.R;*.sas7bdat;*.xpt;*.mtp;*.rec;*.syd;*.dif;*.ods;*.xml;*.html;*.dly|Comma separated files|*.csv|Text data file|*.txt|Excel files|*.xls;*.xlsx|R Data Structure files|*.RDS|SPSS files|*.sav|Tab separated files|*.tsv|CSV with a YAML metadata header|*.csvy|Feather R/Python interchange format|*.feather|Pipe separates files|*.psv|Saved R objects|*.RData|JSON|*.json|YAML|*.yml|Stata files|*.dta|XBASE database files|*.dbf|Weka Attribute-Relation File Format|*.arff|R syntax object|*.R|SAS Files|*.sas7bdat|SAS XPORT|*.xpt|Minitab Files|*.mtp|Epiinfo Files|*.rec|Systat Files|*.syd|Data Interchange Format|*.dif|OpenDocument Spreadsheet|*.ods|Shallow XML documents|*.xml|Single-table HTML documents|*.html|DLY|*.dly|All files|*.*" dlgOpen.Multiselect = False If bFromLibrary Then dlgOpen.Title = "Import from Library" @@ -599,6 +599,8 @@ Public Class dlgImportDataset grpRDS.Show() ElseIf strFileExt = ".txt" Then strFileType = "TXT" + 'add or change format parameter values + clsImportCSV.AddParameter("format", Chr(34) & "txt" & Chr(34), iPosition:=1) 'by default the textfiles will be imported using the function we use for csv ucrBase.clsRsyntax.SetBaseRFunction(clsImportCSV) ucrPanelFixedWidthText.Show() @@ -606,13 +608,9 @@ Public Class dlgImportDataset grpCSV.Location = New System.Drawing.Point(9, 99) 'set the location of the groupbox to adjust gaps in the form UI grpCSV.Show() ElseIf strFileExt = ".csv" OrElse strFileExt = ".dly" Then - 'treat dly files as csv. override the extension using format parameter strFileType = "CSV" - If strFileExt = ".dly" Then - clsImportCSV.AddParameter("format", Chr(34) & "csv" & Chr(34)) - Else - clsImportCSV.RemoveParameterByName("format") - End If + 'add format. forces rio to treat dly files as csv + clsImportCSV.AddParameter("format", Chr(34) & "csv" & Chr(34), iPosition:=1) ucrBase.clsRsyntax.SetBaseRFunction(clsImportCSV) grpCSV.Text = "Import CSV Options" grpCSV.Location = New System.Drawing.Point(9, 50) 'set the location of the groupbox to adjust gaps in the form UI @@ -891,9 +889,9 @@ Public Class dlgImportDataset ElseIf strFileType = "TXT" Then 'for separator we use the function used for csv If rdoSeparatortext.Checked Then - clsImportCSV.AddParameter("na.strings", GetMissingValueRString(ucrInputMissingValueStringCSV.GetText())) + clsImportCSV.AddParameter("na.strings", GetMissingValueRString(ucrInputMissingValueStringCSV.GetText()), iPosition:=2) Else - clsImportFixedWidthText.AddParameter("na", GetMissingValueRString(ucrInputMissingValueStringText.GetText())) + clsImportFixedWidthText.AddParameter("na", GetMissingValueRString(ucrInputMissingValueStringText.GetText()), iPosition:=2) End If End If RefreshFrameView() From 0c23735c216160be00abbb6829853b8847ad282c Mon Sep 17 00:00:00 2001 From: Danny Parsons Date: Tue, 27 Oct 2020 21:30:13 +0000 Subject: [PATCH 079/102] revert to 0.6.2 download --- docs/Download.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Download.html b/docs/Download.html index 5ee67399179..65a727250ba 100644 --- a/docs/Download.html +++ b/docs/Download.html @@ -79,7 +79,7 @@

Download R-Instat


-

R-Instat 0.6.3 Installer (.exe 550MB)

+

R-Instat 0.6.2 Installer (.exe 483MB)

R-Instat is currently a Windows only application. However, it can be accessed on Mac or Linux through use of a Virtual Windows Machine.

Installation & Documentation

From 1e93a253022101a57f933d742405132e2d4aacd4 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 28 Oct 2020 08:42:45 +0300 Subject: [PATCH 080/102] changed default position of the nlogical column --- instat/dlgFindNonnumericValues.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instat/dlgFindNonnumericValues.vb b/instat/dlgFindNonnumericValues.vb index 1dc2d7d9f7d..42505b37233 100644 --- a/instat/dlgFindNonnumericValues.vb +++ b/instat/dlgFindNonnumericValues.vb @@ -52,6 +52,8 @@ Public Class dlgFindNonnumericValues ucrReceiverColumn.bWithQuotes = False ucrReceiverColumn.SetIncludedDataTypes({"character"}) ucrReceiverColumn.strSelectorHeading = "characters" + 'makes the ucrSave control to position new column after selected column + ucrSaveColumn.setLinkedReceiver(ucrReceiverColumn) 'save control ucrSaveColumn.SetPrefix("nonum") From afe40241c0a9ee36fef88feede6a2034ee845090 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 28 Oct 2020 09:35:37 +0300 Subject: [PATCH 081/102] parameter postion addition --- instat/dlgImportDataset.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgImportDataset.vb b/instat/dlgImportDataset.vb index 3d1c145d5f9..7c2f970c869 100644 --- a/instat/dlgImportDataset.vb +++ b/instat/dlgImportDataset.vb @@ -885,7 +885,7 @@ Public Class dlgImportDataset clsImportExcelMulti.AddParameter("na", GetMissingValueRString(ucrInputMissingValueStringExcel.GetText())) clsImportExcel.AddParameter("na", GetMissingValueRString(ucrInputMissingValueStringExcel.GetText())) ElseIf strFileType = "CSV" Then - clsImportCSV.AddParameter("na.strings", GetMissingValueRString(ucrInputMissingValueStringCSV.GetText())) + clsImportCSV.AddParameter("na.strings", GetMissingValueRString(ucrInputMissingValueStringCSV.GetText()), iPosition:=2) ElseIf strFileType = "TXT" Then 'for separator we use the function used for csv If rdoSeparatortext.Checked Then From 1f08c85aee26bf1ffb86cb97a3f89c91c1867ce2 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Wed, 28 Oct 2020 10:53:44 +0300 Subject: [PATCH 082/102] Replaced factor with forcats::as_factor in example 6 --- instat/dlgEnter.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgEnter.vb b/instat/dlgEnter.vb index 4190b98b2ea..76a3f3cacc0 100644 --- a/instat/dlgEnter.vb +++ b/instat/dlgEnter.vb @@ -250,7 +250,7 @@ Public Class dlgEnter lstView.Items.Add(New ListViewItem({"forcats::as_factor(rep(LETTERS[4:1], c(4, 3, 1, 1)))"})) lstView.Items.Item(4).ToolTipText = "Gives D, D, D, D, C, C, C, B, A as a factor." - lstView.Items.Add(New ListViewItem({"factor(rep(c(month.abb[4:7], NA), c(2, 1, 2, 1, 3)))"})) + lstView.Items.Add(New ListViewItem({"forcats::as_factor(rep(c(month.abb[4:7], NA), c(2, 1, 2, 1, 3)))"})) lstView.Items.Item(5).ToolTipText = "Gives Apr, Apr, May, Jun, Jun, Jul, NA, NA, NA." lstView.Items.Add(New ListViewItem({"c(1:4, 10, rep(15, 3), 20)"})) From ffc7170f3f75d1830b91a630583aabb918ca3095 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 28 Oct 2020 12:11:37 +0300 Subject: [PATCH 083/102] more code additions. --- instat/clsRCodeStructure.vb | 11 +------ instat/static/InstatObject/R/data_object_R6.R | 31 +++++++++++-------- instat/ucrSave.vb | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/instat/clsRCodeStructure.vb b/instat/clsRCodeStructure.vb index 953934aa03b..373b4eab55d 100644 --- a/instat/clsRCodeStructure.vb +++ b/instat/clsRCodeStructure.vb @@ -411,18 +411,9 @@ Public Class RCodeStructure End If End If + clsAddColumns.AddParameter("before", If(bInsertColumnBefore, "TRUE", "FALSE")) If Not String.IsNullOrEmpty(strAdjacentColumn) Then - clsAddColumns.AddParameter("before", If(bInsertColumnBefore, "TRUE", "FALSE")) clsAddColumns.AddParameter("adjacent_column", strAdjacentColumn) - Else - If bInsertColumnBefore Then - clsAddColumns.AddParameter("before", "TRUE") - Else - If frmMain.clsInstatOptions.bIncludeRDefaultParameters Then - clsAddColumns.AddParameter("before", "FALSE") - End If - - End If End If If Not bRequireCorrectLength Then clsAddColumns.AddParameter("require_correct_length", "FALSE") diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 76068bca444..eb6b2045ddf 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -493,7 +493,7 @@ DataSheet$set("public", "get_calculation_names", function(as_list = FALSE, exclu } ) -DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, use_col_name_as_prefix = FALSE, hidden = FALSE, before = FALSE, adjacent_column, num_cols, require_correct_length = TRUE) { +DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, use_col_name_as_prefix = FALSE, hidden = FALSE, before, adjacent_column, num_cols, require_correct_length = TRUE) { # Column name must be character if(!is.character(col_name)) stop("Column name must be of type: character") if(missing(num_cols)) { @@ -532,16 +532,7 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, replaced = FALSE previous_length = self$get_column_count() if(!missing(adjacent_column) && !adjacent_column %in% self$get_column_names()) stop(adjacent_column, "not found in the data") - - if(before) { - if(!missing(adjacent_column)) ind = which(self$get_column_names() == adjacent_column) - else ind = 1 - } - else { - if(!missing(adjacent_column)) ind = which(self$get_column_names() == adjacent_column) + 1 - else ind = previous_length + 1 - } - + new_col_names <- c() for(i in 1:num_cols) { if(num_cols == 1) { @@ -568,10 +559,23 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, } self$add_defaults_variables_metadata(new_col_names) if(!replaced) { + #if before and adjacent_column are missing then by default make before be false. This will make the new column be at the end. + if(missing(before) && missing(adjacent_column)) return() + #get the adjacent position to be used in appending the new column names + if(before){ + if(!missing(adjacent_column)) ind = which(self$get_column_names() == adjacent_column) + else ind = 1 + }else{ + if(!missing(adjacent_column)) ind = which(self$get_column_names() == adjacent_column) + 1 + else ind = previous_length + 1 + } + #reorder the columns .todo. this could be changed to use the reorder function if(before && ind == 1) self$set_data(dplyr::select(self$get_data_frame(use_current_filter = FALSE) , c((previous_length + 1):(previous_length + num_cols), 1:previous_length))) else if(before || ind != previous_length + 1) self$set_data(dplyr::select(self$get_data_frame(use_current_filter = FALSE) , c(1:(ind - 1), (previous_length + 1):(previous_length + num_cols), ind:previous_length))) }else { - #get the adjacent position to be used in appending the new column names + #if both before and adjacent_column are missing, no need to reorder existing columns + if(missing(before) && missing(adjacent_column)) return() + #get the adjacent position to be used in appending the new column names if(before) { if(missing(adjacent_column)) adjacent_position = 0 else adjacent_position = which(self$get_column_names() == adjacent_column) - 1 @@ -579,6 +583,7 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, if(missing(adjacent_column)) adjacent_position = self$get_column_count() else adjacent_position = which(self$get_column_names() == adjacent_column) } + #replace existing names with empty placeholders. Maintains the indices. temp_all_col_names <- replace(self$get_column_names(), self$get_column_names() %in% new_col_names, "" ) #append the newly added column names after the set position @@ -586,7 +591,7 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, #remove all empty characters placeholders to get final reordered column names new_col_names_order <- new_col_names_order[! new_col_names_order %in% c("")] #only do reordering if the column names order differ - if(!all( self$get_column_names() == new_col_names_order) ) self$reorder_columns_in_data(col_order=new_col_names_order) + if( !all( self$get_column_names() == new_col_names_order) ) self$reorder_columns_in_data(col_order=new_col_names_order) } } ) diff --git a/instat/ucrSave.vb b/instat/ucrSave.vb index 9bc89eec86b..bf3c6afefa9 100644 --- a/instat/ucrSave.vb +++ b/instat/ucrSave.vb @@ -882,7 +882,7 @@ Public Class ucrSave ''' Updates the control's R command's column position variables. ''' These variables specify the position of the new column in the data frame ''' (start, end or before/after a specified column). - ''' This subroutine is called automatically when the receiver (specifying a column name) linked to + ''' This subroutine is called automatically when the receiver (specifying a column name) linked to clsColPosFunction ''' this control changes. ''' If the save object is not a column then this function does nothing. ''' If the user has selected a column in the linked receiver, then sets the From 3f359cde63d6c4e7bea87ae9761e362243ec2dc5 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 28 Oct 2020 13:03:25 +0300 Subject: [PATCH 084/102] solved the serious bug --- instat/clsRCodeStructure.vb | 1 - instat/static/InstatObject/R/data_object_R6.R | 56 +++++++------------ 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/instat/clsRCodeStructure.vb b/instat/clsRCodeStructure.vb index 373b4eab55d..b868bbae978 100644 --- a/instat/clsRCodeStructure.vb +++ b/instat/clsRCodeStructure.vb @@ -410,7 +410,6 @@ Public Class RCodeStructure clsAddColumns.AddParameter("use_col_name_as_prefix", "FALSE") End If End If - clsAddColumns.AddParameter("before", If(bInsertColumnBefore, "TRUE", "FALSE")) If Not String.IsNullOrEmpty(strAdjacentColumn) Then clsAddColumns.AddParameter("adjacent_column", strAdjacentColumn) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index eb6b2045ddf..8822dad863c 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -558,41 +558,27 @@ DataSheet$set("public", "add_columns_to_data", function(col_name = "", col_data, self$data_changed <- TRUE } self$add_defaults_variables_metadata(new_col_names) - if(!replaced) { - #if before and adjacent_column are missing then by default make before be false. This will make the new column be at the end. - if(missing(before) && missing(adjacent_column)) return() - #get the adjacent position to be used in appending the new column names - if(before){ - if(!missing(adjacent_column)) ind = which(self$get_column_names() == adjacent_column) - else ind = 1 - }else{ - if(!missing(adjacent_column)) ind = which(self$get_column_names() == adjacent_column) + 1 - else ind = previous_length + 1 - } - #reorder the columns .todo. this could be changed to use the reorder function - if(before && ind == 1) self$set_data(dplyr::select(self$get_data_frame(use_current_filter = FALSE) , c((previous_length + 1):(previous_length + num_cols), 1:previous_length))) - else if(before || ind != previous_length + 1) self$set_data(dplyr::select(self$get_data_frame(use_current_filter = FALSE) , c(1:(ind - 1), (previous_length + 1):(previous_length + num_cols), ind:previous_length))) - }else { - #if both before and adjacent_column are missing, no need to reorder existing columns - if(missing(before) && missing(adjacent_column)) return() - #get the adjacent position to be used in appending the new column names - if(before) { - if(missing(adjacent_column)) adjacent_position = 0 - else adjacent_position = which(self$get_column_names() == adjacent_column) - 1 - }else{ - if(missing(adjacent_column)) adjacent_position = self$get_column_count() - else adjacent_position = which(self$get_column_names() == adjacent_column) - } - - #replace existing names with empty placeholders. Maintains the indices. - temp_all_col_names <- replace(self$get_column_names(), self$get_column_names() %in% new_col_names, "" ) - #append the newly added column names after the set position - new_col_names_order <- append(temp_all_col_names, new_col_names, adjacent_position) - #remove all empty characters placeholders to get final reordered column names - new_col_names_order <- new_col_names_order[! new_col_names_order %in% c("")] - #only do reordering if the column names order differ - if( !all( self$get_column_names() == new_col_names_order) ) self$reorder_columns_in_data(col_order=new_col_names_order) - } + + #no need to reorder columns if before and adjacent_column column positioning paramaters are missing + if(missing(before) && missing(adjacent_column)) return() + + #get the adjacent position to be used in appending the new column names + if(before){ + if(missing(adjacent_column)) adjacent_position = 0 + else adjacent_position = which(self$get_column_names() == adjacent_column) - 1 + }else{ + if(missing(adjacent_column)) adjacent_position = self$get_column_count() + else adjacent_position = which(self$get_column_names() == adjacent_column) + } + + #replace existing names with empty placeholders. Maintains the indices + temp_all_col_names <- replace(self$get_column_names(), self$get_column_names() %in% new_col_names, "") + #append the newly added column names after the set position + new_col_names_order <- append(temp_all_col_names, new_col_names, adjacent_position) + #remove all empty characters placeholders to get final reordered column names + new_col_names_order <- new_col_names_order[! new_col_names_order %in% c("")] + #only do reordering if the column names order differ + if( !all( self$get_column_names() == new_col_names_order) ) self$reorder_columns_in_data(col_order=new_col_names_order) } ) From 730997a94301536b42d80a7cd7d59b1a282518cd Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 28 Oct 2020 15:13:21 +0300 Subject: [PATCH 085/102] solved the ColumnCount bug --- instat/clsGridLink.vb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instat/clsGridLink.vb b/instat/clsGridLink.vb index 19794e608db..bc25975381a 100644 --- a/instat/clsGridLink.vb +++ b/instat/clsGridLink.vb @@ -458,7 +458,9 @@ Public Class clsGridLink End If Next Else - For k = 0 To lstColumnNames.Count - 1 + 'worksheet columns could be less than than the data frame columns, + 'so use worksheet ColumnCount + For k = 0 To fillWorkSheet.ColumnCount - 1 fillWorkSheet.ColumnHeaders(k).Text = lstColumnNames(k) Next End If From bba16553e4c7ec2a0294b3485c01d95d332c2a33 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Thu, 29 Oct 2020 11:29:13 +0300 Subject: [PATCH 086/102] Adding a check for missing date gaps --- instat/static/InstatObject/R/data_object_R6.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 36b9a662aaa..76d70e0e066 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3633,14 +3633,22 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va if (missing(var)) stop("var is missing with no default") if (missing(vars)) stop("vars is missing with no default") date_col <- self$get_columns_from_data(date_col_name, use_current_filter = FALSE) + min_date <- min(date_col) + max_date <- max(date_col) + full_date_range <- seq(from = min_date, to = max_date, by = "day") if (!lubridate::is.Date(date_col)) stop("This column must be a date or time!") curr_data <- self$get_data_frame(use_current_filter = FALSE) if (!missing(station_col_name)) { station_col <- self$get_columns_from_data(station_col_name, use_current_filter = FALSE) station_names <- unique(station_col) list_out <- list() + date_lengths <- NULL for (i in seq_along(station_names)) { temp_data <- curr_data[station_col == station_names[i], ] + min_date <- min(temp_data[, date_col_name]) + max_date <- max(temp_data[, date_col_name]) + full_date_range <- seq(from = min_date, to = max_date, by = "day") + date_lengths[i] <- length(full_date_range) var_col <- temp_data[, var] date_col <- temp_data[, date_col_name] Year <- lubridate::year(date_col) @@ -3658,7 +3666,9 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va list_out[[i]] <- out[[1]][, var] print(out[[2]]) } + gaps <- sum(date_lengths) - dim(curr_data)[[1]] } else { + gaps <- length(full_date_range) - length(date_col) var_col <- self$get_columns_from_data(var, use_current_filter = FALSE) Year <- lubridate::year(date_col) Month <- lubridate::month(date_col) @@ -3672,6 +3682,9 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va colnames(patch_weather[[i]])[4] <- var } } + if (gaps != 0) { + stop(gaps, " rows for date gaps are missing, fill date gaps before proceeding.") + } if (!missing(station_col_name)) { col <- unlist(list_out) } From be1f70e6dcd3775e2a3f029551391e56753c9f54 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Thu, 29 Oct 2020 14:44:13 +0300 Subject: [PATCH 087/102] made recent files to display when recent files have loaded optimised the clsRecentFiles, removed unnecessary calls of refreshing displayed recent files --- instat/clsRecentFiles.vb | 331 +++++++++++++++++++++------------------ instat/frmMain.vb | 7 +- instat/ucrDataView.vb | 7 + 3 files changed, 188 insertions(+), 157 deletions(-) diff --git a/instat/clsRecentFiles.vb b/instat/clsRecentFiles.vb index fe11885ed6e..0171ccd264c 100644 --- a/instat/clsRecentFiles.vb +++ b/instat/clsRecentFiles.vb @@ -16,7 +16,7 @@ Imports System.IO Public Class clsRecentFiles - Public mnuItems As New List(Of Form) + Public lstRecentDialogs As New List(Of Form) Private strRecentFilesPath As String Private mnuTbShowLast10 As ToolStripDropDownItem Private mnuFile As ToolStripMenuItem @@ -24,7 +24,7 @@ Public Class clsRecentFiles Private sepStart As ToolStripSeparator Private sepEnd As ToolStripSeparator ' declare a variable to contain the most recent opened items - Private strListMRU As New List(Of String) + Private lstRecentOpenedFiles As New List(Of String) ''' ''' stores reference to the the data view window used in frmMain. @@ -32,6 +32,10 @@ Public Class clsRecentFiles ''' Private ucrDataViewWindow As ucrDataView + Public Sub New(strAppDataPath As String) + strRecentFilesPath = Path.Combine(strAppDataPath, "recent.mru") + End Sub + Public Sub setToolStripItems(dfMnuFile As ToolStripMenuItem, dfMnuFileIcon As ToolStripSplitButton, dfMnuToolStripDropdown As ToolStripDropDownItem, dfSepStart As ToolStripSeparator, dfSepEnd As ToolStripSeparator) mnuFile = dfMnuFile mnuFileIcon = dfMnuFileIcon @@ -46,177 +50,196 @@ Public Class clsRecentFiles Me.ucrDataViewWindow = ucrDataViewWindow End Sub + ''' + ''' loads the list of last saved recent opened files + ''' Public Sub checkOnLoad() - 'Checks for the existence of the file on form load - ' load recently opened files - strRecentFilesPath = Path.Combine(frmMain.strAppDataPath, "recent.mru") - If (File.Exists(strRecentFilesPath)) Then - ' read file - Dim sPaths() As String = File.ReadAllLines(strRecentFilesPath) - For Each sPath As String In sPaths - If Not String.IsNullOrEmpty(sPath) Then - ' Disabled this so that you can still see files that don't exist in the list - ' only add files that still exist... - 'If File.Exists(sPath) Then - ' ' add to the list of recently opened files - ' strListMRU.Add(sPath) - 'End If - strListMRU.Add(sPath) - End If - Next + 'checks for the existence of the file path + If Not File.Exists(strRecentFilesPath) Then + Exit Sub End If - ' display the recently opened files if there are any items to display in the file - UpdateItemsMenu() + + 'read file contents + Dim arrStrPaths() As String = File.ReadAllLines(strRecentFilesPath) + For Each strPath As String In arrStrPaths + If Not String.IsNullOrEmpty(strPath) Then + ' Disabled this so that you can still see files that don't exist in the list + ' only add files that still exist... + 'If File.Exists(sPath) Then + ' ' add to the list of recently opened files + ' strListMRU.Add(sPath) + 'End If + lstRecentOpenedFiles.Add(strPath) + End If + Next + 'display the recently opened files if there are any items to display in the file + UpdateRecentFilesMenuItems() End Sub + ''' + ''' saves the list of recent opened files on form close + ''' Public Sub saveOnClose() - Dim sPath As String - - strRecentFilesPath = Path.Combine(frmMain.strAppDataPath, "recent.mru") - 'saves the list of opened files on form close - ' save MRU - delete existing files first + 'overwite any existing contents of the file File.WriteAllText(strRecentFilesPath, "") - 'Write each item to the file... - For Each sPath In strListMRU - File.AppendAllText(strRecentFilesPath, sPath & Environment.NewLine) + 'write each item to the file... + For Each strPath As String In lstRecentOpenedFiles + File.AppendAllText(strRecentFilesPath, strPath & Environment.NewLine) Next End Sub - Public Sub addToMenu(ByVal tempObj As Object) - Dim dialog As Form 'store reccently opened dialogs - Dim path As String 'to store recently opened files - If TypeOf (tempObj) Is Form AndAlso mnuItems IsNot Nothing Then - dialog = tempObj + ''' + ''' adds the form or file path passed object to menu items + ''' + ''' accepts objects of type Form or File Path + Public Sub addToMenu(formOrFilePathObj As Object) + If TypeOf formOrFilePathObj Is Form Then + Dim frmDialog As Form = DirectCast(formOrFilePathObj, Form) 'Checks for existance, else add it to the beginning - If mnuItems.Contains(dialog) Then mnuItems.Remove(dialog) + If lstRecentDialogs.Contains(frmDialog) Then lstRecentDialogs.Remove(frmDialog) 'adds to the list - mnuItems.Add(dialog) - 'checks that only 1o items are allowed - While mnuItems.Count > 10 - mnuItems.RemoveAt(0) - End While + lstRecentDialogs.Add(frmDialog) + 'checks that only 10 items are allowed + If lstRecentDialogs.Count > 10 Then + lstRecentDialogs.RemoveAt(0) + End If + 'update recent dialogs menu items + UpdateRecentDialogsMenuItems() Else - path = tempObj - If strListMRU.Contains(path) Then strListMRU.Remove(path) - ' add to MRU list.. - strListMRU.Add(path) + Dim strFilePath As String = formOrFilePathObj + 'remove file if it exists(helps with making sure displayed file names are rearranged) + lstRecentOpenedFiles.Remove(strFilePath) + 'add to recent opened files list.. + lstRecentOpenedFiles.Add(strFilePath) 'make sure there are only ever 30 items... 'todo. add this to the general options on the number of recently files to show - While strListMRU.Count > 30 - strListMRU.RemoveAt(0) + While lstRecentOpenedFiles.Count > 30 + lstRecentOpenedFiles.RemoveAt(0) End While + 'update recent files menu items + UpdateRecentFilesMenuItems() End If + End Sub - 'updates the interfaces - UpdateItemsMenu() + ''' + ''' updates the menu toolstrip to show the last 10 opened dialogs + ''' + Public Sub UpdateRecentDialogsMenuItems() + 'exit sub if last 10 toolstrip or list of last 10 dialogs are not initialised + If mnuTbShowLast10 Is Nothing Then + Exit Sub + End If + 'remove the menu items of recent opened dialogs + For i As Integer = mnuTbShowLast10.DropDownItems.Count - 1 To 0 Step -1 + If mnuTbShowLast10.DropDownItems(i).Tag IsNot Nothing AndAlso mnuTbShowLast10.DropDownItems(i).Tag.ToString().StartsWith("Last") Then + mnuTbShowLast10.DropDownItems.RemoveAt(i) + End If + Next + + 'the add and displays menu items (_in reverse order) for dialogs + For icounter As Integer = lstRecentDialogs.Count - 1 To 0 Step -1 + 'creates new toolstripitem, displaying name of the dialog + Dim clsItem As New ToolStripMenuItem(lstRecentDialogs(icounter).Text) + 'sets the tag + clsItem.Tag = "Last" + AddHandler clsItem.Click, AddressOf OnMnuLastRecentDialog_Click + 'insert into the dropdownitems + 'mnuTbShowLast10.DropDownItems.Insert(mnuTbShowLast10.DropDownItems.Count - 1, clsItem) + mnuTbShowLast10.DropDownItems.Add(clsItem) + Next End Sub - Private Sub UpdateItemsMenu() - 'clears the menu items first - Dim clsItems As New List(Of ToolStripItem) - If mnuTbShowLast10 IsNot Nothing AndAlso mnuFile IsNot Nothing AndAlso mnuFileIcon IsNot Nothing AndAlso clsItems IsNot Nothing AndAlso mnuItems IsNot Nothing AndAlso strListMRU IsNot Nothing Then - 'temp collection for recent dialogs - For Each clsMenu As ToolStripItem In mnuTbShowLast10.DropDownItems - If Not clsMenu.Tag Is Nothing Then - If (clsMenu.Tag.ToString().StartsWith("Last")) Then - clsItems.Add(clsMenu) - End If - End If - Next - 'temp collection for recent files - For Each clsMenu As ToolStripItem In mnuFile.DropDownItems - If Not clsMenu.Tag Is Nothing Then - If (clsMenu.Tag.ToString().StartsWith("MRU:")) Then - clsItems.Add(clsMenu) - End If - End If - Next - 'temp collection for recent files - For Each clsMenu As ToolStripItem In mnuFileIcon.DropDownItems - If Not clsMenu.Tag Is Nothing Then - If (clsMenu.Tag.ToString().StartsWith("MRU:")) Then - clsItems.Add(clsMenu) - End If - End If - Next - 'go through the list and remove each from the menu - For Each clsMenu As ToolStripItem In clsItems - mnuTbShowLast10.DropDownItems.Remove(clsMenu) - mnuFile.DropDownItems.Remove(clsMenu) - mnuFileIcon.DropDownItems.Remove(clsMenu) - Next + ''' + ''' updates menu toolstrip and ucrDataView to show the recent files opened + ''' + Public Sub UpdateRecentFilesMenuItems() + 'exit sub if file toolstrip or file icon toolstrip are not initialised + If mnuFile Is Nothing OrElse mnuFileIcon Is Nothing Then + Exit Sub + End If - 'displays items (_in reverse order) for dialogs - For icounter As Integer = mnuItems.Count - 1 To 0 Step -1 - Dim dialog As Form = mnuItems(icounter) - 'creates new toolstripitem, displaying name of the dialog - Dim clsItem As New ToolStripMenuItem(dialog.Text) - 'sets the tag - clsItem.Tag = "Last" - AddHandler clsItem.Click, AddressOf mnuFile_Click - 'insert into the dropdownitems - mnuTbShowLast10.DropDownItems.Insert(mnuTbShowLast10.DropDownItems.Count - 1, clsItem) - Next + Dim strPath As String + Dim strFileName As String - 'remove all the data view window recent file menu items - ucrDataViewWindow.ClearRecentFileMenuItems() + 'remove all displaced recent files from the menu items + For i As Integer = mnuFile.DropDownItems.Count - 1 To 0 Step -1 + If mnuFile.DropDownItems(i).Tag IsNot Nothing AndAlso mnuFile.DropDownItems(i).Tag.ToString().StartsWith("MRU:") Then + mnuFile.DropDownItems.RemoveAt(i) + End If + Next + + For i As Integer = mnuFileIcon.DropDownItems.Count - 1 To 0 Step -1 + If mnuFileIcon.DropDownItems(i).Tag IsNot Nothing AndAlso mnuFileIcon.DropDownItems(i).Tag.ToString().StartsWith("MRU:") Then + mnuFileIcon.DropDownItems.RemoveAt(i) + End If + Next - 'then displays items (_in reverse order) for recent files - Dim strPath As String - Dim strFileName As String - For iCounter As Integer = strListMRU.Count - 1 To 0 Step -1 - strPath = strListMRU(iCounter) - Try - strFileName = Path.GetFileName(strPath) - ' create new ToolStripItem, displaying the name of the file... - Dim clsItem As New ToolStripMenuItem(strFileName) - Dim clsItemIcon As New ToolStripMenuItem(strFileName) - clsItem.ToolTipText = strPath - clsItemIcon.ToolTipText = strPath - ' set the tag - identifies the ToolStripItem as an MRU item and - ' contains the full path so it can be opened later... - clsItem.Tag = "MRU:" & strPath - clsItemIcon.Tag = "MRU:" & strPath - ' hook into the click event handler so we can open the file later... - AddHandler clsItem.Click, AddressOf mnuFileMRU_Click - AddHandler clsItemIcon.Click, AddressOf mnuFileMRU_Click - ' insert into DropDownItems list... - mnuFile.DropDownItems.Insert(mnuFile.DropDownItems.Count - 1, clsItem) - mnuFileIcon.DropDownItems.Insert(mnuFileIcon.DropDownItems.Count, clsItemIcon) + 'remove all the data view window recent file menu items + ucrDataViewWindow.ClearRecentFileMenuItems() - 'set and insert the data view window recent files menu items - Dim linkMenuItem As New LinkLabel - linkMenuItem.Text = strFileName - linkMenuItem.Tag = strPath 'path used when the link is clicked + 'then add and displays items (_in reverse order) for recent files + For iCounter As Integer = lstRecentOpenedFiles.Count - 1 To 0 Step -1 + Try + strPath = lstRecentOpenedFiles(iCounter) + strFileName = Path.GetFileName(strPath) + ' create new ToolStripItem, displaying the name of the file... + Dim clsItem As New ToolStripMenuItem(strFileName) + Dim clsItemIcon As New ToolStripMenuItem(strFileName) + clsItem.ToolTipText = strPath + clsItemIcon.ToolTipText = strPath + ' set the tag - will be used to identify the ToolStripItem as an most recent(MRU) item + ' and contains the full path so it can be opened later + clsItem.Tag = "MRU:" & strPath + clsItemIcon.Tag = "MRU:" & strPath + ' hook into the click event handler so we can open the file later... + AddHandler clsItem.Click, AddressOf OnMnuRecentOpenedFile_Click + AddHandler clsItemIcon.Click, AddressOf OnMnuRecentOpenedFile_Click + ' insert into DropDownItems list... + mnuFile.DropDownItems.Insert(mnuFile.DropDownItems.Count - 1, clsItem) + mnuFileIcon.DropDownItems.Insert(mnuFileIcon.DropDownItems.Count, clsItemIcon) - ucrDataViewWindow.InsertRecentFileMenuItems(linkMenuItem) + 'set and insert the data view window recent files menu items + Dim linkMenuItem As New LinkLabel + linkMenuItem.Text = strFileName + linkMenuItem.Tag = strPath 'path used when the link is clicked - 'attach link click event handler for opening the file - AddHandler linkMenuItem.Click, AddressOf mnuFileMRU_Click + ucrDataViewWindow.InsertRecentFileMenuItems(linkMenuItem) - 'if recent files are more than 5 then just the "more" link label and exit loop - If strListMRU.Count - iCounter > 4 Then - linkMenuItem = New LinkLabel - linkMenuItem.Text = "More ..." - linkMenuItem.Tag = "" - ucrDataViewWindow.InsertRecentFileMenuItems(linkMenuItem) - AddHandler linkMenuItem.Click, AddressOf mnuFileMRU_Click - Exit For - End If - Catch ex As Exception - 'TODO it would be good to remove the invalid line from the file in this case - End Try - Next + 'attach link click event handler for opening the file + AddHandler linkMenuItem.Click, AddressOf OnMnuRecentOpenedFile_Click - ' show separator - 'frmMain.sepEndMRU.Visible = True + 'if recent files are more than 5 then just the "more" link label and exit loop + If lstRecentOpenedFiles.Count - iCounter >= 5 Then + linkMenuItem = New LinkLabel + linkMenuItem.Text = "More ..." + linkMenuItem.Tag = "" + ucrDataViewWindow.InsertRecentFileMenuItems(linkMenuItem) + AddHandler linkMenuItem.Click, AddressOf OnMnuRecentOpenedFile_Click + Exit For + End If + Catch ex As Exception + 'TODO it would be good to remove the invalid line from the file in this case + End Try + Next + + 'show separator + If lstRecentOpenedFiles.Count > 0 Then sepStart.Visible = True sepEnd.Visible = True + Else + sepStart.Visible = False + sepEnd.Visible = False End If + End Sub - Private Sub mnuFileMRU_Click(ByVal sender As Object, ByVal e As EventArgs) + ''' + ''' raised when menu item of recent opened file is clicked + ''' + ''' ToolStripItem or LinkLabel only + ''' + Private Sub OnMnuRecentOpenedFile_Click(ByVal sender As Object, ByVal e As EventArgs) Dim strFilePath As String = "" If TypeOf sender Is ToolStripItem Then @@ -231,26 +254,26 @@ Public Class clsRecentFiles End If If File.Exists(strFilePath) Then - 'dlgImportDataset.SetFilePath(DirectCast(sender, ToolStripItem).Tag.ToString().Substring(4)) - 'dlgImportDataset.SetDataName(Path.GetFileNameWithoutExtension(sender.ToString)) - 'Not working as I would like because of the changes made to the Import Dataset dlgImportDataset.strFileToOpenOn = strFilePath dlgImportDataset.ShowDialog() Else 'removes the path to the non existent file If DialogResult.Yes = MessageBox.Show(frmMain, "File not accessible. It may have been renamed, moved or deleted." & Environment.NewLine & Environment.NewLine & "Would you like to remove this file from the list?", "Cannot access file", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) Then - strListMRU.RemoveAt(strListMRU.FindLastIndex(Function(value As String) - Return value.Contains(sender.ToString) - End Function)) - 'updates the interfaces - UpdateItemsMenu() + lstRecentOpenedFiles.Remove(strFilePath) + 'update recent file menu items controls to not show the file name and path + UpdateRecentFilesMenuItems() End If End If End Sub - Private Sub mnuFile_Click(ByVal sender As Object, ByVal e As EventArgs) - For Each dfTemp As Form In mnuItems - If dfTemp.Text = sender.ToString Then + ''' + ''' raised when last dialog menu item is clicked + ''' + ''' ToolStripMenuItem + ''' + Private Sub OnMnuLastRecentDialog_Click(ByVal sender As Object, ByVal e As EventArgs) + For Each dfTemp As Form In lstRecentDialogs + If dfTemp.Text = DirectCast(sender, ToolStripMenuItem).Text Then dfTemp.ShowDialog() Exit Sub End If @@ -265,8 +288,8 @@ Public Class clsRecentFiles ucrDataViewWindow.ClearRecentFileMenuItems() 'displays items (_in reverse order) for recent files Dim strPath As String - For iCounter As Integer = strListMRU.Count - 1 To 0 Step -1 - strPath = strListMRU(iCounter) + For iCounter As Integer = lstRecentOpenedFiles.Count - 1 To 0 Step -1 + strPath = lstRecentOpenedFiles(iCounter) Try Dim linkMenuItem As New LinkLabel linkMenuItem.Text = Path.GetFileName(strPath) @@ -275,7 +298,7 @@ Public Class clsRecentFiles ucrDataViewWindow.InsertRecentFileMenuItems(linkMenuItem) 'attach link event handler for opening the file - AddHandler linkMenuItem.Click, AddressOf mnuFileMRU_Click + AddHandler linkMenuItem.Click, AddressOf OnMnuRecentOpenedFile_Click Catch ex As Exception 'TODO it would be good to remove the invalid line from the file in this case End Try diff --git a/instat/frmMain.vb b/instat/frmMain.vb index a8dd518d3db..b11b8fd9746 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -30,7 +30,7 @@ Public Class frmMain Public strAppDataPath As String Public strInstatOptionsFile As String = "Options.bin" Public clsInstatOptions As InstatOptions - Public clsRecentItems As New clsRecentFiles + Public clsRecentItems As clsRecentFiles Public strCurrentDataFrame As String Public dlgLastDialog As Form Public strSaveFilePath As String = "" @@ -121,6 +121,7 @@ Public Class frmMain AddHandler System.Windows.Forms.Application.Idle, AddressOf Application_Idle 'Sets up the Recent items + clsRecentItems = New clsRecentFiles(strAppDataPath) clsRecentItems.setToolStripItems(mnuFile, mnuTbOpen, mnuTbLast10Dialogs, sepStart, sepEnd) clsRecentItems.SetDataViewWindow(ucrDataViewer) 'checks existence of MRU list @@ -511,8 +512,8 @@ Public Class frmMain End Sub Private Sub EditLastDialogueToolStrip_Click(sender As Object, e As EventArgs) Handles mnuTbEditLastDialog.Click - If clsRecentItems.mnuItems.Count > 0 Then - clsRecentItems.mnuItems.Last.ShowDialog() + If clsRecentItems.lstRecentDialogs.Count > 0 Then + clsRecentItems.lstRecentDialogs.Last.ShowDialog() End If End Sub diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index d9306920b9d..fb6a5b7ce52 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -55,6 +55,7 @@ Public Class ucrDataView grdData.SetSettings(unvell.ReoGrid.WorksheetSettings.Edit_AutoFormatCell, False) grdData.SheetTabWidth = 450 SetRFunctions() + HideOrShowRecentPanel() End Sub 'Protected Overrides Sub OnFormClosing(ByVal e As FormClosingEventArgs) @@ -887,6 +888,7 @@ Public Class ucrDataView ''' Public Sub ClearRecentFileMenuItems() panelRecentMenuItems.Controls.Clear() + HideOrShowRecentPanel() End Sub ''' @@ -919,6 +921,11 @@ Public Class ucrDataView lblMenuItemPath.Height = 13 lblMenuItemPath.AutoSize = True panelRecentMenuItems.Controls.Add(lblMenuItemPath) + HideOrShowRecentPanel() + End Sub + + Private Sub HideOrShowRecentPanel() + lblRecent.Visible = panelRecentMenuItems.Controls.Count > 0 End Sub Private Sub linkHelpIntroduction_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkHelpIntroduction.LinkClicked From cf770b567096e8b6caec788d1779b1df32cc8a11 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 30 Oct 2020 11:14:48 +0300 Subject: [PATCH 088/102] removed exclusion of numeric data types --- instat/dlgColumnStats.vb | 2 -- 1 file changed, 2 deletions(-) diff --git a/instat/dlgColumnStats.vb b/instat/dlgColumnStats.vb index 40d4ac03bfd..9e9d0ff5d1b 100644 --- a/instat/dlgColumnStats.vb +++ b/instat/dlgColumnStats.vb @@ -59,8 +59,6 @@ Public Class dlgColumnStats ucrReceiverByFactor.SetParameter(New RParameter("factors", 2)) ucrReceiverByFactor.Selector = ucrSelectorForColumnStatistics - ucrReceiverByFactor.SetExcludedDataTypes({"numeric"}) - ucrReceiverByFactor.strSelectorHeading = "Non-numeric(s)" ucrReceiverByFactor.SetParameterIsString() ucrChkStoreResults.SetParameter(New RParameter("store_results", 3)) From ad584a816d57b61d7c46f99c351daad610e550e8 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 30 Oct 2020 12:16:21 +0300 Subject: [PATCH 089/102] 2 empty dialogs dlgPasteNewColumns dlgPasteNewdataFrame --- instat/dlgPasteNewColumns.Designer.vb | 39 ++++++++ instat/dlgPasteNewColumns.resx | 120 ++++++++++++++++++++++++ instat/dlgPasteNewColumns.vb | 3 + instat/dlgPasteNewDataFrame.Designer.vb | 38 ++++++++ instat/dlgPasteNewDataFrame.resx | 120 ++++++++++++++++++++++++ instat/dlgPasteNewDataFrame.vb | 3 + instat/instat.vbproj | 18 ++++ 7 files changed, 341 insertions(+) create mode 100644 instat/dlgPasteNewColumns.Designer.vb create mode 100644 instat/dlgPasteNewColumns.resx create mode 100644 instat/dlgPasteNewColumns.vb create mode 100644 instat/dlgPasteNewDataFrame.Designer.vb create mode 100644 instat/dlgPasteNewDataFrame.resx create mode 100644 instat/dlgPasteNewDataFrame.vb diff --git a/instat/dlgPasteNewColumns.Designer.vb b/instat/dlgPasteNewColumns.Designer.vb new file mode 100644 index 00000000000..67a2cdc8276 --- /dev/null +++ b/instat/dlgPasteNewColumns.Designer.vb @@ -0,0 +1,39 @@ + _ +Partial Class dlgPasteNewColumns + 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() + ' + 'dlgPasteNewColumns + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "dlgPasteNewColumns" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Paste Data to New Column(s)" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgPasteNewColumns.resx b/instat/dlgPasteNewColumns.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgPasteNewColumns.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/dlgPasteNewColumns.vb b/instat/dlgPasteNewColumns.vb new file mode 100644 index 00000000000..123ab14e01a --- /dev/null +++ b/instat/dlgPasteNewColumns.vb @@ -0,0 +1,3 @@ +Public Class dlgPasteNewColumns + +End Class \ No newline at end of file diff --git a/instat/dlgPasteNewDataFrame.Designer.vb b/instat/dlgPasteNewDataFrame.Designer.vb new file mode 100644 index 00000000000..6ba23f3bc2c --- /dev/null +++ b/instat/dlgPasteNewDataFrame.Designer.vb @@ -0,0 +1,38 @@ + _ +Partial Class dlgPasteNewDataFrame + 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() + ' + 'dlgPasteNewDataFrame + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Name = "dlgPasteNewDataFrame" + Me.Text = "Paste Data to New Data Frame" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/instat/dlgPasteNewDataFrame.resx b/instat/dlgPasteNewDataFrame.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgPasteNewDataFrame.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/dlgPasteNewDataFrame.vb b/instat/dlgPasteNewDataFrame.vb new file mode 100644 index 00000000000..4c9573224e4 --- /dev/null +++ b/instat/dlgPasteNewDataFrame.vb @@ -0,0 +1,3 @@ +Public Class dlgPasteNewDataFrame + +End Class \ No newline at end of file diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 05f5a98ddd9..e84792bd88d 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -238,6 +238,18 @@ Form + + dlgPasteNewColumns.vb + + + Form + + + dlgPasteNewDataFrame.vb + + + Form + dlgPolarAnnulus.vb @@ -2633,6 +2645,12 @@ dlgOtherRosePlots.vb + + dlgPasteNewColumns.vb + + + dlgPasteNewDataFrame.vb + dlgPolarAnnulus.vb From bb02bd0c00ce905281a063512f8c458fd4b33f4c Mon Sep 17 00:00:00 2001 From: patowhiz Date: Fri, 30 Oct 2020 12:24:55 +0300 Subject: [PATCH 090/102] added temprary load events --- instat/dlgPasteNewColumns.vb | 2 ++ instat/dlgPasteNewDataFrame.vb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/instat/dlgPasteNewColumns.vb b/instat/dlgPasteNewColumns.vb index 123ab14e01a..506442412c2 100644 --- a/instat/dlgPasteNewColumns.vb +++ b/instat/dlgPasteNewColumns.vb @@ -1,3 +1,5 @@ Public Class dlgPasteNewColumns + Private Sub dlgPasteNewColumns_Load(sender As Object, e As EventArgs) Handles MyBase.Load + End Sub End Class \ No newline at end of file diff --git a/instat/dlgPasteNewDataFrame.vb b/instat/dlgPasteNewDataFrame.vb index 4c9573224e4..0ccc995294b 100644 --- a/instat/dlgPasteNewDataFrame.vb +++ b/instat/dlgPasteNewDataFrame.vb @@ -1,3 +1,5 @@ Public Class dlgPasteNewDataFrame + Private Sub dlgPasteNewDataFrame_Load(sender As Object, e As EventArgs) Handles MyBase.Load + End Sub End Class \ No newline at end of file From c6141edf61231371095aee776401815a44751353 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 30 Oct 2020 13:24:19 +0300 Subject: [PATCH 091/102] Added Circular Density plot dialog --- instat/dlgCircularDensityPlot.Designer.vb | 52 ++++++++++ instat/dlgCircularDensityPlot.resx | 120 ++++++++++++++++++++++ instat/dlgCircularDensityPlot.vb | 3 + instat/instat.vbproj | 9 ++ 4 files changed, 184 insertions(+) create mode 100644 instat/dlgCircularDensityPlot.Designer.vb create mode 100644 instat/dlgCircularDensityPlot.resx create mode 100644 instat/dlgCircularDensityPlot.vb diff --git a/instat/dlgCircularDensityPlot.Designer.vb b/instat/dlgCircularDensityPlot.Designer.vb new file mode 100644 index 00000000000..de32e315465 --- /dev/null +++ b/instat/dlgCircularDensityPlot.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class dlgCircularDensityPlot + 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.ucrBase = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(2, 224) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(399, 52) + Me.ucrBase.TabIndex = 0 + ' + 'dlgCircularDensityPlot + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(402, 282) + Me.Controls.Add(Me.ucrBase) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgCircularDensityPlot" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Density Plot" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ucrBase As ucrButtons +End Class diff --git a/instat/dlgCircularDensityPlot.resx b/instat/dlgCircularDensityPlot.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgCircularDensityPlot.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/dlgCircularDensityPlot.vb b/instat/dlgCircularDensityPlot.vb new file mode 100644 index 00000000000..795e9ab5773 --- /dev/null +++ b/instat/dlgCircularDensityPlot.vb @@ -0,0 +1,3 @@ +Public Class dlgCircularDensityPlot + +End Class \ No newline at end of file diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 05f5a98ddd9..551fe13f293 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -196,6 +196,12 @@ Form + + dlgCircularDensityPlot.vb + + + Form + dlgClimsoftWizard.vb @@ -2611,6 +2617,9 @@ dlgCircular.vb + + dlgCircularDensityPlot.vb + dlgClimsoftWizard.vb From fdcc4d77068dddc051684db38b90928dd98b3de7 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 30 Oct 2020 13:32:57 +0300 Subject: [PATCH 092/102] Added an empty cicular scatter plot dialog --- instat/dlgCircularScatterPlot.Designer.vb | 52 ++++++++++ instat/dlgCircularScatterPlot.resx | 120 ++++++++++++++++++++++ instat/dlgCircularScatterPlot.vb | 3 + instat/instat.vbproj | 9 ++ 4 files changed, 184 insertions(+) create mode 100644 instat/dlgCircularScatterPlot.Designer.vb create mode 100644 instat/dlgCircularScatterPlot.resx create mode 100644 instat/dlgCircularScatterPlot.vb diff --git a/instat/dlgCircularScatterPlot.Designer.vb b/instat/dlgCircularScatterPlot.Designer.vb new file mode 100644 index 00000000000..1fe05b8a305 --- /dev/null +++ b/instat/dlgCircularScatterPlot.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class dlgCircularScatterPlot + 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.UcrButtons1 = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'UcrButtons1 + ' + Me.UcrButtons1.Location = New System.Drawing.Point(5, 237) + Me.UcrButtons1.Name = "UcrButtons1" + Me.UcrButtons1.Size = New System.Drawing.Size(410, 52) + Me.UcrButtons1.TabIndex = 0 + ' + 'dlgCircularScatterPlot + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(420, 296) + Me.Controls.Add(Me.UcrButtons1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgCircularScatterPlot" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Scatter Plot" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents UcrButtons1 As ucrButtons +End Class diff --git a/instat/dlgCircularScatterPlot.resx b/instat/dlgCircularScatterPlot.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgCircularScatterPlot.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/dlgCircularScatterPlot.vb b/instat/dlgCircularScatterPlot.vb new file mode 100644 index 00000000000..3c93573c2dc --- /dev/null +++ b/instat/dlgCircularScatterPlot.vb @@ -0,0 +1,3 @@ +Public Class dlgCircularScatterPlot + +End Class \ No newline at end of file diff --git a/instat/instat.vbproj b/instat/instat.vbproj index 551fe13f293..bb8412b6c04 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -202,6 +202,12 @@ Form + + dlgCircularScatterPlot.vb + + + Form + dlgClimsoftWizard.vb @@ -2620,6 +2626,9 @@ dlgCircularDensityPlot.vb + + dlgCircularScatterPlot.vb + dlgClimsoftWizard.vb From 144cc881ba81c78b64e6dc8db3402a42468f7b62 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 30 Oct 2020 13:42:47 +0300 Subject: [PATCH 093/102] Added an empty circular rose plot dialog --- instat/dlgCircularDensityPlot.Designer.vb | 6 +- instat/dlgCircularRosePlot.Designer.vb | 52 ++++++++++ instat/dlgCircularRosePlot.resx | 120 ++++++++++++++++++++++ instat/dlgCircularRosePlot.vb | 3 + instat/instat.vbproj | 9 ++ 5 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 instat/dlgCircularRosePlot.Designer.vb create mode 100644 instat/dlgCircularRosePlot.resx create mode 100644 instat/dlgCircularRosePlot.vb diff --git a/instat/dlgCircularDensityPlot.Designer.vb b/instat/dlgCircularDensityPlot.Designer.vb index de32e315465..bea894273e5 100644 --- a/instat/dlgCircularDensityPlot.Designer.vb +++ b/instat/dlgCircularDensityPlot.Designer.vb @@ -27,16 +27,16 @@ Partial Class dlgCircularDensityPlot ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(2, 224) + Me.ucrBase.Location = New System.Drawing.Point(6, 240) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(399, 52) + Me.ucrBase.Size = New System.Drawing.Size(406, 52) Me.ucrBase.TabIndex = 0 ' 'dlgCircularDensityPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(402, 282) + Me.ClientSize = New System.Drawing.Size(420, 296) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False diff --git a/instat/dlgCircularRosePlot.Designer.vb b/instat/dlgCircularRosePlot.Designer.vb new file mode 100644 index 00000000000..70982b494ba --- /dev/null +++ b/instat/dlgCircularRosePlot.Designer.vb @@ -0,0 +1,52 @@ + _ +Partial Class dlgCircularRosePlot + 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.UcrButtons1 = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'UcrButtons1 + ' + Me.UcrButtons1.Location = New System.Drawing.Point(6, 238) + Me.UcrButtons1.Name = "UcrButtons1" + Me.UcrButtons1.Size = New System.Drawing.Size(406, 52) + Me.UcrButtons1.TabIndex = 0 + ' + 'dlgCircularRosePlot + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(420, 296) + Me.Controls.Add(Me.UcrButtons1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgCircularRosePlot" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Rose Plot" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents UcrButtons1 As ucrButtons +End Class diff --git a/instat/dlgCircularRosePlot.resx b/instat/dlgCircularRosePlot.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgCircularRosePlot.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/dlgCircularRosePlot.vb b/instat/dlgCircularRosePlot.vb new file mode 100644 index 00000000000..59f30d55064 --- /dev/null +++ b/instat/dlgCircularRosePlot.vb @@ -0,0 +1,3 @@ +Public Class dlgCircularRosePlot + +End Class \ No newline at end of file diff --git a/instat/instat.vbproj b/instat/instat.vbproj index bb8412b6c04..f750311772d 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -202,6 +202,12 @@ Form + + dlgCircularRosePlot.vb + + + Form + dlgCircularScatterPlot.vb @@ -2626,6 +2632,9 @@ dlgCircularDensityPlot.vb + + dlgCircularRosePlot.vb + dlgCircularScatterPlot.vb From 98c7a9947b65aac345254e6f15cfe9e5fa599daf Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 30 Oct 2020 13:45:40 +0300 Subject: [PATCH 094/102] Added circular dialogs --- instat/dlgCircularDensityPlot.Designer.vb | 16 ++++++++-------- instat/dlgCircularRosePlot.Designer.vb | 2 +- instat/dlgCircularScatterPlot.Designer.vb | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/instat/dlgCircularDensityPlot.Designer.vb b/instat/dlgCircularDensityPlot.Designer.vb index bea894273e5..194cad02b62 100644 --- a/instat/dlgCircularDensityPlot.Designer.vb +++ b/instat/dlgCircularDensityPlot.Designer.vb @@ -22,22 +22,22 @@ Partial Class dlgCircularDensityPlot 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.ucrBase = New instat.ucrButtons() + Me.UcrButtons1 = New instat.ucrButtons() Me.SuspendLayout() ' - 'ucrBase + 'UcrButtons1 ' - Me.ucrBase.Location = New System.Drawing.Point(6, 240) - Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(406, 52) - Me.ucrBase.TabIndex = 0 + Me.UcrButtons1.Location = New System.Drawing.Point(5, 238) + Me.UcrButtons1.Name = "UcrButtons1" + Me.UcrButtons1.Size = New System.Drawing.Size(410, 52) + Me.UcrButtons1.TabIndex = 0 ' 'dlgCircularDensityPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(420, 296) - Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.UcrButtons1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -48,5 +48,5 @@ Partial Class dlgCircularDensityPlot End Sub - Friend WithEvents ucrBase As ucrButtons + Friend WithEvents UcrButtons1 As ucrButtons End Class diff --git a/instat/dlgCircularRosePlot.Designer.vb b/instat/dlgCircularRosePlot.Designer.vb index 70982b494ba..aad53a72dd3 100644 --- a/instat/dlgCircularRosePlot.Designer.vb +++ b/instat/dlgCircularRosePlot.Designer.vb @@ -27,7 +27,7 @@ Partial Class dlgCircularRosePlot ' 'UcrButtons1 ' - Me.UcrButtons1.Location = New System.Drawing.Point(6, 238) + Me.UcrButtons1.Location = New System.Drawing.Point(6, 240) Me.UcrButtons1.Name = "UcrButtons1" Me.UcrButtons1.Size = New System.Drawing.Size(406, 52) Me.UcrButtons1.TabIndex = 0 diff --git a/instat/dlgCircularScatterPlot.Designer.vb b/instat/dlgCircularScatterPlot.Designer.vb index 1fe05b8a305..42c03513ed9 100644 --- a/instat/dlgCircularScatterPlot.Designer.vb +++ b/instat/dlgCircularScatterPlot.Designer.vb @@ -27,7 +27,7 @@ Partial Class dlgCircularScatterPlot ' 'UcrButtons1 ' - Me.UcrButtons1.Location = New System.Drawing.Point(5, 237) + Me.UcrButtons1.Location = New System.Drawing.Point(5, 239) Me.UcrButtons1.Name = "UcrButtons1" Me.UcrButtons1.Size = New System.Drawing.Size(410, 52) Me.UcrButtons1.TabIndex = 0 From 911a08eec64dfe448884ebeaa25229fbe26313e1 Mon Sep 17 00:00:00 2001 From: Wycklife Bonyo Date: Fri, 30 Oct 2020 13:50:06 +0300 Subject: [PATCH 095/102] Circular plots dailogs --- instat/dlgCircularDensityPlot.Designer.vb | 16 ++++++++-------- instat/dlgCircularRosePlot.Designer.vb | 16 ++++++++-------- instat/dlgCircularScatterPlot.Designer.vb | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/instat/dlgCircularDensityPlot.Designer.vb b/instat/dlgCircularDensityPlot.Designer.vb index 194cad02b62..87fa26cd9f0 100644 --- a/instat/dlgCircularDensityPlot.Designer.vb +++ b/instat/dlgCircularDensityPlot.Designer.vb @@ -22,22 +22,22 @@ Partial Class dlgCircularDensityPlot 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.UcrButtons1 = New instat.ucrButtons() + Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'UcrButtons1 + 'ucrBase ' - Me.UcrButtons1.Location = New System.Drawing.Point(5, 238) - Me.UcrButtons1.Name = "UcrButtons1" - Me.UcrButtons1.Size = New System.Drawing.Size(410, 52) - Me.UcrButtons1.TabIndex = 0 + Me.ucrBase.Location = New System.Drawing.Point(5, 238) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 0 ' 'dlgCircularDensityPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(420, 296) - Me.Controls.Add(Me.UcrButtons1) + Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -48,5 +48,5 @@ Partial Class dlgCircularDensityPlot End Sub - Friend WithEvents UcrButtons1 As ucrButtons + Friend WithEvents ucrBase As ucrButtons End Class diff --git a/instat/dlgCircularRosePlot.Designer.vb b/instat/dlgCircularRosePlot.Designer.vb index aad53a72dd3..8970c59b849 100644 --- a/instat/dlgCircularRosePlot.Designer.vb +++ b/instat/dlgCircularRosePlot.Designer.vb @@ -22,22 +22,22 @@ Partial Class dlgCircularRosePlot 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.UcrButtons1 = New instat.ucrButtons() + Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'UcrButtons1 + 'ucrBase ' - Me.UcrButtons1.Location = New System.Drawing.Point(6, 240) - Me.UcrButtons1.Name = "UcrButtons1" - Me.UcrButtons1.Size = New System.Drawing.Size(406, 52) - Me.UcrButtons1.TabIndex = 0 + Me.ucrBase.Location = New System.Drawing.Point(6, 240) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(406, 52) + Me.ucrBase.TabIndex = 0 ' 'dlgCircularRosePlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(420, 296) - Me.Controls.Add(Me.UcrButtons1) + Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -48,5 +48,5 @@ Partial Class dlgCircularRosePlot End Sub - Friend WithEvents UcrButtons1 As ucrButtons + Friend WithEvents ucrBase As ucrButtons End Class diff --git a/instat/dlgCircularScatterPlot.Designer.vb b/instat/dlgCircularScatterPlot.Designer.vb index 42c03513ed9..91acf76000e 100644 --- a/instat/dlgCircularScatterPlot.Designer.vb +++ b/instat/dlgCircularScatterPlot.Designer.vb @@ -22,22 +22,22 @@ Partial Class dlgCircularScatterPlot 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.UcrButtons1 = New instat.ucrButtons() + Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' - 'UcrButtons1 + 'ucrBase ' - Me.UcrButtons1.Location = New System.Drawing.Point(5, 239) - Me.UcrButtons1.Name = "UcrButtons1" - Me.UcrButtons1.Size = New System.Drawing.Size(410, 52) - Me.UcrButtons1.TabIndex = 0 + Me.ucrBase.Location = New System.Drawing.Point(5, 239) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 0 ' 'dlgCircularScatterPlot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(420, 296) - Me.Controls.Add(Me.UcrButtons1) + Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -48,5 +48,5 @@ Partial Class dlgCircularScatterPlot End Sub - Friend WithEvents UcrButtons1 As ucrButtons + Friend WithEvents ucrBase As ucrButtons End Class From eeb62c5d5641f74d24f99bf82ca7fb57a649dd62 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Fri, 30 Oct 2020 15:59:47 +0300 Subject: [PATCH 096/102] removed stop and print for cat. This allows display of message into the output window --- instat/static/InstatObject/R/data_object_R6.R | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 76d70e0e066..314a3cb39b6 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3664,7 +3664,6 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va } out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) list_out[[i]] <- out[[1]][, var] - print(out[[2]]) } gaps <- sum(date_lengths) - dim(curr_data)[[1]] } else { @@ -3682,18 +3681,23 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va colnames(patch_weather[[i]])[4] <- var } } - if (gaps != 0) { - stop(gaps, " rows for date gaps are missing, fill date gaps before proceeding.") - } if (!missing(station_col_name)) { col <- unlist(list_out) } else { out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) col <- out[[1]][, var] - print(out[[2]]) } + if(length(col)==dim(curr_data)[[1]]){ + gaps_remaining <- summary_count_missing(col) + gaps_filled <- (summary_count_missing(curr_data[, var])-gaps_remaining) + cat(gaps_filled, " gaps filled", gaps_remaining, " remaining.", "\n") self$add_columns_to_data(col_name = column_name, col_data = col) + }else{ + if (gaps != 0) { + cat(gaps, " rows for date gaps are missing, fill date gaps before proceeding.", "\n") + } + } }) DataSheet$set("public", "visualize_element_na", function(element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = 1461, x_with_truth = NULL, measure = "percent") { From 4638429f387e010d1ec86388e3ae1ae0eac9b879 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 1 Nov 2020 13:39:26 +0300 Subject: [PATCH 097/102] minor edit --- .../static/InstatObject/R/instat_object_R6.R | 144 +++++++++--------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index ff34e2377f4..2aa59349ddf 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -1,56 +1,56 @@ DataBook <- R6::R6Class("DataBook", - public = list( - initialize = function(data_tables = list(), instat_obj_metadata = list(), - data_tables_variables_metadata = rep(list(data.frame()),length(data_tables)), - data_tables_metadata = rep(list(list()),length(data_tables)), - data_tables_filters = rep(list(list()),length(data_tables)), - imported_from = as.list(rep("",length(data_tables))), - messages=TRUE, convert=TRUE, create=TRUE) - { - self$set_meta(instat_obj_metadata) - self$set_objects(list()) - - if (missing(data_tables) || length(data_tables) == 0) { - self$set_data_objects(list()) - } - - else { - self$import_data(data_tables=data_tables, data_tables_variables_metadata=data_tables_variables_metadata, - data_tables_metadata=data_tables_metadata, - imported_from=imported_from, messages=messages, convert=convert, create=create, data_tables_filters = data_tables_filters) - } - - private$.data_sheets_changed <- FALSE - } - ), - private = list( - .data_sheets = list(), - .metadata = list(), - .objects = list(), - .links = list(), - .data_sheets_changed = FALSE, - .database_connection = NULL, - .last_graph = NULL - ), - active = list( - data_objects_changed = function(new_value) { - if(missing(new_value)) return(private$.data_sheets_changed) - else { - if(new_value != TRUE && new_value != FALSE) stop("new_value must be TRUE or FALSE") - private$.data_sheets_changed <- new_value - #TODO is this behaviour we want? - invisible(sapply(self$get_data_objects(), function(x) x$data_changed <- new_value)) - } - } - ) + public = list( + initialize = function(data_tables = list(), instat_obj_metadata = list(), + data_tables_variables_metadata = rep(list(data.frame()),length(data_tables)), + data_tables_metadata = rep(list(list()),length(data_tables)), + data_tables_filters = rep(list(list()),length(data_tables)), + imported_from = as.list(rep("",length(data_tables))), + messages=TRUE, convert=TRUE, create=TRUE) + { + self$set_meta(instat_obj_metadata) + self$set_objects(list()) + + if (missing(data_tables) || length(data_tables) == 0) { + self$set_data_objects(list()) + } + + else { + self$import_data(data_tables=data_tables, data_tables_variables_metadata=data_tables_variables_metadata, + data_tables_metadata=data_tables_metadata, + imported_from=imported_from, messages=messages, convert=convert, create=create, data_tables_filters = data_tables_filters) + } + + private$.data_sheets_changed <- FALSE + } + ), + private = list( + .data_sheets = list(), + .metadata = list(), + .objects = list(), + .links = list(), + .data_sheets_changed = FALSE, + .database_connection = NULL, + .last_graph = NULL + ), + active = list( + data_objects_changed = function(new_value) { + if(missing(new_value)) return(private$.data_sheets_changed) + else { + if(new_value != TRUE && new_value != FALSE) stop("new_value must be TRUE or FALSE") + private$.data_sheets_changed <- new_value + #TODO is this behaviour we want? + invisible(sapply(self$get_data_objects(), function(x) x$data_changed <- new_value)) + } + } + ) ) DataBook$set("public", "import_data", function(data_tables = list(), data_tables_variables_metadata = rep(list(data.frame()),length(data_tables)), - data_tables_metadata = rep(list(list()),length(data_tables)), - data_tables_filters = rep(list(list()),length(data_tables)), - imported_from = as.list(rep("",length(data_tables))), - data_names = NULL, - messages=TRUE, convert=TRUE, create=TRUE) + data_tables_metadata = rep(list(list()),length(data_tables)), + data_tables_filters = rep(list(list()),length(data_tables)), + imported_from = as.list(rep("",length(data_tables))), + data_names = NULL, + messages=TRUE, convert=TRUE, create=TRUE) { if (missing(data_tables) || length(data_tables) == 0) { stop("No data found. No data objects can be created.") @@ -94,12 +94,12 @@ DataBook$set("public", "import_data", function(data_tables = list(), data_tables } new_data = DataSheet$new(data=data_tables[[i]], data_name = curr_name, - variables_metadata = data_tables_variables_metadata[[i]], - metadata = data_tables_metadata[[i]], - imported_from = imported_from[[i]], - start_point = i, - messages = messages, convert = convert, create = create, - filters = data_tables_filters[[i]]) + variables_metadata = data_tables_variables_metadata[[i]], + metadata = data_tables_metadata[[i]], + imported_from = imported_from[[i]], + start_point = i, + messages = messages, convert = convert, create = create, + filters = data_tables_filters[[i]]) # Add this new data object to our list of data objects self$append_data_object(new_data$get_metadata(data_name_label), new_data) } @@ -140,7 +140,7 @@ DataBook$set("public", "copy_data_object", function(data_name, new_name, filter_ DataBook$set("public", "import_RDS", function(data_RDS, keep_existing = TRUE, overwrite_existing = FALSE, include_objects = TRUE, - include_metadata = TRUE, include_logs = TRUE, include_filters = TRUE, include_calculations = TRUE, include_comments = TRUE) + include_metadata = TRUE, include_logs = TRUE, include_filters = TRUE, include_calculations = TRUE, include_comments = TRUE) # TODO add include_calcuations options { # 'instat_object' is previously used class name, some files may have this name. @@ -1532,7 +1532,7 @@ DataBook$set("public", "has_database_connection", function() { ) DataBook$set("public", "database_connect", function(dbname, user, host, port, drv = RMySQL::MySQL()) { - password <- getPass::getPass(paste0(user, " password:")) + password <- getPass::getPass(paste0(user, " password:")) out <- NULL out <- DBI::dbConnect(drv = drv, dbname = dbname, user = user, password = password, host = host, port = port) if(!is.null(out)) { @@ -1577,7 +1577,7 @@ DataBook$set("public", "import_from_climsoft", function(stations = c(), elements end_date <- format(end_date, format = "%Y-%m-%d") date_bounds = paste0(date_bounds, " AND obsDatetime <",sQuote(end_date)) } - + if (length(elements) > 0){ my_elements = paste0("(", paste0(sprintf("'%s'", elements), collapse = ", "), ")") element_ids = DBI::dbGetQuery(con, paste0("SELECT elementID FROM obselement WHERE elementName in", my_elements,";")) @@ -1592,7 +1592,7 @@ DataBook$set("public", "import_from_climsoft", function(stations = c(), elements my_stations = paste0("(", paste(as.character(unique(station_data$recordedFrom)), collapse=", "), ")") station_info <- DBI::dbGetQuery(con, paste0("SELECT * FROM station WHERE stationID in ", my_stations, ";")) } - + data_list <- list(station_info, station_data) names(data_list) = c("station_info","station_data") } @@ -1687,7 +1687,7 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r rain_total_name <- "rain_total" is_station <- !missing(station) - + if(missing(year)) stop("Year column must be specified.") if(!is_station) by <- year else by <- c(year, station) @@ -1739,7 +1739,7 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r !! rlang::sym(end_day) := dplyr::first(!! rlang::sym(end_day))) df <- dplyr::left_join(df, season_data, by = by) } - + # Plant day condition if(start_check) { df$plant_day_cond <- (df[[start_day]] <= df[[plant_day_name]]) @@ -1747,7 +1747,7 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r # Plant length condition df$length_cond <- (df[[plant_day_name]] + df[[plant_length_name]] <= df[[end_day]]) - + # Rain total condition df[["rain_total_actual"]] <- sapply(1:nrow(df), function(x) { @@ -1766,7 +1766,7 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r # All three conditions met df$overall_cond <- ((if(start_check) df$plant_day_cond else TRUE) & df$length_cond & df$rain_cond) - + crops_name <- "crop_def" crops_name <- next_default_item(prefix = crops_name, existing_names = self$get_data_names(), include_index = FALSE) data_tables <- list(df) @@ -2040,7 +2040,7 @@ DataBook$set("public","tidy_climatic_data", function(x, format, stack_cols, day, # This assumes stack_cols and stack_years are in the same order y$year <- plyr::mapvalues(y$year, stack_cols, stack_years) - + # Replacing day 60 with 0 for non-leap years. This will result in NA dates. y$doy[(!lubridate::leap_year(y$year)) & y$doy == 60] <- 0 y$doy[(!lubridate::leap_year(y$year)) & y$doy > 60] <- y$doy[(!lubridate::leap_year(y$year)) & y$doy > 60] - 1 @@ -2178,14 +2178,6 @@ DataBook$set("public","package_check", function(package) { } ) -DataBook$set("public", "patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name = station_col_name) { - self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name, var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name, station_col_name = station_col_name) -}) - -DataBook$set("public", "visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL, measure = "percent") { - self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed = element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth, measure = measure) -}) - DataBook$set("public", "download_from_IRI", function(source, data, path = tempdir(), min_lon, max_lon, min_lat, max_lat, min_date, max_date, name, download_type = "Point", import = TRUE) { init_URL <- "https://iridl.ldeo.columbia.edu/SOURCES/" dim_x <- "X" @@ -2339,3 +2331,11 @@ DataBook$set("public", "download_from_IRI", function(source, data, path = tempdi file.remove(file_name) } }) + +DataBook$set("public", "patch_climate_element", function(data_name, date_col_name = "", var = "", vars = c(), max_mean_bias = NA, max_stdev_bias = NA, column_name, station_col_name = station_col_name) { + self$get_data_objects(data_name)$patch_climate_element(date_col_name = date_col_name, var = var, vars = vars, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias, column_name = column_name, station_col_name = station_col_name) +}) + +DataBook$set("public", "visualize_element_na", function(data_name, element_col_name, element_col_name_imputed, station_col_name, x_axis_labels_col_name, ncol = 2, type = "distribution", xlab = NULL, ylab = NULL, legend = TRUE, orientation = "horizontal", interval_size = interval_size, x_with_truth = NULL, measure = "percent") { + self$get_data_objects(data_name)$visualize_element_na(element_col_name = element_col_name, element_col_name_imputed = element_col_name_imputed, station_col_name = station_col_name, x_axis_labels_col_name = x_axis_labels_col_name, ncol = ncol, type = type, xlab = xlab, ylab = ylab, legend = legend, orientation = orientation, interval_size = interval_size, x_with_truth = x_with_truth, measure = measure) +}) \ No newline at end of file From e11dabe13f0f200f348a05dbbf7b57f99093e613 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 1 Nov 2020 13:42:46 +0300 Subject: [PATCH 098/102] reviewer's comments --- instat/static/InstatObject/R/data_object_R6.R | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 314a3cb39b6..52d82c0ef7b 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -3688,15 +3688,13 @@ DataSheet$set("public", "patch_climate_element", function(date_col_name = "", va out <- chillR::patch_daily_temperatures(weather = weather, patch_weather = patch_weather, vars = var, max_mean_bias = max_mean_bias, max_stdev_bias = max_stdev_bias) col <- out[[1]][, var] } - if(length(col)==dim(curr_data)[[1]]){ - gaps_remaining <- summary_count_missing(col) - gaps_filled <- (summary_count_missing(curr_data[, var])-gaps_remaining) - cat(gaps_filled, " gaps filled", gaps_remaining, " remaining.", "\n") - self$add_columns_to_data(col_name = column_name, col_data = col) - }else{ - if (gaps != 0) { - cat(gaps, " rows for date gaps are missing, fill date gaps before proceeding.", "\n") - } + if (length(col) == dim(curr_data)[[1]]) { + gaps_remaining <- summary_count_missing(col) + gaps_filled <- (summary_count_missing(curr_data[, var]) - gaps_remaining) + cat(gaps_filled, " gaps filled", gaps_remaining, " remaining.", "\n") + self$add_columns_to_data(col_name = column_name, col_data = col) + } else if (gaps != 0) { + cat(gaps, " rows for date gaps are missing, fill date gaps before proceeding.", "\n") } }) From 9df80845a91a297260f1bd9bb5e44509fe575519 Mon Sep 17 00:00:00 2001 From: shadrack kibet Date: Sun, 1 Nov 2020 13:44:42 +0300 Subject: [PATCH 099/102] ident --- instat/dlgInfillMissingValues.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/dlgInfillMissingValues.vb b/instat/dlgInfillMissingValues.vb index 63d92b9c50d..9a4588327c0 100644 --- a/instat/dlgInfillMissingValues.vb +++ b/instat/dlgInfillMissingValues.vb @@ -485,7 +485,7 @@ Public Class dlgInfillMissingValues End Select End If ElseIf rdoShow.Checked Then - ucrChkAddLegend.Visible = True + ucrChkAddLegend.Visible = True clsVisualizeElementNa.AddParameter("type", Chr(34) & "imputation" & Chr(34), iPosition:=8) End If cmdDisplayOptions.Visible = True From e45e705f907e08c5fbe5e7945f8f8f372b5764bc Mon Sep 17 00:00:00 2001 From: lloyddewit <57253949+lloyddewit@users.noreply.github.com> Date: Tue, 3 Nov 2020 10:23:02 +0100 Subject: [PATCH 100/102] Update instat/ucrSave.vb --- instat/ucrSave.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instat/ucrSave.vb b/instat/ucrSave.vb index bf3c6afefa9..78529388eea 100644 --- a/instat/ucrSave.vb +++ b/instat/ucrSave.vb @@ -882,8 +882,8 @@ Public Class ucrSave ''' Updates the control's R command's column position variables. ''' These variables specify the position of the new column in the data frame ''' (start, end or before/after a specified column). - ''' This subroutine is called automatically when the receiver (specifying a column name) linked to clsColPosFunction - ''' this control changes. + ''' This subroutine is called automatically when the receiver (specifying a column name) linked to + ''' clsColPosFunction changes. ''' If the save object is not a column then this function does nothing. ''' If the user has selected a column in the linked receiver, then sets the ''' parameters to ensure that the new column is added directly after the receiver @@ -950,4 +950,4 @@ Public Class ucrSave End If Next End Sub -End Class \ No newline at end of file +End Class From 7a28611817bf4b800b1d37e7a156c17df8ff32c8 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Tue, 3 Nov 2020 23:22:19 +0300 Subject: [PATCH 101/102] Update instat/clsRecentFiles.vb Co-authored-by: lloyddewit <57253949+lloyddewit@users.noreply.github.com> --- instat/clsRecentFiles.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instat/clsRecentFiles.vb b/instat/clsRecentFiles.vb index 0171ccd264c..3492ce213ce 100644 --- a/instat/clsRecentFiles.vb +++ b/instat/clsRecentFiles.vb @@ -137,7 +137,7 @@ Public Class clsRecentFiles End If Next - 'the add and displays menu items (_in reverse order) for dialogs + 'then add and display menu items (in reverse order) for dialogs For icounter As Integer = lstRecentDialogs.Count - 1 To 0 Step -1 'creates new toolstripitem, displaying name of the dialog Dim clsItem As New ToolStripMenuItem(lstRecentDialogs(icounter).Text) From b71a579157f6c44945e4986628d1b5d84fd0f529 Mon Sep 17 00:00:00 2001 From: patowhiz Date: Wed, 4 Nov 2020 13:10:43 +0300 Subject: [PATCH 102/102] changed addToMenu --- instat/clsRecentFiles.vb | 58 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/instat/clsRecentFiles.vb b/instat/clsRecentFiles.vb index 3492ce213ce..41a4ae23e9d 100644 --- a/instat/clsRecentFiles.vb +++ b/instat/clsRecentFiles.vb @@ -89,36 +89,38 @@ Public Class clsRecentFiles End Sub ''' - ''' adds the form or file path passed object to menu items + ''' adds the form to menu items ''' - ''' accepts objects of type Form or File Path - Public Sub addToMenu(formOrFilePathObj As Object) - If TypeOf formOrFilePathObj Is Form Then - Dim frmDialog As Form = DirectCast(formOrFilePathObj, Form) - 'Checks for existance, else add it to the beginning - If lstRecentDialogs.Contains(frmDialog) Then lstRecentDialogs.Remove(frmDialog) - 'adds to the list - lstRecentDialogs.Add(frmDialog) - 'checks that only 10 items are allowed - If lstRecentDialogs.Count > 10 Then - lstRecentDialogs.RemoveAt(0) - End If - 'update recent dialogs menu items - UpdateRecentDialogsMenuItems() - Else - Dim strFilePath As String = formOrFilePathObj - 'remove file if it exists(helps with making sure displayed file names are rearranged) - lstRecentOpenedFiles.Remove(strFilePath) - 'add to recent opened files list.. - lstRecentOpenedFiles.Add(strFilePath) - 'make sure there are only ever 30 items... - 'todo. add this to the general options on the number of recently files to show - While lstRecentOpenedFiles.Count > 30 - lstRecentOpenedFiles.RemoveAt(0) - End While - 'update recent files menu items - UpdateRecentFilesMenuItems() + ''' form to add to menu items + Public Sub addToMenu(frmDialog As Form) + 'Checks for existance, else add it to the beginning + If lstRecentDialogs.Contains(frmDialog) Then lstRecentDialogs.Remove(frmDialog) + 'adds to the list + lstRecentDialogs.Add(frmDialog) + 'checks that only 10 items are allowed + If lstRecentDialogs.Count > 10 Then + lstRecentDialogs.RemoveAt(0) End If + 'update recent dialogs menu items + UpdateRecentDialogsMenuItems() + End Sub + + ''' + ''' adds the file path to menu items + ''' + ''' file path to add to menu items + Public Sub addToMenu(strFilePath As String) + 'remove file if it exists(helps with making sure displayed file names are rearranged) + lstRecentOpenedFiles.Remove(strFilePath) + 'add to recent opened files list.. + lstRecentOpenedFiles.Add(strFilePath) + 'make sure there are only ever 30 items... + 'todo. add this to the general options on the number of recently files to show + While lstRecentOpenedFiles.Count > 30 + lstRecentOpenedFiles.RemoveAt(0) + End While + 'update recent files menu items + UpdateRecentFilesMenuItems() End Sub '''