diff --git a/instat/dlgApsimx.Designer.vb b/instat/dlgApsimx.Designer.vb new file mode 100644 index 00000000000..b01e2a045df --- /dev/null +++ b/instat/dlgApsimx.Designer.vb @@ -0,0 +1,55 @@ + _ +Partial Class dlgApsimx + Inherits System.Windows.Forms.Form + + 'Form remplace la méthode Dispose pour nettoyer la liste des composants. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Requise par le Concepteur Windows Form + Private components As System.ComponentModel.IContainer + + 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form + 'Elle peut être modifiée à l'aide du Concepteur Windows Form. + 'Ne la modifiez pas à l'aide de l'éditeur de code. + _ + Private Sub InitializeComponent() + Me.ucrBase = New instat.ucrButtons() + Me.SuspendLayout() + ' + 'ucrBase + ' + Me.ucrBase.AutoSize = True + Me.ucrBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink + Me.ucrBase.Location = New System.Drawing.Point(12, 255) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(408, 52) + Me.ucrBase.TabIndex = 1 + ' + 'dlgApsimx + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(433, 310) + Me.Controls.Add(Me.ucrBase) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "dlgApsimx" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Apsimx" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents ucrBase As ucrButtons +End Class diff --git a/instat/dlgApsimx.resx b/instat/dlgApsimx.resx new file mode 100644 index 00000000000..1af7de150c9 --- /dev/null +++ b/instat/dlgApsimx.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/instat/dlgApsimx.vb b/instat/dlgApsimx.vb new file mode 100644 index 00000000000..35a703db725 --- /dev/null +++ b/instat/dlgApsimx.vb @@ -0,0 +1,41 @@ +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . + +Imports instat.Translations +Public Class dlgApsimx + Public bFirstLoad As Boolean = True + Private Sub dlgApsimx_Load(sender As Object, e As EventArgs) Handles MyBase.Load + If bFirstLoad Then + InitialiseDialog() + SetDefaults() + bFirstLoad = False + End If + TestOKEnabled() + autoTranslate(Me) + End Sub + + Private Sub InitialiseDialog() + ucrBase.iHelpTopicID = 479 + End Sub + + Private Sub TestOKEnabled() + + End Sub + + Private Sub SetDefaults() + TestOKEnabled() + End Sub +End Class \ No newline at end of file diff --git a/instat/frmMain.Designer.vb b/instat/frmMain.Designer.vb index b5ea7130746..47be79c119d 100644 --- a/instat/frmMain.Designer.vb +++ b/instat/frmMain.Designer.vb @@ -647,6 +647,7 @@ Partial Class frmMain Me.mnuOptionsByContextModel = New System.Windows.Forms.ToolStripMenuItem() Me.mnuOptionsByContextModelFitModel = New System.Windows.Forms.ToolStripMenuItem() Me.mnuOptionsByContextGeneralFitModel = New System.Windows.Forms.ToolStripMenuItem() + Me.mnuOptionsByContextCropModel = New System.Windows.Forms.ToolStripMenuItem() Me.mnuTools = New System.Windows.Forms.ToolStripMenuItem() Me.mnuToolsRunRCode = New System.Windows.Forms.ToolStripMenuItem() Me.mnuToolsRestartR = New System.Windows.Forms.ToolStripMenuItem() @@ -675,7 +676,6 @@ Partial Class frmMain Me.mnuDataFrameMetadata = New System.Windows.Forms.ToolStripMenuItem() Me.mnuScriptFile = New System.Windows.Forms.ToolStripMenuItem() Me.mnuLogFile = New System.Windows.Forms.ToolStripMenuItem() - Me.mnuOptionsByContextCropModel = New System.Windows.Forms.ToolStripMenuItem() Me.stsStrip.SuspendLayout() Me.Tool_strip.SuspendLayout() Me.mnuBar.SuspendLayout() @@ -4763,15 +4763,22 @@ Partial Class frmMain 'mnuOptionsByContextModelFitModel ' Me.mnuOptionsByContextModelFitModel.Name = "mnuOptionsByContextModelFitModel" - Me.mnuOptionsByContextModelFitModel.Size = New System.Drawing.Size(180, 22) + Me.mnuOptionsByContextModelFitModel.Size = New System.Drawing.Size(176, 22) Me.mnuOptionsByContextModelFitModel.Text = "Fit Model..." ' 'mnuOptionsByContextGeneralFitModel ' Me.mnuOptionsByContextGeneralFitModel.Name = "mnuOptionsByContextGeneralFitModel" - Me.mnuOptionsByContextGeneralFitModel.Size = New System.Drawing.Size(180, 22) + Me.mnuOptionsByContextGeneralFitModel.Size = New System.Drawing.Size(176, 22) Me.mnuOptionsByContextGeneralFitModel.Text = "General Fit Model..." ' + 'mnuOptionsByContextCropModel + ' + Me.mnuOptionsByContextCropModel.Name = "mnuOptionsByContextCropModel" + Me.mnuOptionsByContextCropModel.Size = New System.Drawing.Size(180, 22) + Me.mnuOptionsByContextCropModel.Text = "Crop Model..." + Me.mnuOptionsByContextCropModel.Visible = False + ' 'mnuTools ' Me.mnuTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuToolsRunRCode, Me.mnuToolsRestartR, Me.mnuToolsCheckForUpdates, Me.mnuToolsClearOutputWindow, Me.ToolStripSeparator5, Me.mnuToolsSaveCurrentOptions, Me.mnuToolsLoadOptions, Me.mnuToolsInstallRPackage, Me.mnuToolsOptions}) @@ -5067,13 +5074,6 @@ Partial Class frmMain Me.mnuLogFile.Text = "Log Window..." Me.mnuLogFile.ToolTipText = "Log Window" ' - 'mnuOptionsByContextCropModel - ' - Me.mnuOptionsByContextCropModel.Enabled = False - Me.mnuOptionsByContextCropModel.Name = "mnuOptionsByContextCropModel" - Me.mnuOptionsByContextCropModel.Size = New System.Drawing.Size(180, 22) - Me.mnuOptionsByContextCropModel.Text = "Crop Model..." - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) diff --git a/instat/frmMain.vb b/instat/frmMain.vb index 107106dd4e7..d385183ca1e 100644 --- a/instat/frmMain.vb +++ b/instat/frmMain.vb @@ -2462,4 +2462,8 @@ Public Class frmMain dlgPICSARainfall.enumPICSAMode = dlgPICSARainfall.PICSAMode.General dlgPICSARainfall.ShowDialog() End Sub + + Private Sub mnuOptionsByContextCropModel_Click(sender As Object, e As EventArgs) Handles mnuOptionsByContextCropModel.Click + dlgApsimx.ShowDialog() + End Sub End Class diff --git a/instat/instat.vbproj b/instat/instat.vbproj index a94538d14b0..95d60983ab5 100644 --- a/instat/instat.vbproj +++ b/instat/instat.vbproj @@ -189,6 +189,12 @@ + + dlgApsimx.vb + + + Form + dlgClusterAnalysis.vb @@ -2881,6 +2887,9 @@ + + dlgApsimx.vb + dlgAugment.vb diff --git a/instat/static/InstatObject/R/data_object_R6.R b/instat/static/InstatObject/R/data_object_R6.R index 014745ea214..e6fd3d3d018 100644 --- a/instat/static/InstatObject/R/data_object_R6.R +++ b/instat/static/InstatObject/R/data_object_R6.R @@ -1788,6 +1788,13 @@ DataSheet$set("public", "get_filter_as_logical", function(filter_name) { } else { result[, i] <- !col_is_na } + } else if (condition[["operation"]] == "is.empty" || condition[["operation"]] == "! is.empty"){ + col_is_empty <- self$get_columns_from_data(condition[["column"]], use_current_filter = FALSE) == "" + if (condition[["operation"]] == "is.empty") { + result[, i] <- col_is_empty + } else { + result[, i] <- !col_is_empty + } } else { func <- match.fun(condition[["operation"]]) diff --git a/instat/translations/rInstatTranslations.db b/instat/translations/rInstatTranslations.db index daa297210b3..30a7d99bd2e 100644 Binary files a/instat/translations/rInstatTranslations.db and b/instat/translations/rInstatTranslations.db differ diff --git a/instat/ucrFilter.Designer.vb b/instat/ucrFilter.Designer.vb index 98438d08284..b3feecbea98 100644 --- a/instat/ucrFilter.Designer.vb +++ b/instat/ucrFilter.Designer.vb @@ -435,11 +435,21 @@ Partial Class ucrFilter Me.cmdCombineWithAndOr.Text = "All Combined with &&" Me.cmdCombineWithAndOr.UseVisualStyleBackColor = True ' + 'ucrFactorLevels + ' + Me.ucrFactorLevels.AutoSize = True + Me.ucrFactorLevels.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.ucrFactorLevels.Location = New System.Drawing.Point(398, 65) + Me.ucrFactorLevels.Margin = New System.Windows.Forms.Padding(5) + Me.ucrFactorLevels.Name = "ucrFactorLevels" + Me.ucrFactorLevels.Size = New System.Drawing.Size(354, 262) + Me.ucrFactorLevels.TabIndex = 2 + ' 'ucrReceiverExpression ' Me.ucrReceiverExpression.AutoSize = True Me.ucrReceiverExpression.frmParent = Nothing - Me.ucrReceiverExpression.Location = New System.Drawing.Point(456, 44) + Me.ucrReceiverExpression.Location = New System.Drawing.Point(480, 44) Me.ucrReceiverExpression.Margin = New System.Windows.Forms.Padding(5) Me.ucrReceiverExpression.Name = "ucrReceiverExpression" Me.ucrReceiverExpression.Selector = Nothing @@ -454,7 +464,7 @@ Partial Class ucrFilter Me.ucrLogicalCombobox.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrLogicalCombobox.GetSetSelectedIndex = -1 Me.ucrLogicalCombobox.IsReadOnly = False - Me.ucrLogicalCombobox.Location = New System.Drawing.Point(456, 44) + Me.ucrLogicalCombobox.Location = New System.Drawing.Point(478, 43) Me.ucrLogicalCombobox.Margin = New System.Windows.Forms.Padding(7, 6, 7, 6) Me.ucrLogicalCombobox.Name = "ucrLogicalCombobox" Me.ucrLogicalCombobox.Size = New System.Drawing.Size(89, 21) @@ -465,7 +475,7 @@ Partial Class ucrFilter Me.ucrDatePicker.AutoSize = True Me.ucrDatePicker.DateValue = New Date(2021, 7, 7, 8, 39, 9, 171) Me.ucrDatePicker.Format = "dd MMM yyyy" - Me.ucrDatePicker.Location = New System.Drawing.Point(457, 44) + Me.ucrDatePicker.Location = New System.Drawing.Point(478, 43) Me.ucrDatePicker.Margin = New System.Windows.Forms.Padding(5) Me.ucrDatePicker.MaxDate = New Date(9998, 12, 31, 0, 0, 0, 0) Me.ucrDatePicker.MinDate = New Date(1753, 1, 1, 0, 0, 0, 0) @@ -503,22 +513,12 @@ Partial Class ucrFilter Me.ucrFilterOperation.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink Me.ucrFilterOperation.GetSetSelectedIndex = -1 Me.ucrFilterOperation.IsReadOnly = False - Me.ucrFilterOperation.Location = New System.Drawing.Point(399, 44) + Me.ucrFilterOperation.Location = New System.Drawing.Point(399, 43) Me.ucrFilterOperation.Margin = New System.Windows.Forms.Padding(7, 6, 7, 6) Me.ucrFilterOperation.Name = "ucrFilterOperation" - Me.ucrFilterOperation.Size = New System.Drawing.Size(56, 21) + Me.ucrFilterOperation.Size = New System.Drawing.Size(78, 21) Me.ucrFilterOperation.TabIndex = 5 ' - 'ucrFactorLevels - ' - Me.ucrFactorLevels.AutoSize = True - Me.ucrFactorLevels.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle - Me.ucrFactorLevels.Location = New System.Drawing.Point(398, 65) - Me.ucrFactorLevels.Margin = New System.Windows.Forms.Padding(5) - Me.ucrFactorLevels.Name = "ucrFactorLevels" - Me.ucrFactorLevels.Size = New System.Drawing.Size(354, 262) - Me.ucrFactorLevels.TabIndex = 2 - ' 'ucrFilterByReceiver ' Me.ucrFilterByReceiver.AutoSize = True diff --git a/instat/ucrFilter.vb b/instat/ucrFilter.vb index 7525433c7dc..67479a88d8f 100644 --- a/instat/ucrFilter.vb +++ b/instat/ucrFilter.vb @@ -62,7 +62,7 @@ Public Class ucrFilter Private Sub InitialiseControl() ucrFilterPreview.txtInput.ReadOnly = True ucrFilterByReceiver.Selector = ucrSelectorForFitler - ucrFilterOperation.SetItems({"==", "<", "<=", ">", ">=", "!=", "is.na", "! is.na"}) + ucrFilterOperation.SetItems({"==", "<", "<=", ">", ">=", "!=", "is.na", "! is.na", "is.empty", "! is.empty"}) ucrFilterOperation.SetDropDownStyleAsNonEditable() ucrFactorLevels.SetAsMultipleSelectorGrid(ucrFilterByReceiver, @@ -116,7 +116,7 @@ Public Class ucrFilter SetToggleButtonSettings() Else ucrFilterOperation.Visible = True - If ucrFilterOperation.GetText() <> "is.na" AndAlso ucrFilterOperation.GetText() <> "! is.na" Then + If ucrFilterOperation.GetText() <> "is.na" AndAlso ucrFilterOperation.GetText() <> "! is.na" AndAlso ucrFilterOperation.GetText() <> "is.empty" AndAlso ucrFilterOperation.GetText() <> "! is.empty" Then Select Case ucrFilterByReceiver.strCurrDataType.ToLower Case "logical" ucrLogicalCombobox.Visible = True @@ -139,7 +139,7 @@ Public Class ucrFilter cmdAddCondition.Enabled = ucrFactorLevels.IsAnyGridRowSelected Else Select Case ucrFilterOperation.GetText() - Case "is.na", "! is.na" + Case "is.na", "! is.na", "is.empty", "! is.empty" cmdAddCondition.Enabled = True Case Else Select Case ucrFilterByReceiver.strCurrDataType.ToLower @@ -172,7 +172,7 @@ Public Class ucrFilter Private Sub ucrFilterReceiver_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrFilterByReceiver.ControlContentsChanged 'for logical columns add {"==", "is.na", "!is.na"} only Dim selectedIndex As Integer = ucrFilterOperation.GetSetSelectedIndex - ucrFilterOperation.SetItems(If(ucrFilterByReceiver.strCurrDataType.ToLower = "logical", {"==", "is.na", "! is.na"}, {"==", "<", "<=", ">", ">=", "!=", "is.na", "! is.na"})) + ucrFilterOperation.SetItems(If(ucrFilterByReceiver.strCurrDataType.ToLower = "logical", {"==", "is.na", "! is.na"}, {"==", "<", "<=", ">", ">=", "!=", "is.na", "! is.na", "is.empty", "! is.empty"})) If ucrFilterByReceiver.strCurrDataType.ToLower IsNot "logical" AndAlso selectedIndex < ucrFilterOperation.GetItemsCount Then ucrFilterOperation.GetSetSelectedIndex = selectedIndex Else @@ -208,7 +208,7 @@ Public Class ucrFilter Else clsCurrentOperator.SetOperation(ucrFilterOperation.GetText()) clsCurrentConditionListFunction.AddParameter("operation", Chr(34) & ucrFilterOperation.GetText() & Chr(34)) - If ucrFilterOperation.GetText() = "is.na" OrElse ucrFilterOperation.GetText() = "! is.na" Then + If ucrFilterOperation.GetText() = "is.na" OrElse ucrFilterOperation.GetText() = "! is.na" OrElse ucrFilterOperation.GetText() = "is.empty" OrElse ucrFilterOperation.GetText() = "! is.empty" Then strCondition = "" Else If ucrFilterByReceiver.strCurrDataType.ToLower = "character" Then