diff --git a/inno_install_script_64bit.iss b/inno_install_script_64bit.iss index c2354f865aa..8499603c092 100644 --- a/inno_install_script_64bit.iss +++ b/inno_install_script_64bit.iss @@ -7,8 +7,8 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppVersion= {#GetStringFileInfo("instat\bin\x64\Release\instat.exe", "FileVersion")} AppId={{5455FC1A-85BE-4679-B600-8A1A4FC3CDD9-{#SetupSetting("AppVersion")}} -AppName=R-Instat -AppVerName ={code:GetShortAppVersion|{#SetupSetting("AppVersion")}} +AppName=R-Instat {#SetupSetting("AppVersion")} +AppVerName =R-Instat {#SetupSetting("AppVersion")} AppPublisher=African Maths Initiative AppPublisherURL=http://r-instat.org/ diff --git a/instat/Model/DataFrame/clsDataFramePage.vb b/instat/Model/DataFrame/clsDataFramePage.vb index 062e2216a90..01310710542 100644 --- a/instat/Model/DataFrame/clsDataFramePage.vb +++ b/instat/Model/DataFrame/clsDataFramePage.vb @@ -236,7 +236,7 @@ Public Class clsDataFramePage Dim strDisable As String = If(bDisable, "TRUE", "FALSE") clsEnableDisableUndoRFunction.AddParameter("disable_undo", strDisable) - _clsRLink.RunScript(clsEnableDisableUndoRFunction.ToScript) + _clsRLink.RunScript(clsEnableDisableUndoRFunction.ToScript, bSkipScriptAndOutput:=True) End Sub diff --git a/instat/Model/RCommand/clsPrepareFunctionsForGrids.vb b/instat/Model/RCommand/clsPrepareFunctionsForGrids.vb index a55ccc8b2aa..61c4d09ca69 100644 --- a/instat/Model/RCommand/clsPrepareFunctionsForGrids.vb +++ b/instat/Model/RCommand/clsPrepareFunctionsForGrids.vb @@ -184,7 +184,7 @@ Public Class clsPrepareFunctionsForGrids clsViewDataFrame.AddParameter("x", clsRFunctionParameter:=clsGetDataFrame) clsGetDataFrame.SetAssignTo(_strDataFrame) strTemp = clsViewDataFrame.ToScript(strScript) - _RLink.RunScript(strScript & strTemp, strComment:="Right click menu: View R Data Frame", bSeparateThread:=False) + _RLink.RunScript(strScript & strTemp, strComment:="Toolbar Option: View R Data Frame", bSeparateThread:=False) End Sub ''' ''' insert new rows diff --git a/instat/clsRLink.vb b/instat/clsRLink.vb index e1d6f7b28a5..ba19e66b60b 100644 --- a/instat/clsRLink.vb +++ b/instat/clsRLink.vb @@ -926,7 +926,8 @@ Public Class RLink Optional bSeparateThread As Boolean = True, Optional bShowWaitDialogOverride As Nullable(Of Boolean) = Nothing, Optional bUpdateGrids As Boolean = True, - Optional bSilent As Boolean = False) + Optional bSilent As Boolean = False, + Optional bSkipScriptAndOutput As Boolean = False) 'if there is no script to run then just ignore and exit sub If String.IsNullOrWhiteSpace(strScript) Then @@ -999,8 +1000,10 @@ Public Class RLink End If End If - ' If strOutput is empty or does not contain valid HTML files, add strOutput itself as an output - clsOutputLogger.AddOutput(strScriptWithComment, strOutput, bAsFile, bDisplayOutputInExternalViewer) + If Not bSkipScriptAndOutput Then + ' If strOutput is empty or does not contain valid HTML files, add strOutput itself as an output + clsOutputLogger.AddOutput(strScriptWithComment, strOutput, bAsFile, bDisplayOutputInExternalViewer) + End If Catch e As Exception diff --git a/instat/dlgName.vb b/instat/dlgName.vb index 0be8141d4ab..aa20aad2e66 100644 --- a/instat/dlgName.vb +++ b/instat/dlgName.vb @@ -34,6 +34,7 @@ Public Class dlgName Private clsStartwithFunction, clsRegexFunction, clsEndswithFunction, clsMatchesFunction, clsContainsFunction As New RFunction Private WithEvents grdCurrentWorkSheet As Worksheet Private dctRowsNewNameChanged As New Dictionary(Of Integer, String) + Private dctRowsCurrentName As New Dictionary(Of Integer, String) Private dctRowsNewLabelChanged As New Dictionary(Of Integer, String) Private dctNameRowsValues As New Dictionary(Of Integer, String) Private dctCaseOptions As New Dictionary(Of String, String) @@ -99,7 +100,7 @@ Public Class dlgName ucrPnlCase.AddRadioButton(rdoAbbreviate, "abbreviate") ucrPnlCase.AddRadioButton(rdoReplace, "stringr::str_replace") - ucrPnlSelectData.SetParameter(New RParameter("data", 0)) + ucrPnlSelectData.AddRadioButton(rdoWholeDataFrame) ucrPnlSelectData.AddRadioButton(rdoSelectedColumn) ucrPnlSelectData.AddParameterValuesCondition(rdoWholeDataFrame, "checked", "whole") @@ -189,6 +190,7 @@ Public Class dlgName ucrSelectVariables.Reset() dctRowsNewNameChanged.Clear() dctRowsNewLabelChanged.Clear() + dctRowsCurrentName.Clear() bCurrentCell = False clsNewColNameDataframeFunction.SetRCommand("data.frame") @@ -353,10 +355,14 @@ Public Class dlgName If e.Range.Rows > 1 Then For iRow As Integer = iStartRowIndex To grdCurrentWorkSheet.SelectionRange.EndRow Dim strNewData As String = ValidateRVariable(grdCurrentWorkSheet.GetCellData(row:=iRow, col:=iColIndex), iColIndex) + Dim strOldData As String = grdCurrentWorkSheet.GetCellData(row:=iRow, col:=0) + GetOldNames(iRow, strOldData) RenameColumns(strNewData, iRow, iColIndex) Next Else Dim strNewData As String = ValidateRVariable(grdCurrentWorkSheet.GetCellData(row:=e.Range.Row, col:=iColIndex), iColIndex) + Dim strOldData As String = grdCurrentWorkSheet.GetCellData(row:=e.Range.Row, col:=0) + GetOldNames(e.Range.Row, strOldData) RenameColumns(strNewData, iStartRowIndex, iColIndex) End If ValidateNamesFromDictionary(iColIndex) @@ -406,10 +412,22 @@ Public Class dlgName Private Sub grdCurrSheet_AfterCellEdit(sender As Object, e As CellAfterEditEventArgs) Handles grdCurrentWorkSheet.AfterCellEdit Dim iCol As Integer = e.Cell.Column Dim strNewData As String = ValidateRVariable(e.NewData, iCol) + + Dim strFirstColumnData As String = grdCurrentWorkSheet(e.Cell.Row, 0).ToString() + + GetOldNames(e.Cell.Row, strFirstColumnData) RenameColumns(strNewData, e.Cell.Row, iCol) ValidateNamesFromDictionary(iCol) End Sub + Private Sub GetOldNames(iRow As Integer, strOldName As String) + If Not dctRowsCurrentName.ContainsKey(iRow) Then + dctRowsCurrentName.Add(iRow, strOldName) + Else + dctRowsCurrentName(iRow) = strOldName + End If + End Sub + Private Sub GetVariables(strNewData As String, iRowIndex As Integer, iColIndex As Integer) If rdoMultiple.Checked Then If iColIndex = 1 Then @@ -417,7 +435,7 @@ Public Class dlgName AddChangedNewNameRows(iRowIndex, strNewData) clsNewColNameDataframeFunction.AddParameter("cols", GetValuesAsVector(dctRowsNewNameChanged), iPosition:=0) - clsNewColNameDataframeFunction.AddParameter("index", "c(" & String.Join(",", dctRowsNewNameChanged.Keys.ToArray) & ")", iPosition:=1) + clsNewColNameDataframeFunction.AddParameter("old_names", GetValuesAsVector(dctRowsCurrentName), iPosition:=1) clsDefaultRFunction.AddParameter("new_column_names_df", clsRFunctionParameter:=clsNewColNameDataframeFunction, iPosition:=8) Else clsNewColNameDataframeFunction.RemoveParameterByName("cols") @@ -602,7 +620,9 @@ Public Class dlgName rdoReplace.Visible = rdoWholeDataFrame.Checked If rdoWholeDataFrame.Checked Then ucrReceiverColumns.Visible = False + clsDummyFunction.AddParameter("checked", "whole", iPosition:=1) Else + clsDummyFunction.AddParameter("checked", "selected", iPosition:=1) ucrReceiverColumns.SetMeAsReceiver() If rdoReplace.Checked Then rdoMakeCleanNames.Checked = True @@ -681,6 +701,8 @@ Public Class dlgName Dim parsedValue As Boolean Dim strNewData As String = ValidateRVariable(e.Text, iCol) If Not strNewData.ToLower.Equals("t") AndAlso Not strNewData.ToLower.Equals("f") AndAlso Not IsNumeric(strNewData) AndAlso Not Boolean.TryParse(strNewData, parsedValue) Then + Dim strFirstColumnData As String = grdCurrentWorkSheet(e.Cell.Row, 0).ToString() + GetOldNames(e.Cell.Row, strFirstColumnData) RenameColumns(strNewData, e.Cell.Row, iCol) ValidateNamesFromDictionary(iCol) End If @@ -713,6 +735,7 @@ Public Class dlgName clsDefaultRFunction.AddParameter(".cols", clsRFunctionParameter:=clsContainsFunction, iPosition:=3) clsDefaultRFunction.AddParameter(".fn", "stringr::str_replace_all", iPosition:=2) End Select + Else clsDefaultRFunction.RemoveParameterByName("replacement") clsDefaultRFunction.RemoveParameterByName(".cols") diff --git a/instat/dlgPICSACrops.Designer.vb b/instat/dlgPICSACrops.Designer.vb index e787f1db1b8..d7db6283afc 100644 --- a/instat/dlgPICSACrops.Designer.vb +++ b/instat/dlgPICSACrops.Designer.vb @@ -49,6 +49,7 @@ Partial Class dlgPICSACrops Me.ucrReceiverStart = New instat.ucrReceiverSingle() Me.ucrReceiverEnd = New instat.ucrReceiverSingle() Me.grpCropDefinitions = New System.Windows.Forms.GroupBox() + Me.lblStarts = New System.Windows.Forms.Label() Me.ucrInputCropLengths = New instat.ucrInputComboBox() Me.ucrInputWaterAmounts = New instat.ucrInputComboBox() Me.ucrInputPlantingDates = New instat.ucrInputComboBox() @@ -60,14 +61,13 @@ Partial Class dlgPICSACrops Me.lblWaterAmounts = New System.Windows.Forms.Label() Me.ucrPnlStartCheck = New instat.UcrPanel() Me.ucrChkDataProp = New instat.ucrCheck() - Me.ucrChkPrintDataProp = New instat.ucrCheck() + Me.ucrChkDataCrops = New instat.ucrCheck() Me.ucrReceiverRainfall = New instat.ucrReceiverSingle() Me.ucrReceiverDay = New instat.ucrReceiverSingle() Me.ucrReceiverYear = New instat.ucrReceiverSingle() Me.ucrReceiverStation = New instat.ucrReceiverSingle() Me.ucrSelectorForCrops = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.lblStarts = New System.Windows.Forms.Label() Me.grpSeasonReceivers.SuspendLayout() Me.grpCropDefinitions.SuspendLayout() Me.SuspendLayout() @@ -75,9 +75,10 @@ Partial Class dlgPICSACrops 'lblSelectedSet ' Me.lblSelectedSet.AutoSize = True - Me.lblSelectedSet.Location = New System.Drawing.Point(232, 21) + Me.lblSelectedSet.Location = New System.Drawing.Point(348, 32) + Me.lblSelectedSet.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblSelectedSet.Name = "lblSelectedSet" - Me.lblSelectedSet.Size = New System.Drawing.Size(43, 13) + Me.lblSelectedSet.Size = New System.Drawing.Size(64, 20) Me.lblSelectedSet.TabIndex = 15 Me.lblSelectedSet.Tag = "" Me.lblSelectedSet.Text = "Station:" @@ -85,9 +86,10 @@ Partial Class dlgPICSACrops 'Label2 ' Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(365, 21) + Me.Label2.Location = New System.Drawing.Point(548, 32) + Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(32, 13) + Me.Label2.Size = New System.Drawing.Size(47, 20) Me.Label2.TabIndex = 21 Me.Label2.Tag = "" Me.Label2.Text = "Year:" @@ -95,9 +97,10 @@ Partial Class dlgPICSACrops 'Label3 ' Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(365, 66) + Me.Label3.Location = New System.Drawing.Point(548, 99) + Me.Label3.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(65, 13) + Me.Label3.Size = New System.Drawing.Size(95, 20) Me.Label3.TabIndex = 22 Me.Label3.Tag = "" Me.Label3.Text = "Day in Year:" @@ -105,9 +108,10 @@ Partial Class dlgPICSACrops 'lblRain ' Me.lblRain.AutoSize = True - Me.lblRain.Location = New System.Drawing.Point(232, 66) + Me.lblRain.Location = New System.Drawing.Point(348, 99) + Me.lblRain.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblRain.Name = "lblRain" - Me.lblRain.Size = New System.Drawing.Size(32, 13) + Me.lblRain.Size = New System.Drawing.Size(46, 20) Me.lblRain.TabIndex = 23 Me.lblRain.Tag = "" Me.lblRain.Text = "Rain:" @@ -115,9 +119,10 @@ Partial Class dlgPICSACrops 'Label5 ' Me.Label5.AutoSize = True - Me.Label5.Location = New System.Drawing.Point(6, 17) + Me.Label5.Location = New System.Drawing.Point(9, 26) + Me.Label5.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label5.Name = "Label5" - Me.Label5.Size = New System.Drawing.Size(32, 13) + Me.Label5.Size = New System.Drawing.Size(48, 20) Me.Label5.TabIndex = 24 Me.Label5.Tag = "" Me.Label5.Text = "Start:" @@ -125,9 +130,10 @@ Partial Class dlgPICSACrops 'Label6 ' Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(139, 19) + Me.Label6.Location = New System.Drawing.Point(208, 28) + Me.Label6.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(32, 13) + Me.Label6.Size = New System.Drawing.Size(46, 20) Me.Label6.TabIndex = 25 Me.Label6.Tag = "" Me.Label6.Text = "End :" @@ -135,9 +141,10 @@ Partial Class dlgPICSACrops 'cmdOptions ' Me.cmdOptions.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdOptions.Location = New System.Drawing.Point(368, 358) + Me.cmdOptions.Location = New System.Drawing.Point(552, 537) + Me.cmdOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.cmdOptions.Name = "cmdOptions" - Me.cmdOptions.Size = New System.Drawing.Size(120, 25) + Me.cmdOptions.Size = New System.Drawing.Size(180, 38) Me.cmdOptions.TabIndex = 31 Me.cmdOptions.Tag = "Options" Me.cmdOptions.Text = "Options" @@ -149,9 +156,11 @@ Partial Class dlgPICSACrops Me.grpSeasonReceivers.Controls.Add(Me.ucrReceiverStart) Me.grpSeasonReceivers.Controls.Add(Me.Label6) Me.grpSeasonReceivers.Controls.Add(Me.ucrReceiverEnd) - Me.grpSeasonReceivers.Location = New System.Drawing.Point(226, 111) + Me.grpSeasonReceivers.Location = New System.Drawing.Point(339, 166) + Me.grpSeasonReceivers.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpSeasonReceivers.Name = "grpSeasonReceivers" - Me.grpSeasonReceivers.Size = New System.Drawing.Size(272, 66) + Me.grpSeasonReceivers.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpSeasonReceivers.Size = New System.Drawing.Size(408, 99) Me.grpSeasonReceivers.TabIndex = 38 Me.grpSeasonReceivers.TabStop = False Me.grpSeasonReceivers.Text = "Season Dates" @@ -160,11 +169,11 @@ Partial Class dlgPICSACrops ' Me.ucrReceiverStart.AutoSize = True Me.ucrReceiverStart.frmParent = Me - Me.ucrReceiverStart.Location = New System.Drawing.Point(10, 34) + Me.ucrReceiverStart.Location = New System.Drawing.Point(15, 51) Me.ucrReceiverStart.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverStart.Name = "ucrReceiverStart" Me.ucrReceiverStart.Selector = Nothing - Me.ucrReceiverStart.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStart.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverStart.strNcFilePath = "" Me.ucrReceiverStart.TabIndex = 19 Me.ucrReceiverStart.ucrSelector = Nothing @@ -173,11 +182,11 @@ Partial Class dlgPICSACrops ' Me.ucrReceiverEnd.AutoSize = True Me.ucrReceiverEnd.frmParent = Me - Me.ucrReceiverEnd.Location = New System.Drawing.Point(142, 34) + Me.ucrReceiverEnd.Location = New System.Drawing.Point(213, 51) Me.ucrReceiverEnd.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverEnd.Name = "ucrReceiverEnd" Me.ucrReceiverEnd.Selector = Nothing - Me.ucrReceiverEnd.Size = New System.Drawing.Size(120, 22) + Me.ucrReceiverEnd.Size = New System.Drawing.Size(180, 33) Me.ucrReceiverEnd.strNcFilePath = "" Me.ucrReceiverEnd.TabIndex = 26 Me.ucrReceiverEnd.ucrSelector = Nothing @@ -195,23 +204,35 @@ Partial Class dlgPICSACrops Me.grpCropDefinitions.Controls.Add(Me.lblCropLengthDays) Me.grpCropDefinitions.Controls.Add(Me.lblWaterAmounts) Me.grpCropDefinitions.Controls.Add(Me.ucrPnlStartCheck) - Me.grpCropDefinitions.Location = New System.Drawing.Point(6, 194) + Me.grpCropDefinitions.Location = New System.Drawing.Point(9, 291) + Me.grpCropDefinitions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpCropDefinitions.Name = "grpCropDefinitions" - Me.grpCropDefinitions.Size = New System.Drawing.Size(292, 158) + Me.grpCropDefinitions.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpCropDefinitions.Size = New System.Drawing.Size(438, 237) Me.grpCropDefinitions.TabIndex = 39 Me.grpCropDefinitions.TabStop = False Me.grpCropDefinitions.Text = "Crop Definitions" ' + 'lblStarts + ' + Me.lblStarts.AutoSize = True + Me.lblStarts.Location = New System.Drawing.Point(9, 40) + Me.lblStarts.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblStarts.Name = "lblStarts" + Me.lblStarts.Size = New System.Drawing.Size(104, 20) + Me.lblStarts.TabIndex = 56 + Me.lblStarts.Text = "Include Start:" + ' 'ucrInputCropLengths ' Me.ucrInputCropLengths.AddQuotesIfUnrecognised = True Me.ucrInputCropLengths.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputCropLengths.GetSetSelectedIndex = -1 Me.ucrInputCropLengths.IsReadOnly = False - Me.ucrInputCropLengths.Location = New System.Drawing.Point(106, 129) - Me.ucrInputCropLengths.Margin = New System.Windows.Forms.Padding(6) + Me.ucrInputCropLengths.Location = New System.Drawing.Point(159, 194) + Me.ucrInputCropLengths.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrInputCropLengths.Name = "ucrInputCropLengths" - Me.ucrInputCropLengths.Size = New System.Drawing.Size(170, 21) + Me.ucrInputCropLengths.Size = New System.Drawing.Size(255, 32) Me.ucrInputCropLengths.TabIndex = 55 ' 'ucrInputWaterAmounts @@ -220,10 +241,10 @@ Partial Class dlgPICSACrops Me.ucrInputWaterAmounts.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputWaterAmounts.GetSetSelectedIndex = -1 Me.ucrInputWaterAmounts.IsReadOnly = False - Me.ucrInputWaterAmounts.Location = New System.Drawing.Point(107, 92) - Me.ucrInputWaterAmounts.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputWaterAmounts.Location = New System.Drawing.Point(160, 138) + Me.ucrInputWaterAmounts.Margin = New System.Windows.Forms.Padding(14, 14, 14, 14) Me.ucrInputWaterAmounts.Name = "ucrInputWaterAmounts" - Me.ucrInputWaterAmounts.Size = New System.Drawing.Size(169, 21) + Me.ucrInputWaterAmounts.Size = New System.Drawing.Size(254, 32) Me.ucrInputWaterAmounts.TabIndex = 40 ' 'ucrInputPlantingDates @@ -232,19 +253,18 @@ Partial Class dlgPICSACrops Me.ucrInputPlantingDates.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrInputPlantingDates.GetSetSelectedIndex = -1 Me.ucrInputPlantingDates.IsReadOnly = False - Me.ucrInputPlantingDates.Location = New System.Drawing.Point(107, 58) - Me.ucrInputPlantingDates.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputPlantingDates.Location = New System.Drawing.Point(160, 87) + Me.ucrInputPlantingDates.Margin = New System.Windows.Forms.Padding(14, 14, 14, 14) Me.ucrInputPlantingDates.Name = "ucrInputPlantingDates" - Me.ucrInputPlantingDates.Size = New System.Drawing.Size(169, 21) + Me.ucrInputPlantingDates.Size = New System.Drawing.Size(254, 32) Me.ucrInputPlantingDates.TabIndex = 53 ' 'rdoBoth ' Me.rdoBoth.AutoSize = True - Me.rdoBoth.Location = New System.Drawing.Point(225, 25) - Me.rdoBoth.Margin = New System.Windows.Forms.Padding(2) + Me.rdoBoth.Location = New System.Drawing.Point(338, 38) Me.rdoBoth.Name = "rdoBoth" - Me.rdoBoth.Size = New System.Drawing.Size(47, 17) + Me.rdoBoth.Size = New System.Drawing.Size(68, 24) Me.rdoBoth.TabIndex = 44 Me.rdoBoth.TabStop = True Me.rdoBoth.Text = "Both" @@ -253,10 +273,9 @@ Partial Class dlgPICSACrops 'rdoNo ' Me.rdoNo.AutoSize = True - Me.rdoNo.Location = New System.Drawing.Point(153, 25) - Me.rdoNo.Margin = New System.Windows.Forms.Padding(2) + Me.rdoNo.Location = New System.Drawing.Point(230, 38) Me.rdoNo.Name = "rdoNo" - Me.rdoNo.Size = New System.Drawing.Size(39, 17) + Me.rdoNo.Size = New System.Drawing.Size(54, 24) Me.rdoNo.TabIndex = 45 Me.rdoNo.TabStop = True Me.rdoNo.Text = "No" @@ -265,10 +284,9 @@ Partial Class dlgPICSACrops 'rdoYes ' Me.rdoYes.AutoSize = True - Me.rdoYes.Location = New System.Drawing.Point(81, 25) - Me.rdoYes.Margin = New System.Windows.Forms.Padding(2) + Me.rdoYes.Location = New System.Drawing.Point(122, 38) Me.rdoYes.Name = "rdoYes" - Me.rdoYes.Size = New System.Drawing.Size(43, 17) + Me.rdoYes.Size = New System.Drawing.Size(62, 24) Me.rdoYes.TabIndex = 43 Me.rdoYes.TabStop = True Me.rdoYes.Text = "Yes" @@ -277,68 +295,71 @@ Partial Class dlgPICSACrops 'lblPlantingDays ' Me.lblPlantingDays.AutoSize = True - Me.lblPlantingDays.Location = New System.Drawing.Point(3, 60) + Me.lblPlantingDays.Location = New System.Drawing.Point(4, 90) + Me.lblPlantingDays.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblPlantingDays.Name = "lblPlantingDays" - Me.lblPlantingDays.Size = New System.Drawing.Size(81, 13) + Me.lblPlantingDays.Size = New System.Drawing.Size(120, 20) Me.lblPlantingDays.TabIndex = 42 Me.lblPlantingDays.Text = "Planting Day(s):" ' 'lblCropLengthDays ' Me.lblCropLengthDays.AutoSize = True - Me.lblCropLengthDays.Location = New System.Drawing.Point(5, 133) + Me.lblCropLengthDays.Location = New System.Drawing.Point(8, 200) + Me.lblCropLengthDays.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblCropLengthDays.Name = "lblCropLengthDays" - Me.lblCropLengthDays.Size = New System.Drawing.Size(101, 13) + Me.lblCropLengthDays.Size = New System.Drawing.Size(151, 20) Me.lblCropLengthDays.TabIndex = 41 Me.lblCropLengthDays.Text = "Crop Length Day(s):" ' 'lblWaterAmounts ' Me.lblWaterAmounts.AutoSize = True - Me.lblWaterAmounts.Location = New System.Drawing.Point(5, 95) + Me.lblWaterAmounts.Location = New System.Drawing.Point(8, 142) + Me.lblWaterAmounts.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblWaterAmounts.Name = "lblWaterAmounts" - Me.lblWaterAmounts.Size = New System.Drawing.Size(89, 13) + Me.lblWaterAmounts.Size = New System.Drawing.Size(134, 20) Me.lblWaterAmounts.TabIndex = 40 Me.lblWaterAmounts.Text = "Water Amount(s):" ' 'ucrPnlStartCheck ' Me.ucrPnlStartCheck.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlStartCheck.Location = New System.Drawing.Point(75, 14) - Me.ucrPnlStartCheck.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlStartCheck.Location = New System.Drawing.Point(112, 21) + Me.ucrPnlStartCheck.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrPnlStartCheck.Name = "ucrPnlStartCheck" - Me.ucrPnlStartCheck.Size = New System.Drawing.Size(201, 37) + Me.ucrPnlStartCheck.Size = New System.Drawing.Size(302, 56) Me.ucrPnlStartCheck.TabIndex = 46 ' 'ucrChkDataProp ' Me.ucrChkDataProp.AutoSize = True Me.ucrChkDataProp.Checked = False - Me.ucrChkDataProp.Location = New System.Drawing.Point(10, 358) - Me.ucrChkDataProp.Margin = New System.Windows.Forms.Padding(6) + Me.ucrChkDataProp.Location = New System.Drawing.Point(281, 539) + Me.ucrChkDataProp.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) Me.ucrChkDataProp.Name = "ucrChkDataProp" - Me.ucrChkDataProp.Size = New System.Drawing.Size(172, 23) + Me.ucrChkDataProp.Size = New System.Drawing.Size(258, 34) Me.ucrChkDataProp.TabIndex = 37 ' - 'ucrChkPrintDataProp + 'ucrChkDataCrops ' - Me.ucrChkPrintDataProp.AutoSize = True - Me.ucrChkPrintDataProp.Checked = False - Me.ucrChkPrintDataProp.Location = New System.Drawing.Point(188, 358) - Me.ucrChkPrintDataProp.Margin = New System.Windows.Forms.Padding(6) - Me.ucrChkPrintDataProp.Name = "ucrChkPrintDataProp" - Me.ucrChkPrintDataProp.Size = New System.Drawing.Size(255, 23) - Me.ucrChkPrintDataProp.TabIndex = 36 + Me.ucrChkDataCrops.AutoSize = True + Me.ucrChkDataCrops.Checked = False + Me.ucrChkDataCrops.Location = New System.Drawing.Point(9, 539) + Me.ucrChkDataCrops.Margin = New System.Windows.Forms.Padding(9, 9, 9, 9) + Me.ucrChkDataCrops.Name = "ucrChkDataCrops" + Me.ucrChkDataCrops.Size = New System.Drawing.Size(382, 34) + Me.ucrChkDataCrops.TabIndex = 36 ' 'ucrReceiverRainfall ' Me.ucrReceiverRainfall.AutoSize = True Me.ucrReceiverRainfall.frmParent = Me - Me.ucrReceiverRainfall.Location = New System.Drawing.Point(236, 81) + Me.ucrReceiverRainfall.Location = New System.Drawing.Point(354, 122) Me.ucrReceiverRainfall.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverRainfall.Name = "ucrReceiverRainfall" Me.ucrReceiverRainfall.Selector = Nothing - Me.ucrReceiverRainfall.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverRainfall.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverRainfall.strNcFilePath = "" Me.ucrReceiverRainfall.TabIndex = 17 Me.ucrReceiverRainfall.ucrSelector = Nothing @@ -347,11 +368,11 @@ Partial Class dlgPICSACrops ' Me.ucrReceiverDay.AutoSize = True Me.ucrReceiverDay.frmParent = Me - Me.ucrReceiverDay.Location = New System.Drawing.Point(368, 81) + Me.ucrReceiverDay.Location = New System.Drawing.Point(552, 122) Me.ucrReceiverDay.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverDay.Name = "ucrReceiverDay" Me.ucrReceiverDay.Selector = Nothing - Me.ucrReceiverDay.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverDay.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverDay.strNcFilePath = "" Me.ucrReceiverDay.TabIndex = 16 Me.ucrReceiverDay.ucrSelector = Nothing @@ -360,11 +381,11 @@ Partial Class dlgPICSACrops ' Me.ucrReceiverYear.AutoSize = True Me.ucrReceiverYear.frmParent = Me - Me.ucrReceiverYear.Location = New System.Drawing.Point(368, 37) + Me.ucrReceiverYear.Location = New System.Drawing.Point(552, 56) Me.ucrReceiverYear.Margin = New System.Windows.Forms.Padding(0) Me.ucrReceiverYear.Name = "ucrReceiverYear" Me.ucrReceiverYear.Selector = Nothing - Me.ucrReceiverYear.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverYear.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverYear.strNcFilePath = "" Me.ucrReceiverYear.TabIndex = 3 Me.ucrReceiverYear.ucrSelector = Nothing @@ -373,11 +394,11 @@ Partial Class dlgPICSACrops ' Me.ucrReceiverStation.AutoSize = True Me.ucrReceiverStation.frmParent = Me - Me.ucrReceiverStation.Location = New System.Drawing.Point(236, 37) + Me.ucrReceiverStation.Location = New System.Drawing.Point(354, 56) 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.Size = New System.Drawing.Size(180, 30) Me.ucrReceiverStation.strNcFilePath = "" Me.ucrReceiverStation.TabIndex = 2 Me.ucrReceiverStation.ucrSelector = Nothing @@ -388,41 +409,32 @@ Partial Class dlgPICSACrops Me.ucrSelectorForCrops.bDropUnusedFilterLevels = False Me.ucrSelectorForCrops.bShowHiddenColumns = False Me.ucrSelectorForCrops.bUseCurrentFilter = True - Me.ucrSelectorForCrops.Location = New System.Drawing.Point(6, 5) + Me.ucrSelectorForCrops.Location = New System.Drawing.Point(9, 8) Me.ucrSelectorForCrops.Margin = New System.Windows.Forms.Padding(0) Me.ucrSelectorForCrops.Name = "ucrSelectorForCrops" - Me.ucrSelectorForCrops.Size = New System.Drawing.Size(213, 183) + Me.ucrSelectorForCrops.Size = New System.Drawing.Size(320, 274) Me.ucrSelectorForCrops.TabIndex = 1 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(10, 392) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(4) + Me.ucrBase.Location = New System.Drawing.Point(15, 588) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.Size = New System.Drawing.Size(611, 77) Me.ucrBase.TabIndex = 0 ' - 'lblStarts - ' - Me.lblStarts.AutoSize = True - Me.lblStarts.Location = New System.Drawing.Point(6, 27) - Me.lblStarts.Name = "lblStarts" - Me.lblStarts.Size = New System.Drawing.Size(70, 13) - Me.lblStarts.TabIndex = 56 - Me.lblStarts.Text = "Include Start:" - ' 'dlgPICSACrops ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(144.0!, 144.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi Me.AutoSize = True - Me.ClientSize = New System.Drawing.Size(504, 449) + Me.ClientSize = New System.Drawing.Size(756, 674) Me.Controls.Add(Me.grpCropDefinitions) Me.Controls.Add(Me.grpSeasonReceivers) Me.Controls.Add(Me.ucrChkDataProp) - Me.Controls.Add(Me.ucrChkPrintDataProp) + Me.Controls.Add(Me.ucrChkDataCrops) Me.Controls.Add(Me.cmdOptions) Me.Controls.Add(Me.lblRain) Me.Controls.Add(Me.Label3) @@ -435,6 +447,7 @@ Partial Class dlgPICSACrops Me.Controls.Add(Me.ucrSelectorForCrops) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgPICSACrops" @@ -464,7 +477,7 @@ Partial Class dlgPICSACrops Friend WithEvents Label5 As Label Friend WithEvents lblRain As Label Friend WithEvents cmdOptions As Button - Friend WithEvents ucrChkPrintDataProp As ucrCheck + Friend WithEvents ucrChkDataCrops As ucrCheck Friend WithEvents ucrChkDataProp As ucrCheck Friend WithEvents grpSeasonReceivers As GroupBox Friend WithEvents grpCropDefinitions As GroupBox diff --git a/instat/dlgPICSACrops.vb b/instat/dlgPICSACrops.vb index a340b3716cc..5ef3b22f511 100644 --- a/instat/dlgPICSACrops.vb +++ b/instat/dlgPICSACrops.vb @@ -169,16 +169,16 @@ Public Class dlgPICSACrops 'ucrNudWaterSeqStep.SetParameter(New RParameter("step", clsSeqRainfall)) 'ucrNudWaterSeqTo.SetParameter(New RParameter("to", clsSeqRainfall)) + ucrChkDataCrops.SetText("Return Crops Data") + ucrChkDataCrops.SetParameter(New RParameter("return_crops_table", 11), bNewChangeParameterValue:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkDataCrops.SetRDefault("TRUE") + ucrChkDataProp.SetText("Calculate Proportions") - ucrChkDataProp.SetParameter(New RParameter("definition_props", 8), bNewChangeParameterValue:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") + ucrChkDataProp.SetParameter(New RParameter("definition_props", 12), bNewChangeParameterValue:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") ucrChkDataProp.SetRDefault("TRUE") - ucrChkPrintDataProp.SetText("Print Proportions Table(s)") - ucrChkPrintDataProp.SetParameter(New RParameter("print_table", 9), bNewChangeParameterValue:=True, strNewValueIfChecked:="TRUE", strNewValueIfUnchecked:="FALSE") - ucrChkPrintDataProp.SetRDefault("TRUE") - 'Linking of controls - ucrChkDataProp.AddToLinkedControls(ucrChkPrintDataProp, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedDisabledIfParameterMissing:=True) + ucrChkDataProp.AddToLinkedControls(ucrChkDataCrops, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedDisabledIfParameterMissing:=True) End Sub Private Sub SetDefaults() @@ -206,8 +206,8 @@ Public Class dlgPICSACrops ucrInputPlantingDates.SetName("160") ucrInputCropLengths.SetName("120") ucrInputWaterAmounts.SetName("600") - clsCropsFunction.AddParameter("definition_props", "TRUE", iPosition:=11) - clsCropsFunction.AddParameter("print_table", "TRUE", iPosition:=12) + clsCropsFunction.AddParameter("return_crops_table", "TRUE", iPosition:=11) + clsCropsFunction.AddParameter("definition_props", "TRUE", iPosition:=12) ucrBase.clsRsyntax.SetBaseRFunction(clsCropsFunction) ucrBase.clsRsyntax.iCallType = 2 TestOkEnabled() @@ -232,7 +232,7 @@ Public Class dlgPICSACrops ' Disabled as list validation not working correctly with reading/writing controls ucrChkDataProp.SetRCode(clsCropsFunction, bReset) - ucrChkPrintDataProp.SetRCode(clsCropsFunction, bReset) + ucrChkDataCrops.SetRCode(clsCropsFunction, bReset) If bReset Then ucrPnlStartCheck.SetRCode(clsDummyFunction, bReset) End If @@ -246,7 +246,7 @@ Public Class dlgPICSACrops End Sub Private Sub TestOkEnabled() - If Not ucrReceiverYear.IsEmpty AndAlso Not ucrReceiverRainfall.IsEmpty AndAlso Not ucrReceiverStart.IsEmpty AndAlso Not ucrReceiverDay.IsEmpty AndAlso Not ucrReceiverEnd.IsEmpty AndAlso Not ucrInputPlantingDates.IsEmpty AndAlso Not ucrInputCropLengths.IsEmpty AndAlso Not ucrInputWaterAmounts.IsEmpty Then + If Not ucrReceiverYear.IsEmpty AndAlso Not ucrReceiverRainfall.IsEmpty AndAlso Not ucrReceiverStart.IsEmpty AndAlso Not ucrReceiverDay.IsEmpty AndAlso Not ucrReceiverEnd.IsEmpty AndAlso Not ucrInputPlantingDates.IsEmpty AndAlso Not ucrInputCropLengths.IsEmpty AndAlso Not ucrInputWaterAmounts.IsEmpty AndAlso (ucrChkDataCrops.Checked OrElse ucrChkDataProp.Checked) Then ucrBase.OKEnabled(True) Else ucrBase.OKEnabled(False) diff --git a/instat/dlgRPackages.vb b/instat/dlgRPackages.vb index 488477f7658..31635f28e95 100644 --- a/instat/dlgRPackages.vb +++ b/instat/dlgRPackages.vb @@ -43,6 +43,7 @@ Public Class dlgInstallRPackage dctPackages.Add("rapidpror", Chr(34) & "rapidpror" & Chr(34)) dctPackages.Add("openappr", Chr(34) & "openappr" & Chr(34)) dctPackages.Add("networkGraphsR", Chr(34) & "networkGraphsR" & Chr(34)) + dctPackages.Add("climdex.pcic", Chr(34) & "climdex.pcic" & Chr(34)) ucrInputPackage.SetItems(dctPackages) ucrPnlRPackages.AddParameterValuesCondition(rdoCRAN, "checked", "cran") diff --git a/instat/dlgScript.Designer.vb b/instat/dlgScript.Designer.vb index ba37efac17a..a5686b7ed2e 100644 --- a/instat/dlgScript.Designer.vb +++ b/instat/dlgScript.Designer.vb @@ -25,20 +25,43 @@ Partial Class dlgScript Me.tbFeatures = New System.Windows.Forms.TabControl() Me.tbPageSaveData = New System.Windows.Forms.TabPage() Me.rdoFromRFile = New System.Windows.Forms.RadioButton() + Me.ucrInputSaveRFile = New instat.ucrInputTextBox() + Me.lblSaveText = New System.Windows.Forms.Label() + Me.lblSaveDataFrame = New System.Windows.Forms.Label() + Me.lblSaveColumn = New System.Windows.Forms.Label() + Me.ucrInputDataframeColumn = New instat.ucrInputTextBox() + Me.ucrInputSaveColumn = New instat.ucrInputTextBox() + Me.rdoVariable = New System.Windows.Forms.RadioButton() Me.rdoDataFrame = New System.Windows.Forms.RadioButton() + Me.ucrChkDisplayGraph = New instat.ucrCheck() + Me.ucrChkSaveDataFrameSingle = New instat.ucrCheck() + Me.ucrInputSaveDataFrame = New instat.ucrInputTextBox() Me.lblSaveObjectFormat = New System.Windows.Forms.Label() + Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() Me.lblSaveObjectType = New System.Windows.Forms.Label() + Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() Me.rdoSaveOutputObject = New System.Windows.Forms.RadioButton() Me.rdoSaveDataFrame = New System.Windows.Forms.RadioButton() Me.rdoSaveColumn = New System.Windows.Forms.RadioButton() + Me.ucrSaveObject = New instat.ucrSave() + Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() + Me.ucrPnlSaveData = New instat.UcrPanel() + Me.ucrPnlSaveDataFrame = New instat.UcrPanel() Me.tbPageGetData = New System.Windows.Forms.TabPage() + Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() + Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() Me.lblGetColumn = New System.Windows.Forms.Label() Me.lblGetObjectType = New System.Windows.Forms.Label() Me.rdoGetOutputObject = New System.Windows.Forms.RadioButton() Me.lblGetOutputObject = New System.Windows.Forms.Label() Me.rdoGetDataFrame = New System.Windows.Forms.RadioButton() Me.rdoGetColumn = New System.Windows.Forms.RadioButton() + Me.ucrDataFrameGetDF = New instat.ucrDataFrame() + Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() + Me.ucrPnlGetData = New instat.UcrPanel() + Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() Me.tbPageCommand = New System.Windows.Forms.TabPage() + Me.ucrChkWindow = New instat.ucrCheck() Me.rdoWindow = New System.Windows.Forms.RadioButton() Me.rdoListData = New System.Windows.Forms.RadioButton() Me.rdoViewData = New System.Windows.Forms.RadioButton() @@ -48,33 +71,6 @@ Partial Class dlgScript Me.rdoGgplotify = New System.Windows.Forms.RadioButton() Me.rdoCommandPackage = New System.Windows.Forms.RadioButton() Me.rdoCommandObject = New System.Windows.Forms.RadioButton() - Me.tbPageExamples = New System.Windows.Forms.TabPage() - Me.cmdHelp = New System.Windows.Forms.Button() - Me.rdoExampleData = New System.Windows.Forms.RadioButton() - Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() - Me.lstExampleCollection = New System.Windows.Forms.ListView() - Me.clmDatasets = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) - Me.clmDesc = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) - Me.Label3 = New System.Windows.Forms.Label() - Me.lblPreview = New System.Windows.Forms.Label() - Me.txtScript = New System.Windows.Forms.TextBox() - Me.ucrInputSaveRFile = New instat.ucrInputTextBox() - Me.ucrChkDisplayGraph = New instat.ucrCheck() - Me.ucrChkSaveDataFrameSingle = New instat.ucrCheck() - Me.ucrInputSaveDataFrame = New instat.ucrInputTextBox() - Me.ucrCboSaveOutputObjectFormat = New instat.ucrInputComboBox() - Me.ucrCboSaveOutputObjectType = New instat.ucrInputComboBox() - Me.ucrSaveObject = New instat.ucrSave() - Me.ucrDataFrameSaveOutputSelect = New instat.ucrDataFrame() - Me.ucrPnlSaveData = New instat.UcrPanel() - Me.ucrPnlSaveDataFrame = New instat.UcrPanel() - Me.ucrReceiverGetOutputObject = New instat.ucrReceiverSingle() - Me.ucrReceiverGetColumns = New instat.ucrReceiverMultiple() - Me.ucrDataFrameGetDF = New instat.ucrDataFrame() - Me.ucrCboGetOutputObjectType = New instat.ucrInputComboBox() - Me.ucrPnlGetData = New instat.UcrPanel() - Me.ucrSelectorGetObject = New instat.ucrSelectorByDataFrameAddRemove() - Me.ucrChkWindow = New instat.ucrCheck() Me.ucrChkInto = New instat.ucrCheck() Me.ucrInputSaveData = New instat.ucrInputTextBox() Me.ucrCboCommandDataPackage = New instat.ucrInputComboBox() @@ -86,8 +82,18 @@ Partial Class dlgScript Me.ucrInputRemoveObjects = New instat.ucrInputTextBox() Me.ucrCboCommandPackage = New instat.ucrInputComboBox() Me.ucrPnlCommands = New instat.UcrPanel() + Me.tbPageExamples = New System.Windows.Forms.TabPage() + Me.cmdHelp = New System.Windows.Forms.Button() + Me.rdoExampleData = New System.Windows.Forms.RadioButton() + Me.rdoExampleFunction = New System.Windows.Forms.RadioButton() Me.ucrPnlExample = New instat.UcrPanel() + Me.lstExampleCollection = New System.Windows.Forms.ListView() + Me.clmDatasets = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.clmDesc = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader) + Me.Label3 = New System.Windows.Forms.Label() Me.ucrCboExamplePackages = New instat.ucrInputComboBox() + Me.lblPreview = New System.Windows.Forms.Label() + Me.txtScript = New System.Windows.Forms.TextBox() Me.ucrBase = New instat.ucrButtons() Me.tbFeatures.SuspendLayout() Me.tbPageSaveData.SuspendLayout() @@ -105,13 +111,19 @@ Partial Class dlgScript Me.tbFeatures.Location = New System.Drawing.Point(8, 7) Me.tbFeatures.Name = "tbFeatures" Me.tbFeatures.SelectedIndex = 0 - Me.tbFeatures.Size = New System.Drawing.Size(446, 271) + Me.tbFeatures.Size = New System.Drawing.Size(446, 304) Me.tbFeatures.TabIndex = 31 ' 'tbPageSaveData ' - Me.tbPageSaveData.Controls.Add(Me.ucrInputSaveRFile) Me.tbPageSaveData.Controls.Add(Me.rdoFromRFile) + Me.tbPageSaveData.Controls.Add(Me.ucrInputSaveRFile) + Me.tbPageSaveData.Controls.Add(Me.lblSaveText) + Me.tbPageSaveData.Controls.Add(Me.lblSaveDataFrame) + Me.tbPageSaveData.Controls.Add(Me.lblSaveColumn) + Me.tbPageSaveData.Controls.Add(Me.ucrInputDataframeColumn) + Me.tbPageSaveData.Controls.Add(Me.ucrInputSaveColumn) + Me.tbPageSaveData.Controls.Add(Me.rdoVariable) Me.tbPageSaveData.Controls.Add(Me.rdoDataFrame) Me.tbPageSaveData.Controls.Add(Me.ucrChkDisplayGraph) Me.tbPageSaveData.Controls.Add(Me.ucrChkSaveDataFrameSingle) @@ -129,7 +141,7 @@ Partial Class dlgScript Me.tbPageSaveData.Controls.Add(Me.ucrPnlSaveDataFrame) Me.tbPageSaveData.Location = New System.Drawing.Point(4, 22) Me.tbPageSaveData.Name = "tbPageSaveData" - Me.tbPageSaveData.Size = New System.Drawing.Size(438, 245) + Me.tbPageSaveData.Size = New System.Drawing.Size(438, 278) Me.tbPageSaveData.TabIndex = 2 Me.tbPageSaveData.Text = "Save Data" Me.tbPageSaveData.UseVisualStyleBackColor = True @@ -137,7 +149,7 @@ Partial Class dlgScript 'rdoFromRFile ' Me.rdoFromRFile.AutoSize = True - Me.rdoFromRFile.Location = New System.Drawing.Point(83, 125) + Me.rdoFromRFile.Location = New System.Drawing.Point(49, 202) Me.rdoFromRFile.Margin = New System.Windows.Forms.Padding(2) Me.rdoFromRFile.Name = "rdoFromRFile" Me.rdoFromRFile.Size = New System.Drawing.Size(81, 17) @@ -146,18 +158,123 @@ Partial Class dlgScript Me.rdoFromRFile.Text = "From R File:" Me.rdoFromRFile.UseVisualStyleBackColor = True ' + 'ucrInputSaveRFile + ' + Me.ucrInputSaveRFile.AddQuotesIfUnrecognised = True + Me.ucrInputSaveRFile.AutoSize = True + Me.ucrInputSaveRFile.IsMultiline = False + Me.ucrInputSaveRFile.IsReadOnly = False + Me.ucrInputSaveRFile.Location = New System.Drawing.Point(67, 228) + Me.ucrInputSaveRFile.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSaveRFile.Name = "ucrInputSaveRFile" + Me.ucrInputSaveRFile.Size = New System.Drawing.Size(145, 21) + Me.ucrInputSaveRFile.TabIndex = 64 + ' + 'lblSaveText + ' + Me.lblSaveText.AutoSize = True + Me.lblSaveText.Location = New System.Drawing.Point(299, 72) + Me.lblSaveText.Name = "lblSaveText" + Me.lblSaveText.Size = New System.Drawing.Size(116, 13) + Me.lblSaveText.TabIndex = 71 + Me.lblSaveText.Text = "(separated by commas)" + ' + 'lblSaveDataFrame + ' + Me.lblSaveDataFrame.AutoSize = True + Me.lblSaveDataFrame.Location = New System.Drawing.Point(64, 103) + Me.lblSaveDataFrame.Name = "lblSaveDataFrame" + Me.lblSaveDataFrame.Size = New System.Drawing.Size(65, 13) + Me.lblSaveDataFrame.TabIndex = 70 + Me.lblSaveDataFrame.Text = "Data Frame:" + ' + 'lblSaveColumn + ' + Me.lblSaveColumn.AutoSize = True + Me.lblSaveColumn.Location = New System.Drawing.Point(64, 72) + Me.lblSaveColumn.Name = "lblSaveColumn" + Me.lblSaveColumn.Size = New System.Drawing.Size(49, 13) + Me.lblSaveColumn.TabIndex = 69 + Me.lblSaveColumn.Text = "Name(s):" + ' + 'ucrInputDataframeColumn + ' + Me.ucrInputDataframeColumn.AddQuotesIfUnrecognised = True + Me.ucrInputDataframeColumn.AutoSize = True + Me.ucrInputDataframeColumn.IsMultiline = False + Me.ucrInputDataframeColumn.IsReadOnly = False + Me.ucrInputDataframeColumn.Location = New System.Drawing.Point(131, 103) + Me.ucrInputDataframeColumn.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputDataframeColumn.Name = "ucrInputDataframeColumn" + Me.ucrInputDataframeColumn.Size = New System.Drawing.Size(155, 21) + Me.ucrInputDataframeColumn.TabIndex = 68 + ' + 'ucrInputSaveColumn + ' + Me.ucrInputSaveColumn.AddQuotesIfUnrecognised = True + Me.ucrInputSaveColumn.AutoSize = True + Me.ucrInputSaveColumn.IsMultiline = False + Me.ucrInputSaveColumn.IsReadOnly = False + Me.ucrInputSaveColumn.Location = New System.Drawing.Point(132, 72) + Me.ucrInputSaveColumn.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSaveColumn.Name = "ucrInputSaveColumn" + Me.ucrInputSaveColumn.Size = New System.Drawing.Size(154, 21) + Me.ucrInputSaveColumn.TabIndex = 67 + ' + 'rdoVariable + ' + Me.rdoVariable.AutoSize = True + Me.rdoVariable.Location = New System.Drawing.Point(49, 48) + Me.rdoVariable.Margin = New System.Windows.Forms.Padding(2) + Me.rdoVariable.Name = "rdoVariable" + Me.rdoVariable.Size = New System.Drawing.Size(97, 17) + Me.rdoVariable.TabIndex = 66 + Me.rdoVariable.TabStop = True + Me.rdoVariable.Text = "From Variables:" + Me.rdoVariable.UseVisualStyleBackColor = True + ' 'rdoDataFrame ' Me.rdoDataFrame.AutoSize = True - Me.rdoDataFrame.Location = New System.Drawing.Point(83, 48) + Me.rdoDataFrame.Location = New System.Drawing.Point(48, 126) Me.rdoDataFrame.Margin = New System.Windows.Forms.Padding(2) Me.rdoDataFrame.Name = "rdoDataFrame" - Me.rdoDataFrame.Size = New System.Drawing.Size(109, 17) + Me.rdoDataFrame.Size = New System.Drawing.Size(104, 17) Me.rdoDataFrame.TabIndex = 62 Me.rdoDataFrame.TabStop = True - Me.rdoDataFrame.Text = "From Data Frame:" + Me.rdoDataFrame.Text = "Into Data Frame:" Me.rdoDataFrame.UseVisualStyleBackColor = True ' + 'ucrChkDisplayGraph + ' + Me.ucrChkDisplayGraph.AutoSize = True + Me.ucrChkDisplayGraph.Checked = False + Me.ucrChkDisplayGraph.Location = New System.Drawing.Point(88, 217) + Me.ucrChkDisplayGraph.Name = "ucrChkDisplayGraph" + Me.ucrChkDisplayGraph.Size = New System.Drawing.Size(113, 23) + Me.ucrChkDisplayGraph.TabIndex = 60 + ' + 'ucrChkSaveDataFrameSingle + ' + Me.ucrChkSaveDataFrameSingle.AutoSize = True + Me.ucrChkSaveDataFrameSingle.Checked = False + Me.ucrChkSaveDataFrameSingle.Location = New System.Drawing.Point(55, 174) + Me.ucrChkSaveDataFrameSingle.Name = "ucrChkSaveDataFrameSingle" + Me.ucrChkSaveDataFrameSingle.Size = New System.Drawing.Size(146, 23) + Me.ucrChkSaveDataFrameSingle.TabIndex = 59 + ' + 'ucrInputSaveDataFrame + ' + Me.ucrInputSaveDataFrame.AddQuotesIfUnrecognised = True + Me.ucrInputSaveDataFrame.AutoSize = True + Me.ucrInputSaveDataFrame.IsMultiline = False + Me.ucrInputSaveDataFrame.IsReadOnly = False + Me.ucrInputSaveDataFrame.Location = New System.Drawing.Point(67, 147) + Me.ucrInputSaveDataFrame.Margin = New System.Windows.Forms.Padding(9) + Me.ucrInputSaveDataFrame.Name = "ucrInputSaveDataFrame" + Me.ucrInputSaveDataFrame.Size = New System.Drawing.Size(145, 21) + Me.ucrInputSaveDataFrame.TabIndex = 57 + ' 'lblSaveObjectFormat ' Me.lblSaveObjectFormat.AutoSize = True @@ -167,6 +284,18 @@ Partial Class dlgScript Me.lblSaveObjectFormat.TabIndex = 56 Me.lblSaveObjectFormat.Text = "Format:" ' + 'ucrCboSaveOutputObjectFormat + ' + Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False + Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) + Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" + Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) + Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 + ' 'lblSaveObjectType ' Me.lblSaveObjectType.AutoSize = True @@ -176,6 +305,18 @@ Partial Class dlgScript Me.lblSaveObjectType.TabIndex = 54 Me.lblSaveObjectType.Text = "Type:" ' + 'ucrCboSaveOutputObjectType + ' + Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboSaveOutputObjectType.IsReadOnly = False + Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) + Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" + Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) + Me.ucrCboSaveOutputObjectType.TabIndex = 53 + ' 'rdoSaveOutputObject ' Me.rdoSaveOutputObject.Appearance = System.Windows.Forms.Appearance.Button @@ -227,6 +368,44 @@ Partial Class dlgScript Me.rdoSaveColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoSaveColumn.UseVisualStyleBackColor = True ' + 'ucrSaveObject + ' + Me.ucrSaveObject.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrSaveObject.Location = New System.Drawing.Point(88, 193) + Me.ucrSaveObject.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.ucrSaveObject.Name = "ucrSaveObject" + Me.ucrSaveObject.Size = New System.Drawing.Size(258, 22) + Me.ucrSaveObject.TabIndex = 35 + ' + 'ucrDataFrameSaveOutputSelect + ' + Me.ucrDataFrameSaveOutputSelect.AutoSize = True + Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False + Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True + Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) + Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" + Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) + Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 + ' + 'ucrPnlSaveData + ' + Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) + Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlSaveData.Name = "ucrPnlSaveData" + Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlSaveData.TabIndex = 47 + ' + 'ucrPnlSaveDataFrame + ' + Me.ucrPnlSaveDataFrame.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlSaveDataFrame.Location = New System.Drawing.Point(5, 48) + Me.ucrPnlSaveDataFrame.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlSaveDataFrame.Name = "ucrPnlSaveDataFrame" + Me.ucrPnlSaveDataFrame.Size = New System.Drawing.Size(429, 208) + Me.ucrPnlSaveDataFrame.TabIndex = 65 + ' 'tbPageGetData ' Me.tbPageGetData.Controls.Add(Me.ucrReceiverGetOutputObject) @@ -244,11 +423,37 @@ Partial Class dlgScript Me.tbPageGetData.Location = New System.Drawing.Point(4, 22) Me.tbPageGetData.Name = "tbPageGetData" Me.tbPageGetData.Padding = New System.Windows.Forms.Padding(3) - Me.tbPageGetData.Size = New System.Drawing.Size(438, 245) + Me.tbPageGetData.Size = New System.Drawing.Size(438, 278) Me.tbPageGetData.TabIndex = 1 Me.tbPageGetData.Text = "Get Data" Me.tbPageGetData.UseVisualStyleBackColor = True ' + 'ucrReceiverGetOutputObject + ' + Me.ucrReceiverGetOutputObject.AutoSize = True + Me.ucrReceiverGetOutputObject.frmParent = Nothing + Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) + Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" + Me.ucrReceiverGetOutputObject.Selector = Nothing + Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) + Me.ucrReceiverGetOutputObject.strNcFilePath = "" + Me.ucrReceiverGetOutputObject.TabIndex = 27 + Me.ucrReceiverGetOutputObject.ucrSelector = Nothing + ' + 'ucrReceiverGetColumns + ' + Me.ucrReceiverGetColumns.AutoSize = True + Me.ucrReceiverGetColumns.frmParent = Nothing + Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) + Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" + Me.ucrReceiverGetColumns.Selector = Nothing + Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) + Me.ucrReceiverGetColumns.strNcFilePath = "" + Me.ucrReceiverGetColumns.TabIndex = 49 + Me.ucrReceiverGetColumns.ucrSelector = Nothing + ' 'lblGetColumn ' Me.lblGetColumn.AutoSize = True @@ -329,6 +534,50 @@ Partial Class dlgScript Me.rdoGetColumn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter Me.rdoGetColumn.UseVisualStyleBackColor = True ' + 'ucrDataFrameGetDF + ' + Me.ucrDataFrameGetDF.AutoSize = True + Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False + Me.ucrDataFrameGetDF.bUseCurrentFilter = True + Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) + Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) + Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" + Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) + Me.ucrDataFrameGetDF.TabIndex = 31 + ' + 'ucrCboGetOutputObjectType + ' + Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True + Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 + Me.ucrCboGetOutputObjectType.IsReadOnly = False + Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) + Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) + Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" + Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) + Me.ucrCboGetOutputObjectType.TabIndex = 47 + ' + 'ucrPnlGetData + ' + Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) + Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) + Me.ucrPnlGetData.Name = "ucrPnlGetData" + Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) + Me.ucrPnlGetData.TabIndex = 42 + ' + 'ucrSelectorGetObject + ' + Me.ucrSelectorGetObject.AutoSize = True + Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False + Me.ucrSelectorGetObject.bShowHiddenColumns = False + Me.ucrSelectorGetObject.bUseCurrentFilter = True + Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) + Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" + Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) + Me.ucrSelectorGetObject.TabIndex = 34 + ' 'tbPageCommand ' Me.tbPageCommand.Controls.Add(Me.ucrChkWindow) @@ -354,11 +603,20 @@ Partial Class dlgScript Me.tbPageCommand.Controls.Add(Me.ucrPnlCommands) Me.tbPageCommand.Location = New System.Drawing.Point(4, 22) Me.tbPageCommand.Name = "tbPageCommand" - Me.tbPageCommand.Size = New System.Drawing.Size(438, 245) + Me.tbPageCommand.Size = New System.Drawing.Size(438, 278) Me.tbPageCommand.TabIndex = 3 Me.tbPageCommand.Text = "Commands" Me.tbPageCommand.UseVisualStyleBackColor = True ' + 'ucrChkWindow + ' + Me.ucrChkWindow.AutoSize = True + Me.ucrChkWindow.Checked = False + Me.ucrChkWindow.Location = New System.Drawing.Point(233, 94) + Me.ucrChkWindow.Name = "ucrChkWindow" + Me.ucrChkWindow.Size = New System.Drawing.Size(126, 23) + Me.ucrChkWindow.TabIndex = 67 + ' 'rdoWindow ' Me.rdoWindow.AutoSize = True @@ -461,311 +719,14 @@ Partial Class dlgScript Me.rdoCommandObject.Text = "Remove Object(s):" Me.rdoCommandObject.UseVisualStyleBackColor = True ' - 'tbPageExamples + 'ucrChkInto ' - Me.tbPageExamples.Controls.Add(Me.cmdHelp) - Me.tbPageExamples.Controls.Add(Me.rdoExampleData) - Me.tbPageExamples.Controls.Add(Me.rdoExampleFunction) - Me.tbPageExamples.Controls.Add(Me.ucrPnlExample) - Me.tbPageExamples.Controls.Add(Me.lstExampleCollection) - Me.tbPageExamples.Controls.Add(Me.Label3) - Me.tbPageExamples.Controls.Add(Me.ucrCboExamplePackages) - Me.tbPageExamples.Location = New System.Drawing.Point(4, 22) - Me.tbPageExamples.Name = "tbPageExamples" - Me.tbPageExamples.Size = New System.Drawing.Size(438, 245) - Me.tbPageExamples.TabIndex = 4 - Me.tbPageExamples.Text = "Library" - Me.tbPageExamples.UseVisualStyleBackColor = True - ' - 'cmdHelp - ' - Me.cmdHelp.Location = New System.Drawing.Point(361, 4) - Me.cmdHelp.Name = "cmdHelp" - Me.cmdHelp.Size = New System.Drawing.Size(75, 23) - Me.cmdHelp.TabIndex = 61 - Me.cmdHelp.Text = "R Help" - Me.cmdHelp.UseVisualStyleBackColor = True - ' - 'rdoExampleData - ' - Me.rdoExampleData.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoExampleData.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoExampleData.FlatAppearance.BorderSize = 2 - Me.rdoExampleData.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoExampleData.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoExampleData.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoExampleData.Location = New System.Drawing.Point(14, 54) - Me.rdoExampleData.Name = "rdoExampleData" - Me.rdoExampleData.Size = New System.Drawing.Size(80, 30) - Me.rdoExampleData.TabIndex = 57 - Me.rdoExampleData.TabStop = True - Me.rdoExampleData.Text = "Data" - Me.rdoExampleData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoExampleData.UseVisualStyleBackColor = True - ' - 'rdoExampleFunction - ' - Me.rdoExampleFunction.Appearance = System.Windows.Forms.Appearance.Button - Me.rdoExampleFunction.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoExampleFunction.FlatAppearance.BorderSize = 2 - Me.rdoExampleFunction.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption - Me.rdoExampleFunction.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.rdoExampleFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.rdoExampleFunction.Location = New System.Drawing.Point(92, 54) - Me.rdoExampleFunction.Name = "rdoExampleFunction" - Me.rdoExampleFunction.Size = New System.Drawing.Size(80, 30) - Me.rdoExampleFunction.TabIndex = 58 - Me.rdoExampleFunction.TabStop = True - Me.rdoExampleFunction.Text = "Function" - Me.rdoExampleFunction.TextAlign = System.Drawing.ContentAlignment.MiddleCenter - Me.rdoExampleFunction.UseVisualStyleBackColor = True - ' - 'lstExampleCollection - ' - Me.lstExampleCollection.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmDatasets, Me.clmDesc}) - Me.lstExampleCollection.FullRowSelect = True - Me.lstExampleCollection.HideSelection = False - Me.lstExampleCollection.Location = New System.Drawing.Point(3, 93) - Me.lstExampleCollection.MultiSelect = False - Me.lstExampleCollection.Name = "lstExampleCollection" - Me.lstExampleCollection.ShowGroups = False - Me.lstExampleCollection.ShowItemToolTips = True - Me.lstExampleCollection.Size = New System.Drawing.Size(415, 146) - Me.lstExampleCollection.Sorting = System.Windows.Forms.SortOrder.Ascending - Me.lstExampleCollection.TabIndex = 53 - Me.lstExampleCollection.UseCompatibleStateImageBehavior = False - Me.lstExampleCollection.View = System.Windows.Forms.View.Details - ' - 'clmDatasets - ' - Me.clmDatasets.Text = "Data" - Me.clmDatasets.Width = 142 - ' - 'clmDesc - ' - Me.clmDesc.Text = "Description" - Me.clmDesc.Width = 266 - ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(13, 5) - Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(50, 13) - Me.Label3.TabIndex = 52 - Me.Label3.Text = "Package" - ' - 'lblPreview - ' - Me.lblPreview.AutoSize = True - Me.lblPreview.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblPreview.Location = New System.Drawing.Point(9, 281) - Me.lblPreview.Name = "lblPreview" - Me.lblPreview.Size = New System.Drawing.Size(48, 13) - Me.lblPreview.TabIndex = 30 - Me.lblPreview.Text = "Preview:" - ' - 'txtScript - ' - Me.txtScript.Location = New System.Drawing.Point(5, 299) - Me.txtScript.Multiline = True - Me.txtScript.Name = "txtScript" - Me.txtScript.ScrollBars = System.Windows.Forms.ScrollBars.Both - Me.txtScript.Size = New System.Drawing.Size(445, 96) - Me.txtScript.TabIndex = 32 - ' - 'ucrInputSaveRFile - ' - Me.ucrInputSaveRFile.AddQuotesIfUnrecognised = True - Me.ucrInputSaveRFile.AutoSize = True - Me.ucrInputSaveRFile.IsMultiline = False - Me.ucrInputSaveRFile.IsReadOnly = False - Me.ucrInputSaveRFile.Location = New System.Drawing.Point(92, 150) - Me.ucrInputSaveRFile.Margin = New System.Windows.Forms.Padding(9) - Me.ucrInputSaveRFile.Name = "ucrInputSaveRFile" - Me.ucrInputSaveRFile.Size = New System.Drawing.Size(145, 21) - Me.ucrInputSaveRFile.TabIndex = 64 - ' - 'ucrChkDisplayGraph - ' - Me.ucrChkDisplayGraph.AutoSize = True - Me.ucrChkDisplayGraph.Checked = False - Me.ucrChkDisplayGraph.Location = New System.Drawing.Point(88, 217) - Me.ucrChkDisplayGraph.Name = "ucrChkDisplayGraph" - Me.ucrChkDisplayGraph.Size = New System.Drawing.Size(113, 23) - Me.ucrChkDisplayGraph.TabIndex = 60 - ' - 'ucrChkSaveDataFrameSingle - ' - Me.ucrChkSaveDataFrameSingle.AutoSize = True - Me.ucrChkSaveDataFrameSingle.Checked = False - Me.ucrChkSaveDataFrameSingle.Location = New System.Drawing.Point(91, 101) - Me.ucrChkSaveDataFrameSingle.Name = "ucrChkSaveDataFrameSingle" - Me.ucrChkSaveDataFrameSingle.Size = New System.Drawing.Size(146, 23) - Me.ucrChkSaveDataFrameSingle.TabIndex = 59 - ' - 'ucrInputSaveDataFrame - ' - Me.ucrInputSaveDataFrame.AddQuotesIfUnrecognised = True - Me.ucrInputSaveDataFrame.AutoSize = True - Me.ucrInputSaveDataFrame.IsMultiline = False - Me.ucrInputSaveDataFrame.IsReadOnly = False - Me.ucrInputSaveDataFrame.Location = New System.Drawing.Point(92, 70) - Me.ucrInputSaveDataFrame.Margin = New System.Windows.Forms.Padding(9) - Me.ucrInputSaveDataFrame.Name = "ucrInputSaveDataFrame" - Me.ucrInputSaveDataFrame.Size = New System.Drawing.Size(145, 21) - Me.ucrInputSaveDataFrame.TabIndex = 57 - ' - 'ucrCboSaveOutputObjectFormat - ' - Me.ucrCboSaveOutputObjectFormat.AddQuotesIfUnrecognised = True - Me.ucrCboSaveOutputObjectFormat.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboSaveOutputObjectFormat.GetSetSelectedIndex = -1 - Me.ucrCboSaveOutputObjectFormat.IsReadOnly = False - Me.ucrCboSaveOutputObjectFormat.Location = New System.Drawing.Point(88, 160) - Me.ucrCboSaveOutputObjectFormat.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboSaveOutputObjectFormat.Name = "ucrCboSaveOutputObjectFormat" - Me.ucrCboSaveOutputObjectFormat.Size = New System.Drawing.Size(141, 21) - Me.ucrCboSaveOutputObjectFormat.TabIndex = 55 - ' - 'ucrCboSaveOutputObjectType - ' - Me.ucrCboSaveOutputObjectType.AddQuotesIfUnrecognised = True - Me.ucrCboSaveOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboSaveOutputObjectType.GetSetSelectedIndex = -1 - Me.ucrCboSaveOutputObjectType.IsReadOnly = False - Me.ucrCboSaveOutputObjectType.Location = New System.Drawing.Point(87, 116) - Me.ucrCboSaveOutputObjectType.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboSaveOutputObjectType.Name = "ucrCboSaveOutputObjectType" - Me.ucrCboSaveOutputObjectType.Size = New System.Drawing.Size(144, 21) - Me.ucrCboSaveOutputObjectType.TabIndex = 53 - ' - 'ucrSaveObject - ' - Me.ucrSaveObject.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrSaveObject.Location = New System.Drawing.Point(88, 193) - Me.ucrSaveObject.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.ucrSaveObject.Name = "ucrSaveObject" - Me.ucrSaveObject.Size = New System.Drawing.Size(258, 22) - Me.ucrSaveObject.TabIndex = 35 - ' - 'ucrDataFrameSaveOutputSelect - ' - Me.ucrDataFrameSaveOutputSelect.AutoSize = True - Me.ucrDataFrameSaveOutputSelect.bDropUnusedFilterLevels = False - Me.ucrDataFrameSaveOutputSelect.bUseCurrentFilter = True - Me.ucrDataFrameSaveOutputSelect.Location = New System.Drawing.Point(86, 54) - Me.ucrDataFrameSaveOutputSelect.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameSaveOutputSelect.Name = "ucrDataFrameSaveOutputSelect" - Me.ucrDataFrameSaveOutputSelect.Size = New System.Drawing.Size(224, 59) - Me.ucrDataFrameSaveOutputSelect.TabIndex = 29 - ' - 'ucrPnlSaveData - ' - Me.ucrPnlSaveData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlSaveData.Location = New System.Drawing.Point(13, 12) - Me.ucrPnlSaveData.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlSaveData.Name = "ucrPnlSaveData" - Me.ucrPnlSaveData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlSaveData.TabIndex = 47 - ' - 'ucrPnlSaveDataFrame - ' - Me.ucrPnlSaveDataFrame.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlSaveDataFrame.Location = New System.Drawing.Point(5, 48) - Me.ucrPnlSaveDataFrame.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlSaveDataFrame.Name = "ucrPnlSaveDataFrame" - Me.ucrPnlSaveDataFrame.Size = New System.Drawing.Size(429, 134) - Me.ucrPnlSaveDataFrame.TabIndex = 65 - ' - 'ucrReceiverGetOutputObject - ' - Me.ucrReceiverGetOutputObject.AutoSize = True - Me.ucrReceiverGetOutputObject.frmParent = Nothing - Me.ucrReceiverGetOutputObject.Location = New System.Drawing.Point(240, 117) - Me.ucrReceiverGetOutputObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetOutputObject.Name = "ucrReceiverGetOutputObject" - Me.ucrReceiverGetOutputObject.Selector = Nothing - Me.ucrReceiverGetOutputObject.Size = New System.Drawing.Size(138, 20) - Me.ucrReceiverGetOutputObject.strNcFilePath = "" - Me.ucrReceiverGetOutputObject.TabIndex = 27 - Me.ucrReceiverGetOutputObject.ucrSelector = Nothing - ' - 'ucrReceiverGetColumns - ' - Me.ucrReceiverGetColumns.AutoSize = True - Me.ucrReceiverGetColumns.frmParent = Nothing - Me.ucrReceiverGetColumns.Location = New System.Drawing.Point(243, 104) - Me.ucrReceiverGetColumns.Margin = New System.Windows.Forms.Padding(0) - Me.ucrReceiverGetColumns.Name = "ucrReceiverGetColumns" - Me.ucrReceiverGetColumns.Selector = Nothing - Me.ucrReceiverGetColumns.Size = New System.Drawing.Size(137, 105) - Me.ucrReceiverGetColumns.strNcFilePath = "" - Me.ucrReceiverGetColumns.TabIndex = 49 - Me.ucrReceiverGetColumns.ucrSelector = Nothing - ' - 'ucrDataFrameGetDF - ' - Me.ucrDataFrameGetDF.AutoSize = True - Me.ucrDataFrameGetDF.bDropUnusedFilterLevels = False - Me.ucrDataFrameGetDF.bUseCurrentFilter = True - Me.ucrDataFrameGetDF.Location = New System.Drawing.Point(81, 55) - Me.ucrDataFrameGetDF.Margin = New System.Windows.Forms.Padding(0) - Me.ucrDataFrameGetDF.Name = "ucrDataFrameGetDF" - Me.ucrDataFrameGetDF.Size = New System.Drawing.Size(224, 59) - Me.ucrDataFrameGetDF.TabIndex = 31 - ' - 'ucrCboGetOutputObjectType - ' - Me.ucrCboGetOutputObjectType.AddQuotesIfUnrecognised = True - Me.ucrCboGetOutputObjectType.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrCboGetOutputObjectType.GetSetSelectedIndex = -1 - Me.ucrCboGetOutputObjectType.IsReadOnly = False - Me.ucrCboGetOutputObjectType.Location = New System.Drawing.Point(241, 72) - Me.ucrCboGetOutputObjectType.Margin = New System.Windows.Forms.Padding(9) - Me.ucrCboGetOutputObjectType.Name = "ucrCboGetOutputObjectType" - Me.ucrCboGetOutputObjectType.Size = New System.Drawing.Size(137, 21) - Me.ucrCboGetOutputObjectType.TabIndex = 47 - ' - 'ucrPnlGetData - ' - Me.ucrPnlGetData.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlGetData.Location = New System.Drawing.Point(5, 10) - Me.ucrPnlGetData.Margin = New System.Windows.Forms.Padding(6) - Me.ucrPnlGetData.Name = "ucrPnlGetData" - Me.ucrPnlGetData.Size = New System.Drawing.Size(402, 36) - Me.ucrPnlGetData.TabIndex = 42 - ' - 'ucrSelectorGetObject - ' - Me.ucrSelectorGetObject.AutoSize = True - Me.ucrSelectorGetObject.bDropUnusedFilterLevels = False - Me.ucrSelectorGetObject.bShowHiddenColumns = False - Me.ucrSelectorGetObject.bUseCurrentFilter = True - Me.ucrSelectorGetObject.Location = New System.Drawing.Point(9, 52) - Me.ucrSelectorGetObject.Margin = New System.Windows.Forms.Padding(0) - Me.ucrSelectorGetObject.Name = "ucrSelectorGetObject" - Me.ucrSelectorGetObject.Size = New System.Drawing.Size(320, 274) - Me.ucrSelectorGetObject.TabIndex = 34 - ' - 'ucrChkWindow - ' - Me.ucrChkWindow.AutoSize = True - Me.ucrChkWindow.Checked = False - Me.ucrChkWindow.Location = New System.Drawing.Point(233, 94) - Me.ucrChkWindow.Name = "ucrChkWindow" - Me.ucrChkWindow.Size = New System.Drawing.Size(126, 23) - Me.ucrChkWindow.TabIndex = 67 - ' - 'ucrChkInto - ' - Me.ucrChkInto.AutoSize = True - Me.ucrChkInto.Checked = False - Me.ucrChkInto.Location = New System.Drawing.Point(233, 33) - Me.ucrChkInto.Name = "ucrChkInto" - Me.ucrChkInto.Size = New System.Drawing.Size(84, 23) - Me.ucrChkInto.TabIndex = 63 + Me.ucrChkInto.AutoSize = True + Me.ucrChkInto.Checked = False + Me.ucrChkInto.Location = New System.Drawing.Point(233, 33) + Me.ucrChkInto.Name = "ucrChkInto" + Me.ucrChkInto.Size = New System.Drawing.Size(84, 23) + Me.ucrChkInto.TabIndex = 63 ' 'ucrInputSaveData ' @@ -881,6 +842,65 @@ Partial Class dlgScript Me.ucrPnlCommands.Size = New System.Drawing.Size(429, 238) Me.ucrPnlCommands.TabIndex = 47 ' + 'tbPageExamples + ' + Me.tbPageExamples.Controls.Add(Me.cmdHelp) + Me.tbPageExamples.Controls.Add(Me.rdoExampleData) + Me.tbPageExamples.Controls.Add(Me.rdoExampleFunction) + Me.tbPageExamples.Controls.Add(Me.ucrPnlExample) + Me.tbPageExamples.Controls.Add(Me.lstExampleCollection) + Me.tbPageExamples.Controls.Add(Me.Label3) + Me.tbPageExamples.Controls.Add(Me.ucrCboExamplePackages) + Me.tbPageExamples.Location = New System.Drawing.Point(4, 22) + Me.tbPageExamples.Name = "tbPageExamples" + Me.tbPageExamples.Size = New System.Drawing.Size(438, 278) + Me.tbPageExamples.TabIndex = 4 + Me.tbPageExamples.Text = "Library" + Me.tbPageExamples.UseVisualStyleBackColor = True + ' + 'cmdHelp + ' + Me.cmdHelp.Location = New System.Drawing.Point(361, 4) + Me.cmdHelp.Name = "cmdHelp" + Me.cmdHelp.Size = New System.Drawing.Size(75, 23) + Me.cmdHelp.TabIndex = 61 + Me.cmdHelp.Text = "R Help" + Me.cmdHelp.UseVisualStyleBackColor = True + ' + 'rdoExampleData + ' + Me.rdoExampleData.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoExampleData.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleData.FlatAppearance.BorderSize = 2 + Me.rdoExampleData.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleData.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoExampleData.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoExampleData.Location = New System.Drawing.Point(14, 54) + Me.rdoExampleData.Name = "rdoExampleData" + Me.rdoExampleData.Size = New System.Drawing.Size(80, 30) + Me.rdoExampleData.TabIndex = 57 + Me.rdoExampleData.TabStop = True + Me.rdoExampleData.Text = "Data" + Me.rdoExampleData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoExampleData.UseVisualStyleBackColor = True + ' + 'rdoExampleFunction + ' + Me.rdoExampleFunction.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoExampleFunction.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleFunction.FlatAppearance.BorderSize = 2 + Me.rdoExampleFunction.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoExampleFunction.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoExampleFunction.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoExampleFunction.Location = New System.Drawing.Point(92, 54) + Me.rdoExampleFunction.Name = "rdoExampleFunction" + Me.rdoExampleFunction.Size = New System.Drawing.Size(80, 30) + Me.rdoExampleFunction.TabIndex = 58 + Me.rdoExampleFunction.TabStop = True + Me.rdoExampleFunction.Text = "Function" + Me.rdoExampleFunction.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoExampleFunction.UseVisualStyleBackColor = True + ' 'ucrPnlExample ' Me.ucrPnlExample.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink @@ -890,6 +910,42 @@ Partial Class dlgScript Me.ucrPnlExample.Size = New System.Drawing.Size(402, 34) Me.ucrPnlExample.TabIndex = 56 ' + 'lstExampleCollection + ' + Me.lstExampleCollection.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmDatasets, Me.clmDesc}) + Me.lstExampleCollection.FullRowSelect = True + Me.lstExampleCollection.HideSelection = False + Me.lstExampleCollection.Location = New System.Drawing.Point(3, 93) + Me.lstExampleCollection.MultiSelect = False + Me.lstExampleCollection.Name = "lstExampleCollection" + Me.lstExampleCollection.ShowGroups = False + Me.lstExampleCollection.ShowItemToolTips = True + Me.lstExampleCollection.Size = New System.Drawing.Size(415, 146) + Me.lstExampleCollection.Sorting = System.Windows.Forms.SortOrder.Ascending + Me.lstExampleCollection.TabIndex = 53 + Me.lstExampleCollection.UseCompatibleStateImageBehavior = False + Me.lstExampleCollection.View = System.Windows.Forms.View.Details + ' + 'clmDatasets + ' + Me.clmDatasets.Text = "Data" + Me.clmDatasets.Width = 142 + ' + 'clmDesc + ' + Me.clmDesc.Text = "Description" + Me.clmDesc.Width = 266 + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(13, 5) + Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(50, 13) + Me.Label3.TabIndex = 52 + Me.Label3.Text = "Package" + ' 'ucrCboExamplePackages ' Me.ucrCboExamplePackages.AddQuotesIfUnrecognised = True @@ -902,11 +958,30 @@ Partial Class dlgScript Me.ucrCboExamplePackages.Size = New System.Drawing.Size(137, 21) Me.ucrCboExamplePackages.TabIndex = 51 ' + 'lblPreview + ' + Me.lblPreview.AutoSize = True + Me.lblPreview.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.lblPreview.Location = New System.Drawing.Point(9, 314) + Me.lblPreview.Name = "lblPreview" + Me.lblPreview.Size = New System.Drawing.Size(48, 13) + Me.lblPreview.TabIndex = 30 + Me.lblPreview.Text = "Preview:" + ' + 'txtScript + ' + Me.txtScript.Location = New System.Drawing.Point(5, 332) + Me.txtScript.Multiline = True + Me.txtScript.Name = "txtScript" + Me.txtScript.ScrollBars = System.Windows.Forms.ScrollBars.Both + Me.txtScript.Size = New System.Drawing.Size(445, 96) + Me.txtScript.TabIndex = 32 + ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(6, 399) + Me.ucrBase.Location = New System.Drawing.Point(6, 431) Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.ucrBase.Name = "ucrBase" Me.ucrBase.Size = New System.Drawing.Size(408, 52) @@ -917,7 +992,7 @@ Partial Class dlgScript 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(458, 458) + Me.ClientSize = New System.Drawing.Size(458, 489) Me.Controls.Add(Me.txtScript) Me.Controls.Add(Me.lblPreview) Me.Controls.Add(Me.tbFeatures) @@ -1009,4 +1084,10 @@ Partial Class dlgScript Friend WithEvents rdoFromRFile As RadioButton Friend WithEvents rdoDataFrame As RadioButton Friend WithEvents ucrPnlSaveDataFrame As UcrPanel + Friend WithEvents lblSaveText As Label + Friend WithEvents lblSaveDataFrame As Label + Friend WithEvents lblSaveColumn As Label + Friend WithEvents ucrInputDataframeColumn As ucrInputTextBox + Friend WithEvents ucrInputSaveColumn As ucrInputTextBox + Friend WithEvents rdoVariable As RadioButton End Class diff --git a/instat/dlgScript.vb b/instat/dlgScript.vb index 56b6fca3e73..2f8f71f0b70 100644 --- a/instat/dlgScript.vb +++ b/instat/dlgScript.vb @@ -78,6 +78,7 @@ Public Class dlgScript ucrPnlSaveDataFrame.AddRadioButton(rdoDataFrame) ucrPnlSaveDataFrame.AddRadioButton(rdoFromRFile) + ucrPnlSaveDataFrame.AddRadioButton(rdoVariable) ucrChkSaveDataFrameSingle.SetText("Single") @@ -777,6 +778,11 @@ Public Class dlgScript Private Sub HideShowSaveDataFrameControls() ucrInputSaveRFile.SetVisible(False) ucrInputSaveDataFrame.SetVisible(False) + ucrInputSaveColumn.SetVisible(False) + ucrInputDataframeColumn.SetVisible(False) + lblSaveColumn.Visible = False + lblSaveDataFrame.Visible = False + lblSaveText.Visible = False ucrChkSaveDataFrameSingle.SetVisible(False) If rdoDataFrame.Checked Then ucrInputSaveDataFrame.SetVisible(True) @@ -786,7 +792,52 @@ Public Class dlgScript ElseIf rdoFromRFile.Checked Then ucrInputSaveRFile.SetVisible(True) ucrInputSaveRFile.OnControlValueChanged() + ElseIf rdoVariable.Checked Then + ucrInputSaveColumn.SetVisible(True) + ucrInputDataframeColumn.SetVisible(True) + lblSaveText.Visible = True + lblSaveColumn.Visible = True + lblSaveDataFrame.Visible = True + ucrChkSaveDataFrameSingle.SetVisible(True) + ucrInputSaveDataFrame.OnControlValueChanged() End If End Sub + Private Sub ucrInputDataframeColumn_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrInputDataframeColumn.ControlContentsChanged, ucrInputSaveColumn.ControlContentsChanged, + ucrChkSaveDataFrameSingle.ControlContentsChanged + Dim strScript As String = "" + + If rdoVariable.Checked Then + If Not ucrInputDataframeColumn.IsEmpty() AndAlso Not ucrInputSaveColumn.IsEmpty Then + Dim clsDataFrameFunction As New RFunction + Dim clsImportRFunction As New RFunction + Dim strColumneName As String = ucrInputSaveColumn.GetText() + Dim strDataFrameName As String = ucrInputDataframeColumn.GetText() + + clsImportRFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$import_data") + clsDataFrameFunction.SetRCommand("data.frame") + + Dim strAssignedScript As String = "" + clsDataFrameFunction.AddParameter("dataframe", ucrInputSaveColumn.GetText(), bIncludeArgumentName:=False) + clsDataFrameFunction.SetAssignTo(ucrInputDataframeColumn.GetText) + clsDataFrameFunction.ToScript(strScript:=strAssignedScript) + + If ucrChkSaveDataFrameSingle.Checked Then + ' If it's a single data frame then wrap it into a list + Dim clsDataListRFunction As New RFunction + clsDataListRFunction.SetRCommand("list") + clsDataListRFunction.AddParameter(strParameterName:=strDataFrameName, strParameterValue:=strDataFrameName) + clsImportRFunction.AddParameter(strParameterName:="data_tables", clsRFunctionParameter:=clsDataListRFunction) + Else + ' If it's already a list of data frames, then add the name directly + clsImportRFunction.AddParameter(strParameterName:="data_tables", strParameterValue:=strDataFrameName) + End If + + strScript = "# Save variables " & """" & strColumneName & """" & " into data frame " & """" & strDataFrameName & """" & Environment.NewLine & strAssignedScript & clsImportRFunction.ToScript() + + End If + End If + PreviewScript(strScript) + End Sub + End Class \ No newline at end of file diff --git a/instat/dlgSelect.vb b/instat/dlgSelect.vb index 2bc3630c75e..9d9d2acc09f 100644 --- a/instat/dlgSelect.vb +++ b/instat/dlgSelect.vb @@ -137,6 +137,12 @@ Public Class dlgSelect End Sub Private Sub cmdDefineNewSelect_Click(sender As Object, e As EventArgs) Handles cmdDefineNewSelect.Click + If frmMain.IsColumnSelectionApplied Then + Dim clsRemoveCurrentSelection As New RFunction + clsRemoveCurrentSelection.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$remove_current_column_selection") + clsRemoveCurrentSelection.AddParameter("data_name", Chr(34) & ucrSelectorForSelectColumns.strCurrentDataFrame & Chr(34)) + frmMain.clsRLink.RunScript(clsRemoveCurrentSelection.ToScript, strComment:="Remove current selection") + End If dlgSelectColumns.SetDefaultDataFrame(ucrSelectorForSelectColumns.ucrAvailableDataFrames.strCurrDataFrame) dlgSelectColumns.ShowDialog() ucrSelectorForSelectColumns.LoadList() diff --git a/instat/dlgViewGraph.Designer.vb b/instat/dlgViewGraph.Designer.vb index e92f9875b32..8b80ba15a17 100644 --- a/instat/dlgViewGraph.Designer.vb +++ b/instat/dlgViewGraph.Designer.vb @@ -39,15 +39,15 @@ Partial Class dlgViewGraph Private Sub InitializeComponent() Me.grpDisplayOptions = New System.Windows.Forms.GroupBox() + Me.rdoMaximised = New System.Windows.Forms.RadioButton() Me.rdoInteractiveView = New System.Windows.Forms.RadioButton() Me.rdoRViewer = New System.Windows.Forms.RadioButton() Me.rdoOutputWindow = New System.Windows.Forms.RadioButton() + Me.ucrPnlDisplayOptions = New instat.UcrPanel() Me.lblGraphtoUse = New System.Windows.Forms.Label() Me.ucrGraphReceiver = New instat.ucrReceiverSingle() - Me.ucrPnlDisplayOptions = New instat.UcrPanel() Me.ucrGraphsSelector = New instat.ucrSelectorByDataFrameAddRemove() Me.ucrBase = New instat.ucrButtons() - Me.rdoMaximised = New System.Windows.Forms.RadioButton() Me.grpDisplayOptions.SuspendLayout() Me.SuspendLayout() ' @@ -58,22 +58,30 @@ Partial Class dlgViewGraph Me.grpDisplayOptions.Controls.Add(Me.rdoRViewer) Me.grpDisplayOptions.Controls.Add(Me.rdoOutputWindow) Me.grpDisplayOptions.Controls.Add(Me.ucrPnlDisplayOptions) - Me.grpDisplayOptions.Location = New System.Drawing.Point(369, 135) - Me.grpDisplayOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpDisplayOptions.Location = New System.Drawing.Point(246, 90) Me.grpDisplayOptions.Name = "grpDisplayOptions" - Me.grpDisplayOptions.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) - Me.grpDisplayOptions.Size = New System.Drawing.Size(326, 186) + Me.grpDisplayOptions.Size = New System.Drawing.Size(217, 124) Me.grpDisplayOptions.TabIndex = 3 Me.grpDisplayOptions.TabStop = False Me.grpDisplayOptions.Text = "Display Options" ' + 'rdoMaximised + ' + Me.rdoMaximised.AutoSize = True + Me.rdoMaximised.Location = New System.Drawing.Point(9, 43) + Me.rdoMaximised.Name = "rdoMaximised" + Me.rdoMaximised.Size = New System.Drawing.Size(113, 17) + Me.rdoMaximised.TabIndex = 4 + Me.rdoMaximised.TabStop = True + Me.rdoMaximised.Text = "Maximised window" + Me.rdoMaximised.UseVisualStyleBackColor = True + ' 'rdoInteractiveView ' Me.rdoInteractiveView.AutoSize = True - Me.rdoInteractiveView.Location = New System.Drawing.Point(14, 98) - Me.rdoInteractiveView.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoInteractiveView.Location = New System.Drawing.Point(9, 65) Me.rdoInteractiveView.Name = "rdoInteractiveView" - Me.rdoInteractiveView.Size = New System.Drawing.Size(203, 24) + Me.rdoInteractiveView.Size = New System.Drawing.Size(140, 17) Me.rdoInteractiveView.TabIndex = 1 Me.rdoInteractiveView.TabStop = True Me.rdoInteractiveView.Text = "Interactive viewer(Plotly)" @@ -82,10 +90,9 @@ Partial Class dlgViewGraph 'rdoRViewer ' Me.rdoRViewer.AutoSize = True - Me.rdoRViewer.Location = New System.Drawing.Point(10, 130) - Me.rdoRViewer.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoRViewer.Location = New System.Drawing.Point(9, 87) Me.rdoRViewer.Name = "rdoRViewer" - Me.rdoRViewer.Size = New System.Drawing.Size(99, 24) + Me.rdoRViewer.Size = New System.Drawing.Size(68, 17) Me.rdoRViewer.TabIndex = 2 Me.rdoRViewer.TabStop = True Me.rdoRViewer.Text = "R-Viewer" @@ -94,22 +101,29 @@ Partial Class dlgViewGraph 'rdoOutputWindow ' Me.rdoOutputWindow.AutoSize = True - Me.rdoOutputWindow.Location = New System.Drawing.Point(14, 33) - Me.rdoOutputWindow.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.rdoOutputWindow.Location = New System.Drawing.Point(9, 22) Me.rdoOutputWindow.Name = "rdoOutputWindow" - Me.rdoOutputWindow.Size = New System.Drawing.Size(139, 24) + Me.rdoOutputWindow.Size = New System.Drawing.Size(96, 17) Me.rdoOutputWindow.TabIndex = 3 Me.rdoOutputWindow.TabStop = True Me.rdoOutputWindow.Text = "Output window" Me.rdoOutputWindow.UseVisualStyleBackColor = True ' + 'ucrPnlDisplayOptions + ' + Me.ucrPnlDisplayOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrPnlDisplayOptions.Location = New System.Drawing.Point(6, 19) + Me.ucrPnlDisplayOptions.Margin = New System.Windows.Forms.Padding(6, 6, 6, 6) + Me.ucrPnlDisplayOptions.Name = "ucrPnlDisplayOptions" + Me.ucrPnlDisplayOptions.Size = New System.Drawing.Size(203, 99) + Me.ucrPnlDisplayOptions.TabIndex = 0 + ' 'lblGraphtoUse ' Me.lblGraphtoUse.AutoSize = True - Me.lblGraphtoUse.Location = New System.Drawing.Point(375, 68) - Me.lblGraphtoUse.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblGraphtoUse.Location = New System.Drawing.Point(250, 45) Me.lblGraphtoUse.Name = "lblGraphtoUse" - Me.lblGraphtoUse.Size = New System.Drawing.Size(114, 20) + Me.lblGraphtoUse.Size = New System.Drawing.Size(77, 13) Me.lblGraphtoUse.TabIndex = 1 Me.lblGraphtoUse.Text = "Graph to View:" ' @@ -117,71 +131,49 @@ Partial Class dlgViewGraph ' Me.ucrGraphReceiver.AutoSize = True Me.ucrGraphReceiver.frmParent = Me - Me.ucrGraphReceiver.Location = New System.Drawing.Point(375, 90) + Me.ucrGraphReceiver.Location = New System.Drawing.Point(250, 60) Me.ucrGraphReceiver.Margin = New System.Windows.Forms.Padding(0) Me.ucrGraphReceiver.Name = "ucrGraphReceiver" Me.ucrGraphReceiver.Selector = Nothing - Me.ucrGraphReceiver.Size = New System.Drawing.Size(180, 30) + Me.ucrGraphReceiver.Size = New System.Drawing.Size(120, 20) Me.ucrGraphReceiver.strNcFilePath = "" Me.ucrGraphReceiver.TabIndex = 2 Me.ucrGraphReceiver.ucrSelector = Nothing ' - 'ucrPnlDisplayOptions - ' - Me.ucrPnlDisplayOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrPnlDisplayOptions.Location = New System.Drawing.Point(9, 28) - Me.ucrPnlDisplayOptions.Margin = New System.Windows.Forms.Padding(9) - Me.ucrPnlDisplayOptions.Name = "ucrPnlDisplayOptions" - Me.ucrPnlDisplayOptions.Size = New System.Drawing.Size(304, 148) - Me.ucrPnlDisplayOptions.TabIndex = 0 - ' 'ucrGraphsSelector ' Me.ucrGraphsSelector.AutoSize = True Me.ucrGraphsSelector.bDropUnusedFilterLevels = False Me.ucrGraphsSelector.bShowHiddenColumns = False Me.ucrGraphsSelector.bUseCurrentFilter = True - Me.ucrGraphsSelector.Location = New System.Drawing.Point(15, 15) + Me.ucrGraphsSelector.Location = New System.Drawing.Point(10, 10) Me.ucrGraphsSelector.Margin = New System.Windows.Forms.Padding(0) Me.ucrGraphsSelector.Name = "ucrGraphsSelector" - Me.ucrGraphsSelector.Size = New System.Drawing.Size(320, 274) + Me.ucrGraphsSelector.Size = New System.Drawing.Size(213, 183) Me.ucrGraphsSelector.TabIndex = 0 ' 'ucrBase ' Me.ucrBase.AutoSize = True Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink - Me.ucrBase.Location = New System.Drawing.Point(15, 330) - Me.ucrBase.Margin = New System.Windows.Forms.Padding(6) + Me.ucrBase.Location = New System.Drawing.Point(10, 220) + Me.ucrBase.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) 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 = 4 ' - 'rdoMaximised - ' - Me.rdoMaximised.AutoSize = True - Me.rdoMaximised.Location = New System.Drawing.Point(14, 65) - Me.rdoMaximised.Margin = New System.Windows.Forms.Padding(4) - Me.rdoMaximised.Name = "rdoMaximised" - Me.rdoMaximised.Size = New System.Drawing.Size(164, 24) - Me.rdoMaximised.TabIndex = 4 - Me.rdoMaximised.TabStop = True - Me.rdoMaximised.Text = "Maximised window" - Me.rdoMaximised.UseVisualStyleBackColor = True - ' 'dlgViewGraph ' - 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(706, 414) + Me.ClientSize = New System.Drawing.Size(471, 276) Me.Controls.Add(Me.ucrGraphReceiver) Me.Controls.Add(Me.lblGraphtoUse) Me.Controls.Add(Me.grpDisplayOptions) Me.Controls.Add(Me.ucrGraphsSelector) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow - Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "dlgViewGraph" diff --git a/instat/dlgViewGraph.vb b/instat/dlgViewGraph.vb index 4151d80d9c4..151b125fda4 100644 --- a/instat/dlgViewGraph.vb +++ b/instat/dlgViewGraph.vb @@ -40,6 +40,7 @@ Public Class dlgViewGraph Private Sub InitialiseDialog() ucrBase.iHelpTopicID = 525 + ucrBase.clsRsyntax.bSeparateThread = False 'Selector ucrGraphsSelector.SetParameter(New RParameter("data_name", 0)) @@ -63,7 +64,6 @@ Public Class dlgViewGraph 'todo. Calling print() from this dialog doesn't work. investigate why 'temporarily disabled - rdoRViewer.Enabled = False End Sub Private Sub SetDefaults() @@ -125,8 +125,7 @@ Public Class dlgViewGraph clsGetObjectRFunction.AddParameter("as_file", strParameterValue:="FALSE", iPosition:=2) ucrBase.clsRsyntax.SetBaseRFunction(clsViewObjectRFunction) ElseIf rdoRViewer.Checked Then - 'clsViewObjectRFunction.AddParameter("object", clsRFunctionParameter:=clsGetObjectRFunction) - 'clsViewObjectRFunction.RemoveParameterByName("object_format") + clsGetObjectRFunction.AddParameter("as_file", strParameterValue:="FALSE", iPosition:=2) ucrBase.clsRsyntax.SetBaseRFunction(clsPrintRFunction) End If End Sub diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 3412c05a7b7..73e94dbbbf3 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -1748,6 +1748,10 @@ Public Class frmMain ucrDataViewer.UseColumnSelectionInDataView(bUseColumnSelecion) End Sub + Public Function IsColumnSelectionApplied() As Boolean + Return ucrDataViewer.IsColumnSelectionApplied + End Function + Public Sub SetCurrentDataFrame(strDataName As String) ucrDataViewer.SetCurrentDataFrame(strDataName) ucrColumnMeta.SetCurrentDataFrame(strDataName) diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index b123c0a54eb..c188e3d8f03 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -921,6 +921,36 @@ DataSheet$set("public", "cor", function(x_col_names, y_col_name, use = "everythi } ) +DataSheet$set("public", "update_selection", function(new_values, column_selection_name = NULL) { + if (missing(new_values)) stop("new_values is required") + if (missing(column_selection_name)) stop("column_selection_name is required") + + column_selection_obj <- private$column_selections[[column_selection_name]] + + if (is.null(column_selection_obj)) { + stop("No column selection found with the name: ", column_selection_name) + } + + # Update conditions in the column selection with new values + updated_conditions <- lapply(column_selection_obj$conditions, function(condition) { + # Check if the parameters exist and replace them with new values + if ("parameters" %in% names(condition)) { + condition$parameters$x <- new_values + } + return(condition) + }) + + # Update the column selection object with the new conditions + column_selection_obj$conditions <- updated_conditions + private$column_selections[[column_selection_name]] <- column_selection_obj + + # Optionally, mark data as changed + self$data_changed <- TRUE + + message("Column selection '", column_selection_name, "' updated successfully with new values.") +}) + + DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", new_col_name = "", label = "", type = "single", .fn, .cols = everything(), new_column_names_df, new_labels_df, ...) { curr_data <- self$get_data_frame(use_current_filter = FALSE, use_column_selection = FALSE) @@ -954,8 +984,18 @@ DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", ne purrr::map(.x = keys_to_delete, .f = ~self$remove_key(key_name = names(active_keys[.x]))) } } - if(self$column_selection_applied()) self$remove_current_column_selection() # Need to use private$data here because changing names of data field + names(private$data)[names(curr_data) == curr_col_name] <- new_col_name + + column_names <- self$get_column_names() + + if (anyNA(column_names)) { + column_names[is.na(column_names)] <- new_col_name + } else { + column_names <- new_col_name + } + + self$update_selection(column_names, private$.current_column_selection$name) if(any(c("sfc", "sfc_MULTIPOLYGON") %in% class(private$data[[curr_col_name]]))){ # Update the geometry column reference sf::st_geometry(private$data) <- new_col_name @@ -976,11 +1016,22 @@ DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", ne } else if (type == "multiple") { if (!missing(new_column_names_df)) { new_col_names <- new_column_names_df[, 1] - cols_changed_index <- new_column_names_df[, 2] + cols_changed_index <- which(names(private$data) %in% new_column_names_df[, 2]) curr_col_names <- names(private$data) curr_col_names[cols_changed_index] <- new_col_names if(any(duplicated(curr_col_names))) stop("Cannot rename columns. Column names must be unique.") - if(self$column_selection_applied()) self$remove_current_column_selection() + names(private$data)[cols_changed_index] <- new_col_names + + column_names <- self$get_column_names() + + if (anyNA(column_names)) { + column_names[is.na(column_names)] <- new_col_names + } else { + column_names <- new_col_names + } + + self$update_selection(column_names, private$.current_column_selection$name) + if(any(c("sfc", "sfc_MULTIPOLYGON") %in% class(private$dataprivate$data)[cols_changed_index])){ # Update the geometry column reference sf::st_geometry(private$data) <- new_col_names @@ -1005,19 +1056,29 @@ DataSheet$set("public", "rename_column_in_data", function(curr_col_name = "", ne } else if (type == "rename_with") { if (missing(.fn)) stop(.fn, "is missing with no default.") curr_col_names <- names(curr_data) + column_names <- self$get_column_names() private$data <- curr_data |> dplyr::rename_with( .fn = .fn, .cols = {{ .cols }}, ... ) - if(self$column_selection_applied()) self$remove_current_column_selection() new_col_names <- names(private$data) if (!all(new_col_names %in% curr_col_names)) { new_col_names <- new_col_names[!(new_col_names %in% curr_col_names)] for (i in seq_along(new_col_names)) { self$append_to_variables_metadata(new_col_names[i], name_label, new_col_names[i]) } + + column_names <- self$get_column_names() + if (anyNA(column_names)) { + column_names[is.na(column_names)] <- new_col_names + } else { + column_names <- new_col_names + } + + self$update_selection(column_names, private$.current_column_selection$name) + self$data_changed <- TRUE self$variables_metadata_changed <- TRUE } @@ -1545,7 +1606,7 @@ DataSheet$set("public", "get_data_frame_length", function(use_current_filter = F DataSheet$set("public", "get_factor_data_frame", function(col_name = "", include_levels = TRUE, include_NA_level = FALSE) { if(!(col_name %in% self$get_column_names())) stop(col_name, " is not a column name,") - col_data <- self$get_columns_from_data(col_name, use_current_filter = FALSE) + col_data <- self$get_columns_from_data(col_name, use_current_filter = TRUE) if(!(is.factor(col_data))) stop(col_name, " is not a factor column") counts <- data.frame(table(col_data)) diff --git a/instat/static/InstatObject/R/instat_object_R6.R b/instat/static/InstatObject/R/instat_object_R6.R index 5f7a6c88e45..98e0063279f 100644 --- a/instat/static/InstatObject/R/instat_object_R6.R +++ b/instat/static/InstatObject/R/instat_object_R6.R @@ -2215,12 +2215,10 @@ DataBook$set("public","get_variable_sets", function(data_name, set_names, force_ } ) -DataBook$set("public", "crops_definitions", function(data_name, year, station, rain, day, rain_totals, plant_days, plant_lengths, start_check = TRUE, season_data_name, start_day, end_day, definition_props = TRUE, print_table = TRUE) { - plant_day_name <- "plant_day" - plant_length_name <- "plant_length" - rain_total_name <- "rain_total" - +DataBook$set("public", "crops_definitions", function(data_name, year, station, rain, day, rain_totals, plant_days, plant_lengths, start_check = c("both", "yes", "no"), season_data_name, start_day, end_day, return_crops_table = TRUE, definition_props = TRUE){ + # Run checks is_station <- !missing(station) + start_check <- match.arg(start_check) if(missing(year)) stop("Year column must be specified.") if(!is_station) by <- year @@ -2233,17 +2231,26 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r year_col <- self$get_columns_from_data(data_name, year) unique_year <- na.omit(unique(year_col)) - expand_list <- list(rain_totals, plant_lengths, plant_days, unique_year) - names_list <- c(rain_total_name, plant_length_name, plant_day_name, year) - + # creating our combinations + # if there's a station, we only want to consider the year-station combinations that actually exist if(is_station) { - station_col <- self$get_columns_from_data(data_name, station) - unique_station <- na.omit(unique(station_col)) - expand_list[[length(expand_list) + 1]] <- unique_station - names_list[length(names_list) + 1] <- station + expanded_df <- unique(self$get_data_frame(data_name) %>% dplyr::select(year, station)) + } else { + expanded_df <- unique(self$get_data_frame(data_name) %>% dplyr::select(year)) } - df <- setNames(expand.grid(expand_list), names_list) + # Set names + plant_day_name <- "plant_day" + plant_length_name <- "plant_length" + rain_total_name <- "rain_total" + + # Create all combinations of X and Y + condition_combinations <- expand.grid(rain_totals, plant_lengths, plant_days) + names_list <- c(rain_total_name, plant_length_name, plant_day_name) + condition_combinations <- setNames(condition_combinations, names_list) + + # Expand the df with xy_combinations + df <- merge(expanded_df, condition_combinations, by = NULL) daily_data <- self$get_data_frame(data_name) if(season_data_name != data_name) { @@ -2253,8 +2260,7 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r vars <- c(season_by, start_day, end_day) season_data <- season_data %>% dplyr::select(!!! rlang::syms(vars)) df <- dplyr::left_join(df, season_data, by = join_by) - } - else { + } else { col_names <- c(by, start_day, end_day) season_data <- daily_data %>% dplyr::select(!!! rlang::syms(col_names)) %>% @@ -2264,133 +2270,148 @@ DataBook$set("public", "crops_definitions", function(data_name, year, station, r df <- dplyr::left_join(df, season_data, by = by) } - # Plant day condition - if(start_check %in% c("yes", "both")) { - df$plant_day_cond <- (df[[start_day]] <= df[[plant_day_name]]) - } - - # Plant length condition - df$length_cond <- (df[[plant_day_name]] + df[[plant_length_name]] <= df[[end_day]]) + ## Onto the calculation + proportion_df <- NULL + crops_def_table <- NULL + i <- 1 - # Rain total condition - # Create a column for the rain total actuals initialised with NA - df[["rain_total_actual"]] <- NA + calculate_rain_condition <- function(data){ + data <- data %>% dplyr::select(-rain_total_name) %>% unique() - # Vectorise the conditions for each - for (i in 1:nrow(df)) { - # Create a condition to filter the daily data based on the year, day, and plant day/length - ind <- daily_data[[year]] == df[[year]][i] & - daily_data[[day]] >= df[[plant_day_name]][i] & - daily_data[[day]] < (df[[plant_day_name]][i] + df[[plant_length_name]][i]) + for (i in 1:nrow(data)) { + # Create a condition to filter the daily data based on the year, day, and plant day/length + ind <- daily_data[[year]] == data[[year]][i] & + daily_data[[day]] >= data[[plant_day_name]][i] & + daily_data[[day]] < (data[[plant_day_name]][i] + data[[plant_length_name]][i]) - if (is_station) { - ind <- ind & (daily_data[[station]] == df[[station]][i]) - } + if (is_station) { + ind <- ind & (daily_data[[station]] == data[[station]][i]) + } - # Filter the daily data based on the condition - rain_values <- daily_data[[rain]][ind] + # Filter the daily data based on the condition + rain_values <- daily_data[[rain]][ind] - # Calculate the sum of rain values and check conditions - sum_rain <- sum(rain_values, na.rm = TRUE) + # Calculate the sum of rain values and check conditions + sum_rain <- sum(rain_values, na.rm = TRUE) - if (length(rain_values) + 1 < df[[plant_length_name]][i] || (anyNA(rain_values) && sum_rain < df[[rain_total_name]][i])) { - sum_rain <- NA - } + # Set as NA for certain cases: This anyNA is fixed later when we have the total_rainfall value of interest + if (anyNA(rain_values)) sum_rain <- -1 * sum_rain # as a way to tag the sum_rain value for later, we set as -ve value. + #&& sum_rain < data[[rain_total_name]][i]){ + if (length(rain_values) + 1 < data[[plant_length_name]][i]) sum_rain <- NA + if (all(is.na(rain_values))) sum_rain <- NA - # Assign the calculated sum to the respective row in the result dataframe - df[["rain_total_actual"]][i] <- sum_rain - } - df$rain_cond <- df[[rain_total_name]] <= df[["rain_total_actual"]] - - # All three conditions met - if (start_check == "yes"){ - df$overall_cond <- df$plant_day_cond & df$length_cond & df$rain_cond - } else if (start_check == "no"){ - df$overall_cond <- TRUE & df$length_cond & df$rain_cond - } else { - df$overall_cond_with_start <- df$plant_day_cond & df$length_cond & df$rain_cond - df$overall_cond_no_start <- TRUE & df$length_cond & df$rain_cond - } - - crops_name <- "crop_def" - crops_name <- next_default_item(prefix = crops_name, existing_names = self$get_data_names(), include_index = FALSE) - data_tables <- list(df) - names(data_tables) <- crops_name - self$import_data(data_tables = data_tables) + # Assign the calculated sum to the respective row in the result dataframe + data[["rain_total_actual"]][i] <- sum_rain + } + return(data) +} - if(season_data_name != data_name) { - crops_by <- season_by - names(crops_by) <- by - self$add_link(crops_name, season_data_name, crops_by, keyed_link_label) - } - - if(definition_props) { - calc_from <- list() - if(!missing(station)) calc_from[[length(calc_from) + 1]] <- station - calc_from[[length(calc_from) + 1]] <- plant_day_name - calc_from[[length(calc_from) + 1]] <- plant_length_name - calc_from[[length(calc_from) + 1]] <- rain_total_name - names(calc_from) <- rep(crops_name, length(calc_from)) - grouping <- instat_calculation$new(type = "by", calculated_from = calc_from) - - if (start_check %in% c("yes", "no")){ - prop_calc_from <- list("overall_cond") - names(prop_calc_from) <- crops_name - propor_table <- instat_calculation$new(function_exp="sum(overall_cond, na.rm = TRUE)/length(na.omit(overall_cond))", - save = 2, calculated_from = prop_calc_from, - manipulations = list(grouping), - type="summary", result_name = "prop_success", result_data_frame = "crop_prop") - prop_data_frame <- self$run_instat_calculation(propor_table, display = TRUE) - if(print_table) { - prop_data_frame$prop_success <- round(prop_data_frame$prop_success, 2) - prop_table_unstacked <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame, value.var = "prop_success") - if(!missing(station)) f <- interaction(prop_table_unstacked[[station]], prop_table_unstacked[[plant_length_name]], lex.order = TRUE) - else f <- prop_table_unstacked[[plant_length_name]] - prop_table_split <- split(prop_table_unstacked, f) - return(prop_table_split) - } - } else { - prop_calc_from_with_start <- list("overall_cond_with_start") - names(prop_calc_from_with_start) <- crops_name - propor_table_with_start <- instat_calculation$new(function_exp="sum(overall_cond_with_start, na.rm = TRUE)/length(na.omit(overall_cond_with_start))", - save = 2, calculated_from = prop_calc_from_with_start, - manipulations = list(grouping), - type="summary", result_name = "prop_success", result_data_frame = "crop_prop_with_start") - prop_data_frame_with_start <- self$run_instat_calculation(propor_table_with_start, display = TRUE) + # run by plant day and plant_length + for (day_i in plant_days){ + for (length_i in plant_lengths){ - prop_calc_from_no_start <- list("overall_cond_no_start") - names(prop_calc_from_no_start) <- crops_name - propor_table_no_start <- instat_calculation$new(function_exp="sum(overall_cond_no_start, na.rm = TRUE)/length(na.omit(overall_cond_no_start))", - save = 2, calculated_from = prop_calc_from_no_start, - manipulations = list(grouping), - type="summary", result_name = "prop_success", result_data_frame = "crop_prop_no_start") - prop_data_frame_no_start <- self$run_instat_calculation(propor_table_no_start, display = TRUE) + # for each plant length and plant day combination, calculate the total rainfall in that period. + filtered_data_1 <- df %>% filter(plant_day == day_i) %>% filter(plant_length == length_i) - if(print_table) { - prop_data_frame_with_start$prop_success <- round(prop_data_frame_with_start$prop_success, 2) - prop_table_unstacked_with_start <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame_with_start, value.var = "prop_success") - if(!missing(station)) f <- interaction(prop_table_unstacked_with_start[[station]], prop_table_unstacked_with_start[[plant_length_name]], lex.order = TRUE) - else f <- prop_table_unstacked_with_start[[plant_length_name]] - prop_table_split_with_start <- split(prop_table_unstacked_with_start, f) - - prop_data_frame_no_start$prop_success <- round(prop_data_frame_no_start$prop_success, 2) - prop_table_unstacked_no_start <- reshape2::dcast(formula = as.formula(paste(if(!missing(station)) paste(station, "+"), plant_length_name, "+", rain_total_name, "~", plant_day_name)), data = prop_data_frame_no_start, value.var = "prop_success") - if(!missing(station)) f <- interaction(prop_table_unstacked_no_start[[station]], prop_table_unstacked_no_start[[plant_length_name]], lex.order = TRUE) - else f <- prop_table_unstacked_no_start[[plant_length_name]] - prop_table_split_no_start <- split(prop_table_unstacked_no_start, f) + # Now run to get the rain conditions + filtered_data_1 <- calculate_rain_condition(data = filtered_data_1) + + # so: filtered_data_1 contains the total rainfall that occurred in that period for all the plant_day and plant_length combinations + # we now split by our different rain_total_actual conditions. + # we do this here to avoid calculating it multiple times. + for (rain_i in rain_totals){ + filtered_data <- filtered_data_1 %>% dplyr::mutate(rain_total = rain_i) + + # take the rows < 0 and run a check. We want to check + # if (anyNA(rain_values) && sum_rain < data[[rain_total_name]][i]) { sum_rain <- NA + # we do this here because we want to avoid running rain_total in calculate_rain_condition for efficiency purposes. + filtered_data <- filtered_data %>% + dplyr::mutate(rain_total_actual = ifelse(rain_total_actual < 0, ifelse(-1*rain_total_actual < rain_total, NA, -1*rain_total_actual), rain_total_actual)) + + if (!missing(station)) filtered_data <- filtered_data %>% dplyr::group_by(.data[[station]], .data[[year]]) + else filtered_data <- filtered_data %>% dplyr::group_by(.data[[year]]) - # Create an empty list to store the merged data - merged_list <- list() + filtered_data <- filtered_data %>% + # first add a column (T/F) that states that it is in the rainfall period or not. + dplyr::mutate(plant_day_cond = .data[[start_day]] <= plant_day, + length_cond = plant_day + plant_length <= .data[[end_day]], + rain_cond = rain_i <= rain_total_actual) %>% + dplyr::ungroup() + + if (start_check == "both"){ + + filtered_data <- filtered_data %>% + dplyr::mutate( + overall_cond_with_start = plant_day_cond & length_cond & rain_cond, + overall_cond_no_start = length_cond & rain_cond) + if (!missing(station)) filtered_data <- filtered_data %>% dplyr::group_by(.data[[station]]) + proportion_data <- filtered_data %>% + dplyr::summarise(prop_success_with_start = sum(overall_cond_with_start, na.rm = TRUE)/length(na.omit(overall_cond_with_start)), + prop_success_no_start = sum(overall_cond_no_start, na.rm = TRUE)/length(na.omit(overall_cond_no_start))) + } else { + filtered_data <- filtered_data %>% + dplyr::mutate( + overall_cond = case_when( + start_check == "yes" ~ plant_day_cond & length_cond & rain_cond, + start_check == "no" ~ TRUE & length_cond & rain_cond) + ) + if (!missing(station)) filtered_data <- filtered_data %>% dplyr::group_by(.data[[station]]) + proportion_data <- filtered_data %>% + dplyr::summarise(prop_success = sum(overall_cond, na.rm = TRUE)/length(na.omit(overall_cond))) + } - # Vectorize the addition of source indicators and merging of data frames - prop_table_split_with_start <- lapply(prop_table_split_with_start, function(df) { - df$source <- 'with start' - return(df) - }) + if (return_crops_table){ + crops_def_table[[i]] <- filtered_data %>% dplyr::mutate(rain_total = rain_i, + plant_length = length_i, + plant_day = day_i) + } + if (definition_props){ + proportion_df[[i]] <- proportion_data %>% dplyr::mutate(rain_total = rain_i, + plant_length = length_i, + plant_day = day_i) + } + i <- i + 1 } } } -}) + + if (!missing(station)) column_order <- c(station, plant_day_name, plant_length_name, rain_total_name) + else column_order <- c(plant_day_name, plant_length_name, rain_total_name) + + if (return_crops_table){ + # here we get crop_def and import it as a new DF + crops_def_table <- dplyr::bind_rows(crops_def_table) %>% dplyr::select(c(all_of(column_order), everything())) %>% dplyr::arrange(dplyr::across(dplyr::all_of(column_order))) + crops_name <- "crop_def" + crops_name <- next_default_item(prefix = crops_name, existing_names = self$get_data_names(), include_index = FALSE) + data_tables <- list(crops_def_table) + names(data_tables) <- crops_name + if(season_data_name != data_name) { + crops_by <- season_by + names(crops_by) <- by + self$add_link(crops_name, season_data_name, crops_by, keyed_link_label) + } + self$import_data(data_tables = data_tables) + } + if (definition_props){ + prop_data_frame <- dplyr::bind_rows(proportion_df) %>% dplyr::select(c(all_of(column_order), everything())) %>% dplyr::arrange(dplyr::across(dplyr::all_of(column_order))) + + prop_name <- "crop_prop" + prop_name <- next_default_item(prefix = prop_name, existing_names = self$get_data_names(), include_index = FALSE) + data_tables <- list(prop_data_frame) + names(data_tables) <- prop_name + self$import_data(data_tables = data_tables) + + # Add Link + if (return_crops_table){ + if (!missing(station)){ + self$add_link(from_data_frame = crops_name, to_data_frame = prop_name, link_pairs=c(station = station, rain_total = rain_total_name, plant_length = plant_length_name, plant_day = plant_day_name), type="keyed_link") + } else { + self$add_link(from_data_frame = crops_name, to_data_frame = prop_name, link_pairs=c(rain_total = rain_total_name, plant_length = plant_length_name, plant_day = plant_day_name), type="keyed_link") + } + } + } +} +) #' Converting grid (wide) format daily climatic data into tidy (long format) data #' @param x Input data frame diff --git a/instat/ucrColumnMetadata.Designer.vb b/instat/ucrColumnMetadata.Designer.vb index 23b0067bd9c..301a3b4519b 100644 --- a/instat/ucrColumnMetadata.Designer.vb +++ b/instat/ucrColumnMetadata.Designer.vb @@ -49,7 +49,6 @@ Partial Class ucrColumnMetadata Me.unhideSheet = New System.Windows.Forms.ToolStripMenuItem() Me.copySheet = New System.Windows.Forms.ToolStripMenuItem() Me.reorderSheet = New System.Windows.Forms.ToolStripMenuItem() - Me.viewSheet = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator() Me.mnuHelp2 = New System.Windows.Forms.ToolStripMenuItem() Me.propertiesContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) @@ -82,6 +81,7 @@ Partial Class ucrColumnMetadata Me.columnContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator() Me.mnuHelp1 = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator() Me.cellContextMenuStrip.SuspendLayout() Me.statusColumnMenu.SuspendLayout() Me.propertiesContextMenuStrip.SuspendLayout() @@ -105,9 +105,9 @@ Partial Class ucrColumnMetadata 'statusColumnMenu ' Me.statusColumnMenu.ImageScalingSize = New System.Drawing.Size(20, 20) - Me.statusColumnMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.deleteDataFrame, Me.renameSheet, Me.mnuBottomAddComment, Me.hideSheet, Me.unhideSheet, Me.copySheet, Me.reorderSheet, Me.viewSheet, Me.ToolStripSeparator4, Me.mnuHelp2}) + Me.statusColumnMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.renameSheet, Me.reorderSheet, Me.copySheet, Me.deleteDataFrame, Me.hideSheet, Me.unhideSheet, Me.ToolStripSeparator5, Me.mnuBottomAddComment, Me.ToolStripSeparator4, Me.mnuHelp2}) Me.statusColumnMenu.Name = "statusColumnMenu" - Me.statusColumnMenu.Size = New System.Drawing.Size(181, 230) + Me.statusColumnMenu.Size = New System.Drawing.Size(181, 214) ' 'deleteDataFrame ' @@ -151,12 +151,6 @@ Partial Class ucrColumnMetadata Me.reorderSheet.Size = New System.Drawing.Size(180, 22) Me.reorderSheet.Text = "Reorder..." ' - 'viewSheet - ' - Me.viewSheet.Name = "viewSheet" - Me.viewSheet.Size = New System.Drawing.Size(180, 22) - Me.viewSheet.Text = "View Data Frame" - ' 'ToolStripSeparator4 ' Me.ToolStripSeparator4.Name = "ToolStripSeparator4" @@ -373,6 +367,11 @@ Partial Class ucrColumnMetadata Me.mnuHelp1.Size = New System.Drawing.Size(214, 22) Me.mnuHelp1.Text = "Help" ' + 'ToolStripSeparator5 + ' + Me.ToolStripSeparator5.Name = "ToolStripSeparator5" + Me.ToolStripSeparator5.Size = New System.Drawing.Size(177, 6) + ' 'ucrColumnMetadata ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -403,7 +402,6 @@ Partial Class ucrColumnMetadata Friend WithEvents unhideSheet As ToolStripMenuItem Friend WithEvents copySheet As ToolStripMenuItem Friend WithEvents reorderSheet As ToolStripMenuItem - Friend WithEvents viewSheet As ToolStripMenuItem Friend WithEvents mnuBottomAddComment As ToolStripMenuItem Friend WithEvents ucrLinuxGrid As ucrColumnMetadataLinuxGrid Friend WithEvents ucrReoGrid As ucrColumnMetadataReoGrid @@ -433,4 +431,5 @@ Partial Class ucrColumnMetadata Friend WithEvents mnuHelp1 As ToolStripMenuItem Friend WithEvents ToolStripSeparator4 As ToolStripSeparator Friend WithEvents mnuHelp2 As ToolStripMenuItem + Friend WithEvents ToolStripSeparator5 As ToolStripSeparator End Class diff --git a/instat/ucrColumnMetadata.vb b/instat/ucrColumnMetadata.vb index 2d102ea97c4..f7df8f6fc14 100644 --- a/instat/ucrColumnMetadata.vb +++ b/instat/ucrColumnMetadata.vb @@ -473,12 +473,6 @@ Public Class ucrColumnMetadata dlgCopyDataFrame.ShowDialog() End Sub - Private Sub viewSheet_Click(sender As Object, e As EventArgs) Handles viewSheet.Click - StartWait() - GetCurrentDataFrameFocus().clsPrepareFunctions.ViewDataFrame() - EndWait() - End Sub - Private Sub reorderSheet_Click(sender As Object, e As EventArgs) Handles reorderSheet.Click dlgReorderDataFrame.ShowDialog() End Sub diff --git a/instat/ucrDataFrameMetadata.Designer.vb b/instat/ucrDataFrameMetadata.Designer.vb index 94ceb188edc..371422d6c61 100644 --- a/instat/ucrDataFrameMetadata.Designer.vb +++ b/instat/ucrDataFrameMetadata.Designer.vb @@ -50,12 +50,12 @@ Partial Class ucrDataFrameMetadata Me.unhideSheet = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripSeparator11 = New System.Windows.Forms.ToolStripSeparator() Me.mnuAddComment = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuViewHTML = New System.Windows.Forms.ToolStripMenuItem() - Me.viewSheet = New System.Windows.Forms.ToolStripMenuItem() Me.lblHeaderDataFrameMetaData = New System.Windows.Forms.Label() Me.tlpTableContainer = New System.Windows.Forms.TableLayoutPanel() Me.ucrLinuxGrid = New instat.ucrDataframeMetadataLinuxGrid() Me.ucrReoGrid = New instat.ucrDataframeMetadataReoGrid() + Me.HelpToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() Me.cellContextMenuStrip.SuspendLayout() Me.rowRightClickMenu.SuspendLayout() Me.tlpTableContainer.SuspendLayout() @@ -77,71 +77,58 @@ Partial Class ucrDataFrameMetadata 'rowRightClickMenu ' Me.rowRightClickMenu.ImageScalingSize = New System.Drawing.Size(20, 20) - Me.rowRightClickMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.renameSheet, Me.reorderSheet, Me.copySheet, Me.deleteDataFrame, Me.hideSheet, Me.unhideSheet, Me.ToolStripSeparator11, Me.mnuAddComment, Me.mnuViewHTML, Me.viewSheet}) + Me.rowRightClickMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.renameSheet, Me.reorderSheet, Me.copySheet, Me.deleteDataFrame, Me.hideSheet, Me.unhideSheet, Me.ToolStripSeparator1, Me.mnuAddComment, Me.ToolStripSeparator11, Me.HelpToolStripMenuItem}) Me.rowRightClickMenu.Name = "statusColumnMenu" - Me.rowRightClickMenu.Size = New System.Drawing.Size(163, 208) + Me.rowRightClickMenu.Size = New System.Drawing.Size(181, 214) ' 'renameSheet ' Me.renameSheet.Name = "renameSheet" - Me.renameSheet.Size = New System.Drawing.Size(162, 22) + Me.renameSheet.Size = New System.Drawing.Size(180, 22) Me.renameSheet.Text = "Rename..." ' 'reorderSheet ' Me.reorderSheet.Enabled = False Me.reorderSheet.Name = "reorderSheet" - Me.reorderSheet.Size = New System.Drawing.Size(162, 22) + Me.reorderSheet.Size = New System.Drawing.Size(180, 22) Me.reorderSheet.Text = "Reorder..." ' 'copySheet ' Me.copySheet.Name = "copySheet" - Me.copySheet.Size = New System.Drawing.Size(162, 22) + Me.copySheet.Size = New System.Drawing.Size(180, 22) Me.copySheet.Text = "Copy..." ' 'deleteDataFrame ' Me.deleteDataFrame.Name = "deleteDataFrame" - Me.deleteDataFrame.Size = New System.Drawing.Size(162, 22) + Me.deleteDataFrame.Size = New System.Drawing.Size(180, 22) Me.deleteDataFrame.Text = "Delete..." ' 'hideSheet ' Me.hideSheet.Name = "hideSheet" - Me.hideSheet.Size = New System.Drawing.Size(162, 22) + Me.hideSheet.Size = New System.Drawing.Size(180, 22) Me.hideSheet.Text = "Hide" ' 'unhideSheet ' Me.unhideSheet.Name = "unhideSheet" - Me.unhideSheet.Size = New System.Drawing.Size(162, 22) + Me.unhideSheet.Size = New System.Drawing.Size(180, 22) Me.unhideSheet.Text = "Unhide..." ' 'ToolStripSeparator11 ' Me.ToolStripSeparator11.Name = "ToolStripSeparator11" - Me.ToolStripSeparator11.Size = New System.Drawing.Size(159, 6) + Me.ToolStripSeparator11.Size = New System.Drawing.Size(177, 6) ' 'mnuAddComment ' Me.mnuAddComment.Name = "mnuAddComment" - Me.mnuAddComment.Size = New System.Drawing.Size(162, 22) + Me.mnuAddComment.Size = New System.Drawing.Size(180, 22) Me.mnuAddComment.Text = "Add Comment..." ' - 'mnuViewHTML - ' - Me.mnuViewHTML.Enabled = False - Me.mnuViewHTML.Name = "mnuViewHTML" - Me.mnuViewHTML.Size = New System.Drawing.Size(162, 22) - Me.mnuViewHTML.Text = "View HTML" - ' - 'viewSheet - ' - Me.viewSheet.Name = "viewSheet" - Me.viewSheet.Size = New System.Drawing.Size(162, 22) - Me.viewSheet.Text = "View Data Frame" - ' 'lblHeaderDataFrameMetaData ' Me.lblHeaderDataFrameMetaData.BackColor = System.Drawing.Color.FromArgb(CType(CType(35, Byte), Integer), CType(CType(105, Byte), Integer), CType(CType(190, Byte), Integer)) @@ -192,6 +179,17 @@ Partial Class ucrDataFrameMetadata Me.ucrReoGrid.Size = New System.Drawing.Size(324, 381) Me.ucrReoGrid.TabIndex = 9 ' + 'HelpToolStripMenuItem + ' + Me.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem" + Me.HelpToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.HelpToolStripMenuItem.Text = "Help" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(177, 6) + ' 'ucrDataFrameMetadata ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) @@ -217,10 +215,10 @@ Partial Class ucrDataFrameMetadata Friend WithEvents unhideSheet As ToolStripMenuItem Friend WithEvents copySheet As ToolStripMenuItem Friend WithEvents reorderSheet As ToolStripMenuItem - Friend WithEvents viewSheet As ToolStripMenuItem Friend WithEvents mnuAddComment As ToolStripMenuItem Friend WithEvents ucrLinuxGrid As ucrDataframeMetadataLinuxGrid Friend WithEvents ucrReoGrid As ucrDataframeMetadataReoGrid - Friend WithEvents mnuViewHTML As ToolStripMenuItem Friend WithEvents ToolStripSeparator11 As ToolStripSeparator + Friend WithEvents ToolStripSeparator1 As ToolStripSeparator + Friend WithEvents HelpToolStripMenuItem As ToolStripMenuItem End Class diff --git a/instat/ucrDataFrameMetadata.vb b/instat/ucrDataFrameMetadata.vb index 821ff413084..29d90deadfe 100644 --- a/instat/ucrDataFrameMetadata.vb +++ b/instat/ucrDataFrameMetadata.vb @@ -200,16 +200,6 @@ Public Class ucrDataFrameMetadata dlgCopyDataFrame.ShowDialog() End Sub - Private Sub viewSheet_Click(sender As Object, e As EventArgs) Handles viewSheet.Click - Dim strScript As String = "" - Dim strTemp As String - clsGetDataFrame.AddParameter("data_name", Chr(34) & GetSelectedDataframeNameFromSelectedRow() & Chr(34), iPosition:=0) - clsViewDataFrame.AddParameter("x", clsRFunctionParameter:=clsGetDataFrame, iPosition:=0) - clsGetDataFrame.SetAssignTo(GetSelectedDataframeNameFromSelectedRow) - strTemp = clsViewDataFrame.ToScript(strScript) - RunScriptFromDataFrameMetadata(strScript & strTemp, strComment:="Right click menu: View R Data Frame", bSeparateThread:=False) - End Sub - Private Sub reorderSheet_Click(sender As Object, e As EventArgs) Handles reorderSheet.Click dlgReorderDataFrame.ShowDialog() End Sub @@ -222,4 +212,8 @@ Public Class ucrDataFrameMetadata dlgAddComment.SetPosition(strDataFrame:=_grid.CurrentWorksheet.Name) dlgAddComment.ShowDialog() End Sub + + Private Sub HelpToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HelpToolStripMenuItem.Click + Help.ShowHelp(Me, frmMain.strStaticPath & "\" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "544") + End Sub End Class \ No newline at end of file diff --git a/instat/ucrDataView.vb b/instat/ucrDataView.vb index 6eb153dd69c..ebd14bf4db0 100644 --- a/instat/ucrDataView.vb +++ b/instat/ucrDataView.vb @@ -466,6 +466,10 @@ Public Class ucrDataView End If End Sub + Public Function IsColumnSelectionApplied() As Boolean + Return GetCurrentDataFrameFocus().clsFilterOrColumnSelection.bColumnSelectionApplied + End Function + Private Function GetSelectedColumns() As List(Of clsColumnHeaderDisplay) Return _grid.GetSelectedColumns() End Function