Commit 1a92b96fb59e2a38e1e75c88ee9316f87f23cf87

Authored by Benjamin Renard
2 parents d4543515 f4f37147

Merge branch 'FER_11100' into amdadev

generic_data/defaultValues.json
@@ -133,6 +133,11 @@ @@ -133,6 +133,11 @@
133 "ybinnumber":100, 133 "ybinnumber":100,
134 "smoothfactor":1 134 "smoothfactor":1
135 }, 135 },
  136 + "histogram1D":{
  137 + "histo1DFunction":"density",
  138 + "xbinnumber":100,
  139 + "color":"#FF0000"
  140 + },
136 "sauvaud":{ 141 "sauvaud":{
137 "yAxis":"y-right", 142 "yAxis":"y-right",
138 "resolution":3000 143 "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": [
@@ -261,6 +262,11 @@ @@ -261,6 +262,11 @@
261 { "key": "stadev", "value": "Standard Deviation" } 262 { "key": "stadev", "value": "Standard Deviation" }
262 ], 263 ],
263 264
  265 + "availableHistogram1DFunctions": [
  266 + { "key": "density", "value": "Density" },
  267 + { "key": "normdensity", "value": "Normalised Density" }
  268 + ],
  269 +
264 "availableDimsOnXAxis": [ 270 "availableDimsOnXAxis": [
265 { "key": "0", "value": "First dimension" }, 271 { "key": "0", "value": "First dimension" },
266 { "key": "1", "value": "Second dimension" } 272 { "key": "1", "value": "Second dimension" }
generic_data/defaultValuesLinks.json
@@ -231,6 +231,11 @@ @@ -231,6 +231,11 @@
231 "type":"combobox", 231 "type":"combobox",
232 "store":"availableHistogram2DFunctions" 232 "store":"availableHistogram2DFunctions"
233 }, 233 },
  234 + "plot.histogram1D.histo1DFunction":
  235 + {
  236 + "type":"combobox",
  237 + "store":"availableHistogram1DFunctions"
  238 + },
234 "plot.sauvaud.yAxis": 239 "plot.sauvaud.yAxis":
235 { 240 {
236 "type":"combobox", 241 "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' :
@@ -132,9 +135,13 @@ Ext.define('amdaPlotObj.PlotParamObject', { @@ -132,9 +135,13 @@ Ext.define('amdaPlotObj.PlotParamObject', {
132 case 'xyPlot' : 135 case 'xyPlot' :
133 return [ 136 return [
134 {'key' : 'serie', 'value' : 'Serie'}, 137 {'key' : 'serie', 'value' : 'Serie'},
135 - {'key' : 'orbit-serie', 'value' : 'Orbit Serie'},  
136 - {'key' : 'histogram2d', 'value' : '2D Histogram'} 138 + {'key' : 'orbit-serie', 'value' : 'Orbit Serie'}
137 ]; 139 ];
  140 + case 'histoPlot' :
  141 + return [
  142 + {'key' : 'histogram1d', 'value' : '1D Histogram'},
  143 + {'key' : 'histogram2d', 'value' : '2D Histogram'}
  144 + ];
138 case 'instantPlot' : 145 case 'instantPlot' :
139 return [ 146 return [
140 {'key' : 'iserie', 'value' : 'Serie'}, 147 {'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> ');