Blame view

js/app/views/PlotComponents/PlotBaseSerieForm.js 4.62 KB
e84ed2cf   Benjamin Renard   Add Interval Tick...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Project   : AMDA-NG
 * Name      : PlotBaseSerieForm.js
 * @class   amdaPlotComp.PlotBaseSerieForm
 * @extends amdaPlotComp.PlotStandardForm
 * @brief   Form to define specifics base serie options
 * @author  Benjamin Renard
 * @version $Id: PlotBaseSerieForm.js benjamin $
 */

Ext.define('amdaPlotComp.PlotBaseSerieForm', {
	extend: 'amdaPlotComp.PlotStandardForm',
	
	setObject : function(object) {
		this.object = object.get('param-drawing-object');
		this.loadRecord(this.object);
		this.updateOptions(this.crtTree.getSelectedPlotType());
	},
8caed468   Benjamin Renard   Fix axes ranges d...
19

e84ed2cf   Benjamin Renard   Add Interval Tick...
20
21
22
23
	updateOptions: function(plotType) {
		var isScatter = (plotType == 'xyPlot');
		
		var timeTickTypeField = this.getForm().findField('serie-timetick-type');
6e83f9b9   Erdogan Furkan   Done
24
25
		if (timeTickTypeField != null){
			var timeTickFieldSet = timeTickTypeField.findParentByType('fieldset');
e84ed2cf   Benjamin Renard   Add Interval Tick...
26
		
6e83f9b9   Erdogan Furkan   Done
27
28
29
			timeTickFieldSet.setVisible(isScatter);
			
			if (isScatter)
e84ed2cf   Benjamin Renard   Add Interval Tick...
30
			{
6e83f9b9   Erdogan Furkan   Done
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
				//Update Time Tick field
				var timeTickStepField = this.getForm().findField('serie-timetick-step');
				var timeTickNbMajorField = this.getForm().findField('serie-timetick-nbmajor');
				switch (timeTickTypeField.getValue())
				{
				case 'time-step' :
					timeTickStepField.setVisible(true);
					timeTickNbMajorField.setVisible(false);
					break;
				case 'nb-major' :
					timeTickStepField.setVisible(false);
					timeTickNbMajorField.setVisible(true);
					break;
				case 'auto' :
				default :
					timeTickStepField.setVisible(false);
					timeTickNbMajorField.setVisible(false);
				}
e84ed2cf   Benjamin Renard   Add Interval Tick...
49
50
51
52
53
54
55
			}
		}
	},
	
	getTimeTickItems: function() {
		var me = this;
		return [
4f728fd9   Erdogan Furkan   For now 2
56
			this.addStandardCombo('serie-timetick-type', 'Type', amdaDefaultConfigs.availableTimeTickTypes, function(name, value, oldValue) {
e84ed2cf   Benjamin Renard   Add Interval Tick...
57
58
59
60
61
				me.updateOptions(me.crtTree.getSelectedPlotType());
			}),
		    this.addStandardFloat('serie-timetick-step', 'Time step (sec.)'),
			this.addStandardFloat('serie-timetick-nbmajor', 'Number of major ticks'),
			this.addStandardFloat('serie-timetick-nbminor', 'Number of minor ticks'),
4f728fd9   Erdogan Furkan   For now 2
62
			this.addColorsPicker('serie-timetick-color', 'Color', amdaDefaultConfigs.availableColorsNew),
e84ed2cf   Benjamin Renard   Add Interval Tick...
63
64
65
66
67
68
69
70
71
72
			this.addStandardFieldSet('Symbols', '', this.addStandardSymbolsItems('serie-timetick-symbols')),
			this.addStandardFieldSet('First symbol', 'serie-timetick-firstsymbols-activated', this.addStandardSymbolsItems('serie-timetick-firstsymbols')),
			this.addStandardFont('serie-timetick-font')
		];
	},
	
	getIntervalTickItems: function() {
		var me = this;
		
		return [
4f728fd9   Erdogan Furkan   For now 2
73
74
			this.addStandardCombo('serie-intervaltick-mode', 'Mode', amdaDefaultConfigs.availableIntervalTickModes),
			this.addColorsPicker('serie-intervaltick-color', 'Color', amdaDefaultConfigs.availableColorsNew),
e84ed2cf   Benjamin Renard   Add Interval Tick...
75
76
77
78
79
			this.addStandardFieldSet('Symbols', '', this.addStandardSymbolsItems('serie-intervaltick-symbols')),
			this.addStandardFont('serie-intervaltick-font')
		];
	},
	
df008372   Benjamin Renard   Min/max value def...
80
81
	getValuesRangeItems: function() {
		return [
afb7b464   Benjamin Renard   Fix decimal preci...
82
83
		        this.addStandardFloat2('serie-value-min', 'Min value', -Number.MAX_VALUE, Number.MAX_VALUE, true),
		        this.addStandardFloat2('serie-value-max', 'Max value', -Number.MAX_VALUE, Number.MAX_VALUE, true)
df008372   Benjamin Renard   Min/max value def...
84
85
		];
	},
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
86
87
                    getFilteringItems: function(){
                               return[
4f728fd9   Erdogan Furkan   For now 2
88
                                 this.addStandardCombo('filtering-level', 'Level', amdaDefaultConfigs.availableFilteringLevel)
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
89
90
                               ];
                    },
df008372   Benjamin Renard   Min/max value def...
91
	
e84ed2cf   Benjamin Renard   Add Interval Tick...
92
93
94
95
	getFormItems: function() {
		var me = this;
		
		return [
4f728fd9   Erdogan Furkan   For now 2
96
                    this.addStandardCombo('serie-resolution', 'Points per plot', amdaDefaultConfigs.availableResolutions, function(name, value, oldValue) {
8b1dd478   Benjamin Renard   Add the possibili...
97
98
			me.object.set('serie-resolution', value);
                    }),
4f728fd9   Erdogan Furkan   For now 2
99
		    this.addStandardCombo('serie-yaxis', 'Y axis', amdaDefaultConfigs.availableYAxes, function(name, value, oldValue) {
e84ed2cf   Benjamin Renard   Add Interval Tick...
100
101
102
		    	me.object.set('serie-yaxis', value);
		    	me.crtTree.refresh();
		    }),
a8da7fc5   Hacene SI HADJ MOHAND   ihm plot ok
103
	                       myDesktopApp.addAmdaInfo('MinMaxThreshold','vertical-align:bottom'),
b2c2038c   Elena.Budnik   redmine #5993 can...
104
		    this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems()),
e84ed2cf   Benjamin Renard   Add Interval Tick...
105
106
107
108
		    this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'),
		    this.addStandardFieldSet('Lines', 'serie-lines-activated', this.addStandardLineItems('serie-lines')),
		    this.addStandardFieldSet('Symbols', 'serie-symbols-activated', this.addStandardSymbolsItems('serie-symbols')),
		    this.addStandardFieldSet('Time ticks', 'serie-timetick-activated', this.getTimeTickItems()),
0dbe3844   Hacene SI HADJ MOHAND   merge with remote
109
110
	            this.addStandardFieldSet('Interval ticks', 'serie-intervaltick-activated', this.getIntervalTickItems()),
                    this.addStandardFieldSet('Spike Filtering ( ! Experimental ! )', 'filtering-activated', this.getFilteringItems())
e84ed2cf   Benjamin Renard   Add Interval Tick...
111
112
		];
	}
afb7b464   Benjamin Renard   Fix decimal preci...
113
});