Commit 8dddc557a7a5891ea68e8b2065376b82337917e8
1 parent
2048f5bc
Exists in
master
and in
96 other branches
Fix plot reload
Showing
5 changed files
with
25 additions
and
3 deletions
Show diff stats
js/app/models/InteractiveNode.js
@@ -210,7 +210,12 @@ Ext.define('amdaModel.InteractiveNode', { | @@ -210,7 +210,12 @@ Ext.define('amdaModel.InteractiveNode', { | ||
210 | // reload object into the view of corresponding Module | 210 | // reload object into the view of corresponding Module |
211 | var me = this; | 211 | var me = this; |
212 | myDesktopApp.getLoadedModule(this.get('moduleId'), true, function (module) { | 212 | myDesktopApp.getLoadedModule(this.get('moduleId'), true, function (module) { |
213 | - module.getUiContent().setObject(me.get('object')); | 213 | + if (!opt || !opt.plot) { |
214 | + module.getUiContent().setObject(me.get('object')); | ||
215 | + } | ||
216 | + else { | ||
217 | + module.getUiContent().reloadPlot(me); | ||
218 | + } | ||
214 | }); | 219 | }); |
215 | } | 220 | } |
216 | else { | 221 | else { |
js/app/models/PlotObjects/PlotRequestObject.js
@@ -237,6 +237,7 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | @@ -237,6 +237,7 @@ Ext.define('amdaPlotObj.PlotRequestObject', { | ||
237 | requestValues['id'] = this.get('id'); | 237 | requestValues['id'] = this.get('id'); |
238 | requestValues['tab-index'] = this.get('tab-index'); | 238 | requestValues['tab-index'] = this.get('tab-index'); |
239 | requestValues['tab-title'] = this.get('tab-title'); | 239 | requestValues['tab-title'] = this.get('tab-title'); |
240 | + requestValues['name'] = this.get('name'); | ||
240 | 241 | ||
241 | requestValues['file-format'] = this.get('file-format'); | 242 | requestValues['file-format'] = this.get('file-format'); |
242 | requestValues['file-output'] = this.get('file-output'); | 243 | requestValues['file-output'] = this.get('file-output'); |
js/app/views/PlotComponents/PlotTabContent.js
@@ -58,13 +58,14 @@ Ext.define('amdaPlotComp.PlotTabContent', { | @@ -58,13 +58,14 @@ Ext.define('amdaPlotComp.PlotTabContent', { | ||
58 | }, | 58 | }, |
59 | 59 | ||
60 | savePlot : function() { | 60 | savePlot : function() { |
61 | + this.updateTimeObject(); | ||
61 | var object = this.plotNode.get('object'); | 62 | var object = this.plotNode.get('object'); |
62 | if (!object) | 63 | if (!object) |
63 | return; | 64 | return; |
64 | 65 | ||
65 | if ((object.get('id') != '') && (this.plotNode.get('text') == object.get('name'))) { | 66 | if ((object.get('id') != '') && (this.plotNode.get('text') == object.get('name'))) { |
66 | //update existing request | 67 | //update existing request |
67 | - this.plotNode.update(); | 68 | + this.plotNode.update({plot: true}); |
68 | return; | 69 | return; |
69 | } | 70 | } |
70 | 71 | ||
@@ -105,7 +106,7 @@ Ext.define('amdaPlotComp.PlotTabContent', { | @@ -105,7 +106,7 @@ Ext.define('amdaPlotComp.PlotTabContent', { | ||
105 | 106 | ||
106 | saveProcess : function(toRename) { | 107 | saveProcess : function(toRename) { |
107 | if (toRename) { | 108 | if (toRename) { |
108 | - this.plotNode.update(); | 109 | + this.plotNode.update({plot: true}); |
109 | } | 110 | } |
110 | else { | 111 | else { |
111 | if (this.plotNode.get('object').get('id') != '') { | 112 | if (this.plotNode.get('object').get('id') != '') { |
js/app/views/PlotComponents/PlotTabPanel.js
@@ -35,6 +35,17 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | @@ -35,6 +35,17 @@ Ext.define('amdaPlotComp.PlotTabPanel', { | ||
35 | this.addPlotNode(rec, index == 0); | 35 | this.addPlotNode(rec, index == 0); |
36 | }, this); | 36 | }, this); |
37 | }, | 37 | }, |
38 | + | ||
39 | + reloadPlot : function(plotNode) { | ||
40 | + for (i = 0; i < this.items.getCount(); ++i) | ||
41 | + { | ||
42 | + var tabItem = this.items.getAt(i); | ||
43 | + var tabContent = tabItem.items.getAt(0); | ||
44 | + if (plotNode == tabContent.plotNode) { | ||
45 | + tabContent.updateUI(); | ||
46 | + } | ||
47 | + } | ||
48 | + }, | ||
38 | 49 | ||
39 | addPlotNode: function(plotNode, selectTab) | 50 | addPlotNode: function(plotNode, selectTab) |
40 | { | 51 | { |
js/app/views/PlotUI.js
@@ -73,6 +73,10 @@ Ext.define('amdaUI.PlotUI', { | @@ -73,6 +73,10 @@ Ext.define('amdaUI.PlotUI', { | ||
73 | editPlot : function(plotNode) { | 73 | editPlot : function(plotNode) { |
74 | this.plotTabs.addPlotNode(plotNode, true); | 74 | this.plotTabs.addPlotNode(plotNode, true); |
75 | }, | 75 | }, |
76 | + | ||
77 | + reloadPlot : function(plotNode) { | ||
78 | + this.plotTabs.reloadPlot(plotNode); | ||
79 | + }, | ||
76 | 80 | ||
77 | /** | 81 | /** |
78 | * plot method called by 'Do Plot' button to launch the plot process | 82 | * plot method called by 'Do Plot' button to launch the plot process |