|
@@ -3,11 +3,6 @@
|
3
|
3
|
#include "qcustomplot.h"
|
4
|
4
|
#include <cmath>
|
5
|
5
|
|
6
|
|
-/// \fn XYPlotWindow::XYPlotWindow(QWidget *parent)
|
7
|
|
-/// \~English
|
8
|
|
-/// \brief Constructor
|
9
|
|
-/// \~Spanish
|
10
|
|
-/// \brief Constructor
|
11
|
6
|
XYPlotWindow::XYPlotWindow(QWidget *parent) :
|
12
|
7
|
QMainWindow(parent),
|
13
|
8
|
ui(new Ui::XYPlotWindow)
|
|
@@ -16,25 +11,14 @@ XYPlotWindow::XYPlotWindow(QWidget *parent) :
|
16
|
11
|
}
|
17
|
12
|
|
18
|
13
|
|
19
|
|
-/// \fn void XYPlotWindow::AddPointToGraph(double x, double y)
|
20
|
|
-/// \~English
|
21
|
|
-/// \brief Adds a coordinate (x,y) to the XX and YY vectors.
|
22
|
|
-/// \param x value of the coordinate (x,y) to be added to vector XX.
|
23
|
|
-/// \param y value of the coordinate (x,y) to be added to vector YY.
|
24
|
|
-/// \~Spanish
|
25
|
|
-/// \brief Anade una coordenada (x,y) a los vectores XX y YY.
|
26
|
|
-/// \param x valor de la coordenada (x,y) a ser anadido al vector XX.
|
27
|
|
-/// \param y valor de la coordenada (x,y) a ser anadido al vector YY.
|
|
14
|
+// Añade la x y y a sus respectivos vectores.
|
28
|
15
|
void XYPlotWindow::AddPointToGraph(double x, double y) {
|
29
|
16
|
XX.push_back(x);
|
30
|
17
|
YY.push_back(y);
|
31
|
18
|
}
|
32
|
19
|
|
33
|
|
-/// \fn void XYPlotWindow::Plot()
|
34
|
|
-/// \~English
|
35
|
|
-/// \brief Plots the coordinates inserted in the vectors XX and YY.
|
36
|
|
-/// \~Spanish
|
37
|
|
-/// \brief Grafica las coordenadas insertadas en los vectores XX y YY.
|
|
20
|
+// Esta función invoca los métodos apropiados de customPlot para que
|
|
21
|
+// se grafiquen los puntos.
|
38
|
22
|
void XYPlotWindow::Plot() {
|
39
|
23
|
ui->customPlot->xAxis->setLabel("x");
|
40
|
24
|
ui->customPlot->yAxis->setLabel("y");
|
|
@@ -46,11 +30,6 @@ void XYPlotWindow::Plot() {
|
46
|
30
|
myCurve->setData(XX,YY);
|
47
|
31
|
}
|
48
|
32
|
|
49
|
|
-/// \fn XYPlotWindow::~XYPlotWindow()
|
50
|
|
-/// \~English
|
51
|
|
-/// \brief Destructor
|
52
|
|
-/// \~Spanish
|
53
|
|
-/// \brief Destructor
|
54
|
33
|
XYPlotWindow::~XYPlotWindow()
|
55
|
34
|
{
|
56
|
35
|
delete ui;
|