Commit 23aa5d65d152b6c40ec18f5d00ad5b23cdcb2de9

Authored by Hacene SI HADJ MOHAND
2 parents d8919d78 952d9101

merging with master

generic_data/Functions/constants.xml
1 1 <?xml version="1.0"?>
2 2 <constants>
3   - <constant info="astronomical unit" name="AU" units="m">1.49598e+11</constant>
4   - <constant info="Boltzmann constant" name="k" units="J/K">1.38054e-23</constant>
5   - <constant info="kelvin to electron-volt" name="K2eV" units="eV/K">8.622e-5</constant>
6   - <constant info="electron-volt to kelvin" name="eV2K" units="K/eV">1.160e4</constant>
7   - <constant info="proton mass" name="m_p" units="kg">1.67e-27</constant>
8   - <constant info="electron mass" name="m_e" units="kg">9.1091e-31</constant>
9   - <constant info="speed of light in vacuum" name="c" units="m/s">2.99792e+08</constant>
10   - <constant info="elementary charge" name="q_e" units="C">1.6021e-19</constant>
11   - <constant info='electric constant' name="epsilon_0" units="F/m">8.85416e-12</constant>
12   - <constant info='magnetic constant' name="mu_0" units="H/m">1.25664e-06</constant>
13   - <constant info="pi" name="pi">3.14159</constant>
14   - <constant info="rad2deg" name="rad2deg" units="deg/rad">57.2958</constant>
15   - <constant info="deg2rad" name="deg2rad" units="rad/deg">0.0174533</constant>
16   - <constant info="gravitational constant" name="G" units="m3/kg/s2">6.674e-11</constant>
17   - <constant info="acceleration of gravity at Earth" name="g" units="m/s2">9.81</constant>
18   - <constant info="Planck constant" name="h" units="Js">6.626e-34</constant>
19   - <constant info="Avogadro number" name="NA" units="1/mol">6.0221367e+23</constant>
20   - <constant info="Mercury equatorial radius" name="Rme" units="m">2.4397e+06</constant>
21   - <constant info="Venus equatorial radius" name="Rv" units="m">6.0518e+06</constant>
22   - <constant info="Earth equatorial radius" name="Re" units="m">6.3712e+06</constant>
23   - <constant info="Mars equatorial radius" name="Rma" units="m">3.3962e+06</constant>
24   - <constant info="Jupiter equatorial radius" name="Rj" units="m">71.492e+06</constant>
25   - <constant info="Saturn equatorial radius" name="Rs" units="m">60.268e+06</constant>
26   - <constant info="Uranus equatorial radius" name="Ru" units="m">25.559+06</constant>
27   - <constant info="Neptune equatorial radius" name="Rn" units="m">24.764+06</constant>
28   - <constant info="Moon equatorial radius" name="Rmo" units="m">1.738e+06</constant>
29   - <constant info="Pluto equatorial radius" name="Rpl" units="m">1.195e+06</constant>
30   - <constant info="Sun equatorial radius" name="Rsun" units="m">6.95e+08</constant>
  3 + <constant info="astronomical unit" name="AU" units="m" kind="space">1.49598e+11</constant>
  4 + <constant info="Boltzmann constant" name="k" units="J/K" kind="physics">1.38054e-23</constant>
  5 + <constant info="kelvin to electron-volt" name="K2eV" units="eV/K" kind="units">8.622e-5</constant>
  6 + <constant info="electron-volt to kelvin" name="eV2K" units="K/eV" kind="units">1.160e4</constant>
  7 + <constant info="proton mass" name="m_p" units="kg" kind="physics">1.67e-27</constant>
  8 + <constant info="electron mass" name="m_e" units="kg" kind="physics">9.1091e-31</constant>
  9 + <constant info="speed of light in vacuum" name="c" units="m/s" kind="physics">2.99792e+08</constant>
  10 + <constant info="elementary charge" name="q_e" units="C" kind="physics">1.6021e-19</constant>
  11 + <constant info='electric constant' name="epsilon_0" units="F/m" kind="physics">8.85416e-12</constant>
  12 + <constant info='magnetic constant' name="mu_0" units="H/m" kind="physics">1.25664e-06</constant>
  13 + <constant info="pi" name="pi" kind="physics">3.14159</constant>
  14 + <constant info="rad2deg" name="rad2deg" units="deg/rad" kind="units">57.2958</constant>
  15 + <constant info="deg2rad" name="deg2rad" units="rad/deg" kind="units">0.0174533</constant>
  16 + <constant info="gravitational constant" name="G" units="m3/kg/s2" kind="physics">6.674e-11</constant>
  17 + <constant info="acceleration of gravity at Earth" name="g" units="m/s2" kind="physics">9.81</constant>
  18 + <constant info="Planck constant" name="h" units="Js" kind="physics">6.626e-34</constant>
  19 + <constant info="Avogadro number" name="NA" units="1/mol" kind="physics">6.0221367e+23</constant>
  20 + <constant info="Mercury equatorial radius" name="Rme" units="m" kind="space">2.4397e+06</constant>
  21 + <constant info="Venus equatorial radius" name="Rv" units="m" kind="space">6.0518e+06</constant>
  22 + <constant info="Earth equatorial radius" name="Re" units="m" kind="space" >6.3712e+06</constant>
  23 + <constant info="Mars equatorial radius" name="Rma" units="m" kind="space">3.3962e+06</constant>
  24 + <constant info="Jupiter equatorial radius" name="Rj" units="m" kind="space">71.492e+06</constant>
  25 + <constant info="Saturn equatorial radius" name="Rs" units="m" kind="space">60.268e+06</constant>
  26 + <constant info="Uranus equatorial radius" name="Ru" units="m" kind="space">25.559+06</constant>
  27 + <constant info="Neptune equatorial radius" name="Rn" units="m" kind="space">24.764+06</constant>
  28 + <constant info="Moon equatorial radius" name="Rmo" units="m" kind="space">1.738e+06</constant>
  29 + <constant info="Pluto equatorial radius" name="Rpl" units="m" kind="space">1.195e+06</constant>
  30 + <constant info="Sun equatorial radius" name="Rsun" units="m" kind="space">6.95e+08</constant>
  31 + <constant info="Ganymede (Jupiter moon) mean radius" name="Rga" units="m" kind="space">2.634e+06</constant>
  32 + <constant info="Io (Jupiter moon) mean radius" name="Rio" units="m" kind="space">1.822e+06</constant>
  33 + <constant info="Callisto(Jupiter moon) mean radius" name="Rca" units="m" kind="space">2.410e+06</constant>
  34 + <constant info="Europa (Jupiter moon) mean radius" name="Reu" units="m" kind="space">1.561e+06</constant>
  35 + <constant info="Titan (Saturn moon) mean radius" name="Rti" units="m" kind="space">2.575e+06</constant>
  36 + <constant info="Enceladus (Saturn moon) mean radius" name="Renc" units="m" kind="space">2.52e+05</constant>
