YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
qtyarpscope.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: GPL-3.0-or-later
4 */
5
6#ifndef QTYARPSCOPE_H
7#define QTYARPSCOPE_H
8
9#include <QtQuick>
10#include <yarp/os/Network.h>
11#include "simpleloader.h"
12#include "plotmanager.h"
13#include <QTimer>
14#include <QMutex>
15#include <qcustomplot.h>
16
26class QtYARPScope : public QQuickPaintedItem
27{
28 Q_OBJECT
29 Q_DISABLE_COPY(QtYARPScope)
30
31public:
32 QtYARPScope(QQuickItem *parent = 0);
33 Q_INVOKABLE bool parseParameters(QStringList params);
34 Q_INVOKABLE void clear();
35 Q_INVOKABLE void rescale();
36 Q_INVOKABLE void changeInterval(int interval);
37 Q_INVOKABLE void playPressed(int check);
39 void usage();
40 void paint(QPainter *painter) override;
41
42
43
44
45protected:
46 void routeMouseEvents( QMouseEvent* event);
47 void routeMouseEvents( QWheelEvent* event);
48
49 void mousePressEvent( QMouseEvent* event) override;
50 void mouseReleaseEvent( QMouseEvent* event) override;
51 void mouseMoveEvent( QMouseEvent* event) override;
52 void mouseDoubleClickEvent( QMouseEvent* event) override;
53 void wheelEvent(QWheelEvent* event) override;
54
55private:
56 //QCustomPlot m_CustomPlot;
57 QTimer timer;
58 int i;
59
61 GenericLoader *loader;
62 PlotManager *plotManager;
63 QObject *topLevel;
64 QMutex mutex;
65 QRectF zoomRect;
66 bool bPressed;
67 QRectF currentSelectedPlotterRect;
68 Plotter *currentSelectedPlotter;
69
70
71signals:
72 void setWindowTitle(QString title);
73 void setWindowPosition(int x, int y);
74 void setWindowSize(int w, int h);
75 void intervalLoaded(int interval);
76
77private slots:
78 void graphClicked( QCPAbstractPlottable* plottable );
79 void updateCustomPlotSize();
80 void onRepaint();
81};
82
83#endif // QTYARPSCOPE_H
Base Class for the Loaders.
The Manager of the plotters.
Definition plotmanager.h:19
Class representing a Plotter.
Definition plotter.h:115
The plugin Core class.
Definition qtyarpscope.h:27
void mouseMoveEvent(QMouseEvent *event) override
the mouse move event
void intervalLoaded(int interval)
void mouseDoubleClickEvent(QMouseEvent *event) override
the mouse double click event
void usage()
Prints the help menu.
Q_INVOKABLE bool parseParameters(QStringList params)
parse the parameters received from the main container in QstringList form
void paint(QPainter *painter) override
paint method.
Q_INVOKABLE void rescale()
rescales the graphs in order to contains the maximum and minimum value visible in the window
Q_INVOKABLE void changeInterval(int interval)
changes the refresh interval
void routeMouseEvents(QMouseEvent *event)
this function is used to route the mouse events on the core plugin to the relative QCustomPlot.
Q_INVOKABLE void clear()
clears the data in the current window
void setWindowSize(int w, int h)
void setWindowTitle(QString title)
void mouseReleaseEvent(QMouseEvent *event) override
the mouse release event
void setWindowPosition(int x, int y)
void mousePressEvent(QMouseEvent *event) override
the mouse press event
Q_INVOKABLE void playPressed(int check)
plays or pauses the data flow
void wheelEvent(QWheelEvent *event) override
the wheel mouse event
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition Network.h:706
The main, catch-all namespace for YARP.
Definition dirs.h:16