PlotSerieObject.js 3.56 KB
/**
 * Project      : AMDA-NG
 * Name         : PlotSerieObject.js
 * @class   amdaPlotObj.PlotSerieObject
 * @extends amdaPlotObj.PlotBaseSerieObject
 * @brief   Plot Serie Business Object Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotSerieObject.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :18/08/2015: BRE  - file creation
 */
 
 		
Ext.define('amdaPlotObj.PlotSerieObject', {
	extend: 'amdaPlotObj.PlotBaseSerieObject',
	
	fields : [
	          //Only used for xyPlot
	          {name: 'serie-xaxis-param', type: 'string'},
	          {name: 'serie-xvalue-min', type: 'float', useNull:true},
	          {name: 'serie-xvalue-max', type: 'float', useNull:true},
	          {name: 'serie-resampling-mode', type: 'string'},
			  
			  //Only used for timePlot
                              {name: 'serie-errorbar-activated', type: 'boolean'},
                              {name: 'serie-errorbar-type', type: 'string'},
                              {name: 'serie-errorbar-lines-style', type: 'string'},
	          {name: 'serie-errorbar-lines-width', type: 'float'},
	          {name: 'serie-errorbar-lines-color', type: 'string'},
                              {name: 'serie-errorbar-minparam', type: 'string'},
                              {name: 'serie-errorbar-maxparam', type: 'string'},
                              {name: 'serie-errorbar-deltaparam', type: 'string'}
    ],
    
    constructor: function(){
        var me = this;
        me.callParent(arguments);
    },
    
    setDefaultValues: function()
    {
		this.set('serie-errorbar-activated', false);
		this.set('serie-errorbar-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.errorbar.type);
		this.set('serie-errorbar-lines-style', amdaPlotObj.PlotObjectConfig.defaultValues.serie.errorbar.lines.style);
	    this.set('serie-errorbar-lines-width', amdaPlotObj.PlotObjectConfig.defaultValues.serie.errorbar.lines.width);
	    this.set('serie-errorbar-lines-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.errorbar.lines.color);
		this.set('serie-errorbar-minparam', '');
		this.set('serie-errorbar-maxparam', '');
		this.set('serie-errorbar-deltaparam', '');
    	
    	this.set('serie-xaxis-param', '');
    	this.set('serie-resampling-mode', amdaPlotObj.PlotObjectConfig.defaultValues.serie.resamplingMode);
		
		this.callParent(arguments);
    },
    
    getJsonValues : function() 
    {
    	var serieValues  = this.callParent(arguments);
    	
    	serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param');
    	serieValues['serie-xvalue-min'] = this.get('serie-xvalue-min');
    	serieValues['serie-xvalue-max'] = this.get('serie-xvalue-max');
    	serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode');
    	
    	serieValues['serie-errorbar-activated'] = this.get('serie-errorbar-activated');
    	serieValues['serie-errorbar-type'] = this.get('serie-errorbar-type');
		serieValues['serie-errorbar-lines-style'] = this.get('serie-errorbar-lines-style');
		serieValues['serie-errorbar-lines-width'] = this.get('serie-errorbar-lines-width');
		serieValues['serie-errorbar-lines-color'] = this.get('serie-errorbar-lines-color');
		serieValues['serie-errorbar-minparam'] = this.get('serie-errorbar-minparam');
		serieValues['serie-errorbar-maxparam'] = this.get('serie-errorbar-maxparam');
		serieValues['serie-errorbar-deltaparam'] = this.get('serie-errorbar-deltaparam');
		
    	return serieValues;
    }
});