diff --git a/instat/UcrGeomListWithAes.vb b/instat/UcrGeomListWithAes.vb index f4028853efb..ef4c78eb9c2 100644 --- a/instat/UcrGeomListWithAes.vb +++ b/instat/UcrGeomListWithAes.vb @@ -344,7 +344,7 @@ Public Class ucrGeomListWithParameters 'This is a temporary solution to issue which should be solved with geoms 'This adds "" aes for x or y when no variables are mapped to them for geoms which require it, either adding to the global or local aes. - If clsGeomFunction.strRCommand = "geom_boxplot" OrElse clsGeomFunction.strRCommand = "geom_dotplot" Then + If clsGeomFunction.strRCommand = "geom_boxplot" OrElse clsGeomFunction.strRCommand = "geom_dotplot" OrElse clsGeomFunction.strRCommand = "geom_violin" Then If (clsGlobalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x") = -1 OrElse ucrChkIgnoreGlobalAes.Checked) AndAlso clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x") = -1 Then clsCurrentAesFunction.AddParameter("x", Chr(34) & Chr(34)) End If @@ -358,6 +358,9 @@ Public Class ucrGeomListWithParameters End If 'Adding stat = identity method If {"geom_bar", "geom_density", "geom_freqpoly"}.Contains(clsGeomFunction.strRCommand) Then + If (clsGlobalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x") = -1 OrElse ucrChkIgnoreGlobalAes.Checked) AndAlso clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "x") = -1 Then + clsCurrentAesFunction.AddParameter("x", Chr(34) & Chr(34)) + End If 'If there is a y in the global aes, and the global aes are not ignored or if there is a y in the local aes then in case stat has not been set manually, stat is set to identity. If (((clsGlobalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "y") <> -1) AndAlso ((clsGeomFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "inherit.aes") = -1) OrElse (Not ucrChkIgnoreGlobalAes.Checked))) OrElse (clsLocalAesFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "y") <> -1)) AndAlso (clsGeomFunction.clsParameters.FindIndex(Function(x) x.strArgumentName = "stat") = -1) Then clsGeomFunction.AddParameter("stat", Chr(34) & "identity" & Chr(34)) diff --git a/instat/dlgBoxPlot.designer.vb b/instat/dlgBoxPlot.designer.vb index a722ae22baf..ccb4edde49b 100644 --- a/instat/dlgBoxPlot.designer.vb +++ b/instat/dlgBoxPlot.designer.vb @@ -108,7 +108,7 @@ Partial Class dlgBoxplot Me.rdoBoxplotTufte.Size = New System.Drawing.Size(133, 27) Me.rdoBoxplotTufte.TabIndex = 1 Me.rdoBoxplotTufte.TabStop = True - Me.rdoBoxplotTufte.Text = "Boxplot/Tufte Boxplot" + Me.rdoBoxplotTufte.Text = "Boxplot" Me.rdoBoxplotTufte.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoBoxplotTufte.UseVisualStyleBackColor = True ' @@ -172,42 +172,42 @@ Partial Class dlgBoxplot ' Me.contextMenuStripOptions.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItemPlotOptions, Me.toolStripMenuItemBoxOptions, Me.toolStripMenuItemJitterOptions, Me.toolStripMenuItemSummaryOptions, Me.toolStripMenuItemTufteOptions, Me.toolStripMenuItemViolinOptions}) Me.contextMenuStripOptions.Name = "contextMenuStripOk" - Me.contextMenuStripOptions.Size = New System.Drawing.Size(181, 158) + Me.contextMenuStripOptions.Size = New System.Drawing.Size(171, 136) ' 'toolStripMenuItemPlotOptions ' Me.toolStripMenuItemPlotOptions.Name = "toolStripMenuItemPlotOptions" - Me.toolStripMenuItemPlotOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemPlotOptions.Size = New System.Drawing.Size(170, 22) Me.toolStripMenuItemPlotOptions.Text = "Plot Options" ' 'toolStripMenuItemBoxOptions ' Me.toolStripMenuItemBoxOptions.Name = "toolStripMenuItemBoxOptions" - Me.toolStripMenuItemBoxOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemBoxOptions.Size = New System.Drawing.Size(170, 22) Me.toolStripMenuItemBoxOptions.Text = "Boxplot Options" ' 'toolStripMenuItemJitterOptions ' Me.toolStripMenuItemJitterOptions.Name = "toolStripMenuItemJitterOptions" - Me.toolStripMenuItemJitterOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemJitterOptions.Size = New System.Drawing.Size(170, 22) Me.toolStripMenuItemJitterOptions.Text = "Jitter Options" ' 'toolStripMenuItemSummaryOptions ' Me.toolStripMenuItemSummaryOptions.Name = "toolStripMenuItemSummaryOptions" - Me.toolStripMenuItemSummaryOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemSummaryOptions.Size = New System.Drawing.Size(170, 22) Me.toolStripMenuItemSummaryOptions.Text = "Summary Options" ' 'toolStripMenuItemTufteOptions ' Me.toolStripMenuItemTufteOptions.Name = "toolStripMenuItemTufteOptions" - Me.toolStripMenuItemTufteOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemTufteOptions.Size = New System.Drawing.Size(170, 22) Me.toolStripMenuItemTufteOptions.Text = "Tufte Options" ' 'toolStripMenuItemViolinOptions ' Me.toolStripMenuItemViolinOptions.Name = "toolStripMenuItemViolinOptions" - Me.toolStripMenuItemViolinOptions.Size = New System.Drawing.Size(180, 22) + Me.toolStripMenuItemViolinOptions.Size = New System.Drawing.Size(170, 22) Me.toolStripMenuItemViolinOptions.Text = "Violin Options" ' 'ucrInputSummaries diff --git a/instat/dlgHomogenization.Designer.vb b/instat/dlgHomogenization.Designer.vb index 35b58e1b6f4..0b13188ecd5 100644 --- a/instat/dlgHomogenization.Designer.vb +++ b/instat/dlgHomogenization.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class dlgHomogenization 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 @@ -20,7 +20,7 @@ Partial Class dlgHomogenization '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.components = New System.ComponentModel.Container() Me.lblElement = New System.Windows.Forms.Label() @@ -52,20 +52,46 @@ Partial Class dlgHomogenization Me.ucrChkSummary = New instat.ucrCheck() Me.ttOptions = New System.Windows.Forms.ToolTip(Me.components) Me.rdoSingle = New System.Windows.Forms.RadioButton() - Me.rdoMultiple = New System.Windows.Forms.RadioButton() - Me.rdoNeighbouring = New System.Windows.Forms.RadioButton() Me.lblNeighbouring = New System.Windows.Forms.Label() - Me.ucrReceiverNeighbour = New instat.ucrReceiverSingle() + Me.lblStation = New System.Windows.Forms.Label() + Me.rdoPrepare = New System.Windows.Forms.RadioButton() + Me.grpStationFile = New System.Windows.Forms.GroupBox() + Me.ucrReceiverElavation = New instat.ucrReceiverSingle() + Me.lblLongtude = New System.Windows.Forms.Label() + Me.lblStationName = New System.Windows.Forms.Label() + Me.lblStationID = New System.Windows.Forms.Label() + Me.lblElavation = New System.Windows.Forms.Label() + Me.ucrReceiverStationId = New instat.ucrReceiverSingle() + Me.ucrReceiverStationName = New instat.ucrReceiverSingle() + Me.ucrReceiverLongtitude = New instat.ucrReceiverSingle() + Me.ucrReceiverLatitude = New instat.ucrReceiverSingle() + Me.lblLatitude = New System.Windows.Forms.Label() + Me.ucrSelectorStationFile = New instat.ucrSelectorByDataFrameAddRemove() + Me.grpDataFile = New System.Windows.Forms.GroupBox() + Me.ucrReceiverDataFiles = New instat.ucrReceiverMultiple() + Me.lblDataFiles = New System.Windows.Forms.Label() + Me.ucrSelectorDataFiles = New instat.ucrSelectorByDataFrameAddRemove() + Me.lblClimaticVariable = New System.Windows.Forms.Label() + Me.lblFinalYear = New System.Windows.Forms.Label() + Me.lblInitialYear = New System.Windows.Forms.Label() + Me.ucrInputFinalYear = New instat.ucrInputTextBox() + Me.ucrInputInitialYear = New instat.ucrInputTextBox() + Me.ucrReceiverStation = New instat.ucrReceiverSingle() + Me.ucrSelectorHomogenization = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrInputClimateVariables = New instat.ucrInputTextBox() Me.ucrPnlOptions = New instat.UcrPanel() Me.ucrSaveResult = New instat.ucrSave() Me.ucrReceiverElement = New instat.ucrReceiverSingle() - Me.ucrSelectorHomogenization = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.lblStation = New System.Windows.Forms.Label() - Me.ucrReceiverStation = New instat.ucrReceiverSingle() + Me.ucrReceiverNeighbour = New instat.ucrReceiverSingle() + Me.rdoHomogenization = New System.Windows.Forms.RadioButton() + Me.rdoMonthlyTotals = New System.Windows.Forms.RadioButton() + Me.rdoQualityControl = New System.Windows.Forms.RadioButton() Me.grpMethods.SuspendLayout() Me.grpCptOptions.SuspendLayout() Me.grpOutputOptions.SuspendLayout() + Me.grpStationFile.SuspendLayout() + Me.grpDataFile.SuspendLayout() Me.SuspendLayout() ' 'lblElement @@ -75,7 +101,7 @@ Partial Class dlgHomogenization Me.lblElement.Location = New System.Drawing.Point(264, 135) Me.lblElement.Name = "lblElement" Me.lblElement.Size = New System.Drawing.Size(48, 13) - Me.lblElement.TabIndex = 7 + Me.lblElement.TabIndex = 6 Me.lblElement.Text = "Element:" ' 'grpMethods @@ -90,7 +116,7 @@ Partial Class dlgHomogenization Me.grpMethods.Location = New System.Drawing.Point(12, 243) Me.grpMethods.Name = "grpMethods" Me.grpMethods.Size = New System.Drawing.Size(209, 104) - Me.grpMethods.TabIndex = 11 + Me.grpMethods.TabIndex = 10 Me.grpMethods.TabStop = False Me.grpMethods.Text = "Methods" ' @@ -101,7 +127,7 @@ Partial Class dlgHomogenization Me.rdoCptMean.Location = New System.Drawing.Point(87, 23) Me.rdoCptMean.Name = "rdoCptMean" Me.rdoCptMean.Size = New System.Drawing.Size(52, 17) - Me.rdoCptMean.TabIndex = 6 + Me.rdoCptMean.TabIndex = 3 Me.rdoCptMean.Text = "Mean" Me.rdoCptMean.UseVisualStyleBackColor = True ' @@ -112,7 +138,7 @@ Partial Class dlgHomogenization Me.rdoCptMeanVariance.Location = New System.Drawing.Point(87, 69) Me.rdoCptMeanVariance.Name = "rdoCptMeanVariance" Me.rdoCptMeanVariance.Size = New System.Drawing.Size(118, 17) - Me.rdoCptMeanVariance.TabIndex = 5 + Me.rdoCptMeanVariance.TabIndex = 6 Me.rdoCptMeanVariance.Text = "Mean and Variance" Me.rdoCptMeanVariance.UseVisualStyleBackColor = True ' @@ -134,7 +160,7 @@ Partial Class dlgHomogenization Me.rdoBuishand.Location = New System.Drawing.Point(9, 69) Me.rdoBuishand.Name = "rdoBuishand" Me.rdoBuishand.Size = New System.Drawing.Size(69, 17) - Me.rdoBuishand.TabIndex = 16 + Me.rdoBuishand.TabIndex = 5 Me.rdoBuishand.Text = "Buishand" Me.rdoBuishand.UseVisualStyleBackColor = True ' @@ -145,7 +171,7 @@ Partial Class dlgHomogenization Me.rdoPettitt.Location = New System.Drawing.Point(9, 46) Me.rdoPettitt.Name = "rdoPettitt" Me.rdoPettitt.Size = New System.Drawing.Size(52, 17) - Me.rdoPettitt.TabIndex = 15 + Me.rdoPettitt.TabIndex = 2 Me.rdoPettitt.Text = "Pettitt" Me.rdoPettitt.UseVisualStyleBackColor = True ' @@ -156,7 +182,7 @@ Partial Class dlgHomogenization Me.rdoSnht.Location = New System.Drawing.Point(9, 23) Me.rdoSnht.Name = "rdoSnht" Me.rdoSnht.Size = New System.Drawing.Size(55, 17) - Me.rdoSnht.TabIndex = 14 + Me.rdoSnht.TabIndex = 1 Me.rdoSnht.Text = "SNHT" Me.rdoSnht.UseVisualStyleBackColor = True ' @@ -187,7 +213,7 @@ Partial Class dlgHomogenization Me.grpCptOptions.Location = New System.Drawing.Point(227, 243) Me.grpCptOptions.Name = "grpCptOptions" Me.grpCptOptions.Size = New System.Drawing.Size(179, 170) - Me.grpCptOptions.TabIndex = 12 + Me.grpCptOptions.TabIndex = 14 Me.grpCptOptions.TabStop = False Me.grpCptOptions.Text = "Change Point Options" ' @@ -200,7 +226,7 @@ Partial Class dlgHomogenization Me.ucrInputComboMeanVarDistribution.Location = New System.Drawing.Point(68, 67) Me.ucrInputComboMeanVarDistribution.Name = "ucrInputComboMeanVarDistribution" Me.ucrInputComboMeanVarDistribution.Size = New System.Drawing.Size(64, 21) - Me.ucrInputComboMeanVarDistribution.TabIndex = 14 + Me.ucrInputComboMeanVarDistribution.TabIndex = 8 ' 'ucrInputComboVarDistribution ' @@ -220,7 +246,7 @@ Partial Class dlgHomogenization Me.lblPenaltyValue.Location = New System.Drawing.Point(4, 142) Me.lblPenaltyValue.Name = "lblPenaltyValue" Me.lblPenaltyValue.Size = New System.Drawing.Size(59, 13) - Me.lblPenaltyValue.TabIndex = 12 + Me.lblPenaltyValue.TabIndex = 5 Me.lblPenaltyValue.Text = "Pen.Value:" ' 'ucrInputPenValue @@ -241,7 +267,7 @@ Partial Class dlgHomogenization Me.lblMinSegLen.Location = New System.Drawing.Point(4, 95) Me.lblMinSegLen.Name = "lblMinSegLen" Me.lblMinSegLen.Size = New System.Drawing.Size(64, 13) - Me.lblMinSegLen.TabIndex = 10 + Me.lblMinSegLen.TabIndex = 3 Me.lblMinSegLen.Text = "MinSegLen:" ' 'lblQ @@ -251,7 +277,7 @@ Partial Class dlgHomogenization Me.lblQ.Location = New System.Drawing.Point(4, 120) Me.lblQ.Name = "lblQ" Me.lblQ.Size = New System.Drawing.Size(18, 13) - Me.lblQ.TabIndex = 9 + Me.lblQ.TabIndex = 4 Me.lblQ.Text = "Q:" ' 'lblPenalty @@ -261,7 +287,7 @@ Partial Class dlgHomogenization Me.lblPenalty.Location = New System.Drawing.Point(4, 21) Me.lblPenalty.Name = "lblPenalty" Me.lblPenalty.Size = New System.Drawing.Size(45, 13) - Me.lblPenalty.TabIndex = 8 + Me.lblPenalty.TabIndex = 0 Me.lblPenalty.Text = "Penalty:" ' 'lblMethod @@ -271,7 +297,7 @@ Partial Class dlgHomogenization Me.lblMethod.Location = New System.Drawing.Point(4, 44) Me.lblMethod.Name = "lblMethod" Me.lblMethod.Size = New System.Drawing.Size(46, 13) - Me.lblMethod.TabIndex = 7 + Me.lblMethod.TabIndex = 1 Me.lblMethod.Text = "Method:" ' 'lblDistribution @@ -281,7 +307,7 @@ Partial Class dlgHomogenization Me.lblDistribution.Location = New System.Drawing.Point(4, 69) Me.lblDistribution.Name = "lblDistribution" Me.lblDistribution.Size = New System.Drawing.Size(62, 13) - Me.lblDistribution.TabIndex = 6 + Me.lblDistribution.TabIndex = 2 Me.lblDistribution.Text = "Distribution:" ' 'ucrNudMinSegLen @@ -294,7 +320,7 @@ Partial Class dlgHomogenization Me.ucrNudMinSegLen.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) Me.ucrNudMinSegLen.Name = "ucrNudMinSegLen" Me.ucrNudMinSegLen.Size = New System.Drawing.Size(50, 20) - Me.ucrNudMinSegLen.TabIndex = 4 + Me.ucrNudMinSegLen.TabIndex = 9 Me.ucrNudMinSegLen.Value = New Decimal(New Integer() {0, 0, 0, 0}) ' 'ucrInputQ @@ -306,7 +332,7 @@ Partial Class dlgHomogenization Me.ucrInputQ.Location = New System.Drawing.Point(68, 114) Me.ucrInputQ.Name = "ucrInputQ" Me.ucrInputQ.Size = New System.Drawing.Size(55, 21) - Me.ucrInputQ.TabIndex = 3 + Me.ucrInputQ.TabIndex = 10 ' 'ucrInputComboMeanDistribution ' @@ -328,7 +354,7 @@ Partial Class dlgHomogenization Me.ucrInputComboMethod.Location = New System.Drawing.Point(68, 43) Me.ucrInputComboMethod.Name = "ucrInputComboMethod" Me.ucrInputComboMethod.Size = New System.Drawing.Size(64, 21) - Me.ucrInputComboMethod.TabIndex = 1 + Me.ucrInputComboMethod.TabIndex = 7 ' 'ucrInputComboPenalty ' @@ -339,7 +365,7 @@ Partial Class dlgHomogenization Me.ucrInputComboPenalty.Location = New System.Drawing.Point(68, 19) Me.ucrInputComboPenalty.Name = "ucrInputComboPenalty" Me.ucrInputComboPenalty.Size = New System.Drawing.Size(64, 21) - Me.ucrInputComboPenalty.TabIndex = 0 + Me.ucrInputComboPenalty.TabIndex = 6 ' 'grpOutputOptions ' @@ -349,7 +375,7 @@ Partial Class dlgHomogenization Me.grpOutputOptions.Location = New System.Drawing.Point(12, 353) Me.grpOutputOptions.Name = "grpOutputOptions" Me.grpOutputOptions.Size = New System.Drawing.Size(209, 42) - Me.grpOutputOptions.TabIndex = 13 + Me.grpOutputOptions.TabIndex = 12 Me.grpOutputOptions.TabStop = False Me.grpOutputOptions.Text = "Output Options" ' @@ -360,7 +386,7 @@ Partial Class dlgHomogenization Me.ucrChkPlot.Location = New System.Drawing.Point(10, 19) Me.ucrChkPlot.Name = "ucrChkPlot" Me.ucrChkPlot.Size = New System.Drawing.Size(100, 23) - Me.ucrChkPlot.TabIndex = 1 + Me.ucrChkPlot.TabIndex = 0 ' 'ucrChkSummary ' @@ -369,7 +395,7 @@ Partial Class dlgHomogenization Me.ucrChkSummary.Location = New System.Drawing.Point(110, 19) Me.ucrChkSummary.Name = "ucrChkSummary" Me.ucrChkSummary.Size = New System.Drawing.Size(93, 23) - Me.ucrChkSummary.TabIndex = 0 + Me.ucrChkSummary.TabIndex = 1 ' 'rdoSingle ' @@ -380,9 +406,9 @@ Partial Class dlgHomogenization Me.rdoSingle.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption Me.rdoSingle.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.rdoSingle.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoSingle.Location = New System.Drawing.Point(62, 27) + Me.rdoSingle.Location = New System.Drawing.Point(12, 9) Me.rdoSingle.Name = "rdoSingle" - Me.rdoSingle.Size = New System.Drawing.Size(101, 28) + Me.rdoSingle.Size = New System.Drawing.Size(78, 28) Me.rdoSingle.TabIndex = 1 Me.rdoSingle.TabStop = True Me.rdoSingle.Tag = "" @@ -390,44 +416,6 @@ Partial Class dlgHomogenization Me.rdoSingle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSingle.UseVisualStyleBackColor = False ' - 'rdoMultiple - ' - Me.rdoMultiple.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoMultiple.BackColor = System.Drawing.SystemColors.Control - Me.rdoMultiple.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoMultiple.FlatAppearance.BorderSize = 2 - Me.rdoMultiple.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoMultiple.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoMultiple.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoMultiple.Location = New System.Drawing.Point(260, 27) - Me.rdoMultiple.Name = "rdoMultiple" - Me.rdoMultiple.Size = New System.Drawing.Size(101, 28) - Me.rdoMultiple.TabIndex = 3 - Me.rdoMultiple.TabStop = True - Me.rdoMultiple.Tag = "" - Me.rdoMultiple.Text = "Multiple" - Me.rdoMultiple.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoMultiple.UseVisualStyleBackColor = False - ' - 'rdoNeighbouring - ' - Me.rdoNeighbouring.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoNeighbouring.BackColor = System.Drawing.SystemColors.Control - Me.rdoNeighbouring.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoNeighbouring.FlatAppearance.BorderSize = 2 - Me.rdoNeighbouring.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoNeighbouring.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoNeighbouring.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoNeighbouring.Location = New System.Drawing.Point(161, 27) - Me.rdoNeighbouring.Name = "rdoNeighbouring" - Me.rdoNeighbouring.Size = New System.Drawing.Size(101, 28) - Me.rdoNeighbouring.TabIndex = 2 - Me.rdoNeighbouring.TabStop = True - Me.rdoNeighbouring.Tag = "" - Me.rdoNeighbouring.Text = "Neighbouring" - Me.rdoNeighbouring.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoNeighbouring.UseVisualStyleBackColor = False - ' 'lblNeighbouring ' Me.lblNeighbouring.AutoSize = True @@ -435,39 +423,337 @@ Partial Class dlgHomogenization Me.lblNeighbouring.Location = New System.Drawing.Point(264, 190) Me.lblNeighbouring.Name = "lblNeighbouring" Me.lblNeighbouring.Size = New System.Drawing.Size(59, 13) - Me.lblNeighbouring.TabIndex = 9 + Me.lblNeighbouring.TabIndex = 8 Me.lblNeighbouring.Text = "Neighbour:" ' - 'ucrReceiverNeighbour + 'lblStation ' - Me.ucrReceiverNeighbour.AutoSize = True - Me.ucrReceiverNeighbour.frmParent = Me - Me.ucrReceiverNeighbour.Location = New System.Drawing.Point(266, 206) - Me.ucrReceiverNeighbour.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverNeighbour.Name = "ucrReceiverNeighbour" - Me.ucrReceiverNeighbour.Selector = Nothing - Me.ucrReceiverNeighbour.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverNeighbour.strNcFilePath = "" - Me.ucrReceiverNeighbour.TabIndex = 10 - Me.ucrReceiverNeighbour.ucrSelector = Nothing + Me.lblStation.AutoSize = True + Me.lblStation.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblStation.Location = New System.Drawing.Point(264, 80) + Me.lblStation.Name = "lblStation" + Me.lblStation.Size = New System.Drawing.Size(43, 13) + Me.lblStation.TabIndex = 4 + Me.lblStation.Text = "Station:" + ' + 'rdoPrepare + ' + Me.rdoPrepare.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoPrepare.BackColor = System.Drawing.SystemColors.Control + Me.rdoPrepare.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoPrepare.FlatAppearance.BorderSize = 2 + Me.rdoPrepare.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoPrepare.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoPrepare.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoPrepare.Location = New System.Drawing.Point(88, 9) + Me.rdoPrepare.Name = "rdoPrepare" + Me.rdoPrepare.Size = New System.Drawing.Size(63, 28) + Me.rdoPrepare.TabIndex = 2 + Me.rdoPrepare.TabStop = True + Me.rdoPrepare.Tag = "" + Me.rdoPrepare.Text = "Prepare" + Me.rdoPrepare.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoPrepare.UseVisualStyleBackColor = False + ' + 'grpStationFile + ' + Me.grpStationFile.Controls.Add(Me.ucrReceiverElavation) + Me.grpStationFile.Controls.Add(Me.lblLongtude) + Me.grpStationFile.Controls.Add(Me.lblStationName) + Me.grpStationFile.Controls.Add(Me.lblStationID) + Me.grpStationFile.Controls.Add(Me.lblElavation) + Me.grpStationFile.Controls.Add(Me.ucrReceiverStationId) + Me.grpStationFile.Controls.Add(Me.ucrReceiverStationName) + Me.grpStationFile.Controls.Add(Me.ucrReceiverLongtitude) + Me.grpStationFile.Controls.Add(Me.ucrReceiverLatitude) + Me.grpStationFile.Controls.Add(Me.lblLatitude) + Me.grpStationFile.Controls.Add(Me.ucrSelectorStationFile) + Me.grpStationFile.Location = New System.Drawing.Point(11, 260) + Me.grpStationFile.Name = "grpStationFile" + Me.grpStationFile.Size = New System.Drawing.Size(397, 201) + Me.grpStationFile.TabIndex = 11 + Me.grpStationFile.TabStop = False + Me.grpStationFile.Text = "StationFile" + ' + 'ucrReceiverElavation + ' + Me.ucrReceiverElavation.AutoSize = True + Me.ucrReceiverElavation.frmParent = Me + Me.ucrReceiverElavation.Location = New System.Drawing.Point(272, 105) + Me.ucrReceiverElavation.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverElavation.Name = "ucrReceiverElavation" + Me.ucrReceiverElavation.Selector = Nothing + Me.ucrReceiverElavation.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverElavation.strNcFilePath = "" + Me.ucrReceiverElavation.TabIndex = 6 + Me.ucrReceiverElavation.ucrSelector = Nothing + ' + 'lblLongtude + ' + Me.lblLongtude.AutoSize = True + Me.lblLongtude.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblLongtude.Location = New System.Drawing.Point(274, 51) + Me.lblLongtude.Name = "lblLongtude" + Me.lblLongtude.Size = New System.Drawing.Size(57, 13) + Me.lblLongtude.TabIndex = 3 + Me.lblLongtude.Text = "Longitude:" + ' + 'lblStationName + ' + Me.lblStationName.AutoSize = True + Me.lblStationName.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblStationName.Location = New System.Drawing.Point(274, 125) + Me.lblStationName.Name = "lblStationName" + Me.lblStationName.Size = New System.Drawing.Size(74, 13) + Me.lblStationName.TabIndex = 7 + Me.lblStationName.Text = "Station Name:" + ' + 'lblStationID + ' + Me.lblStationID.AutoSize = True + Me.lblStationID.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblStationID.Location = New System.Drawing.Point(274, 161) + Me.lblStationID.Name = "lblStationID" + Me.lblStationID.Size = New System.Drawing.Size(55, 13) + Me.lblStationID.TabIndex = 9 + Me.lblStationID.Text = "Station Id:" + ' + 'lblElavation + ' + Me.lblElavation.AutoSize = True + Me.lblElavation.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblElavation.Location = New System.Drawing.Point(274, 90) + Me.lblElavation.Name = "lblElavation" + Me.lblElavation.Size = New System.Drawing.Size(54, 13) + Me.lblElavation.TabIndex = 5 + Me.lblElavation.Text = "Elavation:" + ' + 'ucrReceiverStationId + ' + Me.ucrReceiverStationId.AutoSize = True + Me.ucrReceiverStationId.frmParent = Me + Me.ucrReceiverStationId.Location = New System.Drawing.Point(272, 175) + Me.ucrReceiverStationId.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStationId.Name = "ucrReceiverStationId" + Me.ucrReceiverStationId.Selector = Nothing + Me.ucrReceiverStationId.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStationId.strNcFilePath = "" + Me.ucrReceiverStationId.TabIndex = 10 + Me.ucrReceiverStationId.ucrSelector = Nothing + ' + 'ucrReceiverStationName + ' + Me.ucrReceiverStationName.AutoSize = True + Me.ucrReceiverStationName.frmParent = Me + Me.ucrReceiverStationName.Location = New System.Drawing.Point(272, 140) + Me.ucrReceiverStationName.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStationName.Name = "ucrReceiverStationName" + Me.ucrReceiverStationName.Selector = Nothing + Me.ucrReceiverStationName.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStationName.strNcFilePath = "" + Me.ucrReceiverStationName.TabIndex = 8 + Me.ucrReceiverStationName.ucrSelector = Nothing + ' + 'ucrReceiverLongtitude + ' + Me.ucrReceiverLongtitude.AutoSize = True + Me.ucrReceiverLongtitude.frmParent = Me + Me.ucrReceiverLongtitude.Location = New System.Drawing.Point(272, 68) + Me.ucrReceiverLongtitude.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverLongtitude.Name = "ucrReceiverLongtitude" + Me.ucrReceiverLongtitude.Selector = Nothing + Me.ucrReceiverLongtitude.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverLongtitude.strNcFilePath = "" + Me.ucrReceiverLongtitude.TabIndex = 4 + Me.ucrReceiverLongtitude.ucrSelector = Nothing + ' + 'ucrReceiverLatitude + ' + Me.ucrReceiverLatitude.AutoSize = True + Me.ucrReceiverLatitude.frmParent = Me + Me.ucrReceiverLatitude.Location = New System.Drawing.Point(272, 25) + Me.ucrReceiverLatitude.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverLatitude.Name = "ucrReceiverLatitude" + Me.ucrReceiverLatitude.Selector = Nothing + Me.ucrReceiverLatitude.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverLatitude.strNcFilePath = "" + Me.ucrReceiverLatitude.TabIndex = 2 + Me.ucrReceiverLatitude.ucrSelector = Nothing + ' + 'lblLatitude + ' + Me.lblLatitude.AutoSize = True + Me.lblLatitude.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblLatitude.Location = New System.Drawing.Point(274, 10) + Me.lblLatitude.Name = "lblLatitude" + Me.lblLatitude.Size = New System.Drawing.Size(48, 13) + Me.lblLatitude.TabIndex = 1 + Me.lblLatitude.Text = "Latitude:" + ' + 'ucrSelectorStationFile + ' + Me.ucrSelectorStationFile.AutoSize = True + Me.ucrSelectorStationFile.bDropUnusedFilterLevels = False + Me.ucrSelectorStationFile.bShowHiddenColumns = False + Me.ucrSelectorStationFile.bUseCurrentFilter = True + Me.ucrSelectorStationFile.Location = New System.Drawing.Point(6, 16) + Me.ucrSelectorStationFile.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorStationFile.Name = "ucrSelectorStationFile" + Me.ucrSelectorStationFile.Size = New System.Drawing.Size(213, 185) + Me.ucrSelectorStationFile.TabIndex = 0 + ' + 'grpDataFile + ' + Me.grpDataFile.Controls.Add(Me.ucrReceiverDataFiles) + Me.grpDataFile.Controls.Add(Me.lblDataFiles) + Me.grpDataFile.Controls.Add(Me.ucrSelectorDataFiles) + Me.grpDataFile.Location = New System.Drawing.Point(12, 59) + Me.grpDataFile.Name = "grpDataFile" + Me.grpDataFile.Size = New System.Drawing.Size(397, 201) + Me.grpDataFile.TabIndex = 3 + Me.grpDataFile.TabStop = False + Me.grpDataFile.Text = "Data File" + ' + 'ucrReceiverDataFiles + ' + Me.ucrReceiverDataFiles.AutoSize = True + Me.ucrReceiverDataFiles.frmParent = Me + Me.ucrReceiverDataFiles.Location = New System.Drawing.Point(265, 38) + Me.ucrReceiverDataFiles.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverDataFiles.Name = "ucrReceiverDataFiles" + Me.ucrReceiverDataFiles.Selector = Nothing + Me.ucrReceiverDataFiles.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverDataFiles.strNcFilePath = "" + Me.ucrReceiverDataFiles.TabIndex = 2 + Me.ucrReceiverDataFiles.ucrSelector = Nothing + ' + 'lblDataFiles + ' + Me.lblDataFiles.AutoSize = True + Me.lblDataFiles.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblDataFiles.Location = New System.Drawing.Point(269, 19) + Me.lblDataFiles.Name = "lblDataFiles" + Me.lblDataFiles.Size = New System.Drawing.Size(76, 13) + Me.lblDataFiles.TabIndex = 1 + Me.lblDataFiles.Text = "Data Columns:" + ' + 'ucrSelectorDataFiles + ' + Me.ucrSelectorDataFiles.AutoSize = True + Me.ucrSelectorDataFiles.bDropUnusedFilterLevels = False + Me.ucrSelectorDataFiles.bShowHiddenColumns = False + Me.ucrSelectorDataFiles.bUseCurrentFilter = True + Me.ucrSelectorDataFiles.Location = New System.Drawing.Point(6, 16) + Me.ucrSelectorDataFiles.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorDataFiles.Name = "ucrSelectorDataFiles" + Me.ucrSelectorDataFiles.Size = New System.Drawing.Size(213, 185) + Me.ucrSelectorDataFiles.TabIndex = 0 + ' + 'lblClimaticVariable + ' + Me.lblClimaticVariable.AutoSize = True + Me.lblClimaticVariable.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblClimaticVariable.Location = New System.Drawing.Point(195, 468) + Me.lblClimaticVariable.Name = "lblClimaticVariable" + Me.lblClimaticVariable.Size = New System.Drawing.Size(87, 13) + Me.lblClimaticVariable.TabIndex = 19 + Me.lblClimaticVariable.Text = "Climatic Variable:" + ' + 'lblFinalYear + ' + Me.lblFinalYear.AutoSize = True + Me.lblFinalYear.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblFinalYear.Location = New System.Drawing.Point(15, 488) + Me.lblFinalYear.Name = "lblFinalYear" + Me.lblFinalYear.Size = New System.Drawing.Size(57, 13) + Me.lblFinalYear.TabIndex = 17 + Me.lblFinalYear.Text = "Final Year:" + ' + 'lblInitialYear + ' + Me.lblInitialYear.AutoSize = True + Me.lblInitialYear.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblInitialYear.Location = New System.Drawing.Point(15, 465) + Me.lblInitialYear.Name = "lblInitialYear" + Me.lblInitialYear.Size = New System.Drawing.Size(59, 13) + Me.lblInitialYear.TabIndex = 15 + Me.lblInitialYear.Text = "Initial Year:" + ' + 'ucrInputFinalYear + ' + Me.ucrInputFinalYear.AddQuotesIfUnrecognised = True + Me.ucrInputFinalYear.AutoSize = True + Me.ucrInputFinalYear.IsMultiline = False + Me.ucrInputFinalYear.IsReadOnly = False + Me.ucrInputFinalYear.Location = New System.Drawing.Point(77, 484) + Me.ucrInputFinalYear.Name = "ucrInputFinalYear" + Me.ucrInputFinalYear.Size = New System.Drawing.Size(89, 21) + Me.ucrInputFinalYear.TabIndex = 18 + ' + 'ucrInputInitialYear + ' + Me.ucrInputInitialYear.AddQuotesIfUnrecognised = True + Me.ucrInputInitialYear.AutoSize = True + Me.ucrInputInitialYear.IsMultiline = False + Me.ucrInputInitialYear.IsReadOnly = False + Me.ucrInputInitialYear.Location = New System.Drawing.Point(77, 461) + Me.ucrInputInitialYear.Name = "ucrInputInitialYear" + Me.ucrInputInitialYear.Size = New System.Drawing.Size(89, 21) + Me.ucrInputInitialYear.TabIndex = 16 + ' + 'ucrReceiverStation + ' + Me.ucrReceiverStation.AutoSize = True + Me.ucrReceiverStation.frmParent = Me + Me.ucrReceiverStation.Location = New System.Drawing.Point(266, 96) + Me.ucrReceiverStation.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStation.Name = "ucrReceiverStation" + Me.ucrReceiverStation.Selector = Nothing + Me.ucrReceiverStation.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStation.strNcFilePath = "" + Me.ucrReceiverStation.TabIndex = 5 + Me.ucrReceiverStation.ucrSelector = Nothing + ' + 'ucrSelectorHomogenization + ' + Me.ucrSelectorHomogenization.AutoSize = True + Me.ucrSelectorHomogenization.bDropUnusedFilterLevels = False + Me.ucrSelectorHomogenization.bShowHiddenColumns = False + Me.ucrSelectorHomogenization.bUseCurrentFilter = True + Me.ucrSelectorHomogenization.Location = New System.Drawing.Point(12, 58) + Me.ucrSelectorHomogenization.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorHomogenization.Name = "ucrSelectorHomogenization" + Me.ucrSelectorHomogenization.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorHomogenization.TabIndex = 4 + ' + 'ucrInputClimateVariables + ' + Me.ucrInputClimateVariables.AddQuotesIfUnrecognised = True + Me.ucrInputClimateVariables.AutoSize = True + Me.ucrInputClimateVariables.IsMultiline = False + Me.ucrInputClimateVariables.IsReadOnly = False + Me.ucrInputClimateVariables.Location = New System.Drawing.Point(284, 464) + Me.ucrInputClimateVariables.Name = "ucrInputClimateVariables" + Me.ucrInputClimateVariables.Size = New System.Drawing.Size(125, 21) + Me.ucrInputClimateVariables.TabIndex = 20 ' 'ucrPnlOptions ' Me.ucrPnlOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlOptions.Location = New System.Drawing.Point(51, 25) + Me.ucrPnlOptions.Location = New System.Drawing.Point(12, 2) Me.ucrPnlOptions.Name = "ucrPnlOptions" - Me.ucrPnlOptions.Size = New System.Drawing.Size(321, 30) + Me.ucrPnlOptions.Size = New System.Drawing.Size(408, 51) Me.ucrPnlOptions.TabIndex = 0 ' 'ucrSaveResult ' Me.ucrSaveResult.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrSaveResult.Enabled = False - Me.ucrSaveResult.Location = New System.Drawing.Point(12, 413) + Me.ucrSaveResult.Location = New System.Drawing.Point(12, 426) Me.ucrSaveResult.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveResult.Name = "ucrSaveResult" Me.ucrSaveResult.Size = New System.Drawing.Size(320, 24) - Me.ucrSaveResult.TabIndex = 14 + Me.ucrSaveResult.TabIndex = 13 ' 'ucrReceiverElement ' @@ -479,66 +765,111 @@ Partial Class dlgHomogenization Me.ucrReceiverElement.Selector = Nothing Me.ucrReceiverElement.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverElement.strNcFilePath = "" - Me.ucrReceiverElement.TabIndex = 8 + Me.ucrReceiverElement.TabIndex = 7 Me.ucrReceiverElement.ucrSelector = Nothing ' - 'ucrSelectorHomogenization - ' - Me.ucrSelectorHomogenization.AutoSize = True - Me.ucrSelectorHomogenization.bDropUnusedFilterLevels = False - Me.ucrSelectorHomogenization.bShowHiddenColumns = False - Me.ucrSelectorHomogenization.bUseCurrentFilter = True - Me.ucrSelectorHomogenization.Location = New System.Drawing.Point(12, 58) - Me.ucrSelectorHomogenization.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorHomogenization.Name = "ucrSelectorHomogenization" - Me.ucrSelectorHomogenization.Size = New System.Drawing.Size(213, 183) - Me.ucrSelectorHomogenization.TabIndex = 4 - ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(12, 440) + Me.ucrBase.Location = New System.Drawing.Point(12, 515) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(405, 52) - Me.ucrBase.TabIndex = 15 - ' - 'lblStation + Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.TabIndex = 21 ' - Me.lblStation.AutoSize = True - Me.lblStation.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblStation.Location = New System.Drawing.Point(264, 80) - Me.lblStation.Name = "lblStation" - Me.lblStation.Size = New System.Drawing.Size(43, 13) - Me.lblStation.TabIndex = 5 - Me.lblStation.Text = "Station:" + 'ucrReceiverNeighbour ' - 'ucrReceiverStation + Me.ucrReceiverNeighbour.AutoSize = True + Me.ucrReceiverNeighbour.frmParent = Me + Me.ucrReceiverNeighbour.Location = New System.Drawing.Point(266, 206) + Me.ucrReceiverNeighbour.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverNeighbour.Name = "ucrReceiverNeighbour" + Me.ucrReceiverNeighbour.Selector = Nothing + Me.ucrReceiverNeighbour.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverNeighbour.strNcFilePath = "" + Me.ucrReceiverNeighbour.TabIndex = 9 + Me.ucrReceiverNeighbour.ucrSelector = Nothing ' - Me.ucrReceiverStation.AutoSize = True - Me.ucrReceiverStation.frmParent = Me - Me.ucrReceiverStation.Location = New System.Drawing.Point(266, 96) - Me.ucrReceiverStation.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverStation.Name = "ucrReceiverStation" - Me.ucrReceiverStation.Selector = Nothing - Me.ucrReceiverStation.Size = New System.Drawing.Size(120, 20) - Me.ucrReceiverStation.strNcFilePath = "" - Me.ucrReceiverStation.TabIndex = 6 - Me.ucrReceiverStation.ucrSelector = Nothing + 'rdoHomogenization + ' + Me.rdoHomogenization.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoHomogenization.BackColor = System.Drawing.SystemColors.Control + Me.rdoHomogenization.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoHomogenization.FlatAppearance.BorderSize = 2 + Me.rdoHomogenization.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoHomogenization.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoHomogenization.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoHomogenization.Location = New System.Drawing.Point(319, 9) + Me.rdoHomogenization.Name = "rdoHomogenization" + Me.rdoHomogenization.Size = New System.Drawing.Size(101, 28) + Me.rdoHomogenization.TabIndex = 23 + Me.rdoHomogenization.TabStop = True + Me.rdoHomogenization.Tag = "" + Me.rdoHomogenization.Text = "Homogenization" + Me.rdoHomogenization.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoHomogenization.UseVisualStyleBackColor = False + ' + 'rdoMonthlyTotals + ' + Me.rdoMonthlyTotals.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoMonthlyTotals.BackColor = System.Drawing.SystemColors.Control + Me.rdoMonthlyTotals.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoMonthlyTotals.FlatAppearance.BorderSize = 2 + Me.rdoMonthlyTotals.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoMonthlyTotals.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoMonthlyTotals.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoMonthlyTotals.Location = New System.Drawing.Point(233, 9) + Me.rdoMonthlyTotals.Name = "rdoMonthlyTotals" + Me.rdoMonthlyTotals.Size = New System.Drawing.Size(91, 28) + Me.rdoMonthlyTotals.TabIndex = 24 + Me.rdoMonthlyTotals.TabStop = True + Me.rdoMonthlyTotals.Tag = "" + Me.rdoMonthlyTotals.Text = "Monthly Totals " + Me.rdoMonthlyTotals.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoMonthlyTotals.UseVisualStyleBackColor = False + ' + 'rdoQualityControl + ' + Me.rdoQualityControl.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoQualityControl.BackColor = System.Drawing.SystemColors.Control + Me.rdoQualityControl.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoQualityControl.FlatAppearance.BorderSize = 2 + Me.rdoQualityControl.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoQualityControl.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoQualityControl.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoQualityControl.Location = New System.Drawing.Point(148, 9) + Me.rdoQualityControl.Name = "rdoQualityControl" + Me.rdoQualityControl.Size = New System.Drawing.Size(87, 28) + Me.rdoQualityControl.TabIndex = 25 + Me.rdoQualityControl.TabStop = True + Me.rdoQualityControl.Tag = "" + Me.rdoQualityControl.Text = "Quality Control" + Me.rdoQualityControl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoQualityControl.UseVisualStyleBackColor = False ' 'dlgHomogenization ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(422, 494) - Me.Controls.Add(Me.lblStation) + Me.ClientSize = New System.Drawing.Size(422, 570) + Me.Controls.Add(Me.rdoQualityControl) + Me.Controls.Add(Me.rdoMonthlyTotals) + Me.Controls.Add(Me.rdoHomogenization) + Me.Controls.Add(Me.grpStationFile) + Me.Controls.Add(Me.grpDataFile) + Me.Controls.Add(Me.ucrInputFinalYear) + Me.Controls.Add(Me.ucrInputInitialYear) + Me.Controls.Add(Me.lblInitialYear) + Me.Controls.Add(Me.lblFinalYear) Me.Controls.Add(Me.ucrReceiverStation) + Me.Controls.Add(Me.ucrSelectorHomogenization) + Me.Controls.Add(Me.lblClimaticVariable) + Me.Controls.Add(Me.ucrInputClimateVariables) + Me.Controls.Add(Me.rdoPrepare) + Me.Controls.Add(Me.lblStation) Me.Controls.Add(Me.lblNeighbouring) - Me.Controls.Add(Me.ucrReceiverNeighbour) - Me.Controls.Add(Me.rdoNeighbouring) Me.Controls.Add(Me.rdoSingle) - Me.Controls.Add(Me.rdoMultiple) Me.Controls.Add(Me.ucrPnlOptions) Me.Controls.Add(Me.ucrSaveResult) Me.Controls.Add(Me.grpOutputOptions) @@ -546,8 +877,8 @@ Partial Class dlgHomogenization Me.Controls.Add(Me.grpMethods) Me.Controls.Add(Me.lblElement) Me.Controls.Add(Me.ucrReceiverElement) - Me.Controls.Add(Me.ucrSelectorHomogenization) Me.Controls.Add(Me.ucrBase) + Me.Controls.Add(Me.ucrReceiverNeighbour) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -560,6 +891,10 @@ Partial Class dlgHomogenization Me.grpCptOptions.PerformLayout() Me.grpOutputOptions.ResumeLayout(False) Me.grpOutputOptions.PerformLayout() + Me.grpStationFile.ResumeLayout(False) + Me.grpStationFile.PerformLayout() + Me.grpDataFile.ResumeLayout(False) + Me.grpDataFile.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -593,9 +928,7 @@ Partial Class dlgHomogenization Friend WithEvents lblPenaltyValue As Label Friend WithEvents ucrInputPenValue As ucrInputTextBox Friend WithEvents rdoSingle As RadioButton - Friend WithEvents rdoMultiple As RadioButton Friend WithEvents ucrPnlOptions As UcrPanel - Friend WithEvents rdoNeighbouring As RadioButton Friend WithEvents lblNeighbouring As Label Friend WithEvents ucrReceiverNeighbour As ucrReceiverSingle Friend WithEvents ucrInputComboVarDistribution As ucrInputComboBox @@ -605,4 +938,30 @@ Partial Class dlgHomogenization Friend WithEvents rdoBuishand As RadioButton Friend WithEvents lblStation As Label Friend WithEvents ucrReceiverStation As ucrReceiverSingle + Friend WithEvents rdoPrepare As RadioButton + Friend WithEvents lblClimaticVariable As Label + Friend WithEvents ucrInputClimateVariables As ucrInputTextBox + Friend WithEvents grpDataFile As GroupBox + Friend WithEvents ucrReceiverDataFiles As ucrReceiverMultiple + Friend WithEvents lblDataFiles As Label + Friend WithEvents ucrSelectorDataFiles As ucrSelectorByDataFrameAddRemove + Friend WithEvents grpStationFile As GroupBox + Friend WithEvents lblLatitude As Label + Friend WithEvents ucrSelectorStationFile As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrInputFinalYear As ucrInputTextBox + Friend WithEvents ucrInputInitialYear As ucrInputTextBox + Friend WithEvents lblInitialYear As Label + Friend WithEvents lblFinalYear As Label + Friend WithEvents ucrReceiverStationId As ucrReceiverSingle + Friend WithEvents ucrReceiverStationName As ucrReceiverSingle + Friend WithEvents ucrReceiverLongtitude As ucrReceiverSingle + Friend WithEvents ucrReceiverLatitude As ucrReceiverSingle + Friend WithEvents ucrReceiverElavation As ucrReceiverSingle + Friend WithEvents lblLongtude As Label + Friend WithEvents lblStationName As Label + Friend WithEvents lblStationID As Label + Friend WithEvents lblElavation As Label + Friend WithEvents rdoQualityControl As RadioButton + Friend WithEvents rdoMonthlyTotals As RadioButton + Friend WithEvents rdoHomogenization As RadioButton End Class diff --git a/instat/dlgHomogenization.vb b/instat/dlgHomogenization.vb index ffca7cb35e8..a3132b561ac 100644 --- a/instat/dlgHomogenization.vb +++ b/instat/dlgHomogenization.vb @@ -19,8 +19,17 @@ Imports instat.Translations Public Class dlgHomogenization Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsCptMeanFunction, clsCptVarianceFunction, clsCptMeanVarianceFunction, clsExcludeNAFunction, clsPlotFunction, clsSummaryFunction, clsSnhtFunction, clsPettittFunction, clsBuishandFunction, clsTapplyFunction, clsCompleteCasesFunction As New RFunction - Private clsBracketsOperator, clsLeftBracketOperator, clsRightBracketOperator As New ROperator + Private bResetRCode As Boolean = True + Private clsCptMeanFunction, clsCptVarianceFunction, clsCptMeanVarianceFunction, clsExcludeNAFunction, clsPlotFunction, clsSummaryFunction, clsSnhtFunction, + clsPettittFunction, clsBuishandFunction, clsTapplyFunction, clsDummyFunction, clsCsv2climatolFunction, clsHomogenQCFunctin, clsDdm2Function, clsHomogenFunction, + clsGetColumnsFunction, clsGetStnColumnsFunction, clsCompleteCasesFunction, clsPmatchFunction, clsPmatch2Function, clsColumnsFunction, clsColumns2Function As New RFunction + Private clsBracketsOperator, clsLeftBracketOperator, clsVars2ColumnsFunction, clsVars1ColumnsFunction, clsRightBracketOperator As New ROperator + + ' Counter variable to keep track of the enabled radio button + Private iEnabledRadioButtonIndex As Integer = 0 + + Private lstOfRadioButtons As List(Of RadioButton) + Private Sub dlgHomogenization_Load(sender As Object, e As EventArgs) Handles MyBase.Load If bFirstLoad Then InitialiseDialog() @@ -31,6 +40,7 @@ Public Class dlgHomogenization SetDefaults() End If SetRCodeForControls(bReset) + DialogSize() bReset = False TestOkEnabled() autoTranslate(Me) @@ -46,6 +56,49 @@ Public Class dlgHomogenization ucrBase.clsRsyntax.iCallType = 2 ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False + ucrSelectorStationFile.SetParameter(New RParameter("stnfile", 1)) + ucrSelectorStationFile.SetParameterIsrfunction() + + ucrSelectorDataFiles.SetParameter(New RParameter("csvfile", 0)) + ucrSelectorDataFiles.SetParameterIsrfunction() + + ucrReceiverDataFiles.SetParameter(New RParameter("datacol", 2)) + ucrReceiverDataFiles.Selector = ucrSelectorDataFiles + ucrReceiverDataFiles.SetParameterIsString() + + ucrReceiverLatitude.SetParameter(New RParameter("lat", 3, bNewIncludeArgumentName:=False)) + ucrReceiverLatitude.Selector = ucrSelectorStationFile + ucrReceiverLatitude.SetParameterIsString() + ucrReceiverLatitude.SetLinkedDisplayControl(lblLatitude) + ucrReceiverLatitude.SetMeAsReceiver() + + ucrReceiverLongtitude.Selector = ucrSelectorStationFile + ucrReceiverLongtitude.SetParameterIsString() + ucrReceiverLongtitude.SetLinkedDisplayControl(lblLongtude) + + ucrReceiverElavation.Selector = ucrSelectorStationFile + ucrReceiverElavation.SetParameterIsString() + ucrReceiverElavation.SetLinkedDisplayControl(lblElavation) + + ucrReceiverStationName.Selector = ucrSelectorStationFile + ucrReceiverStationName.SetParameterIsString() + ucrReceiverStationName.SetLinkedDisplayControl(lblStationName) + + ucrReceiverStationId.Selector = ucrSelectorStationFile + ucrReceiverStationId.SetParameterIsString() + ucrReceiverStationId.SetLinkedDisplayControl(lblStationID) + + ucrInputClimateVariables.SetParameter(New RParameter("varcli", 8)) + ucrInputClimateVariables.SetLinkedDisplayControl(lblClimaticVariable) + + ucrInputInitialYear.SetParameter(New RParameter("anyi", 1)) + ucrInputInitialYear.SetValidationTypeAsNumeric() + ucrInputInitialYear.SetLinkedDisplayControl(lblInitialYear) + + ucrInputFinalYear.SetParameter(New RParameter("anyf", 2)) + ucrInputFinalYear.SetValidationTypeAsNumeric() + ucrInputFinalYear.SetLinkedDisplayControl(lblFinalYear) + ucrReceiverStation.SetParameter(New RParameter("station", 0)) ucrReceiverStation.Selector = ucrSelectorHomogenization ucrReceiverStation.SetParameterIsRFunction() @@ -75,11 +128,15 @@ Public Class dlgHomogenization ttOptions.SetToolTip(rdoBuishand, "Performes the Buishand range test for change-point detection of a normal variate.") ucrPnlOptions.AddRadioButton(rdoSingle) - ucrPnlOptions.AddRadioButton(rdoNeighbouring) - ucrPnlOptions.AddRadioButton(rdoMultiple) - ucrPnlOptions.AddFunctionNamesCondition(rdoSingle, {"cpt.mean", "cpt.var", "cpt.meanvar", "snh.test", "pettitt.test", "br.test", "tapply"}) - ucrPnlOptions.AddFunctionNamesCondition(rdoNeighbouring, {"cpt.mean", "cpt.var", "cpt.meanvar", "snh.test", "pettitt.test", "br.test", "tapply"}, False) - ucrPnlOptions.AddFunctionNamesCondition(rdoMultiple, {"cpt.mean", "cpt.var", "cpt.meanvar", "snh.test", "pettitt.test", "br.test", "tapply"}, False) + ucrPnlOptions.AddRadioButton(rdoPrepare) + ucrPnlOptions.AddRadioButton(rdoQualityControl) + ucrPnlOptions.AddRadioButton(rdoMonthlyTotals) + ucrPnlOptions.AddRadioButton(rdoHomogenization) + ucrPnlOptions.AddParameterValuesCondition(rdoSingle, "checked", "single") + ucrPnlOptions.AddParameterValuesCondition(rdoPrepare, "checked", "prepare") + ucrPnlOptions.AddParameterValuesCondition(rdoQualityControl, "checked", "quality") + ucrPnlOptions.AddParameterValuesCondition(rdoMonthlyTotals, "checked", "month_totals") + ucrPnlOptions.AddParameterValuesCondition(rdoHomogenization, "checked", "homogen") ucrChkPlot.SetText("Plot") ucrChkPlot.AddRSyntaxContainsFunctionNamesCondition(True, {"plot"}) @@ -148,16 +205,13 @@ Public Class dlgHomogenization ucrInputPenValue.SetValidationTypeAsNumeric() ttOptions.SetToolTip(ucrInputPenValue.txtInput, "The theoretical type I error e.g.0.05 when using the Asymptotic penalty. A vector of length 2 (min,max) if using the CROPS penalty") - 'ucrSaveResult.SetDataFrameSelector(ucrSelectorHomogenization.ucrAvailableDataFrames) ucrSaveResult.SetCheckBoxText("Save Test Object:") - 'ucrSaveResult.SetSaveTypeAsModel() - 'ucrSaveResult.SetIsComboBox() - 'ucrSaveResult.SetPrefix("Test") - 'ucrSaveResult.SetAssignToIfUncheckedValue("last_model") + ucrPnlOptions.AddToLinkedControls({ucrSelectorHomogenization, ucrSaveResult, ucrReceiverNeighbour, ucrReceiverStation, ucrReceiverElement}, {rdoSingle}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrInputClimateVariables}, {rdoPrepare, rdoQualityControl, rdoHomogenization, rdoMonthlyTotals}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrPnlOptions.AddToLinkedControls({ucrInputInitialYear, ucrInputFinalYear}, {rdoQualityControl, rdoHomogenization, rdoMonthlyTotals}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrInputComboPenalty.AddToLinkedControls(ucrInputPenValue, {"Asymptotic", "CROPS"}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=0) ucrInputComboMethod.AddToLinkedControls(ucrInputQ, {"SegNeigh", "BinSeg"}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=5) - ucrPnlOptions.AddToLinkedControls(ucrReceiverNeighbour, {rdoNeighbouring}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrInputComboMeanDistribution, {rdoCptMean}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrInputComboVarDistribution, {rdoCptVariance}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) ucrPnlMethods.AddToLinkedControls(ucrInputComboMeanVarDistribution, {rdoCptMeanVariance}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) @@ -166,10 +220,11 @@ Public Class dlgHomogenization ucrReceiverNeighbour.SetLinkedDisplayControl(lblNeighbouring) ucrInputPenValue.SetLinkedDisplayControl(lblPenaltyValue) ucrInputQ.SetLinkedDisplayControl(lblQ) + ucrReceiverElement.SetLinkedDisplayControl(lblElement) + ucrReceiverStation.SetLinkedDisplayControl(lblStation) + + lstOfRadioButtons = New List(Of RadioButton) From {rdoPrepare, rdoQualityControl, rdoMonthlyTotals, rdoHomogenization} - 'Not yet working! - rdoMultiple.Enabled = False - rdoNeighbouring.Enabled = False End Sub Private Sub SetDefaults() @@ -183,17 +238,34 @@ Public Class dlgHomogenization clsPettittFunction = New RFunction clsBuishandFunction = New RFunction clsCompleteCasesFunction = New RFunction + clsCsv2climatolFunction = New RFunction + clsDummyFunction = New RFunction + clsGetColumnsFunction = New RFunction + clsPmatchFunction = New RFunction + clsColumnsFunction = New RFunction + clsPmatch2Function = New RFunction + clsColumns2Function = New RFunction + clsGetStnColumnsFunction = New RFunction + clsHomogenQCFunctin = New RFunction + clsDdm2Function = New RFunction + clsHomogenFunction = New RFunction clsBracketsOperator = New ROperator clsLeftBracketOperator = New ROperator clsRightBracketOperator = New ROperator + clsVars1ColumnsFunction = New ROperator + clsVars2ColumnsFunction = New ROperator ucrSelectorHomogenization.Reset() ucrReceiverElement.SetMeAsReceiver() - 'ucrSaveResult.Reset() + ucrReceiverDataFiles.SetMeAsReceiver() + ucrSelectorDataFiles.Reset() + ucrSelectorStationFile.Reset() 'TODO: Set conditions properly! rdoSnht.Checked = True + clsDummyFunction.AddParameter("checked", "single", iPosition:=0) + clsCptMeanFunction.SetPackageName("changepoint") clsCptMeanFunction.SetRCommand("cpt.mean") clsCptMeanFunction.AddParameter("Q", 5, iPosition:=5) @@ -248,9 +320,59 @@ Public Class dlgHomogenization clsRightBracketOperator.bSpaceAroundOperation = False clsRightBracketOperator.bBrackets = False + clsCsv2climatolFunction.SetPackageName("climatol") + clsCsv2climatolFunction.SetRCommand("csv2climatol") + clsCsv2climatolFunction.AddParameter("datacol", clsRFunctionParameter:=clsPmatchFunction, iPosition:=1) + clsCsv2climatolFunction.AddParameter("stncol", clsRFunctionParameter:=clsPmatch2Function, iPosition:=3) + clsCsv2climatolFunction.AddParameter("header", "TRUE", iPosition:=4) + + clsGetColumnsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsGetColumnsFunction.SetAssignTo("col_data") + + clsGetStnColumnsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsGetStnColumnsFunction.SetAssignTo("stn_data") + + clsVars1ColumnsFunction.SetOperation("", bBracketsTemp:=False) + clsVars1ColumnsFunction.SetAssignTo("var_1") + + clsColumnsFunction.SetRCommand("colnames") + + clsPmatchFunction.SetRCommand("pmatch") + clsPmatchFunction.AddParameter("elements", clsRFunctionParameter:=clsColumnsFunction, bIncludeArgumentName:=False, iPosition:=0) + clsPmatchFunction.AddParameter("duplicates.ok", "TRUE", iPosition:=1) + clsPmatchFunction.AddParameter("cols", clsROperatorParameter:=clsVars1ColumnsFunction, bIncludeArgumentName:=False, iPosition:=0) + clsPmatchFunction.SetAssignTo("data_file") + + clsVars2ColumnsFunction.SetOperation("", bBracketsTemp:=False) + clsVars2ColumnsFunction.SetAssignTo("var_2") + + clsColumns2Function.SetRCommand("colnames") + + clsPmatch2Function.SetRCommand("pmatch") + clsPmatch2Function.AddParameter("stn_data", clsRFunctionParameter:=clsColumns2Function, bIncludeArgumentName:=False, iPosition:=0) + clsPmatch2Function.AddParameter("duplicates.ok", "TRUE", iPosition:=1) + clsPmatch2Function.AddParameter("cols", clsROperatorParameter:=clsVars2ColumnsFunction, bIncludeArgumentName:=False, iPosition:=0) + clsPmatch2Function.SetAssignTo("stns_file") + + clsHomogenQCFunctin.SetPackageName("climatol") + clsHomogenQCFunctin.SetRCommand("homogen") + clsHomogenQCFunctin.AddParameter("onlyQC", "TRUE", iPosition:=3) + clsHomogenQCFunctin.SetAssignTo("QC") + + clsDdm2Function.SetPackageName("climatol") + clsDdm2Function.SetRCommand("dd2m") + clsDdm2Function.AddParameter("valm", 1, iPosition:=3) + + clsHomogenFunction.SetPackageName("climatol") + clsHomogenFunction.SetRCommand("homogen") + clsHomogenFunction.AddParameter("std", 1, iPosition:=3) + clsHomogenFunction.AddParameter("annual", Chr(34) & "total" & Chr(34), iPosition:=4) + ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseRFunction(clsSnhtFunction) AddPlotSummaryParameters() + + ResetRadioButtons() End Sub Private Sub SetRCodeForControls(bReset As Boolean) @@ -283,26 +405,43 @@ Public Class dlgHomogenization ucrReceiverStation.SetRCode(clsLeftBracketOperator, bReset) - 'ucrPnlMethods.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - ucrPnlOptions.SetRCode(ucrBase.clsRsyntax.clsBaseFunction, bReset) - - 'ucrSaveResult.AddAdditionalRCode(clsCptVarianceFunction, iAdditionalPairNo:=1) - 'ucrSaveResult.AddAdditionalRCode(clsCptMeanVarianceFunction, iAdditionalPairNo:=2) - 'ucrSaveResult.AddAdditionalRCode(clsPettittFunction, iAdditionalPairNo:=3) - 'ucrSaveResult.AddAdditionalRCode(clsSnhtFunction, iAdditionalPairNo:=4) - 'ucrSaveResult.AddAdditionalRCode(clsBuishandFunction, iAdditionalPairNo:=5) - - 'ucrSaveResult.SetRCode(clsCptMeanFunction, bReset) + If bReset Then + ucrPnlOptions.SetRCode(clsDummyFunction, bReset) + End If + ucrReceiverDataFiles.SetRCode(clsGetColumnsFunction, bReset) + ucrSelectorDataFiles.SetRCode(clsGetColumnsFunction, bReset) + ucrReceiverLatitude.SetRCode(clsGetColumnsFunction, bReset) + ucrReceiverLongtitude.SetRCode(clsGetColumnsFunction, bReset) + ucrReceiverElavation.SetRCode(clsGetColumnsFunction, bReset) + ucrReceiverStationId.SetRCode(clsGetColumnsFunction, bReset) + ucrReceiverStationName.SetRCode(clsGetColumnsFunction, bReset) + ucrInputClimateVariables.SetRCode(clsCsv2climatolFunction, bReset) + ucrSelectorStationFile.SetRCode(clsGetStnColumnsFunction, bReset) ucrChkPlot.SetRSyntax(ucrBase.clsRsyntax, bReset) ucrChkSummary.SetRSyntax(ucrBase.clsRsyntax, bReset) + ucrInputFinalYear.SetRSyntax(ucrBase.clsRsyntax, bReset) + ucrInputInitialYear.SetRSyntax(ucrBase.clsRsyntax, bReset) + End Sub + + Private Sub ResetRadioButtons() + With lstOfRadioButtons + .ForEach(Sub(radioButton) radioButton.Enabled = False) + .First().Enabled = True + End With End Sub Private Sub TestOkEnabled() - If ucrReceiverElement.IsEmpty OrElse Not ucrSaveResult.IsComplete OrElse (ucrInputComboMethod.GetText = "BinSeg" AndAlso ucrInputQ.IsEmpty) OrElse (ucrInputComboPenalty.GetText = "Asymptotic" AndAlso ucrInputPenValue.IsEmpty) OrElse ucrNudMinSegLen.GetText = "" Then - ucrBase.OKEnabled(False) + If rdoSingle.Checked Then + If ucrReceiverElement.IsEmpty OrElse Not ucrSaveResult.IsComplete OrElse (ucrInputComboMethod.GetText = "BinSeg" AndAlso ucrInputQ.IsEmpty) OrElse (ucrInputComboPenalty.GetText = "Asymptotic" AndAlso ucrInputPenValue.IsEmpty) OrElse ucrNudMinSegLen.GetText = "" Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) + End If + ElseIf rdoPrepare.Checked Then + ucrBase.OKEnabled((Not ucrReceiverLatitude.IsEmpty AndAlso Not ucrReceiverLongtitude.IsEmpty AndAlso (Not ucrReceiverStationName.IsEmpty OrElse Not ucrReceiverStationId.IsEmpty) AndAlso Not ucrReceiverDataFiles.IsEmpty) AndAlso Not ucrInputClimateVariables.IsEmpty) Else - ucrBase.OKEnabled(True) + ucrBase.OKEnabled(Not ucrInputClimateVariables.IsEmpty AndAlso Not ucrInputInitialYear.IsEmpty AndAlso Not ucrInputFinalYear.IsEmpty) End If End Sub @@ -387,7 +526,189 @@ Public Class dlgHomogenization TestOkEnabled() End Sub - Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveResult.ControlContentsChanged, ucrInputQ.ControlContentsChanged, ucrInputPenValue.ControlContentsChanged, ucrNudMinSegLen.ControlContentsChanged, ucrInputComboMethod.ControlContentsChanged, ucrInputComboPenalty.ControlContentsChanged + Private Sub ucrPnlOptions_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOptions.ControlValueChanged + If rdoSingle.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsSnhtFunction) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsHomogenQCFunctin) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsDdm2Function) + ucrBase.clsRsyntax.RemoveFromAfterCodes(clsHomogenFunction) + ElseIf rdoPrepare.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsCsv2climatolFunction) + ElseIf rdoQualityControl.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsHomogenQCFunctin) + ElseIf rdoMonthlyTotals.Checked Then + ucrBase.clsRsyntax.SetBaseRFunction(clsDdm2Function) + Else + ucrBase.clsRsyntax.SetBaseRFunction(clsHomogenFunction) + End If + DialogSize() + HideShowControls() + End Sub + + Private Sub HideShowControls() + If rdoPrepare.Checked Then + grpDataFile.Show() + grpStationFile.Show() + grpMethods.Hide() + grpCptOptions.Hide() + grpOutputOptions.Hide() + ElseIf rdoHomogenization.Checked Then + grpMethods.Hide() + grpCptOptions.Hide() + grpOutputOptions.Hide() + grpStationFile.Hide() + grpDataFile.Hide() + ElseIf rdoMonthlyTotals.Checked Then + grpMethods.Hide() + grpCptOptions.Hide() + grpOutputOptions.Hide() + grpStationFile.Hide() + grpDataFile.Hide() + ElseIf rdoQualityControl.Checked Then + grpMethods.Hide() + grpCptOptions.Hide() + grpOutputOptions.Hide() + grpStationFile.Hide() + grpDataFile.Hide() + Else + grpStationFile.Hide() + grpDataFile.Hide() + grpMethods.Show() + grpCptOptions.Show() + grpOutputOptions.Show() + End If + End Sub + + Private Sub DialogSize() + If rdoSingle.Checked Then + Me.Size = New Size(438, 550) + Me.ucrBase.Location = New Point(12, 460) + ElseIf rdoPrepare.Checked Then + Me.Size = New Size(438, 609) + Me.ucrBase.Location = New Point(12, 515) + Me.ucrInputClimateVariables.Location = New Point(284, 464) + Me.lblClimaticVariable.Location = New Point(195, 468) + Else + Me.Size = New Size(438, 160) + Me.ucrBase.Location = New Point(12, 130) + Me.ucrInputClimateVariables.Location = New Point(272, 61) + Me.ucrInputInitialYear.Location = New Point(77, 59) + Me.ucrInputFinalYear.Location = New Point(77, 90) + Me.lblClimaticVariable.Location = New Point(182, 65) + Me.lblFinalYear.Location = New Point(15, 94) + Me.lblInitialYear.Location = New Point(15, 63) + End If + End Sub + + Private Sub ucrReceiverDataFiles_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDataFiles.ControlValueChanged + If Not ucrReceiverDataFiles.IsEmpty Then + clsVars1ColumnsFunction.AddParameter("cols", ucrReceiverDataFiles.GetVariableNames(True), iPosition:=0, bIncludeArgumentName:=False) + Else + clsVars1ColumnsFunction.RemoveParameterByName("cols") + End If + End Sub + + Private Sub ucrSelectorDataFiles_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorDataFiles.ControlValueChanged + If Not ucrSelectorDataFiles.IsEmpty Then + clsColumnsFunction.AddParameter("data", clsRCodeStructureParameter:=ucrSelectorDataFiles.ucrAvailableDataFrames.clsCurrDataFrame, bIncludeArgumentName:=False, iPosition:=0) + clsCsv2climatolFunction.AddParameter("data", Chr(34) & ucrSelectorDataFiles.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & ".csv" & Chr(34), bIncludeArgumentName:=False, iPosition:=0) + Else + clsColumnsFunction.RemoveParameterByName("data") + clsCsv2climatolFunction.RemoveParameterByName("data") + End If + End Sub + + Private Sub ucrSelectorStationFile_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorStationFile.ControlValueChanged + If Not ucrSelectorStationFile.IsEmpty Then + clsColumns2Function.AddParameter("stndata", clsRCodeStructureParameter:=ucrSelectorStationFile.ucrAvailableDataFrames.clsCurrDataFrame, bIncludeArgumentName:=False, iPosition:=0) + clsCsv2climatolFunction.AddParameter("stnfile", Chr(34) & ucrSelectorStationFile.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem & ".csv" & Chr(34), iPosition:=2) + Else + clsColumns2Function.RemoveParameterByName("stndata") + clsCsv2climatolFunction.RemoveParameterByName("stnfile") + End If + End Sub + + Private Sub ucrInputClimateVariables_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputClimateVariables.ControlValueChanged + If Not ucrInputClimateVariables.IsEmpty Then + clsCsv2climatolFunction.AddParameter("varcli", Chr(34) & ucrInputClimateVariables.GetText & Chr(34), iPosition:=5) + clsHomogenQCFunctin.AddParameter("par", Chr(34) & ucrInputClimateVariables.GetText & Chr(34), bIncludeArgumentName:=False, iPosition:=0) + clsDdm2Function.AddParameter("var", Chr(34) & ucrInputClimateVariables.GetText & Chr(34), bIncludeArgumentName:=False, iPosition:=0) + clsHomogenFunction.AddParameter("name", Chr(34) & ucrInputClimateVariables.GetText & "-m" & Chr(34), bIncludeArgumentName:=False, iPosition:=0) + Else + clsCsv2climatolFunction.RemoveParameterByName("varcli") + clsHomogenQCFunctin.RemoveParameterByName("par") + clsDdm2Function.RemoveParameterByName("var") + clsHomogenFunction.RemoveParameterByName("name") + End If + End Sub + + Private Sub ucrInputFinalYear_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputFinalYear.ControlValueChanged + If Not ucrInputFinalYear.IsEmpty Then + clsHomogenQCFunctin.AddParameter("anyf", ucrInputFinalYear.GetText, iPosition:=2, bIncludeArgumentName:=False) + clsDdm2Function.AddParameter("initial", ucrInputFinalYear.GetText, bIncludeArgumentName:=False, iPosition:=2) + clsHomogenFunction.AddParameter("in_yr", ucrInputFinalYear.GetText, bIncludeArgumentName:=False, iPosition:=2) + Else + clsHomogenQCFunctin.RemoveParameterByName("anyf") + clsDdm2Function.RemoveParameterByName("par") + clsHomogenFunction.RemoveParameterByName("in_yr") + End If + End Sub + + Private Sub ucrInputInitialYear_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputInitialYear.ControlValueChanged + If Not ucrInputInitialYear.IsEmpty Then + clsHomogenQCFunctin.AddParameter("anyi", ucrInputInitialYear.GetText, iPosition:=1, bIncludeArgumentName:=False) + clsDdm2Function.AddParameter("final", ucrInputInitialYear.GetText, bIncludeArgumentName:=False, iPosition:=1) + clsHomogenFunction.AddParameter("final_yr", ucrInputInitialYear.GetText, bIncludeArgumentName:=False, iPosition:=1) + Else + clsHomogenQCFunctin.RemoveParameterByName("anyi") + clsDdm2Function.RemoveParameterByName("final") + clsHomogenFunction.RemoveParameterByName("final_yr") + End If + End Sub + + Private Sub ucrReceiverLatitude_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverLatitude.ControlValueChanged, ucrReceiverElavation.ControlValueChanged, + ucrReceiverLongtitude.ControlValueChanged, ucrReceiverStationId.ControlValueChanged, ucrReceiverStationName.ControlValueChanged + If Not ucrReceiverLatitude.IsEmpty AndAlso Not ucrReceiverLongtitude.IsEmpty Then + Dim lstVariables As New List(Of String)() + + lstVariables.Add(ucrReceiverLatitude.GetVariableNames()) + lstVariables.Add(ucrReceiverLongtitude.GetVariableNames()) + + If Not ucrReceiverElavation.IsEmpty Then + lstVariables.Add(ucrReceiverElavation.GetVariableNames()) + Else + lstVariables.Add(0) + End If + + If Not ucrReceiverStationName.IsEmpty Then + lstVariables.Add(ucrReceiverStationName.GetVariableNames()) + End If + + If Not ucrReceiverStationId.IsEmpty Then + lstVariables.Add(ucrReceiverStationId.GetVariableNames()) + End If + clsVars2ColumnsFunction.AddParameter("cols", "c(" & String.Join(", ", lstVariables) & ")", iPosition:=0, bIncludeArgumentName:=False) + Else + clsVars2ColumnsFunction.RemoveParameterByName("cols") + End If + End Sub + + Private Sub ucrBase_ClickOk(sender As Object, e As EventArgs) Handles ucrBase.ClickOk + If iEnabledRadioButtonIndex >= 0 AndAlso iEnabledRadioButtonIndex < lstOfRadioButtons.Count - 1 Then + ' Enable the next radio button + iEnabledRadioButtonIndex += 1 + lstOfRadioButtons(iEnabledRadioButtonIndex).Enabled = True + Else + ' If all radio buttons are enabled, you may want to reset the counter or handle it as per your requirements + ' For this example, I am resetting the counter to 0 + iEnabledRadioButtonIndex = 0 + End If + End Sub + + Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElement.ControlContentsChanged, ucrSaveResult.ControlContentsChanged, + ucrInputQ.ControlContentsChanged, ucrInputPenValue.ControlContentsChanged, ucrNudMinSegLen.ControlContentsChanged, + ucrInputComboMethod.ControlContentsChanged, ucrInputComboPenalty.ControlContentsChanged, ucrReceiverDataFiles.ControlContentsChanged, ucrInputFinalYear.ControlContentsChanged, ucrInputInitialYear.ControlContentsChanged, ucrInputClimateVariables.ControlContentsChanged, + ucrReceiverStationName.ControlContentsChanged, ucrReceiverStationId.ControlContentsChanged, ucrReceiverLongtitude.ControlContentsChanged, ucrReceiverLatitude.ControlContentsChanged TestOkEnabled() End Sub End Class \ No newline at end of file diff --git a/instat/dlgIDFCurves.Designer.vb b/instat/dlgIDFCurves.Designer.vb index f9af1238740..d5264b4eda9 100644 --- a/instat/dlgIDFCurves.Designer.vb +++ b/instat/dlgIDFCurves.Designer.vb @@ -22,13 +22,150 @@ Partial Class dlgIDFCurves 'Do not modify it using the code editor. _ Private Sub InitializeComponent() + Me.lblDateTime = New System.Windows.Forms.Label() + Me.lblRain = New System.Windows.Forms.Label() + Me.lblStationName = New System.Windows.Forms.Label() + Me.lblMinimumProp = New System.Windows.Forms.Label() + Me.ucrSave = New instat.ucrSave() + Me.ucrNudMaxPrec = New instat.ucrNud() + Me.ucrStationName = New instat.ucrInputTextBox() + Me.ucrReceiverPrec = New instat.ucrReceiverSingle() + Me.ucrReceiverDateTime = New instat.ucrReceiverSingle() + Me.ucrIDFCurvesSelector = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() Me.SuspendLayout() ' + 'lblDateTime + ' + Me.lblDateTime.AutoSize = True + Me.lblDateTime.Location = New System.Drawing.Point(290, 38) + Me.lblDateTime.Name = "lblDateTime" + Me.lblDateTime.Size = New System.Drawing.Size(56, 13) + Me.lblDateTime.TabIndex = 4 + Me.lblDateTime.Text = "Date-Time" + ' + 'lblRain + ' + Me.lblRain.AutoSize = True + Me.lblRain.Location = New System.Drawing.Point(289, 81) + Me.lblRain.Name = "lblRain" + Me.lblRain.Size = New System.Drawing.Size(29, 13) + Me.lblRain.TabIndex = 5 + Me.lblRain.Text = "Rain" + ' + 'lblStationName + ' + Me.lblStationName.AutoSize = True + Me.lblStationName.Location = New System.Drawing.Point(289, 128) + Me.lblStationName.Name = "lblStationName" + Me.lblStationName.Size = New System.Drawing.Size(71, 13) + Me.lblStationName.TabIndex = 7 + Me.lblStationName.Text = "Station Name" + ' + 'lblMinimumProp + ' + Me.lblMinimumProp.AutoSize = True + Me.lblMinimumProp.Location = New System.Drawing.Point(263, 186) + Me.lblMinimumProp.Name = "lblMinimumProp" + Me.lblMinimumProp.Size = New System.Drawing.Size(99, 13) + Me.lblMinimumProp.TabIndex = 9 + Me.lblMinimumProp.Text = "Minimum Proportion" + ' + 'ucrSave + ' + Me.ucrSave.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSave.Location = New System.Drawing.Point(7, 224) + Me.ucrSave.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSave.Name = "ucrSave" + Me.ucrSave.Size = New System.Drawing.Size(401, 24) + Me.ucrSave.TabIndex = 70 + ' + 'ucrNudMaxPrec + ' + Me.ucrNudMaxPrec.AutoSize = True + Me.ucrNudMaxPrec.DecimalPlaces = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxPrec.Increment = New Decimal(New Integer() {1, 0, 0, 0}) + Me.ucrNudMaxPrec.Location = New System.Drawing.Point(365, 183) + Me.ucrNudMaxPrec.Maximum = New Decimal(New Integer() {100, 0, 0, 0}) + Me.ucrNudMaxPrec.Minimum = New Decimal(New Integer() {0, 0, 0, 0}) + Me.ucrNudMaxPrec.Name = "ucrNudMaxPrec" + Me.ucrNudMaxPrec.Size = New System.Drawing.Size(50, 20) + Me.ucrNudMaxPrec.TabIndex = 8 + Me.ucrNudMaxPrec.Value = New Decimal(New Integer() {0, 0, 0, 0}) + ' + 'ucrStationName + ' + Me.ucrStationName.AddQuotesIfUnrecognised = True + Me.ucrStationName.AutoSize = True + Me.ucrStationName.IsMultiline = False + Me.ucrStationName.IsReadOnly = False + Me.ucrStationName.Location = New System.Drawing.Point(286, 144) + Me.ucrStationName.Name = "ucrStationName" + Me.ucrStationName.Size = New System.Drawing.Size(130, 21) + Me.ucrStationName.TabIndex = 6 + ' + 'ucrReceiverPrec + ' + Me.ucrReceiverPrec.AutoSize = True + Me.ucrReceiverPrec.frmParent = Me + Me.ucrReceiverPrec.Location = New System.Drawing.Point(286, 98) + Me.ucrReceiverPrec.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverPrec.Name = "ucrReceiverPrec" + Me.ucrReceiverPrec.Selector = Nothing + Me.ucrReceiverPrec.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverPrec.strNcFilePath = "" + Me.ucrReceiverPrec.TabIndex = 3 + Me.ucrReceiverPrec.ucrSelector = Nothing + ' + 'ucrReceiverDateTime + ' + Me.ucrReceiverDateTime.AutoSize = True + Me.ucrReceiverDateTime.frmParent = Me + Me.ucrReceiverDateTime.Location = New System.Drawing.Point(286, 55) + Me.ucrReceiverDateTime.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverDateTime.Name = "ucrReceiverDateTime" + Me.ucrReceiverDateTime.Selector = Nothing + Me.ucrReceiverDateTime.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverDateTime.strNcFilePath = "" + Me.ucrReceiverDateTime.TabIndex = 2 + Me.ucrReceiverDateTime.ucrSelector = Nothing + ' + 'ucrIDFCurvesSelector + ' + Me.ucrIDFCurvesSelector.AutoSize = True + Me.ucrIDFCurvesSelector.bDropUnusedFilterLevels = False + Me.ucrIDFCurvesSelector.bShowHiddenColumns = False + Me.ucrIDFCurvesSelector.bUseCurrentFilter = True + Me.ucrIDFCurvesSelector.Location = New System.Drawing.Point(6, 8) + Me.ucrIDFCurvesSelector.Margin = New System.Windows.Forms.Padding(0) + Me.ucrIDFCurvesSelector.Name = "ucrIDFCurvesSelector" + Me.ucrIDFCurvesSelector.Size = New System.Drawing.Size(213, 183) + Me.ucrIDFCurvesSelector.TabIndex = 1 + ' + 'ucrBase + ' + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(6, 258) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 0 + ' 'dlgIDFCurves ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(487, 450) + Me.ClientSize = New System.Drawing.Size(417, 329) + Me.Controls.Add(Me.ucrSave) + Me.Controls.Add(Me.lblMinimumProp) + Me.Controls.Add(Me.ucrNudMaxPrec) + Me.Controls.Add(Me.lblStationName) + Me.Controls.Add(Me.ucrStationName) + Me.Controls.Add(Me.lblRain) + Me.Controls.Add(Me.lblDateTime) + Me.Controls.Add(Me.ucrReceiverPrec) + Me.Controls.Add(Me.ucrReceiverDateTime) + Me.Controls.Add(Me.ucrIDFCurvesSelector) + Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False Me.MinimizeBox = False @@ -36,6 +173,19 @@ Partial Class dlgIDFCurves Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "IDF Curves" Me.ResumeLayout(False) + Me.PerformLayout() End Sub + + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrIDFCurvesSelector As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverDateTime As ucrReceiverSingle + Friend WithEvents lblStationName As Label + Friend WithEvents ucrStationName As ucrInputTextBox + Friend WithEvents lblRain As Label + Friend WithEvents lblDateTime As Label + Friend WithEvents ucrReceiverPrec As ucrReceiverSingle + Friend WithEvents lblMinimumProp As Label + Friend WithEvents ucrNudMaxPrec As ucrNud + Friend WithEvents ucrSave As ucrSave End Class diff --git a/instat/dlgIDFCurves.vb b/instat/dlgIDFCurves.vb index e146ccf6d86..d0e3ce284eb 100644 --- a/instat/dlgIDFCurves.vb +++ b/instat/dlgIDFCurves.vb @@ -1,3 +1,167 @@ -Public Class dlgIDFCurves +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . +Imports instat.Translations +Public Class dlgIDFCurves + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private bResetRCode As Boolean = True + Private clsIDFCurvesFunction, clsPmatchFunction, clsGetColumnsFunction, clsColumnsFunction As New RFunction + Private clsVarsColumnsOperator, clsVars1ColumnsOperator As ROperator + + Private Sub dlgIDFCurves_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRCodeForControls(bReset) + bReset = False + TestOKEnabled() + autoTranslate(Me) + End Sub + + Private Sub InitialiseDialog() + ucrBase.clsRsyntax.bSeparateThread = False + + ucrIDFCurvesSelector.SetParameter(New RParameter("prdat", 0)) + ucrIDFCurvesSelector.SetParameterIsrfunction() + + ucrReceiverDateTime.SetParameter(New RParameter("clmn", 1)) + ucrReceiverDateTime.Selector = ucrIDFCurvesSelector + + ucrReceiverPrec.SetParameter(New RParameter("clmn", 1)) + ucrReceiverPrec.Selector = ucrIDFCurvesSelector + + ucrStationName.SetParameter(New RParameter("stname", 2)) + + ucrNudMaxPrec.SetParameter(New RParameter("mindpy", 3)) + ucrNudMaxPrec.SetMinMax(0.0, 1.0) + ucrNudMaxPrec.Increment = 0.1 + ucrNudMaxPrec.DecimalPlaces = 1 + ucrNudMaxPrec.SetRDefault(0.8) + + ucrSave.SetPrefix("Prec_accum") + ucrSave.SetIsComboBox() + ucrSave.SetCheckBoxText("Save DataFrame") + ucrSave.SetSaveTypeAsDataFrame() + ucrSave.SetDataFrameSelector(ucrIDFCurvesSelector.ucrAvailableDataFrames) + ucrSave.SetAssignToIfUncheckedValue("last_accum") + + End Sub + + Private Sub SetDefaults() + clsIDFCurvesFunction = New RFunction + clsPmatchFunction = New RFunction + clsGetColumnsFunction = New RFunction + + clsColumnsFunction = New RFunction + + clsVarsColumnsOperator = New ROperator + clsVars1ColumnsOperator = New ROperator + + ucrIDFCurvesSelector.Reset() + ucrReceiverDateTime.SetMeAsReceiver() + + clsGetColumnsFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_columns_from_data") + clsGetColumnsFunction.SetAssignTo("col_data") + + clsVarsColumnsOperator.SetOperation("", bBracketsTemp:=False) + clsVarsColumnsOperator.SetAssignTo("var_1") + + clsVars1ColumnsOperator.SetOperation("", bBracketsTemp:=False) + clsVars1ColumnsOperator.SetAssignTo("var_2") + + clsColumnsFunction.SetRCommand("colnames") + + clsPmatchFunction.SetRCommand("pmatch") + clsPmatchFunction.AddParameter("elements", clsRFunctionParameter:=clsColumnsFunction, bIncludeArgumentName:=False, iPosition:=0) + clsPmatchFunction.AddParameter("duplicates.ok", "TRUE", iPosition:=1) + clsPmatchFunction.AddParameter("cols", clsROperatorParameter:=clsVars1ColumnsOperator, bIncludeArgumentName:=False, iPosition:=0) + clsPmatchFunction.SetAssignTo("data_file") + + clsIDFCurvesFunction.SetPackageName("climatol") + clsIDFCurvesFunction.SetRCommand("IDFcurves") + clsIDFCurvesFunction.AddParameter("clmn", clsRFunctionParameter:=clsPmatchFunction, iPosition:=2) + clsIDFCurvesFunction.AddParameter("na.code", "NA", iPosition:=3) + + ucrBase.clsRsyntax.SetBaseRFunction(clsIDFCurvesFunction) + ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = True + End Sub + + Private Sub SetRCodeForControls(bReset As Boolean) + ucrIDFCurvesSelector.SetRCode(clsGetColumnsFunction, bReset) + ucrNudMaxPrec.SetRCode(clsIDFCurvesFunction, bReset) + ucrStationName.SetRCode(clsIDFCurvesFunction, bReset) + ucrSave.SetRCode(clsIDFCurvesFunction, bReset) + + If bReset Then + ucrReceiverDateTime.SetRCode(clsGetColumnsFunction, bReset) + ucrReceiverPrec.SetRCode(clsGetColumnsFunction, bReset) + End If + End Sub + + Private Sub TestOkEnabled() + ucrBase.OKEnabled(Not ucrReceiverDateTime.IsEmpty AndAlso Not ucrReceiverPrec.IsEmpty AndAlso Not ucrStationName.IsEmpty) + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRCodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub ucrReceiverPrec_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverPrec.ControlValueChanged, ucrReceiverDateTime.ControlValueChanged + If Not ucrReceiverPrec.IsEmpty AndAlso Not ucrReceiverDateTime.IsEmpty Then + clsVars1ColumnsOperator.AddParameter("cols", "c(" & ucrReceiverDateTime.GetVariableNames() & ", " & ucrReceiverPrec.GetVariableNames() & ")", iPosition:=0, bIncludeArgumentName:=False) + Else + clsVars1ColumnsOperator.RemoveParameterByName("cols") + End If + End Sub + + Private Sub ucrNudMaxPrec_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrNudMaxPrec.ControlValueChanged + If Not ucrNudMaxPrec.IsEmpty Then + clsIDFCurvesFunction.AddParameter("mindpy", ucrNudMaxPrec.GetText, iPosition:=5) + Else + clsIDFCurvesFunction.RemoveParameterByName("mindpy") + End If + End Sub + + Private Sub ucrStationName_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrStationName.ControlValueChanged + If Not ucrStationName.IsEmpty Then + clsIDFCurvesFunction.AddParameter("stname", Chr(34) & ucrStationName.GetText & Chr(34), iPosition:=4) + Else + clsIDFCurvesFunction.RemoveParameterByName("stname") + End If + End Sub + + Private Sub ucrIDFCurvesSelector_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrIDFCurvesSelector.ControlValueChanged + If Not ucrIDFCurvesSelector.IsEmpty Then + clsColumnsFunction.AddParameter("data", clsRCodeStructureParameter:=ucrIDFCurvesSelector.ucrAvailableDataFrames.clsCurrDataFrame, bIncludeArgumentName:=False, iPosition:=0) + clsIDFCurvesFunction.AddParameter("data", ucrIDFCurvesSelector.ucrAvailableDataFrames.cboAvailableDataFrames.SelectedItem, bIncludeArgumentName:=False, iPosition:=0) + Else + clsColumnsFunction.RemoveParameterByName("data") + clsIDFCurvesFunction.RemoveParameterByName("data") + End If + End Sub + + Private Sub ucrReceiverDateTime_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDateTime.ControlContentsChanged, +ucrReceiverPrec.ControlContentsChanged, ucrStationName.ControlContentsChanged + TestOkEnabled() + End Sub End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index a9172782aa6..9a8750bf72f 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -2197,7 +2197,6 @@ Partial Class frmMain ' 'mnuClimaticDescribeIDF ' - Me.mnuClimaticDescribeIDF.Enabled = False Me.mnuClimaticDescribeIDF.Name = "mnuClimaticDescribeIDF" Me.mnuClimaticDescribeIDF.Size = New System.Drawing.Size(211, 22) Me.mnuClimaticDescribeIDF.Text = "IDF..." @@ -5100,8 +5099,9 @@ Partial Class frmMain Me.MainMenuStrip = Me.mnuBar Me.Name = "frmMain" Me.Text = "R-Instat " + My.Application.Info.Version.Major.ToString + "." + - My.Application.Info.Version.Minor.ToString + "." + - My.Application.Info.Version.Build.ToString() + My.Application.Info.Version.Minor.ToString + "." + + My.Application.Info.Version.Build.ToString + Me.Text = "R-Instat .." Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.stsStrip.ResumeLayout(False) Me.stsStrip.PerformLayout() diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 53a7c82fb5e..fd19d0d0f00 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -1921,14 +1921,14 @@ DataBook$set("public", "export_workspace", function(data_names, file, include_gr for(temp_name in data_names) { e[[temp_name]] <- self$get_data_frame(temp_name, use_current_filter = FALSE) if(include_graphs) { - graphs <- self$get_graphs(temp_name) + graphs <- self$get_objects(data_name = temp_name, object_type_label = "graph") graph_names <- names(graphs) for(i in seq_along(graphs)) { e[[paste(temp_name, graph_names[i], sep = "_")]] <- graphs[[i]] } } if(include_models) { - models <- self$get_models(temp_name) + models <- self$get_objects(data_name = temp_name, object_type_label = "model") model_names <- names(models) for(i in seq_along(models)) { e[[paste(temp_name, model_names[i], sep = "_")]] <- models[[i]] diff --git a/instat/translations/rInstatTranslations.db b/instat/translations/rInstatTranslations.db index 82986ede7c3..e10a26275f8 100644 Binary files a/instat/translations/rInstatTranslations.db and b/instat/translations/rInstatTranslations.db differ