PlotInstantSerieObject.js 3.09 KB
/**
 * Project      : AMDA-NG
 * Name         : PlotInstantSerieObject.js
 * @class   amdaPlotObj.PlotInstantSerieObject
 * @extends Ext.data.Model
 * @brief   Plot Instant Serie Business Object Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotInstantSerieObject.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :28/08/2015: BRE  - file creation
 */
 
 		
Ext.define('amdaPlotObj.PlotInstantSerieObject', {
	extend: 'Ext.data.Model',
	
	requires: [
	           'amdaPlotObj.PlotObjectConfig'
	],
	
	fields : [
	          {name: 'iserie-tableonx', type: 'boolean'},
	          {name: 'iserie-lines-activated', type: 'boolean'},
	          {name: 'iserie-lines-style', type: 'string'},
	          {name: 'iserie-lines-width', type: 'float'},
	          {name: 'iserie-lines-color', type: 'string'},
	          {name: 'iserie-symbols-activated', type: 'boolean'},
	          {name: 'iserie-symbols-type', type: 'string'},
	          {name: 'iserie-symbols-size', type: 'float'},
	          {name: 'iserie-symbols-color', type: 'string'}
    ],
    
    constructor: function(){
        var me = this;
        me.callParent(arguments);
        if ((arguments.length > 0) && arguments[0])
        {
        }
        else
        {
        	//new object, set default fields values
        	me.setDefaultValues();
        }
        this.dirty = false;
    },
    
    setDefaultValues: function()
    {
    	this.set('iserie-tableonx', false);
    	this.set('iserie-lines-activated', true);
    	this.set('iserie-lines-style', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.style);
    	this.set('iserie-lines-width', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.width);
    	this.set('iserie-lines-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.color);
    	this.set('iserie-symbols-activated', false);
    	this.set('iserie-symbols-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.type);
    	this.set('iserie-symbols-size', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.size);
    	this.set('iserie-symbols-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.color);
    },
    
    getJsonValues : function() 
    {
    	var iserieValues  = new Object();
    	
    	iserieValues['iserie-tableonx'] = this.get('iserie-tableonx');
    	iserieValues['iserie-lines-activated'] = this.get('iserie-lines-activated');
    	iserieValues['iserie-lines-style'] = this.get('iserie-lines-style');
    	iserieValues['iserie-lines-width'] = this.get('iserie-lines-width');
    	iserieValues['iserie-lines-color'] = this.get('iserie-lines-color');
    	iserieValues['iserie-symbols-activated'] = this.get('iserie-symbols-activated');
    	iserieValues['iserie-symbols-type'] = this.get('iserie-symbols-type');
    	iserieValues['iserie-symbols-size'] = this.get('iserie-symbols-size');
    	iserieValues['iserie-symbols-color'] = this.get('iserie-symbols-color');
    	
    	return iserieValues;
    }
});