EmergencyStopWidget.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarXCore::ArmarXObjects::EmergencyStop
17 * @author Stefan Reither ( stef dot reither at web dot de )
18 * @date 2016
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <QAction>
26#include <QPushButton>
27#include <QToolButton>
28#include <QWidget>
29
30#include <IceUtil/UUID.h>
31
34
36
37class QLabel;
38class QGridLayout;
39class QShortcut;
40
41namespace armarx
42{
43 class ArmarXMainWindow;
44
46 public ArmarXComponentWidgetControllerTemplate<EmergencyStopWidget>,
47 public armarx::EmergencyStopListener
48
49 {
50 Q_OBJECT
51 public:
52 explicit EmergencyStopWidget(QWidget* parent = 0, ArmarXMainWindow* mainWindow = 0);
53 QWidget* getButtonWidget();
54 // void reportEmergencyStopState(EmergencyStopState, const Ice::Current&) override;
55
56 signals:
59
60 public slots:
61 void enableSS2();
62 void releaseSS2();
63 void clicked(bool = true);
64
65 // ManagedIceObject interface
66 protected:
67 void onInitComponent() override;
68 void onConnectComponent() override;
69 void onDisconnectComponent() override;
70 std::string getDefaultName() const override;
71
72 EmergencyStopState releaseSS2OnMaster() const;
73
74 private slots:
75 void setChecked(const EmergencyStopState);
76 void updateEmergencyStopState();
77
78 private:
79 ArmarXMainWindow* mainWindow;
80 QPixmap iconNormal;
81 QPixmap iconDark;
82
83 QToolButton* button;
84 QAction* emergencyStopAction;
85
86 EmergencyStopMasterInterfacePrx emergencyStopMasterPrx;
87 EmergencyStopState lastKnownEmergencyStopState;
88 QTimer* timer;
89
90 // ArmarXWidgetController interface
91 public:
92 static QString
94 {
95 return "EmergencyStopWidget";
96 }
97
98 void loadSettings(QSettings* settings) override;
99 void saveSettings(QSettings* settings) override;
100 std::string iceNameUUID = IceUtil::generateUUID();
101 // EmergencyStopListener interface
102
103 void reportEmergencyStopState(EmergencyStopState, const Ice::Current&) override;
104 };
105
107} // namespace armarx
The ArmarXMainWindow class.
void onInitComponent() override
Pure virtual hook for the subclass.
void onDisconnectComponent() override
Hook for subclass.
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
void reportEmergencyStopState(EmergencyStopState, const Ice::Current &) override
EmergencyStopState releaseSS2OnMaster() const
void onConnectComponent() override
Pure virtual hook for the subclass.
EmergencyStopWidget(QWidget *parent=0, ArmarXMainWindow *mainWindow=0)
std::string getDefaultName() const override
Retrieve default name of component.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< EmergencyStopWidget > EmergencyStopWidgetPtr