Blame view

js/app/models/PlotObjects/PlotSerieObject.js 8.45 KB
17433635   Benjamin Renard   Add series and sp...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * Project      : AMDA-NG
 * Name         : PlotSerieObject.js
 * @class   amdaPlotObj.PlotSerieObject
 * @extends Ext.data.Model
 * @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: 'Ext.data.Model',
	
	requires: [
	           'amdaPlotObj.PlotObjectConfig'
	],
	
	fields : [
	          {name: 'serie-yaxis', type: 'string'},
24b02d83   Benjamin Renard   Add definition of...
25
	          {name: 'serie-lines-activated', type: 'boolean'},
17433635   Benjamin Renard   Add series and sp...
26
27
28
	          {name: 'serie-lines-style', type: 'string'},
	          {name: 'serie-lines-width', type: 'float'},
	          {name: 'serie-lines-color', type: 'string'},
24b02d83   Benjamin Renard   Add definition of...
29
	          {name: 'serie-symbols-activated', type: 'boolean'},
17433635   Benjamin Renard   Add series and sp...
30
31
32
33
	          {name: 'serie-symbols-type', type: 'string'},
	          {name: 'serie-symbols-size', type: 'float'},
	          {name: 'serie-symbols-color', type: 'string'},
	          {name: 'serie-colored-param', type: 'string'},
24b02d83   Benjamin Renard   Add definition of...
34
	          
17433635   Benjamin Renard   Add series and sp...
35
	          //Only used for xyPlot
003ba315   Benjamin Renard   Add Epoch Plot an...
36
	          {name: 'serie-xaxis-param', type: 'string'},
24b02d83   Benjamin Renard   Add definition of...
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
	          {name: 'serie-resampling-mode', type: 'string'},
	          //Time tick
	          {name: 'serie-timetick-activated', type: 'boolean'},
	          {name: 'serie-timetick-type', type: 'string'},
	          {name: 'serie-timetick-step', type: 'float'},
	          {name: 'serie-timetick-nbmajor', type: 'int'},
	          {name: 'serie-timetick-nbminor', type: 'int'},
	          {name: 'serie-timetick-color', type: 'string'},
	          {name: 'serie-timetick-symbols-type', type: 'string'},
	          {name: 'serie-timetick-symbols-size', type: 'float'},
	          {name: 'serie-timetick-symbols-color', type: 'string'},
	          {name: 'serie-timetick-firstsymbols-activated', type: 'boolean'},
	          {name: 'serie-timetick-firstsymbols-type', type: 'string'},
	          {name: 'serie-timetick-firstsymbols-size', type: 'float'},
	          {name: 'serie-timetick-firstsymbols-color', type: 'string'},
	          {name: 'serie-timetick-font-activated', type: 'boolean'},
	          {name: 'serie-timetick-font-name', type: 'string'},
	          {name: 'serie-timetick-font-size', type: 'int'},
	          {name: 'serie-timetick-font-bold', type: 'boolean'},
	          {name: 'serie-timetick-font-italic', type: 'boolean'}
17433635   Benjamin Renard   Add series and sp...
57
58
    ],
    
a971060f   Benjamin Renard   Fix some bugs
59
60
61
62
63
64
65
66
67
68
69
70
71
72
    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;
    },
    
