cisst-saw
Loading...
Searching...
No Matches
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
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19
20#ifndef _mtsSystemQtWidget_h
21#define _mtsSystemQtWidget_h
22
24
25#include <QTextEdit>
26
29
30// Always include last
32
33// Widget without the component, can be included in another widget
34class CISST_EXPORT mtsSystemQtWidget: public QWidget
35{
36 Q_OBJECT;
37
38public:
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
46protected:
49};
50
51// Widget with a component, can be used directly with cisstMultiTask component manager
53{
54 Q_OBJECT;
56
57public:
58 mtsSystemQtWidgetComponent(const std::string & componentName, double periodInSeconds = 50.0 * cmn_ms);
60
61 inline void Configure(const std::string & CMN_UNUSED(filename) = "") override {};
62 void Startup(void) override;
63 inline void Cleanup(void) override {};
64
65private slots:
66 void timerEvent(QTimerEvent * event) override;
67
68private:
69 int TimerPeriodInMilliseconds;
70 mtsFunctionRead period_statistics;
71 mtsIntervalStatistics IntervalStatistics;
72};
73
75
76#endif // _mtsSystemQtWidget_h
mtsComponent(void)
Definition mtsFunctionRead.h:37
Definition mtsInterfaceRequired.h:83
Definition mtsIntervalStatistics.h:45
Definition mtsIntervalStatisticsQtWidget.h:34
Definition mtsMessageQtWidget.h:32
Definition mtsSystemQtWidget.h:53
~mtsSystemQtWidgetComponent()
Definition mtsSystemQtWidget.h:59
void Cleanup(void) override
Definition mtsSystemQtWidget.h:63
void Startup(void) override
void Configure(const std::string &CMN_UNUSED(filename)="") override
Definition mtsSystemQtWidget.h:61
mtsSystemQtWidgetComponent(const std::string &componentName, double periodInSeconds=50.0 *cmn_ms)
mtsIntervalStatisticsQtWidget * QMIntervalStatistics
Definition mtsSystemQtWidget.h:48
void setupUi(void)
void SetInterfaceRequired(mtsInterfaceRequired *interfaceRequired)
mtsSystemQtWidget(const std::string &name="mtsSystemQtWidget")
void SetValue(const mtsIntervalStatistics &value)
mtsMessageQtWidget * QMMessage
Definition mtsSystemQtWidget.h:47
virtual ~mtsSystemQtWidget()
Definition mtsSystemQtWidget.h:40
const int CMN_DYNAMIC_CREATION_ONEARG
Definition cmnClassRegisterMacros.h:330
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
#define CMN_UNUSED(argument)
Definition cmnPortability.h:497
const double cmn_ms
Definition cmnUnits.h:190
Declaration of mtsComponent.
Rules of exporting.