[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 16/24: qtgui: fixed number display for qwt
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 16/24: qtgui: fixed number display for qwt 5.2, 6.0, and 6.1. |
Date: |
Tue, 18 Mar 2014 17:51:41 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 20c83953f6f79fa6d440a87159bb067b6996cca4
Author: Tom Rondeau <address@hidden>
Date: Mon Mar 17 16:34:26 2014 -0400
qtgui: fixed number display for qwt 5.2, 6.0, and 6.1.
---
gr-qtgui/lib/numberdisplayform.cc | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/gr-qtgui/lib/numberdisplayform.cc
b/gr-qtgui/lib/numberdisplayform.cc
index 599310c..3efbaec 100644
--- a/gr-qtgui/lib/numberdisplayform.cc
+++ b/gr-qtgui/lib/numberdisplayform.cc
@@ -40,18 +40,30 @@ NumberDisplayForm::NumberDisplayForm(int nplots,
gr::qtgui::graph_t type,
d_indicator.push_back(new QwtThermo());
d_indicator[i]->setScale(-1, 1);
+
+#if QWT_VERSION < 0x060100
+#else
d_indicator[i]->setOriginMode(QwtThermo::OriginCustom);
d_indicator[i]->setOrigin(0.0);
+#endif /* if QWT_VERSION < 0x060100 */
switch(type) {
case(gr::qtgui::NUM_GRAPH_HORIZ):
+#if QWT_VERSION < 0x060100
+ d_indicator[i]->setOrientation(Qt::Horizontal, QwtThermo::BottomScale);
+#else
d_indicator[i]->setOrientation(Qt::Horizontal);
+#endif /* if QWT_VERSION < 0x060100 */
d_layout->addWidget(d_label[i], 2*i, 0);
d_layout->addWidget(d_text_box[i], 2*i, 1);
d_layout->addWidget(d_indicator[i], 2*i+1, 1);
break;
case(gr::qtgui::NUM_GRAPH_VERT):
+#if QWT_VERSION < 0x060100
+ d_indicator[i]->setOrientation(Qt::Vertical, QwtThermo::LeftScale);
+#else
d_indicator[i]->setOrientation(Qt::Vertical);
+#endif /* if QWT_VERSION < 0x060100 */
d_layout->addWidget(d_label[i], 0, i);
d_layout->addWidget(d_text_box[i], 1, i);
d_layout->addWidget(d_indicator[i], 2, i);
@@ -223,7 +235,6 @@ NumberDisplayForm::newData(const QEvent* updateEvent)
d_max[i] = std::max(d_max[i], samples[i]);
if(d_autoscale_state) {
- //d_indicator[i]->setRange(d_min[i], d_max[i], false);
d_indicator[i]->setScale(d_min[i], d_max[i]);
}
}
@@ -250,14 +261,22 @@ NumberDisplayForm::setGraphType(const gr::qtgui::graph_t
type)
switch(d_graph_type) {
case(gr::qtgui::NUM_GRAPH_HORIZ):
+#if QWT_VERSION < 0x060100
+ d_indicator[i]->setOrientation(Qt::Horizontal, QwtThermo::BottomScale);
+#else
d_indicator[i]->setOrientation(Qt::Horizontal);
+#endif /* if QWT_VERSION < 0x060100 */
d_indicator[i]->setVisible(true);
d_layout->addWidget(d_label[i], 2*i, 0);
d_layout->addWidget(d_text_box[i], 2*i, 1);
d_layout->addWidget(d_indicator[i], 2*i+1, 1);
break;
case(gr::qtgui::NUM_GRAPH_VERT):
+#if QWT_VERSION < 0x060100
+ d_indicator[i]->setOrientation(Qt::Vertical, QwtThermo::LeftScale);
+#else
d_indicator[i]->setOrientation(Qt::Vertical);
+#endif /* if QWT_VERSION < 0x060100 */
d_indicator[i]->setVisible(true);
d_layout->addWidget(d_label[i], 0, i);
d_layout->addWidget(d_text_box[i], 1, i);
@@ -279,7 +298,12 @@ NumberDisplayForm::setColor(int which, const QColor &min,
const QColor &max)
{
QwtLinearColorMap *map = new QwtLinearColorMap();
map->setColorInterval(min, max);
+
+#if QWT_VERSION < 0x060000
+ d_indicator[which]->setFillColor(max);
+#else
d_indicator[which]->setColorMap(map);
+#endif /* QWT_VERSION < 0x060000 */
}
void
@@ -353,15 +377,23 @@ NumberDisplayForm::graphType() const
QColor
NumberDisplayForm::colorMin(int which) const
{
+#if QWT_VERSION < 0x060000
+ return d_indicator[which]->fillColor();
+#else
QwtLinearColorMap *map =
static_cast<QwtLinearColorMap*>(d_indicator[which]->colorMap());
return map->color1();
+#endif /* QWT_VERSION < 0x060000 */
}
QColor
NumberDisplayForm::colorMax(int which) const
{
+#if QWT_VERSION < 0x060000
+ return d_indicator[which]->fillColor();
+#else
QwtLinearColorMap *map =
static_cast<QwtLinearColorMap*>(d_indicator[which]->colorMap());
return map->color2();
+#endif /* QWT_VERSION < 0x060000 */
}
std::string
@@ -398,6 +430,7 @@ void
NumberDisplayForm::autoScale(bool on)
{
d_autoscale_state = on;
+ d_autoscale_act->setChecked(on);
// Reset the autoscale limits
for(int i = 0; i < d_nplots; i++) {
- [Commit-gnuradio] [gnuradio] 03/24: Move correlate_access_code_tag_bb to non-deprecated GRC category and deprecate the older correlate_access_code_bb., (continued)
- [Commit-gnuradio] [gnuradio] 03/24: Move correlate_access_code_tag_bb to non-deprecated GRC category and deprecate the older correlate_access_code_bb., git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 20/24: Merge remote-tracking branch 'skoslowski/grc_show_missing_blocks', git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 09/24: grc: tabbed PropsDialog, git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 19/24: Merge remote-tracking branch 'gnuradio-wg-grc/grc_pygtk_backw_compat_fixes', git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 12/24: grc: special colors for missing blocks, git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 18/24: qtgui: fixes number sink to handle Python/C++ exposure (see: 6a78af5919133 and d9dbb6b489deb), git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 22/24: qtgui: fixing up a few minor details; include file and ability to set accumulate checkable on startup., git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 10/24: Merge branch 'qtgui_numsink', git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 02/24: Simplify correlate_access_code_tag_bb and fix bug leading to false trigger., git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 23/24: Merge remote-tracking branch 'mbant/doxygen-updates', git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 16/24: qtgui: fixed number display for qwt 5.2, 6.0, and 6.1.,
git <=
- [Commit-gnuradio] [gnuradio] 08/24: gr-qtgui: Expose the qwidget() method in the public interface, git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 21/24: Merge remote-tracking branch 'bistromath/corr_tag', git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 24/24: Merge branch 'maint', git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 01/24: docs: Updated Doxy files, added search bar, git, 2014/03/18
- [Commit-gnuradio] [gnuradio] 13/24: qtgui: adding a 'config' tab to qtgui sinks to set display/line config options (style, width, colors, etc.), git, 2014/03/18