Blame view

js/app/views/PlotComponents/PlotSerieForm.js 3.16 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');
df008372   Benjamin Renard   Min/max value def...
18
19
		var xValueMinField = this.getForm().findField('serie-xvalue-min');
		var xValueFieldSet = xValueMinField.findParentByType('fieldset');
003ba315   Benjamin Renard   Add Epoch Plot an...
20
		var resamplingModeField = this.getForm().findField('serie-resampling-mode');
24b02d83   Benjamin Renard   Add definition of...
21
		
17433635   Benjamin Renard   Add series and sp...
22
		xParamField.setVisible(isScatter);
df008372   Benjamin Renard   Min/max value def...
23
		xValueFieldSet.setVisible(isScatter);
003ba315   Benjamin Renard   Add Epoch Plot an...
24
		resamplingModeField.setVisible(isScatter);
24b02d83   Benjamin Renard   Add definition of...
25
		
e84ed2cf   Benjamin Renard   Add Interval Tick...
26
27
28
29
30
31
		var errorBarTypeField = this.getForm().findField('serie-errorbar-type');
		var errorBarFieldSet = errorBarTypeField.findParentByType('fieldset');
		
		errorBarFieldSet.setVisible(!isScatter);
		
		if (!isScatter)
24b02d83   Benjamin Renard   Add definition of...
32
		{
e84ed2cf   Benjamin Renard   Add Interval Tick...
33
34
35
36
37
38
39
			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...
40
		}
e84ed2cf   Benjamin Renard   Add Interval Tick...
41
42
		
		this.callParent(arguments);
17433635   Benjamin Renard   Add series and sp...
43
44
	},
	
e84ed2cf   Benjamin Renard   Add Interval Tick...
45
	getErrorBarItems: function() {
24b02d83   Benjamin Renard   Add definition of...
46
		var me = this;
e84ed2cf   Benjamin Renard   Add Interval Tick...
47
		
24b02d83   Benjamin Renard   Add definition of...
48
		return [
e84ed2cf   Benjamin Renard   Add Interval Tick...
49
50
			this.addStandardCombo('serie-errorbar-type', 'Type', amdaPlotObj.PlotObjectConfig.availableErrorBarTypes, function(name, value, oldValue) {
		    	me.updateOptions(me.crtTree.getSelectedPlotType());
24b02d83   Benjamin Renard   Add definition of...
51
			}),
e84ed2cf   Benjamin Renard   Add Interval Tick...
52
53
54
55
			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...
56
		];
24b02d83   Benjamin Renard   Add definition of...
57
58
	},
	
df008372   Benjamin Renard   Min/max value def...
59
60
61
62
63
64
65
	getXValuesRangeItems: function() {
		return [
		        this.addStandardFloat('serie-xvalue-min', 'Min value', -Number.MAX_VALUE, Number.MAX_VALUE, true),
		        this.addStandardFloat('serie-xvalue-max', 'Max value', -Number.MAX_VALUE, Number.MAX_VALUE, true)
		];
	},
	
24b02d83   Benjamin Renard   Add definition of...
66
	getFormItems: function() {
dbb7bcbe   Benjamin Renard   Add curves defint...
67
68
		var me = this;
		
e84ed2cf   Benjamin Renard   Add Interval Tick...
69
70
71
72
73
74
75
		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();
			}),
df008372   Benjamin Renard   Min/max value def...
76
			this.addStandardFieldSet('X Values range', '', this.getXValuesRangeItems()),
e84ed2cf   Benjamin Renard   Add Interval Tick...
77
			this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaPlotObj.PlotObjectConfig.availableResamplingModes)
17433635   Benjamin Renard   Add series and sp...
78
		];
e84ed2cf   Benjamin Renard   Add Interval Tick...
79
80
81
82
83
84
85
86
		
		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...
87
88
	}
});