Blame view

js/app/views/PlotComponents/PlotSerieForm.js 2.64 KB
17433635   Benjamin Renard   Add series and sp...
1
2
3
4
/**
 * Project   : AMDA-NG
 * Name      : PlotSerieForm.js
 * @class   amdaPlotComp.PlotSerieForm
e84ed2cf   Benjamin Renard   Add Interval Tick...
5
 * @extends amdaPlotComp.PlotBaseSerieForm
17433635   Benjamin Renard   Add series and sp...
6
7
8
9
10
11
 * @brief   Form to define specifics serie options
 * @author  Benjamin Renard
 * @version $Id: PlotSerieForm.js benjamin $
 */

Ext.define('amdaPlotComp.PlotSerieForm', {
e84ed2cf   Benjamin Renard   Add Interval Tick...
12
	extend: 'amdaPlotComp.PlotBaseSerieForm',
17433635   Benjamin Renard   Add series and sp...
13
14
	
	updateOptions: function(plotType) {
24b02d83   Benjamin Renard   Add definition of...
15
16
		var isScatter = (plotType == 'xyPlot');
		
17433635   Benjamin Renard   Add series and sp...
17
		var xParamField = this.getForm().findField('serie-xaxis-param');
003ba315   Benjamin Renard   Add Epoch Plot an...
18
		var resamplingModeField = this.getForm().findField('serie-resampling-mode');
24b02d83   Benjamin Renard   Add definition of...
19
		
17433635   Benjamin Renard   Add series and sp...
20
		xParamField.setVisible(isScatter);
003ba315   Benjamin Renard   Add Epoch Plot an...
21
		resamplingModeField.setVisible(isScatter);
24b02d83   Benjamin Renard   Add definition of...
22
		
e84ed2cf   Benjamin Renard   Add Interval Tick...
23
24
25
26
27
28
		var errorBarTypeField = this.getForm().findField('serie-errorbar-type');
		var errorBarFieldSet = errorBarTypeField.findParentByType('fieldset');
		
		errorBarFieldSet.setVisible(!isScatter);
		
		if (!isScatter)
24b02d83   Benjamin Renard   Add definition of...
29
		{
e84ed2cf   Benjamin Renard   Add Interval Tick...
30
31
32
33
34
35
36
			var errorMinField = this.getForm().findField('serie-errorbar-minparam');
			var errorMaxField = this.getForm().findField('serie-errorbar-maxparam');
			var errorDeltaField = this.getForm().findField('serie-errorbar-deltaparam');
			
			errorMinField.setVisible(errorBarTypeField.getValue() == 'min-max');
			errorMaxField.setVisible(errorBarTypeField.getValue() == 'min-max');
			errorDeltaField.setVisible(errorBarTypeField.getValue() == 'delta');
24b02d83   Benjamin Renard   Add definition of...
37
		}
e84ed2cf   Benjamin Renard   Add Interval Tick...
38
39
		
		this.callParent(arguments);
17433635   Benjamin Renard   Add series and sp...
40
41
	},
	
e84ed2cf   Benjamin Renard   Add Interval Tick...
42
	getErrorBarItems: function() {
24b02d83   Benjamin Renard   Add definition of...
43
		var me = this;
e84ed2cf   Benjamin Renard   Add Interval Tick...
44
		
24b02d83   Benjamin Renard   Add definition of...
45
		return [
e84ed2cf   Benjamin Renard   Add Interval Tick...
46
47
			this.addStandardCombo('serie-errorbar-type', 'Type', amdaPlotObj.PlotObjectConfig.availableErrorBarTypes, function(name, value, oldValue) {
		    	me.updateOptions(me.crtTree.getSelectedPlotType());
24b02d83   Benjamin Renard   Add definition of...
48
			}),
e84ed2cf   Benjamin Renard   Add Interval Tick...
49
50
51
52
			this.addStandardParamDropTarget('serie-errorbar-minparam', 'Min. Parameter'),
			this.addStandardParamDropTarget('serie-errorbar-maxparam', 'Max. Parameter'),
			this.addStandardParamDropTarget('serie-errorbar-deltaparam', 'Delta Parameter'),
			this.addStandardFieldSet('Bar Lines', '', this.addStandardLineItems('serie-errorbar-lines'))
17433635   Benjamin Renard   Add series and sp...
53
		];
24b02d83   Benjamin Renard   Add definition of...
54
55
56
	},
	
	getFormItems: function() {
dbb7bcbe   Benjamin Renard   Add curves defint...
57
58
		var me = this;
		
e84ed2cf   Benjamin Renard   Add Interval Tick...
59
60
61
62
63
64
65
66
		var baseSerieItems = this.callParent(arguments);
		
		var serieItems = [
			this.addStandardParamDropTarget('serie-xaxis-param', 'X Parameter', function(name, value, oldValue) {
				me.object.set('serie-xaxis-param', value);
        		me.crtTree.refresh();
			}),
			this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaPlotObj.PlotObjectConfig.availableResamplingModes)
17433635   Benjamin Renard   Add series and sp...
67
		];
e84ed2cf   Benjamin Renard   Add Interval Tick...
68
69
70
71
72
73
74
75
		
		Ext.each(baseSerieItems, function(item) {
			serieItems.push(item);
		});
		
		serieItems.push(this.addStandardFieldSet('Error Bar', 'serie-errorbar-activated', this.getErrorBarItems()));
		
		return serieItems;
17433635   Benjamin Renard   Add series and sp...
76
77
	}
});