Commit 2ac3a3f968f38d888ed8ddef163a852df1ac097a
1 parent
e4c1c74d
Exists in
master
and in
19 other branches
For now, histo1D working
Showing
8 changed files
with
183 additions
and
1 deletions
Show diff stats
generic_data/defaultValues.json
@@ -132,6 +132,11 @@ | @@ -132,6 +132,11 @@ | ||
132 | "ybinnumber":100, | 132 | "ybinnumber":100, |
133 | "smoothfactor":1 | 133 | "smoothfactor":1 |
134 | }, | 134 | }, |
135 | + "histogram1D":{ | ||
136 | + "histo1DFunction":"density", | ||
137 | + "xbinnumber":100, | ||
138 | + "color":"#FF0000" | ||
139 | + }, | ||
135 | "sauvaud":{ | 140 | "sauvaud":{ |
136 | "yAxis":"y-right", | 141 | "yAxis":"y-right", |
137 | "resolution":3000 | 142 | "resolution":3000 |
generic_data/defaultValuesConfig.json
@@ -38,7 +38,8 @@ | @@ -38,7 +38,8 @@ | ||
38 | { "key": "epochPlot", "value": "Epoch Plot" }, | 38 | { "key": "epochPlot", "value": "Epoch Plot" }, |
39 | { "key": "instantPlot", "value": "Instant Plot" }, | 39 | { "key": "instantPlot", "value": "Instant Plot" }, |
40 | { "key": "statusPlot", "value": "Status Plot" }, | 40 | { "key": "statusPlot", "value": "Status Plot" }, |
41 | - { "key": "tickPlot", "value": "Tick Plot" } | 41 | + { "key": "tickPlot", "value": "Tick Plot" }, |
42 | + { "key": "histoPlot", "value": "Histogram Plot" } | ||
42 | ], | 43 | ], |
43 | 44 | ||
44 | "availableFontNames": [ | 45 | "availableFontNames": [ |
@@ -254,6 +255,11 @@ | @@ -254,6 +255,11 @@ | ||
254 | { "key": "stadev", "value": "Standard Deviation" } | 255 | { "key": "stadev", "value": "Standard Deviation" } |
255 | ], | 256 | ], |
256 | 257 | ||
258 | + "availableHistogram1DFunctions": [ | ||
259 | + { "key": "density", "value": "Density" }, | ||
260 | + { "key": "normdensity", "value": "Normalised Density" } | ||
261 | + ], | ||
262 | + | ||
257 | "availableDimsOnXAxis": [ | 263 | "availableDimsOnXAxis": [ |
258 | { "key": "0", "value": "First dimension" }, | 264 | { "key": "0", "value": "First dimension" }, |
259 | { "key": "1", "value": "Second dimension" } | 265 | { "key": "1", "value": "Second dimension" } |
generic_data/defaultValuesLinks.json
@@ -226,6 +226,11 @@ | @@ -226,6 +226,11 @@ | ||
226 | "type":"combobox", | 226 | "type":"combobox", |
227 | "store":"availableHistogram2DFunctions" | 227 | "store":"availableHistogram2DFunctions" |
228 | }, | 228 | }, |
229 | + "plot.histogram1D.histo1DFunction": | ||
230 | + { | ||
231 | + "type":"combobox", | ||
232 | + "store":"availableHistogram1DFunctions" | ||
233 | + }, | ||
229 | "plot.sauvaud.yAxis": | 234 | "plot.sauvaud.yAxis": |
230 | { | 235 | { |
231 | "type":"combobox", | 236 | "type":"combobox", |
js/app/models/PlotObjects/PlotHistogram1DSerieObject.js
0 โ 100644
@@ -0,0 +1,58 @@ | @@ -0,0 +1,58 @@ | ||
1 | +/** | ||
2 | + * Project : TMA-AMDA | ||
3 | + * Name : PlotHistogram1DSerieObject.js | ||
4 | + * @class amdaPlotObj.PlotHistogram1DSerieObject | ||
5 | + * @extends amdaPlotObj.PlotBaseSerieObject | ||
6 | + * @brief Plot Histogram1D Business Object Definition | ||
7 | + * @author Furkan Erdogan | ||
8 | + * @version $Id: PlotHistogram1DSerieObject.js furkan $ | ||
9 | + ****************************************************************************** | ||
10 | + * FT Id : Date : Name - Description | ||
11 | + ****************************************************************************** | ||
12 | + * : :08/02/2023: FER - file creation | ||
13 | + */ | ||
14 | + | ||
15 | + | ||
16 | +Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', { | ||
17 | + extend: 'amdaPlotObj.PlotBaseSerieObject', | ||
18 | + requires: ['amdaPlotObj.PlotAxisObject'], | ||
19 | + fields : [ | ||
20 | + // {name: 'serie-xaxis-param', type: 'string'}, | ||
21 | + // {name: 'serie-resampling-mode', type: 'string'}, | ||
22 | + {name: 'histo1d-function', type: 'string'}, | ||
23 | + {name: 'histo1d-xbinnumber', type: 'int'}, | ||
24 | + {name: 'histo1d-color', type: 'string', defaultValue: "none"} | ||
25 | + ], | ||
26 | + | ||
27 | + constructor: function(){ | ||
28 | + var me = this; | ||
29 | + me.callParent(arguments); | ||
30 | + }, | ||
31 | + | ||
32 | + setDefaultValues: function() | ||
33 | + { | ||
34 | + // this.set('serie-xaxis-param', ''); | ||
35 | + // this.set('serie-resampling-mode', amdaDefaultValues.plot.serie.resamplingMode); | ||
36 | + this.set('histo1d-function', amdaDefaultValues.plot.histogram1D.histo1DFunction); | ||
37 | + // this.set('histotype-param', ''); | ||
38 | + this.set('histo1d-xbinnumber', amdaDefaultValues.plot.histogram1D.xbinnumber); | ||
39 | + this.set('histo1d-color', amdaDefaultValues.plot.histogram1D.color); | ||
40 | + | ||
41 | + this.callParent(arguments); | ||
42 | + }, | ||
43 | + | ||
44 | + getJsonValues : function() | ||
45 | + { | ||
46 | + var serieValues = this.callParent(arguments); | ||
47 | + // serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param'); | ||
48 | + // serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode'); | ||
49 | + serieValues['histo1d-function'] = this.get('histo1d-function'); | ||
50 | + // serieValues['histotype-param'] = this.get('histotype-param'); | ||
51 | + serieValues['histo1d-xbinnumber'] = this.get('histo1d-xbinnumber'); | ||
52 | + serieValues['histo1d-color'] = this.get('histo1d-color'); | ||
53 | + // serieValues['histo1D-ybinnumber'] = this.get('histo1D-ybinnumber'); | ||
54 | + // serieValues['histo1D-smoothfactor'] = this.get('histo1D-smoothfactor'); | ||
55 | + | ||
56 | + return serieValues; | ||
57 | + } | ||
58 | +}); |
js/app/models/PlotObjects/PlotPanelObject.js
@@ -248,6 +248,7 @@ Ext.define('amdaPlotObj.PlotPanelObject', { | @@ -248,6 +248,7 @@ Ext.define('amdaPlotObj.PlotPanelObject', { | ||
248 | recs = this.axes().add({id : 'color'}); | 248 | recs = this.axes().add({id : 'color'}); |
249 | recs[0].setDefaultValues('color'); | 249 | recs[0].setDefaultValues('color'); |
250 | break; | 250 | break; |
251 | + case 'histoPlot': | ||
251 | case 'xyPlot' : | 252 | case 'xyPlot' : |
252 | //X Axis | 253 | //X Axis |
253 | var recs = this.axes().add({id : 'xaxis_id'}); | 254 | var recs = this.axes().add({id : 'xaxis_id'}); |
js/app/models/PlotObjects/PlotParamObject.js
@@ -21,6 +21,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { | @@ -21,6 +21,7 @@ Ext.define('amdaPlotObj.PlotParamObject', { | ||
21 | 'amdaPlotObj.PlotSerieObject', | 21 | 'amdaPlotObj.PlotSerieObject', |
22 | 'amdaPlotObj.PlotOrbitSerieObject', | 22 | 'amdaPlotObj.PlotOrbitSerieObject', |
23 | 'amdaPlotObj.PlotHistogram2DSerieObject', | 23 | 'amdaPlotObj.PlotHistogram2DSerieObject', |
24 | + 'amdaPlotObj.PlotHistogram1DSerieObject', | ||
24 | 'amdaPlotObj.PlotSpectroObject', | 25 | 'amdaPlotObj.PlotSpectroObject', |
25 | 'amdaPlotObj.PlotSauvaudObject', | 26 | 'amdaPlotObj.PlotSauvaudObject', |
26 | 'amdaPlotObj.PlotStatusBarObject', | 27 | 'amdaPlotObj.PlotStatusBarObject', |
@@ -75,6 +76,8 @@ Ext.define('amdaPlotObj.PlotParamObject', { | @@ -75,6 +76,8 @@ Ext.define('amdaPlotObj.PlotParamObject', { | ||
75 | return new amdaPlotObj.PlotSerieObject(data); | 76 | return new amdaPlotObj.PlotSerieObject(data); |
76 | case 'histogram2d' : | 77 | case 'histogram2d' : |
77 | return new amdaPlotObj.PlotHistogram2DSerieObject(data); | 78 | return new amdaPlotObj.PlotHistogram2DSerieObject(data); |
79 | + case 'histogram1d' : | ||
80 | + return new amdaPlotObj.PlotHistogram1DSerieObject(data); | ||
78 | case 'orbit-serie' : | 81 | case 'orbit-serie' : |
79 | return new amdaPlotObj.PlotOrbitSerieObject(data); | 82 | return new amdaPlotObj.PlotOrbitSerieObject(data); |
80 | case 'spectro' : | 83 | case 'spectro' : |
@@ -135,6 +138,11 @@ Ext.define('amdaPlotObj.PlotParamObject', { | @@ -135,6 +138,11 @@ Ext.define('amdaPlotObj.PlotParamObject', { | ||
135 | {'key' : 'orbit-serie', 'value' : 'Orbit Serie'}, | 138 | {'key' : 'orbit-serie', 'value' : 'Orbit Serie'}, |
136 | {'key' : 'histogram2d', 'value' : '2D Histogram'} | 139 | {'key' : 'histogram2d', 'value' : '2D Histogram'} |
137 | ]; | 140 | ]; |
141 | + case 'histoPlot' : | ||
142 | + return [ | ||
143 | + {'key' : 'histogram1d', 'value' : 'Histogram'}, | ||
144 | + {'key' : 'histogram2d', 'value' : '2D Histogram'} | ||
145 | + ]; | ||
138 | case 'instantPlot' : | 146 | case 'instantPlot' : |
139 | return [ | 147 | return [ |
140 | {'key' : 'iserie', 'value' : 'Serie'}, | 148 | {'key' : 'iserie', 'value' : 'Serie'}, |
js/app/views/PlotComponents/PlotHistogram1DSerieForm.js
0 โ 100644
@@ -0,0 +1,95 @@ | @@ -0,0 +1,95 @@ | ||
1 | +/** | ||
2 | + * Project : TMA-AMDA | ||
3 | + * Name : PlotHistogram1DSerieForm.js | ||
4 | + * @class amdaPlotComp.PlotHistogram1DSerieForm | ||
5 | + * @extends amdaPlotComp.PlotBaseSerieForm | ||
6 | + * @brief Form to define specifics histogram1d serie options | ||
7 | + * @author Furkan Erdogan | ||
8 | + * @version $Id: PlotHistogram1DSerieForm.js furkan $ | ||
9 | + */ | ||
10 | + | ||
11 | +Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', { | ||
12 | + extend: 'amdaPlotComp.PlotBaseSerieForm', | ||
13 | + | ||
14 | + setObject: function (object) { | ||
15 | + this.callParent(arguments); | ||
16 | + }, | ||
17 | + | ||
18 | + setParentObject: function (parentObject) { | ||
19 | + this.callParent(arguments); | ||
20 | + this.updateAxesRanges(parentObject); | ||
21 | + | ||
22 | + }, | ||
23 | + | ||
24 | + updateAxesRanges: function(parentObject) { | ||
25 | + var xAxisObj = parentObject.axes().getById('xaxis_id'); | ||
26 | + | ||
27 | + this.getForm().findField('histo1d-xmin').setValue(xAxisObj.get('axis-range-min')); | ||
28 | + this.getForm().findField('histo1d-xmax').setValue(xAxisObj.get('axis-range-max')); | ||
29 | + }, | ||
30 | + | ||
31 | + getRangeForms: function(){ | ||
32 | + var me = this; | ||
33 | + return { | ||
34 | + xtype: 'fieldset', | ||
35 | + bodyStyle: { background: '#dfe8f6' }, | ||
36 | + title: 'X ranges', | ||
37 | + name: 'histo1d-ranges', | ||
38 | + renderTo: Ext.getBody(), | ||
39 | + fieldDefaults: { | ||
40 | + labelAlign: 'right', | ||
41 | + msgTarget: 'side', | ||
42 | + labelWidth: 40, | ||
43 | + }, | ||
44 | + defaults: { | ||
45 | + xtype: 'panel', | ||
46 | + bodyStyle: {background: '#dfe8f6'}, | ||
47 | + flex: 1, | ||
48 | + border:false, | ||
49 | + layout: 'anchor', | ||
50 | + }, | ||
51 | + layout:'hbox', | ||
52 | + frame: true, | ||
53 | + //bodyPadding: '5 5 5 5', | ||
54 | + items: | ||
55 | + [{ | ||
56 | + items:[ | ||
57 | + me.addStandardFloat2('histo1d-xmin', 'X Min', -Number.MAX_VALUE, Number.MAX_VALUE, false, false, function(name, newValue, oldValue){ | ||
58 | + me.parentObject.axes().getById('xaxis_id').set('axis-range-min', newValue); | ||
59 | + }) | ||
60 | + ] | ||
61 | + }, | ||
62 | + { | ||
63 | + items:[ | ||
64 | + me.addStandardFloat2('histo1d-xmax', 'X Max', -Number.MAX_VALUE, Number.MAX_VALUE, false, false, function(name, newValue, oldValue){ | ||
65 | + me.parentObject.axes().getById('xaxis_id').set('axis-range-max', newValue); | ||
66 | + }) | ||
67 | + ] | ||
68 | + }] | ||
69 | + }; | ||
70 | + | ||
71 | + }, | ||
72 | + getFormItems: function() { | ||
73 | + var me = this; | ||
74 | + | ||
75 | + var histogram1DItems = [ | ||
76 | + // this.addStandardParamDropTarget('serie-xaxis-param', 'X Parameter', function(name, value, oldValue) { | ||
77 | + // me.object.set('serie-xaxis-param', value); | ||
78 | + // me.crtTree.refresh(); | ||
79 | + // }), | ||
80 | + me.getRangeForms(), | ||
81 | + // this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaDefaultConfigs.availableResamplingModes), | ||
82 | + this.addStandardCombo('histo1d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram1DFunctions, function(name, value, oldValue) { | ||
83 | + me.object.set('histo1d-function', value); | ||
84 | + }), | ||
85 | + // this.addStandardParamDropTarget('histotype-param', 'Z Parameter', function(name, value, oldValue) { | ||
86 | + // me.object.set('histotype-param', value); | ||
87 | + // me.crtTree.refresh(); | ||
88 | + // }), | ||
89 | + this.addStandardInteger('histo1d-xbinnumber', 'Nb. of bins'), | ||
90 | + this.addColorsPicker('histo1d-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none') | ||
91 | + | ||
92 | + ]; | ||
93 | + return histogram1DItems; | ||
94 | + } | ||
95 | +}); |
js/app/views/PlotComponents/PlotParamForm.js
@@ -15,6 +15,7 @@ Ext.define('amdaPlotComp.PlotParamForm', { | @@ -15,6 +15,7 @@ Ext.define('amdaPlotComp.PlotParamForm', { | ||
15 | 'amdaPlotComp.PlotSerieForm', | 15 | 'amdaPlotComp.PlotSerieForm', |
16 | 'amdaPlotComp.PlotOrbitSerieForm', | 16 | 'amdaPlotComp.PlotOrbitSerieForm', |
17 | 'amdaPlotComp.PlotHistogram2DSerieForm', | 17 | 'amdaPlotComp.PlotHistogram2DSerieForm', |
18 | + 'amdaPlotComp.PlotHistogram1DSerieForm', | ||
18 | 'amdaPlotComp.PlotSpectroForm', | 19 | 'amdaPlotComp.PlotSpectroForm', |
19 | 'amdaPlotComp.PlotSauvaudForm', | 20 | 'amdaPlotComp.PlotSauvaudForm', |
20 | 'amdaPlotComp.PlotStatusBarForm', | 21 | 'amdaPlotComp.PlotStatusBarForm', |
@@ -67,6 +68,9 @@ Ext.define('amdaPlotComp.PlotParamForm', { | @@ -67,6 +68,9 @@ Ext.define('amdaPlotComp.PlotParamForm', { | ||
67 | case 'histogram2d': | 68 | case 'histogram2d': |
68 | this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotHistogram2DSerieForm({ id: formId })); | 69 | this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotHistogram2DSerieForm({ id: formId })); |
69 | break; | 70 | break; |
71 | + case 'histogram1d': | ||
72 | + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotHistogram1DSerieForm({ id: formId })); | ||
73 | + break; | ||
70 | case 'sauvaud': | 74 | case 'sauvaud': |
71 | if(this.object.get('type') !=2){ | 75 | if(this.object.get('type') !=2){ |
72 | myDesktopApp.warningMsg('Sauvaud Plot requires <b>2D Parameter</b> '); | 76 | myDesktopApp.warningMsg('Sauvaud Plot requires <b>2D Parameter</b> '); |