cisst-saw
Loading...
Searching...
No Matches
prmInputDataQtWidget.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: 2019-01-03
7
8 (C) Copyright 2019-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#ifndef _prmInputDataQtWidget_h
20#define _prmInputDataQtWidget_h
21
22#include <QWidget>
23
29
30// Always include last
32
33class QSpinBox;
34
36{
37 Q_OBJECT;
38
39public:
40 prmInputDataQtWidget(const std::string & name = "prmInputDataQtWidget");
42
43 inline void setupUi(void) {};
44
47 void SetValue(const prmInputData & newValue);
48
49private slots:
50 void SlotPlotIndex(int newAxis);
51
52protected:
55
58 QSpinBox * QSBPlotIndex;
60};
61
62// Widget with a component, can be used directly with cisstMultiTask component manager
64{
65 Q_OBJECT;
67
68public:
69 prmInputDataQtWidgetComponent(const std::string & componentName, double periodInSeconds = 50.0 * cmn_ms);
71
72 inline void Configure(const std::string & CMN_UNUSED(filename) = "") override {};
73 void Startup(void) override;
74 inline void Cleanup(void) override {};
75
76signals:
78private slots:
79 void timerEvent(QTimerEvent * event) override;
80 void SlotInputDataEvent(prmInputData);
81private:
82 void InputDataEventHandler(const prmInputData & inputData);
83 int TimerPeriodInMilliseconds;
84 prmInputData mInputData;
85};
86
88
90
91#endif // _prmInputDataQtWidget_h
mtsComponent(void)
Definition prmInputData.h:36
Definition prmInputDataQtWidget.h:64
~prmInputDataQtWidgetComponent()
Definition prmInputDataQtWidget.h:70
void SignalInputDataEvent(prmInputData)
prmInputDataQtWidgetComponent(const std::string &componentName, double periodInSeconds=50.0 *cmn_ms)
void Configure(const std::string &CMN_UNUSED(filename)="") override
Definition prmInputDataQtWidget.h:72
void Startup(void) override
void Cleanup(void) override
Definition prmInputDataQtWidget.h:74
vctQtWidgetDynamicVectorDoubleRead * QVRAnalogInputsWidget
Definition prmInputDataQtWidget.h:53
prmInputDataQtWidget(const std::string &name="prmInputDataQtWidget")
void setupUi(void)
Definition prmInputDataQtWidget.h:43
vctPlot2DOpenGLQtWidget * QVPlot
Definition prmInputDataQtWidget.h:56
int PlotIndex
Definition prmInputDataQtWidget.h:59
void SetValue(const prmInputData &newValue)
QSpinBox * QSBPlotIndex
Definition prmInputDataQtWidget.h:58
vctPlot2DBase::Signal * AnalogSignal
Definition prmInputDataQtWidget.h:57
vctQtWidgetDynamicVectorBoolRead * QVRDigitalInputsWidget
Definition prmInputDataQtWidget.h:54
~prmInputDataQtWidget(void)
Definition prmInputDataQtWidget.h:41
Definition vctPlot2DBase.h:55
Definition vctPlot2DOpenGLQtWidget.h:29
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
Declaration of units and unit conversion methods.
const double cmn_ms
Definition cmnUnits.h:190
Declaration of mtsComponent.
Q_DECLARE_METATYPE(prmInputData)
vctQtWidgetDynamicVectorReadInteger< bool > vctQtWidgetDynamicVectorBoolRead
Definition vctForwardDeclarationsQt.h:43
vctQtWidgetDynamicVectorReadFloating< double > vctQtWidgetDynamicVectorDoubleRead
Definition vctForwardDeclarationsQt.h:39