Commit dc9e2c14c16c8f60a4bdb9874f0c16d78c11913d
1 parent
5ad6fd38
Exists in
master
and in
106 other branches
init + message + 2D icon
Showing
6 changed files
with
36 additions
and
22 deletions
Show diff stats
js/app/models/LocalParamNode.js
js/app/models/PlotObjects/PlotParamObject.js
js/app/views/ParamArgumentsUI.js
... | ... | @@ -19,7 +19,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { |
19 | 19 | onChange: null, |
20 | 20 | onModifyHeight: null, |
21 | 21 | pluginOwner: null, |
22 | - | |
22 | + isFirstMsg : true, | |
23 | 23 | // -1 -> unknown, 0 -> scalar, 1 -> Tab1D, 2 -> Tab2D |
24 | 24 | paramType: 0, |
25 | 25 | |
... | ... | @@ -58,12 +58,12 @@ Ext.define('amdaUI.ParamArgumentsUI', { |
58 | 58 | } |
59 | 59 | else |
60 | 60 | me.unmask(); |
61 | + | |
61 | 62 | }, |
62 | 63 | |
63 | 64 | rebuildAll: function(paramInfoResult , uiScope) { |
64 | 65 | //Rebuild arguments selection |
65 | 66 | this.rebuildArguments(paramInfoResult, uiScope); |
66 | - | |
67 | 67 | //Set parameter type (scalar, vector or Tab2D) |
68 | 68 | this.paramRequestObject.set('type', this.paramType); |
69 | 69 | |
... | ... | @@ -212,41 +212,42 @@ Ext.define('amdaUI.ParamArgumentsUI', { |
212 | 212 | indexes.push({'key' : component.index_2, 'value' : index + ' : ' + component.name}); |
213 | 213 | }); |
214 | 214 | } |
215 | - | |
215 | + | |
216 | 216 | //Add combo box |
217 | 217 | var indexesStore = Ext.create('Ext.data.Store', { |
218 | 218 | fields: ['key', 'value'], |
219 | 219 | data : indexes |
220 | 220 | }); |
221 | 221 | |
222 | - if (relatedDim == "dim2" ) | |
223 | - var comboValue = indexesStore.getAt(1); | |
224 | - else | |
225 | - var comboValue = indexesStore.first(); | |
226 | - | |
227 | 222 | var indexesCombo = Ext.create('Ext.form.ComboBox', { |
228 | 223 | fieldLabel: title, |
229 | 224 | store: indexesStore, |
230 | 225 | queryMode: 'local', |
231 | 226 | displayField: 'value', |
232 | 227 | valueField: 'key', |
233 | - value: comboValue, | |
228 | + value: '*', | |
234 | 229 | editable: false, |
235 | 230 | argId: relatedDim, |
236 | 231 | hidden: (relatedTable ? relatedTable.variable : false), |
237 | 232 | listeners: { |
238 | - beforeselect: function(cb, record) { | |
239 | - if (cb.argId == 'dim2' && cb.previousSibling().getValue() == '*' && record.get('key') == '*') { | |
240 | - alert('NEVER'); | |
241 | - return false; | |
242 | - } | |
243 | - if (cb.argId == 'dim1' && record.get('key') == '*' && cb.nextSibling() instanceof Ext.form.ComboBox && cb.nextSibling().getValue() == '*') { | |
244 | - alert('NEVER'); | |
245 | - return false; | |
246 | - } | |
247 | - }, | |
248 | 233 | change: function(field, newValue, oldValue, eOpts) { |
249 | - this.paramRequestObject.set(relatedDim+'-index', newValue); | |
234 | + if (this.paramRequestObject.get('type') == '2' && this.isFirstMsg) | |
235 | + { | |
236 | + if (field.argId == 'dim2' && newValue == '*') { | |
237 | + var previousCombo = field.previousSibling(); | |
238 | + | |
239 | + if (previousCombo instanceof Ext.form.FieldSet) | |
240 | + previousCombo = previousCombo.previousSibling(); | |
241 | + | |
242 | + if (previousCombo instanceof Ext.form.ComboBox && previousCombo.argId == 'dim1' && previousCombo.getValue() == '*' && !previousCombo.isDisabled()) { | |
243 | + myDesktopApp.warningMsg('If argument <i>All</i> is set for both dimensions output will be the total sum <b>(not spectra!)</b>'); | |
244 | + this.isFirstMsg = false; | |
245 | + } | |
246 | + | |
247 | + } | |
248 | + } | |
249 | + | |
250 | + this.paramRequestObject.set(relatedDim+'-index', newValue); | |
250 | 251 | if (this.onChange != null) |
251 | 252 | this.onChange(uiScope, relatedDim, newValue, oldValue, false); |
252 | 253 | }, | ... | ... |
js/resources/css/amda.css
... | ... | @@ -329,6 +329,12 @@ background-image: url(../images/16x16/error.png) !important; |
329 | 329 | background-repeat: no-repeat; |
330 | 330 | } |
331 | 331 | |
332 | +.icon-2dspectra { | |
333 | + background-image:url(../images/16x16/circle_orange2_.png) !important; | |
334 | + background-position: center; | |
335 | + background-repeat: no-repeat; | |
336 | +} | |
337 | + | |
332 | 338 | .icon-unknowntype { |
333 | 339 | background-image:url(../images/14x14/circle_grey.png) !important; |
334 | 340 | background-position: center; | ... | ... |
913 Bytes
php/classes/AmdaAction.php
... | ... | @@ -218,6 +218,7 @@ class AmdaAction |
218 | 218 | $isParameter = false; |
219 | 219 | $needsArgs = false; |
220 | 220 | $isSpectra = false; |
221 | + $is2dSpectra = false; | |
221 | 222 | $isStack = false; |
222 | 223 | $not_yet = false; |
223 | 224 | |
... | ... | @@ -290,6 +291,8 @@ class AmdaAction |
290 | 291 | if ($child->getAttribute('display_type') == 'spectrogram') { |
291 | 292 | $needsArgs = true; |
292 | 293 | $isSpectra = true; |
294 | + if (strpos($child->getAttribute('name'),'2D') !== false) | |
295 | + $is2dSpectra = true; | |
293 | 296 | } |
294 | 297 | elseif ($child->getAttribute('display_type') == 'stackplot') { |
295 | 298 | $isStack = true; |
... | ... | @@ -303,8 +306,8 @@ class AmdaAction |
303 | 306 | $childrenToReturn[] = array('text' => $name,'alias' => $alias, |
304 | 307 | 'id' => $id,'nodeType' => $nodeType, 'info' => $info, "component_info" => $component_info, |
305 | 308 | 'globalStart' => $globalStart, 'globalStop' => $globalStop, 'timeRestriction' => $timeRestriction, |
306 | - 'leaf' => $isLeaf, 'isParameter' => $isParameter, | |
307 | - 'isSpectra' => $isSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet); | |
309 | + 'leaf' => $isLeaf, 'isParameter' => $isParameter,'isSpectra' => $isSpectra, | |
310 | + 'is2dSpectra' => $is2dSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet); | |
308 | 311 | } |
309 | 312 | else { |
310 | 313 | if ($child->tagName == 'mission' || $child->tagName == 'observatory') { | ... | ... |