DerivedParamNode.js
2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* Project : AMDA-NG4
* Name : DerivedParamNode.js
* @class amdaModel.DerivedParamNode
* @extends amdaModel.InteractiveNode
* @brief Model of Node corresponding to a derived parameter
* @author CDA
* @version $Id: DerivedParamNode.js 2544 2014-10-03 10:21:56Z elena $
*/
Ext.define('amdaModel.DerivedParamNode', {
extend: 'amdaModel.InteractiveNode',
requires:[],
statics:{
nodeType: 'derivedParam',
objectName: 'Parameter'
},
constructor : function(config){
this.callParent(arguments);
this.set('moduleId',myDesktopApp.dynamicModules.param.id);
this.set('objectDataModel',amdaModel.Parameter.$className);
this.set('ownerTreeId',amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);
if (this.get('isParameter')) {
console.log(this);
if( (this.get('dim_1') == 3 && this.get('dim_2') == 1) || (this.get('dim_1') == 1 && this.get('dim_2') == 3)){
this.set('iconCls', 'icon-vector');
} else if ( (this.get('dim_1') > 1 && this.get('dim_2') >=1)|| (this.get('dim_1') >=1 && this.get('dim_2') >1)) {
this.set('iconCls','icon-spectra');
} else {
this.set('iconCls', 'icon-unknowntype');
}
}
},
localMenuItems : function() {
var menuItems =
[{
fnId : 'leaf-plotParam',
text : 'Plot Parameter',
hidden : true
}, {
fnId : 'leaf-downParam',
text : 'Download Parameter',
hidden : true
}];
return menuItems;
},
getAllContextMenuItems: function(){
var menuItems = this.allMenuItems();
var locMenuItems = this.localMenuItems();
return Ext.Array.merge(menuItems,locMenuItems);
},
isParameter : function(){
return this.get('isParameter');
},
specialUpdate : function(res, timeUpdate) {
if (this.get('isParameter')) {
console.log(this);
if( (this.get('dim_1') == 3 && this.get('dim_2') == 1) || (this.get('dim_1') == 1 && this.get('dim_2') == 3)){
this.set('iconCls', 'icon-vector');
} else if ((this.get('dim_1') > 1 && this.get('dim_2') >= 1)|| (this.get('dim_1') >= 1 && this.get('dim_2') >1)) {
this.set('iconCls','icon-spectra');
} else {
this.set('iconCls', 'icon-unknowntype');
}
}
}
});