Blame view

js/app/models/PlotObjects/PlotBaseSerieObject.js 11.1 KB
e84ed2cf   Benjamin Renard   Add Interval Tick...
1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * Project      : AMDA-NG
 * Name         : PlotBaseSerieObject.js
 * @class   amdaPlotObj.PlotBaseSerieObject
 * @extends Ext.data.Model
 * @brief   Plot Base Serie Business Object Definition 
 * @author  Benjamin Renard
 * @version $Id: PlotBaseSerieObject.js benjamin $
 ******************************************************************************
 *    FT Id     :   Date   : Name - Description
 ******************************************************************************
 *	:           :14/09/2015: BRE  - file creation
 */
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
14
15


e84ed2cf   Benjamin Renard   Add Interval Tick...
16
Ext.define('amdaPlotObj.PlotBaseSerieObject', {
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
17
    extend: 'Ext.data.Model',
c85f1120   Erdogan Furkan   Merge amdadev + C...
18
    
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
19
20
21
22
    fields: [
        {name: 'serie-yaxis', type: 'string'},
        {name: 'serie-resolution', type: 'int'},
        {name: 'serie-lines-activated', type: 'boolean'},
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
23
24
25
        {name: 'serie-lines-style', type: 'string'},
        {name: 'serie-lines-width', type: 'float'},
        {name: 'serie-lines-color', type: 'string'},
fc4e516d   Benjamin Renard   Fix
26
	{name: 'serie-symbols-activated', type: 'boolean'},
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
        {name: 'serie-symbols-type', type: 'string'},
        {name: 'serie-symbols-size', type: 'float'},
        {name: 'serie-symbols-color', type: 'string'},
        {name: 'serie-colored-param', type: 'string'},
        {name: 'serie-value-min', type: 'float', useNull: true},
        {name: 'serie-value-max', type: 'float', useNull: true},

        //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'},

        //Interval tick
        {name: 'serie-intervaltick-activated', type: 'boolean'},
        {name: 'serie-intervaltick-mode', type: 'string'},
        {name: 'serie-intervaltick-color', type: 'string'},
        {name: 'serie-intervaltick-symbols-type', type: 'string'},
        {name: 'serie-intervaltick-symbols-size', type: 'float'},
        {name: 'serie-intervaltick-symbols-color', type: 'string'},
        {name: 'serie-intervaltick-font-activated', type: 'boolean'},
        {name: 'serie-intervaltick-font-name', type: 'string'},
        {name: 'serie-intervaltick-font-size', type: 'int'},
        {name: 'serie-intervaltick-font-bold', type: 'boolean'},
        {name: 'serie-intervaltick-font-italic', type: 'boolean'},
        //Filtering
         {name: 'filtering-activated', type: 'boolean'},
         {name:'filtering-level', type:'int'}
    ],

    constructor: function () {
e84ed2cf   Benjamin Renard   Add Interval Tick...
72
73
74
75
        var me = this;
        me.callParent(arguments);
        if ((arguments.length > 0) && arguments[0])
        {
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
76
        } else
e84ed2cf   Benjamin Renard   Add Interval Tick...
77
        {
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
78
79
            //new object, set default fields values
            me.setDefaultValues();
e84ed2cf   Benjamin Renard   Add Interval Tick...
80
81
82
        }
        this.dirty = false;
    },
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
83
84

    setDefaultValues: function ()
e84ed2cf   Benjamin Renard   Add Interval Tick...
85
    {
b1dc2eb3   Erdogan Furkan   More modifications
86
87
        this.set('serie-yaxis', amdaDefaultValues.plot.serie.yAxis);
        this.set('serie-resolution', amdaDefaultValues.plot.serie.resolution);
ba2fd748   Hacene SI HADJ MOHAND   selector ok
88
        
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
89
        this.set('serie-lines-activated', true);
b1dc2eb3   Erdogan Furkan   More modifications
90
91
92
        this.set('serie-lines-style', amdaDefaultValues.plot.serie.lines.style);
        this.set('serie-lines-width', amdaDefaultValues.plot.serie.lines.width);
        this.set('serie-lines-color', amdaDefaultValues.plot.serie.lines.color);
ba2fd748   Hacene SI HADJ MOHAND   selector ok
93
        
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
94
        this.set('serie-symbols-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
95
96
97
        this.set('serie-symbols-type', amdaDefaultValues.plot.serie.symbols.type);
        this.set('serie-symbols-size', amdaDefaultValues.plot.serie.symbols.size);
        this.set('serie-symbols-color', amdaDefaultValues.plot.serie.symbols.color);
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
98
99
100
        this.set('serie-colored-param', '');

        this.set('serie-timetick-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
101
102
103
104
105
106
107
108
        this.set('serie-timetick-type', amdaDefaultValues.plot.serie.timetick.type);
        this.set('serie-timetick-step', amdaDefaultValues.plot.serie.timetick.step);
        this.set('serie-timetick-nbmajor', amdaDefaultValues.plot.serie.timetick.nbmajor);
        this.set('serie-timetick-nbminor', amdaDefaultValues.plot.serie.timetick.nbminor);
        this.set('serie-timetick-color', amdaDefaultValues.plot.serie.timetick.color);
        this.set('serie-timetick-symbols-type', amdaDefaultValues.plot.serie.timetick.symbols.type);
        this.set('serie-timetick-symbols-size', amdaDefaultValues.plot.serie.timetick.symbols.size);
        this.set('serie-timetick-symbols-color', amdaDefaultValues.plot.serie.timetick.symbols.color);
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
109
        this.set('serie-timetick-firstsymbols-activated', true);
b1dc2eb3   Erdogan Furkan   More modifications
110
111
112
        this.set('serie-timetick-firstsymbols-type', amdaDefaultValues.plot.serie.timetick.firstsymbols.type);
        this.set('serie-timetick-firstsymbols-size', amdaDefaultValues.plot.serie.timetick.firstsymbols.size);
        this.set('serie-timetick-firstsymbols-color', amdaDefaultValues.plot.serie.timetick.firstsymbols.color);
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
113
        this.set('serie-timetick-font-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
114
115
        this.set('serie-timetick-font-name', amdaDefaultValues.plot.serie.timetick.font.name);
        this.set('serie-timetick-font-size', amdaDefaultValues.plot.serie.timetick.font.size);
e84ed2cf   Benjamin Renard   Add Interval Tick...
116
117
        this.set('serie-timetick-font-bold', false);
        this.set('serie-timetick-font-italic', false);
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
118
119

        this.set('serie-intervaltick-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
120
121
122
123
124
        this.set('serie-intervaltick-mode', amdaDefaultValues.plot.serie.intervaltick.mode);
        this.set('serie-intervaltick-color', amdaDefaultValues.plot.serie.intervaltick.color);
        this.set('serie-intervaltick-symbols-type', amdaDefaultValues.plot.serie.intervaltick.symbols.type);
        this.set('serie-intervaltick-symbols-size', amdaDefaultValues.plot.serie.intervaltick.symbols.size);
        this.set('serie-intervaltick-symbols-color', amdaDefaultValues.plot.serie.intervaltick.symbols.color);
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
125
        this.set('serie-intervaltick-font-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
126
127
        this.set('serie-intervaltick-font-name', amdaDefaultValues.plot.serie.intervaltick.font.name);
        this.set('serie-intervaltick-font-size', amdaDefaultValues.plot.serie.intervaltick.font.size);
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
128
129
130
131
132
        this.set('serie-intervaltick-font-bold', false);
        this.set('serie-intervaltick-font-italic', false);
        
        // filtering 
          this.set( 'filtering-activated', false);
b1dc2eb3   Erdogan Furkan   More modifications
133
         this.set('filtering-level', amdaDefaultValues.plot.filtering.level);
e84ed2cf   Benjamin Renard   Add Interval Tick...
134
    },
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
135
136

    loadFromData: function (drawData)
ced82260   Benjamin Renard   Get initial plot ...
137
    {
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
138
139
140
141
142
        Ext.Object.each(drawData, function (key, value) {
            if (key == 'type')
                return;
            this.set(key, value);
        }, this);
ced82260   Benjamin Renard   Get initial plot ...
143
    },
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
144
145

    getJsonValues: function ()
e84ed2cf   Benjamin Renard   Add Interval Tick...
146
    {
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
147
148
149
150
        var serieValues = new Object();

        serieValues['serie-yaxis'] = this.get('serie-yaxis');
        serieValues['serie-resolution'] = this.get('serie-resolution');
ba2fd748   Hacene SI HADJ MOHAND   selector ok
151
        
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
152
153
154
155
        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');
ba2fd748   Hacene SI HADJ MOHAND   selector ok
156
           
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
        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-value-min'] = this.get('serie-value-min');
        serieValues['serie-value-max'] = this.get('serie-value-max');

        serieValues['serie-timetick-activated'] = this.get('serie-timetick-activated');
        serieValues['serie-timetick-type'] = this.get('serie-timetick-type');
        serieValues['serie-timetick-step'] = this.get('serie-timetick-step');
        serieValues['serie-timetick-nbmajor'] = this.get('serie-timetick-nbmajor');
        serieValues['serie-timetick-nbminor'] = this.get('serie-timetick-nbminor');
        serieValues['serie-timetick-color'] = this.get('serie-timetick-color');
        serieValues['serie-timetick-symbols-type'] = this.get('serie-timetick-symbols-type');
        serieValues['serie-timetick-symbols-size'] = this.get('serie-timetick-symbols-size');
        serieValues['serie-timetick-symbols-color'] = this.get('serie-timetick-symbols-color');
        serieValues['serie-timetick-firstsymbols-activated'] = this.get('serie-timetick-firstsymbols-activated');
        serieValues['serie-timetick-firstsymbols-type'] = this.get('serie-timetick-firstsymbols-type');
        serieValues['serie-timetick-firstsymbols-size'] = this.get('serie-timetick-firstsymbols-size');
        serieValues['serie-timetick-firstsymbols-color'] = this.get('serie-timetick-firstsymbols-color');
        serieValues['serie-timetick-font-activated'] = this.get('serie-timetick-font-activated');
        serieValues['serie-timetick-font-name'] = this.get('serie-timetick-font-name');
        serieValues['serie-timetick-font-size'] = this.get('serie-timetick-font-size');
        serieValues['serie-timetick-font-bold'] = this.get('serie-timetick-font-bold');
        serieValues['serie-timetick-font-italic'] = this.get('serie-timetick-font-italic');

        serieValues['serie-intervaltick-activated'] = this.get('serie-intervaltick-activated');
        serieValues['serie-intervaltick-mode'] = this.get('serie-intervaltick-mode');
        serieValues['serie-intervaltick-color'] = this.get('serie-intervaltick-color');
        serieValues['serie-intervaltick-symbols-type'] = this.get('serie-intervaltick-symbols-type');
        serieValues['serie-intervaltick-symbols-size'] = this.get('serie-intervaltick-symbols-size');
        serieValues['serie-intervaltick-symbols-color'] = this.get('serie-intervaltick-symbols-color');
        serieValues['serie-intervaltick-font-activated'] = this.get('serie-intervaltick-font-activated');
        serieValues['serie-intervaltick-font-name'] = this.get('serie-intervaltick-font-name');
        serieValues['serie-intervaltick-font-size'] = this.get('serie-intervaltick-font-size');
        serieValues['serie-intervaltick-font-bold'] = this.get('serie-intervaltick-font-bold');
        serieValues['serie-intervaltick-font-italic'] = this.get('serie-intervaltick-font-italic');
        
         serieValues['filtering-activated'] = this.get('filtering-activated');
         serieValues['filtering-level'] = this.get('filtering-level');

        return serieValues;
e84ed2cf   Benjamin Renard   Add Interval Tick...
200
    }
8b1dd478   Benjamin Renard   Add the possibili...
201
});