Commit 5b3c2c8a2f759adbf2f02b0f4df3f76af548f3e7

Authored by Hacene SI HADJ MOHAND
1 parent 08a4a1b9

ihm for sauvaud plot

js/app/models/PlotObjects/PlotObjectConfig.js
... ... @@ -144,6 +144,10 @@ Ext.define('amdaPlotObj.PlotObjectConfig', {
144 144 yAxis: 'y-left',
145 145 resolution: 3000
146 146 },
  147 + sauvaud: {
  148 + yAxis: 'y-right',
  149 + resolution: 3000
  150 + },
147 151 legends: {
148 152 series: {
149 153 type: 'text-only',
... ...
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;
... ...
js/app/models/PlotObjects/PlotSauvaudObject.js 0 → 100644
... ... @@ -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,9 @@ 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 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSauvaudForm({ id: formId }));
  68 + break;
65 69 case 'spectro':
66 70 this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSpectroForm({ id: formId }));
67 71 break;
... ...
js/app/views/PlotComponents/PlotSauvaudForm.js 0 → 100644
... ... @@ -0,0 +1,43 @@
  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 +
  14 + getFormItems: function () {
  15 + items = this.callParent();
  16 + const ref = this;
  17 + /**
  18 + const newDataForStore = [];
  19 + for (indexTable in ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName]) {
  20 + const table = ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][indexTable];
  21 + let item = {};
  22 + item[keyTemp] = indexTable;
  23 + item[valueTemp] = table[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableRelatedDim];
  24 + newDataForStore.push(item);
  25 + }
  26 + console.log(newDataForStore);
  27 + this.getFilteringItems();
  28 +*/
  29 + var availableDims = [];
  30 + availableDims = [
  31 + { 'key': 0, 'value': 'Dim1' },
  32 + { 'key': 1, 'value': 'Dim2' }
  33 + ];
  34 + const dimField = this.addStandardCombo('right_dimension', 'Right Dim', availableDims, function (name, value, oldValue) {
  35 + if (ref.object.get('right_dim') != value) {
  36 + ref.object.set('right_dim', value);
  37 + }
  38 + });
  39 +
  40 + items.splice(0,0, dimField);
  41 + return items;
  42 + },
  43 + });
0 44 \ No newline at end of file
... ...