Commit bafc2a526a8ea2bbffbb6529ab59ee83cda4601a

Authored by Elena.Budnik
1 parent 5bc01d75
Exists in alias

icon Cls for alias

js/app/models/AliasNode.js
... ... @@ -20,7 +20,10 @@ Ext.define('amdaModel.AliasNode', {
20 20  
21 21 constructor : function(config) {
22 22 this.callParent(arguments);
23   - if (this.get('leaf')) this.set('iconCls', 'icon-scalar');
  23 +// if (this.get('leaf'))
  24 +// this.set('iconCls', 'icon-scalar');
  25 + if (this.get('leaf') && (!this.get('iconCls') || this.get('iconCls') == ""))
  26 + this.set('iconCls', 'icon-scalar');
24 27 },
25 28  
26 29 allMenuItems : function() {
... ... @@ -41,9 +44,9 @@ Ext.define('amdaModel.AliasNode', {
41 44 return menuItems;
42 45 },
43 46  
44   - create: function(alias, param, component_info) {
  47 + create: function(alias, param, component_info, iconCls) {
45 48 //if (!Ext.Object.isEmpty(component_info)))
46   - AmdaAction.createObject({ name: alias, param: param, component_info : component_info,
  49 + AmdaAction.createObject({ name: alias, param: param, component_info : component_info, iconCls : iconCls,
47 50 nodeType:amdaModel.AliasNode.nodeType, leaf:true }, null,
48 51 function(result, e){
49 52 var t = e.getTransaction();
... ... @@ -61,6 +64,7 @@ Ext.define('amdaModel.AliasNode', {
61 64 // set the tooltip
62 65 this.set('info', param);
63 66 this.set('component_info',component_info);
  67 + this.set('iconCls',iconCls);
64 68 }
65 69 } else {
66 70 // EXCEPTION :
... ... @@ -75,7 +79,7 @@ Ext.define('amdaModel.AliasNode', {
75 79 },this);
76 80 },
77 81  
78   - renameNode: function(old_alias,alias, param) {
  82 + renameNode: function(old_alias, alias, param) {
79 83 AmdaAction.renameObject({id : param, old_name: old_alias, name: alias,
80 84 parent : this.parentNode.get('id'), leaf: this.isLeaf(), nodeType: this.get('nodeType')},
81 85 function(result, e){
... ...
js/app/models/PlotObjects/PlotPanelObject.js
... ... @@ -298,7 +298,8 @@ Ext.define('amdaPlotObj.PlotPanelObject', {
298 298 var isTTCat = (typeof data !== "undefined") && (typeof data.isTTCat !== "undefined") && data.isTTCat;
299 299 var isVector = (typeof data !== "undefined") && (typeof data.isVector !== "undefined") && data.isVector;
300 300 var components = (typeof data !== "undefined") && (typeof data.components !== "undefined") && data.components ? data.components : null;
301   -
  301 + var realparamid = (typeof data !== "undefined") && (typeof data.realparamid !== "undefined") ? data.realparamid : null;
  302 +
302 303 this.set('last-param-id', this.get('last-param-id') + 1);
303 304  
304 305 var emptyPanel = (this.params().getCount() == 0);
... ... @@ -323,7 +324,10 @@ Ext.define('amdaPlotObj.PlotPanelObject', {
323 324 recs[0].set('real-type', 1);
324 325 }
325 326 }
326   -
  327 + if (realparamid) {
  328 + recs[0].set('real-paramid',realparamid); // aliases
  329 + }
  330 +
327 331 recs[0].set('param-type', isTTCat ? 'ttcat' : 'param');
328 332 if (isTTCat) {
329 333 recs[0].set('param-ttcat-name', data.name);
... ...
js/app/views/AliasUI.js
... ... @@ -122,6 +122,7 @@ Ext.define('amdaUI.AliasUI',{
122 122 var alias = this.aliasField.value;
123 123 var param = this.parameterField.value;
124 124 var component_info = this.paramNode.get('component_info');
  125 + var iconClass = this.paramNode.get('iconCls');
125 126 // now validation
126 127 if (this.validate(alias,param)) {
127 128 if (isNew) {
... ... @@ -131,7 +132,7 @@ Ext.define('amdaUI.AliasUI',{
131 132 }
132 133 else {
133 134 // create alias
134   - this.linkedNode.create(alias, param, component_info);
  135 + this.linkedNode.create(alias, param, component_info, iconClass);
135 136 this.updateConstruct(param,"#"+alias);
136 137 }
137 138 }
... ...
js/app/views/PlotComponents/PlotTree.js
... ... @@ -711,15 +711,15 @@ Ext.define('amdaPlotComp.PlotTree', {
711 711 //It's a component
712 712 components = [];
713 713 components['paramId'] = component_info.parentId;
714   -
  714 +
715 715 if (component_info.index1)
716 716 components['index1'] = component_info.index1;
717 717  
718 718 if (component_info.index2)
719 719 components['index2'] = component_info.index2;
720 720 }
721   -
722   - this.dropParamToCreate(targetNode, position, "#" + record.get('text'), { 'components': components });
  721 +
  722 + this.dropParamToCreate(targetNode, position, "#" + record.get('text'), { 'components': components, 'realparamid' : record.get('info') });
723 723 return true;
724 724 case 'amdaModel.DerivedParamNode' :
725 725 if (!record.get('isParameter'))
... ...
php/classes/AliasMgr.php
... ... @@ -10,7 +10,7 @@ class AliasMgr extends AmdaObjectMgr {
10 10 parent::__construct('Alias.xml');
11 11 $this->contentRootId = 'alias-treeRootNode';
12 12 $this->contentRootTag = 'aliasList';
13   - $this->attributes = array('name' => '', 'param' => '');
  13 + $this->attributes = array('name' => '', 'param' => '', 'iconCls' => '');
14 14 $this->objTagName = 'alias';
15 15 if (!file_exists($this->xmlName)) {
16 16 $this->createDom();
... ...