31 37 </constants>
... ...
generic_data/Functions/functions.xml
... ... @@ -88,14 +88,18 @@
88 88 <prompt/>
89 89 <info_brief>GSE to SM transformation</info_brief>
90 90 </function>-->
91   - <function name="cross(,)" params="2" kind="math">
  91 + <function name="cross(,)" params="2" kind="vectors">
92 92 <info_brief>Cross product</info_brief>
93 93 <new_kernel>cross</new_kernel>
94 94 </function>
95   - <function name="dot(,)" params="2" kind="math">
  95 + <function name="dot(,)" params="2" kind="vectors">
96 96 <info_brief>Dot product</info_brief>
97 97 <new_kernel>dot</new_kernel>
98 98 </function>
  99 + <function name="module()" kind="vectors">
  100 + <info_brief>Magnitude</info_brief>
  101 + <new_kernel>magnitude</new_kernel>
  102 + </function>
99 103 <function name="abs()" kind="math">
100 104 <info_brief>Absolute value</info_brief>
101 105 <new_kernel>abs</new_kernel>
... ...
generic_data/compilation/.gitignore 0 โ†’ 100644
... ... @@ -0,0 +1,2 @@
  1 +*
  2 +!.gitignore
... ...
help/plotHOWTO
1 1 <li>1. To plot a parameter <i>drag</i> it from the Parameters tree and <i>drop</i> onto the panel
2 2 <li>2. <i>Link to MultiPlot</i> replaces the individual plot tab TimeSelector with the common for all plot tabs "MultiTime" Selector
3   -<li>3. <i>Simplified View</i> hides all request elements except <i>panel</i> and <i>parameter</i>
  3 +<li>3. Check <i>Extended Plot Options</i> to get control over all available plot options
