PlotSerieForm.js
3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* Project : AMDA-NG
* Name : PlotSerieForm.js
* @class amdaPlotComp.PlotSerieForm
* @extends amdaPlotComp.PlotBaseSerieForm
* @brief Form to define specifics serie options
* @author Benjamin Renard
* @version $Id: PlotSerieForm.js benjamin $
*/
Ext.define('amdaPlotComp.PlotSerieForm', {
extend: 'amdaPlotComp.PlotBaseSerieForm',
updateOptions: function(plotType) {
var isScatter = (plotType == 'xyPlot');
var xParamField = this.getForm().findField('serie-xaxis-param');
var xValueMinField = this.getForm().findField('serie-xvalue-min');
var xValueFieldSet = xValueMinField.findParentByType('fieldset');
var resamplingModeField = this.getForm().findField('serie-resampling-mode');
xParamField.setVisible(isScatter);
xValueFieldSet.setVisible(isScatter);
resamplingModeField.setVisible(isScatter);
var errorBarTypeField = this.getForm().findField('serie-errorbar-type');
var errorBarFieldSet = errorBarTypeField.findParentByType('fieldset');
errorBarFieldSet.setVisible(!isScatter);
if (!isScatter)
{
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');
}
this.callParent(arguments);
},
getErrorBarItems: function() {
var me = this;
return [
this.addStandardCombo('serie-errorbar-type', 'Type', amdaDefaultConfigs.availableErrorBarTypes, function(name, value, oldValue) {
me.updateOptions(me.crtTree.getSelectedPlotType());
}),
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'))
];
},
getXValuesRangeItems: function() {
return [
this.addStandardFloat2('serie-xvalue-min', 'Min value', -Number.MAX_VALUE, Number.MAX_VALUE, true),
this.addStandardFloat2('serie-xvalue-max', 'Max value', -Number.MAX_VALUE, Number.MAX_VALUE, true)
];
},
getFormItems: function() {
var me = this;
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.addStandardFieldSet('X Values range', '', this.getXValuesRangeItems()),
this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaDefaultConfigs.availableResamplingModes)
];
Ext.each(baseSerieItems, function(item) {
serieItems.push(item);
});
serieItems.push(this.addStandardFieldSet('Error Bar', 'serie-errorbar-activated', this.getErrorBarItems()));
return serieItems;
}
});