Commit b36e5e8717b228ed09edf10cddd2e19a2534cdd7
Exists in
master
and in
63 other branches
Merge branch 'develop' into amdadev
Showing
5 changed files
with
182 additions
and
3 deletions
Show diff stats
js/app/models/PlotObjects/PlotObjectConfig.js
js/app/models/PlotObjects/PlotParamObject.js
... | ... | @@ -19,13 +19,14 @@ Ext.define('amdaPlotObj.PlotParamObject', { |
19 | 19 | requires: [ |
20 | 20 | 'amdaPlotObj.PlotObjectConfig', |
21 | 21 | 'amdaPlotObj.PlotSerieObject', |
22 | - 'amdaPlotObj.PlotOrbitSerieObject', | |
22 | + 'amdaPlotObj.PlotOrbitSerieObject', | |
23 | 23 | 'amdaPlotObj.PlotSpectroObject', |
24 | + 'amdaPlotObj.PlotSauvaudObject', | |
24 | 25 | 'amdaPlotObj.PlotStatusBarObject', |
25 | 26 | 'amdaPlotObj.PlotTickBarObject', |
26 | 27 | 'amdaPlotObj.PlotInstantSerieObject', |
27 | 28 | 'amdaPlotObj.PlotInstantSpectroObject', |
28 | - 'amdaPlotObj.PlotIntervalsObject' | |
29 | + 'amdaPlotObj.PlotIntervalsObject' | |
29 | 30 | ], |
30 | 31 | |
31 | 32 | fields : [ |
... | ... | @@ -85,6 +86,8 @@ Ext.define('amdaPlotObj.PlotParamObject', { |
85 | 86 | return new amdaPlotObj.PlotInstantSpectroObject(data); |
86 | 87 | case 'intervals' : |
87 | 88 | return new amdaPlotObj.PlotIntervalsObject(data); |
89 | + case 'sauvaud' : | |
90 | + return new amdaPlotObj.PlotSauvaudObject(data); | |
88 | 91 | default : |
89 | 92 | return null; |
90 | 93 | } |
... | ... | @@ -119,6 +122,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { |
119 | 122 | return [ |
120 | 123 | {'key' : 'serie', 'value' : 'Serie'}, |
121 | 124 | {'key' : 'spectro', 'value' : 'Spectro'}, |
125 | + {'key' : 'sauvaud', 'value' : 'Sauvaud'}, | |
122 | 126 | {'key' : 'tick-bar', 'value' : 'Tick Bar'}, |
123 | 127 | {'key' : 'status-bar', 'value' : 'Status Bar'} |
124 | 128 | ]; |
... | ... | @@ -211,6 +215,10 @@ Ext.define('amdaPlotObj.PlotParamObject', { |
211 | 215 | var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableYAxes, this.get('param-drawing-object').get('spectro-yaxis')); |
212 | 216 | info += ', Y '+yAxis; |
213 | 217 | break; |
218 | + case 'sauvaud' : | |
219 | + var yAxis = amdaPlotObj.PlotObjectConfig.getValueByKey(amdaPlotObj.PlotObjectConfig.availableYAxes, this.get('param-drawing-object').get('spectro-yaxis')); | |
220 | + info += ', Y '+yAxis; | |
221 | + break; | |
214 | 222 | } |
215 | 223 | |
216 | 224 | return info; | ... | ... |
... | ... | @@ -0,0 +1,96 @@ |
1 | +/** | |
2 | + * Projectย : AMDA-NG | |
3 | + * Name : PlotSpectroObject.js | |
4 | + * @class amdaPlotObj.PlotSpectroObject | |
5 | + * @extends Ext.data.Model | |
6 | + * @brief Plot Spectro Business Object Definition | |
7 | + * @author Benjamin Renard | |
8 | + * @version $Id: PlotSpectroObject.js benjamin $ | |
9 | + ****************************************************************************** | |
10 | + * FT Id : Date : Name - Description | |
11 | + ****************************************************************************** | |
12 | + * : :21/08/2015: BRE - file creation | |
13 | + */ | |
14 | + | |
15 | + | |
16 | +Ext.define('amdaPlotObj.PlotSauvaudObject', { | |
17 | + extend: 'Ext.data.Model', | |
18 | + | |
19 | + requires: [ | |
20 | + 'amdaPlotObj.PlotObjectConfig' | |
21 | + ], | |
22 | + | |
23 | + fields: [ | |
24 | + { name: 'spectro-yaxis', type: 'string' }, | |
25 | + { name: 'spectro-resolution', type: 'int' }, | |
26 | + { name: 'spectro-value-min', type: 'float', useNull: true }, | |
27 | + { name: 'spectro-value-max', type: 'float', useNull: true }, | |
28 | + { name: 'spectro-log0-as-min', type: 'boolean' }, | |
29 | + { name: 'spectro-normalization', type: 'string' }, | |
30 | + //Filtering | |
31 | + { name: 'filtering-activated', type: 'boolean' }, | |
32 | + { name: 'filtering-level', type: 'int' }, | |
33 | + { name: 'right_dim', type: 'int' }, | |
34 | + | |
35 | + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.name, type: 'boolean' }, | |
36 | + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, type: 'string' }, | |
37 | + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, type: 'string' }, | |
38 | + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, type: 'string' } | |
39 | + ], | |
40 | + | |
41 | + constructor: function () { | |
42 | + var me = this; | |
43 | + me.callParent(arguments); | |
44 | + if ((arguments.length > 0) && arguments[0]) { | |
45 | + } | |
46 | + else { | |
47 | + //new object, set default fields values | |
48 | + me.setDefaultValues(); | |
49 | + } | |
50 | + this.dirty = false; | |
51 | + }, | |
52 | + | |
53 | + loadFromData: function (drawData) { | |
54 | + Ext.Object.each(drawData, function (key, value) { | |
55 | + if (key == 'type') | |
56 | + return; | |
57 | + this.set(key, value); | |
58 | + }, this); | |
59 | + }, | |
60 | + | |
61 | + setDefaultValues: function () { | |
62 | + this.set('spectro-yaxis', amdaPlotObj.PlotObjectConfig.defaultValues.spectro.yAxis); | |
63 | + this.set('spectro-resolution', amdaPlotObj.PlotObjectConfig.defaultValues.spectro.resolution); | |
64 | + this.set('spectro-log0-as-min', false); | |
65 | + this.set('spectro-normalization', "none"); | |
66 | + // filtering | |
67 | + this.set('filtering-activated', false); | |
68 | + this.set('filtering-level', amdaPlotObj.PlotObjectConfig.defaultValues.filtering.level); | |
69 | + this.set('right_dim', 0); | |
70 | + | |
71 | + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.name, false); | |
72 | + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, null); | |
73 | + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue); | |
74 | + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue); | |
75 | + }, | |
76 | + | |
77 | + getJsonValues: function () { | |
78 | + var sauvaudValues = new Object(); | |
79 | + | |
80 | + sauvaudValues['spectro-yaxis'] = this.get('spectro-yaxis'); | |
81 | + sauvaudValues['spectro-resolution'] = this.get('spectro-resolution'); | |
82 | + sauvaudValues['spectro-value-min'] = this.get('spectro-value-min'); | |
83 | + sauvaudValues['spectro-value-max'] = this.get('spectro-value-max'); | |
84 | + sauvaudValues['spectro-log0-as-min'] = this.get('spectro-log0-as-min'); | |
85 | + sauvaudValues['spectro-normalization'] = this.get('spectro-normalization'); | |
86 | + sauvaudValues['filtering-activated'] = this.get('filtering-activated'); | |
87 | + sauvaudValues['filtering-level'] = this.get('filtering-level'); | |
88 | + sauvaudValues['right_dim'] = this.get('right_dim'); | |
89 | + | |
90 | + sauvaudValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.name] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.name); | |
91 | + sauvaudValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key); | |
92 | + sauvaudValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key); | |
93 | + sauvaudValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey); | |
94 | + return sauvaudValues; | |
95 | + } | |
96 | +}); | ... | ... |
js/app/views/PlotComponents/PlotParamForm.js
... | ... | @@ -15,6 +15,7 @@ Ext.define('amdaPlotComp.PlotParamForm', { |
15 | 15 | 'amdaPlotComp.PlotSerieForm', |
16 | 16 | 'amdaPlotComp.PlotOrbitSerieForm', |
17 | 17 | 'amdaPlotComp.PlotSpectroForm', |
18 | + 'amdaPlotComp.PlotSauvaudForm', | |
18 | 19 | 'amdaPlotComp.PlotStatusBarForm', |
19 | 20 | 'amdaPlotComp.PlotTickBarForm', |
20 | 21 | 'amdaPlotComp.PlotInstantSerieForm', |
... | ... | @@ -62,6 +63,14 @@ Ext.define('amdaPlotComp.PlotParamForm', { |
62 | 63 | case 'orbit-serie': |
63 | 64 | this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotOrbitSerieForm({ id: formId })); |
64 | 65 | break; |
66 | + case 'sauvaud': | |
67 | + if(this.object.get('type') !=2){ | |
68 | + myDesktopApp.warningMsg('Sauvaud Plot requires <b>2D Parameter</b> '); | |
69 | + }else if(this.object.get('dim1-index') != '*' || this.object.get('dim2-index') != '*' ){ | |
70 | + myDesktopApp.warningMsg('Sauvaud Plot requires the selection of <b>All Arguments</b> in both directions'); | |
71 | + } | |
72 | + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSauvaudForm({ id: formId })); | |
73 | + break; | |
65 | 74 | case 'spectro': |
66 | 75 | this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSpectroForm({ id: formId })); |
67 | 76 | break; |
... | ... | @@ -113,7 +122,8 @@ Ext.define('amdaPlotComp.PlotParamForm', { |
113 | 122 | |
114 | 123 | onChangeParamArgs: function (uiScope, args_key, newValue, oldValue, isTemplateArg) { |
115 | 124 | if ((uiScope.isFirstMsg) && (uiScope.object.get('type') == 2) && (uiScope.object.get('dim1-sum-type') == 0) && (uiScope.object.get('dim2-sum-type') == 0) && |
116 | - (uiScope.object.get('dim1-index') == '*') && (uiScope.object.get('dim2-index') == '*')) { | |
125 | + (uiScope.object.get('dim1-index') == '*') && (uiScope.object.get('dim2-index') == '*') && (uiScope.object.get('param-drawing-type') != 'sauvaud')) { | |
126 | + console.log(uiScope.object); | |
117 | 127 | uiScope.isFirstMsg = false; |
118 | 128 | myDesktopApp.warningMsg('If argument <i>All</i> is set for both dimensions output will be the total sum <b>(not spectra!)</b>'); |
119 | 129 | } | ... | ... |
... | ... | @@ -0,0 +1,61 @@ |
1 | +/* | |
2 | + * To change this license header, choose License Headers in Project Properties. | |
3 | + * To change this template file, choose Tools | Templates | |
4 | + * and open the template in the editor. | |
5 | + */ | |
6 | + | |
7 | + | |
8 | +Ext.define('amdaPlotComp.PlotSauvaudForm', { | |
9 | + extend: 'amdaPlotComp.PlotSpectroForm', | |
10 | + requires: [ | |
11 | + 'amdaUI.ParamArgumentsUI' | |
12 | + ], | |
13 | + setObject: function (object) { | |
14 | + this.data = object.data; | |
15 | + this.object = object.get('param-drawing-object'); | |
16 | + | |
17 | + this.loadRecord(this.object); | |
18 | + }, | |
19 | + | |
20 | + /** | |
21 | + * Populate the comboBoxValue by the set of channel data related to the selected dimension | |
22 | + * @param {*} ref the reference of the current instance of this class | |
23 | + * @param {*} index dimension's index | |
24 | + * @param {*} comboBoxV the comboBoxValue | |
25 | + * @returns | |
26 | + */ | |
27 | + | |
28 | + | |
29 | + addComboSauvaudDim: (ref) => { | |
30 | + | |
31 | + const comboBoxDim = ref.addStandardCombo(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, | |
32 | + amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimlabel, [], | |
33 | + (name, newKey, oldKey) => { | |
34 | + | |
35 | + ref.populateSauvaudComboBoxValue(ref, newKey, this); | |
36 | + }); | |
37 | + | |
38 | + return comboBoxDim; | |
39 | + }, | |
40 | + | |
41 | + getSauvaudItems(){ | |
42 | + return [this.addComboSauvaudDim(this)]; | |
43 | + }, | |
44 | + | |
45 | + getFormItems: function () { | |
46 | + items = this.callParent(); | |
47 | + const ref = this; | |
48 | + const dataStore = [ | |
49 | + { 'key': 0, 'value': 'dim1' }, | |
50 | + { 'key': 1, 'value': 'dim2' }, | |
51 | + ]; | |
52 | + const dimField = this.addStandardCombo('right_dimension', 'Right Dim', dataStore , function (name, value, oldValue) { | |
53 | + if (ref.object.get('right_dim') != value) { | |
54 | + ref.object.set('right_dim', value); | |
55 | + } | |
56 | + }); | |
57 | + | |
58 | + items.splice(0,0, dimField); | |
59 | + return items; | |
60 | + }, | |
61 | + }); | |
0 | 62 | \ No newline at end of file | ... | ... |