Commit 1b2281a1b3636520f4d26dee00b10b72e5684802

Authored by Hacene SI HADJ MOHAND
1 parent dfa8db4f

ok for tt

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/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/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 /**
... ...