Blame view

js/app/views/PlotComponents/PlotSerieForm.js 3.26 KB
17433635   Benjamin Renard   Add series and sp...
1
2
3
4
/**
 * Project   : AMDA-NG
 * Name      : PlotSerieForm.js
 * @class   amdaPlotComp.PlotSerieForm
a0bf9157   Benjamin Renard   Add tick plot and...
5
 * @extends amdaPlotComp.PlotStandardForm
17433635   Benjamin Renard   Add series and sp...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * @brief   Form to define specifics serie options
 * @author  Benjamin Renard
 * @version $Id: PlotSerieForm.js benjamin $
 */

Ext.define('amdaPlotComp.PlotSerieForm', {
	extend: 'amdaPlotComp.PlotStandardForm',
	
	setObject : function(object) {
		this.object = object.get('param-drawing-object');
		this.loadRecord(this.object);
		this.updateOptions(this.crtTree.getSelectedPlotType());
	},
	
	updateOptions: function(plotType) {
24b02d83   Benjamin Renard   Add definition of...
21
22
		var isScatter = (plotType == 'xyPlot');
		
17433635   Benjamin Renard   Add series and sp...
23
		var xParamField = this.getForm().findField('serie-xaxis-param');
003ba315   Benjamin Renard   Add Epoch Plot an...
24
		var resamplingModeField = this.getForm().findField('serie-resampling-mode');
24b02d83   Benjamin Renard   Add definition of...
25
26
27
		var timeTickTypeField = this.getForm().findField('serie-timetick-type');
		var timeTickFieldSet = timeTickTypeField.findParentByType('fieldset');
		
17433635   Benjamin Renard   Add series and sp...
28
		xParamField.setVisible(isScatter);
003ba315   Benjamin Renard   Add Epoch Plot an...
29
		resamplingModeField.setVisible(isScatter);
24b02d83   Benjamin Renard   Add definition of...
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
		timeTickFieldSet.setVisible(isScatter);
		
		if (isScatter)
		{
			//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);
			}
		}
17433635   Benjamin Renard   Add series and sp...
53
54
	},
	
24b02d83   Benjamin Renard   Add definition of...
55
56
57
58
59
60
61
62
63
64
65
66
67
	getTimeTickItems: function() {
		var me = this;
		return [
			this.addStandardCombo('serie-timetick-type', 'Type', amdaPlotObj.PlotObjectConfig.availableTimeTickTypes, function(name, value, oldValue) {
				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'),
			this.addStandardColor('serie-timetick-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors),
			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')
17433635   Benjamin Renard   Add series and sp...
68
		];
24b02d83   Benjamin Renard   Add definition of...
69
70
71
	},
	
	getFormItems: function() {
17433635   Benjamin Renard   Add series and sp...
72
73
		return [
		    this.addStandardParamDropTarget('serie-xaxis-param', 'X Parameter'),
003ba315   Benjamin Renard   Add Epoch Plot an...
74
		    this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaPlotObj.PlotObjectConfig.availableResamplingModes),
17433635   Benjamin Renard   Add series and sp...
75
76
		    this.addStandardCombo('serie-yaxis', 'Y axis', amdaPlotObj.PlotObjectConfig.availableYAxes),
		    this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'),
24b02d83   Benjamin Renard   Add definition of...
77
78
79
		    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())
17433635   Benjamin Renard   Add series and sp...
80
81
82
		];
	}
});