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 <
ArmarXGui/libraries/ArmarXGuiBase/ArmarXComponentWidgetController.h
>
26
#include <
ArmarXCore/components/EmergencyStop/EmergencyStop.h
>
27
#include <
ArmarXCore/core/services/tasks/PeriodicTask.h
>
28
#include <IceUtil/UUID.h>
29
30
#include <QWidget>
31
#include <QAction>
32
#include <QPushButton>
33
#include <QToolButton>
34
35
class
QLabel;
36
class
QGridLayout;
37
class
QShortcut;
38
39
namespace
armarx
40
{
41
class
ArmarXMainWindow;
42
43
class
EmergencyStopWidget
:
44
public
ArmarXComponentWidgetControllerTemplate
<EmergencyStopWidget>,
45
public
armarx::EmergencyStopListener
46
{
47
Q_OBJECT
48
public
:
49
explicit
EmergencyStopWidget
(QWidget* parent = 0,
ArmarXMainWindow
* mainWindow = 0);
50
QWidget*
getButtonWidget
();
51
52
public
slots:
53
void
clicked
(
bool
=
true
);
54
55
// ManagedIceObject interface
56
protected
:
57
void
onInitComponent
()
override
;
58
void
onConnectComponent
()
override
;
59
void
onDisconnectComponent
()
override
;
60
std::string
getDefaultName
()
const override
;
61
62
private
slots:
63
void
setChecked(
const
EmergencyStopState);
64
65
private
:
66
ArmarXMainWindow
* mainWindow;
67
QGridLayout* layout;
68
QPixmap iconNormal;
69
QPixmap iconDark;
70
QToolButton* button;
71
QAction* emergencyStopAction;
72
QShortcut* emergencyStopShortcut;
73
74
EmergencyStopMasterInterfacePrx emergencyStopMasterPrx;
75
76
using
clock_t = std::chrono::high_resolution_clock;
77
static
constexpr std::chrono::milliseconds deactivationWaitPeriod{2500};
78
clock_t::time_point timeLastActivated;
79
80
// ArmarXWidgetController interface
81
public
:
82
static
QString
GetWidgetName
()
83
{
84
return
"EmergencyStopWidget"
;
85
}
86
void
loadSettings
(QSettings* settings)
override
;
87
void
saveSettings
(QSettings* settings)
override
;
88
std::string
iceNameUUID
= IceUtil::generateUUID();
89
// EmergencyStopListener interface
90
public
:
91
void
reportEmergencyStopState
(EmergencyStopState,
const
Ice::Current&)
override
;
92
};
93
using
EmergencyStopWidgetPtr
=
IceInternal::Handle <EmergencyStopWidget>
;
94
}
armarx::EmergencyStopWidget::GetWidgetName
static QString GetWidgetName()
Definition:
EmergencyStopWidget.h:82
armarx::EmergencyStopWidget::EmergencyStopWidget
EmergencyStopWidget(QWidget *parent=0, ArmarXMainWindow *mainWindow=0)
Definition:
EmergencyStopWidget.cpp:34
armarx::ArmarXMainWindow
The ArmarXMainWindow class.
Definition:
ArmarXMainWindow.h:80
PeriodicTask.h
armarx::ArmarXComponentWidgetControllerTemplate
Definition:
ArmarXComponentWidgetController.h:69
armarx::EmergencyStopWidget::saveSettings
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition:
EmergencyStopWidget.cpp:97
armarx::EmergencyStopWidget::reportEmergencyStopState
void reportEmergencyStopState(EmergencyStopState, const Ice::Current &) override
Definition:
EmergencyStopWidget.cpp:102
armarx::EmergencyStopWidget::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition:
EmergencyStopWidget.cpp:79
IceInternal::Handle< EmergencyStopWidget >
armarx::EmergencyStopWidget::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition:
EmergencyStopWidget.cpp:86
ArmarXComponentWidgetController.h
armarx::EmergencyStopWidget::getButtonWidget
QWidget * getButtonWidget()
Definition:
EmergencyStopWidget.cpp:68
EmergencyStop.h
armarx::EmergencyStopWidget::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition:
EmergencyStopWidget.cpp:73
armarx::EmergencyStopWidget::clicked
void clicked(bool=true)
Definition:
EmergencyStopWidget.cpp:107
armarx::EmergencyStopWidget
Definition:
EmergencyStopWidget.h:43
armarx::EmergencyStopWidget::iceNameUUID
std::string iceNameUUID
Definition:
EmergencyStopWidget.h:88
armarx::EmergencyStopWidget::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition:
EmergencyStopWidget.cpp:92
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:28
armarx::EmergencyStopWidget::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition:
EmergencyStopWidget.cpp:128
ArmarXGui
applications
ArmarXGui
Widgets
EmergencyStopWidget.h
Generated on Wed Feb 8 2023 10:48:52 for armarx_documentation by
1.8.17