Commit 2a243af42a5073c8818a670d1ee78835d18e44dd
Exists in
master
and in
106 other branches
merging master
Showing
27 changed files
with
427 additions
and
191 deletions
Show diff stats
generic_data/Functions/constants.xml
1 | <?xml version="1.0"?> | 1 | <?xml version="1.0"?> |
2 | <constants> | 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 | </constants> | 37 | </constants> |
generic_data/Functions/functions.xml
@@ -88,14 +88,18 @@ | @@ -88,14 +88,18 @@ | ||
88 | <prompt/> | 88 | <prompt/> |
89 | <info_brief>GSE to SM transformation</info_brief> | 89 | <info_brief>GSE to SM transformation</info_brief> |
90 | </function>--> | 90 | </function>--> |
91 | - <function name="cross(,)" params="2" kind="math"> | 91 | + <function name="cross(,)" params="2" kind="vectors"> |
92 | <info_brief>Cross product</info_brief> | 92 | <info_brief>Cross product</info_brief> |
93 | <new_kernel>cross</new_kernel> | 93 | <new_kernel>cross</new_kernel> |
94 | </function> | 94 | </function> |
95 | - <function name="dot(,)" params="2" kind="math"> | 95 | + <function name="dot(,)" params="2" kind="vectors"> |
96 | <info_brief>Dot product</info_brief> | 96 | <info_brief>Dot product</info_brief> |
97 | <new_kernel>dot</new_kernel> | 97 | <new_kernel>dot</new_kernel> |
98 | </function> | 98 | </function> |
99 | + <function name="module()" kind="vectors"> | ||
100 | + <info_brief>Magnitude</info_brief> | ||
101 | + <new_kernel>magnitude</new_kernel> | ||
102 | + </function> | ||
99 | <function name="abs()" kind="math"> | 103 | <function name="abs()" kind="math"> |
100 | <info_brief>Absolute value</info_brief> | 104 | <info_brief>Absolute value</info_brief> |
101 | <new_kernel>abs</new_kernel> | 105 | <new_kernel>abs</new_kernel> |
help/plotHOWTO
1 | <li>1. To plot a parameter <i>drag</i> it from the Parameters tree and <i>drop</i> onto the panel | 1 | <li>1. To plot a parameter <i>drag</i> it from the Parameters tree and <i>drop</i> onto the panel |
2 | <li>2. <i>Link to MultiPlot</i> replaces the individual plot tab TimeSelector with the common for all plot tabs "MultiTime" Selector | 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 | \ No newline at end of file | 6 | \ No newline at end of file |
js/app/models/Constant.js
@@ -20,6 +20,7 @@ Ext.define('amdaModel.Constant', { | @@ -20,6 +20,7 @@ Ext.define('amdaModel.Constant', { | ||
20 | 20 | ||
21 | fields : [ | 21 | fields : [ |
22 | {name: 'name', mapping: '@name', type:'string'}, | 22 | {name: 'name', mapping: '@name', type:'string'}, |
23 | + {name: 'kind', mapping: '@kind', type: 'string', defaultValue: 'space'}, | ||
23 | {name: 'info', mapping: '@info', type:'string'}, | 24 | {name: 'info', mapping: '@info', type:'string'}, |
24 | {name: 'units', mapping: '@units', type: 'string', defaultValue: ''}, | 25 | {name: 'units', mapping: '@units', type: 'string', defaultValue: ''}, |
25 | {name: 'value', mapping: ' ', type: 'string'} | 26 | {name: 'value', mapping: ' ', type: 'string'} |
js/app/models/InteractiveNode.js
@@ -28,8 +28,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -28,8 +28,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
28 | statics: { | 28 | statics: { |
29 | preloadNodes : function(node,onready) | 29 | preloadNodes : function(node,onready) |
30 | { | 30 | { |
31 | - var me = this; | ||
32 | - | 31 | + var me = this; |
33 | var nodesToLoad = new Array(); | 32 | var nodesToLoad = new Array(); |
34 | nodesToLoad.push(node); | 33 | nodesToLoad.push(node); |
35 | this.preloadTreeNode(node, nodesToLoad, function (node) | 34 | this.preloadTreeNode(node, nodesToLoad, function (node) |
@@ -131,7 +130,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -131,7 +130,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
131 | } | 130 | } |
132 | module.setContextNode(contextNode); | 131 | module.setContextNode(contextNode); |
133 | 132 | ||
134 | - } else if (module.getLinkedNode() != null){ | 133 | + } else if (module.getLinkedNode() != null){ |
135 | //TODO the node to edit is already edited | 134 | //TODO the node to edit is already edited |
136 | // myDesktopApp.warningMsg('This object is being edited'); | 135 | // myDesktopApp.warningMsg('This object is being edited'); |
137 | //Sol1: msg alert: "warning this node is already edited! If you want to get the original, please press the 'reset' button"->'OK' | 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('amdaModel.InteractiveNode', { | @@ -237,7 +236,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
237 | if (!this.get('contextNode') || (this.get('contextNode').data.id == 'sharedtimeTable-treeRootNode') || (this.get('contextNode').data.id == 'sharedcatalog-treeRootNode')) { | 236 | if (!this.get('contextNode') || (this.get('contextNode').data.id == 'sharedtimeTable-treeRootNode') || (this.get('contextNode').data.id == 'sharedcatalog-treeRootNode')) { |
238 | // set the root node of 'Derived Parameters' tree as contextNode | 237 | // set the root node of 'Derived Parameters' tree as contextNode |
239 | this.set('contextNode',this.getRootNode()); | 238 | this.set('contextNode',this.getRootNode()); |
240 | - } | 239 | + } |
241 | // call the Ext.Direct method to create parameter | 240 | // call the Ext.Direct method to create parameter |
242 | AmdaAction.createObject(this.get('object').getJsonValues(false), this.get('contextNode').get('id'), function(res,e){ | 241 | AmdaAction.createObject(this.get('object').getJsonValues(false), this.get('contextNode').get('id'), function(res,e){ |
243 | //success | 242 | //success |
@@ -258,12 +257,13 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -258,12 +257,13 @@ Ext.define('amdaModel.InteractiveNode', { | ||
258 | } | 257 | } |
259 | // set text of this node | 258 | // set text of this node |
260 | this.set('text',this.get('object').get('name')); | 259 | this.set('text',this.get('object').get('name')); |
260 | + | ||
261 | //set id of this node | 261 | //set id of this node |
262 | this.set('id',res.id); | 262 | this.set('id',res.id); |
263 | this.internalId = res.id; | 263 | this.internalId = res.id; |
264 | + | ||
264 | // set id of node's object | 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 | if (res.created){ | 267 | if (res.created){ |
268 | // set the created date | 268 | // set the created date |
269 | this.get('object').set('created',res.created); | 269 | this.get('object').set('created',res.created); |
@@ -577,45 +577,54 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -577,45 +577,54 @@ Ext.define('amdaModel.InteractiveNode', { | ||
577 | if (this.parentNode) { | 577 | if (this.parentNode) { |
578 | if (this.isLeaf()){ | 578 | if (this.isLeaf()){ |
579 | var moduleId = this.get('moduleId'); | 579 | var moduleId = this.get('moduleId'); |
580 | - // if really interactive node | 580 | + // if really interactive node |
581 | if (moduleId) { | 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 | //update mask info in myData | 630 | //update mask info in myData |
js/app/models/LocalParamNode.js
@@ -65,6 +65,9 @@ Ext.define('amdaModel.LocalParamNode', | @@ -65,6 +65,9 @@ Ext.define('amdaModel.LocalParamNode', | ||
65 | 65 | ||
66 | if (this.get('isStack') || this.get('isSpectra')) | 66 | if (this.get('isStack') || this.get('isSpectra')) |
67 | this.set('iconCls', 'icon-spectra'); | 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('amdaPlotObj.PlotObjectConfig', { | @@ -23,7 +23,7 @@ Ext.define('amdaPlotObj.PlotObjectConfig', { | ||
23 | oneFilePerInterval: false | 23 | oneFilePerInterval: false |
24 | }, | 24 | }, |
25 | tree : { | 25 | tree : { |
26 | - simplifiedView : true | 26 | + fullView : false |
27 | }, | 27 | }, |
28 | page : { | 28 | page : { |
29 | xMargin : 5., | 29 | xMargin : 5., |
js/app/models/PlotObjects/PlotPanelObject.js
@@ -280,7 +280,7 @@ Ext.define('amdaPlotObj.PlotPanelObject', { | @@ -280,7 +280,7 @@ Ext.define('amdaPlotObj.PlotPanelObject', { | ||
280 | } | 280 | } |
281 | }, | 281 | }, |
282 | 282 | ||
283 | - createNewParam: function(paramId, paramComponents, isVector, plotOnly, onAfterCreate) { | 283 | + createNewParam: function(paramId, paramComponents, isVector, is2d, plotOnly, onAfterCreate) { |
284 | this.set('last-param-id', this.get('last-param-id') + 1); | 284 | this.set('last-param-id', this.get('last-param-id') + 1); |
285 | 285 | ||
286 | var emptyPanel = (this.params().getCount() == 0); | 286 | var emptyPanel = (this.params().getCount() == 0); |
@@ -304,7 +304,9 @@ Ext.define('amdaPlotObj.PlotPanelObject', { | @@ -304,7 +304,9 @@ Ext.define('amdaPlotObj.PlotPanelObject', { | ||
304 | recs[0].set('dim2-index', paramComponents['index2']); | 304 | recs[0].set('dim2-index', paramComponents['index2']); |
305 | } | 305 | } |
306 | } | 306 | } |
307 | - | 307 | + |
308 | + if (is2d) | ||
309 | + recs[0].set('dim2-index','0'); | ||
308 | // activate legend if vector & TimePlot | 310 | // activate legend if vector & TimePlot |
309 | if ( isVector && this.get('panel-plot-type') == 'timePlot' ) { | 311 | if ( isVector && this.get('panel-plot-type') == 'timePlot' ) { |
310 | this.loadSeriesLegend(); | 312 | this.loadSeriesLegend(); |
js/app/models/PlotObjects/PlotParamObject.js
@@ -58,6 +58,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { | @@ -58,6 +58,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { | ||
58 | return; | 58 | return; |
59 | this.set('param-drawing-object', this.createDrawingObjectByType(this.get('param-drawing-type'), drawing)); | 59 | this.set('param-drawing-object', this.createDrawingObjectByType(this.get('param-drawing-type'), drawing)); |
60 | drawingObject.dirty = false; | 60 | drawingObject.dirty = false; |
61 | + | ||
61 | }, | 62 | }, |
62 | 63 | ||
63 | createDrawingObjectByType : function(type, data) | 64 | createDrawingObjectByType : function(type, data) |
js/app/models/PlotObjects/PlotTabObject.js
@@ -27,7 +27,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | @@ -27,7 +27,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | ||
27 | 27 | ||
28 | fields : [ | 28 | fields : [ |
29 | {name: 'id', type: 'int'}, | 29 | {name: 'id', type: 'int'}, |
30 | - {name: 'tree-simplified-view', type: 'boolean'}, | 30 | + {name: 'tree-full-view', type: 'boolean'}, |
31 | {name: 'multi-plot-linked', type: 'boolean'}, | 31 | {name: 'multi-plot-linked', type: 'boolean'}, |
32 | {name: 'page-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set | 32 | {name: 'page-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set |
33 | {name: 'panels-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set | 33 | {name: 'panels-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set |
@@ -153,7 +153,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | @@ -153,7 +153,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | ||
153 | 153 | ||
154 | setDefaultValues: function() | 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 | this.set('multi-plot-linked', false); | 158 | this.set('multi-plot-linked', false); |
159 | 159 | ||
@@ -223,7 +223,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | @@ -223,7 +223,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | ||
223 | var tabValues = new Object(); | 223 | var tabValues = new Object(); |
224 | 224 | ||
225 | tabValues['id'] = this.get('id'); | 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 | tabValues['multi-plot-linked'] = this.get('multi-plot-linked'); | 227 | tabValues['multi-plot-linked'] = this.get('multi-plot-linked'); |
228 | tabValues['page-node-state'] = this.get('page-node-state'); | 228 | tabValues['page-node-state'] = this.get('page-node-state'); |
229 | tabValues['panels-node-state'] = this.get('panels-node-state'); | 229 | tabValues['panels-node-state'] = this.get('panels-node-state'); |
js/app/views/CalculatorUI.js
@@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
15 | */ | 15 | */ |
16 | 16 | ||
17 | var CalculatorData = ['1','2','3','4','5','6','7','8','9','0','(',')','[',']','+','-','*','/','^', '.','>','<', '&', '|']; | 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 | Ext.define('amdaUI.CalculatorUI', { | 20 | Ext.define('amdaUI.CalculatorUI', { |
20 | extend: 'Ext.util.Observable', | 21 | extend: 'Ext.util.Observable', |
@@ -93,12 +94,12 @@ Ext.define('amdaUI.CalculatorUI', { | @@ -93,12 +94,12 @@ Ext.define('amdaUI.CalculatorUI', { | ||
93 | scope : this, | 94 | scope : this, |
94 | callback: function(records, operation, success) | 95 | callback: function(records, operation, success) |
95 | { | 96 | { |
96 | - this.createConstantBtns(); | 97 | + this.createAllConstantBtns(); |
97 | } | 98 | } |
98 | }); | 99 | }); |
99 | } | 100 | } |
100 | else | 101 | else |
101 | - this.createConstantBtns(); | 102 | + this.createAllConstantBtns(); |
102 | 103 | ||
103 | //load functions store | 104 | //load functions store |
104 | if (!amdaUI.CalculatorUI.functionStore) | 105 | if (!amdaUI.CalculatorUI.functionStore) |
@@ -148,8 +149,10 @@ Ext.define('amdaUI.CalculatorUI', { | @@ -148,8 +149,10 @@ Ext.define('amdaUI.CalculatorUI', { | ||
148 | defaults: { xtype: 'button', columnWidth: .11}, | 149 | defaults: { xtype: 'button', columnWidth: .11}, |
149 | items: this.getItems('Calculator') | 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 | id : 'calc_tab_const_id' | 156 | id : 'calc_tab_const_id' |
154 | }, { | 157 | }, { |
155 | title: 'Functions', xtype:'tabpanel', //iconCls: 'tabs', | 158 | title: 'Functions', xtype:'tabpanel', //iconCls: 'tabs', |
@@ -337,14 +340,50 @@ Ext.define('amdaUI.CalculatorUI', { | @@ -337,14 +340,50 @@ Ext.define('amdaUI.CalculatorUI', { | ||
337 | return btns; | 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 | var constTab = this.win.query('#calc_tab_const_id'); | 361 | var constTab = this.win.query('#calc_tab_const_id'); |
342 | - | 362 | + |
343 | if (constTab.length < 1) | 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 | amdaUI.CalculatorUI.constantStore.each( function(c){ | 385 | amdaUI.CalculatorUI.constantStore.each( function(c){ |
347 | - constTab[0].add( | 386 | + crtTab.add( |
348 | { | 387 | { |
349 | text: c.get('name'), | 388 | text: c.get('name'), |
350 | tooltip: c.get('units') == '' ? c.get('info')+'<br/>'+c.get('value') : | 389 | tooltip: c.get('units') == '' ? c.get('info')+'<br/>'+c.get('value') : |
@@ -365,15 +404,10 @@ Ext.define('amdaUI.CalculatorUI', { | @@ -365,15 +404,10 @@ Ext.define('amdaUI.CalculatorUI', { | ||
365 | } | 404 | } |
366 | }); | 405 | }); |
367 | },this); | 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 | createFunctionBtns : function(item, tabTitle) | 412 | createFunctionBtns : function(item, tabTitle) |
379 | { | 413 | { |
@@ -396,6 +430,9 @@ Ext.define('amdaUI.CalculatorUI', { | @@ -396,6 +430,9 @@ Ext.define('amdaUI.CalculatorUI', { | ||
396 | case 'FunctionsSliding' : | 430 | case 'FunctionsSliding' : |
397 | amdaUI.CalculatorUI.functionStore.filter('kind','sliding'); | 431 | amdaUI.CalculatorUI.functionStore.filter('kind','sliding'); |
398 | break; | 432 | break; |
433 | + case 'VectorFunctions' : | ||
434 | + amdaUI.CalculatorUI.functionStore.filter('kind','vector'); | ||
435 | + break; | ||
399 | } | 436 | } |
400 | 437 | ||
401 | var crtTab = funcTab[0].add( | 438 | var crtTab = funcTab[0].add( |
js/app/views/ParamArgumentsPlug.js
@@ -66,7 +66,7 @@ Ext.define('amdaUI.ParamArgumentsPlug', { | @@ -66,7 +66,7 @@ Ext.define('amdaUI.ParamArgumentsPlug', { | ||
66 | { | 66 | { |
67 | this.win = new Ext.Window({ | 67 | this.win = new Ext.Window({ |
68 | id: prefixId + '-param-arg-win', | 68 | id: prefixId + '-param-arg-win', |
69 | - width: 200, | 69 | + width: 280, |
70 | height: 150, | 70 | height: 150, |
71 | x: 0, y: 0, | 71 | x: 0, y: 0, |
72 | baseCls:'x-panel', | 72 | baseCls:'x-panel', |
js/app/views/ParamArgumentsUI.js
@@ -19,7 +19,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { | @@ -19,7 +19,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { | ||
19 | onChange: null, | 19 | onChange: null, |
20 | onModifyHeight: null, | 20 | onModifyHeight: null, |
21 | pluginOwner: null, | 21 | pluginOwner: null, |
22 | - | 22 | + isFirstMsg : true, |
23 | // -1 -> unknown, 0 -> scalar, 1 -> Tab1D, 2 -> Tab2D | 23 | // -1 -> unknown, 0 -> scalar, 1 -> Tab1D, 2 -> Tab2D |
24 | paramType: 0, | 24 | paramType: 0, |
25 | 25 | ||
@@ -59,6 +59,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { | @@ -59,6 +59,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { | ||
59 | } | 59 | } |
60 | else | 60 | else |
61 | me.unmask(); | 61 | me.unmask(); |
62 | + | ||
62 | }, | 63 | }, |
63 | 64 | ||
64 | rebuildAll: function(paramInfoResult , uiScope) { | 65 | rebuildAll: function(paramInfoResult , uiScope) { |
@@ -211,7 +212,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { | @@ -211,7 +212,7 @@ Ext.define('amdaUI.ParamArgumentsUI', { | ||
211 | indexes.push({'key' : component.index_2, 'value' : index + ' : ' + component.name}); | 212 | indexes.push({'key' : component.index_2, 'value' : index + ' : ' + component.name}); |
212 | }); | 213 | }); |
213 | } | 214 | } |
214 | - | 215 | + |
215 | //Add combo box | 216 | //Add combo box |
216 | var indexesStore = Ext.create('Ext.data.Store', { | 217 | var indexesStore = Ext.create('Ext.data.Store', { |
217 | fields: ['key', 'value'], | 218 | fields: ['key', 'value'], |
@@ -224,13 +225,29 @@ Ext.define('amdaUI.ParamArgumentsUI', { | @@ -224,13 +225,29 @@ Ext.define('amdaUI.ParamArgumentsUI', { | ||
224 | queryMode: 'local', | 225 | queryMode: 'local', |
225 | displayField: 'value', | 226 | displayField: 'value', |
226 | valueField: 'key', | 227 | valueField: 'key', |
227 | - value: '*', | 228 | + value: '*', |
228 | editable: false, | 229 | editable: false, |
229 | argId: relatedDim, | 230 | argId: relatedDim, |
230 | hidden: (relatedTable ? relatedTable.variable : false), | 231 | hidden: (relatedTable ? relatedTable.variable : false), |
231 | listeners: { | 232 | listeners: { |
232 | change: function(field, newValue, oldValue, eOpts) { | 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 | if (this.onChange != null) | 251 | if (this.onChange != null) |
235 | this.onChange(uiScope, relatedDim, newValue, oldValue, false); | 252 | this.onChange(uiScope, relatedDim, newValue, oldValue, false); |
236 | }, | 253 | }, |
js/app/views/ParameterUI.js
@@ -49,8 +49,9 @@ Ext.define('amdaUI.ParameterUI', | @@ -49,8 +49,9 @@ Ext.define('amdaUI.ParameterUI', | ||
49 | addParam : function(newParamName, isLeaf, needArgs, components) | 49 | addParam : function(newParamName, isLeaf, needArgs, components) |
50 | { | 50 | { |
51 | //if (!isLeaf || needArgs || components) | 51 | //if (!isLeaf || needArgs || components) |
52 | - // this.editParameterArgs(newParamName, components); | ||
53 | - //else | 52 | + if ( needArgs ) |
53 | + this.editParameterArgs(newParamName, components); | ||
54 | + else | ||
54 | this.addParamInEditor(newParamName); | 55 | this.addParamInEditor(newParamName); |
55 | }, | 56 | }, |
56 | 57 |
js/app/views/PlotComponents/PlotPanelForm.js
@@ -119,7 +119,7 @@ Ext.define('amdaPlotComp.PlotPanelForm', { | @@ -119,7 +119,7 @@ Ext.define('amdaPlotComp.PlotPanelForm', { | ||
119 | if (value != me.object.get('panel-plot-type')) | 119 | if (value != me.object.get('panel-plot-type')) |
120 | { | 120 | { |
121 | me.object.changePlotType(value); | 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 | me.crtTree.buildPanelAxesNode(me.object); | 124 | me.crtTree.buildPanelAxesNode(me.object); |
125 | me.crtTree.buildPanelAdditionalObjectsNode(me.object); | 125 | me.crtTree.buildPanelAdditionalObjectsNode(me.object); |
js/app/views/PlotComponents/PlotTree.js
@@ -46,15 +46,11 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -46,15 +46,11 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
46 | this.store.getRootNode().removeAll(); | 46 | this.store.getRootNode().removeAll(); |
47 | 47 | ||
48 | this.tabObject = tabObject; | 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 | //Page Node | 52 | //Page Node |
56 | var pageNode = this.store.getRootNode().appendChild(new amdaPlotObj.PlotPageTreeNode({object : tabObject})); | 53 | var pageNode = this.store.getRootNode().appendChild(new amdaPlotObj.PlotPageTreeNode({object : tabObject})); |
57 | - | ||
58 | //Layout node | 54 | //Layout node |
59 | pageNode.appendChild(new amdaPlotObj.PlotLayoutTreeNode({object : tabObject})); | 55 | pageNode.appendChild(new amdaPlotObj.PlotLayoutTreeNode({object : tabObject})); |
60 | 56 | ||
@@ -63,8 +59,12 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -63,8 +59,12 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
63 | } | 59 | } |
64 | else | 60 | else |
65 | this.panelsNode = this.store.getRootNode(); | 61 | this.panelsNode = this.store.getRootNode(); |
66 | - | 62 | + |
63 | + this.suspendLayouts(); | ||
67 | this.buildPanelsNode(); | 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 | buildPanelsNode: function(paramNodeToSelect) { | 70 | buildPanelsNode: function(paramNodeToSelect) { |
@@ -137,7 +137,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -137,7 +137,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
137 | //Retrieve corresponding panel node | 137 | //Retrieve corresponding panel node |
138 | if (panelNode.object == panelObject) | 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 | //Retrieve params node | 142 | //Retrieve params node |
143 | paramsNode = panelNode.findChild('type', 'params'); | 143 | paramsNode = panelNode.findChild('type', 'params'); |
@@ -283,7 +283,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -283,7 +283,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
283 | 283 | ||
284 | addPanelNode: function(panelObject, paramNodeToSelect) { | 284 | addPanelNode: function(panelObject, paramNodeToSelect) { |
285 | var panelNode = this.panelsNode.appendChild(new amdaPlotObj.PlotPanelTreeNode({object : panelObject})); | 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 | //Axes node | 288 | //Axes node |
289 | this.buildPanelAxesNode(panelObject); | 289 | this.buildPanelAxesNode(panelObject); |
@@ -337,7 +337,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -337,7 +337,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
337 | var toIndex = targetNode.parentNode.indexOf(targetNode); | 337 | var toIndex = targetNode.parentNode.indexOf(targetNode); |
338 | 338 | ||
339 | var fromPanelObject = null; | 339 | var fromPanelObject = null; |
340 | - if (!this.tabObject.get('tree-simplified-view')) | 340 | + if (this.tabObject.get('tree-full-view')) |
341 | { | 341 | { |
342 | fromPanelObject = record.parentNode.parentNode.object; | 342 | fromPanelObject = record.parentNode.parentNode.object; |
343 | } | 343 | } |
@@ -374,7 +374,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -374,7 +374,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
374 | return true; | 374 | return true; |
375 | case 'amdaPlotObj.PlotParamTreeNode' : | 375 | case 'amdaPlotObj.PlotParamTreeNode' : |
376 | var toPanelObject = null; | 376 | var toPanelObject = null; |
377 | - if (!this.tabObject.get('tree-simplified-view')) | 377 | + if (this.tabObject.get('tree-full-view')) |
378 | { | 378 | { |
379 | toPanelObject = targetNode.parentNode.parentNode.object; | 379 | toPanelObject = targetNode.parentNode.parentNode.object; |
380 | } | 380 | } |
@@ -453,7 +453,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -453,7 +453,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
453 | break; | 453 | break; |
454 | case 'param' : | 454 | case 'param' : |
455 | var panelObject = null; | 455 | var panelObject = null; |
456 | - if (!this.tabObject.get('tree-simplified-view')) | 456 | + if (this.tabObject.get('tree-full-view')) |
457 | panelObject = record.parentNode.parentNode.object; | 457 | panelObject = record.parentNode.parentNode.object; |
458 | else | 458 | else |
459 | panelObject = record.parentNode.object; | 459 | panelObject = record.parentNode.object; |
@@ -463,7 +463,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -463,7 +463,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
463 | break; | 463 | break; |
464 | case 'text-legend' : | 464 | case 'text-legend' : |
465 | var panelObject = null; | 465 | var panelObject = null; |
466 | - if (!this.tabObject.get('tree-simplified-view')) | 466 | + if (this.tabObject.get('tree-full-view')) |
467 | panelObject = record.parentNode.parentNode.object; | 467 | panelObject = record.parentNode.parentNode.object; |
468 | else | 468 | else |
469 | panelObject = record.parentNode.object; | 469 | panelObject = record.parentNode.object; |
@@ -472,7 +472,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -472,7 +472,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
472 | break; | 472 | break; |
473 | case 'constant' : | 473 | case 'constant' : |
474 | var panelObject = null; | 474 | var panelObject = null; |
475 | - if (!this.tabObject.get('tree-simplified-view')) | 475 | + if (this.tabObject.get('tree-full-view')) |
476 | panelObject = record.parentNode.parentNode.object; | 476 | panelObject = record.parentNode.parentNode.object; |
477 | else | 477 | else |
478 | panelObject = record.parentNode.object; | 478 | panelObject = record.parentNode.object; |
@@ -481,7 +481,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -481,7 +481,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
481 | break; | 481 | break; |
482 | case 'text-obj' : | 482 | case 'text-obj' : |
483 | var panelObject = null; | 483 | var panelObject = null; |
484 | - if (!this.tabObject.get('tree-simplified-view')) | 484 | + if (this.tabObject.get('tree-full-view')) |
485 | panelObject = record.parentNode.parentNode.object; | 485 | panelObject = record.parentNode.parentNode.object; |
486 | else | 486 | else |
487 | panelObject = record.parentNode.object; | 487 | panelObject = record.parentNode.object; |
@@ -490,7 +490,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -490,7 +490,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
490 | break; | 490 | break; |
491 | case 'curve' : | 491 | case 'curve' : |
492 | var panelObject = null; | 492 | var panelObject = null; |
493 | - if (!this.tabObject.get('tree-simplified-view')) | 493 | + if (this.tabObject.get('tree-full-view')) |
494 | panelObject = record.parentNode.parentNode.object; | 494 | panelObject = record.parentNode.parentNode.object; |
495 | else | 495 | else |
496 | panelObject = record.parentNode.object; | 496 | panelObject = record.parentNode.object; |
@@ -499,7 +499,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -499,7 +499,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
499 | break; | 499 | break; |
500 | case 'fill' : | 500 | case 'fill' : |
501 | var panelObject = null; | 501 | var panelObject = null; |
502 | - if (!this.tabObject.get('tree-simplified-view')) | 502 | + if (this.tabObject.get('tree-full-view')) |
503 | panelObject = record.parentNode.parentNode.object; | 503 | panelObject = record.parentNode.parentNode.object; |
504 | else | 504 | else |
505 | panelObject = record.parentNode.object; | 505 | panelObject = record.parentNode.object; |
@@ -565,7 +565,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -565,7 +565,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
565 | 565 | ||
566 | case 'amdaPlotObj.PlotParamTreeNode' : | 566 | case 'amdaPlotObj.PlotParamTreeNode' : |
567 | var fromPanelObject = null; | 567 | var fromPanelObject = null; |
568 | - if (!this.tabObject.get('tree-simplified-view')) | 568 | + if (this.tabObject.get('tree-full-view')) |
569 | { | 569 | { |
570 | fromPanelObject = record.parentNode.parentNode.object; | 570 | fromPanelObject = record.parentNode.parentNode.object; |
571 | } | 571 | } |
@@ -582,7 +582,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -582,7 +582,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
582 | toPanelObject = targetNode.object; | 582 | toPanelObject = targetNode.object; |
583 | break; | 583 | break; |
584 | case 'amdaPlotObj.PlotParamTreeNode' : | 584 | case 'amdaPlotObj.PlotParamTreeNode' : |
585 | - if (!this.tabObject.get('tree-simplified-view')) | 585 | + if (this.tabObject.get('tree-full-view')) |
586 | { | 586 | { |
587 | toPanelObject = targetNode.parentNode.parentNode.object; | 587 | toPanelObject = targetNode.parentNode.parentNode.object; |
588 | } | 588 | } |
@@ -607,7 +607,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -607,7 +607,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
607 | return false; | 607 | return false; |
608 | }, | 608 | }, |
609 | 609 | ||
610 | - dropParamToCreate: function (targetNode, position, paramId, paramComponents, isVector, plotOnly) | 610 | + dropParamToCreate: function (targetNode, position, paramId, paramComponents, isVector, is2d, plotOnly) |
611 | { | 611 | { |
612 | var panelObject = null; | 612 | var panelObject = null; |
613 | if (targetNode == null) | 613 | if (targetNode == null) |
@@ -640,7 +640,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -640,7 +640,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
640 | 640 | ||
641 | //Create param object | 641 | //Create param object |
642 | var me = this; | 642 | var me = this; |
643 | - panelObject.createNewParam(paramId, paramComponents, isVector, plotOnly, function (newParamObject) { | 643 | + panelObject.createNewParam(paramId, paramComponents, isVector, is2d, plotOnly, function (newParamObject) { |
644 | //Rebuild params node | 644 | //Rebuild params node |
645 | me.buildPanelsNode(newParamObject.getId()); | 645 | me.buildPanelsNode(newParamObject.getId()); |
646 | //BRE newParamObject | 646 | //BRE newParamObject |
@@ -669,6 +669,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -669,6 +669,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
669 | this.dropParamToCreate(targetNode, position, "#" + record.get('alias')); | 669 | this.dropParamToCreate(targetNode, position, "#" + record.get('alias')); |
670 | else { | 670 | else { |
671 | var isVector = record.get('iconCls') == 'icon-vector'; | 671 | var isVector = record.get('iconCls') == 'icon-vector'; |
672 | + var is2d = record.get('iconCls') == 'icon-2dspectra'; | ||
672 | var component_info = record.get('component_info'); | 673 | var component_info = record.get('component_info'); |
673 | var param_id = record.get('id'); | 674 | var param_id = record.get('id'); |
674 | var plot_only = record.get('notyet'); | 675 | var plot_only = record.get('notyet'); |
@@ -682,7 +683,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -682,7 +683,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
682 | if (component_info.index2) | 683 | if (component_info.index2) |
683 | components['index2'] = component_info.index2; | 684 | components['index2'] = component_info.index2; |
684 | } | 685 | } |
685 | - this.dropParamToCreate(targetNode, position, param_id, components, isVector, plot_only); | 686 | + this.dropParamToCreate(targetNode, position, param_id, components, isVector, is2d, plot_only); |
686 | } | 687 | } |
687 | return true; | 688 | return true; |
688 | case 'amdaModel.AliasNode' : | 689 | case 'amdaModel.AliasNode' : |
@@ -845,7 +846,7 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -845,7 +846,7 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
845 | 846 | ||
846 | init : function(config) { | 847 | init : function(config) { |
847 | var me = this; | 848 | var me = this; |
848 | - | 849 | + |
849 | this.plotElementPanel = config.plotElementPanel; | 850 | this.plotElementPanel = config.plotElementPanel; |
850 | 851 | ||
851 | var store = Ext.create('Ext.data.TreeStore', { | 852 | var store = Ext.create('Ext.data.TreeStore', { |
@@ -854,15 +855,22 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -854,15 +855,22 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
854 | } | 855 | } |
855 | }); | 856 | }); |
856 | 857 | ||
857 | - this.plotElementPanel = config.plotElementPanel; | 858 | + // this.plotElementPanel = config.plotElementPanel; |
858 | 859 | ||
859 | this.simplifiedViewCombo = Ext.create('Ext.form.field.Checkbox', { | 860 | this.simplifiedViewCombo = Ext.create('Ext.form.field.Checkbox', { |
860 | xtype: 'checkbox', | 861 | xtype: 'checkbox', |
861 | - boxLabel: 'Simplified View', | 862 | + boxLabel: 'Extended Plot Options', |
862 | listeners: { | 863 | listeners: { |
864 | +// render: function(c) { | ||
865 | +// Ext.create('Ext.tip.ToolTip', { | ||
866 | +// target: c.getEl(), | ||
867 | +// html: "SOME TEXT" | ||
868 | +// }); | ||
869 | +// }, | ||
863 | change: function(combo, newValue, oldValue, eOpts) { | 870 | change: function(combo, newValue, oldValue, eOpts) { |
864 | if (this.tabObject) | 871 | if (this.tabObject) |
865 | - this.tabObject.set('tree-simplified-view', newValue); | 872 | + this.tabObject.set('tree-full-view', newValue); |
873 | + | ||
866 | if (newValue != oldValue) | 874 | if (newValue != oldValue) |
867 | this.buildTree(this.tabObject); | 875 | this.buildTree(this.tabObject); |
868 | }, | 876 | }, |
@@ -937,13 +945,13 @@ Ext.define('amdaPlotComp.PlotTree', { | @@ -937,13 +945,13 @@ Ext.define('amdaPlotComp.PlotTree', { | ||
937 | }, | 945 | }, |
938 | scope: this | 946 | scope: this |
939 | }, | 947 | }, |
940 | - '->', | 948 | + '-', '->', |
941 | this.linkToMultiPlotCombo, | 949 | this.linkToMultiPlotCombo, |
942 | ' ', | 950 | ' ', |
943 | this.simplifiedViewCombo | 951 | this.simplifiedViewCombo |
944 | ] | 952 | ] |
945 | }; | 953 | }; |
946 | 954 | ||
947 | - Ext.apply (this , Ext.apply (arguments, myConf)); | 955 | + Ext.apply(this,Ext.apply(arguments, myConf)); |
948 | } | 956 | } |
949 | -}); | ||
950 | \ No newline at end of file | 957 | \ No newline at end of file |
958 | +}); |
js/resources/css/amda.css
@@ -329,6 +329,12 @@ background-image: url(../images/16x16/error.png) !important; | @@ -329,6 +329,12 @@ background-image: url(../images/16x16/error.png) !important; | ||
329 | background-repeat: no-repeat; | 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 | .icon-unknowntype { | 338 | .icon-unknowntype { |
333 | background-image:url(../images/14x14/circle_grey.png) !important; | 339 | background-image:url(../images/14x14/circle_grey.png) !important; |
334 | background-position: center; | 340 | background-position: center; |
913 Bytes
php/classes/AmdaAction.php
@@ -228,6 +228,7 @@ class AmdaAction | @@ -228,6 +228,7 @@ class AmdaAction | ||
228 | $isParameter = false; | 228 | $isParameter = false; |
229 | $needsArgs = false; | 229 | $needsArgs = false; |
230 | $isSpectra = false; | 230 | $isSpectra = false; |
231 | + $is2dSpectra = false; | ||
231 | $isStack = false; | 232 | $isStack = false; |
232 | $not_yet = false; | 233 | $not_yet = false; |
233 | 234 | ||
@@ -237,12 +238,16 @@ class AmdaAction | @@ -237,12 +238,16 @@ class AmdaAction | ||
237 | 238 | ||
238 | if ($child->hasAttribute('dataStart') && $child->hasAttribute('dataStop')) { | 239 | if ($child->hasAttribute('dataStart') && $child->hasAttribute('dataStop')) { |
239 | $info .= "<br/>Time Range: ".$child->getAttribute('dataStart')."-".$child->getAttribute('dataStop'); | 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 | if ($child->getAttribute('dataStart') == 'depending on mission') { | 247 | if ($child->getAttribute('dataStart') == 'depending on mission') { |
243 | $info .= "<br/>Time Range: ".$child->getAttribute('dataStart'); | 248 | $info .= "<br/>Time Range: ".$child->getAttribute('dataStart'); |
244 | } | 249 | } |
245 | - | 250 | + |
246 | // if ($child->getAttribute('restriction') > 1) { | 251 | // if ($child->getAttribute('restriction') > 1) { |
247 | // $restricted = $child->getAttribute('restriction'); | 252 | // $restricted = $child->getAttribute('restriction'); |
248 | // $info .= "<br/><b>Time Restriction</b>: -$restricted days"; | 253 | // $info .= "<br/><b>Time Restriction</b>: -$restricted days"; |
@@ -300,6 +305,8 @@ class AmdaAction | @@ -300,6 +305,8 @@ class AmdaAction | ||
300 | if ($child->getAttribute('display_type') == 'spectrogram') { | 305 | if ($child->getAttribute('display_type') == 'spectrogram') { |
301 | $needsArgs = true; | 306 | $needsArgs = true; |
302 | $isSpectra = true; | 307 | $isSpectra = true; |
308 | + if (strpos($child->getAttribute('name'),'2D') !== false) | ||
309 | + $is2dSpectra = true; | ||
303 | } | 310 | } |
304 | elseif ($child->getAttribute('display_type') == 'stackplot') { | 311 | elseif ($child->getAttribute('display_type') == 'stackplot') { |
305 | $isStack = true; | 312 | $isStack = true; |
@@ -313,8 +320,8 @@ class AmdaAction | @@ -313,8 +320,8 @@ class AmdaAction | ||
313 | $childrenToReturn[] = array('text' => $name,'alias' => $alias, | 320 | $childrenToReturn[] = array('text' => $name,'alias' => $alias, |
314 | 'id' => $id,'nodeType' => $nodeType, 'info' => $info, "component_info" => $component_info, | 321 | 'id' => $id,'nodeType' => $nodeType, 'info' => $info, "component_info" => $component_info, |
315 | 'globalStart' => $globalStart, 'globalStop' => $globalStop, 'timeRestriction' => $timeRestriction, | 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 | else { | 326 | else { |
320 | if ($child->tagName == 'mission' || $child->tagName == 'observatory') { | 327 | if ($child->tagName == 'mission' || $child->tagName == 'observatory') { |
php/classes/SharedObjectMgrAbstract.php
@@ -80,6 +80,43 @@ abstract class SharedObjectMgrAbstract { | @@ -80,6 +80,43 @@ abstract class SharedObjectMgrAbstract { | ||
80 | 80 | ||
81 | return array('success' => TRUE, 'object_id' => $newId); | 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 | public function getRootDirPath() { | 121 | public function getRootDirPath() { |
85 | return SHAREDPATH . "/" . $this->rootdirname; | 122 | return SHAREDPATH . "/" . $this->rootdirname; |
@@ -158,4 +195,4 @@ abstract class SharedObjectMgrAbstract { | @@ -158,4 +195,4 @@ abstract class SharedObjectMgrAbstract { | ||
158 | } | 195 | } |
159 | } | 196 | } |
160 | 197 | ||
161 | -?> | ||
162 | \ No newline at end of file | 198 | \ No newline at end of file |
199 | +?> |
php/classes/SharedObjectTreeFile.php
@@ -50,9 +50,32 @@ class SharedObjectTreeFile { | @@ -50,9 +50,32 @@ class SharedObjectTreeFile { | ||
50 | $objectNode->setAttribute($key, $value); | 50 | $objectNode->setAttribute($key, $value); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | - | 53 | + $this->doc->save($this->getFilePath()); |
54 | 54 | ||
55 | //Remove obsolete folders and objects | 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 | $this->doc->save($this->getFilePath()); | 80 | $this->doc->save($this->getFilePath()); |
58 | 81 | ||
@@ -162,6 +185,34 @@ class SharedObjectTreeFile { | @@ -162,6 +185,34 @@ class SharedObjectTreeFile { | ||
162 | } | 185 | } |
163 | return ""; | 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 | private function init() { | 217 | private function init() { |
167 | if (!file_exists($this->getFilePath())) | 218 | if (!file_exists($this->getFilePath())) |
@@ -260,7 +311,7 @@ class SharedObjectTreeFile { | @@ -260,7 +311,7 @@ class SharedObjectTreeFile { | ||
260 | 311 | ||
261 | return NULL; | 312 | return NULL; |
262 | } | 313 | } |
263 | - | 314 | + |
264 | private function createObjectNode($object_type, $folder_name, $object_id) { | 315 | private function createObjectNode($object_type, $folder_name, $object_id) { |
265 | $listNode = $this->getObjectListNode($object_type); | 316 | $listNode = $this->getObjectListNode($object_type); |
266 | 317 |
php/classes/SharedObjectsMgr.php
@@ -50,6 +50,29 @@ class SharedObjectsMgr { | @@ -50,6 +50,29 @@ class SharedObjectsMgr { | ||
50 | 50 | ||
51 | return $result; | 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 | public function getFolders($object_type) { | 77 | public function getFolders($object_type) { |
55 | if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type])) | 78 | if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type])) |
@@ -57,6 +80,18 @@ class SharedObjectsMgr { | @@ -57,6 +80,18 @@ class SharedObjectsMgr { | ||
57 | 80 | ||
58 | return $this->treeFile->getFolders($object_type); | 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 | public function isNameAlreadyUsed($object_type, $name) { | 96 | public function isNameAlreadyUsed($object_type, $name) { |
62 | if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type])) | 97 | if (!array_key_exists($object_type, $this->sharedObjectsMgr) || !isset($this->sharedObjectsMgr[$object_type])) |
@@ -96,4 +131,4 @@ class SharedObjectsMgr { | @@ -96,4 +131,4 @@ class SharedObjectsMgr { | ||
96 | } | 131 | } |
97 | } | 132 | } |
98 | 133 | ||
99 | -?> | ||
100 | \ No newline at end of file | 134 | \ No newline at end of file |
135 | +?> |
php/classes/UserMgr.php
@@ -276,9 +276,9 @@ class UserMgr | @@ -276,9 +276,9 @@ class UserMgr | ||
276 | else { | 276 | else { |
277 | // totally rewrite | 277 | // totally rewrite |
278 | if ($base->hasAttribute('isSimulation')) { | 278 | if ($base->hasAttribute('isSimulation')) { |
279 | - /*$centerNode = $this->makeSimulationBase($baseId); | 279 | + $centerNode = $this->makeSimulationBase($baseId); |
280 | $center = new $baseId(); | 280 | $center = new $baseId(); |
281 | - $centerNode->setAttribute('available', $center->monitor());*/ | 281 | + $centerNode->setAttribute('available', $center->monitor()); |
282 | } | 282 | } |
283 | else { | 283 | else { |
284 | $center = new $baseId(); | 284 | $center = new $baseId(); |
@@ -334,18 +334,19 @@ class UserMgr | @@ -334,18 +334,19 @@ class UserMgr | ||
334 | 334 | ||
335 | $this->paramMgr->xmlDom->formatOutput = true; | 335 | $this->paramMgr->xmlDom->formatOutput = true; |
336 | $this->paramMgr->xmlDom->preserveWhiteSpace = false; | 336 | $this->paramMgr->xmlDom->preserveWhiteSpace = false; |
337 | - | 337 | + |
338 | $BASE = $this->paramMgr->xmlDom->createElement('dataRoot'); | 338 | $BASE = $this->paramMgr->xmlDom->createElement('dataRoot'); |
339 | $BASE->setAttribute('xml:id','myRemoteData-treeRootNode'); | 339 | $BASE->setAttribute('xml:id','myRemoteData-treeRootNode'); |
340 | 340 | ||
341 | foreach ($this->paramMgr->Bases as $baseId) | 341 | foreach ($this->paramMgr->Bases as $baseId) |
342 | { | 342 | { |
343 | $centerNode = $this->makeNewBase($baseId); | 343 | $centerNode = $this->makeNewBase($baseId); |
344 | - $BASE->appendChild($centerNode); | 344 | + if (isset($centerNode)) |
345 | + $BASE->appendChild($centerNode); | ||
345 | } | 346 | } |
346 | - | 347 | + |
347 | $this->paramMgr->xmlDom->appendChild($BASE); | 348 | $this->paramMgr->xmlDom->appendChild($BASE); |
348 | - | 349 | + |
349 | return $this->paramMgr->xmlDom->save($this->paramMgr->xmlName); | 350 | return $this->paramMgr->xmlDom->save($this->paramMgr->xmlName); |
350 | } | 351 | } |
351 | } | 352 | } |
@@ -353,11 +354,11 @@ class UserMgr | @@ -353,11 +354,11 @@ class UserMgr | ||
353 | protected function makeNewBase($baseId) | 354 | protected function makeNewBase($baseId) |
354 | { | 355 | { |
355 | // no data base description ; skip this data base | 356 | // no data base description ; skip this data base |
356 | - if (!@file_exists(RemoteData.$baseId.'/base.xml')) return; | 357 | + if (!@file_exists(RemoteData.$baseId.'/base.xml')) return NULL; |
357 | 358 | ||
358 | // can't read base.xml ; skip this data base | 359 | // can't read base.xml ; skip this data base |
359 | - if (!@$this->baseExtXml->load(RemoteData.$baseId.'/base.xml')) return; | ||
360 | - | 360 | + if (!@$this->baseExtXml->load(RemoteData.$baseId.'/base.xml')) return NULL; |
361 | + | ||
361 | $base = $this->paramMgr->basesDom->getElementById($baseId); | 362 | $base = $this->paramMgr->basesDom->getElementById($baseId); |
362 | 363 | ||
363 | if ($base->hasAttribute('default')) | 364 | if ($base->hasAttribute('default')) |
@@ -527,7 +528,7 @@ class UserMgr | @@ -527,7 +528,7 @@ class UserMgr | ||
527 | 528 | ||
528 | 529 | ||
529 | public function init() | 530 | public function init() |
530 | - { | 531 | + { |
531 | if ($this->ddLogin() != 0) | 532 | if ($this->ddLogin() != 0) |
532 | die('<h2>You are trying to log in as '.$this->user.'<br/> Please check that you entered a valid password</h2>'); | 533 | die('<h2>You are trying to log in as '.$this->user.'<br/> Please check that you entered a valid password</h2>'); |
533 | 534 | ||
@@ -573,12 +574,11 @@ class UserMgr | @@ -573,12 +574,11 @@ class UserMgr | ||
573 | $this->setPath(); | 574 | $this->setPath(); |
574 | 575 | ||
575 | $this->userGrps = $this->getUserGrps(); | 576 | $this->userGrps = $this->getUserGrps(); |
576 | - | 577 | + |
577 | if (!$this->makeLocalTree()) | 578 | if (!$this->makeLocalTree()) |
578 | die("Login for ".$this->user." failed: Can't make LocalParams.xml");; | 579 | die("Login for ".$this->user." failed: Can't make LocalParams.xml");; |
579 | - //$ok = $this->makeRemoteTree(); | ||
580 | - | ||
581 | -//die("BRE"); | 580 | + |
581 | + $ok = $this->makeRemoteTree(); | ||
582 | 582 | ||
583 | if (!file_exists(USERWSDIR.'Request.xml')) $reqMgr = new RequestMgr(); | 583 | if (!file_exists(USERWSDIR.'Request.xml')) $reqMgr = new RequestMgr(); |
584 | if (!file_exists(USERWSDIR.'Tt.xml')) $ttMgr = new TimeTableMgr(); | 584 | if (!file_exists(USERWSDIR.'Tt.xml')) $ttMgr = new TimeTableMgr(); |
php/config.php
@@ -87,6 +87,7 @@ define('RemoteData', DATAPATH.'/RemoteData/'); | @@ -87,6 +87,7 @@ define('RemoteData', DATAPATH.'/RemoteData/'); | ||
87 | define('Functions', DATAPATH.'/Functions/'); | 87 | define('Functions', DATAPATH.'/Functions/'); |
88 | define('Hst', DATAPATH.'/Hst/'); | 88 | define('Hst', DATAPATH.'/Hst/'); |
89 | define('SpecialSettingsDir',DATAPATH.'/SpecialSettings/'); | 89 | define('SpecialSettingsDir',DATAPATH.'/SpecialSettings/'); |
90 | +define('CommonLib', DATAPATH.'/compilation/lib/'); | ||
90 | 91 | ||
91 | // General Info files | 92 | // General Info files |
92 | define('orbitsXml',LocalData.'/Orbites.xml'); | 93 | define('orbitsXml',LocalData.'/Orbites.xml'); |
update_amda/generate_param_info
@@ -35,7 +35,8 @@ do | @@ -35,7 +35,8 @@ do | ||
35 | 35 | ||
36 | if [ -e $PARAM_INFO_PATH/$info_file ] | 36 | if [ -e $PARAM_INFO_PATH/$info_file ] |
37 | then | 37 | then |
38 | - echo ${param_filename} exists | 38 | + #echo ${param_filename} exists |
39 | + temp=a | ||
39 | else | 40 | else |
40 | echo "Generate info file for ${param_filename}" | 41 | echo "Generate info file for ${param_filename}" |
41 | php $UPDATEDIR/preprocessInfo.php ${param_filename} | 42 | php $UPDATEDIR/preprocessInfo.php ${param_filename} |
@@ -48,39 +49,40 @@ if [ ! -e ./app.properties ]; then | @@ -48,39 +49,40 @@ if [ ! -e ./app.properties ]; then | ||
48 | exit | 49 | exit |
49 | fi | 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 | DDLogin $DDUSER $DDPASS | 88 | DDLogin $DDUSER $DDPASS |
@@ -92,7 +94,8 @@ do | @@ -92,7 +94,8 @@ do | ||
92 | 94 | ||
93 | if [ -e $NEWMETA/ParamInfo/$info_file ] | 95 | if [ -e $NEWMETA/ParamInfo/$info_file ] |
94 | then | 96 | then |
95 | - echo ${param_filename} exists | 97 | + # echo ${param_filename} exists |
98 | + temp=a | ||
96 | else | 99 | else |
97 | echo "Generate info file for ${param_filename}" | 100 | echo "Generate info file for ${param_filename}" |
98 | amdaParameterInfo -p ${param_filename} | 101 | amdaParameterInfo -p ${param_filename} |
update_amda/updateAmda
@@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
101 | cp $RemoteData/PARAMS/* $PARAMS_LOCALDB_DIR/ | 101 | cp $RemoteData/PARAMS/* $PARAMS_LOCALDB_DIR/ |
102 | fi | 102 | fi |
103 | fi | 103 | fi |
104 | - # Update StartStop only | 104 | + # Update StartStop & Help only |
105 | if [ $UPDATE ] | 105 | if [ $UPDATE ] |
106 | then | 106 | then |
107 | echo "Updating...." | 107 | echo "Updating...." |
@@ -114,6 +114,11 @@ | @@ -114,6 +114,11 @@ | ||
114 | fi | 114 | fi |
115 | 115 | ||
116 | echo 'update in NEWMETA/dd_missions: done' | 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 | echo "making Tree..." | 123 | echo "making Tree..." |
119 | php $UPDATEDIR/makeTree.php | 124 | php $UPDATEDIR/makeTree.php |