diff --git a/js/app/controllers/ExplorerModule.js b/js/app/controllers/ExplorerModule.js index 42ca471..ea60031 100644 --- a/js/app/controllers/ExplorerModule.js +++ b/js/app/controllers/ExplorerModule.js @@ -37,7 +37,7 @@ Ext.define('amdaDesktop.ExplorerModule', 'amdaModel.Download', 'amdaModel.TimeTable', 'amdaModel.Catalog', - 'amdaModel.Statistics', + 'amdaModel.Stats', 'amdaModel.FileObject', 'amdaModel.FileParamObject', 'amdaModel.FilterInfo' diff --git a/js/app/controllers/StatisticsModule.js b/js/app/controllers/StatisticsModule.js index 3cc380e..fbcc1d2 100644 --- a/js/app/controllers/StatisticsModule.js +++ b/js/app/controllers/StatisticsModule.js @@ -21,7 +21,7 @@ Ext.define('amdaDesktop.StatisticsModule', { * @required */ nodeDataModel : 'amdaModel.StatisticsNode', - objectDataModel : 'amdaModel.Statistics', + objectDataModel : 'amdaModel.Stats', /** * @cfg {String} window definitions * @required diff --git a/js/app/models/Statistics.js b/js/app/models/Statistics.js deleted file mode 100644 index 0d63eac..0000000 --- a/js/app/models/Statistics.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Project : AMDA-NG - * Name : Statistics.js - * Description : Statistics Object Definition - * @class amdaModel.Statistics - * @extends amdaModel.TimeTable - * @author elena - */ - -Ext.define('amdaModel.Statistics', { - extend: 'amdaModel.AmdaTimeObject', - - fields : [ - { name: 'parameter' } , - { name: 'description' } - ], - - getJsonValues : function (hasId) - { - var values = new Object(); - if (hasId) { - values.id = this.get('id'); - } - - values.timesrc = this.get('timesrc'); - values.name = 'test'; //this.get('name'); - -// if (this.get('description').match(/[a-z,0-9]/gi) != null) { -// values.description = this.get('description'); -// } -// if (this.get('history').match(/[a-z,0-9]/gi) != null) { -// values.history = this.get('history'); -// } - values.objName = this.get('objName'); - values.objFormat = this.get('objFormat'); - -// values.cacheToken = this.get('cacheToken'); - values.parameter = this.get('parameter'); - - // if there's at least one parameter -// if (this.get('parameter') && this.get('parameter').length) -// { -// var list = this.get('parameter'); -// values.parameter=[]; -// Ext.each(list, function(item, index){ -// values.parameter[index] = item.getJsonValues(); -// }); -// } - - if (values.timesrc == amdaModel.AmdaTimeObject.inputTimeSrc[0]) - { - // get complete timeTables collection - var timeTables = this.get('timeTables'); - // init an empty array for timeTables - values.timeTables=[]; - // for each interval record - Ext.Array.each(timeTables, function(item, index, all) - { - if (!item.$className) { - values.timeTables[index] = {timeTableName : item.timeTableName, id : item.id}; - } - // get Json simplified value - else { - values.timeTables[index] = item.getJsonValues(); - } - }); - } else - { - values.startDate = this.get('startDate'); - values.stopDate = this.get('stopDate'); - values.durationDay = this.get('durationDay'); - values.durationHour = this.get('durationHour'); - values.durationMin = this.get('durationMin'); - values.durationSec = this.get('durationSec'); - } - - values.leaf = true; - values.nodeType = 'statistics'; - - return values; - } -}); \ No newline at end of file diff --git a/js/app/models/Stats.js b/js/app/models/Stats.js new file mode 100644 index 0000000..74b5362 --- /dev/null +++ b/js/app/models/Stats.js @@ -0,0 +1,82 @@ +/** + * Project : AMDA-NG + * Name : Stats.js + * Description : Statistics Object Definition + * @class amdaModel.Stats + * @extends amdaModel.TimeTable + * @author elena + */ + +Ext.define('amdaModel.Stats', { + extend: 'amdaModel.AmdaTimeObject', + + fields : [ + { name: 'parameter' } , + { name: 'description' } + ], + + getJsonValues : function (hasId) + { + var values = new Object(); + if (hasId) { + values.id = this.get('id'); + } + + values.timesrc = this.get('timesrc'); + values.name = 'test'; //this.get('name'); + +// if (this.get('description').match(/[a-z,0-9]/gi) != null) { +// values.description = this.get('description'); +// } +// if (this.get('history').match(/[a-z,0-9]/gi) != null) { +// values.history = this.get('history'); +// } + values.objName = this.get('objName'); + values.objFormat = this.get('objFormat'); + +// values.cacheToken = this.get('cacheToken'); + values.parameter = this.get('parameter'); + + // if there's at least one parameter +// if (this.get('parameter') && this.get('parameter').length) +// { +// var list = this.get('parameter'); +// values.parameter=[]; +// Ext.each(list, function(item, index){ +// values.parameter[index] = item.getJsonValues(); +// }); +// } + + if (values.timesrc == amdaModel.AmdaTimeObject.inputTimeSrc[0]) + { + // get complete timeTables collection + var timeTables = this.get('timeTables'); + // init an empty array for timeTables + values.timeTables=[]; + // for each interval record + Ext.Array.each(timeTables, function(item, index, all) + { + if (!item.$className) { + values.timeTables[index] = {timeTableName : item.timeTableName, id : item.id}; + } + // get Json simplified value + else { + values.timeTables[index] = item.getJsonValues(); + } + }); + } else + { + values.startDate = this.get('startDate'); + values.stopDate = this.get('stopDate'); + values.durationDay = this.get('durationDay'); + values.durationHour = this.get('durationHour'); + values.durationMin = this.get('durationMin'); + values.durationSec = this.get('durationSec'); + } + + values.leaf = true; + values.nodeType = 'statistics'; + + return values; + } +}); -- libgit2 0.21.2