17433635   Benjamin Renard   Add series and sp...
73
74
75
76
77
78
79
80
81
82
83
84
    setDefaultValues: function()
    {
    	this.set('serie-yaxis', amdaPlotObj.PlotObjectConfig.defaultValues.serie.yAxis);
    	this.set('serie-lines-activated', true);
    	this.set('serie-lines-style', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.style);
    	this.set('serie-lines-width', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.width);
    	this.set('serie-lines-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.lines.color);
    	this.set('serie-symbols-activated', false);
    	this.set('serie-symbols-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.type);
    	this.set('serie-symbols-size', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.size);
    	this.set('serie-symbols-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.symbols.color);
    	this.set('serie-colored-param', '');
24b02d83   Benjamin Renard   Add definition of...
85
86
87
88
89
90
91
92
93
94
    	
    	this.set('serie-timetick-activated', false);
		this.set('serie-timetick-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.type);
		this.set('serie-timetick-step', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.step);
		this.set('serie-timetick-nbmajor', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.nbmajor);
		this.set('serie-timetick-nbminor', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.nbminor);
		this.set('serie-timetick-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.color);
	    this.set('serie-timetick-symbols-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.type);
	    this.set('serie-timetick-symbols-size', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.size);
	    this.set('serie-timetick-symbols-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.symbols.color);
94abdb37   Benjamin Renard   Add params legend...
95
		this.set('serie-timetick-firstsymbols-activated', true);
24b02d83   Benjamin Renard   Add definition of...
96
97
98
99
100
101
102
103
104
		this.set('serie-timetick-firstsymbols-type', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.firstsymbols.type);
	    this.set('serie-timetick-firstsymbols-size', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.firstsymbols.size);
	    this.set('serie-timetick-firstsymbols-color', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.firstsymbols.color);
		this.set('serie-timetick-font-activated', false);
        this.set('serie-timetick-font-name', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.font.name);
        this.set('serie-timetick-font-size', amdaPlotObj.PlotObjectConfig.defaultValues.serie.timetick.font.size);
        this.set('serie-timetick-font-bold', false);
        this.set('serie-timetick-font-italic', false);
    	
17433635   Benjamin Renard   Add series and sp...
105
    	this.set('serie-xaxis-param', '');
003ba315   Benjamin Renard   Add Epoch Plot an...
106
    	this.set('serie-resampling-mode', amdaPlotObj.PlotObjectConfig.defaultValues.serie.resamplingMode);
17433635   Benjamin Renard   Add series and sp...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
    },
    
    getJsonValues : function() 
    {
    	var serieValues  = new Object();
    	
    	serieValues['serie-yaxis'] = this.get('serie-yaxis');
    	serieValues['serie-lines-activated'] = this.get('serie-lines-activated');
    	serieValues['serie-lines-style'] = this.get('serie-lines-style');
    	serieValues['serie-lines-width'] = this.get('serie-lines-width');
    	serieValues['serie-lines-color'] = this.get('serie-lines-color');
    	serieValues['serie-symbols-activated'] = this.get('serie-symbols-activated');
    	serieValues['serie-symbols-type'] = this.get('serie-symbols-type');
    	serieValues['serie-symbols-size'] = this.get('serie-symbols-size');
    	serieValues['serie-symbols-color'] = this.get('serie-symbols-color');
    	serieValues['serie-colored-param'] = this.get('serie-colored-param');
    	serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param');
003ba315   Benjamin Renard   Add Epoch Plot an...
124
    	serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode');
17433635   Benjamin Renard   Add series and sp...
125
    	
24b02d83   Benjamin Renard   Add definition of...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
    	if (this.get('serie-timetick-activated'))
    	{
    		serieValues['serie-timetick'] = new Object();
    		serieValues['serie-timetick']['serie-timetick-type'] = this.get('serie-timetick-type');
    		serieValues['serie-timetick']['serie-timetick-step'] = this.get('serie-timetick-step');
    		serieValues['serie-timetick']['serie-timetick-nbmajor'] = this.get('serie-timetick-nbmajor');
    		serieValues['serie-timetick']['serie-timetick-nbminor'] = this.get('serie-timetick-nbminor');
    		serieValues['serie-timetick']['serie-timetick-color'] = this.get('serie-timetick-color');
    		serieValues['serie-timetick']['serie-timetick-symbols-type'] = this.get('serie-timetick-symbols-type');
    		serieValues['serie-timetick']['serie-timetick-symbols-size'] = this.get('serie-timetick-symbols-size');
    		serieValues['serie-timetick']['serie-timetick-symbols-color'] = this.get('serie-timetick-symbols-color');
    		serieValues['serie-timetick']['serie-timetick-firstsymbols-activated'] = this.get('serie-timetick-firstsymbols-activated');
    		serieValues['serie-timetick']['serie-timetick-firstsymbols-type'] = this.get('serie-timetick-firstsymbols-type');
    		serieValues['serie-timetick']['serie-timetick-firstsymbols-size'] = this.get('serie-timetick-firstsymbols-size');
    		serieValues['serie-timetick']['serie-timetick-firstsymbols-color'] = this.get('serie-timetick-firstsymbols-color');
    		serieValues['serie-timetick']['serie-timetick-font-activated'] = this.get('serie-timetick-font-activated');
    		serieValues['serie-timetick']['serie-timetick-font-name'] = this.get('serie-timetick-font-name');
    		serieValues['serie-timetick']['serie-timetick-font-size'] = this.get('serie-timetick-font-size');
    		serieValues['serie-timetick']['serie-timetick-font-bold'] = this.get('serie-timetick-font-bold');
    		serieValues['serie-timetick']['serie-timetick-font-italic'] = this.get('serie-timetick-font-italic');
		}
    	
17433635   Benjamin Renard   Add series and sp...
148
149
150
    	return serieValues;
    }
});