Commit 9cb1f3cda4b2d53de25e2bf574821561daf1b96f
1 parent
e72f367a
Exists in
master
and in
111 other branches
Update download interface for the new kernel
Showing
2 changed files
with
42 additions
and
39 deletions
Show diff stats
js/app/models/Download.js
... | ... | @@ -23,18 +23,17 @@ Ext.define('amdaModel.Download', { |
23 | 23 | {name: 'list', defaultValue: null }, // array of parameters |
24 | 24 | {name: 'timeformat', type: 'string'}, |
25 | 25 | {name: 'timeformatTT', type: 'string'}, |
26 | - {name: 'milli', type: 'boolean', defaultValue: false}, | |
27 | 26 | {name: 'structure', type: 'string'}, |
27 | + {name: 'refparamSampling', type: 'boolean', defaultValue: false}, | |
28 | 28 | {name: 'sampling', type: 'int', defaultValue: '600'}, |
29 | 29 | {name: 'output', type: 'string'}, |
30 | - {name: 'header', type: 'string'}, | |
31 | 30 | {name: 'fileformat', type: 'string'}, |
32 | 31 | {name: 'fileformatTT', type: 'string'}, |
33 | 32 | {name: 'compression', type: 'string'}, |
34 | 33 | {name: 'compressionTT', type: 'string'} |
35 | 34 | ], |
36 | 35 | |
37 | - propertiesToCopy : 'id,name,downloadSrc,sampling,list,timeformat,timeformatTT,structure,output,header,fileformat,fileformatTT,compression,compressionTT', | |
36 | + propertiesToCopy : 'id,name,downloadSrc,refparamSampling,sampling,list,timeformat,timeformatTT,structure,output,fileformat,fileformatTT,compression,compressionTT', | |
38 | 37 | |
39 | 38 | getJsonValues : function(){ |
40 | 39 | |
... | ... | @@ -45,9 +44,9 @@ Ext.define('amdaModel.Download', { |
45 | 44 | //Data download |
46 | 45 | if (myValues.downloadSrc === '0') { // Data download |
47 | 46 | myValues.structure = this.get('structure'); |
47 | + myValues.refparamSampling = this.get('refparamSampling'); | |
48 | 48 | myValues.sampling = this.get('sampling'); |
49 | 49 | myValues.output = this.get('output'); |
50 | - myValues.header = this.get('header'); | |
51 | 50 | |
52 | 51 | myValues.timesrc = this.get('timesrc'); |
53 | 52 | // if there's at least one timeTable in case of Download data |
... | ... | @@ -84,8 +83,6 @@ Ext.define('amdaModel.Download', { |
84 | 83 | Ext.each(list, function(item, index){ |
85 | 84 | myValues.list[index]=item.get('name'); |
86 | 85 | }); |
87 | - // milli is used only for download | |
88 | - myValues.milli = this.get('milli'); | |
89 | 86 | } |
90 | 87 | myValues.fileformat = this.get('fileformat'); |
91 | 88 | myValues.timeformat = this.get('timeformat'); |
... | ... | @@ -122,4 +119,4 @@ Ext.define('amdaModel.Download', { |
122 | 119 | return myValues; |
123 | 120 | } |
124 | 121 | |
125 | -}); | |
126 | 122 | \ No newline at end of file |
123 | +}); | ... | ... |
js/app/views/DownloadUI.js
... | ... | @@ -18,12 +18,14 @@ Ext.define('amdaUI.DownloadUI', { |
18 | 18 | 'amdaUI.SearchParamEditorPlugin' |
19 | 19 | ], |
20 | 20 | |
21 | - timeformatData : [['Y-m-dTH:i:s', 'YYYY-MM-DDThh:mm:ss'], ['Y m d H i s', 'YYYY MM DD hh mm ss'], ['d m Y H i s', 'DD MM YYYY hh mm ss'], ['Y z H i s', 'YYYY DDD hh mm ss']], | |
22 | - fileformatData : [['ASCII', 'ASCII'],['vot', 'VOTable']], | |
21 | + //Old kernel time formats | |
22 | + //timeformatData : [['Y-m-dTH:i:s', 'YYYY-MM-DDThh:mm:ss'], ['Y m d H i s', 'YYYY MM DD hh mm ss'], ['d m Y H i s', 'DD MM YYYY hh mm ss'], ['Y z H i s', 'YYYY DDD hh mm ss']], | |
23 | + //New kernel time formats | |
24 | + timeformatData : [['Y-m-dTH:i:s', 'YYYY-MM-DDThh:mm:ss'], ['DD Time', 'DD Time'], ['Timestamp', 'Timestamp']], | |
25 | + fileformatData : [['ASCII', 'ASCII'],['vot', 'VOTable'],['cdf', 'CDF'],['json', 'JSON']], | |
23 | 26 | fileformatTTData : [['text', 'plain text'], ['vot','VOTable']], |
24 | 27 | filecompressData : [['zip', 'zip'], ['tar+gzip', 'tar+gzip']], |
25 | 28 | filestructureData : [['0','All In One File'], ['1','One File Per Time Interval'], ['2','One File Per Param/Interval']], |
26 | - fileheaderData : [['0','Write Into Data File'], ['1','Create Separate File']], | |
27 | 29 | |
28 | 30 | constructor: function(config) { |
29 | 31 | this.init(config); |
... | ... | @@ -146,8 +148,8 @@ Ext.define('amdaUI.DownloadUI', { |
146 | 148 | var timeSource = values.timesrc_downloadTimeSelector; |
147 | 149 | var structure = values.filestructure; |
148 | 150 | var sampling = values.sampling ? values.sampling : 600; |
151 | + var refparamSampling = values.refparamsampling == 'on'; | |
149 | 152 | var output = values.output ? values.output : ''; |
150 | - var header = values.header; | |
151 | 153 | var fileformat = values.fileformat; |
152 | 154 | var compression = values.compression; |
153 | 155 | |
... | ... | @@ -185,9 +187,9 @@ Ext.define('amdaUI.DownloadUI', { |
185 | 187 | // set parameters |
186 | 188 | this.object.set('list',this.paramGrid.getStore().data.items); |
187 | 189 | this.object.set('structure', structure); |
190 | + this.object.set('refparamSampling', refparamSampling); | |
188 | 191 | this.object.set('sampling', sampling); |
189 | 192 | this.object.set('output',output); |
190 | - this.object.set('header', header); | |
191 | 193 | this.object.set('timeformat',timeformat); |
192 | 194 | this.object.set('fileformat',fileformat); |
193 | 195 | this.object.set('compression',compression); |
... | ... | @@ -233,9 +235,6 @@ Ext.define('amdaUI.DownloadUI', { |
233 | 235 | if (!this.object.get('compressionTT')) |
234 | 236 | this.object.set('compressionTT', this.filecompressData[1][0]); |
235 | 237 | |
236 | - if (!this.object.get('header')) | |
237 | - this.object.set('header', this.fileheaderData[0][0]); | |
238 | - | |
239 | 238 | // load object into form |
240 | 239 | this.formPanel.getForm().loadRecord(this.object); |
241 | 240 | // set object's TTs into the timeselector |
... | ... | @@ -261,21 +260,29 @@ Ext.define('amdaUI.DownloadUI', { |
261 | 260 | grid.getStore().remove(record); |
262 | 261 | }, |
263 | 262 | |
264 | - disableField : function(combo, newValue, oldValue){ | |
265 | - var tt = combo.next(); | |
263 | + onFileStructureChange : function(combo, newValue, oldValue){ | |
264 | + if (!this.formPanel) | |
265 | + return; | |
266 | + | |
267 | + var refParamCheck = this.formPanel.getForm().findField('refparamsampling'); | |
268 | + var samplingField = this.formPanel.getForm().findField('sampling'); | |
266 | 269 | |
267 | - if (tt && newValue !== oldValue) { | |
268 | - var ff = tt.next(); | |
269 | - if (newValue == 2) { | |
270 | - tt.setDisabled(true); | |
271 | - // ff.setDisabled(true); | |
272 | - } | |
273 | - else { | |
274 | - tt.setDisabled(false); | |
275 | - // ff.setDisabled(false); | |
276 | - } | |
270 | + if (samplingField && newValue !== oldValue) { | |
271 | + refParamCheck.setDisabled(newValue == 2); | |
272 | + samplingField.setDisabled((newValue == 2) || refParamCheck.getValue()); | |
277 | 273 | } |
278 | 274 | }, |
275 | + | |
276 | + onRefParamSamplingChange : function(check, newValue, oldValue){ | |
277 | + if (!this.formPanel) | |
278 | + return; | |
279 | + | |
280 | + var samplingField = this.formPanel.getForm().findField('sampling'); | |
281 | + var structureCombo = this.formPanel.getForm().findField('filestructure'); | |
282 | + | |
283 | + if (samplingField && newValue !== oldValue) | |
284 | + samplingField.setDisabled((structureCombo.getValue() == 2) || check.getValue()); | |
285 | + }, | |
279 | 286 | |
280 | 287 | /** |
281 | 288 | * Check if changes were made before closing window |
... | ... | @@ -479,19 +486,24 @@ Ext.define('amdaUI.DownloadUI', { |
479 | 486 | store: this.timeformatData, |
480 | 487 | value: this.timeformatData[0] |
481 | 488 | }, |
482 | - { xtype : 'checkbox', boxLabel: 'Show Milliseconds', | |
483 | - boxLabelAlign: 'before', | |
484 | - name: 'milli', checked: false//, | |
485 | - // margin : '0 0 5 150' //(top, right, bottom, left). | |
486 | - }, | |
487 | 489 | { |
488 | 490 | fieldLabel: 'File Structure', |
489 | 491 | name: 'filestructure', |
490 | 492 | store: this.filestructureData, |
491 | 493 | value: this.filestructureData[2], |
492 | 494 | listeners : { |
493 | - change : { fn : this.disableField } | |
495 | + change : { fn : this.onFileStructureChange }, | |
496 | + scope: this | |
494 | 497 | } |
498 | + }, | |
499 | + { | |
500 | + xtype: 'checkbox', boxLabel: 'Use first param. as reference for sampling', | |
501 | + boxLabelAlign: 'before', | |
502 | + name: 'refparamsampling', checked: false, disabled: true, | |
503 | + listeners : { | |
504 | + change : { fn : this.onRefParamSamplingChange }, | |
505 | + scope : this | |
506 | + } | |
495 | 507 | }, |
496 | 508 | { |
497 | 509 | xtype: 'numberfield', name: 'sampling', |
... | ... | @@ -504,12 +516,6 @@ Ext.define('amdaUI.DownloadUI', { |
504 | 516 | fieldLabel: 'File Name', |
505 | 517 | disabled: true, editable: true |
506 | 518 | }, |
507 | - { | |
508 | - fieldLabel:'Header', | |
509 | - name: 'header', | |
510 | - store: this.fileheaderData, | |
511 | - value: this.fileheaderData[0] | |
512 | - }, | |
513 | 519 | { |
514 | 520 | fieldLabel: 'File Format', |
515 | 521 | name: 'fileformat', | ... | ... |