Commit 13ad8aca49b9f4d63a2be4437135db739fd84b90
1 parent
b9249413
Exists in
master
and in
109 other branches
2 options : all in one or for active tab
Showing
2 changed files
with
45 additions
and
21 deletions
Show diff stats
js/app/models/PlotObjects/PlotRequestObject.js
... | ... | @@ -30,7 +30,8 @@ Ext.define('amdaPlotObj.PlotRequestObject', { |
30 | 30 | {name: 'one-file-per-interval', type: 'boolean'}, |
31 | 31 | {name: 'last-plotted-tab', type: 'int', defaultValue: 0}, |
32 | 32 | {name: 'last-tab-id', type: 'int', defaultValue: 0}, |
33 | - {name: 'active-tab-id', type: 'int', defaultValue: 1} | |
33 | + {name: 'active-tab-id', type: 'int', defaultValue: 1}, | |
34 | + {name: 'all-in-one', type: 'boolean', defaultValue: false} | |
34 | 35 | ], |
35 | 36 | |
36 | 37 | hasMany: { |
... | ... | @@ -122,10 +123,9 @@ Ext.define('amdaPlotObj.PlotRequestObject', { |
122 | 123 | requestValues['file-prefix'] = this.get('file-prefix'); |
123 | 124 | requestValues['one-file-per-interval'] = this.get('one-file-per-interval'); |
124 | 125 | requestValues['last-plotted-tab'] = this.get('last-plotted-tab'); |
125 | - requestValues['name'] = this.get('name'); | |
126 | - requestValues['active-tab-id'] = this.get('active-tab-id'); | |
126 | + requestValues['name'] = this.get('name'); | |
127 | + requestValues['timesrc'] = this.get('timesrc'); | |
127 | 128 | |
128 | - requestValues['timesrc'] = this.get('timesrc'); | |
129 | 129 | // if there's at least one timeTable name into 'timeTables' collection |
130 | 130 | if (this.get('timesrc') == amdaModel.AmdaTimeObject.inputTimeSrc[0] && this.get('timeTables') && this.get('timeTables').length){ |
131 | 131 | // get complete timeTables collection |
... | ... | @@ -143,22 +143,34 @@ Ext.define('amdaPlotObj.PlotRequestObject', { |
143 | 143 | } |
144 | 144 | }); |
145 | 145 | } else { |
146 | - requestValues['startDate'] = this.get('startDate'); | |
147 | - requestValues['stopDate'] = this.get('stopDate'); | |
148 | - requestValues['durationDay'] = this.get('durationDay'); | |
149 | - requestValues['durationHour'] = this.get('durationHour'); | |
150 | - requestValues['durationMin'] = this.get('durationMin'); | |
151 | - requestValues['durationSec'] = this.get('durationSec'); | |
152 | - } | |
153 | - | |
154 | - requestValues['tabs'] = []; | |
146 | + requestValues['startDate'] = this.get('startDate'); | |
147 | + requestValues['stopDate'] = this.get('stopDate'); | |
148 | + requestValues['durationDay'] = this.get('durationDay'); | |
149 | + requestValues['durationHour'] = this.get('durationHour'); | |
150 | + requestValues['durationMin'] = this.get('durationMin'); | |
151 | + requestValues['durationSec'] = this.get('durationSec'); | |
152 | + } | |
155 | 153 | |
156 | - this.tabs().each(function (tab, index) { | |
157 | - requestValues['tabs'][index] = tab.getJsonValues(); | |
158 | - }); | |
159 | - | |
160 | - requestValues['last-tab-id'] = this.get('last-tab-id'); | |
161 | - | |
154 | + requestValues['tabs'] = []; | |
155 | + | |
156 | + if (this.get('all-in-one')) { | |
157 | + this.tabs().each(function (tab, index) { | |
158 | + requestValues['tabs'][index] = tab.getJsonValues(); | |
159 | + }); | |
160 | + | |
161 | + requestValues['active-tab-id'] = this.get('active-tab-id'); | |
162 | + requestValues['last-tab-id'] = this.get('last-tab-id'); | |
163 | + } | |
164 | + else { | |
165 | + var tab = this.tabs().getAt(this.get('active-tab-id')-1); | |
166 | + requestValues['tabs'][0] = tab.getJsonValues(); | |
167 | + | |
168 | + requestValues['tabs'][0]['id'] = "1"; | |
169 | + requestValues['active-tab-id'] = "1"; | |
170 | + requestValues['last-tab-id'] = "1"; | |
171 | + requestValues['last-plotted-tab'] = "0"; | |
172 | + } | |
173 | + | |
162 | 174 | return requestValues; |
163 | 175 | } |
164 | 176 | }); |
165 | 177 | \ No newline at end of file |
... | ... |
js/app/views/PlotUI.js
... | ... | @@ -32,6 +32,8 @@ Ext.define('amdaUI.PlotUI', { |
32 | 32 | |
33 | 33 | plotElement : null, |
34 | 34 | |
35 | + allPlots : false, | |
36 | + | |
35 | 37 | constructor: function(config) { |
36 | 38 | this.init(config); |
37 | 39 | this.callParent(arguments); |
... | ... | @@ -55,7 +57,8 @@ Ext.define('amdaUI.PlotUI', { |
55 | 57 | this.updateObject(); |
56 | 58 | |
57 | 59 | this.object.set('active-tab-id', this.plotTabs.getSelectedTabId()); |
58 | - | |
60 | + this.object.set('all-in-one', this.allPlots); | |
61 | + | |
59 | 62 | if ((this.object.get('id') != '') && (plotModule.linkedNode.get('text') == this.object.get('name'))) |
60 | 63 | //update existing request |
61 | 64 | plotModule.linkedNode.update(); |
... | ... | @@ -286,7 +289,16 @@ Ext.define('amdaUI.PlotUI', { |
286 | 289 | handler: function(button) { |
287 | 290 | this.saveProcess(); |
288 | 291 | } |
289 | - } | |
292 | + },' ', { | |
293 | + xtype: 'checkbox', | |
294 | + boxLabel: 'All Plot Tabs', | |
295 | + listeners : { | |
296 | + scope: this, | |
297 | + change: function (cb, nv, ov) { | |
298 | + this.allPlots = nv; | |
299 | + } | |
300 | + } | |
301 | + } | |
290 | 302 | ] |
291 | 303 | }); |
292 | 304 | |
... | ... |