Commit e9597b38cab466cc5560a23789e014a0e1c676cd

Authored by Menouar AZIB
1 parent 779f2914

Add comments to PlotFunctionIntervalSelection.js

js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js
1 Ext.define('amdaPlotComp.intervalSelection.PlotFunctionIntervalSelection', { 1 Ext.define('amdaPlotComp.intervalSelection.PlotFunctionIntervalSelection', {
2 - extend: 'amdaPlotComp.intervalSelection.IntervalSelection',  
3 - requires: ['amdaPlotComp.plotFunction.FunctionType'], 2 + extend: 'amdaPlotComp.intervalSelection.IntervalSelection', // This class extends from amdaPlotComp.intervalSelection.IntervalSelection
  3 + requires: ['amdaPlotComp.plotFunction.FunctionType'], // This class requires the FunctionType class from amdaPlotComp.plotFunction
4 4
5 - title: "Plot Function",  
6 - plotFunctionType: null, 5 + title: "Plot Function", // The title of this interval selection
  6 + plotFunctionType: null, // An instance of the FunctionType class, initially set to null
7 7
  8 + /**
  9 + * Initializes the component.
  10 + * It calls the parent's initComponent method, then creates a new instance of FunctionType and adds it to the form.
  11 + */
8 initComponent: function () { 12 initComponent: function () {
9 this.callParent(arguments); 13 this.callParent(arguments);
10 this.plotFunctionType = new amdaPlotComp.plotFunction.FunctionType(); 14 this.plotFunctionType = new amdaPlotComp.plotFunction.FunctionType();
11 this.form.add(this.plotFunctionType); 15 this.form.add(this.plotFunctionType);
12 }, 16 },
13 17
  18 + /**
  19 + * Applies the plot function based on the values of the fields.
  20 + * If the values are not valid, it shows a warning message.
  21 + * Otherwise, it calls the interactive plot with the plotFunction action and resets the host component selection.
  22 + */
14 _apply: function () { 23 _apply: function () {
15 if (this._notValidValues()) { 24 if (this._notValidValues()) {
16 myDesktopApp.warningMsg('Please note that either the Start Time or the Stop Time has not been defined. To proceed, ensure both times are properly set.'); 25 myDesktopApp.warningMsg('Please note that either the Start Time or the Stop Time has not been defined. To proceed, ensure both times are properly set.');