Commit ba9db22b9f17f9f981b369b09c8fe5fb48fce55e
Exists in
master
and in
72 other branches
Merge branch 'develop' into amdadev
Showing
8 changed files
with
91 additions
and
12 deletions
Show diff stats
js/app/controllers/PlotModule.js
... | ... | @@ -216,7 +216,20 @@ Ext.define('amdaDesktop.PlotModule', { |
216 | 216 | }); |
217 | 217 | } |
218 | 218 | }, |
219 | - | |
219 | + addTT :function(ttName, ttId){ | |
220 | + var me = this; | |
221 | + var desktop = this.app.getDesktop(); | |
222 | + var win = desktop.getWindow(this.id); | |
223 | + if (win) { | |
224 | + me.getUiContent().addTT(ttName, ttId); | |
225 | + win.show(); | |
226 | + } | |
227 | + else { | |
228 | + this.createWindow(function () { | |
229 | + me.getUiContent().addTT(ttName, ttId); | |
230 | + }); | |
231 | + } | |
232 | + }, | |
220 | 233 | editPlot : function(plotNode) { |
221 | 234 | var me = this; |
222 | 235 | var desktop = this.app.getDesktop(); | ... | ... |
js/app/models/CatalogNode.js
... | ... | @@ -36,6 +36,10 @@ Ext.define('amdaModel.CatalogNode', { |
36 | 36 | text : 'Download '+ this.self.objectName, |
37 | 37 | hidden : true |
38 | 38 | },{ |
39 | + fnId : 'leaf-plot', | |
40 | + text : 'Plot '+ this.self.objectName, | |
41 | + hidden : true | |
42 | + },{ | |
39 | 43 | fnId : 'leaf-visu', |
40 | 44 | text : 'Visualize '+ this.self.objectName, |
41 | 45 | hidden : true |
... | ... | @@ -43,6 +47,10 @@ Ext.define('amdaModel.CatalogNode', { |
43 | 47 | fnId : 'leaf-generateTT', |
44 | 48 | text : 'Generate Time Table ', |
45 | 49 | hidden : true |
50 | + },{ | |
51 | + fnId : 'leaf-generateTT', | |
52 | + text : 'Generate Time Table ', | |
53 | + hidden : true | |
46 | 54 | } |
47 | 55 | ]; |
48 | 56 | |
... | ... | @@ -57,6 +65,9 @@ Ext.define('amdaModel.CatalogNode', { |
57 | 65 | },{ |
58 | 66 | fnId : 'mult-downloadMulti', |
59 | 67 | text : 'Download selected '+this.self.objectName+'s' |
68 | + },{ | |
69 | + fnId : 'mult-plotMulti', | |
70 | + text : 'Plot selected '+this.self.objectName+'s' | |
60 | 71 | }]; |
61 | 72 | |
62 | 73 | return menuItems; | ... | ... |
js/app/models/InteractiveNode.js
... | ... | @@ -457,11 +457,14 @@ Ext.define('amdaModel.InteractiveNode', { |
457 | 457 | this.createDownload(this); |
458 | 458 | break; |
459 | 459 | case 'generateCatalog': |
460 | - this.generateCatalog(this); | |
461 | - break; | |
462 | - case 'generateTT': | |
463 | - this.generateTT(this); | |
464 | - break; | |
460 | + this.generateCatalog(this); | |
461 | + break; | |
462 | + case 'generateTT': | |
463 | + this.generateTT(this); | |
464 | + break; | |
465 | + case 'plotTT': | |
466 | + this.ttPlot(this); | |
467 | + break; | |
465 | 468 | default: |
466 | 469 | break; |
467 | 470 | } // switch end |
... | ... | @@ -813,6 +816,13 @@ Ext.define('amdaModel.InteractiveNode', { |
813 | 816 | { |
814 | 817 | timeTabNode.editInModule(); |
815 | 818 | }); |
816 | - } | |
819 | + }, | |
820 | + ttPlot : function(node) { | |
821 | + // download Module | |
822 | + if (node.get('disable')) return; | |
823 | + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) { | |
824 | + module.addTT(node.get('text'), node.get('id')); | |
825 | + }); | |
826 | + }, | |
817 | 827 | |
818 | 828 | }); | ... | ... |
js/app/models/TimeTableNode.js
... | ... | @@ -38,6 +38,10 @@ Ext.define('amdaModel.TimeTableNode', { |
38 | 38 | text : 'Download Time Table', |
39 | 39 | hidden : true |
40 | 40 | },{ |
41 | + fnId : 'leaf-plot', | |
42 | + text : 'Plot Time Table', | |
43 | + hidden : true | |
44 | + },{ | |
41 | 45 | fnId : 'leaf-operations', |
42 | 46 | text : 'Operations', |
43 | 47 | hidden : true |
... | ... | @@ -56,7 +60,10 @@ Ext.define('amdaModel.TimeTableNode', { |
56 | 60 | { |
57 | 61 | fnId : 'mult-downloadMulti', |
58 | 62 | text : 'Download selected '+ this.self.objectName + 's' |
59 | - },{ | |
63 | + }, { | |
64 | + fnId : 'mult-plotMulti', | |
65 | + text : 'Plot selected '+ this.self.objectName + 's' | |
66 | + }, { | |
60 | 67 | fnId : 'mult-operationsMulti', |
61 | 68 | text : 'Operations' |
62 | 69 | }]; |
... | ... | @@ -95,7 +102,9 @@ Ext.define('amdaModel.TimeTableNode', { |
95 | 102 | case 'download': |
96 | 103 | this.ttDownload(); |
97 | 104 | break; |
98 | - | |
105 | + case 'plot': | |
106 | + this.ttPlot(this); | |
107 | + break; | |
99 | 108 | case 'operations': |
100 | 109 | this.ttOperations(); |
101 | 110 | break; |
... | ... | @@ -111,6 +120,10 @@ Ext.define('amdaModel.TimeTableNode', { |
111 | 120 | case 'downloadMulti': |
112 | 121 | this.downloadMulti(); |
113 | 122 | break; |
123 | + | |
124 | + case 'plotMulti': | |
125 | + this.plotMulti(); | |
126 | + break; | |
114 | 127 | |
115 | 128 | case 'operationsMulti': |
116 | 129 | this.operationsMulti(); |
... | ... | @@ -134,6 +147,13 @@ Ext.define('amdaModel.TimeTableNode', { |
134 | 147 | uidownload.addTTdownload(me.get('text'), me.get('id')); |
135 | 148 | }); |
136 | 149 | }, |
150 | + ttPlot : function(node) { | |
151 | + // download Module | |
152 | + if (node.get('disable')) return; | |
153 | + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) { | |
154 | + module.addTT(node.get('text'), node.get('id')); | |
155 | + }); | |
156 | + }, | |
137 | 157 | |
138 | 158 | ttOperations : function() { |
139 | 159 | var me = this; |
... | ... | @@ -155,6 +175,12 @@ Ext.define('amdaModel.TimeTableNode', { |
155 | 175 | item.ttDownload(); |
156 | 176 | }) |
157 | 177 | }, |
178 | + plotMulti: function(){ | |
179 | + var selection = this.myGetOwnerTree().getSelectionModel().selected.items; | |
180 | + Ext.Array.each(selection,function(item,index,allItems){ | |
181 | + item.ttPlot(); | |
182 | + }) | |
183 | + }, | |
158 | 184 | |
159 | 185 | operationsMulti: function(){ |
160 | 186 | var selection = this.myGetOwnerTree().getSelectionModel().selected.items; | ... | ... |
js/app/models/sharedCatalogNode.js
... | ... | @@ -33,6 +33,10 @@ Ext.define('amdaModel.sharedCatalogNode', { |
33 | 33 | text : 'Edit Catalog', |
34 | 34 | hidden : true |
35 | 35 | },{ |
36 | + fnId : 'leaf-plotTT', | |
37 | + text : 'Plot Catalog', | |
38 | + hidden : true | |
39 | + },{ | |
36 | 40 | fnId : 'leaf-generateTT', |
37 | 41 | text : 'Generate Time Table ', |
38 | 42 | hidden : true | ... | ... |
js/app/models/sharedTimeTableNode.js
... | ... | @@ -32,6 +32,10 @@ Ext.define('amdaModel.sharedTimeTableNode', { |
32 | 32 | text : 'Edit Time Table', |
33 | 33 | hidden : true |
34 | 34 | },{ |
35 | + fnId : 'leaf-plotTT', | |
36 | + text : 'Plot Time Table', | |
37 | + hidden : true | |
38 | + },{ | |
35 | 39 | fnId : 'leaf-generateCatalog', |
36 | 40 | text : 'Generate Catalog', |
37 | 41 | hidden : true | ... | ... |
js/app/views/PlotComponents/PlotTabContent.js
... | ... | @@ -41,6 +41,9 @@ Ext.define('amdaPlotComp.PlotTabContent', { |
41 | 41 | this.timeSelector.intervalSel.setInterval(startDate, stopDate); |
42 | 42 | |
43 | 43 | }, |
44 | + getTimeSelector: function(){ | |
45 | + return this.timeSelector; | |
46 | + }, | |
44 | 47 | |
45 | 48 | updateTimeObject : function() { |
46 | 49 | var timeSource = this.timeSelector.getActiveTimeSource(); | ... | ... |
js/app/views/PlotUI.js
... | ... | @@ -121,9 +121,17 @@ Ext.define('amdaUI.PlotUI', { |
121 | 121 | }, |
122 | 122 | |
123 | 123 | addTT : function(newTTName,newTTid,timeSelectorId) { |
124 | - var crtTimeSelector = Ext.getCmp(timeSelectorId); | |
125 | - if (crtTimeSelector) | |
126 | - crtTimeSelector.addTT(newTTName,newTTid); | |
124 | + if(timeSelectorId){ | |
125 | + var crtTimeSelector = Ext.getCmp(timeSelectorId); | |
126 | + if (crtTimeSelector) | |
127 | + crtTimeSelector.addTT(newTTName,newTTid); | |
128 | + }else{ | |
129 | + var plotTab = this.plotTabs.getCurrentPlotTabContent(); | |
130 | + if (plotTab) | |
131 | + var crtTimeSelector = plotTab.getTimeSelector(); | |
132 | + if (crtTimeSelector) | |
133 | + crtTimeSelector.addTT(newTTName,newTTid); | |
134 | + } | |
127 | 135 | }, |
128 | 136 | |
129 | 137 | /** | ... | ... |