Commit 95ebd7a5223e7f664239fe9b408f0302755608b3
Exists in
master
and in
100 other branches
Merge branch 'master' of https://gitlab.irap.omp.eu/CDPP/AMDA_IHM
Showing
36 changed files
with
788 additions
and
195 deletions
Show diff stats
generic_data/rank.json
1 | -{"Mercury": 1, "Venus": 2, "Heliosphere.NearEarth": 3, "Heliosphere.Remote1AU": 4, | ||
2 | -"Earth.Magnetosheath": 5, "Earth.Magnetosphere": 5, "Earth": 5, "Earth.Surface": 6, | ||
3 | -"Mars": 7, "Jupiter": 8, "Ganymede" : 8, "Saturn": 9, "Uranus" : 10, "Neptune" : 11, "Comet" : 93, | 1 | +{"Sun" : 1, "Mercury": 2, "Venus": 3, "Heliosphere.NearEarth": 4, "Heliosphere.Remote1AU": 5, |
2 | +"Earth.Magnetosheath": 6, "Earth.Magnetosphere": 6, "Earth": 6, "Earth.Surface": 7, | ||
3 | +"Mars": 8, "Jupiter": 9, "Ganymede" : 9, "Saturn": 91, "Uranus" : 92, "Neptune" : 93, "Comet" : 94, | ||
4 | "Heliosphere" : 99 } | 4 | "Heliosphere" : 99 } |
5 | \ No newline at end of file | 5 | \ No newline at end of file |
200 KB
137 KB
85.6 KB
56.1 KB
94.4 KB
103 KB
js/app/controllers/AmdaModule.js
@@ -99,7 +99,12 @@ Ext.define('amdaDesktop.AmdaModule', { | @@ -99,7 +99,12 @@ Ext.define('amdaDesktop.AmdaModule', { | ||
99 | show : onshowfn, | 99 | show : onshowfn, |
100 | scope : this | 100 | scope : this |
101 | }); | 101 | }); |
102 | - } | ||
103 | - win.show(); | 102 | + } |
103 | + if (!win.isVisible()) { | ||
104 | + win.show(); | ||
105 | + } | ||
106 | + else if (onshowfn) { | ||
107 | + onshowfn(); | ||
108 | + } | ||
104 | } | 109 | } |
105 | }); | 110 | }); |
js/app/controllers/InteractiveModule.js
@@ -144,7 +144,13 @@ Ext.define('amdaDesktop.InteractiveModule', { | @@ -144,7 +144,13 @@ Ext.define('amdaDesktop.InteractiveModule', { | ||
144 | // second arg 'true' is used in CatalogUI to mark if Grid Reconfiguration is needed | 144 | // second arg 'true' is used in CatalogUI to mark if Grid Reconfiguration is needed |
145 | this.getUiContent().setObject(this.linkedNode.get('object'), true); | 145 | this.getUiContent().setObject(this.linkedNode.get('object'), true); |
146 | } | 146 | } |
147 | - win.show(); | 147 | + |
148 | + if (!win.isVisible()) { | ||
149 | + win.show(); | ||
150 | + } | ||
151 | + else if (onShowEvent) { | ||
152 | + onShowEvent(); | ||
153 | + } | ||
148 | }, | 154 | }, |
149 | /** | 155 | /** |
150 | * Mechanism to attach a Module to the Workspace Explorer to enable interactions | 156 | * Mechanism to attach a Module to the Workspace Explorer to enable interactions |
@@ -256,4 +262,4 @@ Ext.define('amdaDesktop.InteractiveModule', { | @@ -256,4 +262,4 @@ Ext.define('amdaDesktop.InteractiveModule', { | ||
256 | return null; | 262 | return null; |
257 | } | 263 | } |
258 | 264 | ||
259 | -}); | ||
260 | \ No newline at end of file | 265 | \ No newline at end of file |
266 | +}); |
js/app/controllers/PlotModule.js
@@ -208,5 +208,5 @@ Ext.define('amdaDesktop.PlotModule', { | @@ -208,5 +208,5 @@ Ext.define('amdaDesktop.PlotModule', { | ||
208 | getWindowResult: function(winResultId){ | 208 | getWindowResult: function(winResultId){ |
209 | if (!this.plotResultWindowsManager.get(winResultId)) return null; | 209 | if (!this.plotResultWindowsManager.get(winResultId)) return null; |
210 | return this.plotResultWindowsManager.get(winResultId); | 210 | return this.plotResultWindowsManager.get(winResultId); |
211 | - } | 211 | + } |
212 | }); | 212 | }); |
js/app/models/AmdaNode.js
@@ -128,7 +128,20 @@ Ext.define('amdaModel.AmdaNode', { | @@ -128,7 +128,20 @@ Ext.define('amdaModel.AmdaNode', { | ||
128 | } | 128 | } |
129 | // if this node is a leaf and have no child | 129 | // if this node is a leaf and have no child |
130 | else if (this.isLeaf() || this.get('nodeType' ) == 'derivedParam' ) { | 130 | else if (this.isLeaf() || this.get('nodeType' ) == 'derivedParam' ) { |
131 | - itemKind = amdaUI.ExplorerUI.ITEM_KIND_LEAF; | 131 | + if (this.get('nodeType') == 'plottab') { |
132 | + itemKind = amdaUI.ExplorerUI.ITEM_KIND_PTAB; | ||
133 | + } | ||
134 | + else { | ||
135 | + itemKind = amdaUI.ExplorerUI.ITEM_KIND_LEAF; | ||
136 | + } | ||
137 | + } | ||
138 | + else if (this.get('nodeType') == 'request') { | ||
139 | + if (this.get('tabs') && (this.get('tabs').length > 0)) { | ||
140 | + itemKind = amdaUI.ExplorerUI.ITEM_KIND_LEAF; | ||
141 | + } | ||
142 | + else { | ||
143 | + itemKind = amdaUI.ExplorerUI.ITEM_KIND_DIRE; | ||
144 | + } | ||
132 | } | 145 | } |
133 | else if (this.get('isParameter') && this.get('nodeType' ) != 'derivedParam' ) { | 146 | else if (this.get('isParameter') && this.get('nodeType' ) != 'derivedParam' ) { |
134 | itemKind = amdaUI.ExplorerUI.ITEM_KIND_PARA; | 147 | itemKind = amdaUI.ExplorerUI.ITEM_KIND_PARA; |
js/app/models/InteractiveNode.js
@@ -52,7 +52,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -52,7 +52,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
52 | { | 52 | { |
53 | node.eachChild(function(n) | 53 | node.eachChild(function(n) |
54 | { | 54 | { |
55 | - if (!n.isLoaded() && !n.isLeaf()) | 55 | + if (!n.isLoaded() && !n.isRealLeaf()) |
56 | { | 56 | { |
57 | nodesToLoad.push(n); | 57 | nodesToLoad.push(n); |
58 | me.preloadTreeNode(n,nodesToLoad,onloaded); | 58 | me.preloadTreeNode(n,nodesToLoad,onloaded); |
@@ -70,7 +70,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -70,7 +70,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
70 | { | 70 | { |
71 | records.forEach(function (record) | 71 | records.forEach(function (record) |
72 | { | 72 | { |
73 | - if (!record.isLoaded() && !record.isLeaf()) | 73 | + if (!record.isLoaded() && !record.isRealLeaf()) |
74 | { | 74 | { |
75 | nodesToLoad.push(record); | 75 | nodesToLoad.push(record); |
76 | me.preloadTreeNode(record,nodesToLoad,onloaded); | 76 | me.preloadTreeNode(record,nodesToLoad,onloaded); |
@@ -99,6 +99,11 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -99,6 +99,11 @@ Ext.define('amdaModel.InteractiveNode', { | ||
99 | } | 99 | } |
100 | } | 100 | } |
101 | }, | 101 | }, |
102 | + | ||
103 | + isRealLeaf: function() | ||
104 | + { | ||
105 | + return this.isLeaf(); | ||
106 | + }, | ||
102 | 107 | ||
103 | /** | 108 | /** |
104 | * this method is overriden into ExecutableNode to return true | 109 | * this method is overriden into ExecutableNode to return true |
@@ -146,7 +151,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -146,7 +151,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
146 | */ | 151 | */ |
147 | rename: function(value,callBackFn) | 152 | rename: function(value,callBackFn) |
148 | { | 153 | { |
149 | - var dataToSend = {id : this.get('id'), old_name: this.modified.text, name: value, parent : this.data.parentId, leaf: this.isLeaf(), nodeType: this.get('nodeType')}; | 154 | + var dataToSend = {id : this.get('id'), old_name: this.modified.text, name: value, parent : this.data.parentId, leaf: this.isRealLeaf(), nodeType: this.get('nodeType')}; |
150 | AmdaAction.renameObject(dataToSend, callBackFn); | 155 | AmdaAction.renameObject(dataToSend, callBackFn); |
151 | }, | 156 | }, |
152 | 157 | ||
@@ -155,7 +160,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -155,7 +160,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
155 | */ | 160 | */ |
156 | renameDD: function(parentId, callBackFn) | 161 | renameDD: function(parentId, callBackFn) |
157 | { | 162 | { |
158 | - var dataToSend = {id : this.get('id'), old_name: this.get('name'), name: this.get('name'), parent : parentId, leaf: this.isLeaf(), nodeType: this.get('nodeType')}; | 163 | + var dataToSend = {id : this.get('id'), old_name: this.get('name'), name: this.get('name'), parent : parentId, leaf: this.isRealLeaf(), nodeType: this.get('nodeType')}; |
159 | AmdaAction.renameObject(dataToSend, callBackFn); | 164 | AmdaAction.renameObject(dataToSend, callBackFn); |
160 | }, | 165 | }, |
161 | 166 | ||
@@ -166,7 +171,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -166,7 +171,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
166 | */ | 171 | */ |
167 | isValidName : function(name, callBackFn) | 172 | isValidName : function(name, callBackFn) |
168 | { | 173 | { |
169 | - var dataToSend = {name: name, nodeType: this.get('nodeType'), leaf: this.isLeaf()}; | 174 | + var dataToSend = {name: name, nodeType: this.get('nodeType'), leaf: this.isRealLeaf()}; |
170 | AmdaAction.validNameObject(dataToSend, callBackFn); | 175 | AmdaAction.validNameObject(dataToSend, callBackFn); |
171 | }, | 176 | }, |
172 | 177 | ||
@@ -515,7 +520,7 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -515,7 +520,7 @@ Ext.define('amdaModel.InteractiveNode', { | ||
515 | 520 | ||
516 | deleteNode: function() { | 521 | deleteNode: function() { |
517 | // if the target is a directory | 522 | // if the target is a directory |
518 | - if (!this.isLeaf()) { | 523 | + if (!this.isRealLeaf()) { |
519 | // determine if this directory is empty before launching the delete confirmation method | 524 | // determine if this directory is empty before launching the delete confirmation method |
520 | this.isNotEmptyDir(this.confirmDirectoryDeletion); | 525 | this.isNotEmptyDir(this.confirmDirectoryDeletion); |
521 | // else (the target is a leaf) | 526 | // else (the target is a leaf) |
@@ -568,14 +573,14 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -568,14 +573,14 @@ Ext.define('amdaModel.InteractiveNode', { | ||
568 | */ | 573 | */ |
569 | realDelete : function() | 574 | realDelete : function() |
570 | { | 575 | { |
571 | - AmdaAction.deleteObject({id: this.get('id'), leaf: this.isLeaf(), nodeType: this.get('nodeType')}, function(res,e){ | 576 | + AmdaAction.deleteObject({id: this.get('id'), leaf: this.isRealLeaf(), nodeType: this.get('nodeType')}, function(res,e){ |
572 | //TODO proper errors handling | 577 | //TODO proper errors handling |
573 | // node deletion in tree | 578 | // node deletion in tree |
574 | if (res) { // if success | 579 | if (res) { // if success |
575 | if (res.id) { | 580 | if (res.id) { |
576 | //Ext.Msg.show({title:'Warning', msg: 'Requests with parameter '+node.data.text+' are deleted', icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); | 581 | //Ext.Msg.show({title:'Warning', msg: 'Requests with parameter '+node.data.text+' are deleted', icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); |
577 | if (this.parentNode) { | 582 | if (this.parentNode) { |
578 | - if (this.isLeaf()){ | 583 | + if (this.isRealLeaf()){ |
579 | var moduleId = this.get('moduleId'); | 584 | var moduleId = this.get('moduleId'); |
580 | // if really interactive node | 585 | // if really interactive node |
581 | if (moduleId) { | 586 | if (moduleId) { |
js/app/models/LocalParamNode.js
@@ -28,9 +28,9 @@ Ext.define('amdaModel.LocalParamNode', | @@ -28,9 +28,9 @@ Ext.define('amdaModel.LocalParamNode', | ||
28 | {name: 'rank', type: 'integer', persist: false, defaultValue: null} | 28 | {name: 'rank', type: 'integer', persist: false, defaultValue: null} |
29 | ], | 29 | ], |
30 | 30 | ||
31 | - icons : {'1' : 'icon-mercury','2' : 'icon-venus','3' : 'icon-sw','4' : 'icon-sw','5' : 'icon-earth','6' : 'icon-earth', | ||
32 | - '7' : 'icon-mars','8' : 'icon-jupiter','9' : 'icon-saturn','10' : 'icon-uranus','11' : 'icon-neptune', | ||
33 | - '93' :'icon-comet', '99' :'icon-solarsystem', '999' :'icon-solarsystem' | 31 | + icons : {'1' : 'icon-sun', '2' : 'icon-mercury','3' : 'icon-venus','4' : 'icon-sw','5' : 'icon-sw','6' : 'icon-earth','7' : 'icon-earth', |
32 | + '8' : 'icon-mars','9' : 'icon-jupiter','91' : 'icon-saturn','92' : 'icon-uranus','93' : 'icon-neptune', | ||
33 | + '94' :'icon-comet', '99' :'icon-solarsystem', '999' :'icon-solarsystem' | ||
34 | }, | 34 | }, |
35 | 35 | ||
36 | constructor : function(config) | 36 | constructor : function(config) |
js/app/models/PlotNode.js
@@ -10,15 +10,47 @@ | @@ -10,15 +10,47 @@ | ||
10 | Ext.define('amdaModel.PlotNode', { | 10 | Ext.define('amdaModel.PlotNode', { |
11 | extend: 'amdaModel.ExecutableNode', | 11 | extend: 'amdaModel.ExecutableNode', |
12 | 12 | ||
13 | + fields : [ | ||
14 | + {name : 'tabs', type:'auto', defaultValue:false, persist: false} | ||
15 | + ], | ||
16 | + | ||
13 | statics: { | 17 | statics: { |
14 | nodeType: 'request' | 18 | nodeType: 'request' |
15 | }, | 19 | }, |
16 | 20 | ||
21 | + requires:[ | ||
22 | + 'amdaModel.PlotTabNode' | ||
23 | + ], | ||
24 | + | ||
17 | constructor : function(config){ | 25 | constructor : function(config){ |
18 | this.callParent(arguments); | 26 | this.callParent(arguments); |
19 | this.set('moduleId',myDesktopApp.dynamicModules.plot.id); | 27 | this.set('moduleId',myDesktopApp.dynamicModules.plot.id); |
20 | this.set('objectDataModel','amdaPlotObj.PlotRequestObject'); | 28 | this.set('objectDataModel','amdaPlotObj.PlotRequestObject'); |
21 | this.set('nodeType',this.self.nodeType); | 29 | this.set('nodeType',this.self.nodeType); |
30 | + if (this.get('leaf')) { | ||
31 | + this.updateTabs(this.get('tabs')); | ||
32 | + } | ||
33 | + }, | ||
34 | + | ||
35 | + updateTabs : function(tabs) { | ||
36 | + if (tabs) { | ||
37 | + var oneTab = (tabs.length == 1); | ||
38 | + this.set('leaf', oneTab); | ||
39 | + this.set('iconCls', oneTab ? 'icon-plot-page' : 'icon-plot-pages'); | ||
40 | + this.removeAll(); | ||
41 | + if (tabs.length > 1) { | ||
42 | + var me = this; | ||
43 | + Ext.Array.each(tabs, function(tab) { | ||
44 | + var tabNode = new amdaModel.PlotTabNode({text: tab.name, tabid: tab.id}); | ||
45 | + me.appendChild(tabNode); | ||
46 | + }); | ||
47 | + } | ||
48 | + this.set('tabs', tabs); | ||
49 | + } | ||
50 | + }, | ||
51 | + | ||
52 | + specialUpdate : function(res) { | ||
53 | + this.updateTabs(res.tabs); | ||
22 | }, | 54 | }, |
23 | 55 | ||
24 | allMenuItems : function() { | 56 | allMenuItems : function() { |
@@ -44,6 +76,10 @@ Ext.define('amdaModel.PlotNode', { | @@ -44,6 +76,10 @@ Ext.define('amdaModel.PlotNode', { | ||
44 | }, { | 76 | }, { |
45 | fnId : 'leaf-deleteNode', | 77 | fnId : 'leaf-deleteNode', |
46 | text : 'Delete Request' | 78 | text : 'Delete Request' |
79 | + }, { | ||
80 | + fnId : 'leaf-insertTabs', | ||
81 | + text : 'Insert in current Plot Request' | ||
82 | + | ||
47 | }]; | 83 | }]; |
48 | 84 | ||
49 | return menuItems; | 85 | return menuItems; |
@@ -92,10 +128,35 @@ Ext.define('amdaModel.PlotNode', { | @@ -92,10 +128,35 @@ Ext.define('amdaModel.PlotNode', { | ||
92 | case 'deleteMulti': | 128 | case 'deleteMulti': |
93 | this.deleteMulti(); | 129 | this.deleteMulti(); |
94 | break; | 130 | break; |
95 | - | 131 | + case 'insertTabs': |
132 | + this.insertPlotTabsRequest(); | ||
96 | default: | 133 | default: |
97 | break; | 134 | break; |
98 | } | 135 | } |
136 | + }, | ||
137 | + | ||
138 | + isRealLeaf: function() | ||
139 | + { | ||
140 | + var isFolder = (!this.isLeaf()) && (this.get('tabs') === false); | ||
141 | + return !isFolder; | ||
142 | + }, | ||
143 | + | ||
144 | + insertPlotTabsRequest: function() { | ||
145 | + var me = this; | ||
146 | + AmdaAction.getObject(me.get('id'), me.get('nodeType'), function (result,remoteEvent) { | ||
147 | + var paramObj = Ext.create(me.get('objectDataModel'), result); | ||
148 | + myDesktopApp.getLoadedModule(me.get('moduleId'), true, function (module) { | ||
149 | + module.createWindow(function () { | ||
150 | + var uiContent = module.getUiContent(); | ||
151 | + if (uiContent != null) { | ||
152 | + paramObj.tabs().each(function (tab) { | ||
153 | + var tabData = tab.getJsonValues(); | ||
154 | + uiContent.insertPlotTab(tabData); | ||
155 | + }); | ||
156 | + } | ||
157 | + }); | ||
158 | + }); | ||
159 | + }); | ||
99 | } | 160 | } |
100 | 161 | ||
101 | }); | 162 | }); |
js/app/models/PlotObjects/PlotLayoutAutoObject.js
@@ -14,18 +14,41 @@ | @@ -14,18 +14,41 @@ | ||
14 | 14 | ||
15 | 15 | ||
16 | Ext.define('amdaPlotObj.PlotLayoutAutoObject', { | 16 | Ext.define('amdaPlotObj.PlotLayoutAutoObject', { |
17 | - extend: 'Ext.data.Model', | 17 | + extend: 'Ext.data.Model', |
18 | 18 | ||
19 | - requires: [ | ||
20 | - 'amdaPlotObj.PlotObjectConfig' | ||
21 | - ], | 19 | + requires: [ |
20 | + 'amdaPlotObj.PlotObjectConfig' | ||
21 | + ], | ||
22 | 22 | ||
23 | - fields : [ | ||
24 | - {name: 'layout-panel-height', type: 'float', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelHeight}, | ||
25 | - {name: 'layout-panel-spacing', type: 'float', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelSpacing}, | ||
26 | - {name: 'layout-expand', type: 'boolean', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.expand}, | ||
27 | - {name: 'layout-timeaxes-legend-lowerone', type: 'boolean', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.timeAxesLegend} | 23 | + fields : [ |
24 | + {name: 'layout-panel-height', type: 'float'}, | ||
25 | + {name: 'layout-panel-spacing', type: 'float'}, | ||
26 | + {name: 'layout-expand', type: 'boolean'}, | ||
27 | + {name: 'layout-timeaxes-legend-lowerone', type: 'boolean'} | ||
28 | ], | 28 | ], |
29 | + | ||
30 | + constructor: function() | ||
31 | + { | ||
32 | + var me = this; | ||
33 | + me.callParent(arguments); | ||
34 | + if ((arguments.length > 0) && arguments[0]) | ||
35 | + { | ||
36 | + } | ||
37 | + else | ||
38 | + { | ||
39 | + //new object, set default fields values | ||
40 | + me.setDefaultValues(); | ||
41 | + } | ||
42 | + this.dirty = false; | ||
43 | + }, | ||
44 | + | ||
45 | + setDefaultValues: function() | ||
46 | + { | ||
47 | + this.set('layout-panel-height', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelHeight); | ||
48 | + this.set('layout-panel-spacing', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelSpacing); | ||
49 | + this.set('layout-expand', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.expand); | ||
50 | + this.set('layout-timeaxes-legend-lowerone', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.timeAxesLegend); | ||
51 | + }, | ||
29 | 52 | ||
30 | getJsonValues : function() | 53 | getJsonValues : function() |
31 | { | 54 | { |
js/app/models/PlotObjects/PlotLayoutVerticalObject.js
@@ -14,23 +14,45 @@ | @@ -14,23 +14,45 @@ | ||
14 | 14 | ||
15 | 15 | ||
16 | Ext.define('amdaPlotObj.PlotLayoutVerticalObject', { | 16 | Ext.define('amdaPlotObj.PlotLayoutVerticalObject', { |
17 | - extend: 'Ext.data.Model', | 17 | + extend: 'Ext.data.Model', |
18 | 18 | ||
19 | - requires: [ | ||
20 | - 'amdaPlotObj.PlotObjectConfig' | ||
21 | - ], | 19 | + requires: [ |
20 | + 'amdaPlotObj.PlotObjectConfig' | ||
21 | + ], | ||
22 | 22 | ||
23 | - fields : [ | ||
24 | - {name: 'layout-panel-height', type: 'float', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelHeight}, | ||
25 | - {name: 'layout-panel-spacing', type: 'float', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelSpacing}, | ||
26 | - {name: 'layout-expand', type: 'boolean', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.expand}, | ||
27 | - {name: 'layout-timeaxes-legend-lowerone', type: 'boolean', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.timeAxesLegend}, | ||
28 | - //{name: 'layout-timeplot-width', type: 'float', useNull:true}, | ||
29 | - {name: 'layout-timeplot-height', type: 'float', useNull:true}, | ||
30 | - {name: 'layout-xyplot-width', type: 'float', useNull:true}, | ||
31 | - {name: 'layout-xyplot-height', type: 'float', useNull:true} | 23 | + fields : [ |
24 | + {name: 'layout-panel-height', type: 'float'}, | ||
25 | + {name: 'layout-panel-spacing', type: 'float'}, | ||
26 | + {name: 'layout-expand', type: 'boolean'}, | ||
27 | + {name: 'layout-timeaxes-legend-lowerone', type: 'boolean'}, | ||
28 | + //{name: 'layout-timeplot-width', type: 'float', useNull:true}, | ||
29 | + {name: 'layout-timeplot-height', type: 'float', useNull:true}, | ||
30 | + {name: 'layout-xyplot-width', type: 'float', useNull:true}, | ||
31 | + {name: 'layout-xyplot-height', type: 'float', useNull:true} | ||
32 | ], | 32 | ], |
33 | - | 33 | + |
34 | + constructor: function() | ||
35 | + { | ||
36 | + var me = this; | ||
37 | + me.callParent(arguments); | ||
38 | + if ((arguments.length > 0) && arguments[0]) | ||
39 | + { | ||
40 | + } | ||
41 | + else { | ||
42 | + //new object, set default fields values | ||
43 | + me.setDefaultValues(); | ||
44 | + } | ||
45 | + this.dirty = false; | ||
46 | + }, | ||
47 | + | ||
48 | + setDefaultValues: function() | ||
49 | + { | ||
50 | + this.set('layout-panel-height', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelHeight); | ||
51 | + this.set('layout-panel-spacing', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.panelSpacing); | ||
52 | + this.set('layout-expand', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.expand); | ||
53 | + this.set('layout-timeaxes-legend-lowerone', amdaPlotObj.PlotObjectConfig.defaultValues.page.layout.timeAxesLegend); | ||
54 | + }, | ||
55 | + | ||
34 | getJsonValues : function() | 56 | getJsonValues : function() |
35 | { | 57 | { |
36 | var layoutValues = new Object(); | 58 | var layoutValues = new Object(); |
js/app/models/PlotObjects/PlotLegendSeriesObject.js
@@ -14,32 +14,46 @@ | @@ -14,32 +14,46 @@ | ||
14 | 14 | ||
15 | 15 | ||
16 | Ext.define('amdaPlotObj.PlotLegendSeriesObject', { | 16 | Ext.define('amdaPlotObj.PlotLegendSeriesObject', { |
17 | - extend: 'Ext.data.Model', | 17 | + extend: 'Ext.data.Model', |
18 | 18 | ||
19 | - requires: [ | ||
20 | - 'amdaPlotObj.PlotObjectConfig' | ||
21 | - ], | 19 | + requires: [ |
20 | + 'amdaPlotObj.PlotObjectConfig' | ||
21 | + ], | ||
22 | 22 | ||
23 | - fields : [ | ||
24 | - {name: 'legend-series-activated', type: 'boolean', defaultValue: false}, | ||
25 | - {name: 'legend-series-type', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.type}, | ||
26 | - {name: 'legend-series-position', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.position}, | ||
27 | - {name: 'legend-series-showparaminfo', type: 'boolean', defaultValue: true}, | ||
28 | - {name: 'legend-series-defaulttextcolor', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.text.color}, | ||
29 | - {name: 'legend-series-border-activated', type: 'boolean', defaultValue: false}, | ||
30 | - {name: 'legend-series-border-color', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.border.color}, | ||
31 | - {name: 'legend-series-intervalinfo-activated', type: 'boolean', defaultValue: false}, | ||
32 | - {name: 'legend-series-intervalinfo-type', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.intervalinfo.type}, | ||
33 | - {name: 'legend-series-font-activated', type: 'boolean', defaultValue: false}, | ||
34 | - {name: 'legend-series-font-name', type: 'string', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.name}, | ||
35 | - {name: 'legend-series-font-size', type: 'int', defaultValue: amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.size}, | ||
36 | - {name: 'legend-series-font-bold', type: 'boolean', defaultValue: false}, | ||
37 | - {name: 'legend-series-font-italic', type: 'boolean', defaultValue: false} | 23 | + fields : [ |
24 | + {name: 'legend-series-activated', type: 'boolean'}, | ||
25 | + {name: 'legend-series-type', type: 'string'}, | ||
26 | + {name: 'legend-series-position', type: 'string'}, | ||
27 | + {name: 'legend-series-showparaminfo', type: 'boolean'}, | ||
28 | + {name: 'legend-series-defaulttextcolor', type: 'string'}, | ||
29 | + {name: 'legend-series-border-activated', type: 'boolean'}, | ||
30 | + {name: 'legend-series-border-color', type: 'string'}, | ||
31 | + {name: 'legend-series-intervalinfo-activated', type: 'boolean'}, | ||
32 | + {name: 'legend-series-intervalinfo-type', type: 'string'}, | ||
33 | + {name: 'legend-series-font-activated', type: 'boolean'}, | ||
34 | + {name: 'legend-series-font-name', type: 'string'}, | ||
35 | + {name: 'legend-series-font-size', type: 'int'}, | ||
36 | + {name: 'legend-series-font-bold', type: 'boolean'}, | ||
37 | + {name: 'legend-series-font-italic', type: 'boolean'} | ||
38 | ], | 38 | ], |
39 | + | ||
40 | + constructor: function() | ||
41 | + { | ||
42 | + var me = this; | ||
43 | + me.callParent(arguments); | ||
44 | + if ((arguments.length > 0) && arguments[0]) | ||
45 | + { | ||
46 | + } | ||
47 | + else { | ||
48 | + //new object, set default fields values | ||
49 | + me.setDefaultValues(); | ||
50 | + } | ||
51 | + this.dirty = false; | ||
52 | + }, | ||
39 | 53 | ||
40 | setDefaultValues: function() | 54 | setDefaultValues: function() |
41 | { | 55 | { |
42 | - /*this.set('legend-series-activated', false); | 56 | + this.set('legend-series-activated', false); |
43 | this.set('legend-series-type', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.type); | 57 | this.set('legend-series-type', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.type); |
44 | this.set('legend-series-position', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.position); | 58 | this.set('legend-series-position', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.position); |
45 | this.set('legend-series-showparaminfo', true); | 59 | this.set('legend-series-showparaminfo', true); |
@@ -52,7 +66,7 @@ Ext.define('amdaPlotObj.PlotLegendSeriesObject', { | @@ -52,7 +66,7 @@ Ext.define('amdaPlotObj.PlotLegendSeriesObject', { | ||
52 | this.set('legend-series-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.name); | 66 | this.set('legend-series-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.name); |
53 | this.set('legend-series-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.size); | 67 | this.set('legend-series-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.legends.series.font.size); |
54 | this.set('legend-series-font-bold', false); | 68 | this.set('legend-series-font-bold', false); |
55 | - this.set('legend-series-font-italic', false);*/ | 69 | + this.set('legend-series-font-italic', false); |
56 | }, | 70 | }, |
57 | 71 | ||
58 | getShortInfo : function() | 72 | getShortInfo : function() |
@@ -86,4 +100,4 @@ Ext.define('amdaPlotObj.PlotLegendSeriesObject', { | @@ -86,4 +100,4 @@ Ext.define('amdaPlotObj.PlotLegendSeriesObject', { | ||
86 | 100 | ||
87 | return legendValues; | 101 | return legendValues; |
88 | } | 102 | } |
89 | -}); | ||
90 | \ No newline at end of file | 103 | \ No newline at end of file |
104 | +}); |
js/app/models/PlotObjects/PlotRequestObject.js
@@ -30,8 +30,7 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | @@ -30,8 +30,7 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | ||
30 | {name: 'one-file-per-interval', type: 'boolean'}, | 30 | {name: 'one-file-per-interval', type: 'boolean'}, |
31 | {name: 'last-plotted-tab', type: 'int', defaultValue: 0}, | 31 | {name: 'last-plotted-tab', type: 'int', defaultValue: 0}, |
32 | {name: 'last-tab-id', type: 'int', defaultValue: 0}, | 32 | {name: 'last-tab-id', type: 'int', defaultValue: 0}, |
33 | - {name: 'active-tab-id', type: 'int', defaultValue: 1}, | ||
34 | - {name: 'all-in-one', type: 'boolean', defaultValue: false} | 33 | + {name: 'active-tab-id', type: 'int', defaultValue: 1} |
35 | ], | 34 | ], |
36 | 35 | ||
37 | hasMany: { | 36 | hasMany: { |
@@ -74,10 +73,19 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | @@ -74,10 +73,19 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | ||
74 | 73 | ||
75 | createNewTab: function() { | 74 | createNewTab: function() { |
76 | this.set('last-tab-id', this.get('last-tab-id') + 1); | 75 | this.set('last-tab-id', this.get('last-tab-id') + 1); |
77 | - var recs = this.tabs().add({id : this.get('last-tab-id')}); | ||
78 | - recs[0].setDefaultValues(); | 76 | + var data = {id: this.get('last-tab-id')}; |
77 | + var applyDefault = true; | ||
78 | + if ((arguments.length > 0) && arguments[0]) { | ||
79 | + data = arguments[0]; | ||
80 | + data['id'] = this.get('last-tab-id'); | ||
81 | + applyDefault = false; | ||
82 | + } | ||
83 | + var recs = this.tabs().add(data); | ||
84 | + if (applyDefault) { | ||
85 | + recs[0].setDefaultValues(); | ||
86 | + } | ||
79 | this.dirty = true; | 87 | this.dirty = true; |
80 | - return recs[0]; | 88 | + return recs[0]; |
81 | }, | 89 | }, |
82 | 90 | ||
83 | removeTabById: function(tabId) { | 91 | removeTabById: function(tabId) { |
@@ -124,7 +132,6 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | @@ -124,7 +132,6 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | ||
124 | requestValues['one-file-per-interval'] = this.get('one-file-per-interval'); | 132 | requestValues['one-file-per-interval'] = this.get('one-file-per-interval'); |
125 | requestValues['last-plotted-tab'] = this.get('last-plotted-tab'); | 133 | requestValues['last-plotted-tab'] = this.get('last-plotted-tab'); |
126 | requestValues['name'] = this.get('name'); | 134 | requestValues['name'] = this.get('name'); |
127 | - requestValues['all-in-one'] = this.get('all-in-one'); | ||
128 | 135 | ||
129 | requestValues['timesrc'] = this.get('timesrc'); | 136 | requestValues['timesrc'] = this.get('timesrc'); |
130 | 137 | ||
@@ -153,26 +160,15 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | @@ -153,26 +160,15 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | ||
153 | requestValues['durationSec'] = this.get('durationSec'); | 160 | requestValues['durationSec'] = this.get('durationSec'); |
154 | } | 161 | } |
155 | 162 | ||
156 | - requestValues['tabs'] = []; | 163 | + requestValues['tabs'] = []; |
157 | 164 | ||
158 | - if (this.get('all-in-one')) { | ||
159 | - this.tabs().each(function (tab, index) { | ||
160 | - requestValues['tabs'][index] = tab.getJsonValues(); | ||
161 | - }); | 165 | + this.tabs().each(function (tab, index) { |
166 | + requestValues['tabs'][index] = tab.getJsonValues(); | ||
167 | + }); | ||
162 | 168 | ||
163 | - requestValues['active-tab-id'] = this.get('active-tab-id'); | ||
164 | - requestValues['last-tab-id'] = this.get('last-tab-id'); | ||
165 | - } | ||
166 | - else { | ||
167 | - var tab = this.tabs().getAt(this.get('active-tab-id')-1); | ||
168 | - requestValues['tabs'][0] = tab.getJsonValues(); | ||
169 | - | ||
170 | - requestValues['tabs'][0]['id'] = "1"; | ||
171 | - requestValues['active-tab-id'] = "1"; | ||
172 | - requestValues['last-tab-id'] = "1"; | ||
173 | - requestValues['last-plotted-tab'] = "0"; | ||
174 | - } | 169 | + requestValues['active-tab-id'] = this.get('active-tab-id'); |
170 | + requestValues['last-tab-id'] = this.get('last-tab-id'); | ||
175 | 171 | ||
176 | - return requestValues; | 172 | + return requestValues; |
177 | } | 173 | } |
178 | -}); | ||
179 | \ No newline at end of file | 174 | \ No newline at end of file |
175 | +}); |
js/app/models/PlotObjects/PlotTabObject.js
@@ -27,6 +27,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | @@ -27,6 +27,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | ||
27 | 27 | ||
28 | fields : [ | 28 | fields : [ |
29 | {name: 'id', type: 'int'}, | 29 | {name: 'id', type: 'int'}, |
30 | + {name: 'tab-name', type: 'string', defaultValue: ''}, | ||
30 | {name: 'tree-full-view', type: 'boolean'}, | 31 | {name: 'tree-full-view', type: 'boolean'}, |
31 | {name: 'multi-plot-linked', type: 'boolean'}, | 32 | {name: 'multi-plot-linked', type: 'boolean'}, |
32 | {name: 'page-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set | 33 | {name: 'page-node-state', type: 'int', defaultValue: 2}, //0 : collapsed, 1 : expanded, 2 : not set |
@@ -223,6 +224,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | @@ -223,6 +224,7 @@ Ext.define('amdaPlotObj.PlotTabObject', { | ||
223 | var tabValues = new Object(); | 224 | var tabValues = new Object(); |
224 | 225 | ||
225 | tabValues['id'] = this.get('id'); | 226 | tabValues['id'] = this.get('id'); |
227 | + tabValues['tab-name'] = this.get('tab-name'); | ||
226 | tabValues['tree-full-view'] = this.get('tree-full-view'); | 228 | tabValues['tree-full-view'] = this.get('tree-full-view'); |
227 | tabValues['multi-plot-linked'] = this.get('multi-plot-linked'); | 229 | tabValues['multi-plot-linked'] = this.get('multi-plot-linked'); |
228 | tabValues['page-node-state'] = this.get('page-node-state'); | 230 | tabValues['page-node-state'] = this.get('page-node-state'); |
@@ -289,4 +291,4 @@ Ext.define('amdaPlotObj.PlotTabObject', { | @@ -289,4 +291,4 @@ Ext.define('amdaPlotObj.PlotTabObject', { | ||
289 | 291 | ||
290 | return tabValues; | 292 | return tabValues; |
291 | } | 293 | } |
292 | -}); | ||
293 | \ No newline at end of file | 294 | \ No newline at end of file |
295 | +}); |
@@ -0,0 +1,164 @@ | @@ -0,0 +1,164 @@ | ||
1 | +/** | ||
2 | + * Project : AMDA-NG4 | ||
3 | + * Name : PlotTabNode.js | ||
4 | + * @class amdaModel.PlotTabNode | ||
5 | + * @extends amdaModel.ExecutableNode | ||
6 | + * @brief Basic Model of Node corresponding to a tab of a plot request | ||
7 | + * @author Benjamin Renard | ||
8 | + */ | ||
9 | + | ||
10 | +Ext.define('amdaModel.PlotTabNode', { | ||
11 | + extend: 'amdaModel.ExecutableNode', | ||
12 | + | ||
13 | + fields : [ | ||
14 | + {name : 'tabid', type:'string', defaultValue:'', persist: false} | ||
15 | + ], | ||
16 | + | ||
17 | + statics: { | ||
18 | + nodeType: 'plottab' | ||
19 | + }, | ||
20 | + | ||
21 | + constructor : function(config){ | ||
22 | + this.callParent(arguments); | ||
23 | + this.set('moduleId',myDesktopApp.dynamicModules.plot.id); | ||
24 | + //this.set('objectDataModel','amdaPlotObj.PlotRequestObject'); | ||
25 | + this.set('nodeType',this.self.nodeType); | ||
26 | + this.set('leaf',true); | ||
27 | + this.set('iconCls','icon-plot-page'); | ||
28 | + }, | ||
29 | + | ||
30 | + allMenuItems : function() { | ||
31 | + var menuItems = | ||
32 | + [ | ||
33 | + { | ||
34 | + fnId : 'ptab-openTab', | ||
35 | + text : 'Open in new Plot Request' | ||
36 | + }, { | ||
37 | + fnId : 'ptab-insertTab', | ||
38 | + text : 'Insert in current Plot Request' | ||
39 | + }, { | ||
40 | + fnId : 'ptab-renameTab', | ||
41 | + text : 'Rename Plot Tab' | ||
42 | + }]; | ||
43 | + | ||
44 | + return menuItems; | ||
45 | + }, | ||
46 | + | ||
47 | + allMenuMultiItems : function() { | ||
48 | + var menuMulti = [ | ||
49 | + ]; | ||
50 | + return menuMulti; | ||
51 | + }, | ||
52 | + | ||
53 | + getAllContextMenuItems: function(){ | ||
54 | + return this.allMenuItems(); | ||
55 | + }, | ||
56 | + | ||
57 | + getMultiContextMenuItems: function(){ | ||
58 | + return this.allMenuMultiItems(); | ||
59 | + }, | ||
60 | + | ||
61 | + onMenuItemClick : function(menu,item,event) { | ||
62 | + | ||
63 | + var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length); | ||
64 | + | ||
65 | + switch (fnId) { | ||
66 | + | ||
67 | + case 'openTab': | ||
68 | + this.insertPlotTabRequest(true); | ||
69 | + break; | ||
70 | + | ||
71 | + case 'insertTab': | ||
72 | + this.insertPlotTabRequest(false); | ||
73 | + break; | ||
74 | + | ||
75 | + case 'renameTab': | ||
76 | + this.renameTab(); | ||
77 | + break; | ||
78 | + default: | ||
79 | + break; | ||
80 | + } | ||
81 | + }, | ||
82 | + | ||
83 | + insertPlotTabRequest : function(inNewRequest) { | ||
84 | + var me = this; | ||
85 | + amdaModel.InteractiveNode.preloadNodes(this.parentNode.getRootNode(), function() { | ||
86 | + AmdaAction.getObject(me.parentNode.get('id'), me.parentNode.get('nodeType'), function (result,remoteEvent) { | ||
87 | + var paramObj = Ext.create(me.parentNode.get('objectDataModel'), result); | ||
88 | + var tabData = null; | ||
89 | + paramObj.tabs().each(function(tab) { | ||
90 | + if (tab.get('id') == me.get('tabid')) { | ||
91 | + tabData = tab.getJsonValues(); | ||
92 | + } | ||
93 | + }); | ||
94 | + if (tabData != null) { | ||
95 | + if (inNewRequest) { | ||
96 | + tabData['id'] = 1; | ||
97 | + paramObj.set('id',''); | ||
98 | + paramObj.set('name', ''); | ||
99 | + paramObj.set('folderId', ''); | ||
100 | + paramObj.set('active-tab-id', 1); | ||
101 | + paramObj.set('last-tab-id', 1); | ||
102 | + paramObj.set('last-plotted-tab', 1); | ||
103 | + paramObj.loadTabs([tabData]); | ||
104 | + myDesktopApp.getLoadedModule(me.get('moduleId'), true, function (module) { | ||
105 | + module.setContextNode(me.parentNode.getRootNode()); | ||
106 | + module.createWindow(function () { | ||
107 | + var uiContent = module.getUiContent(); | ||
108 | + if (uiContent != null) { | ||
109 | + uiContent.resetProcess(paramObj.getJsonValues()); | ||
110 | + } | ||
111 | + }); | ||
112 | + }); | ||
113 | + } | ||
114 | + else { | ||
115 | + myDesktopApp.getLoadedModule(me.get('moduleId'), true, function (module) { | ||
116 | + module.createWindow(function () { | ||
117 | + var uiContent = module.getUiContent(); | ||
118 | + if (uiContent != null) { | ||
119 | + var tabObj = new amdaPlotObj.PlotTabObject(tabData); | ||
120 | + uiContent.insertPlotTab(tabData); | ||
121 | + } | ||
122 | + }); | ||
123 | + }); | ||
124 | + } | ||
125 | + } | ||
126 | + }, me); | ||
127 | + }); | ||
128 | + }, | ||
129 | + | ||
130 | + editPlotTab : function() { | ||
131 | + var me = this; | ||
132 | + this.parentNode.editLeaf(function () { | ||
133 | + myDesktopApp.getLoadedModule(me.get('moduleId'), true, function (module) { | ||
134 | + var uiContent = module.getUiContent(); | ||
135 | + if (uiContent != null) { | ||
136 | + uiContent.forceActiveTab(me.get('tabid')); | ||
137 | + } | ||
138 | + }); | ||
139 | + }); | ||
140 | + }, | ||
141 | + | ||
142 | + renameTab: function() { | ||
143 | + if (this.myGetOwnerTree()) { | ||
144 | + var item = this.myGetOwnerTree().getSelectionModel().selected.items[0]; | ||
145 | + this.myGetOwnerTree().fireEvent('edition', this.myGetOwnerTree().view, item); | ||
146 | + } | ||
147 | + }, | ||
148 | + | ||
149 | + rename: function(value,callBackFn) { | ||
150 | + var me = this; | ||
151 | + var dataToSend = {id : this.get('tabid'), old_name: this.modified.text, name: value, parent : this.data.parentId, leaf: this.isLeaf(), nodeType: this.get('nodeType')}; | ||
152 | + AmdaAction.renameObject(dataToSend, function (result) { | ||
153 | + callBackFn(result); | ||
154 | + myDesktopApp.getLoadedModule(me.get('moduleId'), true, function (module) { | ||
155 | + var uiContent = module.getUiContent(); | ||
156 | + if (uiContent != null) { | ||
157 | + if ((module.linkedNode != null) && (module.linkedNode.get('id') == dataToSend.parent)) { | ||
158 | + uiContent.updatePlotTabName(dataToSend.id, dataToSend.name); | ||
159 | + } | ||
160 | + } | ||
161 | + }); | ||
162 | + }); | ||
163 | + }, | ||
164 | +}); |
js/app/views/DownloadUI.js
@@ -459,6 +459,7 @@ Ext.define('amdaUI.DownloadUI', { | @@ -459,6 +459,7 @@ Ext.define('amdaUI.DownloadUI', { | ||
459 | } | 459 | } |
460 | break; | 460 | break; |
461 | case 'alias' : | 461 | case 'alias' : |
462 | + // console.log(data.records[0].data); | ||
462 | idToSent = "#" + data.records[0].get('text'); | 463 | idToSent = "#" + data.records[0].get('text'); |
463 | break; | 464 | break; |
464 | case 'derivedParam' : | 465 | case 'derivedParam' : |
@@ -481,7 +482,7 @@ Ext.define('amdaUI.DownloadUI', { | @@ -481,7 +482,7 @@ Ext.define('amdaUI.DownloadUI', { | ||
481 | } | 482 | } |
482 | break; | 483 | break; |
483 | case 'myDataParam' : | 484 | case 'myDataParam' : |
484 | - idToSent = "ws_" + data.records[0].get('text'); | 485 | + idToSent = "wsd_" + data.records[0].get('text'); |
485 | break; | 486 | break; |
486 | default : | 487 | default : |
487 | return false; | 488 | return false; |
js/app/views/ExplorerUI.js
@@ -102,6 +102,7 @@ Ext.define('amdaUI.ExplorerUI', { | @@ -102,6 +102,7 @@ Ext.define('amdaUI.ExplorerUI', { | ||
102 | ITEM_KIND_LEAF : 'leaf', | 102 | ITEM_KIND_LEAF : 'leaf', |
103 | ITEM_KIND_DIRE : 'dire', | 103 | ITEM_KIND_DIRE : 'dire', |
104 | ITEM_KIND_PARA : 'para', | 104 | ITEM_KIND_PARA : 'para', |
105 | + ITEM_KIND_PTAB : 'ptab', //plot tab | ||
105 | ITEM_KIND_MISS : 'miss' | 106 | ITEM_KIND_MISS : 'miss' |
106 | }, | 107 | }, |
107 | 108 | ||
@@ -231,7 +232,7 @@ Ext.define('amdaUI.ExplorerUI', { | @@ -231,7 +232,7 @@ Ext.define('amdaUI.ExplorerUI', { | ||
231 | toggleGroup: 'sorting', | 232 | toggleGroup: 'sorting', |
232 | handler: function(){ | 233 | handler: function(){ |
233 | var tree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); | 234 | var tree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); |
234 | - tree.getStore().sort([{ property : 'rank' }]); | 235 | + tree.getStore().sort('rank'); |
235 | this.updateFilter(); | 236 | this.updateFilter(); |
236 | } | 237 | } |
237 | }] | 238 | }] |
@@ -353,6 +354,7 @@ Ext.define('amdaUI.ExplorerUI', { | @@ -353,6 +354,7 @@ Ext.define('amdaUI.ExplorerUI', { | ||
353 | case 'remoteParam' : | 354 | case 'remoteParam' : |
354 | case 'remoteSimuParam' : | 355 | case 'remoteSimuParam' : |
355 | case 'myData' : | 356 | case 'myData' : |
357 | + case 'plottab' : | ||
356 | return false; | 358 | return false; |
357 | default : | 359 | default : |
358 | if (draggedRecord.data.id == targetNode.data.nodeType+'-treeRootNode') | 360 | if (draggedRecord.data.id == targetNode.data.nodeType+'-treeRootNode') |
@@ -575,13 +577,13 @@ Ext.define('amdaUI.ExplorerUI', { | @@ -575,13 +577,13 @@ Ext.define('amdaUI.ExplorerUI', { | ||
575 | }); | 577 | }); |
576 | } | 578 | } |
577 | 579 | ||
578 | - if (record.isLeaf() || record.data.isParameter) | 580 | + if (record.isLeaf() || record.data.isParameter || (record.data.tabs && (record.data.tabs.length > 0))) |
579 | switch (record.get('nodeType')) | 581 | switch (record.get('nodeType')) |
580 | { | 582 | { |
581 | case 'myData' : | 583 | case 'myData' : |
582 | case 'myDataParam' : | 584 | case 'myDataParam' : |
583 | case 'derivedParam' : | 585 | case 'derivedParam' : |
584 | - case 'timeTable' : | 586 | + case 'timeTable' : |
585 | case 'sharedtimeTable' : | 587 | case 'sharedtimeTable' : |
586 | case 'sharedcatalog' : | 588 | case 'sharedcatalog' : |
587 | case 'catalog' : | 589 | case 'catalog' : |
@@ -589,6 +591,9 @@ Ext.define('amdaUI.ExplorerUI', { | @@ -589,6 +591,9 @@ Ext.define('amdaUI.ExplorerUI', { | ||
589 | case 'condition' : | 591 | case 'condition' : |
590 | record.editLeaf(); | 592 | record.editLeaf(); |
591 | break; | 593 | break; |
594 | + case 'plottab' : | ||
595 | + record.editPlotTab(); | ||
596 | + break; | ||
592 | case 'localParam' : | 597 | case 'localParam' : |
593 | case 'remoteParam': | 598 | case 'remoteParam': |
594 | case 'remoteSimuParam': | 599 | case 'remoteSimuParam': |
@@ -1024,7 +1029,7 @@ Ext.define( 'MyTreeEditor', { | @@ -1024,7 +1029,7 @@ Ext.define( 'MyTreeEditor', { | ||
1024 | event.record.commit(); | 1029 | event.record.commit(); |
1025 | var rec = event.record.data; | 1030 | var rec = event.record.data; |
1026 | // in case of directory | 1031 | // in case of directory |
1027 | - if (!rec.leaf){ | 1032 | + if (!rec.leaf && (rec.nodeType != 'plottab')){ |
1028 | // set folder's ID returned by server | 1033 | // set folder's ID returned by server |
1029 | rec.id = result.id; | 1034 | rec.id = result.id; |
1030 | } | 1035 | } |
js/app/views/PlotComponents/PlotTabPanel.js
@@ -31,16 +31,20 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -31,16 +31,20 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
31 | 31 | ||
32 | setRequestObject: function(object) | 32 | setRequestObject: function(object) |
33 | { | 33 | { |
34 | + var me = this; | ||
34 | this.removeAll(); | 35 | this.removeAll(); |
35 | this.object = object; | 36 | this.object = object; |
36 | - var selectedTab = this.object.get('active-tab-id'); | ||
37 | 37 | ||
38 | + var haveSelectedTab = false; | ||
38 | this.object.tabs().each(function (rec, index) { | 39 | this.object.tabs().each(function (rec, index) { |
39 | - var isSelected = false; | ||
40 | - if (index+1 == selectedTab) | ||
41 | - isSelected = true; | 40 | + if (rec.get('id') == me.object.get('active-tab-id')) { |
41 | + haveSelectedTab = true; | ||
42 | + } | ||
43 | + }); | ||
42 | 44 | ||
43 | - this.addPlotTab(rec, isSelected); | 45 | + this.object.tabs().each(function (rec, index) { |
46 | + var isSelectedTab = haveSelectedTab ? (rec.get('id') == me.object.get('active-tab-id')) : (index == 0); | ||
47 | + this.addPlotTab(rec, isSelectedTab); | ||
44 | }, this); | 48 | }, this); |
45 | }, | 49 | }, |
46 | 50 | ||
@@ -49,8 +53,9 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -49,8 +53,9 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
49 | var tabNumber = this.getTabBar().items.getCount(); | 53 | var tabNumber = this.getTabBar().items.getCount(); |
50 | var tabContent = new amdaPlotComp.PlotTabContent({plotElementPanel: this.plotElementPanel, plotTabPanel : this, tabId : tabObject.get('id')}); | 54 | var tabContent = new amdaPlotComp.PlotTabContent({plotElementPanel: this.plotElementPanel, plotTabPanel : this, tabId : tabObject.get('id')}); |
51 | tabContent.setTabObject(tabObject); | 55 | tabContent.setTabObject(tabObject); |
56 | + var me = this; | ||
52 | var tabComp = this.add({ | 57 | var tabComp = this.add({ |
53 | - title: 'Plot '+tabNumber, | 58 | + title: (tabObject.get('tab-name') != '') ? tabObject.get('tab-name') : 'Plot '+tabNumber, |
54 | closable: true, | 59 | closable: true, |
55 | layout: 'fit', | 60 | layout: 'fit', |
56 | bodyStyle: 'background: none', | 61 | bodyStyle: 'background: none', |
@@ -75,8 +80,34 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -75,8 +80,34 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
75 | this.object.removeTabById(tab.items.getAt(0).object.get('id')); | 80 | this.object.removeTabById(tab.items.getAt(0).object.get('id')); |
76 | }, | 81 | }, |
77 | destroy: function(tab, eOpts) { | 82 | destroy: function(tab, eOpts) { |
83 | + | ||
78 | this.updatePlotTabs(); | 84 | this.updatePlotTabs(); |
79 | - } | 85 | + }, |
86 | + afterrender: function(tab, e0pts) { | ||
87 | + if (!tab.tab.el) { | ||
88 | + return; | ||
89 | + } | ||
90 | + tab.tab.el.on('contextmenu', function(e, t, eOpts) { | ||
91 | + var menu = new Ext.menu.Menu({ | ||
92 | + items: [ | ||
93 | + { | ||
94 | + text: 'Rename', | ||
95 | + handler: function() { | ||
96 | + Ext.Msg.prompt('Rename', 'Please enter new plot tab name:', function(btn, text){ | ||
97 | + if (btn == 'ok'){ | ||
98 | + tabObject.set('tab-name',text); | ||
99 | + me.updatePlotTabs(); | ||
100 | + } | ||
101 | + }, me); | ||
102 | + } | ||
103 | + } | ||
104 | + ] | ||
105 | + }); | ||
106 | + var position = e.getXY(); | ||
107 | + e.stopEvent(); | ||
108 | + menu.showAt(position); | ||
109 | + },this); | ||
110 | + } | ||
80 | } | 111 | } |
81 | }); | 112 | }); |
82 | 113 | ||
@@ -88,12 +119,32 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -88,12 +119,32 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
88 | 119 | ||
89 | updatePlotTabs: function() | 120 | updatePlotTabs: function() |
90 | { | 121 | { |
122 | + var me = this; | ||
123 | + var haveSelectedTab = false; | ||
124 | + this.object.tabs().each(function (rec, index) { | ||
125 | + if (rec.get('id') == me.object.get('active-tab-id')) { | ||
126 | + haveSelectedTab = true; | ||
127 | + } | ||
128 | + }); | ||
129 | + | ||
91 | var i = 0; | 130 | var i = 0; |
92 | for (i = 0; i < this.items.getCount(); ++i) | 131 | for (i = 0; i < this.items.getCount(); ++i) |
93 | { | 132 | { |
133 | + var tabItem = this.items.getAt(i); | ||
134 | + var tabContent = tabItem.items.getAt(0); | ||
135 | + var tabObj = this.object.tabs().getById(tabContent.tabId); | ||
136 | + if (!tabObj) { | ||
137 | + continue; | ||
138 | + } | ||
139 | + if (!haveSelectedTab) { | ||
140 | + //Set first tab as the selected one | ||
141 | + this.setActiveTab(tabItem); | ||
142 | + this.object.set('active-tab-id', tabObj.get('id')); | ||
143 | + haveSelectedTab = true; | ||
144 | + } | ||
94 | var tabNumber = i+1; | 145 | var tabNumber = i+1; |
95 | - this.items.getAt(i).setTitle('Plot '+tabNumber); | ||
96 | - this.items.getAt(i).items.getAt(0).setTabObject(this.object.tabs().getAt(i)); | 146 | + tabItem.setTitle((tabObj.get('tab-name') != '') ? tabObj.get('tab-name') : 'Plot '+tabNumber); |
147 | + tabContent.setTabObject(tabObj); | ||
97 | } | 148 | } |
98 | }, | 149 | }, |
99 | 150 |
js/app/views/PlotUI.js
@@ -32,8 +32,6 @@ Ext.define('amdaUI.PlotUI', { | @@ -32,8 +32,6 @@ Ext.define('amdaUI.PlotUI', { | ||
32 | 32 | ||
33 | plotElement : null, | 33 | plotElement : null, |
34 | 34 | ||
35 | - allPlots : false, | ||
36 | - | ||
37 | constructor: function(config) { | 35 | constructor: function(config) { |
38 | this.init(config); | 36 | this.init(config); |
39 | this.callParent(arguments); | 37 | this.callParent(arguments); |
@@ -47,12 +45,6 @@ Ext.define('amdaUI.PlotUI', { | @@ -47,12 +45,6 @@ Ext.define('amdaUI.PlotUI', { | ||
47 | this.plotTabs.setRequestObject(this.object); | 45 | this.plotTabs.setRequestObject(this.object); |
48 | this.timeSelector.intervalSel.setInterval(this.object.get('startDate'), this.object.get('stopDate')); | 46 | this.timeSelector.intervalSel.setInterval(this.object.get('startDate'), this.object.get('stopDate')); |
49 | this.addTTs(this.object.get('timeTables')); | 47 | this.addTTs(this.object.get('timeTables')); |
50 | - this.updateRequestOption(this.object.get('all-in-one')); | ||
51 | - }, | ||
52 | - | ||
53 | - updateRequestOption : function(allInOne) { | ||
54 | - var requestOptionCB = this.formPanel.getForm().findField('all-in-one'); | ||
55 | - requestOptionCB.setValue(allInOne); | ||
56 | }, | 48 | }, |
57 | 49 | ||
58 | /** | 50 | /** |
@@ -92,7 +84,11 @@ Ext.define('amdaUI.PlotUI', { | @@ -92,7 +84,11 @@ Ext.define('amdaUI.PlotUI', { | ||
92 | resetProcess : function(){ | 84 | resetProcess : function(){ |
93 | var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); | 85 | var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); |
94 | plotModule.createLinkedNode(); | 86 | plotModule.createLinkedNode(); |
95 | - plotModule.createObject(); | 87 | + var obj = null; |
88 | + if ((arguments.length > 0) && (arguments[0] != null)) { | ||
89 | + obj = arguments[0]; | ||
90 | + } | ||
91 | + plotModule.createObject(obj); | ||
96 | this.setObject(plotModule.linkedNode.get('object')); | 92 | this.setObject(plotModule.linkedNode.get('object')); |
97 | }, | 93 | }, |
98 | 94 | ||
@@ -119,7 +115,6 @@ Ext.define('amdaUI.PlotUI', { | @@ -119,7 +115,6 @@ Ext.define('amdaUI.PlotUI', { | ||
119 | doPlot : function(){ | 115 | doPlot : function(){ |
120 | 116 | ||
121 | this.updateObject(); | 117 | this.updateObject(); |
122 | - this.object.set('all-in-one', true); | ||
123 | this.object.set('last-plotted-tab', this.plotTabs.getSelectedTabId()); | 118 | this.object.set('last-plotted-tab', this.plotTabs.getSelectedTabId()); |
124 | var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); | 119 | var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); |
125 | if (plotModule) | 120 | if (plotModule) |
@@ -180,10 +175,154 @@ Ext.define('amdaUI.PlotUI', { | @@ -180,10 +175,154 @@ Ext.define('amdaUI.PlotUI', { | ||
180 | 175 | ||
181 | this.timeSelector.intervalSel.setInterval(dateStart, dateStop); | 176 | this.timeSelector.intervalSel.setInterval(dateStart, dateStop); |
182 | }, | 177 | }, |
178 | + | ||
179 | + forceActiveTab : function(tabId) { | ||
180 | + for (var i = 0; i < this.plotTabs.items.getCount(); ++i) { | ||
181 | + var plotTab = this.plotTabs.items.getAt(i).items.getAt(0); | ||
182 | + if (plotTab.tabId == tabId) { | ||
183 | + this.plotTabs.setActiveTab(i); | ||
184 | + return; | ||
185 | + } | ||
186 | + } | ||
187 | + }, | ||
188 | + | ||
189 | + updatePlotTabName: function(tabId, name) { | ||
190 | + var me = this; | ||
191 | + this.object.tabs().each(function (tabObject) { | ||
192 | + if (tabId == tabObject.getId()) { | ||
193 | + tabObject.set('tab-name', name); | ||
194 | + me.plotTabs.updatePlotTabs(); | ||
195 | + } | ||
196 | + }); | ||
197 | + }, | ||
198 | + | ||
199 | + insertPlotTab : function(tabData) { | ||
200 | + var newTab = this.object.createNewTab(tabData); | ||
201 | + this.plotTabs.addPlotTab(newTab,true); | ||
202 | + }, | ||
183 | 203 | ||
184 | updateLinkedToMultiPlotMode : function(isLinkedToMultiPlotMode) { | 204 | updateLinkedToMultiPlotMode : function(isLinkedToMultiPlotMode) { |
185 | this.timeSelector.setVisible(isLinkedToMultiPlotMode); | 205 | this.timeSelector.setVisible(isLinkedToMultiPlotMode); |
186 | }, | 206 | }, |
207 | + | ||
208 | + keepOnlySelectedTabInObject: function(showWarning, onSuccess) { | ||
209 | + if (this.object.tabs().count() == 1) { | ||
210 | + if (onSuccess) { | ||
211 | + onSuccess(); | ||
212 | + } | ||
213 | + return; | ||
214 | + } | ||
215 | + | ||
216 | + var me = this; | ||
217 | + var removeFunc = function() { | ||
218 | + var tabsToRemove = []; | ||
219 | + var selectedTabFound = false; | ||
220 | + me.object.tabs().each(function(tab) { | ||
221 | + if (tab.get('id') != me.object.get('active-tab-id')) { | ||
222 | + tabsToRemove.push(tab); | ||
223 | + } | ||
224 | + else { | ||
225 | + selectedTabFound = true; | ||
226 | + } | ||
227 | + }); | ||
228 | + if (!selectedTabFound) { | ||
229 | + myDesktopApp.errorMsg('Cannot retrieve selected tab'); | ||
230 | + return false; | ||
231 | + } | ||
232 | + if (tabsToRemove.length > 0) { | ||
233 | + me.object.tabs().remove(tabsToRemove); | ||
234 | + } | ||
235 | + return true; | ||
236 | + }; | ||
237 | + | ||
238 | + if (!showWarning) { | ||
239 | + if (removeFunc()) { | ||
240 | + if (onSuccess) { | ||
241 | + onSuccess(); | ||
242 | + } | ||
243 | + } | ||
244 | + return; | ||
245 | + } | ||
246 | + | ||
247 | + | ||
248 | + Ext.Msg.show( { title : 'Warning', | ||
249 | + msg: 'Active plot will be saved, but other ones will be lost.<br/>Do you want to continue?', | ||
250 | + width: 300, | ||
251 | + buttons: Ext.Msg.OKCANCEL, | ||
252 | + fn: function(btn) { | ||
253 | + if (btn == 'cancel') return; | ||
254 | + | ||
255 | + if (removeFunc()) { | ||
256 | + if (onSuccess) { | ||
257 | + onSuccess(); | ||
258 | + } | ||
259 | + } | ||
260 | + return; | ||
261 | + }, | ||
262 | + scope: me | ||
263 | + }); | ||
264 | + }, | ||
265 | + | ||
266 | + savePlotRequest : function(allTabs) { | ||
267 | + var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); | ||
268 | + if (!plotModule) | ||
269 | + return; | ||
270 | + this.updateObject(); | ||
271 | + this.object.set('active-tab-id', this.plotTabs.getSelectedTabId()); | ||
272 | + var me = this; | ||
273 | + | ||
274 | + if ((this.object.get('id') != '') && (plotModule.linkedNode.get('text') == this.object.get('name'))) { | ||
275 | + //update existing request | ||
276 | + if (!allTabs) { | ||
277 | + this.keepOnlySelectedTabInObject(true, function() { | ||
278 | + plotModule.linkedNode.update(); | ||
279 | + }); | ||
280 | + } | ||
281 | + else { | ||
282 | + plotModule.linkedNode.update(); | ||
283 | + } | ||
284 | + return; | ||
285 | + } | ||
286 | + | ||
287 | + //save new request | ||
288 | + var me = this; | ||
289 | + plotModule.linkedNode.isValidName(this.object.get('name'), function (res) { | ||
290 | + if (!res) { | ||
291 | + myDesktopApp.errorMsg('Error during object validation'); | ||
292 | + return; | ||
293 | + } | ||
294 | + if (!res.valid) { | ||
295 | + if (res.error) { | ||
296 | + if (res.error.search('subtree') != -1) { | ||
297 | + Ext.Msg.show( { title : 'Warning', | ||
298 | + msg: res.error + '<br/>Do you want to overwrite it?', | ||
299 | + width: 300, | ||
300 | + buttons: Ext.Msg.OKCANCEL, | ||
301 | + icon: Ext.Msg.WARNING, | ||
302 | + fn : me.overwriteProcess, | ||
303 | + scope : me | ||
304 | + }); | ||
305 | + } | ||
306 | + else { | ||
307 | + myDesktopApp.errorMsg(res.error); | ||
308 | + } | ||
309 | + } | ||
310 | + else { | ||
311 | + myDesktopApp.errorMsg('Invalid object name'); | ||
312 | + } | ||
313 | + return; | ||
314 | + } | ||
315 | + if (!allTabs) { | ||
316 | + me.keepOnlySelectedTabInObject((me.object.get('id') == ''), function() { | ||
317 | + me.saveProcess(false); | ||
318 | + me.setObject(me.object); | ||
319 | + }); | ||
320 | + } | ||
321 | + else { | ||
322 | + me.saveProcess(false); | ||
323 | + } | ||
324 | + }); | ||
325 | + }, | ||
187 | 326 | ||
188 | init : function(config) { | 327 | init : function(config) { |
189 | this.timeSelector = new amdaUI.TimeSelectorUI( { id: 'multiPlotTimeSelector' + config.id, title : 'MultiPlot Time Selection', border : false, collapsible : true, collapseDirection : 'bottom', visible : false, flex: 2 } ); | 328 | this.timeSelector = new amdaUI.TimeSelectorUI( { id: 'multiPlotTimeSelector' + config.id, title : 'MultiPlot Time Selection', border : false, collapsible : true, collapseDirection : 'bottom', visible : false, flex: 2 } ); |
@@ -252,7 +391,8 @@ Ext.define('amdaUI.PlotUI', { | @@ -252,7 +391,8 @@ Ext.define('amdaUI.PlotUI', { | ||
252 | ] | 391 | ] |
253 | } | 392 | } |
254 | ], | 393 | ], |
255 | - fbar: [{ | 394 | + fbar: [ |
395 | + { | ||
256 | xtype: 'button', | 396 | xtype: 'button', |
257 | text: 'Plot', | 397 | text: 'Plot', |
258 | scope: this, | 398 | scope: this, |
@@ -275,68 +415,24 @@ Ext.define('amdaUI.PlotUI', { | @@ -275,68 +415,24 @@ Ext.define('amdaUI.PlotUI', { | ||
275 | } | 415 | } |
276 | }, | 416 | }, |
277 | '->', '-', { | 417 | '->', '-', { |
278 | - xtype: 'button', | ||
279 | - text: 'Save Request', | 418 | + xtype: 'splitbutton', |
419 | + text: 'Save All Tabs', | ||
420 | + menu: { | ||
421 | + items: [ | ||
422 | + { | ||
423 | + text: 'Save Current Tab', | ||
424 | + scope: this, | ||
425 | + handler: function() { | ||
426 | + this.savePlotRequest(false); | ||
427 | + } | ||
428 | + }, | ||
429 | + ] | ||
430 | + }, | ||
280 | scope: this, | 431 | scope: this, |
281 | handler: function(button) { | 432 | handler: function(button) { |
282 | - var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); | ||
283 | - if (!plotModule) | ||
284 | - return; | ||
285 | - | ||
286 | - this.updateObject(); | ||
287 | - this.object.set('active-tab-id', this.plotTabs.getSelectedTabId()); | ||
288 | - this.object.set('all-in-one', this.allPlots); | ||
289 | - | ||
290 | - //update existing request | ||
291 | - if ((this.object.get('id') != '') && | ||
292 | - (plotModule.linkedNode.get('text') == this.object.get('name'))) | ||
293 | - plotModule.linkedNode.update(); | ||
294 | - else { | ||
295 | - var me = this; | ||
296 | - plotModule.linkedNode.isValidName(this.object.get('name'), function (res) { | ||
297 | - if (!res) { | ||
298 | - myDesktopApp.errorMsg('Error during object validation'); | ||
299 | - return; | ||
300 | - } | ||
301 | - if (!res.valid) { | ||
302 | - if (res.error) { | ||
303 | - if (res.error.search('subtree') != -1) { | ||
304 | - Ext.Msg.show( { title : 'Warning', | ||
305 | - msg: res.error + '<br/>Do you want to overwrite it?', | ||
306 | - width: 300, | ||
307 | - buttons: Ext.Msg.OKCANCEL, | ||
308 | - icon: Ext.Msg.WARNING, | ||
309 | - fn : me.overwriteProcess, | ||
310 | - scope : me | ||
311 | - }); | ||
312 | - } | ||
313 | - else { | ||
314 | - myDesktopApp.errorMsg(res.error); | ||
315 | - } | ||
316 | - } | ||
317 | - else { | ||
318 | - myDesktopApp.errorMsg('Invalid object name'); | ||
319 | - } | ||
320 | - | ||
321 | - return; | ||
322 | - } | ||
323 | - me.saveProcess(false); | ||
324 | - }) | ||
325 | - } | ||
326 | - } | ||
327 | - }, ' ', | ||
328 | - myDesktopApp.addAmdaInfo('plotSaveRequest'), | ||
329 | - ' ', { | ||
330 | - xtype: 'checkbox', | ||
331 | - boxLabel: 'All Plot Tabs', | ||
332 | - name : 'all-in-one', | ||
333 | - listeners : { | ||
334 | - scope: this, | ||
335 | - change: function (cb, nv, ov) { | ||
336 | - this.allPlots = nv; | ||
337 | - } | 433 | + this.savePlotRequest(true); |
338 | } | 434 | } |
339 | - } | 435 | + } |
340 | ] | 436 | ] |
341 | }); | 437 | }); |
342 | 438 |
js/resources/css/amda.css
@@ -354,6 +354,12 @@ background-image: url(../images/16x16/error.png) !important; | @@ -354,6 +354,12 @@ background-image: url(../images/16x16/error.png) !important; | ||
354 | opacity:0.5 !important; | 354 | opacity:0.5 !important; |
355 | } | 355 | } |
356 | 356 | ||
357 | +.icon-sun { | ||
358 | + background-image:url(../images/icons/sun.png) !important; | ||
359 | + background-position: center; | ||
360 | + background-repeat: no-repeat; | ||
361 | +} | ||
362 | + | ||
357 | .icon-mercury { | 363 | .icon-mercury { |
358 | background-image:url(../images/icons/mercury.png) !important; | 364 | background-image:url(../images/icons/mercury.png) !important; |
359 | background-position: center; | 365 | background-position: center; |
@@ -456,6 +462,10 @@ p + p { | @@ -456,6 +462,10 @@ p + p { | ||
456 | background-image:url( ../images/16x16/plot_page.png ) !important; | 462 | background-image:url( ../images/16x16/plot_page.png ) !important; |
457 | } | 463 | } |
458 | 464 | ||
465 | +.icon-plot-pages { | ||
466 | + background-image:url( ../images/16x16/plot_pages.png ) !important; | ||
467 | +} | ||
468 | + | ||
459 | .icon-plot-layout { | 469 | .icon-plot-layout { |
460 | background-image:url( ../images/16x16/plot_layout.png ) !important; | 470 | background-image:url( ../images/16x16/plot_layout.png ) !important; |
461 | } | 471 | } |
150 Bytes
php/classes/AmdaAction.php
@@ -151,6 +151,7 @@ class AmdaAction | @@ -151,6 +151,7 @@ class AmdaAction | ||
151 | $isParameter = false; | 151 | $isParameter = false; |
152 | $isAddable = false; | 152 | $isAddable = false; |
153 | $isSimulation = false; | 153 | $isSimulation = false; |
154 | + $plotTabs = FALSE; | ||
154 | $rank = null; | 155 | $rank = null; |
155 | $skip = FALSE; | 156 | $skip = FALSE; |
156 | 157 | ||
@@ -178,18 +179,44 @@ class AmdaAction | @@ -178,18 +179,44 @@ class AmdaAction | ||
178 | case 'request': | 179 | case 'request': |
179 | $objectMgr = new RequestMgr(); | 180 | $objectMgr = new RequestMgr(); |
180 | $objplot = $objectMgr->getObject($id); | 181 | $objplot = $objectMgr->getObject($id); |
181 | - for ($i=0; $i < count($objplot->children); $i++) | ||
182 | - { | ||
183 | - for ($j=0; $j < count($objplot->children[$i]->children); $j++) { | ||
184 | - $info = $info.' . '.$objplot->children[$i]->children[$j]->name; | 182 | + if (isset($objplot->name)) { |
183 | + $info = $objplot->name; | ||
184 | + } | ||
185 | + else { | ||
186 | + $info = $id; | ||
187 | + } | ||
188 | + | ||
189 | + $isLeaf = isset($objplot->tabs); | ||
190 | + if ($isLeaf) { | ||
191 | + $plotTabs = array(); | ||
192 | + foreach ($objplot->tabs as $index => $tab) { | ||
193 | + $plotTabs[$index] = array( | ||
194 | + "name" => (!empty($tab->{'tab-name'})) ? $tab->{'tab-name'} : "Plot ".($index+1), | ||
195 | + "id" => $tab->id, | ||
196 | + ); | ||
185 | } | 197 | } |
186 | } | 198 | } |
199 | + else | ||
200 | + $plotTabs = FALSE; | ||
187 | break; | 201 | break; |
188 | 202 | ||
189 | case 'alias': | 203 | case 'alias': |
190 | $info = $id; | 204 | $info = $id; |
191 | $id = 'alias_'.$id; | 205 | $id = 'alias_'.$id; |
206 | + $component_info = array(); | ||
207 | + if ($child->hasAttribute("index1")) | ||
208 | + $component_info["index1"] = $child->getAttribute('index1'); | ||
209 | + if ($child->hasAttribute("index2")) | ||
210 | + $component_info["index2"] = $child->getAttribute('index2'); | ||
211 | + | ||
212 | + if ($child->hasAttribute("parentId")) | ||
213 | + $component_info["parentId"] = $child->getAttribute("parentId"); | ||
214 | + | ||
215 | + if ($child->hasAttribute("iconCls")) | ||
216 | + $iconCls = $child->getAttribute("iconCls"); | ||
217 | + | ||
192 | if ($isLeaf) $isParameter = true; | 218 | if ($isLeaf) $isParameter = true; |
219 | + | ||
193 | break; | 220 | break; |
194 | 221 | ||
195 | case 'timeTable': | 222 | case 'timeTable': |
@@ -254,8 +281,16 @@ class AmdaAction | @@ -254,8 +281,16 @@ class AmdaAction | ||
254 | // } | 281 | // } |
255 | } | 282 | } |
256 | 283 | ||
257 | - if ($child->hasAttribute('units')) $info = $child->getAttribute('units'); | ||
258 | - | 284 | + if ($child->hasAttribute('units')) { |
285 | + | ||
286 | + $units = $child->getAttribute('units'); | ||
287 | + | ||
288 | + if ($child->hasAttribute('description')) | ||
289 | + $info = $child->getAttribute('description')."<br/>".$units; | ||
290 | + else | ||
291 | + $info = $units; | ||
292 | + } | ||
293 | + | ||
259 | if ($child->tagName == 'parameter') { | 294 | if ($child->tagName == 'parameter') { |
260 | $isParameter = true; | 295 | $isParameter = true; |
261 | 296 | ||
@@ -313,6 +348,7 @@ class AmdaAction | @@ -313,6 +348,7 @@ class AmdaAction | ||
313 | } | 348 | } |
314 | } | 349 | } |
315 | 350 | ||
351 | + | ||
316 | if ($isParameter) { | 352 | if ($isParameter) { |
317 | $objectMgr = new AliasMgr(); | 353 | $objectMgr = new AliasMgr(); |
318 | $alias = $objectMgr->getAlias($id); | 354 | $alias = $objectMgr->getAlias($id); |
@@ -561,7 +597,9 @@ class AmdaAction | @@ -561,7 +597,9 @@ class AmdaAction | ||
561 | } | 597 | } |
562 | 598 | ||
563 | $childrenToReturn[] = array('text' => $name, 'id' => $id, 'nodeType' => $nodeType, 'info' => $info, | 599 | $childrenToReturn[] = array('text' => $name, 'id' => $id, 'nodeType' => $nodeType, 'info' => $info, |
564 | - 'help' => $help, 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'dim_1' => $dim_1, 'dim_2' => $dim_2); | 600 | + 'help' => $help, 'leaf' => $isLeaf, 'isParameter' => $isParameter, 'dim_1' => $dim_1, 'dim_2' => $dim_2, 'tabs' => $plotTabs, |
601 | + 'component_info' => isset($component_info) ? $component_info : NULL, | ||
602 | + 'iconCls' => isset($iconCls) ? $iconCls : NULL ); | ||
565 | } | 603 | } |
566 | } | 604 | } |
567 | // if $childrenToReturn we have to return [] | 605 | // if $childrenToReturn we have to return [] |
@@ -757,6 +795,7 @@ class AmdaAction | @@ -757,6 +795,7 @@ class AmdaAction | ||
757 | break; | 795 | break; |
758 | case 'condition' : | 796 | case 'condition' : |
759 | case 'request' : | 797 | case 'request' : |
798 | + case 'plottab' : | ||
760 | $objectMgr = new RequestMgr($obj->nodeType); | 799 | $objectMgr = new RequestMgr($obj->nodeType); |
761 | break; | 800 | break; |
762 | case 'alias' : | 801 | case 'alias' : |
@@ -846,6 +885,7 @@ class AmdaAction | @@ -846,6 +885,7 @@ class AmdaAction | ||
846 | break; | 885 | break; |
847 | case 'condition' : | 886 | case 'condition' : |
848 | case 'request' : | 887 | case 'request' : |
888 | + case 'plottab' : | ||
849 | $objectMgr = new RequestMgr($obj->nodeType); | 889 | $objectMgr = new RequestMgr($obj->nodeType); |
850 | break; | 890 | break; |
851 | default: | 891 | default: |
@@ -915,7 +955,8 @@ class AmdaAction | @@ -915,7 +955,8 @@ class AmdaAction | ||
915 | } | 955 | } |
916 | 956 | ||
917 | private function executeRequest($obj, $function) | 957 | private function executeRequest($obj, $function) |
918 | - { | 958 | + { |
959 | + | ||
919 | // Check user if access to DD Server and / or possible 'space consuming' action | 960 | // Check user if access to DD Server and / or possible 'space consuming' action |
920 | if ( $function == FunctionTypeEnumClass::PARAMS || | 961 | if ( $function == FunctionTypeEnumClass::PARAMS || |
921 | $function == FunctionTypeEnumClass::ACTION || | 962 | $function == FunctionTypeEnumClass::ACTION || |
php/classes/RequestMgr.php
@@ -30,7 +30,7 @@ class RequestMgr extends AmdaObjectMgr | @@ -30,7 +30,7 @@ class RequestMgr extends AmdaObjectMgr | ||
30 | $this->attributes = array('name' => ''); | 30 | $this->attributes = array('name' => ''); |
31 | $this->optionalAttributes = array(); | 31 | $this->optionalAttributes = array(); |
32 | 32 | ||
33 | - if ($type == 'request') | 33 | + if ($type == 'request' || $type == 'plottab') |
34 | { | 34 | { |
35 | $this->id_prefix = 'req_'; | 35 | $this->id_prefix = 'req_'; |
36 | } | 36 | } |
@@ -70,6 +70,52 @@ class RequestMgr extends AmdaObjectMgr | @@ -70,6 +70,52 @@ class RequestMgr extends AmdaObjectMgr | ||
70 | { | 70 | { |
71 | return false; | 71 | return false; |
72 | } | 72 | } |
73 | + | ||
74 | + public function validNameObject($p) | ||
75 | + { | ||
76 | + if ($this->type == 'plottab') { | ||
77 | + if (empty($p->name)) { | ||
78 | + return array('valid' => false, 'error' => 'Name is required'); | ||
79 | + } | ||
80 | + return array('valid' => true); | ||
81 | + } | ||
82 | + return parent::validNameObject($p); | ||
83 | + } | ||
84 | + | ||
85 | + public function renameObject($p) | ||
86 | + { | ||
87 | + if ($this->type == 'plottab') { | ||
88 | + //Rename a plot tab | ||
89 | + if (!isset($p->parent) || empty($p->parent)) { | ||
90 | + return array('error' => 'Missing parent definition'); | ||
91 | + } | ||
92 | + $plotObj = $this->getObject($p->parent); | ||
93 | + if (is_array($plotObj) && isset($plotObj['error'])) { | ||
94 | + return array('error' => $plotObj['error']); | ||
95 | + } | ||
96 | + if (!isset($plotObj->tabs)) { | ||
97 | + return array('error' => 'Cannot retrieve tab in plot request'); | ||
98 | + } | ||
99 | + $renameOK = FALSE; | ||
100 | + foreach ($plotObj->tabs as &$tab) { | ||
101 | + if ($tab->id == $p->id) { | ||
102 | + $tab->{'tab-name'} = $p->name; | ||
103 | + $renameOK = TRUE; | ||
104 | + break; | ||
105 | + } | ||
106 | + } | ||
107 | + if (!$renameOK) { | ||
108 | + return array('error' => 'Cannot retrieve tab in plot request 2'); | ||
109 | + } | ||
110 | + //Save modification | ||
111 | + $file = fopen(USERREQDIR.$p->parent, 'w'); | ||
112 | + fwrite($file, json_encode($plotObj)); | ||
113 | + fclose($file); | ||
114 | + | ||
115 | + return array('id' => $p->id); | ||
116 | + } | ||
117 | + return parent::renameObject($p); | ||
118 | + } | ||
73 | 119 | ||
74 | /* Stop Time from StartTime and Interval*/ | 120 | /* Stop Time from StartTime and Interval*/ |
75 | public function convertTime($obj) | 121 | public function convertTime($obj) |
@@ -144,7 +190,7 @@ class RequestMgr extends AmdaObjectMgr | @@ -144,7 +190,7 @@ class RequestMgr extends AmdaObjectMgr | ||
144 | * Make new request/condition resource file (JSON!!) and add it to content file | 190 | * Make new request/condition resource file (JSON!!) and add it to content file |
145 | * ATTENTION : it is not DD parameter!!! | 191 | * ATTENTION : it is not DD parameter!!! |
146 | */ | 192 | */ |
147 | - protected function createParameter($p) | 193 | + protected function createParameter($p, $folder) |
148 | { | 194 | { |
149 | if ($this -> objectExistsByName($p->name)) | 195 | if ($this -> objectExistsByName($p->name)) |
150 | { | 196 | { |
@@ -177,6 +223,19 @@ class RequestMgr extends AmdaObjectMgr | @@ -177,6 +223,19 @@ class RequestMgr extends AmdaObjectMgr | ||
177 | } | 223 | } |
178 | } | 224 | } |
179 | } | 225 | } |
226 | + | ||
227 | + $additional = array(); | ||
228 | + if ($this->type == 'request') { | ||
229 | + $additional['tabs'] = array(); | ||
230 | + if (isset($p->tabs)) { | ||
231 | + foreach ($p->tabs as $index => $tab) { | ||
232 | + $additional['tabs'][$index] = array( | ||
233 | + "name" => (!empty($tab->{'tab-name'})) ? $tab->{'tab-name'} : "Plot ".($index+1), | ||
234 | + "id" => $tab->id, | ||
235 | + ); | ||
236 | + } | ||
237 | + } | ||
238 | + } | ||
180 | 239 | ||
181 | $this->descFileName = USERREQDIR.$this->id; | 240 | $this->descFileName = USERREQDIR.$this->id; |
182 | $p->id = $this->id; | 241 | $p->id = $this->id; |
@@ -184,10 +243,10 @@ class RequestMgr extends AmdaObjectMgr | @@ -184,10 +243,10 @@ class RequestMgr extends AmdaObjectMgr | ||
184 | $file = fopen($this->descFileName, 'w'); | 243 | $file = fopen($this->descFileName, 'w'); |
185 | fwrite($file, json_encode($p)); | 244 | fwrite($file, json_encode($p)); |
186 | fclose($file); | 245 | fclose($file); |
187 | - | 246 | + |
188 | $this -> addToContent($p, $folder); | 247 | $this -> addToContent($p, $folder); |
189 | 248 | ||
190 | - return array('id' => $this->id, 'info' => $info); | 249 | + return array('id' => $this->id, 'info' => $info) + $additional; |
191 | } | 250 | } |
192 | 251 | ||
193 | public static function checkRequest($obj) | 252 | public static function checkRequest($obj) |
@@ -225,7 +284,7 @@ class RequestMgr extends AmdaObjectMgr | @@ -225,7 +284,7 @@ class RequestMgr extends AmdaObjectMgr | ||
225 | { | 284 | { |
226 | $argsTab['param'] = array_unique($params); | 285 | $argsTab['param'] = array_unique($params); |
227 | $argsTab['startTime'] = $tab->{'multi-plot-linked'} ? $obj->startDate : $tab->startDate; | 286 | $argsTab['startTime'] = $tab->{'multi-plot-linked'} ? $obj->startDate : $tab->startDate; |
228 | - $argsTab['stopTime'] = $tab->{'multi-plot-linked'} ? $obj->startDate : $tab->stopDate; | 287 | + $argsTab['stopTime'] = $tab->{'multi-plot-linked'} ? $obj->stopDate : $tab->stopDate; |
229 | } | 288 | } |
230 | } | 289 | } |
231 | if (count($argsTab) > 0) $args[] = $argsTab; | 290 | if (count($argsTab) > 0) $args[] = $argsTab; |
@@ -255,8 +314,8 @@ class RequestMgr extends AmdaObjectMgr | @@ -255,8 +314,8 @@ class RequestMgr extends AmdaObjectMgr | ||
255 | { | 314 | { |
256 | // tab is not defined, iterate over $obj->tabs? | 315 | // tab is not defined, iterate over $obj->tabs? |
257 | $argsTab['param'] = array_unique($params); | 316 | $argsTab['param'] = array_unique($params); |
258 | - $argsTab['startTime'] = $tab->{'multi-plot-linked'} ? $obj->startDate : $tab->startDate; | ||
259 | - $argsTab['stopTime'] = $tab->{'multi-plot-linked'} ? $obj->startDate : $tab->stopDate; | 317 | + $argsTab['startTime'] = $obj->startDate; |
318 | + $argsTab['stopTime'] = $obj->stopDate; | ||
260 | } | 319 | } |
261 | if (count($argsTab) > 0) $args[] = $argsTab; | 320 | if (count($argsTab) > 0) $args[] = $argsTab; |
262 | 321 |
php/classes/TimeTableMgr.php
@@ -452,10 +452,11 @@ class TimeTableMgr extends AmdaObjectMgr | @@ -452,10 +452,11 @@ class TimeTableMgr extends AmdaObjectMgr | ||
452 | $attributesToReturn['folderId'] = $folderId; | 452 | $attributesToReturn['folderId'] = $folderId; |
453 | 453 | ||
454 | if (!$onlyDescription) { | 454 | if (!$onlyDescription) { |
455 | - $intNodes = $dom->getElementsByTagName('intervals'); | 455 | + $xpath = new DOMXPath($dom); |
456 | 456 | ||
457 | - /** @var DOMElement $intNode */ | ||
458 | - foreach ($intNodes as $intNode) { | 457 | + $intervals = $xpath->query('//intervals'); |
458 | + | ||
459 | + foreach ($intervals as $intNode) { | ||
459 | $startNodes = $intNode->getElementsByTagName('start'); | 460 | $startNodes = $intNode->getElementsByTagName('start'); |
460 | if ($startNodes->length <= 0) { | 461 | if ($startNodes->length <= 0) { |
461 | return ['error' => 'Error detected in result file']; | 462 | return ['error' => 'Error detected in result file']; |
php/config.php
@@ -63,7 +63,7 @@ define('EPNTAP_APIS', 'http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync') | @@ -63,7 +63,7 @@ define('EPNTAP_APIS', 'http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync') | ||
63 | define('EPNTAP_AMDA', 'http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync'); | 63 | define('EPNTAP_AMDA', 'http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync'); |
64 | 64 | ||
65 | // PHP run-time settings | 65 | // PHP run-time settings |
66 | -ini_set('memory_limit',128000000); | 66 | +ini_set('memory_limit',256000000); |
67 | ini_set('max_execution_time',600); // max PHP execution | 67 | ini_set('max_execution_time',600); // max PHP execution |
68 | 68 | ||
69 | ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES | 69 | ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES |