From e9597b38cab466cc5560a23789e014a0e1c676cd Mon Sep 17 00:00:00 2001
From: Menouar AZIB <menouar.azib@akka.eu>
Date: Tue, 24 Oct 2023 10:26:50 +0200
Subject: [PATCH] Add comments to PlotFunctionIntervalSelection.js

---
 js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js b/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js
index db3ffe8..ca08de3 100644
--- a/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js
+++ b/js/app/views/PlotComponents/intervalSelection/PlotFunctionIntervalSelection.js
@@ -1,16 +1,25 @@
 Ext.define('amdaPlotComp.intervalSelection.PlotFunctionIntervalSelection', {
-    extend: 'amdaPlotComp.intervalSelection.IntervalSelection',
-    requires: ['amdaPlotComp.plotFunction.FunctionType'],
+    extend: 'amdaPlotComp.intervalSelection.IntervalSelection', // This class extends from amdaPlotComp.intervalSelection.IntervalSelection
+    requires: ['amdaPlotComp.plotFunction.FunctionType'], // This class requires the FunctionType class from amdaPlotComp.plotFunction
 
-    title: "Plot Function",
-    plotFunctionType: null,
+    title: "Plot Function", // The title of this interval selection
+    plotFunctionType: null, // An instance of the FunctionType class, initially set to null
 
+    /**
+     * Initializes the component.
+     * It calls the parent's initComponent method, then creates a new instance of FunctionType and adds it to the form.
+     */
     initComponent: function () {
         this.callParent(arguments);
         this.plotFunctionType = new amdaPlotComp.plotFunction.FunctionType();
         this.form.add(this.plotFunctionType);
     },
 
+    /**
+     * Applies the plot function based on the values of the fields.
+     * If the values are not valid, it shows a warning message.
+     * Otherwise, it calls the interactive plot with the plotFunction action and resets the host component selection.
+     */
     _apply: function () {
         if (this._notValidValues()) {
             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.');
--
libgit2 0.21.2