Commit 866158846d3bbc718a2a9a3794bc47fbd395d66d

Authored by Menouard AZIB
1 parent 11b200e3

Quand on passe d'un panel à l'audre la combobox dim affiche les valeurs entières…

… au lieu des string  'dim1 et 'dim2 => corrigé. Et maintenant une valeur par défaut est séléctionnée pour la combobox type quand on active le bakcground subtracion
js/app/models/PlotObjects/PlotObjectConfig.js
... ... @@ -513,7 +513,7 @@ Ext.define('amdaPlotObj.PlotObjectConfig', {
513 513 textinputkey: "background_sub_by_value",
514 514 dimlabel: 'Dim ',
515 515 dimkey: 'background_sub_dim',
516   - dimNullValue: -1
  516 + dimNullValue: "-1"
517 517 }
518 518 },
519 519  
... ...
js/app/models/PlotObjects/PlotSpectroObject.js
... ... @@ -33,8 +33,8 @@ Ext.define('amdaPlotObj.PlotSpectroObject', {
33 33  
34 34 { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.name, type: 'boolean' },
35 35 { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, type: 'string' },
36   - { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, type: 'float' },
37   - { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, type: 'int' }
  36 + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, type: 'string' },
  37 + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, type: 'string' }
38 38 ],
39 39  
40 40 constructor: function () {
... ... @@ -68,7 +68,7 @@ Ext.define('amdaPlotObj.PlotSpectroObject', {
68 68  
69 69 this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.name, false);
70 70 this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, null);
71   - this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, -1);
  71 + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
72 72 this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
73 73 },
74 74  
... ...
js/app/views/PlotComponents/PlotSpectroForm.js
... ... @@ -222,7 +222,7 @@ Ext.define('amdaPlotComp.PlotSpectroForm', {
222 222 const comboBoxV = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key);
223 223  
224 224 if (newKey === amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue) {
225   - comboBoxV.setValue(-1);
  225 + comboBoxV.setValue(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
226 226 comboBoxV.setVisible(false);
227 227 return;
228 228 }
... ... @@ -259,9 +259,10 @@ Ext.define('amdaPlotComp.PlotSpectroForm', {
259 259 const field = this.addStandardFieldSet(amdaPlotObj.PlotObjectConfig.bgSubstraction.name,
260 260 amdaPlotObj.PlotObjectConfig.bgSubstraction.name, this.getBackgroundSubItems(),
261 261 function (name, newKey, oldKey) {
262   - if (newKey !== oldKey) {
263   - const comboBoxType = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key);
264   - comboBoxType.setValue(null);
  262 + const comboBoxType = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key);
  263 + comboBoxType.setValue(null);
  264 + if (newKey) {
  265 + comboBoxType.setValue(Object.keys(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values)[0]);
265 266 }
266 267 });
267 268  
... ...