Commit 098d15a9c2157e82f1e3f180d6b8a470c939d899

Authored by Benjamin Renard
1 parent fca728d7

Give the possibility to put header in a separate file (#6497)

Showing 2 changed files with 10 additions and 3 deletions   Show diff stats
js/app/models/Download.js
@@ -20,6 +20,7 @@ Ext.define('amdaModel.Download', { @@ -20,6 +20,7 @@ Ext.define('amdaModel.Download', {
20 {name: 'timeformatTT', type: 'string'}, 20 {name: 'timeformatTT', type: 'string'},
21 {name: 'structure', type: 'string'}, 21 {name: 'structure', type: 'string'},
22 {name: 'refparamSampling', type: 'boolean', defaultValue: false}, 22 {name: 'refparamSampling', type: 'boolean', defaultValue: false},
  23 + {name: 'separateInfoFile', type: 'boolean', defaultValue: false},
23 {name: 'sampling', type: 'int', defaultValue: '600'}, 24 {name: 'sampling', type: 'int', defaultValue: '600'},
24 {name: 'fileprefix', type: 'string'}, 25 {name: 'fileprefix', type: 'string'},
25 {name: 'fileformat', type: 'string'}, 26 {name: 'fileformat', type: 'string'},
@@ -28,7 +29,7 @@ Ext.define('amdaModel.Download', { @@ -28,7 +29,7 @@ Ext.define('amdaModel.Download', {
28 {name: 'compressionTT', type: 'string'} 29 {name: 'compressionTT', type: 'string'}
29 ], 30 ],
30 31
31 - propertiesToCopy : 'id,name,downloadSrc,refparamSampling,sampling,list,timeformat,timeformatTT,structure,fileprefix,fileformat,fileformatTT,compression,compressionTT', 32 + propertiesToCopy : 'id,name,downloadSrc,refparamSampling,separateInfoFile,sampling,list,timeformat,timeformatTT,structure,fileprefix,fileformat,fileformatTT,compression,compressionTT',
32 33
33 getJsonValues : function(){ 34 getJsonValues : function(){
34 35
@@ -40,6 +41,7 @@ Ext.define('amdaModel.Download', { @@ -40,6 +41,7 @@ Ext.define('amdaModel.Download', {
40 if (myValues.downloadSrc === '0') { // Data download 41 if (myValues.downloadSrc === '0') { // Data download
41 myValues.structure = this.get('structure'); 42 myValues.structure = this.get('structure');
42 myValues.refparamSampling = this.get('refparamSampling'); 43 myValues.refparamSampling = this.get('refparamSampling');
  44 + myValues.separateInfoFile = this.get('separateInfoFile');
43 myValues.sampling = this.get('sampling'); 45 myValues.sampling = this.get('sampling');
44 myValues.fileprefix = this.get('fileprefix'); 46 myValues.fileprefix = this.get('fileprefix');
45 47
@@ -47,8 +49,7 @@ Ext.define('amdaModel.Download', { @@ -47,8 +49,7 @@ Ext.define('amdaModel.Download', {
47 // if there's at least one timeTable in case of Download data 49 // if there's at least one timeTable in case of Download data
48 if (this.get('timesrc') == amdaModel.AmdaTimeObject.inputTimeSrc[0] && this.get('timeTables') && this.get('timeTables').length){ 50 if (this.get('timesrc') == amdaModel.AmdaTimeObject.inputTimeSrc[0] && this.get('timeTables') && this.get('timeTables').length){
49 // get complete timeTables collection 51 // get complete timeTables collection
50 - var timeTables = this.get('timeTables');  
51 - // init an empty array for timeTables 52 + var timeTables = this.get('timeTables'); // init an empty array for timeTables
52 myValues.timeTables=[]; 53 myValues.timeTables=[];
53 // for each interval record 54 // for each interval record
54 Ext.Array.each(timeTables, function(item, index, all){ 55 Ext.Array.each(timeTables, function(item, index, all){
js/app/views/DownloadUI.js
@@ -613,6 +613,12 @@ Ext.define('amdaUI.DownloadUI', { @@ -613,6 +613,12 @@ Ext.define('amdaUI.DownloadUI', {
613 scope: this 613 scope: this
614 } 614 }
615 }, 615 },
  616 + {
  617 + xtype: 'checkbox', boxLabel: 'Header in a separate file',
  618 + boxLabelAlign: 'before',
  619 + name: 'separateInfoFile', checked: false
  620 +
  621 + },
616 { 622 {
617 xtype: 'checkbox', boxLabel: 'Use first param. as reference for sampling', 623 xtype: 'checkbox', boxLabel: 'Use first param. as reference for sampling',
618 boxLabelAlign: 'before', 624 boxLabelAlign: 'before',