cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
mtsSystemQtWidget.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
Author(s): Anton Deguet
6
Created on: 2013-05-17
7
8
(C) Copyright 2013-2023 Johns Hopkins University (JHU), All Rights Reserved.
9
10
--- begin cisst license - do not edit ---
11
12
This software is provided "as is" under an open source license, with
13
no warranty. The complete license can be found in license.txt and
14
http://www.cisst.org/cisst/license.txt.
15
16
--- end cisst license ---
17
*/
18
19
20
#ifndef _mtsSystemQtWidget_h
21
#define _mtsSystemQtWidget_h
22
23
#include <
cisstMultiTask/mtsComponent.h
>
24
25
#include <QTextEdit>
26
27
#include <
cisstMultiTask/mtsMessageQtWidget.h
>
28
#include <
cisstMultiTask/mtsIntervalStatisticsQtWidget.h
>
29
30
// Always include last
31
#include <
cisstMultiTask/mtsExportQt.h
>
32
33
// Widget without the component, can be included in another widget
34
class
CISST_EXPORT
mtsSystemQtWidget
:
public
QWidget
35
{
36
Q_OBJECT;
37
38
public
:
39
mtsSystemQtWidget
(
const
std::string & name =
"mtsSystemQtWidget"
);
40
inline
virtual
~mtsSystemQtWidget
() {}
41
42
void
SetInterfaceRequired
(
mtsInterfaceRequired
* interfaceRequired);
43
void
setupUi
(
void
);
44
void
SetValue
(
const
mtsIntervalStatistics
& value);
45
46
protected
:
47
mtsMessageQtWidget
*
QMMessage
;
48
mtsIntervalStatisticsQtWidget
*
QMIntervalStatistics
;
49
};
50
51
// Widget with a component, can be used directly with cisstMultiTask component manager
52
class
CISST_EXPORT
mtsSystemQtWidgetComponent
:
public
mtsSystemQtWidget
,
public
mtsComponent
53
{
54
Q_OBJECT;
55
CMN_DECLARE_SERVICES(
CMN_DYNAMIC_CREATION_ONEARG
,
CMN_LOG_ALLOW_DEFAULT
);
56
57
public
:
58
mtsSystemQtWidgetComponent
(
const
std::string & componentName,
double
periodInSeconds = 50.0 *
cmn_ms
);
59
~mtsSystemQtWidgetComponent
() {}
60
61
inline
void
Configure
(
const
std::string &
CMN_UNUSED
(filename) =
""
)
override
{};
62
void
Startup
(
void
)
override
;
63
inline
void
Cleanup
(
void
)
override
{};
64
65
private
slots:
66
void
timerEvent(QTimerEvent * event)
override
;
67
68
private
:
69
int
TimerPeriodInMilliseconds;
70
mtsFunctionRead
period_statistics;
71
mtsIntervalStatistics
IntervalStatistics;
72
};
73
74
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsSystemQtWidgetComponent
);
75
76
#endif
// _mtsSystemQtWidget_h
mtsComponent::mtsComponent
mtsComponent(void)
mtsFunctionRead
Definition
mtsFunctionRead.h:37
mtsInterfaceRequired
Definition
mtsInterfaceRequired.h:83
mtsIntervalStatistics
Definition
mtsIntervalStatistics.h:45
mtsIntervalStatisticsQtWidget
Definition
mtsIntervalStatisticsQtWidget.h:34
mtsMessageQtWidget
Definition
mtsMessageQtWidget.h:32
mtsSystemQtWidgetComponent
Definition
mtsSystemQtWidget.h:53
mtsSystemQtWidgetComponent::~mtsSystemQtWidgetComponent
~mtsSystemQtWidgetComponent()
Definition
mtsSystemQtWidget.h:59
mtsSystemQtWidgetComponent::Cleanup
void Cleanup(void) override
Definition
mtsSystemQtWidget.h:63
mtsSystemQtWidgetComponent::Startup
void Startup(void) override
mtsSystemQtWidgetComponent::Configure
void Configure(const std::string &CMN_UNUSED(filename)="") override
Definition
mtsSystemQtWidget.h:61
mtsSystemQtWidgetComponent::mtsSystemQtWidgetComponent
mtsSystemQtWidgetComponent(const std::string &componentName, double periodInSeconds=50.0 *cmn_ms)
mtsSystemQtWidget::QMIntervalStatistics
mtsIntervalStatisticsQtWidget * QMIntervalStatistics
Definition
mtsSystemQtWidget.h:48
mtsSystemQtWidget::setupUi
void setupUi(void)
mtsSystemQtWidget::SetInterfaceRequired
void SetInterfaceRequired(mtsInterfaceRequired *interfaceRequired)
mtsSystemQtWidget::mtsSystemQtWidget
mtsSystemQtWidget(const std::string &name="mtsSystemQtWidget")
mtsSystemQtWidget::SetValue
void SetValue(const mtsIntervalStatistics &value)
mtsSystemQtWidget::QMMessage
mtsMessageQtWidget * QMMessage
Definition
mtsSystemQtWidget.h:47
mtsSystemQtWidget::~mtsSystemQtWidget
virtual ~mtsSystemQtWidget()
Definition
mtsSystemQtWidget.h:40
CMN_DYNAMIC_CREATION_ONEARG
const int CMN_DYNAMIC_CREATION_ONEARG
Definition
cmnClassRegisterMacros.h:330
CMN_DECLARE_SERVICES_INSTANTIATION
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition
cmnClassRegisterMacros.h:199
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
CMN_LOG_ALLOW_DEFAULT
#define CMN_LOG_ALLOW_DEFAULT
Definition
cmnLogLoD.h:76
CMN_UNUSED
#define CMN_UNUSED(argument)
Definition
cmnPortability.h:497
cmn_ms
const double cmn_ms
Definition
cmnUnits.h:190
mtsComponent.h
Declaration of mtsComponent.
mtsExportQt.h
Rules of exporting.
mtsIntervalStatisticsQtWidget.h
mtsMessageQtWidget.h
Generated by
1.18.0