From 06b20411cf9d358a79f9613195032d31f11ea7b1 Mon Sep 17 00:00:00 2001 From: Hacene SI HADJ MOHAND <hacene.si-hadj-mohand@akka.eu> Date: Wed, 3 Nov 2021 09:22:42 +0100 Subject: [PATCH] I have changed the DD Time to DOY TIME --- help/ncTimeFormat | 2 +- js/app/models/Download.js | 408 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 files changed, 203 insertions(+), 207 deletions(-) diff --git a/help/ncTimeFormat b/help/ncTimeFormat index 9a22b62..f1583f5 100644 --- a/help/ncTimeFormat +++ b/help/ncTimeFormat @@ -8,7 +8,7 @@ netCDF3<br/> <ul> <li> double (seconds from 01/01/1970) <li> string ISO (YYYY-MM-DDTHH:MM:SS.MSK) - <li> string DD Time (YYYYDOYHHMMSSMSK, where DOY = Day-Of-Year -1) + <li> string DOY TIME (YYYYDOYHHMMSSMSK, where DOY = Day-Of-Year) </ul> diff --git a/js/app/models/Download.js b/js/app/models/Download.js index c434f87..51a7fff 100644 --- a/js/app/models/Download.js +++ b/js/app/models/Download.js @@ -10,212 +10,208 @@ Ext.define('amdaModel.DownloadConfig', { - singleton: true, - - defaultValues : { - timeformat: 'YYYY-MM-DDThh:mm:ss', - timeformatTT: 'YYYY-MM-DDThh:mm:ss', - fileformat: 'ASCII', - fileformatTT: 'text', - filecompress: 'tar+gzip', - filecompressTT: 'tar+gzip', - filestructure: '2' - }, - - timeformatData: [ - ['YYYY-MM-DDThh:mm:ss', 'YYYY-MM-DDThh:mm:ss.ms', 'ISO format with msecs'], - ['DD Time', 'YYYYDOYhhmmssms', 'Day-Of-Year, 1 Jan : DOY = 0'], - ['Timestamp', 'Seconds from 1970', 'Total of seconds from the Unix Epoch on January 1st, 1970 at UTC.'], - ['YYYY MM DD hh mm ss', 'YYYY MM DD hh mm ss ms', 'date with spaces'], - ['Timestamp-with-milliseconds', 'Seconds from 1970 with ms', 'Total of seconds from the Unix Epoch with milliseconds.'] - ], - fileformatData: [ - ['ASCII', 'ASCII'], - ['vot', 'VOTable'], - ['cdf', 'CDF'], - ['json', 'JSON'] - ], - fileformatTTData: [ - ['text', 'plain text'], - ['vot', 'VOTable'], - ['space', 'HPEvent'] - ], - filecompressData: [ - ['zip', 'zip'], - ['tar+gzip', 'tar+gzip'] - ], - filecompressTTData: [ - ['zip', 'zip'], - ['tar+gzip', 'tar+gzip'], - ['none', 'none'] - ], - filestructureData: [ - ['0', 'All In One File'], - ['1', 'One File Per Time Interval'], - ['2', 'One File Per Param/Interval'] - ] + singleton: true, + + defaultValues: { + timeformat: 'YYYY-MM-DDThh:mm:ss', + timeformatTT: 'YYYY-MM-DDThh:mm:ss', + fileformat: 'ASCII', + fileformatTT: 'text', + filecompress: 'tar+gzip', + filecompressTT: 'tar+gzip', + filestructure: '2' + }, + + timeformatData: [ + ['YYYY-MM-DDThh:mm:ss', 'YYYY-MM-DDThh:mm:ss.ms', 'ISO format with msecs'], + ['DOY TIME', 'YYYYDOYhhmmssms', 'Day-Of-Year, 1 Jan : DOY = 1'], + ['Timestamp', 'Seconds from 1970', 'Total of seconds from the Unix Epoch on January 1st, 1970 at UTC.'], + ['YYYY MM DD hh mm ss', 'YYYY MM DD hh mm ss ms', 'date with spaces'], + ['Timestamp-with-milliseconds', 'Seconds from 1970 with ms', 'Total of seconds from the Unix Epoch with milliseconds.'] + ], + fileformatData: [ + ['ASCII', 'ASCII'], + ['vot', 'VOTable'], + ['cdf', 'CDF'], + ['json', 'JSON'] + ], + fileformatTTData: [ + ['text', 'plain text'], + ['vot', 'VOTable'], + ['space', 'HPEvent'] + ], + filecompressData: [ + ['zip', 'zip'], + ['tar+gzip', 'tar+gzip'] + ], + filecompressTTData: [ + ['zip', 'zip'], + ['tar+gzip', 'tar+gzip'], + ['none', 'none'] + ], + filestructureData: [ + ['0', 'All In One File'], + ['1', 'One File Per Time Interval'], + ['2', 'One File Per Param/Interval'] + ] }); - + Ext.define('amdaModel.Download', { - extend: 'amdaModel.AmdaTimeObject', - - requires: [ - "amdaModel.DownloadParam" - ], - - fields : [ - {name: 'type', type: 'string', defaultValue: 'Download'}, - {name: 'downloadSrc', type: 'string'}, - {name: 'timeformat', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.timeformat}, - {name: 'timeformatTT', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.timeformatTT}, - {name: 'filestructure', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.filestructure}, - {name: 'refparamSampling', type: 'boolean', defaultValue: false}, - {name: 'separateInfoFile', type: 'boolean', defaultValue: false}, - {name: 'sampling', type: 'float', defaultValue: '600'}, - {name: 'scientificformat', type: 'boolean', defaultValue: true}, - {name: 'fileprefix', type: 'string'}, - {name: 'fileformat', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.fileformat}, - {name: 'fileformatTT', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.fileformatTT}, - {name: 'compression', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.filecompress}, - {name: 'compressionTT', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.filecompressTT}, - {name: 'last_update', type: 'int', defaultValue: 0} - ], - - associations : [ - { - type : 'hasMany', - model : 'amdaModel.DownloadParam', - name : 'params' - } - ], - - propertiesToCopy : 'id,name,downloadSrc,refparamSampling,separateInfoFile,sampling,scientificformat,list,timeformat,timeformatTT,filestructure,fileprefix,fileformat,fileformatTT,compression,compressionTT', - - constructor: function(){ - var me = this; - me.callParent(arguments); - if ((arguments.length > 0) && arguments[0]) - { - if (arguments[0].list) - me.loadParams(arguments[0].list); - } - this.dirty = false; - }, - - loadParams: function(params) - { - /* Compatability mode */ - Ext.each(params, function(param, index) { - if (param.hasOwnProperty('is-init')) { - return; - } - params[index]['dim1-sum-type'] = param['dim1-is-range'] ? 1 : 0; - params[index]['dim1-min-value'] = param['dim1-min-range']; - params[index]['dim1-max-value'] = param['dim1-max-range']; - params[index]['dim2-sum-type'] = param['dim2-is-range'] ? 1 : 0; - params[index]['dim2-min-value'] = param['dim2-min-range']; - params[index]['dim2-max-value'] = param['dim2-max-range']; - params[index]['is-init'] = true; - }); - this.params().loadData(params); - }, - - isDirty : function() { - if (this.dirty) - return true; - - var d = false; - - this.params().each(function (param, index) { - if (param.dirty) - d = true; + extend: 'amdaModel.AmdaTimeObject', + + requires: [ + "amdaModel.DownloadParam" + ], + + fields: [ + { name: 'type', type: 'string', defaultValue: 'Download' }, + { name: 'downloadSrc', type: 'string' }, + { name: 'timeformat', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.timeformat }, + { name: 'timeformatTT', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.timeformatTT }, + { name: 'filestructure', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.filestructure }, + { name: 'refparamSampling', type: 'boolean', defaultValue: false }, + { name: 'separateInfoFile', type: 'boolean', defaultValue: false }, + { name: 'sampling', type: 'float', defaultValue: '600' }, + { name: 'scientificformat', type: 'boolean', defaultValue: true }, + { name: 'fileprefix', type: 'string' }, + { name: 'fileformat', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.fileformat }, + { name: 'fileformatTT', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.fileformatTT }, + { name: 'compression', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.filecompress }, + { name: 'compressionTT', type: 'string', defaultValue: amdaModel.DownloadConfig.defaultValues.filecompressTT }, + { name: 'last_update', type: 'int', defaultValue: 0 } + ], + + associations: [{ + type: 'hasMany', + model: 'amdaModel.DownloadParam', + name: 'params' + }], + + propertiesToCopy: 'id,name,downloadSrc,refparamSampling,separateInfoFile,sampling,scientificformat,list,timeformat,timeformatTT,filestructure,fileprefix,fileformat,fileformatTT,compression,compressionTT', + + constructor: function() { + var me = this; + me.callParent(arguments); + if ((arguments.length > 0) && arguments[0]) { + if (arguments[0].list) + me.loadParams(arguments[0].list); + } + this.dirty = false; + }, + + loadParams: function(params) { + /* Compatability mode */ + Ext.each(params, function(param, index) { + if (param.hasOwnProperty('is-init')) { + return; + } + params[index]['dim1-sum-type'] = param['dim1-is-range'] ? 1 : 0; + params[index]['dim1-min-value'] = param['dim1-min-range']; + params[index]['dim1-max-value'] = param['dim1-max-range']; + params[index]['dim2-sum-type'] = param['dim2-is-range'] ? 1 : 0; + params[index]['dim2-min-value'] = param['dim2-min-range']; + params[index]['dim2-max-value'] = param['dim2-max-range']; + params[index]['is-init'] = true; + }); + this.params().loadData(params); + }, + + isDirty: function() { + if (this.dirty) + return true; + + var d = false; + + this.params().each(function(param, index) { + if (param.dirty) + d = true; + }); + return d; + }, + + getJsonValues: function() { + + var myValues = new Object(); + myValues.nodeType = 'download'; //amdaModel.DownloadNode.nodeType; + myValues.type = this.get('type'); + myValues.downloadSrc = this.get('downloadSrc'); + myValues.name = this.get('name'); + //Data download + if (myValues.downloadSrc === '0') { // Data download + myValues.filestructure = this.get('filestructure'); + myValues.refparamSampling = this.get('refparamSampling'); + myValues.separateInfoFile = this.get('separateInfoFile'); + myValues.scientificformat = this.get('scientificformat'); + myValues.sampling = this.get('sampling'); + myValues.fileprefix = this.get('fileprefix'); + + myValues.timesrc = this.get('timesrc'); + // if there's at least one timeTable in case of Download data + if (this.get('timesrc') == amdaModel.AmdaTimeObject.inputTimeSrc[0] && this.get('timeTables') && this.get('timeTables').length) { + // get complete timeTables collection + var timeTables = this.get('timeTables'); // init an empty array for timeTables + myValues.timeTables = []; + // for each interval record + Ext.Array.each(timeTables, function(item, index, all) { + // get Json simplified value + if (!item.$className) { + myValues.timeTables[index] = { timeTableName: item.timeTableName, id: item.id }; + } + // get Json simplified value + else { + myValues.timeTables[index] = item.getJsonValues(); + } + }); + } else { + myValues.startDate = this.get('startDate'); + myValues.stopDate = this.get('stopDate'); + myValues.durationDay = this.get('durationDay'); + myValues.durationHour = this.get('durationHour'); + myValues.durationMin = this.get('durationMin'); + myValues.durationSec = this.get('durationSec'); + } + + // if there's at least one parameter + myValues.list = [] + this.params().each(function(param, index) { + myValues.list[index] = param.getJsonValues(); }); - return d; - }, - - getJsonValues : function(){ - - var myValues = new Object(); - myValues.nodeType = 'download';//amdaModel.DownloadNode.nodeType; - myValues.type = this.get('type'); - myValues.downloadSrc = this.get('downloadSrc'); - myValues.name = this.get('name'); - //Data download - if (myValues.downloadSrc === '0') { // Data download - myValues.filestructure = this.get('filestructure'); - myValues.refparamSampling = this.get('refparamSampling'); - myValues.separateInfoFile = this.get('separateInfoFile'); - myValues.scientificformat = this.get('scientificformat'); - myValues.sampling = this.get('sampling'); - myValues.fileprefix = this.get('fileprefix'); - - myValues.timesrc = this.get('timesrc'); - // if there's at least one timeTable in case of Download data - if (this.get('timesrc') == amdaModel.AmdaTimeObject.inputTimeSrc[0] && this.get('timeTables') && this.get('timeTables').length){ - // get complete timeTables collection - var timeTables = this.get('timeTables'); // init an empty array for timeTables - myValues.timeTables=[]; - // for each interval record - Ext.Array.each(timeTables, function(item, index, all){ - // get Json simplified value - if (!item.$className) { - myValues.timeTables[index] = {timeTableName : item.timeTableName, id : item.id}; - } - // get Json simplified value - else { - myValues.timeTables[index] = item.getJsonValues(); - } - }); - } else { - myValues.startDate = this.get('startDate'); - myValues.stopDate = this.get('stopDate'); - myValues.durationDay = this.get('durationDay'); - myValues.durationHour = this.get('durationHour'); - myValues.durationMin = this.get('durationMin'); - myValues.durationSec = this.get('durationSec'); - } - - // if there's at least one parameter - myValues.list = [] - this.params().each(function (param, index) { - myValues.list[index] = param.getJsonValues(); - }); - myValues.fileformat = this.get('fileformat'); - myValues.timeformat = this.get('timeformat'); - myValues.compression = this.get('compression'); - } - // TT download - else if (myValues.downloadSrc === '1') { - // if there's at least one timeTable - if (this.get('timeTables') && this.get('timeTables').length) { - var list = this.get('timeTables'); - myValues.list=[]; - - Ext.each(list, function(item, index){ - var tt = new Object(); - tt.name = item.get('name'); - tt.id = item.get('id'); - myValues.list[index] = tt; - }); - } - myValues.fileformat = this.get('fileformatTT'); - myValues.timeformat = this.get('timeformatTT'); - myValues.compression = this.get('compressionTT'); - } - // fits images download - else { - myValues.list=[]; - if (this.get('list') && this.get('list').length) - Ext.each(this.get('list'), function(item, index){ - var image = new Object(); - image.name = item['name']; - image.url = item['url']; - myValues.list[index] = image; - }); - myValues.compression = this.get('compression'); - } - myValues.leaf = true; - // myValues.nodeType = amdaModel.PlotNode.nodeType; - return myValues; - } -}); + myValues.fileformat = this.get('fileformat'); + myValues.timeformat = this.get('timeformat'); + myValues.compression = this.get('compression'); + } + // TT download + else if (myValues.downloadSrc === '1') { + // if there's at least one timeTable + if (this.get('timeTables') && this.get('timeTables').length) { + var list = this.get('timeTables'); + myValues.list = []; + + Ext.each(list, function(item, index) { + var tt = new Object(); + tt.name = item.get('name'); + tt.id = item.get('id'); + myValues.list[index] = tt; + }); + } + myValues.fileformat = this.get('fileformatTT'); + myValues.timeformat = this.get('timeformatTT'); + myValues.compression = this.get('compressionTT'); + } + // fits images download + else { + myValues.list = []; + if (this.get('list') && this.get('list').length) + Ext.each(this.get('list'), function(item, index) { + var image = new Object(); + image.name = item['name']; + image.url = item['url']; + myValues.list[index] = image; + }); + myValues.compression = this.get('compression'); + } + myValues.leaf = true; + // myValues.nodeType = amdaModel.PlotNode.nodeType; + return myValues; + } +}); \ No newline at end of file -- libgit2 0.21.2