diff --git a/instat/dlgExportToClimsoft.Designer.vb b/instat/dlgExportToClimsoft.Designer.vb index 936d119bb8..04cd11be29 100644 --- a/instat/dlgExportToClimsoft.Designer.vb +++ b/instat/dlgExportToClimsoft.Designer.vb @@ -27,49 +27,50 @@ Partial Class dlgExportToClimsoft Me.lblHour = New System.Windows.Forms.Label() Me.lblExport = New System.Windows.Forms.Label() Me.cmdBrowse = New System.Windows.Forms.Button() - Me.ucrChkExportDataFrame = New instat.ucrCheck() + Me.rdoHourly = New System.Windows.Forms.RadioButton() + Me.rdoDaily = New System.Windows.Forms.RadioButton() + Me.lblStationID = New System.Windows.Forms.Label() + Me.rdoExportData = New System.Windows.Forms.RadioButton() + Me.rdoNewDataFrame = New System.Windows.Forms.RadioButton() + Me.grpSave = New System.Windows.Forms.GroupBox() + Me.rdoExportComments = New System.Windows.Forms.RadioButton() + Me.ucrDataFrameSheets = New instat.ucrDataFrame() + Me.ucrPnlOutput = New instat.UcrPanel() + Me.ucrReceiverStationID = New instat.ucrReceiverSingle() Me.ucrInputExportFile = New instat.ucrInputTextBox() Me.ucrSaveNewDataFrame = New instat.ucrSave() - Me.ucrChkNewDataFrame = New instat.ucrCheck() Me.ucrInputHour = New instat.ucrInputTextBox() Me.ucrBase = New instat.ucrButtons() Me.ucrReceiverElements = New instat.ucrReceiverMultiple() Me.ucrReceiverDate = New instat.ucrReceiverSingle() Me.ucrSelectorImportToClimsoft = New instat.ucrSelectorByDataFrameAddRemove() - Me.rdoHourly = New System.Windows.Forms.RadioButton() - Me.rdoDaily = New System.Windows.Forms.RadioButton() Me.ucrPnlDailyHourly = New instat.UcrPanel() - Me.ucrReceiverStationID = New instat.ucrReceiverSingle() - Me.lblStationID = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'lblElement ' Me.lblElement.AutoSize = True - Me.lblElement.Location = New System.Drawing.Point(417, 268) - Me.lblElement.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblElement.Location = New System.Drawing.Point(278, 179) Me.lblElement.Name = "lblElement" - Me.lblElement.Size = New System.Drawing.Size(80, 20) + Me.lblElement.Size = New System.Drawing.Size(53, 13) Me.lblElement.TabIndex = 10 Me.lblElement.Text = "Elements:" ' 'lblDate ' Me.lblDate.AutoSize = True - Me.lblDate.Location = New System.Drawing.Point(417, 140) - Me.lblDate.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblDate.Location = New System.Drawing.Point(278, 93) Me.lblDate.Name = "lblDate" - Me.lblDate.Size = New System.Drawing.Size(48, 20) + Me.lblDate.Size = New System.Drawing.Size(33, 13) Me.lblDate.TabIndex = 6 Me.lblDate.Text = "Date:" ' 'lblHour ' Me.lblHour.AutoSize = True - Me.lblHour.Location = New System.Drawing.Point(417, 204) - Me.lblHour.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblHour.Location = New System.Drawing.Point(278, 136) Me.lblHour.Name = "lblHour" - Me.lblHour.Size = New System.Drawing.Size(48, 20) + Me.lblHour.Size = New System.Drawing.Size(33, 13) Me.lblHour.TabIndex = 8 Me.lblHour.Text = "Hour:" ' @@ -77,33 +78,144 @@ Partial Class dlgExportToClimsoft ' Me.lblExport.AutoSize = True Me.lblExport.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblExport.Location = New System.Drawing.Point(14, 566) - Me.lblExport.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblExport.Location = New System.Drawing.Point(9, 431) Me.lblExport.Name = "lblExport" - Me.lblExport.Size = New System.Drawing.Size(88, 20) + Me.lblExport.Size = New System.Drawing.Size(59, 13) Me.lblExport.TabIndex = 15 Me.lblExport.Text = "Export File:" ' 'cmdBrowse ' Me.cmdBrowse.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdBrowse.Location = New System.Drawing.Point(489, 558) - Me.cmdBrowse.Margin = New System.Windows.Forms.Padding(4) + Me.cmdBrowse.Location = New System.Drawing.Point(326, 426) Me.cmdBrowse.Name = "cmdBrowse" - Me.cmdBrowse.Size = New System.Drawing.Size(120, 34) + Me.cmdBrowse.Size = New System.Drawing.Size(80, 23) Me.cmdBrowse.TabIndex = 17 Me.cmdBrowse.Text = "Browse" Me.cmdBrowse.UseVisualStyleBackColor = True ' - 'ucrChkExportDataFrame + 'rdoHourly + ' + Me.rdoHourly.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoHourly.BackColor = System.Drawing.SystemColors.Control + Me.rdoHourly.Enabled = False + Me.rdoHourly.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoHourly.FlatAppearance.BorderSize = 2 + Me.rdoHourly.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoHourly.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoHourly.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoHourly.Location = New System.Drawing.Point(190, 8) + Me.rdoHourly.Name = "rdoHourly" + Me.rdoHourly.Size = New System.Drawing.Size(91, 28) + Me.rdoHourly.TabIndex = 2 + Me.rdoHourly.TabStop = True + Me.rdoHourly.Tag = "Frequency" + Me.rdoHourly.Text = "Hourly" + Me.rdoHourly.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoHourly.UseVisualStyleBackColor = False + ' + 'rdoDaily + ' + Me.rdoDaily.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoDaily.BackColor = System.Drawing.SystemColors.Control + Me.rdoDaily.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDaily.FlatAppearance.BorderSize = 2 + Me.rdoDaily.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoDaily.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoDaily.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoDaily.Location = New System.Drawing.Point(101, 8) + Me.rdoDaily.Name = "rdoDaily" + Me.rdoDaily.Size = New System.Drawing.Size(91, 28) + Me.rdoDaily.TabIndex = 1 + Me.rdoDaily.TabStop = True + Me.rdoDaily.Tag = "Frequency" + Me.rdoDaily.Text = "Daily" + Me.rdoDaily.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoDaily.UseVisualStyleBackColor = False + ' + 'lblStationID ' - Me.ucrChkExportDataFrame.AutoSize = True - Me.ucrChkExportDataFrame.Checked = False - Me.ucrChkExportDataFrame.Location = New System.Drawing.Point(14, 459) - Me.ucrChkExportDataFrame.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkExportDataFrame.Name = "ucrChkExportDataFrame" - Me.ucrChkExportDataFrame.Size = New System.Drawing.Size(399, 34) - Me.ucrChkExportDataFrame.TabIndex = 13 + Me.lblStationID.AutoSize = True + Me.lblStationID.Location = New System.Drawing.Point(279, 56) + Me.lblStationID.Name = "lblStationID" + Me.lblStationID.Size = New System.Drawing.Size(57, 13) + Me.lblStationID.TabIndex = 4 + Me.lblStationID.Text = "Station ID:" + ' + 'rdoExportData + ' + Me.rdoExportData.AutoSize = True + Me.rdoExportData.Location = New System.Drawing.Point(15, 281) + Me.rdoExportData.Name = "rdoExportData" + Me.rdoExportData.Size = New System.Drawing.Size(107, 17) + Me.rdoExportData.TabIndex = 94 + Me.rdoExportData.TabStop = True + Me.rdoExportData.Text = "Export Data (csv)" + Me.rdoExportData.UseVisualStyleBackColor = True + ' + 'rdoNewDataFrame + ' + Me.rdoNewDataFrame.AutoSize = True + Me.rdoNewDataFrame.Location = New System.Drawing.Point(15, 252) + Me.rdoNewDataFrame.Name = "rdoNewDataFrame" + Me.rdoNewDataFrame.Size = New System.Drawing.Size(105, 17) + Me.rdoNewDataFrame.TabIndex = 93 + Me.rdoNewDataFrame.TabStop = True + Me.rdoNewDataFrame.Text = "New Data Frame" + Me.rdoNewDataFrame.UseVisualStyleBackColor = True + ' + 'grpSave + ' + Me.grpSave.Location = New System.Drawing.Point(8, 237) + Me.grpSave.Name = "grpSave" + Me.grpSave.Size = New System.Drawing.Size(165, 109) + Me.grpSave.TabIndex = 96 + Me.grpSave.TabStop = False + Me.grpSave.Text = "Save" + ' + 'rdoExportComments + ' + Me.rdoExportComments.AutoSize = True + Me.rdoExportComments.Location = New System.Drawing.Point(15, 306) + Me.rdoExportComments.Name = "rdoExportComments" + Me.rdoExportComments.Size = New System.Drawing.Size(107, 17) + Me.rdoExportComments.TabIndex = 97 + Me.rdoExportComments.TabStop = True + Me.rdoExportComments.Text = "Export Comments" + Me.rdoExportComments.UseVisualStyleBackColor = True + ' + 'ucrDataFrameSheets + ' + Me.ucrDataFrameSheets.AutoSize = True + Me.ucrDataFrameSheets.bDropUnusedFilterLevels = False + Me.ucrDataFrameSheets.bUseCurrentFilter = True + Me.ucrDataFrameSheets.Location = New System.Drawing.Point(11, 349) + Me.ucrDataFrameSheets.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameSheets.Name = "ucrDataFrameSheets" + Me.ucrDataFrameSheets.Size = New System.Drawing.Size(151, 50) + Me.ucrDataFrameSheets.TabIndex = 89 + ' + 'ucrPnlOutput + ' + Me.ucrPnlOutput.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlOutput.Location = New System.Drawing.Point(12, 251) + Me.ucrPnlOutput.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlOutput.Name = "ucrPnlOutput" + Me.ucrPnlOutput.Size = New System.Drawing.Size(151, 86) + Me.ucrPnlOutput.TabIndex = 95 + ' + 'ucrReceiverStationID + ' + Me.ucrReceiverStationID.AutoSize = True + Me.ucrReceiverStationID.frmParent = Me + Me.ucrReceiverStationID.Location = New System.Drawing.Point(276, 73) + 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 = 5 + Me.ucrReceiverStationID.ucrSelector = Nothing ' 'ucrInputExportFile ' @@ -111,62 +223,52 @@ Partial Class dlgExportToClimsoft Me.ucrInputExportFile.AutoSize = True Me.ucrInputExportFile.IsMultiline = False Me.ucrInputExportFile.IsReadOnly = False - Me.ucrInputExportFile.Location = New System.Drawing.Point(213, 560) - Me.ucrInputExportFile.Margin = New System.Windows.Forms.Padding(9, 12, 9, 12) + Me.ucrInputExportFile.Location = New System.Drawing.Point(142, 427) + Me.ucrInputExportFile.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) Me.ucrInputExportFile.Name = "ucrInputExportFile" - Me.ucrInputExportFile.Size = New System.Drawing.Size(273, 32) + Me.ucrInputExportFile.Size = New System.Drawing.Size(182, 21) Me.ucrInputExportFile.TabIndex = 16 ' 'ucrSaveNewDataFrame ' Me.ucrSaveNewDataFrame.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveNewDataFrame.Location = New System.Drawing.Point(14, 513) - Me.ucrSaveNewDataFrame.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrSaveNewDataFrame.Location = New System.Drawing.Point(9, 399) + Me.ucrSaveNewDataFrame.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrSaveNewDataFrame.Name = "ucrSaveNewDataFrame" - Me.ucrSaveNewDataFrame.Size = New System.Drawing.Size(522, 36) + Me.ucrSaveNewDataFrame.Size = New System.Drawing.Size(348, 24) Me.ucrSaveNewDataFrame.TabIndex = 14 ' - 'ucrChkNewDataFrame - ' - Me.ucrChkNewDataFrame.AutoSize = True - Me.ucrChkNewDataFrame.Checked = False - Me.ucrChkNewDataFrame.Location = New System.Drawing.Point(14, 416) - Me.ucrChkNewDataFrame.Margin = New System.Windows.Forms.Padding(9) - Me.ucrChkNewDataFrame.Name = "ucrChkNewDataFrame" - Me.ucrChkNewDataFrame.Size = New System.Drawing.Size(399, 34) - Me.ucrChkNewDataFrame.TabIndex = 12 - ' 'ucrInputHour ' Me.ucrInputHour.AddQuotesIfUnrecognised = True Me.ucrInputHour.AutoSize = True Me.ucrInputHour.IsMultiline = False Me.ucrInputHour.IsReadOnly = False - Me.ucrInputHour.Location = New System.Drawing.Point(417, 230) - Me.ucrInputHour.Margin = New System.Windows.Forms.Padding(14) + Me.ucrInputHour.Location = New System.Drawing.Point(278, 153) + Me.ucrInputHour.Margin = New System.Windows.Forms.Padding(9) Me.ucrInputHour.Name = "ucrInputHour" - Me.ucrInputHour.Size = New System.Drawing.Size(178, 32) + Me.ucrInputHour.Size = New System.Drawing.Size(119, 21) Me.ucrInputHour.TabIndex = 9 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 604) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(6, 8, 6, 8) + Me.ucrBase.Location = New System.Drawing.Point(7, 459) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(611, 77) + Me.ucrBase.Size = New System.Drawing.Size(408, 52) Me.ucrBase.TabIndex = 18 ' 'ucrReceiverElements ' Me.ucrReceiverElements.AutoSize = True Me.ucrReceiverElements.frmParent = Me - Me.ucrReceiverElements.Location = New System.Drawing.Point(417, 298) + Me.ucrReceiverElements.Location = New System.Drawing.Point(278, 199) Me.ucrReceiverElements.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverElements.Name = "ucrReceiverElements" Me.ucrReceiverElements.Selector = Nothing - Me.ucrReceiverElements.Size = New System.Drawing.Size(180, 150) + Me.ucrReceiverElements.Size = New System.Drawing.Size(120, 100) Me.ucrReceiverElements.strNcFilePath = "" Me.ucrReceiverElements.TabIndex = 11 Me.ucrReceiverElements.ucrSelector = Nothing @@ -175,11 +277,11 @@ Partial Class dlgExportToClimsoft ' Me.ucrReceiverDate.AutoSize = True Me.ucrReceiverDate.frmParent = Me - Me.ucrReceiverDate.Location = New System.Drawing.Point(417, 165) + Me.ucrReceiverDate.Location = New System.Drawing.Point(278, 110) Me.ucrReceiverDate.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDate.Name = "ucrReceiverDate" Me.ucrReceiverDate.Selector = Nothing - Me.ucrReceiverDate.Size = New System.Drawing.Size(180, 30) + Me.ucrReceiverDate.Size = New System.Drawing.Size(120, 20) Me.ucrReceiverDate.strNcFilePath = "" Me.ucrReceiverDate.TabIndex = 7 Me.ucrReceiverDate.ucrSelector = Nothing @@ -190,101 +292,41 @@ Partial Class dlgExportToClimsoft Me.ucrSelectorImportToClimsoft.bDropUnusedFilterLevels = False Me.ucrSelectorImportToClimsoft.bShowHiddenColumns = False Me.ucrSelectorImportToClimsoft.bUseCurrentFilter = True - Me.ucrSelectorImportToClimsoft.Location = New System.Drawing.Point(14, 78) + Me.ucrSelectorImportToClimsoft.Location = New System.Drawing.Point(9, 52) Me.ucrSelectorImportToClimsoft.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorImportToClimsoft.Name = "ucrSelectorImportToClimsoft" - Me.ucrSelectorImportToClimsoft.Size = New System.Drawing.Size(320, 274) + Me.ucrSelectorImportToClimsoft.Size = New System.Drawing.Size(213, 183) Me.ucrSelectorImportToClimsoft.TabIndex = 3 ' - 'rdoHourly - ' - Me.rdoHourly.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoHourly.BackColor = System.Drawing.SystemColors.Control - Me.rdoHourly.Enabled = False - Me.rdoHourly.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoHourly.FlatAppearance.BorderSize = 2 - Me.rdoHourly.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoHourly.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoHourly.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoHourly.Location = New System.Drawing.Point(285, 12) - Me.rdoHourly.Margin = New System.Windows.Forms.Padding(4) - Me.rdoHourly.Name = "rdoHourly" - Me.rdoHourly.Size = New System.Drawing.Size(136, 42) - Me.rdoHourly.TabIndex = 2 - Me.rdoHourly.TabStop = True - Me.rdoHourly.Tag = "Frequency" - Me.rdoHourly.Text = "Hourly" - Me.rdoHourly.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoHourly.UseVisualStyleBackColor = False - ' - 'rdoDaily - ' - Me.rdoDaily.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoDaily.BackColor = System.Drawing.SystemColors.Control - Me.rdoDaily.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoDaily.FlatAppearance.BorderSize = 2 - Me.rdoDaily.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoDaily.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoDaily.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoDaily.Location = New System.Drawing.Point(151, 12) - Me.rdoDaily.Margin = New System.Windows.Forms.Padding(4) - Me.rdoDaily.Name = "rdoDaily" - Me.rdoDaily.Size = New System.Drawing.Size(136, 42) - Me.rdoDaily.TabIndex = 1 - Me.rdoDaily.TabStop = True - Me.rdoDaily.Tag = "Frequency" - Me.rdoDaily.Text = "Daily" - Me.rdoDaily.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoDaily.UseVisualStyleBackColor = False - ' 'ucrPnlDailyHourly ' Me.ucrPnlDailyHourly.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDailyHourly.Location = New System.Drawing.Point(136, 12) - Me.ucrPnlDailyHourly.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrPnlDailyHourly.Location = New System.Drawing.Point(91, 8) + Me.ucrPnlDailyHourly.Margin = New System.Windows.Forms.Padding(4) Me.ucrPnlDailyHourly.Name = "ucrPnlDailyHourly" - Me.ucrPnlDailyHourly.Size = New System.Drawing.Size(310, 42) + Me.ucrPnlDailyHourly.Size = New System.Drawing.Size(207, 28) Me.ucrPnlDailyHourly.TabIndex = 0 ' - 'ucrReceiverStationID - ' - Me.ucrReceiverStationID.AutoSize = True - Me.ucrReceiverStationID.frmParent = Me - Me.ucrReceiverStationID.Location = New System.Drawing.Point(414, 110) - Me.ucrReceiverStationID.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverStationID.Name = "ucrReceiverStationID" - Me.ucrReceiverStationID.Selector = Nothing - Me.ucrReceiverStationID.Size = New System.Drawing.Size(180, 30) - Me.ucrReceiverStationID.strNcFilePath = "" - Me.ucrReceiverStationID.TabIndex = 5 - Me.ucrReceiverStationID.ucrSelector = Nothing - ' - 'lblStationID - ' - Me.lblStationID.AutoSize = True - Me.lblStationID.Location = New System.Drawing.Point(419, 84) - Me.lblStationID.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) - Me.lblStationID.Name = "lblStationID" - Me.lblStationID.Size = New System.Drawing.Size(85, 20) - Me.lblStationID.TabIndex = 4 - Me.lblStationID.Text = "Station ID:" - ' 'dlgExportToClimsoft ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) + 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(626, 690) + Me.ClientSize = New System.Drawing.Size(417, 467) + Me.Controls.Add(Me.rdoExportComments) + Me.Controls.Add(Me.rdoExportData) + Me.Controls.Add(Me.rdoNewDataFrame) + Me.Controls.Add(Me.ucrDataFrameSheets) + Me.Controls.Add(Me.ucrPnlOutput) + Me.Controls.Add(Me.grpSave) Me.Controls.Add(Me.lblStationID) Me.Controls.Add(Me.ucrReceiverStationID) Me.Controls.Add(Me.rdoDaily) Me.Controls.Add(Me.rdoHourly) - Me.Controls.Add(Me.ucrChkExportDataFrame) Me.Controls.Add(Me.lblExport) Me.Controls.Add(Me.cmdBrowse) Me.Controls.Add(Me.ucrInputExportFile) Me.Controls.Add(Me.ucrSaveNewDataFrame) - Me.Controls.Add(Me.ucrChkNewDataFrame) Me.Controls.Add(Me.lblHour) Me.Controls.Add(Me.ucrInputHour) Me.Controls.Add(Me.ucrBase) @@ -295,7 +337,6 @@ Partial Class dlgExportToClimsoft Me.Controls.Add(Me.ucrSelectorImportToClimsoft) Me.Controls.Add(Me.ucrPnlDailyHourly) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog - Me.Margin = New System.Windows.Forms.Padding(4) Me.Name = "dlgExportToClimsoft" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.Text = "Export For Climsoft" @@ -312,15 +353,19 @@ Partial Class dlgExportToClimsoft Friend WithEvents ucrBase As ucrButtons Friend WithEvents lblHour As Label Friend WithEvents ucrInputHour As ucrInputTextBox - Friend WithEvents ucrChkNewDataFrame As ucrCheck Friend WithEvents ucrSaveNewDataFrame As ucrSave Friend WithEvents lblExport As Label Friend WithEvents cmdBrowse As Button Friend WithEvents ucrInputExportFile As ucrInputTextBox - Friend WithEvents ucrChkExportDataFrame As ucrCheck Friend WithEvents rdoDaily As RadioButton Friend WithEvents rdoHourly As RadioButton Friend WithEvents ucrPnlDailyHourly As UcrPanel Friend WithEvents lblStationID As Label Friend WithEvents ucrReceiverStationID As ucrReceiverSingle + Friend WithEvents rdoExportData As RadioButton + Friend WithEvents rdoNewDataFrame As RadioButton + Friend WithEvents ucrDataFrameSheets As ucrDataFrame + Friend WithEvents ucrPnlOutput As UcrPanel + Friend WithEvents grpSave As GroupBox + Friend WithEvents rdoExportComments As RadioButton End Class diff --git a/instat/dlgExportToClimsoft.vb b/instat/dlgExportToClimsoft.vb index 887d4aa091..5db37c474e 100644 --- a/instat/dlgExportToClimsoft.vb +++ b/instat/dlgExportToClimsoft.vb @@ -20,7 +20,7 @@ Imports instat.Translations Public Class dlgExportToClimsoft Private bFirstLoad As Boolean = True Private bReset As Boolean = True - Private clsDataFrameFunction, clsCurrentNewColumnFunction, clsDummyFunction, clsMutateFunction, clsExportClimsoftFunction, clsPasteFunction, clsSprintfFunction, clsPosixctFunction As New RFunction + Private clsDataFrameFunction, clsGetDataFrameFunction, clsCurrentNewColumnFunction, clsDummyFunction, clsMutateFunction, clsExportClimsoftFunction, clsPasteFunction, clsSprintfFunction, clsPosixctFunction, clsExportCommentsFunction As New RFunction Private clsPipeOperator As New ROperator Private Sub dlgExportToClimsoft_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -44,6 +44,18 @@ Public Class dlgExportToClimsoft ucrReceiverStationID.SetLinkedDisplayControl(lblStationID) ucrReceiverStationID.Selector = ucrSelectorImportToClimsoft + ucrDataFrameSheets.SetParameter(New RParameter("x", 0)) + ucrDataFrameSheets.SetParameterIsRFunction() + + ucrPnlOutput.AddRadioButton(rdoNewDataFrame) + ucrPnlOutput.AddRadioButton(rdoExportData) + ucrPnlOutput.AddRadioButton(rdoExportComments) + ucrPnlOutput.AddParameterValuesCondition(rdoNewDataFrame, "check", "dataframe") + ucrPnlOutput.AddParameterValuesCondition(rdoExportData, "check", "export") + ucrPnlOutput.AddParameterValuesCondition(rdoExportComments, "check", "comments") + + ucrPnlOutput.AddToLinkedControls({ucrDataFrameSheets, ucrInputExportFile}, {rdoExportComments}, bNewLinkedHideIfParameterMissing:=True, bNewLinkedAddRemoveParameter:=True) + ucrReceiverDate.SetParameter(New RParameter("date", 2)) ucrReceiverDate.SetParameterIsRFunction() ucrReceiverDate.SetClimaticType("date") @@ -64,16 +76,6 @@ Public Class dlgExportToClimsoft ucrReceiverElements.SetLinkedDisplayControl(lblElement) ucrReceiverElements.Selector = ucrSelectorImportToClimsoft - ucrChkNewDataFrame.SetText("New Data Frame Name") - ucrChkNewDataFrame.AddToLinkedControls(ucrSaveNewDataFrame, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkNewDataFrame.AddParameterValuesCondition(True, "dataframe", "True") - ucrChkNewDataFrame.AddParameterValuesCondition(False, "dataframe", "False") - - ucrChkExportDataFrame.SetText(" Export Data Frame(s)") - ucrChkExportDataFrame.AddToLinkedControls(ucrInputExportFile, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) - ucrChkExportDataFrame.AddParameterValuesCondition(True, "export", "True") - ucrChkExportDataFrame.AddParameterValuesCondition(False, "export", "False") - ucrSaveNewDataFrame.SetSaveTypeAsDataFrame() ucrSaveNewDataFrame.SetIsTextBox() ucrSaveNewDataFrame.SetLabelText("Data Frame Name:") @@ -81,7 +83,6 @@ Public Class dlgExportToClimsoft ucrInputExportFile.SetParameter(New RParameter("file", 1)) ucrInputExportFile.IsReadOnly = True ucrInputExportFile.SetLinkedDisplayControl(lblExport) - End Sub Private Sub SetDefaults() @@ -92,6 +93,7 @@ Public Class dlgExportToClimsoft clsExportClimsoftFunction = New RFunction clsPasteFunction = New RFunction clsSprintfFunction = New RFunction + clsExportCommentsFunction = New RFunction clsPipeOperator = New ROperator ucrSelectorImportToClimsoft.Reset() @@ -101,6 +103,8 @@ Public Class dlgExportToClimsoft clsDummyFunction.AddParameter("dataframe", "True", iPosition:=0) clsDummyFunction.AddParameter("export", "False", iPosition:=1) clsDummyFunction.AddParameter("checked", "daily", iPosition:=2) + clsDummyFunction.AddParameter("value", "True", iPosition:=3) + clsDummyFunction.AddParameter("check", "dataframe", iPosition:=4) clsPosixctFunction.SetRCommand("as.POSIXct") clsPosixctFunction.AddParameter("x", clsRFunctionParameter:=clsPasteFunction, bIncludeArgumentName:=False, iPosition:=0) @@ -126,6 +130,13 @@ Public Class dlgExportToClimsoft clsSprintfFunction.SetRCommand("sprintf") clsSprintfFunction.AddParameter("hour", 6, iPosition:=1, bIncludeArgumentName:=False) + clsGetDataFrameFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_data_frame") + clsGetDataFrameFunction.SetAssignTo(ucrDataFrameSheets.cboAvailableDataFrames.Text) + + clsExportCommentsFunction.SetPackageName("rio") + clsExportCommentsFunction.SetRCommand("export") + clsExportCommentsFunction.AddParameter("x", clsRFunctionParameter:=clsGetDataFrameFunction, iPosition:=1) + ucrBase.clsRsyntax.ClearCodes() ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction, iPosition:=0) @@ -135,6 +146,8 @@ Public Class dlgExportToClimsoft End Sub Private Sub SetRCodeForControls(bReset As Boolean) + ucrInputExportFile.AddAdditionalCodeParameterPair(clsExportCommentsFunction, New RParameter("file", 0), iAdditionalPairNo:=1) + ucrReceiverDate.SetRCode(clsPasteFunction, bReset) ucrInputHour.SetRCode(clsSprintfFunction, bReset) ucrReceiverStationID.SetRCode(clsDataFrameFunction, bReset) @@ -142,23 +155,34 @@ Public Class dlgExportToClimsoft ucrInputExportFile.SetRCode(clsExportClimsoftFunction, bReset) ucrPnlDailyHourly.SetRCode(clsDummyFunction, bReset) If bReset Then - ucrChkExportDataFrame.SetRCode(clsDummyFunction, bReset) - ucrChkNewDataFrame.SetRCode(clsDummyFunction, bReset) + ucrPnlOutput.SetRCode(clsDummyFunction, bReset) End If End Sub Private Sub TestOkEnabled() - ucrBase.OKEnabled(Not ucrReceiverDate.IsEmpty _ - AndAlso Not ucrReceiverElements.IsEmpty _ - AndAlso Not ucrReceiverStationID.IsEmpty - ) - If ucrChkNewDataFrame.Checked And Not ucrSaveNewDataFrame.IsComplete Then - ucrBase.OKEnabled(False) - End If - If ucrChkExportDataFrame.Checked And ucrInputExportFile.IsEmpty Then - ucrBase.OKEnabled(False) - End If + If rdoNewDataFrame.Checked Then + If Not ucrReceiverDate.IsEmpty AndAlso Not ucrReceiverElements.IsEmpty AndAlso ucrSaveNewDataFrame.IsComplete Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + ElseIf rdoExportData.Checked Then + If Not ucrReceiverDate.IsEmpty AndAlso Not ucrReceiverElements.IsEmpty AndAlso Not ucrInputExportFile.IsEmpty Then + ucrBase.OKEnabled(True) + Else + ucrBase.OKEnabled(False) + End If + + Else + If ucrDataFrameSheets.cboAvailableDataFrames.Text <> "" AndAlso Not ucrInputExportFile.IsEmpty Then + ucrBase.OKEnabled(True) + + Else + ucrBase.OKEnabled(False) + + End If + End If End Sub Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset @@ -174,17 +198,12 @@ Public Class dlgExportToClimsoft End If ucrSaveNewDataFrame.SetPrefix(strDataframeName & "__climsoft") - End Sub Private Sub ucrSelectorImportToClimsoft_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorImportToClimsoft.ControlValueChanged DataFrameAssignTo() End Sub - Private Sub ucrChkNewDataFrame_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkNewDataFrame.ControlValueChanged, ucrChkExportDataFrame.ControlValueChanged - SettingBaseFunction() - End Sub - Private Sub ucrReceiverElements_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElements.ControlValueChanged ucrBase.clsRsyntax.GetBeforeCodes().Clear() clsCurrentNewColumnFunction = ucrReceiverElements.GetVariables(True).Clone @@ -193,30 +212,54 @@ Public Class dlgExportToClimsoft SettingBaseFunction() End Sub + Private Sub ucrDataFrameSheets_Load(sender As Object, e As EventArgs) Handles ucrDataFrameSheets.Load + If ucrDataFrameSheets.cboAvailableDataFrames.Items.Count > 0 Then + ' Check if the .comment dataframe exists + Dim bcommentExists As Boolean = False + For Each dataframe As String In ucrDataFrameSheets.cboAvailableDataFrames.Items + If dataframe = ".comment" Then + bcommentExists = True + Exit For + End If + Next + + ' Set .comment as the default selection if it exists + If bcommentExists Then + ucrDataFrameSheets.cboAvailableDataFrames.SelectedItem = ".comment" + End If + End If + End Sub + Private Sub cmdBrowse_Click(sender As Object, e As EventArgs) Handles cmdBrowse.Click SelectFileToSave() End Sub Private Sub SettingBaseFunction() + cmdBrowse.Visible = False - If ucrChkNewDataFrame.Checked And ucrChkExportDataFrame.Checked Then - ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) - ucrBase.clsRsyntax.ClearCodes() - ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction) - ucrBase.clsRsyntax.AddToAfterCodes(clsExportClimsoftFunction) - cmdBrowse.Visible = True - ElseIf ucrChkNewDataFrame.Checked AndAlso Not ucrChkExportDataFrame.Checked Then + If rdoNewDataFrame.Checked Then ucrBase.clsRsyntax.SetBaseROperator(clsPipeOperator) ucrBase.clsRsyntax.GetAfterCodes().Clear() cmdBrowse.Visible = False + ucrInputExportFile.Visible = False + ucrSaveNewDataFrame.Visible = True - ElseIf ucrChkExportDataFrame.Checked AndAlso Not ucrChkNewDataFrame.Checked Then - ucrBase.clsRsyntax.GetBeforeCodes().Clear() + ElseIf rdoExportData.Checked Then + ucrBase.clsRsyntax.GetAfterCodes().Clear() ucrBase.clsRsyntax.AddToBeforeCodes(clsCurrentNewColumnFunction) ucrBase.clsRsyntax.SetBaseRFunction(clsExportClimsoftFunction) ucrBase.clsRsyntax.GetAfterCodes().Clear() cmdBrowse.Visible = True + ucrInputExportFile.Visible = True + ucrSaveNewDataFrame.Visible = False + Else + ucrBase.clsRsyntax.ClearCodes() + ucrBase.clsRsyntax.SetBaseRFunction(clsExportCommentsFunction) + cmdBrowse.Visible = True + ucrInputExportFile.Visible = True + ucrSaveNewDataFrame.Visible = False End If + End Sub Private Sub SelectFileToSave() @@ -237,7 +280,7 @@ Public Class dlgExportToClimsoft Private Sub ucrReceiverElements_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverElements.ControlContentsChanged, ucrReceiverDate.ControlContentsChanged, ucrSaveNewDataFrame.ControlContentsChanged, - ucrReceiverStationID.ControlContentsChanged, ucrInputExportFile.ControlContentsChanged, ucrChkExportDataFrame.ControlContentsChanged + ucrReceiverStationID.ControlContentsChanged, ucrInputExportFile.ControlContentsChanged, ucrDataFrameSheets.ControlContentsChanged TestOkEnabled() End Sub @@ -248,6 +291,14 @@ Public Class dlgExportToClimsoft SettingBaseFunction() End Sub + Private Sub ucrDataFrameSheets_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrDataFrameSheets.ControlValueChanged + SettingBaseFunction() + + clsGetDataFrameFunction.AddParameter("data_name", Chr(34) & ucrDataFrameSheets.cboAvailableDataFrames.Text & Chr(34), iPosition:=0) + clsGetDataFrameFunction.SetAssignTo(ucrDataFrameSheets.cboAvailableDataFrames.Text) + + End Sub + Private Sub ucrInputHour_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrInputHour.ControlValueChanged If Not ucrInputHour.IsEmpty Then clsSprintfFunction.AddParameter("fmt", Chr(34) & "%02d:00:00" & Chr(34), iPosition:=0) @@ -267,4 +318,10 @@ Public Class dlgExportToClimsoft clsPasteFunction.RemoveParameterByName("date_time") End If End Sub + + Private Sub ucrPnlOutput_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlOutput.ControlValueChanged + SettingBaseFunction() + TestOkEnabled() + End Sub + End Class \ No newline at end of file