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