diff --git a/instat/dlgClimaticCheckDataTemperature.Designer.vb b/instat/dlgClimaticCheckDataTemperature.Designer.vb index 833d69eac4a..af536bcaddc 100644 --- a/instat/dlgClimaticCheckDataTemperature.Designer.vb +++ b/instat/dlgClimaticCheckDataTemperature.Designer.vb @@ -39,19 +39,21 @@ Partial Class dlgClimaticCheckDataTemperature Me.lblNudSame = New System.Windows.Forms.Label() Me.lblNudJump = New System.Windows.Forms.Label() Me.lblNudDiff = New System.Windows.Forms.Label() - Me.lblNudOutlier = New System.Windows.Forms.Label() Me.lblNudRangeElement1Min = New System.Windows.Forms.Label() Me.lblNudRangeElement2Min = New System.Windows.Forms.Label() Me.lblNudRangeElement1Max = New System.Windows.Forms.Label() Me.lblNudRangeElement2Max = New System.Windows.Forms.Label() Me.ttOutliers = New System.Windows.Forms.ToolTip(Me.components) - Me.ucrChkRange2 = New instat.ucrCheck() + Me.lblNewColumnName = New System.Windows.Forms.Label() + Me.ucrInputNewColumnName = New instat.ucrInputTextBox() + Me.ucrChkIncludeLogicalColumns = New instat.ucrCheck() + Me.ucrChkIncludeCalculatedColumns = New instat.ucrCheck() + Me.ucrChkRangeElement2 = New instat.ucrCheck() Me.ucrReceiverElement2 = New instat.ucrReceiverSingle() Me.ucrNudJump = New instat.ucrNud() - Me.ucrChkRange = New instat.ucrCheck() + Me.ucrChkRangeElement1 = New instat.ucrCheck() Me.ucrNudSame = New instat.ucrNud() Me.ucrNudDifference = New instat.ucrNud() - Me.ucrNudOutlier = New instat.ucrNud() Me.ucrNudRangeElement2Max = New instat.ucrNud() Me.ucrChkOutlier = New instat.ucrCheck() Me.ucrNudRangeElement2Min = New instat.ucrNud() @@ -162,11 +164,6 @@ Partial Class dlgClimaticCheckDataTemperature resources.ApplyResources(Me.lblNudDiff, "lblNudDiff") Me.lblNudDiff.Name = "lblNudDiff" ' - 'lblNudOutlier - ' - resources.ApplyResources(Me.lblNudOutlier, "lblNudOutlier") - Me.lblNudOutlier.Name = "lblNudOutlier" - ' 'lblNudRangeElement1Min ' resources.ApplyResources(Me.lblNudRangeElement1Min, "lblNudRangeElement1Min") @@ -187,11 +184,36 @@ Partial Class dlgClimaticCheckDataTemperature resources.ApplyResources(Me.lblNudRangeElement2Max, "lblNudRangeElement2Max") Me.lblNudRangeElement2Max.Name = "lblNudRangeElement2Max" ' - 'ucrChkRange2 + 'lblNewColumnName + ' + resources.ApplyResources(Me.lblNewColumnName, "lblNewColumnName") + Me.lblNewColumnName.Name = "lblNewColumnName" + ' + 'ucrInputNewColumnName + ' + Me.ucrInputNewColumnName.AddQuotesIfUnrecognised = True + resources.ApplyResources(Me.ucrInputNewColumnName, "ucrInputNewColumnName") + Me.ucrInputNewColumnName.IsMultiline = False + Me.ucrInputNewColumnName.IsReadOnly = False + Me.ucrInputNewColumnName.Name = "ucrInputNewColumnName" + ' + 'ucrChkIncludeLogicalColumns ' - Me.ucrChkRange2.Checked = False - resources.ApplyResources(Me.ucrChkRange2, "ucrChkRange2") - Me.ucrChkRange2.Name = "ucrChkRange2" + Me.ucrChkIncludeLogicalColumns.Checked = False + resources.ApplyResources(Me.ucrChkIncludeLogicalColumns, "ucrChkIncludeLogicalColumns") + Me.ucrChkIncludeLogicalColumns.Name = "ucrChkIncludeLogicalColumns" + ' + 'ucrChkIncludeCalculatedColumns + ' + Me.ucrChkIncludeCalculatedColumns.Checked = False + resources.ApplyResources(Me.ucrChkIncludeCalculatedColumns, "ucrChkIncludeCalculatedColumns") + Me.ucrChkIncludeCalculatedColumns.Name = "ucrChkIncludeCalculatedColumns" + ' + 'ucrChkRangeElement2 + ' + Me.ucrChkRangeElement2.Checked = False + resources.ApplyResources(Me.ucrChkRangeElement2, "ucrChkRangeElement2") + Me.ucrChkRangeElement2.Name = "ucrChkRangeElement2" ' 'ucrReceiverElement2 ' @@ -212,11 +234,11 @@ Partial Class dlgClimaticCheckDataTemperature Me.ucrNudJump.Name = "ucrNudJump" Me.ucrNudJump.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrChkRange + 'ucrChkRangeElement1 ' - Me.ucrChkRange.Checked = False - resources.ApplyResources(Me.ucrChkRange, "ucrChkRange") - Me.ucrChkRange.Name = "ucrChkRange" + Me.ucrChkRangeElement1.Checked = False + resources.ApplyResources(Me.ucrChkRangeElement1, "ucrChkRangeElement1") + Me.ucrChkRangeElement1.Name = "ucrChkRangeElement1" ' 'ucrNudSame ' @@ -238,16 +260,6 @@ Partial Class dlgClimaticCheckDataTemperature Me.ucrNudDifference.Name = "ucrNudDifference" Me.ucrNudDifference.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' - 'ucrNudOutlier - ' - Me.ucrNudOutlier.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudOutlier.Increment = New Decimal(New Integer() {1, 0, 0, 0}) - resources.ApplyResources(Me.ucrNudOutlier, "ucrNudOutlier") - Me.ucrNudOutlier.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) - Me.ucrNudOutlier.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) - Me.ucrNudOutlier.Name = "ucrNudOutlier" - Me.ucrNudOutlier.Value = New Decimal(New Integer() {0, 0, 0, 0}) - ' 'ucrNudRangeElement2Max ' Me.ucrNudRangeElement2Max.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) @@ -368,6 +380,7 @@ Partial Class dlgClimaticCheckDataTemperature ' 'ucrSelectorTemperature ' + Me.ucrSelectorTemperature.bDropUnusedFilterLevels = False Me.ucrSelectorTemperature.bShowHiddenColumns = False Me.ucrSelectorTemperature.bUseCurrentFilter = True resources.ApplyResources(Me.ucrSelectorTemperature, "ucrSelectorTemperature") @@ -387,12 +400,15 @@ Partial Class dlgClimaticCheckDataTemperature ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.ucrChkRange2) + Me.Controls.Add(Me.lblNewColumnName) + Me.Controls.Add(Me.ucrInputNewColumnName) + Me.Controls.Add(Me.ucrChkIncludeLogicalColumns) + Me.Controls.Add(Me.ucrChkIncludeCalculatedColumns) + Me.Controls.Add(Me.ucrChkRangeElement2) Me.Controls.Add(Me.lblNudRangeElement2Max) Me.Controls.Add(Me.lblNudRangeElement1Max) Me.Controls.Add(Me.lblNudRangeElement2Min) Me.Controls.Add(Me.lblNudRangeElement1Min) - Me.Controls.Add(Me.lblNudOutlier) Me.Controls.Add(Me.lblNudDiff) Me.Controls.Add(Me.lblNudJump) Me.Controls.Add(Me.lblNudSame) @@ -402,12 +418,11 @@ Partial Class dlgClimaticCheckDataTemperature Me.Controls.Add(Me.lblElement2) Me.Controls.Add(Me.ucrReceiverElement2) Me.Controls.Add(Me.ucrNudJump) - Me.Controls.Add(Me.ucrChkRange) + Me.Controls.Add(Me.ucrChkRangeElement1) Me.Controls.Add(Me.lblRangeElement1to) Me.Controls.Add(Me.ucrNudSame) Me.Controls.Add(Me.lblRangeElement2to) Me.Controls.Add(Me.ucrNudDifference) - Me.Controls.Add(Me.ucrNudOutlier) Me.Controls.Add(Me.ucrNudRangeElement2Max) Me.Controls.Add(Me.ucrChkOutlier) Me.Controls.Add(Me.ucrNudRangeElement2Min) @@ -460,14 +475,13 @@ Partial Class dlgClimaticCheckDataTemperature Friend WithEvents ucrChkDifference As ucrCheck Friend WithEvents ucrNudSame As ucrNud Friend WithEvents ucrNudDifference As ucrNud - Friend WithEvents ucrNudOutlier As ucrNud Friend WithEvents ucrNudRangeElement1Max As ucrNud Friend WithEvents ucrNudRangeElement1Min As ucrNud Friend WithEvents ucrNudRangeElement2Max As ucrNud Friend WithEvents ucrNudRangeElement2Min As ucrNud Friend WithEvents lblRangeElement1to As Label Friend WithEvents lblRangeElement2to As Label - Friend WithEvents ucrChkRange As ucrCheck + Friend WithEvents ucrChkRangeElement1 As ucrCheck Friend WithEvents ucrNudJump As ucrNud Friend WithEvents lblElement2 As Label Friend WithEvents ucrReceiverElement2 As ucrReceiverSingle @@ -475,7 +489,6 @@ Partial Class dlgClimaticCheckDataTemperature Friend WithEvents rdoIndividual As RadioButton Friend WithEvents rdoMultiple As RadioButton Friend WithEvents ucrPnlType As UcrPanel - Friend WithEvents lblNudOutlier As Label Friend WithEvents lblNudDiff As Label Friend WithEvents lblNudJump As Label Friend WithEvents lblNudSame As Label @@ -483,6 +496,10 @@ Partial Class dlgClimaticCheckDataTemperature Friend WithEvents lblNudRangeElement1Max As Label Friend WithEvents lblNudRangeElement2Min As Label Friend WithEvents lblNudRangeElement1Min As Label - Friend WithEvents ucrChkRange2 As ucrCheck + Friend WithEvents ucrChkRangeElement2 As ucrCheck Friend WithEvents ttOutliers As ToolTip + Friend WithEvents ucrChkIncludeCalculatedColumns As ucrCheck + Friend WithEvents ucrChkIncludeLogicalColumns As ucrCheck + Friend WithEvents lblNewColumnName As Label + Friend WithEvents ucrInputNewColumnName As ucrInputTextBox End Class diff --git a/instat/dlgClimaticCheckDataTemperature.resx b/instat/dlgClimaticCheckDataTemperature.resx index f206d0b43b4..c8d1a781714 100644 --- a/instat/dlgClimaticCheckDataTemperature.resx +++ b/instat/dlgClimaticCheckDataTemperature.resx @@ -148,7 +148,7 @@ $this - 34 + 36 True @@ -178,7 +178,7 @@ $this - 33 + 35 True @@ -208,7 +208,7 @@ $this - 32 + 34 True @@ -238,7 +238,7 @@ $this - 31 + 33 True @@ -268,7 +268,7 @@ $this - 30 + 32 True @@ -298,7 +298,7 @@ $this - 29 + 31 True @@ -313,7 +313,7 @@ 16, 13 - 23 + 22 to @@ -328,7 +328,7 @@ $this - 16 + 19 True @@ -343,7 +343,7 @@ 16, 13 - 30 + 28 to @@ -358,7 +358,7 @@ $this - 18 + 21 True @@ -388,7 +388,7 @@ $this - 12 + 15 Button @@ -430,7 +430,7 @@ $this - 9 + 12 Button @@ -466,7 +466,7 @@ $this - 10 + 13 Button @@ -508,7 +508,7 @@ $this - 11 + 14 True @@ -523,7 +523,7 @@ 29, 13 - 35 + 33 days @@ -538,7 +538,7 @@ $this - 8 + 11 True @@ -553,7 +553,7 @@ 18, 13 - 38 + 36 °C @@ -568,7 +568,7 @@ $this - 7 + 10 True @@ -583,7 +583,7 @@ 18, 13 - 41 + 39 °C @@ -598,37 +598,7 @@ $this - 6 - - - True - - - NoControl - - - 242, 426 - - - 47, 13 - - - 44 - - - multiplier - - - lblNudOutlier - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 + 9 True @@ -643,7 +613,7 @@ 18, 13 - 22 + 21 °C @@ -658,7 +628,7 @@ $this - 4 + 8 True @@ -673,7 +643,7 @@ 18, 13 - 29 + 27 °C @@ -688,7 +658,7 @@ $this - 3 + 7 True @@ -703,7 +673,7 @@ 18, 13 - 25 + 24 °C @@ -718,7 +688,7 @@ $this - 2 + 6 True @@ -733,7 +703,7 @@ 18, 13 - 32 + 30 °C @@ -748,43 +718,142 @@ $this - 1 + 5 17, 17 - + + True + + + False + + + NoControl + + + 10, 489 + + + 101, 13 + + + 45 + + + New Column Name: + + + lblNewColumnName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + False + + + 115, 485 + + + 174, 21 + + + 46 + + + ucrInputNewColumnName + + + instat.ucrInputTextBox, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 1 + + + 10, 456 + + + 228, 20 + + + 43 + + + ucrChkIncludeLogicalColumns + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 2 + + + 291, 456 + + + 228, 20 + + + 0 + + + ucrChkIncludeCalculatedColumns + + + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 3 + + 10, 293 - + 172, 20 - - 26 + + 25 - - ucrChkRange2 + + ucrChkRangeElement2 - + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 0 + + 4 True - 36 + 25 6, 13 - 527, 520 + 527, 573 188, 356 @@ -793,7 +862,7 @@ 50, 20 - 37 + 35 ucrNudJump @@ -805,28 +874,28 @@ $this - 14 + 17 - + 10, 264 - + 172, 20 - + 19 - - ucrChkRange + + ucrChkRangeElement1 - + instat.ucrCheck, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - + $this - - 15 + + 18 188, 324 @@ -835,7 +904,7 @@ 50, 20 - 34 + 32 ucrNudSame @@ -847,7 +916,7 @@ $this - 17 + 20 188, 389 @@ -856,7 +925,7 @@ 50, 20 - 40 + 38 ucrNudDifference @@ -868,28 +937,7 @@ $this - 19 - - - 188, 422 - - - 50, 20 - - - 43 - - - ucrNudOutlier - - - instat.ucrNud, instat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 20 + 22 291, 293 @@ -898,7 +946,7 @@ 50, 20 - 31 + 29 ucrNudRangeElement2Max @@ -910,7 +958,7 @@ $this - 21 + 23 10, 422 @@ -919,7 +967,7 @@ 100, 20 - 42 + 40 ucrChkOutlier @@ -931,7 +979,7 @@ $this - 22 + 24 188, 293 @@ -940,7 +988,7 @@ 50, 20 - 28 + 26 ucrNudRangeElement2Min @@ -952,7 +1000,7 @@ $this - 23 + 25 291, 264 @@ -961,7 +1009,7 @@ 50, 20 - 24 + 23 ucrNudRangeElement1Max @@ -973,7 +1021,7 @@ $this - 24 + 26 10, 324 @@ -982,7 +1030,7 @@ 100, 20 - 33 + 31 ucrChkSame @@ -994,7 +1042,7 @@ $this - 25 + 27 188, 264 @@ -1003,7 +1051,7 @@ 50, 20 - 21 + 20 ucrNudRangeElement1Min @@ -1015,7 +1063,7 @@ $this - 26 + 28 10, 356 @@ -1024,7 +1072,7 @@ 100, 20 - 36 + 34 ucrChkJump @@ -1036,7 +1084,7 @@ $this - 27 + 29 10, 389 @@ -1045,7 +1093,7 @@ 100, 20 - 39 + 37 ucrChkDifference @@ -1057,7 +1105,7 @@ $this - 28 + 30 392, 334 @@ -1081,7 +1129,7 @@ $this - 35 + 37 392, 287 @@ -1105,7 +1153,7 @@ $this - 36 + 38 392, 240 @@ -1129,7 +1177,7 @@ $this - 37 + 39 392, 193 @@ -1153,7 +1201,7 @@ $this - 38 + 40 392, 146 @@ -1177,7 +1225,7 @@ $this - 39 + 41 392, 99 @@ -1201,7 +1249,7 @@ $this - 40 + 42 10, 76 @@ -1225,16 +1273,16 @@ $this - 41 + 43 - 10, 458 + 10, 516 410, 52 - 45 + 47 ucrBase @@ -1246,7 +1294,7 @@ $this - 42 + 44 95, 13 @@ -1267,7 +1315,7 @@ $this - 43 + 45 CenterScreen @@ -1309,6 +1357,6 @@ $this - 13 + 16 \ No newline at end of file diff --git a/instat/dlgClimaticCheckDataTemperature.vb b/instat/dlgClimaticCheckDataTemperature.vb index 1e78320ffe3..c33d8608274 100644 --- a/instat/dlgClimaticCheckDataTemperature.vb +++ b/instat/dlgClimaticCheckDataTemperature.vb @@ -14,16 +14,19 @@ ' 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 dlgClimaticCheckDataTemperature Private bFirstload As Boolean = True Private bReset As Boolean = True Private strCurrDataFrame As String - Private clsGroupByFunc, clsListFunc, clsTempFilterFunc, clsRunCalcFunc As New RFunction - 'Range + Private clsGroupByFunc, clsGroupingListFunc, clsCalcFilterFunc, clsRunCalcFunc As New RFunction + 'logical columns + Private clsFilterListFunc, clsFilterFunc As New RFunction + 'Range Private clsGreaterEqualToOperator, clsLessEqualToOperator, clsRangeOrOperator, clsRangeOr2Opertor, clsGreaterEqualTo2Operator, clsLessEqualTo2Operator, clsRange2OrOperator As New ROperator 'Jump - Private clsConcFunc, clsDiffFunc, clsAbsFunc As RFunction + Private clsConcFunc, clsDiffFunc, clsAbsFunc As New RFunction Private clsJumpGreaterOperator As New ROperator 'Same Private clsRepFunc, clsRleFunc, clsAsNumFunc As New RFunction @@ -31,8 +34,14 @@ Public Class dlgClimaticCheckDataTemperature 'Difference Private clsDiffOperator, clsLessDiffOperator As New ROperator 'Combined - Private clsOrOperator As New ROperator - + Private clsOrOperator As New ROperator + 'outliers + Private clsGroupByMonth, clsListForOutlierManipulations, clsOutlierLimitUpperFunc, clsOutlierLimitUpperCalc, clsOutlierLimitLowerFunc, clsOutlierLimitLowerCalc, clsListSubCalc As New RFunction + Private clsOutlierLimitUpperFuncTmin, clsOutlierLimitUpperCalcTmin, clsOutlierLimitLowerFuncTmin, clsOutlierLimitLowerCalcTmin As New RFunction + Private clsOutlierUpperOperator, clsOutlierLowerOperator As New ROperator + Private clsOutlierUpperOperatorTmin, clsOutlierLowerOperatorTmin As New ROperator + Private clsOutlierCombinedOperator As New ROperator + Private Sub dlgClimaticCheckDataTemperature_Load(sender As Object, e As EventArgs) Handles MyBase.Load autoTranslate(Me) If bFirstload Then @@ -52,11 +61,10 @@ Public Class dlgClimaticCheckDataTemperature 'TODO: Not yet implemented. rdoMultiple.Enabled = False rdoSatelite.Enabled = False - rdoIndividual.Checked = True - - ucrChkOutlier.Enabled = False - ucrNudOutlier.Enabled = False - lblNudOutlier.Enabled = False + rdoIndividual.Checked = True + + ucrChkIncludeCalculatedColumns.Enabled = False + Dim lstLabels As New List(Of Control) lstLabels.AddRange({lblRangeElement1to, lblNudRangeElement1Min, lblNudRangeElement1Max}) @@ -94,7 +102,7 @@ Public Class dlgClimaticCheckDataTemperature ucrReceiverDay.SetParameterIsString() ucrReceiverDay.bWithQuotes = False ucrReceiverDay.bAutoFill = True - ucrReceiverDay.AddIncludedMetadataProperty("Climatic_Type", {Chr(34) & "doy" & Chr(34)}) + ucrReceiverDay.SetClimaticType("doy") ucrReceiverDay.strSelectorHeading = "Day Variables" 'Element Receiver @@ -109,17 +117,17 @@ Public Class dlgClimaticCheckDataTemperature ucrReceiverElement2.bWithQuotes = False 'Checkboxes for options - ucrChkRange.SetParameter(New RParameter("range", clsRangeOrOperator, 1), bNewChangeParameterValue:=False) - ucrChkRange.SetText("Acceptable Range(Element1)") + ucrChkRangeElement1.SetParameter(New RParameter("range", clsRangeOrOperator, 1), bNewChangeParameterValue:=False) + ucrChkRangeElement1.SetText("Acceptable Range (Element1)") - ucrChkRange2.SetParameter(New RParameter("range2", clsRange2OrOperator, 1), bNewChangeParameterValue:=False) - ucrChkRange2.SetText("Acceptable Range(Element2)") + ucrChkRangeElement2.SetParameter(New RParameter("range2", clsRange2OrOperator, 1), bNewChangeParameterValue:=False) + ucrChkRangeElement2.SetText("Acceptable Range (Element2)") 'Linking controls - ucrChkRange.AddToLinkedControls(ucrNudRangeElement1Min, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) - ucrChkRange.AddToLinkedControls(ucrNudRangeElement1Max, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=50) - ucrChkRange2.AddToLinkedControls(ucrNudRangeElement2Min, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) - ucrChkRange2.AddToLinkedControls(ucrNudRangeElement2Max, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=30) + ucrChkRangeElement1.AddToLinkedControls(ucrNudRangeElement1Min, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) + ucrChkRangeElement1.AddToLinkedControls(ucrNudRangeElement1Max, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=50) + ucrChkRangeElement2.AddToLinkedControls(ucrNudRangeElement2Min, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) + ucrChkRangeElement2.AddToLinkedControls(ucrNudRangeElement2Max, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=30) ucrNudRangeElement2Min.SetLinkedDisplayControl(lstLabels2) ucrNudRangeElement1Min.SetLinkedDisplayControl(lstLabels) ucrNudJump.SetLinkedDisplayControl(lblNudJump) @@ -128,16 +136,17 @@ Public Class dlgClimaticCheckDataTemperature ucrReceiverElement2.SetLinkedDisplayControl(lblElement2) ucrChkSame.SetParameter(New RParameter("same", clsSameGreaterOperator, 1), bNewChangeParameterValue:=False) - ucrChkSame.SetText("Same") + ucrChkSame.SetText("Same (Element1)") ucrChkSame.AddToLinkedControls(ucrNudSame, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=4) ucrChkJump.SetParameter(New RParameter("jump", clsJumpGreaterOperator, 1), bNewChangeParameterValue:=False) - ucrChkJump.SetText("Jump") + ucrChkJump.SetText("Jump (Element1)") ucrChkJump.AddToLinkedControls(ucrNudJump, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=10) ucrChkDifference.SetParameter(New RParameter("diff", clsLessDiffOperator, 1), bNewChangeParameterValue:=False) - ucrChkDifference.SetText("Difference") - + ucrChkDifference.SetText("Difference") + + ucrChkOutlier.SetParameter(New RParameter("Combined_outlier", clsOutlierCombinedOperator, 1), bNewChangeParameterValue:=False) ucrChkOutlier.SetText("Outlier") 'Nuds for the respective options @@ -160,6 +169,8 @@ Public Class dlgClimaticCheckDataTemperature 'Jump Option ucrNudJump.SetParameter(New RParameter("from", iNewPosition:=1, bNewIncludeArgumentName:=False)) ucrNudJump.SetMinMax(1, 25) + ucrNudJump.DecimalPlaces = 1 + ucrNudJump.Increment = 0.1 'Difference Option ucrNudDifference.SetParameter(New RParameter("n", iNewPosition:=1, bNewIncludeArgumentName:=False)) @@ -168,17 +179,40 @@ Public Class dlgClimaticCheckDataTemperature ucrNudDifference.Increment = 0.1 ucrChkDifference.AddToLinkedControls(ucrNudDifference, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) + ucrChkIncludeCalculatedColumns.SetText("Include calculated columns") + ucrChkIncludeCalculatedColumns.AddParameterPresentCondition(True, "sub1", True) + ucrChkIncludeCalculatedColumns.AddParameterPresentCondition(False, "sub1", False) + + ucrChkIncludeLogicalColumns.SetText("Include logical columns") + ucrChkIncludeLogicalColumns.SetParameter(New RParameter("save")) + ucrChkIncludeLogicalColumns.SetValuesCheckedAndUnchecked("2", "0") + + 'ucrChkIncludeLogicalColumns.AddToLinkedControls(ucrInputNewColumnName, {True}, bNewLinkedHideIfParameterMissing:=True) + 'ucrInputNewColumnName.SetLinkedDisplayControl(lblNewColumnName) + + 'TODO:To be added in future. + 'save + 'ucrInputNewColumnName.SetParameter(New RParameter("result_name", 2)) + 'ucrInputNewColumnName.SetDataFrameSelector(ucrSelectorTemperature.ucrAvailableDataFrames) + 'ucrInputNewColumnName.SetName("Qc") + 'outliers Option - ucrChkOutlier.AddToLinkedControls(ucrNudOutlier, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=2.5) + ttOutliers.SetToolTip(ucrChkOutlier, "Values that are further than this number of IQRs from the corresponding quartile.") End Sub Private Sub SetDefaults() - Dim strLengths As String = "lengths" + Dim strLengths As String = "lengths" + Dim strUpper_Outlier_Limit_Tmax As String = "upper_outlier_limit_Tmax" + Dim strLower_Outlier_Limit_Tmax As String = "lower_outlier_limit_Tmax" + Dim strUpper_Outlier_Limit_Tmin As String = "upper_outlier_limit_Tmin" + Dim strLower_Outlier_Limit_Tmin As String = "lower_outlier_limit_Tmin" clsGroupByFunc = New RFunction - clsListFunc = New RFunction - clsTempFilterFunc = New RFunction + clsGroupingListFunc = New RFunction + clsCalcFilterFunc = New RFunction + clsFilterFunc = New RFunction + clsFilterListFunc = New RFunction clsRunCalcFunc = New RFunction clsGreaterEqualToOperator = New ROperator clsLessEqualToOperator = New ROperator @@ -194,6 +228,11 @@ Public Class dlgClimaticCheckDataTemperature clsLessEqualTo2Operator = New ROperator clsGreaterEqualTo2Operator = New ROperator + clsOutlierUpperOperator.Clear() + clsOutlierLowerOperator.Clear() + clsOutlierUpperOperatorTmin.Clear() + clsOutlierLowerOperatorTmin.Clear() + clsRangeOrOperator.Clear() clsRange2OrOperator.Clear() clsSameGreaterOperator.Clear() @@ -207,8 +246,8 @@ Public Class dlgClimaticCheckDataTemperature clsGroupByFunc.SetRCommand("instat_calculation$new") clsGroupByFunc.AddParameter("type", Chr(34) & "by" & Chr(34), iPosition:=0) clsGroupByFunc.SetAssignTo("grouping") - clsListFunc.SetRCommand("list") - clsListFunc.AddParameter("list", bIncludeArgumentName:=False, clsRFunctionParameter:=clsGroupByFunc, iPosition:=0) + clsGroupingListFunc.SetRCommand("list") + clsGroupingListFunc.AddParameter("list", bIncludeArgumentName:=False, clsRFunctionParameter:=clsGroupByFunc, iPosition:=0) 'Range clsGreaterEqualToOperator.SetOperation(">=") @@ -253,21 +292,109 @@ Public Class dlgClimaticCheckDataTemperature clsLessDiffOperator.AddParameter("left", bIncludeArgumentName:=False, clsROperatorParameter:=clsDiffOperator, iPosition:=0) clsDiffOperator.SetOperation("-") - 'Main Filter - clsTempFilterFunc.SetRCommand("instat_calculation$new") - clsTempFilterFunc.AddParameter("type", Chr(34) & "filter" & Chr(34), iPosition:=0) - clsTempFilterFunc.AddParameter("save", "2", iPosition:=4) - clsTempFilterFunc.AddParameter("result_data_frame", Chr(34) & "Temperature_Filter" & Chr(34), iPosition:=5) - clsTempFilterFunc.SetAssignTo("temp_filter") - clsTempFilterFunc.AddParameter("function_exp", clsROperatorParameter:=clsOrOperator, iPosition:=1) + 'Group By Month for Outliers + clsGroupByMonth.SetRCommand("instat_calculation$new") + clsGroupByMonth.AddParameter("type", Chr(34) & "by" & Chr(34), iPosition:=0) + clsGroupByMonth.SetAssignTo("grouping_month") + + clsListForOutlierManipulations.SetRCommand("list") + clsListForOutlierManipulations.AddParameter("sub1", clsRFunctionParameter:=clsGroupByMonth, bIncludeArgumentName:=False, iPosition:=0) + + 'Tmax + 'Upper Outlier Limit function and calc + clsOutlierLimitUpperCalc.SetRCommand("instat_calculation$new") + clsOutlierLimitUpperCalc.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsOutlierLimitUpperCalc.AddParameter("function_exp", clsRFunctionParameter:=clsOutlierLimitUpperFunc, iPosition:=1) + clsOutlierLimitUpperCalc.AddParameter("result_name", Chr(34) & strUpper_Outlier_Limit_Tmax & Chr(34), iPosition:=4) + clsOutlierLimitUpperCalc.AddParameter("save", "0", iPosition:=5) + clsOutlierLimitUpperCalc.SetAssignTo("upper_outlier_limit_Tmax") + clsOutlierLimitUpperFunc.AddParameter("bupperlimit", "TRUE") + clsOutlierLimitUpperFunc.SetRCommand("summary_outlier_limit") + clsOutlierLimitUpperFunc.bToScriptAsRString = True + + 'Lower outlier limit Function and Calc + clsOutlierLimitLowerCalc.SetRCommand("instat_calculation$new") + clsOutlierLimitLowerCalc.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsOutlierLimitLowerCalc.AddParameter("function_exp", clsRFunctionParameter:=clsOutlierLimitLowerFunc, iPosition:=1) + clsOutlierLimitLowerCalc.AddParameter("result_name", Chr(34) & strLower_Outlier_Limit_Tmax & Chr(34), iPosition:=4) + clsOutlierLimitLowerCalc.AddParameter("save", "0", iPosition:=5) + clsOutlierLimitLowerCalc.SetAssignTo("lower_outlier_limit_Tmax") + clsOutlierLimitLowerFunc.AddParameter("bupperlimit", "FALSE") + clsOutlierLimitLowerFunc.SetRCommand("summary_outlier_limit") + clsOutlierLimitLowerFunc.bToScriptAsRString = True + + 'Upper Outlier Operator + clsOutlierUpperOperator.SetOperation(">") + clsOutlierUpperOperator.AddParameter("right", strUpper_Outlier_Limit_Tmax, iPosition:=1) + 'Lower Outlier Operator + clsOutlierLowerOperator.SetOperation("<") + clsOutlierLowerOperator.AddParameter("right", strLower_Outlier_Limit_Tmax, iPosition:=1) + + 'Tmin + 'Upper Outlier Limit function and calc + clsOutlierLimitUpperCalcTmin.SetRCommand("instat_calculation$new") + clsOutlierLimitUpperCalcTmin.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsOutlierLimitUpperCalcTmin.AddParameter("function_exp", clsRFunctionParameter:=clsOutlierLimitUpperFuncTmin, iPosition:=1) + clsOutlierLimitUpperCalcTmin.AddParameter("result_name", Chr(34) & strUpper_Outlier_Limit_Tmin & Chr(34), iPosition:=4) + clsOutlierLimitUpperCalcTmin.AddParameter("save", "0", iPosition:=5) + clsOutlierLimitUpperCalcTmin.SetAssignTo("upper_outlier_limit_Tmin") + clsOutlierLimitUpperFuncTmin.AddParameter("bupperlimit", "TRUE") + clsOutlierLimitUpperFuncTmin.SetRCommand("summary_outlier_limit") + clsOutlierLimitUpperFuncTmin.bToScriptAsRString = True + + 'Lower outlier limit Function and Calc + clsOutlierLimitLowerCalcTmin.SetRCommand("instat_calculation$new") + clsOutlierLimitLowerCalcTmin.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsOutlierLimitLowerCalcTmin.AddParameter("function_exp", clsRFunctionParameter:=clsOutlierLimitLowerFuncTmin, iPosition:=1) + clsOutlierLimitLowerCalcTmin.AddParameter("result_name", Chr(34) & strLower_Outlier_Limit_Tmin & Chr(34), iPosition:=4) + clsOutlierLimitLowerCalcTmin.AddParameter("save", "0", iPosition:=5) + clsOutlierLimitLowerCalcTmin.SetAssignTo("lower_outlier_limit_Tmin") + clsOutlierLimitLowerFuncTmin.AddParameter("bupperlimit", "FALSE") + clsOutlierLimitLowerFuncTmin.SetRCommand("summary_outlier_limit") + clsOutlierLimitLowerFuncTmin.bToScriptAsRString = True + + 'Sub Calculations List for temp_filter + clsListSubCalc.SetRCommand("list") + + 'Upper Outlier Operator + clsOutlierUpperOperatorTmin.SetOperation(">") + clsOutlierUpperOperatorTmin.AddParameter("right", strUpper_Outlier_Limit_Tmin, iPosition:=1) + + 'Lower Outlier Operator + clsOutlierLowerOperatorTmin.SetOperation("<") + clsOutlierLowerOperatorTmin.AddParameter("right", strLower_Outlier_Limit_Tmin, iPosition:=1) + + 'outlier limits combined + clsOutlierCombinedOperator.SetOperation("|") + + 'Main calculation filter + clsCalcFilterFunc.SetRCommand("instat_calculation$new") + clsCalcFilterFunc.AddParameter("type", Chr(34) & "calculation" & Chr(34), iPosition:=0) + clsCalcFilterFunc.AddParameter("result_name", Chr(34) & "QC" & Chr(34)) + clsCalcFilterFunc.SetAssignTo("Filter_Calculation") + clsCalcFilterFunc.AddParameter("function_exp", clsROperatorParameter:=clsOrOperator, iPosition:=1) + + 'Logical columns + clsFilterFunc.SetRCommand("instat_calculation$new") + clsFilterFunc.AddParameter("type", Chr(34) & "filter" & Chr(34), iPosition:=0) + clsFilterFunc.AddParameter("function_exp", strParameterValue:=Chr(34) & "QC" & Chr(34), iPosition:=1) + clsFilterFunc.AddParameter("sub_calculations", clsRFunctionParameter:=clsFilterListFunc, iPosition:=2) + clsFilterFunc.AddParameter("save", "2", iPosition:=3) + clsFilterFunc.AddParameter("result_data_frame", Chr(34) & "Filter" & Chr(34), iPosition:=4) + clsFilterFunc.SetAssignTo("filtered_data") + + clsFilterListFunc.SetRCommand("list") + clsFilterListFunc.AddParameter("sub", clsRFunctionParameter:=clsCalcFilterFunc, bIncludeArgumentName:=False) + + clsFilterFunc.SetAssignTo("filtered_data") 'Combined clsOrOperator.SetOperation("|") clsOrOperator.bBrackets = False - clsOrOperator.bToScriptAsRString = True - + clsOrOperator.bToScriptAsRString = True + clsRunCalcFunc.SetRCommand("InstatDataObject$run_instat_calculation") - clsRunCalcFunc.AddParameter("calc", clsRFunctionParameter:=clsTempFilterFunc, iPosition:=0) + clsRunCalcFunc.AddParameter("calc", clsRFunctionParameter:=clsFilterFunc, iPosition:=0) clsRunCalcFunc.AddParameter("display", "FALSE") ucrBase.clsRsyntax.SetBaseRFunction(clsRunCalcFunc) End Sub @@ -277,8 +404,17 @@ Public Class dlgClimaticCheckDataTemperature ucrReceiverElement1.AddAdditionalCodeParameterPair(clsDiffFunc, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) ucrReceiverElement1.AddAdditionalCodeParameterPair(clsDiffOperator, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=3) ucrReceiverElement1.AddAdditionalCodeParameterPair(clsAsNumFunc, New RParameter("x", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=4) + ucrReceiverElement1.AddAdditionalCodeParameterPair(clsOutlierUpperOperator, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=5) + ucrReceiverElement1.AddAdditionalCodeParameterPair(clsOutlierLowerOperator, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=6) + ucrReceiverElement1.AddAdditionalCodeParameterPair(clsOutlierLimitUpperFunc, New RParameter("x", 0), iAdditionalPairNo:=7) + ucrReceiverElement1.AddAdditionalCodeParameterPair(clsOutlierLimitLowerFunc, New RParameter("x", 0), iAdditionalPairNo:=8) ucrReceiverElement2.AddAdditionalCodeParameterPair(clsGreaterEqualTo2Operator, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=1) ucrReceiverElement2.AddAdditionalCodeParameterPair(clsLessEqualTo2Operator, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=2) + ucrReceiverElement2.AddAdditionalCodeParameterPair(clsOutlierUpperOperatorTmin, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=3) + ucrReceiverElement2.AddAdditionalCodeParameterPair(clsOutlierLowerOperatorTmin, New RParameter("left", 0, bNewIncludeArgumentName:=False), iAdditionalPairNo:=4) + ucrReceiverElement2.AddAdditionalCodeParameterPair(clsOutlierLimitUpperFuncTmin, New RParameter("x", 0), iAdditionalPairNo:=5) + ucrReceiverElement2.AddAdditionalCodeParameterPair(clsOutlierLimitLowerFuncTmin, New RParameter("x", 0), iAdditionalPairNo:=6) + ucrChkOutlier.AddAdditionalCodeParameterPair(clsCalcFilterFunc, New RParameter("sub_calculations", strParamValue:=clsListSubCalc), iAdditionalPairNo:=1) ucrNudRangeElement2Max.SetRCode(clsGreaterEqualTo2Operator, bReset) ucrNudRangeElement2Min.SetRCode(clsLessEqualTo2Operator, bReset) @@ -290,26 +426,79 @@ Public Class dlgClimaticCheckDataTemperature ucrNudDifference.SetRCode(clsLessDiffOperator, bReset) ucrNudSame.SetRCode(clsSameGreaterOperator, bReset) ucrChkDifference.SetRCode(clsOrOperator, bReset) - ucrChkRange.SetRCode(clsOrOperator, bReset) - ucrChkRange2.SetRCode(clsOrOperator, bReset) + ucrChkRangeElement1.SetRCode(clsOrOperator, bReset) + ucrChkRangeElement2.SetRCode(clsOrOperator, bReset) ucrChkSame.SetRCode(clsOrOperator, bReset) ucrChkJump.SetRCode(clsOrOperator, bReset) + ucrChkIncludeLogicalColumns.SetRCode(clsCalcFilterFunc, bReset) + ucrChkOutlier.SetRCode(clsOrOperator, bReset) End Sub - Private Sub TestOkEnabled() - If ucrChkRange.Checked AndAlso Not ucrReceiverElement1.IsEmpty() AndAlso ucrNudRangeElement1Min.GetText <> "" AndAlso ucrNudRangeElement1Max.GetText <> "" Then - ucrBase.OKEnabled(True) - ElseIf ucrChkRange2.Checked AndAlso Not ucrReceiverElement2.IsEmpty() AndAlso ucrNudRangeElement2Min.GetText <> "" AndAlso ucrNudRangeElement2Max.GetText <> "" Then - ucrBase.OKEnabled(True) - ElseIf Not ucrReceiverElement1.IsEmpty AndAlso ucrChkSame.Checked AndAlso ucrNudSame.GetText <> "" Then - ucrBase.OKEnabled(True) - ElseIf Not ucrReceiverElement1.IsEmpty AndAlso ucrChkJump.Checked AndAlso ucrNudJump.GetText <> "" Then - ucrBase.OKEnabled(True) - ElseIf ucrChkDifference.Checked AndAlso ucrNudDifference.GetText <> "" AndAlso Not ucrReceiverElement1.IsEmpty AndAlso Not ucrReceiverElement2.IsEmpty Then - ucrBase.OKEnabled(True) - Else + Private Sub TestOkEnabled() + + Dim bEnable As Boolean = False + + If ucrReceiverElement1.IsEmpty() AndAlso ucrReceiverElement2.IsEmpty() Then + ucrBase.OKEnabled(False) + Exit Sub + ElseIf ucrReceiverElement1.IsEmpty() OrElse ucrReceiverElement2.IsEmpty() AndAlso ucrChkDifference.Checked Then + ucrBase.OKEnabled(False) + Exit Sub + ElseIf ucrReceiverElement1.IsEmpty() AndAlso (ucrChkRangeElement1.Checked OrElse ucrChkSame.Checked OrElse ucrChkJump.Checked) Then ucrBase.OKEnabled(False) + Exit Sub + ElseIf ucrReceiverElement2.IsEmpty() AndAlso ucrChkRangeElement2.Checked Then + ucrBase.OKEnabled(False) + Exit Sub End If + + If ucrChkRangeElement1.Checked Then + If ucrNudRangeElement1Min.GetText <> "" AndAlso ucrNudRangeElement1Max.GetText <> "" Then + bEnable = True + Else + ucrBase.OKEnabled(False) + Exit Sub + End If + End If + If ucrChkRangeElement2.Checked Then + If ucrNudRangeElement2Min.GetText <> "" AndAlso ucrNudRangeElement2Max.GetText <> "" Then + bEnable = True + Else + ucrBase.OKEnabled(False) + Exit Sub + End If + End If + If ucrChkSame.Checked Then + If ucrNudSame.GetText <> "" Then + bEnable = True + Else + ucrBase.OKEnabled(False) + Exit Sub + End If + End If + If ucrChkJump.Checked Then + If ucrNudJump.GetText <> "" Then + bEnable = True + Else + ucrBase.OKEnabled(False) + Exit Sub + End If + End If + If ucrChkDifference.Checked Then + If ucrNudDifference.GetText <> "" Then + bEnable = True + Else + ucrBase.OKEnabled(False) + Exit Sub + End If + + End If + If ucrChkOutlier.Checked Then + bEnable = True + End If + + ucrBase.OKEnabled(bEnable) + End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -321,40 +510,102 @@ Public Class dlgClimaticCheckDataTemperature Private Sub GroupByOptions() If Not ucrReceiverStation.IsEmpty Then clsGroupByFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverStation.GetVariableNames & ")", iPosition:=1) - clsTempFilterFunc.AddParameter("manipulations", clsRFunctionParameter:=clsListFunc, iPosition:=3) + clsCalcFilterFunc.AddParameter("manipulations", clsRFunctionParameter:=clsGroupingListFunc, iPosition:=3) + clsFilterFunc.AddParameter("manipulations", clsRFunctionParameter:=clsGroupingListFunc, iPosition:=3) Else - clsTempFilterFunc.RemoveParameterByName("manipulations") + clsCalcFilterFunc.RemoveParameterByName("manipulations") + clsFilterFunc.RemoveParameterByName("manipulations") End If - End Sub - - Private Sub FilterFunc() - If ucrChkRange.Checked Then - If Not ucrReceiverElement1.IsEmpty Then - clsTempFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & ")", iPosition:=2) + End Sub + + Private Sub GroupByMonth() + If Not ucrReceiverMonth.IsEmpty Then + clsGroupByMonth.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverMonth.GetVariableNames & ")", iPosition:=1) + If Not ucrReceiverElement1.IsEmpty() Then + clsOutlierLimitUpperCalc.AddParameter("manipulations", clsRFunctionParameter:=clsListForOutlierManipulations, iPosition:=3) + clsOutlierLimitLowerCalc.AddParameter("manipulations", clsRFunctionParameter:=clsListForOutlierManipulations, iPosition:=3) + ElseIf ucrReceiverElement1.IsEmpty() Then + clsOutlierLimitUpperCalc.RemoveParameterByName("manipulations") + clsOutlierLimitLowerCalc.RemoveParameterByName("manipulations") End If - ElseIf ucrChkRange2.Checked Then - If Not ucrReceiverElement2.IsEmpty Then - clsTempFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + If Not ucrReceiverElement2.IsEmpty() Then + clsOutlierLimitUpperCalcTmin.AddParameter("manipulations", clsRFunctionParameter:=clsListForOutlierManipulations, iPosition:=3) + clsOutlierLimitLowerCalcTmin.AddParameter("manipulations", clsRFunctionParameter:=clsListForOutlierManipulations, iPosition:=3) + ElseIf ucrReceiverElement2.IsEmpty Then + clsOutlierLimitUpperCalcTmin.RemoveParameterByName("manipulations") + clsOutlierLimitLowerCalcTmin.RemoveParameterByName("manipulations") End If Else - clsTempFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & ")", iPosition:=2) + clsOutlierLimitUpperCalc.RemoveParameterByName("manipulations") + clsOutlierLimitLowerCalc.RemoveParameterByName("manipulations") + clsOutlierLimitUpperCalcTmin.RemoveParameterByName("manipulations") + clsOutlierLimitLowerCalcTmin.RemoveParameterByName("manipulations") + End If + End Sub + + Private Sub FilterFunc() + If Not ucrReceiverElement1.IsEmpty Then + clsOutlierLimitUpperCalc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & ")", iPosition:=2) + clsOutlierLimitLowerCalc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & ")", iPosition:=2) + End If + If Not ucrReceiverElement2.IsEmpty Then + clsOutlierLimitUpperCalcTmin.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + clsOutlierLimitLowerCalcTmin.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + End If + If Not ucrReceiverElement1.IsEmpty AndAlso Not ucrReceiverElement2.IsEmpty Then + clsCalcFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & "," & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + clsFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & "," & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + clsListSubCalc.AddParameter("sub1", clsRFunctionParameter:=clsOutlierLimitUpperCalc, bIncludeArgumentName:=False, iPosition:=0) + clsListSubCalc.AddParameter("sub2", clsRFunctionParameter:=clsOutlierLimitLowerCalc, bIncludeArgumentName:=False, iPosition:=1) + clsListSubCalc.AddParameter("sub3", clsRFunctionParameter:=clsOutlierLimitUpperCalcTmin, bIncludeArgumentName:=False, iPosition:=2) + clsListSubCalc.AddParameter("sub4", clsRFunctionParameter:=clsOutlierLimitLowerCalcTmin, bIncludeArgumentName:=False, iPosition:=3) + clsOutlierCombinedOperator.AddParameter("sub1", clsROperatorParameter:=clsOutlierUpperOperator, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.AddParameter("sub2", clsROperatorParameter:=clsOutlierLowerOperator, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.AddParameter("sub3", clsROperatorParameter:=clsOutlierUpperOperatorTmin, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.AddParameter("sub4", clsROperatorParameter:=clsOutlierLowerOperatorTmin, bIncludeArgumentName:=False) + ElseIf Not ucrReceiverElement1.IsEmpty Then + clsCalcFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & ")", iPosition:=2) + clsFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement1.GetVariableNames & ")", iPosition:=2) + clsListSubCalc.AddParameter("sub1", clsRFunctionParameter:=clsOutlierLimitUpperCalc, bIncludeArgumentName:=False, iPosition:=0) + clsListSubCalc.AddParameter("sub2", clsRFunctionParameter:=clsOutlierLimitLowerCalc, bIncludeArgumentName:=False, iPosition:=1) + clsListSubCalc.RemoveParameterByName("sub3") + clsListSubCalc.RemoveParameterByName("sub4") + clsOutlierCombinedOperator.AddParameter("sub1", clsROperatorParameter:=clsOutlierUpperOperator, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.AddParameter("sub2", clsROperatorParameter:=clsOutlierLowerOperator, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.RemoveParameterByName("sub3") + clsOutlierCombinedOperator.RemoveParameterByName("sub4") + ElseIf Not ucrReceiverElement2.IsEmpty Then + clsCalcFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + clsFilterFunc.AddParameter("calculated_from", "list(" & strCurrDataFrame & "=" & ucrReceiverElement2.GetVariableNames & ")", iPosition:=2) + clsListSubCalc.AddParameter("sub3", clsRFunctionParameter:=clsOutlierLimitUpperCalcTmin, bIncludeArgumentName:=False, iPosition:=2) + clsListSubCalc.AddParameter("sub4", clsRFunctionParameter:=clsOutlierLimitLowerCalcTmin, bIncludeArgumentName:=False, iPosition:=3) + clsListSubCalc.RemoveParameterByName("sub1") + clsListSubCalc.RemoveParameterByName("sub2") + clsOutlierCombinedOperator.AddParameter("sub3", clsROperatorParameter:=clsOutlierUpperOperatorTmin, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.AddParameter("sub4", clsROperatorParameter:=clsOutlierLowerOperatorTmin, bIncludeArgumentName:=False) + clsOutlierCombinedOperator.RemoveParameterByName("sub1") + clsOutlierCombinedOperator.RemoveParameterByName("sub2") End If End Sub Private Sub ucrSelectorTemperature_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorTemperature.ControlValueChanged strCurrDataFrame = Chr(34) & ucrSelectorTemperature.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & Chr(34) - GroupByOptions() End Sub Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged GroupByOptions() - End Sub - - Private Sub ucrReceiverElement_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement1.ControlValueChanged, ucrReceiverElement2.ControlValueChanged, ucrChkRange.ControlValueChanged, ucrChkRange2.ControlValueChanged + End Sub + + + Private Sub ucrReceiverElement_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement1.ControlValueChanged, ucrReceiverElement2.ControlValueChanged FilterFunc() End Sub - Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement1.ControlContentsChanged, ucrReceiverElement2.ControlContentsChanged, ucrNudSame.ControlContentsChanged, ucrNudRangeElement1Min.ControlContentsChanged, ucrNudRangeElement1Max.ControlContentsChanged, ucrNudRangeElement2Min.ControlContentsChanged, ucrNudRangeElement2Max.ControlContentsChanged, ucrNudJump.ControlContentsChanged, ucrNudRangeElement2Min.ControlContentsChanged, ucrNudRangeElement2Max.ControlContentsChanged, ucrNudDifference.ControlContentsChanged, ucrChkRange.ControlContentsChanged, ucrChkRange2.ControlContentsChanged, ucrChkJump.ControlContentsChanged, ucrChkDifference.ControlContentsChanged, ucrChkSame.ControlContentsChanged + Private Sub CoreControls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement1.ControlContentsChanged, ucrReceiverElement2.ControlContentsChanged, ucrNudSame.ControlContentsChanged, ucrNudRangeElement1Min.ControlContentsChanged, ucrNudRangeElement1Max.ControlContentsChanged, ucrNudRangeElement2Min.ControlContentsChanged, ucrNudRangeElement2Max.ControlContentsChanged, ucrNudJump.ControlContentsChanged, ucrNudRangeElement2Min.ControlContentsChanged, ucrNudRangeElement2Max.ControlContentsChanged, ucrNudDifference.ControlContentsChanged, ucrChkRangeElement1.ControlContentsChanged, ucrChkRangeElement2.ControlContentsChanged, ucrChkJump.ControlContentsChanged, ucrChkDifference.ControlContentsChanged, ucrChkSame.ControlContentsChanged, ucrChkOutlier.ControlContentsChanged TestOkEnabled() End Sub + + Private Sub ucrReceiverMonth_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverMonth.ControlValueChanged + GroupByMonth() + End Sub End Class \ No newline at end of file diff --git a/instat/static/InstatObject/R/Backend_Components/summary_functions.R b/instat/static/InstatObject/R/Backend_Components/summary_functions.R index 31cb3d8abd0..5ca0963241b 100644 --- a/instat/static/InstatObject/R/Backend_Components/summary_functions.R +++ b/instat/static/InstatObject/R/Backend_Components/summary_functions.R @@ -416,7 +416,7 @@ proportion_label="proportion_calc" count_calc_label="count_calc" # list of all summary function names -all_summaries=c(sum_label, mode_label, count_label, count_missing_label, count_non_missing_label, sd_label, var_label, median_label, range_label, min_label, max_label, mean_label,quartile_label, lower_quart_label, upper_quart_label, skewness_label, kurtosis_label, summary_coef_var_label, summary_skewness_mc_label, summary_median_absolute_deviation_label, summary_Qn_label, summary_Sn_label, cor_label, cov_label,first_label, last_label, nth_label, n_distinct_label, proportion_label, count_calc_label) +all_summaries=c(sum_label, mode_label, count_label, count_missing_label, count_non_missing_label, sd_label, var_label, median_label, range_label, min_label, max_label, mean_label,quartile_label, lower_quart_label, upper_quart_label, skewness_label, kurtosis_label, summary_coef_var_label, summary_skewness_mc_label, summary_outlier_limit_label, summary_median_absolute_deviation_label, summary_Qn_label, summary_Sn_label, cor_label, cov_label,first_label, last_label, nth_label, n_distinct_label, proportion_label, count_calc_label) summary_mode <- function(x,...) { ux <- unique(x) out <- ux[which.max(tabulate(match(x, ux)))] @@ -521,12 +521,6 @@ summary_outlier_limit <- function(x, coef = 1.5, bupperlimit=TRUE, bskewedcalc=F } } -# kurtosis function -summary_kurtosis <- function(x, na.rm = FALSE, type = 2, ...) { - return(e1071::kurtosis(x, na.rm = na.rm, type = type)) -} - - # kurtosis function summary_kurtosis <- function(x, na.rm = FALSE, type = 2, ...) { return(e1071::kurtosis(x, na.rm = na.rm, type = type))