From 866158846d3bbc718a2a9a3794bc47fbd395d66d Mon Sep 17 00:00:00 2001 From: Menouar AZIB Date: Fri, 26 Nov 2021 09:37:58 +0100 Subject: [PATCH] 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 | 2 +- js/app/models/PlotObjects/PlotSpectroObject.js | 6 +++--- js/app/views/PlotComponents/PlotSpectroForm.js | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/js/app/models/PlotObjects/PlotObjectConfig.js b/js/app/models/PlotObjects/PlotObjectConfig.js index 09c6b0e..497f9df 100644 --- a/js/app/models/PlotObjects/PlotObjectConfig.js +++ b/js/app/models/PlotObjects/PlotObjectConfig.js @@ -513,7 +513,7 @@ Ext.define('amdaPlotObj.PlotObjectConfig', { textinputkey: "background_sub_by_value", dimlabel: 'Dim ', dimkey: 'background_sub_dim', - dimNullValue: -1 + dimNullValue: "-1" } }, diff --git a/js/app/models/PlotObjects/PlotSpectroObject.js b/js/app/models/PlotObjects/PlotSpectroObject.js index 17af7c7..3b76bc7 100644 --- a/js/app/models/PlotObjects/PlotSpectroObject.js +++ b/js/app/models/PlotObjects/PlotSpectroObject.js @@ -33,8 +33,8 @@ Ext.define('amdaPlotObj.PlotSpectroObject', { { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.name, type: 'boolean' }, { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, type: 'string' }, - { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, type: 'float' }, - { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, type: 'int' } + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, type: 'string' }, + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, type: 'string' } ], constructor: function () { @@ -68,7 +68,7 @@ Ext.define('amdaPlotObj.PlotSpectroObject', { this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.name, false); this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, null); - this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, -1); + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue); this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue); }, diff --git a/js/app/views/PlotComponents/PlotSpectroForm.js b/js/app/views/PlotComponents/PlotSpectroForm.js index 9a46009..801e225 100644 --- a/js/app/views/PlotComponents/PlotSpectroForm.js +++ b/js/app/views/PlotComponents/PlotSpectroForm.js @@ -222,7 +222,7 @@ Ext.define('amdaPlotComp.PlotSpectroForm', { const comboBoxV = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key); if (newKey === amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue) { - comboBoxV.setValue(-1); + comboBoxV.setValue(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue); comboBoxV.setVisible(false); return; } @@ -259,9 +259,10 @@ Ext.define('amdaPlotComp.PlotSpectroForm', { const field = this.addStandardFieldSet(amdaPlotObj.PlotObjectConfig.bgSubstraction.name, amdaPlotObj.PlotObjectConfig.bgSubstraction.name, this.getBackgroundSubItems(), function (name, newKey, oldKey) { - if (newKey !== oldKey) { - const comboBoxType = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key); - comboBoxType.setValue(null); + const comboBoxType = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key); + comboBoxType.setValue(null); + if (newKey) { + comboBoxType.setValue(Object.keys(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values)[0]); } }); -- libgit2 0.21.2