4 4  
5 5  
6 6 \ No newline at end of file
... ...
js/app/models/Constant.js
... ... @@ -20,6 +20,7 @@ Ext.define(&#39;amdaModel.Constant&#39;, {
20 20  
21 21 fields : [
22 22 {name: 'name', mapping: '@name', type:'string'},
  23 + {name: 'kind', mapping: '@kind', type: 'string', defaultValue: 'space'},
23 24 {name: 'info', mapping: '@info', type:'string'},
24 25 {name: 'units', mapping: '@units', type: 'string', defaultValue: ''},
25 26 {name: 'value', mapping: ' ', type: 'string'}
... ...
js/app/models/InteractiveNode.js
... ... @@ -28,8 +28,7 @@ Ext.define(&#39;amdaModel.InteractiveNode&#39;, {
28 28 statics: {
29 29 preloadNodes : function(node,onready)
30 30 {
31   - var me = this;
32   -
  31 + var me = this;
33 32 var nodesToLoad = new Array();
34 33 nodesToLoad.push(node);
35 34 this.preloadTreeNode(node, nodesToLoad, function (node)
... ... @@ -131,7 +130,7 @@ Ext.define(&#39;amdaModel.InteractiveNode&#39;, {
131 130 }
132 131 module.setContextNode(contextNode);
133 132  
134   - } else if (module.getLinkedNode() != null){
  133 + } else if (module.getLinkedNode() != null){
135 134 //TODO the node to edit is already edited
136 135 // myDesktopApp.warningMsg('This object is being edited');
137 136 //Sol1: msg alert: "warning this node is already edited! If you want to get the original, please press the 'reset' button"->'OK'
... ... @@ -237,7 +236,7 @@ Ext.define(&#39;amdaModel.InteractiveNode&#39;, {
237 236 if (!this.get('contextNode') || (this.get('contextNode').data.id == 'sharedtimeTable-treeRootNode') || (this.get('contextNode').data.id == 'sharedcatalog-treeRootNode')) {
238 237 // set the root node of 'Derived Parameters' tree as contextNode
239 238 this.set('contextNode',this.getRootNode());
240   - }
  239 + }
241 240 // call the Ext.Direct method to create parameter
242 241 AmdaAction.createObject(this.get('object').getJsonValues(false), this.get('contextNode').get('id'), function(res,e){
243 242 //success
... ... @@ -258,12 +257,13 @@ Ext.define(&#39;amdaModel.InteractiveNode&#39;, {
258 257 }
259 258 // set text of this node
260 259 this.set('text',this.get('object').get('name'));
  260 +
261 261 //set id of this node
262 262 this.set('id',res.id);
263 263 this.internalId = res.id;
  264 +
264 265 // set id of node's object
265   - this.get('object').set('id',res.id);
266   -
  266 + this.get('object').set('id',res.id);
267 267 if (res.created){
268 268 // set the created date
269 269 this.get('object').set('created',res.created);
... ... @@ -577,45 +577,54 @@ Ext.define(&#39;amdaModel.InteractiveNode&#39;, {
577 577 if (this.parentNode) {
578 578 if (this.isLeaf()){
579 579 var moduleId = this.get('moduleId');
580   - // if really interactive node
  580 + // if really interactive node
581 581 if (moduleId) {
582   - var me = this;
583   - myDesktopApp.getLoadedModule(moduleId, true, function (module) {
584   - var editedNode = module.getLinkedNode();
585   - // file node is not linked directly to the module
586   - var isThisFile = false;
587   -
588   - if (editedNode && editedNode.$className == 'amdaModel.MyDataParamNode')
589   - if (editedNode.get('fileObject').get('fileName') == me.get('text'))
590   - isThisFile = true;
591   -
592   - if (me.$className == 'amdaModel.DerivedParamNode')
593   - {
594   - var obj = {
595   - paramId : 'ws_'+me.get('text')
596   - };
597   - AmdaAction.compilParamDelete(obj);
598   - }
599   -
600   - if (editedNode === me || isThisFile){
601   - var newNode = Ext.ModelManager.create({leaf : true}, me.$className);
602   - // several tabs could be connected to one node
603   - if (moduleId === myDesktopApp.dynamicModules.plot.id) {
604   - var linkedNodes = module.linkedNodes;
605   -
606   - if (linkedNodes) {
607   - linkedNodes.each(function(key, value){
608   - if (value === me) {
609   - linkedNodes.replace(key,newNode);
610   - var tabPanel = module.getUiContent().tabPanel.items.getByKey(key);
611   - tabPanel.setObject(Ext.create(amdaModel.Plot.$className, {}));
612   - }
613   - }, me);
614   - }
615   - }
616   - newNode.editInModule();
  582 + var win = myDesktopApp.getDesktop().getWindow(moduleId);
  583 + // if window is really open
  584 + if (win) {
  585 + var me = this;
  586 + myDesktopApp.getLoadedModule(moduleId, true, function (module) {
  587 + var editedNode = module.getLinkedNode();
  588 +
  589 + // file node is not linked directly to the module
  590 + var isThisFile = false;
  591 + if (editedNode && editedNode.$className == 'amdaModel.MyDataParamNode')
  592 + if (editedNode.get('fileObject').get('fileName') == me.get('text'))
  593 + isThisFile = true;
  594 +
  595 + // node was created BEFORE tree loading; node.id are different ; but it is the same node
  596 + if ( editedNode && editedNode.get('id') == me.get('id') && editedNode !== me ) {
  597 + module.setLinkedNode(me);
  598 + isThisFile = true;
  599 + }
  600 +
  601 + if (me.$className == 'amdaModel.DerivedParamNode') {
  602 + var obj = {
  603 + paramId : 'ws_'+me.get('text')
  604 + };
  605 + AmdaAction.compilParamDelete(obj);
  606 + }
  607 +
  608 + if (editedNode === me || isThisFile ){
  609 + var newNode = Ext.ModelManager.create({leaf : true}, me.$className);
  610 + // several tabs could be connected to one node
  611 + if (moduleId === myDesktopApp.dynamicModules.plot.id) {
  612 + var linkedNodes = module.linkedNodes;
  613 +
  614 + if (linkedNodes) {
  615 + linkedNodes.each(function(key, value){
  616 + if (value === me) {
  617 + linkedNodes.replace(key,newNode);
  618 + var tabPanel = module.getUiContent().tabPanel.items.getByKey(key);
  619 + tabPanel.setObject(Ext.create(amdaModel.Plot.$className, {}));
  620 + }
  621 + }, me);
  622 + }
  623 + }
  624 + newNode.editInModule();
  625 + }
  626 + });
617 627 }
618   - });
619 628 }
620 629 }
621 630 //update mask info in myData
... ...
js/app/models/LocalParamNode.js
... ... @@ -65,6 +65,9 @@ Ext.define(&#39;amdaModel.LocalParamNode&#39;,
65 65  
66 66 if (this.get('isStack') || this.get('isSpectra'))
67 67 this.set('iconCls', 'icon-spectra');
  68 +
  69 + if (this.get('is2dSpectra'))
  70 + this.set('iconCls', 'icon-2dspectra');
68 71 }
69 72 },
70 73  
... ...
js/app/models/PlotObjects/PlotObjectConfig.js
... ... @@ -23,7 +23,7 @@ Ext.define(&#39;amdaPlotObj.PlotObjectConfig&#39;, {
23 23 oneFilePerInterval: false
24 24 },
25 25 tree : {
26   - simplifiedView : true
  26 + fullView : false
27 27 },
28 28 page : {
29 29 xMargin : 5.,
... ...
js/app/models/PlotObjects/PlotPanelObject.js
... ... @@ -304,9 +304,16 @@ Ext.define(&#39;amdaPlotObj.PlotPanelObject&#39;, {
304 304 recs[0].set('dim2-index', paramComponents['index2']);
305 305 }
306 306 }
  307 +<<<<<<< HEAD
307 308  
308 309 if (is2d)
309 310 recs[0].set('dim2-index','0');
  311 +=======
  312 +
  313 + if (is2d)
  314 + recs[0].set('dim2-index','0');
  315 +
  316 +>>>>>>> master
310 317 // activate legend if vector & TimePlot
311 318 if ( isVector && this.get('panel-plot-type') == 'timePlot' ) {
312 319 this.loadSeriesLegend();
... ...
js/app/models/PlotObjects/PlotParamObject.js
... ... @@ -58,6 +58,7 @@ Ext.define(&#39;amdaPlotObj.PlotParamObject&#39;, {
58 58 return;
59 59 this.set('param-drawing-object', this.createDrawingObjectByType(this.get('param-drawing-type'), drawing));
60 60 drawingObject.dirty = false;
  61 +
61 62 },
62 63  
63 64 createDrawingObjectByType : function(type, data)
... ...
js/app/models/PlotObjects/PlotTabObject.js
... ... @@ -27,7 +27,7 @@ Ext.define(&#39;amdaPlotObj.PlotTabObject&#39;, {
27 27  
28 28 fields : [
29 29 {name: 'id', type: 'int'},
30   - {name: 'tree-simplified-view', type: 'boolean'},
  30 + {name: 'tree-full-view', type: 'boolean'},
31 31 {name: 'multi-plot-linked', type: 'boolean'},
32 32 {name: 'page-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set
33 33 {name: 'panels-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set
... ... @@ -153,7 +153,7 @@ Ext.define(&#39;amdaPlotObj.PlotTabObject&#39;, {
153 153  
154 154 setDefaultValues: function()
155 155 {
156   - this.set('tree-simplified-view', amdaPlotObj.PlotObjectConfig.defaultValues.tree.simplifiedView);
  156 + this.set('tree-full-view', amdaPlotObj.PlotObjectConfig.defaultValues.tree.fullView);
157 157  
158 158 this.set('multi-plot-linked', false);
159 159  
... ... @@ -223,7 +223,7 @@ Ext.define(&#39;amdaPlotObj.PlotTabObject&#39;, {
223 223 var tabValues = new Object();
224 224  
225 225 tabValues['id'] = this.get('id');
226   - tabValues['tree-simplified-view'] = this.get('tree-simplified-view');
  226 + tabValues['tree-full-view'] = this.get('tree-full-view');
227 227 tabValues['multi-plot-linked'] = this.get('multi-plot-linked');
228 228 tabValues['page-node-state'] = this.get('page-node-state');
229 229 tabValues['panels-node-state'] = this.get('panels-node-state');
... ...
js/app/views/CalculatorUI.js
... ... @@ -15,6 +15,7 @@
15 15 */
16 16  
17 17 var CalculatorData = ['1','2','3','4','5','6','7','8','9','0','(',')','[',']','+','-','*','/','^', '.','>','<', '&', '|'];
  18 +// var CalculatorData = ['1','2','3','4','5','6','7','8','9','0','(',')','[',']','+','-','*','/','^', '.','>','>=', '=', '<=', '<', '&', '|'];
18 19  
19 20 Ext.define('amdaUI.CalculatorUI', {
20 21 extend: 'Ext.util.Observable',
... ... @@ -93,12 +94,12 @@ Ext.define(&#39;amdaUI.CalculatorUI&#39;, {
93 94 scope : this,
94 95 callback: function(records, operation, success)
95 96 {
96   - this.createConstantBtns();
  97 + this.createAllConstantBtns();
97 98 }
98 99 });
99 100 }
100 101 else
101   - this.createConstantBtns();
  102 + this.createAllConstantBtns();
102 103  
103 104 //load functions store
104 105 if (!amdaUI.CalculatorUI.functionStore)
... ... @@ -148,8 +149,10 @@ Ext.define(&#39;amdaUI.CalculatorUI&#39;, {
148 149 defaults: { xtype: 'button', columnWidth: .11},
149 150 items: this.getItems('Calculator')
150 151 } , {
151   - title: 'Constants', layout: 'column',
152   - defaults: { xtype: 'button', columnWidth: .20},
  152 + title: 'Constants', xtype:'tabpanel', //iconCls: 'tabs',
  153 + enableTabScroll: true, tabPosition: 'bottom',
  154 + defaults: { frame: true, border: false, plain: true, layout: 'column', autoScroll:true},
  155 + activeTab: 0,
153 156 id : 'calc_tab_const_id'
154 157 }, {
155 158 title: 'Functions', xtype:'tabpanel', //iconCls: 'tabs',
... ... @@ -337,14 +340,50 @@ Ext.define(&#39;amdaUI.CalculatorUI&#39;, {
337 340 return btns;
338 341 },
339 342  
340   - createConstantBtns : function(){
  343 + createAllFunctionBtns : function()
  344 + {
  345 + this.createFunctionBtns('MathFunctions','Simple Maths');
  346 + this.createFunctionBtns('VectorFunctions','Vector Functions');
  347 + this.createFunctionBtns('TimeFunctions','Statistics');
  348 + this.createFunctionBtns('FunctionsSliding','Statistics/Sliding');
  349 + this.createFunctionBtns('AmdaFunctions','Special');
  350 + },
  351 +
  352 + createAllConstantBtns : function()
  353 + {
  354 + this.createConstantBtns('Space','Planets Constants');
  355 + this.createConstantBtns('Physics','Physics Constants');
  356 + this.createConstantBtns('Units','Units Conversion');
  357 + },
  358 +
  359 + createConstantBtns : function(item, tabTitle)
  360 + {
341 361 var constTab = this.win.query('#calc_tab_const_id');
342   -
  362 +
343 363 if (constTab.length < 1)
344   - return;
345   -
  364 + return;
  365 +
  366 + switch (item)
  367 + {
  368 + case 'Space' :
  369 + amdaUI.CalculatorUI.constantStore.filter('kind','space');
  370 + break;
  371 + case 'Physics' :
  372 + amdaUI.CalculatorUI.constantStore.filter('kind','physics');
  373 + break;
  374 + case 'Units' :
  375 + amdaUI.CalculatorUI.constantStore.filter('kind','units');
  376 + break;
  377 + }
  378 +
  379 + var crtTab = constTab[0].add(
  380 + {
  381 + title : tabTitle,
  382 + defaults: { xtype: 'button', columnWidth: .20}
  383 + });
  384 +
346 385 amdaUI.CalculatorUI.constantStore.each( function(c){
347   - constTab[0].add(
  386 + crtTab.add(
348 387 {
349 388 text: c.get('name'),
350 389 tooltip: c.get('units') == '' ? c.get('info')+'<br/>'+c.get('value') :
... ... @@ -365,15 +404,10 @@ Ext.define(&#39;amdaUI.CalculatorUI&#39;, {
365 404 }
366 405 });
367 406 },this);
368   - },
369   -
370   - createAllFunctionBtns : function()
371   - {
372   - this.createFunctionBtns('MathFunctions','Simple Maths');
373   - this.createFunctionBtns('TimeFunctions','Statistics');
374   - this.createFunctionBtns('FunctionsSliding','Statistics/Sliding');
375   - this.createFunctionBtns('AmdaFunctions','Space Physics');
376   - },
  407 +
  408 + //clear filter
  409 + amdaUI.CalculatorUI.constantStore.clearFilter();
  410 + },
377 411  
378 412 createFunctionBtns : function(item, tabTitle)
379 413 {
... ... @@ -396,6 +430,9 @@ Ext.define(&#39;amdaUI.CalculatorUI&#39;, {
396 430 case 'FunctionsSliding' :
397 431 amdaUI.CalculatorUI.functionStore.filter('kind','sliding');
398 432 break;
  433 + case 'VectorFunctions' :
  434 + amdaUI.CalculatorUI.functionStore.filter('kind','vector');
  435 + break;
399 436 }
400 437  
401 438 var crtTab = funcTab[0].add(
... ...
js/app/views/ParamArgumentsPlug.js
... ... @@ -66,7 +66,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsPlug&#39;, {
66 66 {
67 67 this.win = new Ext.Window({
68 68 id: prefixId + '-param-arg-win',
69   - width: 200,
  69 + width: 280,
70 70 height: 150,
71 71 x: 0, y: 0,
72 72 baseCls:'x-panel',
... ...
js/app/views/ParamArgumentsUI.js
... ... @@ -19,7 +19,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
19 19 onChange: null,
20 20 onModifyHeight: null,
21 21 pluginOwner: null,
22   -
  22 + isFirstMsg : true,
23 23 // -1 -> unknown, 0 -> scalar, 1 -> Tab1D, 2 -> Tab2D
24 24 paramType: 0,
25 25  
... ... @@ -59,6 +59,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
59 59 }
60 60 else
61 61 me.unmask();
  62 +
62 63 },
63 64  
64 65 rebuildAll: function(paramInfoResult , uiScope) {
... ... @@ -211,7 +212,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
211 212 indexes.push({'key' : component.index_2, 'value' : index + ' : ' + component.name});
212 213 });
213 214 }
214   -
  215 +
215 216 //Add combo box
216 217 var indexesStore = Ext.create('Ext.data.Store', {
217 218 fields: ['key', 'value'],
... ... @@ -224,13 +225,29 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
224 225 queryMode: 'local',
225 226 displayField: 'value',
226 227 valueField: 'key',
227   - value: '*',
  228 + value: '*',
228 229 editable: false,
229 230 argId: relatedDim,
230 231 hidden: (relatedTable ? relatedTable.variable : false),
231 232 listeners: {
232 233 change: function(field, newValue, oldValue, eOpts) {
233   - this.paramRequestObject.set(relatedDim+'-index', newValue);
  234 + if (this.paramRequestObject.get('type') == '2' && this.isFirstMsg)
  235 + {
  236 + if (field.argId == 'dim2' && newValue == '*') {
  237 + var previousCombo = field.previousSibling();
  238 +
  239 + if (previousCombo instanceof Ext.form.FieldSet)
  240 + previousCombo = previousCombo.previousSibling();
  241 +
  242 + if (previousCombo instanceof Ext.form.ComboBox && previousCombo.argId == 'dim1' && previousCombo.getValue() == '*' && !previousCombo.isDisabled()) {
  243 + myDesktopApp.warningMsg('If argument <i>All</i> is set for both dimensions output will be the total sum <b>(not spectra!)</b>');
  244 + this.isFirstMsg = false;
  245 + }
  246 +
  247 + }
  248 + }
  249 +
  250 + this.paramRequestObject.set(relatedDim+'-index', newValue);
234 251 if (this.onChange != null)
235 252 this.onChange(uiScope, relatedDim, newValue, oldValue, false);
236 253 },
... ...
js/app/views/PlotComponents/PlotPanelForm.js
... ... @@ -119,7 +119,7 @@ Ext.define(&#39;amdaPlotComp.PlotPanelForm&#39;, {
119 119 if (value != me.object.get('panel-plot-type'))
120 120 {
121 121 me.object.changePlotType(value);
122   - if (!me.crtTree.tabObject.get('tree-simplified-view'))
  122 + if (me.crtTree.tabObject.get('tree-full-view'))
123 123 {
124 124 me.crtTree.buildPanelAxesNode(me.object);
125 125 me.crtTree.buildPanelAdditionalObjectsNode(me.object);
... ...
js/app/views/PlotComponents/PlotTree.js
... ... @@ -46,15 +46,11 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
46 46 this.store.getRootNode().removeAll();
47 47  
48 48 this.tabObject = tabObject;
49   -
50   - this.simplifiedViewCombo.setValue(this.tabObject.get('tree-simplified-view'));
51   - this.linkToMultiPlotCombo.setValue(this.tabObject.get('multi-plot-linked'));
52   -
53   - if (!this.tabObject.get('tree-simplified-view'))
  49 +
  50 + if (this.tabObject.get('tree-full-view') && this.simplifiedViewCombo.getValue())
54 51 {
55 52 //Page Node
56 53 var pageNode = this.store.getRootNode().appendChild(new amdaPlotObj.PlotPageTreeNode({object : tabObject}));
57   -
58 54 //Layout node
59 55 pageNode.appendChild(new amdaPlotObj.PlotLayoutTreeNode({object : tabObject}));
60 56  
... ... @@ -63,8 +59,12 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
63 59 }
64 60 else
65 61 this.panelsNode = this.store.getRootNode();
66   -
  62 +
  63 + this.suspendLayouts();
67 64 this.buildPanelsNode();
  65 + this.simplifiedViewCombo.setValue(this.tabObject.get('tree-full-view'));
  66 + this.linkToMultiPlotCombo.setValue(this.tabObject.get('multi-plot-linked'));
  67 + this.resumeLayouts(true);
68 68 },
69 69  
70 70 buildPanelsNode: function(paramNodeToSelect) {
... ... @@ -137,7 +137,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
137 137 //Retrieve corresponding panel node
138 138 if (panelNode.object == panelObject)
139 139 {
140   - if (!me.tabObject.get('tree-simplified-view'))
  140 + if (me.tabObject.get('tree-full-view'))
141 141 {
142 142 //Retrieve params node
143 143 paramsNode = panelNode.findChild('type', 'params');
... ... @@ -283,7 +283,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
283 283  
284 284 addPanelNode: function(panelObject, paramNodeToSelect) {
285 285 var panelNode = this.panelsNode.appendChild(new amdaPlotObj.PlotPanelTreeNode({object : panelObject}));
286   - if (!this.tabObject.get('tree-simplified-view'))
  286 + if (this.tabObject.get('tree-full-view'))
287 287 {
288 288 //Axes node
289 289 this.buildPanelAxesNode(panelObject);
... ... @@ -337,7 +337,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
337 337 var toIndex = targetNode.parentNode.indexOf(targetNode);
338 338  
339 339 var fromPanelObject = null;
340   - if (!this.tabObject.get('tree-simplified-view'))
  340 + if (this.tabObject.get('tree-full-view'))
341 341 {
342 342 fromPanelObject = record.parentNode.parentNode.object;
343 343 }
... ... @@ -374,7 +374,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
374 374 return true;
375 375 case 'amdaPlotObj.PlotParamTreeNode' :
376 376 var toPanelObject = null;
377   - if (!this.tabObject.get('tree-simplified-view'))
  377 + if (this.tabObject.get('tree-full-view'))
378 378 {
379 379 toPanelObject = targetNode.parentNode.parentNode.object;
380 380 }
... ... @@ -453,7 +453,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
453 453 break;
454 454 case 'param' :
455 455 var panelObject = null;
456   - if (!this.tabObject.get('tree-simplified-view'))
  456 + if (this.tabObject.get('tree-full-view'))
457 457 panelObject = record.parentNode.parentNode.object;
458 458 else
459 459 panelObject = record.parentNode.object;
... ... @@ -463,7 +463,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
463 463 break;
464 464 case 'text-legend' :
465 465 var panelObject = null;
466   - if (!this.tabObject.get('tree-simplified-view'))
  466 + if (this.tabObject.get('tree-full-view'))
467 467 panelObject = record.parentNode.parentNode.object;
468 468 else
469 469 panelObject = record.parentNode.object;
... ... @@ -472,7 +472,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
472 472 break;
473 473 case 'constant' :
474 474 var panelObject = null;
475   - if (!this.tabObject.get('tree-simplified-view'))
  475 + if (this.tabObject.get('tree-full-view'))
476 476 panelObject = record.parentNode.parentNode.object;
477 477 else
478 478 panelObject = record.parentNode.object;
... ... @@ -481,7 +481,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
481 481 break;
482 482 case 'text-obj' :
483 483 var panelObject = null;
484   - if (!this.tabObject.get('tree-simplified-view'))
  484 + if (this.tabObject.get('tree-full-view'))
485 485 panelObject = record.parentNode.parentNode.object;
486 486 else
487 487 panelObject = record.parentNode.object;
... ... @@ -490,7 +490,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
490 490 break;
491 491 case 'curve' :
492 492 var panelObject = null;
493   - if (!this.tabObject.get('tree-simplified-view'))
  493 + if (this.tabObject.get('tree-full-view'))
494 494 panelObject = record.parentNode.parentNode.object;
495 495 else
496 496 panelObject = record.parentNode.object;
... ... @@ -499,7 +499,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
499 499 break;
500 500 case 'fill' :
501 501 var panelObject = null;
502   - if (!this.tabObject.get('tree-simplified-view'))
  502 + if (this.tabObject.get('tree-full-view'))
503 503 panelObject = record.parentNode.parentNode.object;
504 504 else
505 505 panelObject = record.parentNode.object;
... ... @@ -565,7 +565,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
565 565  
566 566 case 'amdaPlotObj.PlotParamTreeNode' :
567 567 var fromPanelObject = null;
568   - if (!this.tabObject.get('tree-simplified-view'))
  568 + if (this.tabObject.get('tree-full-view'))
569 569 {
570 570 fromPanelObject = record.parentNode.parentNode.object;
571 571 }
... ... @@ -582,7 +582,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
582 582 toPanelObject = targetNode.object;
583 583 break;
584 584 case 'amdaPlotObj.PlotParamTreeNode' :
585   - if (!this.tabObject.get('tree-simplified-view'))
  585 + if (this.tabObject.get('tree-full-view'))
586 586 {
587 587 toPanelObject = targetNode.parentNode.parentNode.object;
588 588 }
... ... @@ -607,6 +607,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
607 607 return false;
608 608 },
609 609  
  610 +<<<<<<< HEAD
610 611 dropParamToCreate: function (targetNode, position, paramId, paramComponents, isVector, is2d, plotOnly)
611 612 {
612 613 var panelObject = null;
... ... @@ -736,6 +737,109 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
736 737 return this.movePanel(record, targetNode, position);
737 738 default :
738 739 return false;
  740 +=======
  741 + dropParamToCreate : function(targetNode, position, paramId, paramComponents, isVector, is2d, plotOnly)
  742 + {
  743 + var panelObject = null;
  744 + if (targetNode == null)
  745 + {
  746 + //create new panel
  747 + panelObject = this.tabObject.createNewPanel();
  748 + }
  749 + else
  750 + {
  751 + switch (targetNode.$className)
  752 + {
  753 + case 'amdaPlotObj.PlotParamsTreeNode' :
  754 + case 'amdaPlotObj.PlotPanelTreeNode' :
  755 + case 'amdaPlotObj.PlotAxesTreeNode' :
  756 + panelObject = targetNode.object;
  757 + break;
  758 + case 'amdaPlotObj.PlotTimeAxisTreeNode' :
  759 + case 'amdaPlotObj.PlotEpochAxisTreeNode' :
  760 + case 'amdaPlotObj.PlotXAxisTreeNode' :
  761 + case 'amdaPlotObj.PlotYLeftAxisTreeNode' :
  762 + case 'amdaPlotObj.PlotYRightAxisTreeNode' :
  763 + case 'amdaPlotObj.PlotColorAxisTreeNode' :
  764 + case 'amdaPlotObj.PlotParamTreeNode' :
  765 + panelObject = targetNode.parentNode.object;
  766 + break;
  767 + default:
  768 + //create new panel
  769 + panelObject = this.tabObject.createNewPanel();
  770 + }
  771 + }
  772 +
  773 + //Create param object
  774 + var me = this;
  775 + panelObject.createNewParam(paramId, paramComponents, isVector, is2d, plotOnly, function (newParamObject) {
  776 + //Rebuild params node
  777 + me.buildPanelsNode(newParamObject.getId());
  778 + //BRE newParamObject
  779 + });
  780 + },
  781 +
  782 + dropRecord : function(record,targetNode,position)
  783 + {
  784 + var selModel = this.getSelectionModel();
  785 +
  786 + //select the target node if defined
  787 + if (targetNode)
  788 + selModel.select(targetNode);
  789 + else
  790 + selModel.deselectAll();
  791 +
  792 + switch (record.$className)
  793 + {
  794 + case 'amdaModel.LocalParamNode' :
  795 + case 'amdaModel.RemoteParamNode' :
  796 + case 'amdaModel.RemoteSimuParamNode' :
  797 + if (!record.get('isParameter') || record.get('disable'))
  798 + return false;
  799 +
  800 + if (record.get('alias') != "" )
  801 + this.dropParamToCreate(targetNode, position, "#"+record.get('alias'));
  802 + else {
  803 + var isVector = record.get('iconCls') == 'icon-vector';
  804 + var is2d = record.get('iconCls') == 'icon-2dspectra';
  805 + var component_info = record.get('component_info');
  806 + var param_id = record.get('id');
  807 + var plot_only = record.get('notyet');
  808 + var components = null;
  809 + if (component_info && component_info.parentId) {
  810 + //It's a component
  811 + param_id = component_info.parentId;
  812 + components = [];
  813 + if (component_info.index1)
  814 + components['index1'] = component_info.index1;
  815 + if (component_info.index2)
  816 + components['index2'] = component_info.index2;
  817 + }
  818 + this.dropParamToCreate(targetNode, position, param_id, components, isVector, is2d, plot_only);
  819 + }
  820 + return true;
  821 + case 'amdaModel.AliasNode' :
  822 + if (!record.isLeaf())
  823 + return false;
  824 + this.dropParamToCreate(targetNode, position, "#"+record.get('text'));
  825 + return true;
  826 + case 'amdaModel.DerivedParamNode' :
  827 + if (!record.isLeaf())
  828 + return false;
  829 + this.dropParamToCreate(targetNode, position, "ws_"+record.get('text'));
  830 + return true;
  831 + case 'amdaModel.MyDataParamNode' :
  832 + if (!record.isLeaf())
  833 + return false;
  834 + this.dropParamToCreate(targetNode, position, "wsd_"+record.get('text'));
  835 + return true;
  836 + case 'amdaPlotObj.PlotParamTreeNode' :
  837 + return this.moveParam(record,targetNode,position);
  838 + case 'amdaPlotObj.PlotPanelTreeNode' :
  839 + return this.movePanel(record,targetNode,position);
  840 + default :
  841 + return false;
  842 +>>>>>>> master
739 843 }
740 844 return false;
741 845 },
... ... @@ -846,7 +950,7 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
846 950  
847 951 init : function(config) {
848 952 var me = this;
849   -
  953 +
850 954 this.plotElementPanel = config.plotElementPanel;
851 955  
852 956 var store = Ext.create('Ext.data.TreeStore', {
... ... @@ -855,15 +959,22 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
855 959 }
856 960 });
857 961  
858   - this.plotElementPanel = config.plotElementPanel;
  962 + // this.plotElementPanel = config.plotElementPanel;
859 963  
860 964 this.simplifiedViewCombo = Ext.create('Ext.form.field.Checkbox', {
861 965 xtype: 'checkbox',
862   - boxLabel: 'Simplified View',
  966 + boxLabel: 'Extended Plot Options',
863 967 listeners: {
  968 +// render: function(c) {
  969 +// Ext.create('Ext.tip.ToolTip', {
  970 +// target: c.getEl(),
  971 +// html: "SOME TEXT"
  972 +// });
  973 +// },
864 974 change: function(combo, newValue, oldValue, eOpts) {
865 975 if (this.tabObject)
866   - this.tabObject.set('tree-simplified-view', newValue);
  976 + this.tabObject.set('tree-full-view', newValue);
  977 +
867 978 if (newValue != oldValue)
868 979 this.buildTree(this.tabObject);
869 980 },
... ... @@ -938,13 +1049,13 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
938 1049 },
939 1050 scope: this
940 1051 },
941   - '->',
  1052 + '-', '->',
942 1053 this.linkToMultiPlotCombo,
943 1054 ' ',
944 1055 this.simplifiedViewCombo
945 1056 ]
946 1057 };
947 1058  
948   - Ext.apply (this , Ext.apply (arguments, myConf));
  1059 + Ext.apply(this,Ext.apply(arguments, myConf));
949 1060 }
950 1061 });
951 1062 \ No newline at end of file
... ...
js/resources/css/amda.css
... ... @@ -329,6 +329,12 @@ background-image: url(../images/16x16/error.png) !important;
329 329 background-repeat: no-repeat;
330 330 }
331 331  
  332 +.icon-2dspectra {
  333 + background-image:url(../images/16x16/circle_orange2_.png) !important;
  334 + background-position: center;
  335 + background-repeat: no-repeat;
  336 +}
  337 +
332 338 .icon-unknowntype {
333 339 background-image:url(../images/14x14/circle_grey.png) !important;
334 340 background-position: center;
... ...
js/resources/images/16x16/circle_orange2_.png 0 โ†’ 100644

913 Bytes

php/classes/AmdaAction.php
... ... @@ -228,6 +228,7 @@ class AmdaAction
228 228 $isParameter = false;
229 229 $needsArgs = false;
230 230 $isSpectra = false;
  231 + $is2dSpectra = false;
231 232 $isStack = false;
232 233 $not_yet = false;
233 234  
... ... @@ -237,12 +238,16 @@ class AmdaAction
237 238  
238 239 if ($child->hasAttribute('dataStart') && $child->hasAttribute('dataStop')) {
239 240 $info .= "<br/>Time Range: ".$child->getAttribute('dataStart')."-".$child->getAttribute('dataStop');
  241 +
  242 + if ($child->hasAttribute('lastUpdate')) {
  243 + $info .= "<br/>Last Updated: : ".$child->getAttribute('lastUpdate');
  244 + }
240 245 }
241 246  
242 247 if ($child->getAttribute('dataStart') == 'depending on mission') {
243 248 $info .= "<br/>Time Range: ".$child->getAttribute('dataStart');
244 249 }
245   -
  250 +
246 251 // if ($child->getAttribute('restriction') > 1) {
247 252 // $restricted = $child->getAttribute('restriction');
248 253 // $info .= "<br/><b>Time Restriction</b>: -$restricted days";
... ... @@ -300,6 +305,8 @@ class AmdaAction
300 305 if ($child->getAttribute('display_type') == 'spectrogram') {
301 306 $needsArgs = true;
302 307 $isSpectra = true;
  308 + if (strpos($child->getAttribute('name'),'2D') !== false)
  309 + $is2dSpectra = true;
303 310 }
304 311 elseif ($child->getAttribute('display_type') == 'stackplot') {
305 312 $isStack = true;
... ... @@ -313,8 +320,8 @@ class AmdaAction
313 320 $childrenToReturn[] = array('text' => $name,'alias' => $alias,
314 321 'id' => $id,'nodeType' => $nodeType, 'info' => $info, "component_info" => $component_info,
315 322 'globalStart' => $globalStart, 'globalStop' => $globalStop, 'timeRestriction' => $timeRestriction,
316   - 'leaf' => $isLeaf, 'isParameter' => $isParameter,
317   - 'isSpectra' => $isSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet);
  323 + 'leaf' => $isLeaf, 'isParameter' => $isParameter,'isSpectra' => $isSpectra,
  324 + 'is2dSpectra' => $is2dSpectra,'isStack' => $isStack, 'needsArgs' => $needsArgs, 'help' => $help, 'notyet' => $not_yet);
318 325 }
319 326 else {
320 327 if ($child->tagName == 'mission' || $child->tagName == 'observatory') {
... ...
php/classes/SharedObjectMgrAbstract.php
... ... @@ -80,6 +80,43 @@ abstract class SharedObjectMgrAbstract {
80 80  
81 81 return array('success' => TRUE, 'object_id' => $newId);
82 82 }
  83 +
  84 + public function delete($folder_name, $objectId) {
  85 + $dst_folder_path = $this->getFolderDirPath($folder_name);
  86 + if (!is_dir($dst_folder_path))
  87 + return array('success' => false, 'message' => 'Cannot get folder path');
  88 +
  89 + $dst_header_path = $this->getHeaderDirPath($folder_name);
  90 + if (is_dir($dst_header_path)) {
  91 + $headerFilePath = $this->getHeaderFilePath($folder_name, $objectId);
  92 + if (is_file($headerFilePath)) {
  93 + unlink($headerFilePath);
  94 + }
  95 + }
  96 +
  97 + $dst_data_path = $this->getDataDirPath($folder_name);
  98 + if (is_dir($dst_data_path)) {
  99 + $dataFilePath = $this->getDataFilePath($folder_name, $objectId);
  100 + if (is_file($dataFilePath)) {
  101 + unlink($dataFilePath);
  102 + }
  103 + }
  104 +
  105 + return array('success' => TRUE, 'object_id' => $objectId);
  106 + }
  107 +
  108 + public function createFolder($folder_name) {
  109 + $folder_path = $this->getFolderDirPath($folder_name);
  110 + if (is_dir($folder_path)) {
  111 + return FALSE;
  112 + }
  113 +
  114 + mkdir($folder_path);
  115 + chgrp($folder_path, APACHE_USER);
  116 + chmod($folder_path, 0775);
  117 +
  118 + return is_dir($folder_path);
  119 + }
83 120  
84 121 public function getRootDirPath() {
85 122 return SHAREDPATH . "/" . $this->rootdirname;
... ... @@ -158,4 +195,4 @@ abstract class SharedObjectMgrAbstract {
158 195 }
159 196 }
160 197  
161   -?>
162 198 \ No newline at end of file
  199 +?>
... ...
php/classes/SharedObjectTreeFile.php
... ... @@ -50,9 +50,32 @@ class SharedObjectTreeFile {
50 50 $objectNode->setAttribute($key, $value);
51 51 }
52 52 }
53   -
  53 + $this->doc->save($this->getFilePath());
54 54  
55 55 //Remove obsolete folders and objects
  56 + $folders = $this->getFolders($object_type);
  57 + foreach ($folders as $folder) {
  58 + $folderNode = $this->getObjectFolderNode($object_type, $folder["name"]);
  59 + if (!isset($folderNode)) {
  60 + continue;
  61 + }
  62 + if (!array_key_exists($folder["name"], $objects)) {
  63 + $folderNode->parentNode->removeChild($folderNode);
  64 + }
  65 + else {
  66 + $objectNodes = $folderNode->getElementsByTagName($object_type);
  67 + $to_remove = array();
  68 + foreach ($objectNodes as $objectNode) {
  69 + $idAtt = $objectNode->getAttribute('xml:id');
  70 + if (!in_array($idAtt, $objects[$folder["name"]])) {
  71 + $to_remove[] = $objectNode;
  72 + }
  73 + }
  74 + foreach ($to_remove as $node) {
  75 + $folderNode->removeChild($node);
  76 + }
  77 + }
  78 + }
56 79  
57 80 $this->doc->save($this->getFilePath());
58 81  
... ... @@ -162,6 +185,34 @@ class SharedObjectTreeFile {
162 185 }
163 186 return "";
164 187 }
  188 +
  189 + public function getObjectsByName($object_type, $folder_name, $object_name) {
  190 + $folderNode = $this->getObjectFolderNode($object_type, $folder_name);
  191 +
  192 + if (!isset($folderNode))
  193 + return NULL;
  194 +
  195 + $objectNodes = $folderNode->getElementsByTagName($object_type);
  196 +
  197 + $result = array();
  198 + foreach ($objectNodes as $objectNode) {
  199 + if ($objectNode->getAttribute('name') == $object_name)
  200 + $result[] = $objectNode->getAttribute("xml:id");
  201 + }
  202 +
  203 + return $result;
  204 + }
  205 +
  206 + public function deleteObjectByObjectId($object_type, $folder_name, $object_id) {
  207 + $node = $this->getObjectNode($object_type, $folder_name, $object_id);
  208 + if (!isset($node)) {
  209 + return array('success' => FALSE, 'message' => 'Cannot retrieve object node in tree');
  210 + }
  211 + $node->parentNode->removeChild($node);
  212 + $this->doc->save($this->getFilePath());
  213 +
  214 + return array('success' => TRUE);
  215 + }
165 216  
166 217 private function init() {
167 218 if (!file_exists($this->getFilePath()))
... ... @@ -260,7 +311,7 @@ class SharedObjectTreeFile {
260 311  
261 312 return NULL;
262 313 }
263   -
  314 +
264 315 private function createObjectNode($object_type, $folder_name, $object_id) {
265 316 $listNode = $this->getObjectListNode($object_type);
266 317  
... ...
php/classes/SharedObjectsMgr.php
... ... @@ -50,6 +50,29 @@ class SharedObjectsMgr {
50 50  
51 51 return $result;
52 52 }
  53 +
  54 + public function update($object_type, $object_name, $folder_id, $src_object_path, $description, $sharedBy) {
  55 + if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type]))
  56 + return array('success' => FALSE, 'message' => 'Unknown type');
  57 +
  58 + $folder_name = $this->treeFile->getFolderNameById($object_type, $folder_id);
  59 +
  60 + if (empty($folder_name))
  61 + return array('success' => FALSE, 'message' => 'Cannot retrieve folder');
  62 +
  63 + $objects = $this->treeFile->getObjectsByName($object_type, $folder_name, $object_name);
  64 +
  65 + if (!empty($objects)) {
  66 + //delete old objects
  67 + foreach ($objects as $object_id) {
  68 + $result = $this->treeFile->deleteObjectByObjectId($object_type, $folder_name, $object_id);
  69 + $result = $this->sharedObjectsMgr[$object_type]->delete($folder_name, $object_id);
  70 + }
  71 + }
  72 +
  73 + //add new object
  74 + return $this->add($object_type, $object_name, $folder_id, $src_object_path, $description, $sharedBy);
  75 + }
53 76  
54 77 public function getFolders($object_type) {
55 78 if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type]))
... ... @@ -57,6 +80,18 @@ class SharedObjectsMgr {
57 80  
58 81 return $this->treeFile->getFolders($object_type);
59 82 }
  83 +
  84 + public function createFolder($object_type, $folder_name) {
  85 + if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type])) {
  86 + return array('success' => FALSE, 'message' => 'Unknown type');
  87 + }
  88 +
  89 + if (!$this->sharedObjectsMgr[$object_type]->createFolder($folder_name)) {
  90 + return array('success' => FALSE, 'message' => 'Cannot create folder '.$folder_name);
  91 + }
  92 +
  93 + return $this->updateTree();
  94 + }
60 95  
61 96 public function isNameAlreadyUsed($object_type, $name) {
62 97 if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type]))
... ... @@ -96,4 +131,4 @@ class SharedObjectsMgr {
96 131 }
97 132 }
98 133  
99   -?>
100 134 \ No newline at end of file
  135 +?>
... ...
php/config.php
... ... @@ -87,6 +87,7 @@ define(&#39;RemoteData&#39;, DATAPATH.&#39;/RemoteData/&#39;);
87 87 define('Functions', DATAPATH.'/Functions/');
88 88 define('Hst', DATAPATH.'/Hst/');
89 89 define('SpecialSettingsDir',DATAPATH.'/SpecialSettings/');
  90 +define('CommonLib', DATAPATH.'/compilation/lib/');
90 91  
91 92 // General Info files
92 93 define('orbitsXml',LocalData.'/Orbites.xml');
... ...
update_amda/generate_param_info
... ... @@ -35,7 +35,8 @@ do
35 35  
36 36 if [ -e $PARAM_INFO_PATH/$info_file ]
37 37 then
38   - echo ${param_filename} exists
  38 + #echo ${param_filename} exists
  39 + temp=a
39 40 else
40 41 echo "Generate info file for ${param_filename}"
41 42 php $UPDATEDIR/preprocessInfo.php ${param_filename}
... ... @@ -48,39 +49,40 @@ if [ ! -e ./app.properties ]; then
48 49 exit
49 50 fi
50 51  
51   -if [ -e ./app.properties.temp ]; then
52   - # rm ./app.properties.temp
53   - echo "Seems ./app.properties has been modified already"
54   -else
55   - while read line
56   - do
57   -
58   - if [[ $line == app.param.path* ]]; then
59   - line="app.param.path="$NEWMETA"final/"
60   - fi
61   -
62   - if [[ $line == app.dataSetInfo.path* ]]; then
63   - line="app.dataSetInfo.path="$NEWMETA"datasets/"
64   - fi
65   -
66   - if [[ $line == app.user.name* ]]; then
67   - line="app.user.name="$DDUSER
68   - fi
69   -
70   - if [[ $line == app.plugin* ]]; then
71   - line="app.plugin=./../build/"$KERNEL_BUILD_TYPE"/plugin/"
72   - fi
73   -
74   - if [[ $line == app.process.LIB* ]]; then
75   - line="app.process.LIB=-L../build/"$KERNEL_BUILD_TYPE"/lib/ -lParameters"
76   - fi
77   -
78   - echo $line >> ./app.properties.temp
79   -
80   - done < <(cat $AMDA_KERNEL_DIR/app-generate-paraminfo/app.properties)
  52 +# if [ -e ./app.properties.temp ]; then
  53 +# # rm ./app.properties.temp
  54 +# echo "Seems ./app.properties has been modified already"
  55 +# else
  56 +# modify app.properties in any case !
  57 +while read line
  58 + do
81 59  
82   - cp ./app.properties.temp $AMDA_KERNEL_DIR/app-generate-paraminfo/app.properties
83   -fi
  60 + if [[ $line == app.param.path* ]]; then
  61 + line="app.param.path="$NEWMETA"final/"
  62 + fi
  63 +
  64 + if [[ $line == app.dataSetInfo.path* ]]; then
  65 + line="app.dataSetInfo.path="$NEWMETA"datasets/"
  66 + fi
  67 +
  68 + if [[ $line == app.user.name* ]]; then
  69 + line="app.user.name="$DDUSER
  70 + fi
  71 +
  72 + if [[ $line == app.plugin* ]]; then
  73 + line="app.plugin=./../build/"$KERNEL_BUILD_TYPE"/plugin/"
  74 + fi
  75 +
  76 + if [[ $line == app.process.LIB* ]]; then
  77 + line="app.process.LIB=-L../build/"$KERNEL_BUILD_TYPE"/lib/ -lParameters"
  78 + fi
  79 +
  80 + echo $line >> ./app.properties.temp
  81 +
  82 + done < <(cat $AMDA_KERNEL_DIR/app-generate-paraminfo/app.properties)
  83 +
  84 +cp ./app.properties.temp $AMDA_KERNEL_DIR/app-generate-paraminfo/app.properties
  85 +#fi
84 86  
85 87  
86 88 DDLogin $DDUSER $DDPASS
... ... @@ -92,7 +94,8 @@ do
92 94  
93 95 if [ -e $NEWMETA/ParamInfo/$info_file ]
94 96 then
95   - echo ${param_filename} exists
  97 + # echo ${param_filename} exists
  98 + temp=a
96 99 else
97 100 echo "Generate info file for ${param_filename}"
98 101 amdaParameterInfo -p ${param_filename}
... ...
update_amda/updateAmda
... ... @@ -101,7 +101,7 @@
101 101 cp $RemoteData/PARAMS/* $PARAMS_LOCALDB_DIR/
102 102 fi
103 103 fi
104   - # Update StartStop only
  104 + # Update StartStop & Help only
105 105 if [ $UPDATE ]
106 106 then
107 107 echo "Updating...."
... ... @@ -114,6 +114,11 @@
114 114 fi
115 115  
116 116 echo 'update in NEWMETA/dd_missions: done'
  117 + echo 'update in NEWMETA/help: done'
  118 +
  119 + cp $NEWMETA/help/* $HelpAuto
  120 +
  121 + echo "copy $NEWMETA/help/ to $HelpAuto : done"
117 122  
118 123 echo "making Tree..."
119 124 php $UPDATEDIR/makeTree.php
... ...