YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
7#ifndef MAINWINDOW_H
8#define MAINWINDOW_H
9
11
12#include <QMainWindow>
13#include <QResizeEvent>
14#include <QLabel>
15#include <QTimer>
16#include <QAction>
17#include <QMutex>
18#include <QTreeWidget>
19#include <QGraphicsDropShadowEffect>
20
21#include "partitem.h"
22#include "sliderOptions.h"
23#include "modestreemanager.h"
24
25#include <vector>
26#include <string>
27
28namespace Ui {
29class MainWindow;
30}
31
32using namespace yarp::os;
33class MainWindow : public QMainWindow
34{
36
37public:
38 explicit MainWindow(QWidget *parent = 0);
39 bool init(std::vector<std::string> enabledParts,
44 std::string rcb_protocol);
46
47 void term();
48
49protected:
50 void closeEvent(QCloseEvent *event) override;
51private:
52 Ui::MainWindow* m_ui;
53 QTabWidget* m_tabPanel;
54 QToolBar* m_globalToolBar;
55 QToolBar* m_partToolBar;
56 QLabel* m_partName;
57 QTimer m_timer;
58 QMenu* m_currentPartMenu;
59 QMutex m_mutex;
60 int m_sequenceActiveCount;
61 sliderOptions* m_sliderOpt;
62 ResourceFinder m_finder;
63 std::string m_user_script1;
64 std::string m_user_script2;
65
66 QAction *m_goAll;
67 QAction *m_runAllSeq;
68 QAction *m_runAllSeqTime;
69 QAction *m_saveAllSeq;
70 QAction *m_loadAllSeq;
71 QAction *m_cycleAllSeq;
72 QAction *m_cycleAllSeqTime;
73 QAction *m_stopAllSeq;
74 QAction *m_idleAllParts;
75 QAction *m_runAllParts;
76 QAction *m_homeAllParts;
77 std::vector<QAction *> m_customPositionsAllParts;
78 std::vector<QAction *> m_customPositionsSinglePart;
79 std::vector<QAction *> m_customPositionsSinglePartToolbar;
80 QAction *openSequenceAction;
81 QAction *m_runSinglePart;
82 QAction *m_calibSinglePart;
83 QAction *m_homeSinglePart;
84 QAction *m_idleSinglePart;
85 QAction *m_script2;
86 QAction *m_script1;
87 ModesTreeManager *m_modesTreeManager;
88 QGraphicsDropShadowEffect *m_glowEffect;
89 QTimer m_glowTimer;
90
91private slots:
92 void onSequenceActivated();
93 void onSequenceStopped();
94 void onSaveAllSeq();
95 void onLoadAllSeq();
96 void onStopAllSeq();
97 void onCurrentPartChanged(int index);
98 void onOpenSequenceTab();
99 void onRunSinglePart();
100 void onRunAllParts();
101 void onRunTimeAllSeq();
102 void onRunAllSeq();
103 void onCycleAllSeq();
104 void onCycleTimeAllSeq();
105 void onUpdate();
106 void onIdleAllParts();
107 void onIdleSinglePart();
108 void onHomeSinglePart();
109 void onHomeAllParts();
110 void onHomeSinglePartToCustomPosition(const yarp::os::Bottle& positionElement);
111 void onHomeAllPartsToCustomPosition(const yarp::os::Bottle& positionElement);
112 void onCalibSinglePart();
113 void onGoAll();
114 void onExecuteScript1();
115 void onExecuteScript2();
116 void onViewGlobalToolbar(bool);
117 void onViewPartToolbar(bool);
118 void onViewSpeeds(bool);
119 void onViewCurrents(bool);
120 void onViewMotorPositions(bool);
121 void onViewDutyCycles(bool);
122 void onViewPositionTargetBox(bool);
123 void onViewPositionTargetValue(bool);
124 void onEnableControlVelocity(bool val);
125 void onEnableControlVelocityDirect(bool val);
126 void onEnableControlMixed(bool val);
127 void onEnableControlPositionDirect(bool val);
128 void onEnableControlPWM(bool val);
129 void onEnableControlCurrent(bool val);
130 void onEnableControlTorque(bool val);
131 void onSliderOptionsClicked();
132 void onSetPosSliderOptionMW(int, double, int);
133 void onSetVelSliderOptionMW(int, double, int);
134 void onSetAccSliderOptionMW(int, double, int);
135 void onSetTrqSliderOptionMW(int, double, int);
136 void onSetCurSliderOptionMW(int, double, int);
137 void onJointClicked(int partIndex, int jointIndex);
138 void onGlowTimerExpired();
139 void onPartDoubleClicked(int partIndex);
140
141signals:
153 void sig_setPosSliderOptionMW(int, double, int);
154 void sig_setVelSliderOptionMW(int, double, int);
155 void sig_setAccSliderOptionMW(int, double, int);
156 void sig_setTrqSliderOptionMW(int, double, int);
157 void sig_setCurSliderOptionMW(int, double, int);
161
162};
163
164#endif // MAINWINDOW_H
MainWindow class.
Definition display.h:22
void sig_enableControlMixed(bool)
void sig_enableControlPWM(bool)
void closeEvent(QCloseEvent *event) override
void sig_setAccSliderOptionMW(int, double, int)
void sig_enableControlVelocityDirect(bool)
void sig_setVelSliderOptionMW(int, double, int)
void sig_setPosSliderOptionMW(int, double, int)
void sig_enableControlTorque(bool)
void sig_enableControlVelocity(bool)
void init(yarp::os::Property config)
Init the application with the current configuration.
void sig_viewPositionTargetValue(bool)
void sig_viewSpeedValues(bool)
void sig_enableControlPositionDirect(bool)
MainWindow(QWidget *parent=0)
void sig_viewMotorPositions(bool)
void sig_internalClose()
void sig_viewDutyCycles(bool)
void sig_enableControlCurrent(bool)
void sig_viewCurrentValues(bool)
void sig_setCurSliderOptionMW(int, double, int)
void sig_setTrqSliderOptionMW(int, double, int)
void sig_viewPositionTargetBox(bool)
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:65
A mini-server for performing network communication in the background.
Helper class for finding config files and other external resources.
bool speedview_param_enabled
Definition main.cpp:35
bool debug_param_enabled
Definition main.cpp:34
bool enable_calib_all
Definition main.cpp:36
Definition aboutdlg.h:11
An interface to the operating system, including Port based communication.