From dc9e2c14c16c8f60a4bdb9874f0c16d78c11913d Mon Sep 17 00:00:00 2001 From: Elena.Budnik Date: Fri, 8 Feb 2019 16:42:22 +0100 Subject: [PATCH] init + message + 2D icon --- js/app/models/LocalParamNode.js | 3 +++ js/app/models/PlotObjects/PlotParamObject.js | 1 + js/app/views/ParamArgumentsUI.js | 41 +++++++++++++++++++++-------------------- js/resources/css/amda.css | 6 ++++++ js/resources/images/16x16/circle_orange2_.png | Bin 0 -> 913 bytes php/classes/AmdaAction.php | 7 +++++-- 6 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 js/resources/images/16x16/circle_orange2_.png diff --git a/js/app/models/LocalParamNode.js b/js/app/models/LocalParamNode.js index a699f72..acb0035 100644 --- a/js/app/models/LocalParamNode.js +++ b/js/app/models/LocalParamNode.js @@ -65,6 +65,9 @@ Ext.define('amdaModel.LocalParamNode', if (this.get('isStack') || this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); + + if (this.get('is2dSpectra')) + this.set('iconCls', 'icon-2dspectra'); } }, diff --git a/js/app/models/PlotObjects/PlotParamObject.js b/js/app/models/PlotObjects/PlotParamObject.js index 975cd5f..ea0e9dc 100644 --- a/js/app/models/PlotObjects/PlotParamObject.js +++ b/js/app/models/PlotObjects/PlotParamObject.js @@ -28,6 +28,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { ], fields : [ + {name: 'dim2-index', type: 'string', defaultValue: '0'}, {name: 'param-drawing-type', type: 'string'}, {name: 'param-drawing-object', type: 'auto'} ], diff --git a/js/app/views/ParamArgumentsUI.js b/js/app/views/ParamArgumentsUI.js index b891ca7..046a806 100644 --- a/js/app/views/ParamArgumentsUI.js +++ b/js/app/views/ParamArgumentsUI.js @@ -19,7 +19,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { onChange: null, onModifyHeight: null, pluginOwner: null, - + isFirstMsg : true, // -1 -> unknown, 0 -> scalar, 1 -> Tab1D, 2 -> Tab2D paramType: 0, @@ -58,12 +58,12 @@ Ext.define('amdaUI.ParamArgumentsUI', { } else me.unmask(); + }, rebuildAll: function(paramInfoResult , uiScope) { //Rebuild arguments selection this.rebuildArguments(paramInfoResult, uiScope); - //Set parameter type (scalar, vector or Tab2D) this.paramRequestObject.set('type', this.paramType); @@ -212,41 +212,42 @@ Ext.define('amdaUI.ParamArgumentsUI', { indexes.push({'key' : component.index_2, 'value' : index + ' : ' + component.name}); }); } - + //Add combo box var indexesStore = Ext.create('Ext.data.Store', { fields: ['key', 'value'], data : indexes }); - if (relatedDim == "dim2" ) - var comboValue = indexesStore.getAt(1); - else - var comboValue = indexesStore.first(); - var indexesCombo = Ext.create('Ext.form.ComboBox', { fieldLabel: title, store: indexesStore, queryMode: 'local', displayField: 'value', valueField: 'key', - value: comboValue, + value: '*', editable: false, argId: relatedDim, hidden: (relatedTable ? relatedTable.variable : false), listeners: { - beforeselect: function(cb, record) { - if (cb.argId == 'dim2' && cb.previousSibling().getValue() == '*' && record.get('key') == '*') { - alert('NEVER'); - return false; - } - if (cb.argId == 'dim1' && record.get('key') == '*' && cb.nextSibling() instanceof Ext.form.ComboBox && cb.nextSibling().getValue() == '*') { - alert('NEVER'); - return false; - } - }, change: function(field, newValue, oldValue, eOpts) { - this.paramRequestObject.set(relatedDim+'-index', newValue); + if (this.paramRequestObject.get('type') == '2' && this.isFirstMsg) + { + if (field.argId == 'dim2' && newValue == '*') { + var previousCombo = field.previousSibling(); + + if (previousCombo instanceof Ext.form.FieldSet) + previousCombo = previousCombo.previousSibling(); + + if (previousCombo instanceof Ext.form.ComboBox && previousCombo.argId == 'dim1' && previousCombo.getValue() == '*' && !previousCombo.isDisabled()) { + myDesktopApp.warningMsg('If argument All is set for both dimensions output will be the total sum (not spectra!)'); + this.isFirstMsg = false; + } + + } + } + + this.paramRequestObject.set(relatedDim+'-index', newValue); if (this.onChange != null) this.onChange(uiScope, relatedDim, newValue, oldValue, false); }, diff --git a/js/resources/css/amda.css b/js/resources/css/amda.css index 35817fc..c5dbd87 100644 --- a/js/resources/css/amda.css +++ b/js/resources/css/amda.css @@ -329,6 +329,12 @@ background-image: url(../images/16x16/error.png) !important; background-repeat: no-repeat; } +.icon-2dspectra { + background-image:url(../images/16x16/circle_orange2_.png) !important; + background-position: center; + background-repeat: no-repeat; +} + .icon-unknowntype { background-image:url(../images/14x14/circle_grey.png) !important; background-position: center; diff --git a/js/resources/images/16x16/circle_orange2_.png b/js/resources/images/16x16/circle_orange2_.png new file mode 100644 index 0000000..932117d Binary files /dev/null and b/js/resources/images/16x16/circle_orange2_.png differ diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index fece986..876007c 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -218,6 +218,7 @@ class AmdaAction $isParameter = false; $needsArgs = false; $isSpectra = false; + $is2dSpectra = false; $isStack = false; $not_yet = false; @@ -290,6 +291,8 @@ class AmdaAction if ($child->getAttribute('display_type') == 'spectrogram') { $needsArgs = true; $isSpectra = true; + if (strpos($child->getAttribute('name'),'2D') !== false) + $is2dSpectra = true; } elseif ($child->getAttribute('display_type') == 'stackplot') { $isStack = true; @@ -303,8 +306,8 @@ class AmdaAction $childrenToReturn[] = array('text' => $name,'alias' => $alias, 'id' => $id,'nodeType' => $nodeType, 'info' => $info, "component_info" => $component_info, 'globalStart' => $globalStart, 'globalStop' => $globalStop, 'timeRestriction' => $timeRestriction, - 'leaf' => $isLeaf, 'isParameter' => $isParameter, - 'isSpectra' => $isSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet); + 'leaf' => $isLeaf, 'isParameter' => $isParameter,'isSpectra' => $isSpectra, + 'is2dSpectra' => $is2dSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet); } else { if ($child->tagName == 'mission' || $child->tagName == 'observatory') { -- libgit2 0.21.2