PlotSauvaudForm.js 1.81 KB
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


Ext.define('amdaPlotComp.PlotSauvaudForm', {
	extend: 'amdaPlotComp.PlotSpectroForm', 
        	requires: [
		'amdaUI.ParamArgumentsUI'
	],
        setObject: function (object) {
		this.data = object.data;
		this.object = object.get('param-drawing-object');

		this.loadRecord(this.object);
	},
        
        	/**
	 * Populate the comboBoxValue by the set of channel data related to the selected dimension
	 * @param {*} ref  the reference of the current instance of this class
	 * @param {*} index dimension's index
	 * @param {*} comboBoxV  the comboBoxValue
	 * @returns 
	 */

        
  	addComboSauvaudDim: (ref) => {

		const comboBoxDim = ref.addStandardCombo(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey,
			amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimlabel, [],
			(name, newKey, oldKey) => {

					ref.populateSauvaudComboBoxValue(ref, newKey, this);
			});

		return comboBoxDim;
	},

           getSauvaudItems(){
                return [this.addComboSauvaudDim(this)];
            },
        
        getFormItems: function () {
             items = this.callParent();
            const ref = this;
           const dataStore = [
                                              { 'key': 0, 'value': 'dim1' },
		      { 'key': 1, 'value': 'dim2' }, 
                                            ];
            const dimField = this.addStandardCombo('right_dimension', 'Switch Dimension', dataStore , function (name, value, oldValue) {
				if (ref.object.get('right_dim') != value) {
					ref.object.set('right_dim', value);
				}
			});
        
           items.splice(0,0, dimField);
            return items;
        },
    });