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,
43 bool enable_calib_all);
45
46 void term();
47
48protected:
49 void closeEvent(QCloseEvent *event) override;
50private:
51 Ui::MainWindow* m_ui;
52 QTabWidget* m_tabPanel;
53 QToolBar* m_globalToolBar;
54 QToolBar* m_partToolBar;
55 QLabel* m_partName;
56 QTimer m_timer;
57 QMenu* m_currentPartMenu;
58 QMutex m_mutex;
59 int m_sequenceActiveCount;
60 sliderOptions* m_sliderOpt;
61 ResourceFinder m_finder;
62 std::string m_user_script1;
63 std::string m_user_script2;
64
65 QAction *m_goAll;
66 QAction *m_runAllSeq;
67 QAction *m_runAllSeqTime;
68 QAction *m_saveAllSeq;
69 QAction *m_loadAllSeq;
70 QAction *m_cycleAllSeq;
71 QAction *m_cycleAllSeqTime;
72 QAction *m_stopAllSeq;
73 QAction *m_idleAllParts;
74 QAction *m_runAllParts;
75 QAction *m_homeAllParts;
76 std::vector<QAction *> m_customPositionsAllParts;
77 std::vector<QAction *> m_customPositionsSinglePart;
78 std::vector<QAction *> m_customPositionsSinglePartToolbar;
79 QAction *openSequenceAction;
80 QAction *m_runSinglePart;
81 QAction *m_calibSinglePart;
82 QAction *m_homeSinglePart;
83 QAction *m_idleSinglePart;
84 QAction *m_script2;
85 QAction *m_script1;
86 ModesTreeManager *m_modesTreeManager;
87 QGraphicsDropShadowEffect *m_glowEffect;
88 QTimer m_glowTimer;
89
90private slots:
91 void onSequenceActivated();
92 void onSequenceStopped();
93 void onSaveAllSeq();
94 void onLoadAllSeq();
95 void onStopAllSeq();
96 void onCurrentPartChanged(int index);
97 void onOpenSequenceTab();
98 void onRunSinglePart();
99 void onRunAllParts();
100 void onRunTimeAllSeq();
101 void onRunAllSeq();
102 void onCycleAllSeq();
103 void onCycleTimeAllSeq();
104 void onUpdate();
105 void onIdleAllParts();
106 void onIdleSinglePart();
107 void onHomeSinglePart();
108 void onHomeAllParts();
109 void onHomeSinglePartToCustomPosition(const yarp::os::Bottle& positionElement);
110 void onHomeAllPartsToCustomPosition(const yarp::os::Bottle& positionElement);
111 void onCalibSinglePart();
112 void onGoAll();
113 void onExecuteScript1();
114 void onExecuteScript2();
115 void onViewGlobalToolbar(bool);
116 void onViewPartToolbar(bool);
117 void onViewSpeeds(bool);
118 void onViewCurrents(bool);
119 void onViewMotorPositions(bool);
120 void onViewDutyCycles(bool);
121 void onViewPositionTargetBox(bool);
122 void onViewPositionTargetValue(bool);
123 void onEnableControlVelocity(bool val);
124 void onEnableControlMixed(bool val);
125 void onEnableControlPositionDirect(bool val);
126 void onEnableControlPWM(bool val);
127 void onEnableControlCurrent(bool val);
128 void onSliderOptionsClicked();
129 void onSetPosSliderOptionMW(int, double, int);
130 void onSetVelSliderOptionMW(int, double);
131 void onSetTrqSliderOptionMW(int, double);
132 void onJointClicked(int partIndex, int jointIndex);
133 void onGlowTimerExpired();
134 void onPartDoubleClicked(int partIndex);
135
136signals:
146 void sig_setPosSliderOptionMW(int, double, int);
147 void sig_setVelSliderOptionMW(int, double);
148 void sig_setTrqSliderOptionMW(int, double);
152
153};
154
155#endif // MAINWINDOW_H
MainWindow class.
Definition display.h:22
void sig_enableControlMixed(bool)
void sig_enableControlPWM(bool)
void closeEvent(QCloseEvent *event) override
void sig_setPosSliderOptionMW(int, double, int)
void sig_setVelSliderOptionMW(int, double)
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_setTrqSliderOptionMW(int, double)
void sig_viewMotorPositions(bool)
void sig_internalClose()
void sig_viewDutyCycles(bool)
void sig_enableControlCurrent(bool)
void sig_viewCurrentValues(bool)
void sig_viewPositionTargetBox(bool)
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
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.