CurveDataConfigWidget.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2015 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
19 #include <ui_CurveDataConfigWidget.h>
20 
22 
23 namespace rqt_multiplot {
24 
25 /*****************************************************************************/
26 /* Constructors and Destructor */
27 /*****************************************************************************/
28 
30  QWidget(parent),
31  ui_(new Ui::CurveDataConfigWidget()),
32  config_(0) {
33  ui_->setupUi(this);
34 
35  ui_->spinBoxCircularBufferCapacity->setEnabled(false);
36  ui_->doubleSpinBoxTimeFrameLength->setEnabled(false);
37 
38  connect(ui_->radioButtonVector, SIGNAL(toggled(bool)), this,
39  SLOT(radioButtonVectorToggled(bool)));
40  connect(ui_->radioButtonList, SIGNAL(toggled(bool)), this,
41  SLOT(radioButtonListToggled(bool)));
42  connect(ui_->radioButtonCircularBuffer, SIGNAL(toggled(bool)), this,
44  connect(ui_->radioButtonTimeFrame, SIGNAL(toggled(bool)), this,
45  SLOT(radioButtonTimeFrameToggled(bool)));
46 
47  connect(ui_->spinBoxCircularBufferCapacity, SIGNAL(valueChanged(int)),
49  connect(ui_->doubleSpinBoxTimeFrameLength, SIGNAL(valueChanged(double)),
50  this, SLOT(doubleSpinBoxTimeFrameLengthValueChanged(double)));
51 }
52 
54  delete ui_;
55 }
56 
57 /*****************************************************************************/
58 /* Accessors */
59 /*****************************************************************************/
60 
62  if (config != config_) {
63  if (config_) {
64  disconnect(config_, SIGNAL(typeChanged(int)), this,
65  SLOT(configTypeChanged(int)));
66  disconnect(config_, SIGNAL(circularBufferCapacityChanged(size_t)),
67  this, SLOT(configCircularBufferCapacityChanged(size_t)));
68  disconnect(config_, SIGNAL(timeFrameLengthChanged(double)),
69  this, SLOT(configTimeFrameLengthChanged(double)));
70  }
71 
72  config_ = config;
73 
74  if (config) {
75  connect(config, SIGNAL(typeChanged(int)), this,
76  SLOT(configTypeChanged(int)));
77  connect(config, SIGNAL(circularBufferCapacityChanged(size_t)),
78  this, SLOT(configCircularBufferCapacityChanged(size_t)));
79  connect(config, SIGNAL(timeFrameLengthChanged(double)),
80  this, SLOT(configTimeFrameLengthChanged(double)));
81 
82  configTypeChanged(config->getType());
84  getCircularBufferCapacity());
86  }
87  }
88 }
89 
91  return config_;
92 }
93 
94 /*****************************************************************************/
95 /* Slots */
96 /*****************************************************************************/
97 
99  if (type == CurveDataConfig::List)
100  ui_->radioButtonList->setChecked(true);
101  else if (type == CurveDataConfig::CircularBuffer)
102  ui_->radioButtonCircularBuffer->setChecked(true);
103  else if (type == CurveDataConfig::TimeFrame)
104  ui_->radioButtonTimeFrame->setChecked(true);
105  else
106  ui_->radioButtonVector->setChecked(true);
107 }
108 
110  capacity) {
111  ui_->spinBoxCircularBufferCapacity->setValue(capacity);
112 }
113 
115  ui_->doubleSpinBoxTimeFrameLength->setValue(length);
116 }
117 
119  if (config_ && checked)
121 }
122 
124  if (config_ && checked)
126 }
127 
129  ui_->spinBoxCircularBufferCapacity->setEnabled(checked);
130 
131  if (config_ && checked)
133 }
134 
136  ui_->doubleSpinBoxTimeFrameLength->setEnabled(checked);
137 
138  if (config_ && checked)
140 }
141 
143  int value) {
144  if (config_)
146 }
147 
149  double value) {
150  if (config_) {
151  config_->setTimeFrameLength(value);
152  }
153 }
154 
155 }
void setCircularBufferCapacity(size_t capacity)
void configCircularBufferCapacityChanged(size_t capacity)
void setTimeFrameLength(double length)
void setConfig(CurveDataConfig *range)


rqt_multiplot_plugin
Author(s): Ralf Kaestner
autogenerated on Fri Jan 15 2021 03:47:53