Commit 8419f5a1f9f020f2f946ef5793488c1c13aaef69
1 parent
7139db83
Exists in
special-params
Allow use of special params in all modules
Showing
7 changed files
with
42 additions
and
8 deletions
Show diff stats
js/app/views/DownloadUI.js
... | ... | @@ -416,6 +416,7 @@ Ext.define('amdaUI.DownloadUI', { |
416 | 416 | (record.get('nodeType') == 'remoteSimuParam') || |
417 | 417 | (record.get('nodeType') == 'derivedParam') || |
418 | 418 | (record.get('nodeType') == 'myDataParam') || |
419 | + (record.get('nodeType') == 'specialParam') || | |
419 | 420 | (record.get('nodeType') == 'alias')) && |
420 | 421 | (record.isLeaf() || record.get('isParameter')) && |
421 | 422 | !record.get('disable')) |
... | ... | @@ -436,8 +437,9 @@ Ext.define('amdaUI.DownloadUI', { |
436 | 437 | case 'localParam' : |
437 | 438 | case 'remoteParam': |
438 | 439 | case 'remoteSimuParam': |
440 | + case 'specialParam': | |
439 | 441 | idToSent = record.get('id'); |
440 | - if (record.get('alias') != "") | |
442 | + if (record.get('alias') && (record.get('alias') != "")) | |
441 | 443 | idToSent = "#" + record.get('alias'); |
442 | 444 | var component_info = record.get('component_info'); |
443 | 445 | if (component_info && component_info.parentId) |
... | ... |
js/app/views/ParamArgumentsUI.js
... | ... | @@ -498,6 +498,28 @@ Ext.define('amdaUI.ParamArgumentsUI', { |
498 | 498 | |
499 | 499 | me.add(argumentField); |
500 | 500 | break; |
501 | + case 'int' : | |
502 | + var argumentField = Ext.create('Ext.form.NumberField', { | |
503 | + argId: 'template_' + key, | |
504 | + fieldLabel: argument.name, | |
505 | + allowDecimals : false, | |
506 | + allowBlank : false, | |
507 | + value: parseInt(argument.default), | |
508 | + listeners: { | |
509 | + change: function(field, newValue, oldValue, eOpts) { | |
510 | + var template_args = me.paramRequestObject.get('template_args'); | |
511 | + if (!template_args) | |
512 | + template_args = {}; | |
513 | + template_args[key] = newValue; | |
514 | + me.paramRequestObject.set('template_args', template_args); | |
515 | + if (!this.inRebuild && (me.onChange != null)) | |
516 | + me.onChange(uiScope, key, newValue, oldValue, true); | |
517 | + }, | |
518 | + scope: me | |
519 | + } | |
520 | + }); | |
521 | + me.add(argumentField); | |
522 | + break; | |
501 | 523 | case 'list' : |
502 | 524 | var items = []; |
503 | 525 | Ext.Object.each(argument.items, function (itemKey, itemName) { |
... | ... |
js/app/views/ParameterUI.js
... | ... | @@ -352,7 +352,7 @@ Ext.define('amdaUI.ParameterUI', |
352 | 352 | case 'remoteSimuParam' : |
353 | 353 | case 'specialParam' : |
354 | 354 | nameToSent = data.records[0].get('id'); |
355 | - if (data.records[0].get('alias')!= "" ) | |
355 | + if (data.records[0].get('alias') && (data.records[0].get('alias')!= "")) | |
356 | 356 | var nameToSent = "#"+data.records[0].get('alias'); |
357 | 357 | var component_info = data.records[0].get('component_info'); |
358 | 358 | if (component_info && component_info.parentId) |
... | ... |
js/app/views/PlotComponents/PlotTree.js
... | ... | @@ -556,7 +556,8 @@ Ext.define('amdaPlotComp.PlotTree', { |
556 | 556 | return record.get('leaf'); |
557 | 557 | case 'amdaModel.LocalParamNode' : |
558 | 558 | case 'amdaModel.RemoteParamNode' : |
559 | - case 'amdaModel.RemoteSimuParamNode' : | |
559 | + case 'amdaModel.RemoteSimuParamNode' : | |
560 | + case 'amdaModel.SpecialParamNode' : | |
560 | 561 | return record.get('isParameter') && ! record.get('disable'); |
561 | 562 | |
562 | 563 | case 'amdaModel.DerivedParamNode' : |
... | ... | @@ -686,10 +687,11 @@ Ext.define('amdaPlotComp.PlotTree', { |
686 | 687 | case 'amdaModel.LocalParamNode' : |
687 | 688 | case 'amdaModel.RemoteParamNode' : |
688 | 689 | case 'amdaModel.RemoteSimuParamNode' : |
690 | + case 'amdaModel.SpecialParamNode' : | |
689 | 691 | if (!record.get('isParameter') || record.get('disable')) |
690 | 692 | return false; |
691 | 693 | |
692 | - if (record.get('alias') != "") | |
694 | + if (record.get('alias') && (record.get('alias') != "")) | |
693 | 695 | this.dropParamToCreate(targetNode, position, "#" + record.get('alias')); |
694 | 696 | else { |
695 | 697 | var isVector = record.get('iconCls') == 'icon-vector'; |
... | ... |
js/app/views/SearchUI.js
... | ... | @@ -346,6 +346,7 @@ Ext.define('amdaUI.SearchUI', |
346 | 346 | (data.records[0].get('nodeType') == 'remoteSimuParam') || |
347 | 347 | (data.records[0].get('nodeType') == 'derivedParam') || |
348 | 348 | (data.records[0].get('nodeType') == 'myDataParam') || |
349 | + (data.records[0].get('nodeType') == 'specialParam') || | |
349 | 350 | (data.records[0].get('nodeType') == 'alias')) && |
350 | 351 | (data.records[0].isLeaf() || data.records[0].get('isParameter')) && |
351 | 352 | !data.records[0].data.disable) |
... | ... | @@ -367,9 +368,10 @@ Ext.define('amdaUI.SearchUI', |
367 | 368 | { |
368 | 369 | case 'localParam' : |
369 | 370 | case 'remoteParam' : |
370 | - case 'remoteSimuParam' : | |
371 | + case 'remoteSimuParam' : | |
372 | + case 'specialParam' : | |
371 | 373 | nameToSent = data.records[0].get('id'); |
372 | - if (data.records[0].get('alias')!= "" ) | |
374 | + if (data.records[0].get('alias') && (data.records[0].get('alias')!= "") ) | |
373 | 375 | nameToSent = "#"+data.records[0].get('alias'); |
374 | 376 | var component_info = data.records[0].get('component_info'); |
375 | 377 | if (component_info && component_info.parentId) |
... | ... |
js/app/views/StatisticsUI.js
... | ... | @@ -348,6 +348,7 @@ Ext.define('amdaUI.StatisticsUI', |
348 | 348 | (data.records[0].data.nodeType == 'remoteSimuParam') || |
349 | 349 | (data.records[0].data.nodeType == 'derivedParam') || |
350 | 350 | (data.records[0].data.nodeType == 'myDataParam') || |
351 | + (data.records[0].data.nodeType == 'specialParam') || | |
351 | 352 | (data.records[0].data.nodeType == 'alias')) && |
352 | 353 | (data.records[0].isLeaf() || data.records[0].data.isParameter) && |
353 | 354 | !data.records[0].data.disable) |
... | ... | @@ -371,8 +372,9 @@ Ext.define('amdaUI.StatisticsUI', |
371 | 372 | case 'localParam' : |
372 | 373 | case 'remoteParam': |
373 | 374 | case 'remoteSimuParam': |
375 | + case 'specialParam' : | |
374 | 376 | nameToSent = data.records[0].get('id'); |
375 | - if (data.records[0].get('alias') != "") | |
377 | + if (data.records[0].get('alias') && (data.records[0].get('alias') != "")) | |
376 | 378 | var nameToSent = "#" + data.records[0].get('alias'); |
377 | 379 | var component_info = data.records[0].get('component_info'); |
378 | 380 | if (component_info && component_info.parentId) |
... | ... |
php/classes/AmdaAction.php
... | ... | @@ -156,6 +156,7 @@ class AmdaAction |
156 | 156 | $rank = null; |
157 | 157 | $skip = FALSE; |
158 | 158 | $last_update = 0; |
159 | + $needsArgs = FALSE; | |
159 | 160 | |
160 | 161 | switch ($nodeType) |
161 | 162 | { |
... | ... | @@ -217,6 +218,9 @@ class AmdaAction |
217 | 218 | if ($child->hasAttribute('description')) { |
218 | 219 | $info = $child->getAttribute('description'); |
219 | 220 | } |
221 | + $needsArgs = FALSE; | |
222 | + if ($child->hasAttribute('TemplatedParameter')) | |
223 | + $needsArgs = true; | |
220 | 224 | break; |
221 | 225 | |
222 | 226 | case 'localParam': |
... | ... | @@ -593,7 +597,7 @@ class AmdaAction |
593 | 597 | $childrenToReturn[] = array('text' => $name, 'id' => $id, 'nodeType' => $nodeType, 'info' => $info, |
594 | 598 | 'help' => $help, 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'dim_1' => $dim_1, 'dim_2' => $dim_2, |
595 | 599 | 'component_info' => isset($component_info) ? $component_info : NULL, |
596 | - 'iconCls' => isset($iconCls) ? $iconCls : NULL, 'last_update' => $last_update ); | |
600 | + 'iconCls' => isset($iconCls) ? $iconCls : NULL, 'last_update' => $last_update, 'needsArgs' => $needsArgs ); | |
597 | 601 | } |
598 | 602 | } |
599 | 603 | // if $childrenToReturn we have to return [] |
... | ... |