Commit 1c007ca23aaedb54a3397a7ca380d2d489598371
1 parent
12547118
Exists in
master
and in
109 other branches
vector icon for MyDataParam + delete obsolete isScatter
Showing
2 changed files
with
206 additions
and
218 deletions
Show diff stats
js/app/models/MyDataParamNode.js
... | ... | @@ -5,10 +5,7 @@ |
5 | 5 | * @extends amdaModel.InteractiveNode |
6 | 6 | * @brief |
7 | 7 | * @author |
8 | - * @version $Id: MyDataParamNode.js 2683 2014-12-02 10:58:53Z elena $ | |
9 | - ******************************************************************************* | |
10 | - * FT Id : Date : Name - Description | |
11 | - ******************************************************************************* | |
8 | + * @version $Id: MyDataParamNode.js 2683 2014-12-02 10:58:53Z elena | |
12 | 9 | */ |
13 | 10 | |
14 | 11 | Ext.define('amdaModel.MyDataParamNode', { |
... | ... | @@ -27,225 +24,226 @@ Ext.define('amdaModel.MyDataParamNode', { |
27 | 24 | objectName : 'Parameter' |
28 | 25 | }, |
29 | 26 | |
30 | - constructor : function(config) | |
31 | - { | |
32 | - this.callParent(arguments); | |
33 | - this.set('moduleId',myDesktopApp.dynamicModules.my_data.id); | |
34 | - this.set('objectDataModel','amdaModel.FileParamObject'); | |
35 | - if (this.get('isParameter')) { | |
36 | - if (this.get('size') == 1) this.set('iconCls', 'icon-scalar'); | |
37 | - else this.set('iconCls', 'icon-unknowntype'); | |
38 | - } | |
39 | - //TODO this.set('iconCls', 'icon-vector'); | |
40 | - if (this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); | |
41 | - }, | |
27 | + constructor : function(config) | |
28 | + { | |
29 | + this.callParent(arguments); | |
30 | + this.set('moduleId',myDesktopApp.dynamicModules.my_data.id); | |
31 | + this.set('objectDataModel','amdaModel.FileParamObject'); | |
32 | + if (this.get('isParameter')) { | |
33 | + if (this.get('size') == 1) | |
34 | + this.set('iconCls', 'icon-scalar'); | |
35 | + else if (this.get('size') == 3) | |
36 | + this.set('iconCls', 'icon-vector'); | |
37 | + else | |
38 | + this.set('iconCls', 'icon-unknowntype'); | |
39 | + } | |
40 | + if (this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); | |
41 | + }, | |
42 | 42 | |
43 | - localMenuItems : function() | |
44 | - { | |
45 | - var menuItems = | |
46 | - [{ | |
47 | - fnId : 'root-upload', | |
48 | - text : 'Upload File', | |
49 | - hidden : true | |
50 | - }, { | |
51 | - fnId : 'dire-upload', | |
52 | - text : 'Upload File', | |
53 | - hidden : true | |
54 | - }, { | |
55 | - fnId : 'leaf-upload', | |
56 | - text : 'Upload File', | |
57 | - hidden : true | |
58 | - },{ | |
59 | - fnId : 'leaf-plotParam', | |
60 | - text : 'Plot Parameter', | |
61 | - hidden : true | |
62 | - }, { | |
63 | - fnId : 'leaf-downParam', | |
64 | - text : 'Download Parameter', | |
65 | - hidden : true | |
66 | - }, { | |
67 | - fnId : 'para-plotParam', | |
68 | - text : 'Plot Parameter', | |
69 | - hidden : true | |
70 | - }, { | |
71 | - fnId : 'para-downParam', | |
72 | - text : 'Download Parameter', | |
73 | - hidden : true | |
74 | - }]; | |
75 | - return menuItems; | |
76 | - }, | |
43 | + localMenuItems : function() | |
44 | + { | |
45 | + var menuItems = | |
46 | + [{ | |
47 | + fnId : 'root-upload', | |
48 | + text : 'Upload File', | |
49 | + hidden : true | |
50 | + }, { | |
51 | + fnId : 'dire-upload', | |
52 | + text : 'Upload File', | |
53 | + hidden : true | |
54 | + }, { | |
55 | + fnId : 'leaf-upload', | |
56 | + text : 'Upload File', | |
57 | + hidden : true | |
58 | + },{ | |
59 | + fnId : 'leaf-plotParam', | |
60 | + text : 'Plot Parameter', | |
61 | + hidden : true | |
62 | + }, { | |
63 | + fnId : 'leaf-downParam', | |
64 | + text : 'Download Parameter', | |
65 | + hidden : true | |
66 | + }, { | |
67 | + fnId : 'para-plotParam', | |
68 | + text : 'Plot Parameter', | |
69 | + hidden : true | |
70 | + }, { | |
71 | + fnId : 'para-downParam', | |
72 | + text : 'Download Parameter', | |
73 | + hidden : true | |
74 | + }]; | |
75 | + return menuItems; | |
76 | + }, | |
77 | 77 | |
78 | - getAllContextMenuItems: function() | |
79 | - { | |
80 | - var menuItems = this.allMenuItems('Parameter'); | |
81 | - var locMenuItems = this.localMenuItems(); | |
78 | + getAllContextMenuItems: function() | |
79 | + { | |
80 | + var menuItems = this.allMenuItems('Parameter'); | |
81 | + var locMenuItems = this.localMenuItems(); | |
82 | 82 | |
83 | - return Ext.Array.merge(menuItems,locMenuItems); | |
84 | - }, | |
85 | - | |
86 | - onMenuItemClick : function(menu,item,event) | |
87 | - { | |
88 | - var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length); | |
83 | + return Ext.Array.merge(menuItems,locMenuItems); | |
84 | + }, | |
89 | 85 | |
90 | - switch (fnId) { | |
86 | + onMenuItemClick : function(menu,item,event) | |
87 | + { | |
88 | + var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length); | |
91 | 89 | |
92 | - case 'deleteNode': | |
93 | - this.deleteNode(); | |
94 | - break; | |
90 | + switch (fnId) { | |
91 | + case 'deleteNode': | |
92 | + this.deleteNode(); | |
93 | + break; | |
95 | 94 | |
96 | - case 'createDir': | |
97 | - this.createDir(); | |
98 | - break; | |
95 | + case 'createDir': | |
96 | + this.createDir(); | |
97 | + break; | |
99 | 98 | |
100 | - case 'createLeaf': | |
101 | - this.createLeaf(this); | |
102 | - break; | |
99 | + case 'createLeaf': | |
100 | + this.createLeaf(this); | |
101 | + break; | |
103 | 102 | |
104 | - case 'renameNode': | |
105 | - this.renameNode(); | |
106 | - break; | |
103 | + case 'renameNode': | |
104 | + this.renameNode(); | |
105 | + break; | |
107 | 106 | |
108 | - case 'editLeaf': | |
109 | - this.editLeaf(); | |
110 | - break; | |
107 | + case 'editLeaf': | |
108 | + this.editLeaf(); | |
109 | + break; | |
111 | 110 | |
112 | - case 'upload': | |
113 | - this.uploadFile(); | |
114 | - break; | |
111 | + case 'upload': | |
112 | + this.uploadFile(); | |
113 | + break; | |
115 | 114 | |
116 | - case 'plotParam': | |
117 | - this.createPlot(this); | |
118 | - break; | |
115 | + case 'plotParam': | |
116 | + this.createPlot(this); | |
117 | + break; | |
118 | + | |
119 | + case 'downParam': | |
120 | + this.createDownload(this); | |
121 | + break; | |
119 | 122 | |
120 | - case 'downParam': | |
121 | - this.createDownload(this); | |
122 | - break; | |
123 | - | |
124 | - default: | |
125 | - break; | |
126 | - } // switch end | |
123 | + default: | |
124 | + break; | |
125 | + } // switch end | |
127 | 126 | |
128 | 127 | }, |
129 | 128 | |
130 | - uploadFile: function() { | |
131 | - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.upload.id, true, function (module) { | |
132 | - module.createWindow(); | |
133 | - }); | |
134 | - }, | |
129 | + uploadFile: function() { | |
130 | + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.upload.id, true, function (module) { | |
131 | + module.createWindow(); | |
132 | + }); | |
133 | + }, | |
135 | 134 | |
136 | - editLeaf: function() { | |
137 | - // load the rootNode and recursively all its child nodes | |
138 | - // to know all names of DerivedParameters | |
139 | - var me = this; | |
140 | - amdaModel.InteractiveNode.preloadNodes(this.getRootNode(), | |
141 | - function() | |
142 | - { | |
143 | - if (me.get('object')) | |
144 | - { | |
145 | - if (me.get('fileObject')) | |
146 | - // launch edition of parameter into parameter module | |
147 | - me.editInModule(); | |
148 | - else | |
149 | - AmdaAction.getObject(me.get('object').get('file'), amdaModel.MyDataNode.nodeType, me.getFileObjectCallback, me); | |
150 | - } | |
151 | - else | |
152 | - { | |
153 | - // call the ext method to get the details of parameter | |
154 | - // the edition of real parameter is done into callback method getObjectCallback | |
155 | - AmdaAction.getObject(me.get('id'), me.get('nodeType'), me.getObjectCallback, me); | |
156 | - } | |
157 | - }); | |
158 | - }, | |
135 | + editLeaf: function() { | |
136 | + // load the rootNode and recursively all its child nodes | |
137 | + // to know all names of DerivedParameters | |
138 | + var me = this; | |
139 | + amdaModel.InteractiveNode.preloadNodes(this.getRootNode(), | |
140 | + function() | |
141 | + { | |
142 | + if (me.get('object')) | |
143 | + { | |
144 | + if (me.get('fileObject')) | |
145 | + // launch edition of parameter into parameter module | |
146 | + me.editInModule(); | |
147 | + else | |
148 | + AmdaAction.getObject(me.get('object').get('file'), amdaModel.MyDataNode.nodeType, me.getFileObjectCallback, me); | |
149 | + } | |
150 | + else | |
151 | + { | |
152 | + // call the ext method to get the details of parameter | |
153 | + // the edition of real parameter is done into callback method getObjectCallback | |
154 | + AmdaAction.getObject(me.get('id'), me.get('nodeType'), me.getObjectCallback, me); | |
155 | + } | |
156 | + }); | |
157 | + }, | |
159 | 158 | |
160 | - // special case file object should be also loaded | |
161 | - getObjectCallback : function(result,remoteEvent){//result, e) { | |
162 | - var t = remoteEvent.getTransaction(); | |
163 | - if (result) { | |
164 | - if (result.id) { | |
165 | - var paramObj = Ext.create(this.get('objectDataModel'), result); | |
166 | - // set parameter into node | |
167 | - this.set('object',paramObj); | |
168 | - | |
169 | - paramObj.set('tableDef', result['tableDef']); | |
170 | - | |
171 | - if (paramObj.get('mask')) var file = paramObj.get('mask'); | |
172 | - else var file = paramObj.get('file'); | |
173 | - | |
174 | - AmdaAction.getObject(file, amdaModel.MyDataNode.nodeType, | |
175 | - this.getFileObjectCallback, this); | |
176 | - } | |
177 | - else { | |
178 | - myDesktopApp.errorMsg(result.error); | |
179 | - } | |
180 | - } | |
181 | - else { | |
182 | - // EXCEPTION : parameter not found !? | |
183 | - myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '" | |
184 | - +this.get('name')+"' found!"); | |
185 | - //TODO: adding an error log | |
186 | - } | |
187 | - }, | |
159 | + // special case file object should be also loaded | |
160 | + getObjectCallback : function(result,remoteEvent){//result, e) { | |
161 | + var t = remoteEvent.getTransaction(); | |
162 | + if (result) { | |
163 | + if (result.id) { | |
164 | + var paramObj = Ext.create(this.get('objectDataModel'), result); | |
165 | + // set parameter into node | |
166 | + this.set('object',paramObj); | |
167 | + | |
168 | + paramObj.set('tableDef', result['tableDef']); | |
169 | + | |
170 | + if (paramObj.get('mask')) var file = paramObj.get('mask'); | |
171 | + else var file = paramObj.get('file'); | |
172 | + | |
173 | + AmdaAction.getObject(file, amdaModel.MyDataNode.nodeType, | |
174 | + this.getFileObjectCallback, this); | |
175 | + } | |
176 | + else { | |
177 | + myDesktopApp.errorMsg(result.error); | |
178 | + } | |
179 | + } | |
180 | + else { | |
181 | + // EXCEPTION : parameter not found !? | |
182 | + myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '" | |
183 | + +this.get('name')+"' found!"); | |
184 | + //TODO: adding an error log | |
185 | + } | |
186 | + }, | |
188 | 187 | |
189 | - getFileObjectCallback : function(result,remoteEvent){//result, e) { | |
190 | - var t = remoteEvent.getTransaction(); | |
191 | - if (result) { | |
192 | - if (result.success) { | |
193 | - var paramObj = Ext.create('amdaModel.FileObject', result); | |
194 | - this.set('fileObject', paramObj); | |
195 | - // Edition of parameter into parameter Module | |
196 | - this.editInModule(); | |
197 | - } | |
198 | - else { | |
199 | - myDesktopApp.errorMsg(result.error); | |
200 | - } | |
201 | - } | |
202 | - else { | |
203 | - // EXCEPTION : parameter not found !? | |
204 | - myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '" | |
205 | - +this.get('name')+"' found!"); | |
206 | - } | |
207 | - }, | |
188 | + getFileObjectCallback : function(result,remoteEvent){//result, e) { | |
189 | + var t = remoteEvent.getTransaction(); | |
190 | + if (result) { | |
191 | + if (result.success) { | |
192 | + var paramObj = Ext.create('amdaModel.FileObject', result); | |
193 | + this.set('fileObject', paramObj); | |
194 | + // Edition of parameter into parameter Module | |
195 | + this.editInModule(); | |
196 | + } | |
197 | + else { | |
198 | + myDesktopApp.errorMsg(result.error); | |
199 | + } | |
200 | + } | |
201 | + else { | |
202 | + // EXCEPTION : parameter not found !? | |
203 | + myDesktopApp.errorMsg(t.action + "." + t.method + " : No parameter '" | |
204 | + +this.get('name')+"' found!"); | |
205 | + } | |
206 | + }, | |
208 | 207 | |
209 | - /* | |
210 | - * Mask was possibly changed update this info | |
211 | - */ | |
212 | - updateMask : function(mask) | |
213 | - { | |
214 | - var myParamRootNode = this.getRootNode(); | |
215 | - if (myParamRootNode.isExpanded) { | |
216 | - Ext.Array.each(myParamRootNode.childNodes, function(node) { | |
217 | - if (node.get('linkedMask') && node.get('linkedMask').indexOf(mask) != -1 ) { | |
218 | - node.set('linkedMask',mask); | |
219 | - if (node.get('info')) { | |
220 | - var info = node.get('info').split("<br/>"); | |
221 | - node.set('info',info[0] + "<br/>" + info[1] + "<br/> Mask: " + mask); | |
222 | - } | |
223 | - } | |
224 | - | |
225 | - }); | |
226 | - } | |
227 | - | |
228 | - }, | |
208 | + /* | |
209 | + * Mask was possibly changed update this info | |
210 | + */ | |
211 | + updateMask : function(mask) | |
212 | + { | |
213 | + var myParamRootNode = this.getRootNode(); | |
214 | + if (myParamRootNode.isExpanded) { | |
215 | + Ext.Array.each(myParamRootNode.childNodes, function(node) { | |
216 | + if (node.get('linkedMask') && node.get('linkedMask').indexOf(mask) != -1 ) { | |
217 | + node.set('linkedMask',mask); | |
218 | + if (node.get('info')) { | |
219 | + var info = node.get('info').split("<br/>"); | |
220 | + node.set('info',info[0] + "<br/>" + info[1] + "<br/> Mask: " + mask); | |
221 | + } | |
222 | + } | |
223 | + | |
224 | + }); | |
225 | + } | |
226 | + }, | |
229 | 227 | |
230 | - updateMyData : function(){ | |
231 | - // reload myFiles Tree in explorer | |
232 | - var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); | |
233 | - if (explorerTree) { | |
234 | - var explorerTreeStore = explorerTree.getStore(); | |
235 | - var explorerRoot = explorerTreeStore.getRootNode().findChild('text','My Files'); | |
236 | - | |
237 | - var explorerPath = '/root/myData-treeRootNode/'; | |
238 | - | |
239 | - explorerTreeStore.reload({node : explorerRoot, | |
240 | - params : { nodeType: 'myData'}, | |
241 | - callback : function(){ | |
242 | - explorerTree.selectPath(explorerPath); | |
243 | - } | |
244 | - }); | |
245 | - } | |
246 | - }, | |
228 | + updateMyData : function(){ | |
229 | + // reload myFiles Tree in explorer | |
230 | + var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); | |
231 | + if (explorerTree) { | |
232 | + var explorerTreeStore = explorerTree.getStore(); | |
233 | + var explorerRoot = explorerTreeStore.getRootNode().findChild('text','My Files'); | |
234 | + | |
235 | + var explorerPath = '/root/myData-treeRootNode/'; | |
236 | + | |
237 | + explorerTreeStore.reload({node : explorerRoot, | |
238 | + params : { nodeType: 'myData'}, | |
239 | + callback : function(){ | |
240 | + explorerTree.selectPath(explorerPath); | |
241 | + } | |
242 | + }); | |
243 | + } | |
244 | + }, | |
247 | 245 | |
248 | - isParameter : function(){ | |
249 | - return this.get('isParameter'); | |
250 | - } | |
246 | + isParameter : function(){ | |
247 | + return this.get('isParameter'); | |
248 | + } | |
251 | 249 | }); | ... | ... |
php/classes/AmdaAction.php
... | ... | @@ -247,7 +247,6 @@ class AmdaAction |
247 | 247 | if ($child->tagName == 'parameter') |
248 | 248 | { |
249 | 249 | $isParameter = true; |
250 | - $isScatter = true; | |
251 | 250 | |
252 | 251 | if ($child->parentNode->hasAttribute('dataStart')) |
253 | 252 | { |
... | ... | @@ -270,7 +269,6 @@ class AmdaAction |
270 | 269 | if ($child->tagName == 'component') |
271 | 270 | { |
272 | 271 | $isParameter = true; |
273 | - $isScatter = true; | |
274 | 272 | |
275 | 273 | if ($child->parentNode->parentNode->hasAttribute('dataStart')) |
276 | 274 | { |
... | ... | @@ -291,7 +289,6 @@ class AmdaAction |
291 | 289 | $component_info["parentId"] = $child->parentNode->getAttribute('xml:id'); |
292 | 290 | } |
293 | 291 | |
294 | - if ($child->tagName == 'parameter' && $child->hasChildNodes()) $isScatter = false; | |
295 | 292 | |
296 | 293 | if ($child->tagName == 'parameter' && $child->hasAttribute('display_type')) |
297 | 294 | { |
... | ... | @@ -299,12 +296,10 @@ class AmdaAction |
299 | 296 | { |
300 | 297 | $needsArgs = true; |
301 | 298 | $isSpectra = true; |
302 | - $isScatter = false; | |
303 | 299 | } |
304 | 300 | elseif ($child->getAttribute('display_type') == 'stackplot') |
305 | 301 | { |
306 | 302 | $isStack = true; |
307 | - $isScatter = false; | |
308 | 303 | } |
309 | 304 | } |
310 | 305 | |
... | ... | @@ -316,7 +311,7 @@ class AmdaAction |
316 | 311 | $childrenToReturn[] = array('text' => $name,'alias' => $alias, |
317 | 312 | 'id' => $id,'nodeType' => $nodeType, 'info' => $info, "component_info" => $component_info, |
318 | 313 | 'globalStart' => $globalStart, 'globalStop' => $globalStop, 'timeRestriction' => $timeRestriction, |
319 | - 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'isScatter' => $isScatter, | |
314 | + 'leaf' => $isLeaf, 'isParameter' => $isParameter, | |
320 | 315 | 'isSpectra' => $isSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet); |
321 | 316 | } |
322 | 317 | else |
... | ... | @@ -431,13 +426,10 @@ class AmdaAction |
431 | 426 | if (($child->tagName == 'parameter') || ($child->tagName == 'component')) |
432 | 427 | { |
433 | 428 | $isParameter = true; |
434 | - $isScatter = true; | |
435 | 429 | } |
436 | 430 | |
437 | 431 | $needsArgs = $child->getAttribute('needsArgs'); |
438 | 432 | |
439 | - if (($child->tagName == 'parameter' && $child->hasChildNodes()) || $needsArgs) $isScatter = false; | |
440 | - | |
441 | 433 | if ($remoteBase) |
442 | 434 | { |
443 | 435 | if ($child->tagName == 'dataset') $isRemoteDataSet = true; |
... | ... | @@ -466,19 +458,18 @@ class AmdaAction |
466 | 458 | if ($child->hasAttribute('display_type') && $child->getAttribute('display_type') == 'spectrogram') |
467 | 459 | { |
468 | 460 | $needsArgs = true; |
469 | - $isScatter = false; | |
470 | 461 | $isSpectra = true; |
471 | 462 | } |
472 | 463 | if ($globalStart) |
473 | 464 | $childrenToReturn[] = array('text' => $name,'alias' => $alias, |
474 | 465 | 'id' => $id,'nodeType' => $nodeType, 'info' => $info, 'help' => $help, 'globalStart' => $globalStart, |
475 | 466 | 'globalStop' => $globalStop, 'leaf' => $isLeaf, 'disable' => $disable, 'isParameter' => $isParameter, |
476 | - 'isScatter' => $isScatter, 'isSpectra' => $isSpectra, 'needsArgs' => $needsArgs, "component_info" => isset($component_info) ? $component_info : NULL); | |
467 | + 'isSpectra' => $isSpectra, 'needsArgs' => $needsArgs, "component_info" => isset($component_info) ? $component_info : NULL); | |
477 | 468 | else |
478 | 469 | $childrenToReturn[] = array('text' => $name,'alias' => $alias, |
479 | 470 | 'id' => $id,'nodeType' => $nodeType, 'info' => $info, 'help' => $help, |
480 | 471 | 'leaf' => $isLeaf, 'disable' => $disable, 'isParameter' => $isParameter, |
481 | - 'isScatter' => $isScatter, 'isSpectra' => $isSpectra, 'needsArgs' => $needsArgs, "component_info" => $component_info); | |
472 | + 'isSpectra' => $isSpectra, 'needsArgs' => $needsArgs, "component_info" => $component_info); | |
482 | 473 | } |
483 | 474 | else |
484 | 475 | { |
... | ... | @@ -525,7 +516,6 @@ class AmdaAction |
525 | 516 | $globalStop = null; |
526 | 517 | $specialNode = true; |
527 | 518 | $size = $child->getAttribute('size'); |
528 | - $isScatter = $size == 1; | |
529 | 519 | $mask = $child->getAttribute('mask'); |
530 | 520 | $isSpectra = false; |
531 | 521 | |
... | ... | @@ -544,7 +534,7 @@ class AmdaAction |
544 | 534 | |
545 | 535 | $childrenToReturn[] = array('text' => $name, 'size' => $size, 'id' => $id, |
546 | 536 | 'globalStart' => $globalStart, 'globalStop' => $globalStop, |
547 | - 'nodeType' => $nodeType, 'info' => $info, 'isScatter' => $isScatter, 'leaf' => $isLeaf, | |
537 | + 'nodeType' => $nodeType, 'info' => $info, 'leaf' => $isLeaf, | |
548 | 538 | 'isParameter' => $isParameter, 'linkedMask' => $mask, 'isSpectra' => $isSpectra); |
549 | 539 | |
550 | 540 | break; | ... | ... |