summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2019-04-06 17:21:40 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2019-04-06 17:21:40 -0500
commitc866f91716ca2c9b9acb286867651fdea0ad46a1 (patch)
tree9d105bbd770571c4a4665e70ee5db26fa7b3e41e
parentd0de8d578fef4375a728e693936c342b43ac37a9 (diff)
downloadulab-c866f91716ca2c9b9acb286867651fdea0ad46a1.tar.gz
ulab-c866f91716ca2c9b9acb286867651fdea0ad46a1.zip
Enhance horizontal cursor labels in scope zoom widget
-rw-r--r--clients/tde/src/part/scope/part.cpp1
-rw-r--r--clients/tde/src/widgets/tracewidget.cpp15
-rw-r--r--clients/tde/src/widgets/tracewidget.h3
3 files changed, 18 insertions, 1 deletions
diff --git a/clients/tde/src/part/scope/part.cpp b/clients/tde/src/part/scope/part.cpp
index 1995e85..44dbb84 100644
--- a/clients/tde/src/part/scope/part.cpp
+++ b/clients/tde/src/part/scope/part.cpp
@@ -565,6 +565,7 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *
m_traceWidget->setCursorActiveTraceList(4, activeTraces);
m_traceWidget->setZoomBoxEnabled(true);
+ m_base->traceZoomWidget->setHorizontalRangeModeAbsolute(false);
m_base->traceZoomWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
connect(m_traceWidget, SIGNAL(zoomBoxChanged(const TQRectF&)), this, SLOT(updateZoomWidgetLimits(const TQRectF&)));
connect(m_traceWidget, SIGNAL(offsetChanged(uint, double)), m_base->traceZoomWidget, SLOT(setTraceOffset(uint, double)));
diff --git a/clients/tde/src/widgets/tracewidget.cpp b/clients/tde/src/widgets/tracewidget.cpp
index 6ce3fa2..f875571 100644
--- a/clients/tde/src/widgets/tracewidget.cpp
+++ b/clients/tde/src/widgets/tracewidget.cpp
@@ -1374,7 +1374,12 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) {
#if 0
m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>%1<br>@%2,%3</qt>").arg(m_base->m_traceArray[trace]->traceName).arg(TraceWidget::prettyFormat(realCursorXPosition, horizontal_range, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits)));
#else
- m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>@%2,%3</qt>").arg(TraceWidget::prettyFormat(realCursorXPosition, (m_base->m_useAbsoluteHorizontalRange)?m_base->m_traceArray[trace]->rightEdge:horizontal_range, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits)));
+ if (m_base->m_useAbsoluteHorizontalRange) {
+ m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>@%2,%3</qt>").arg(TraceWidget::prettyFormat(realCursorXPosition, m_base->m_traceArray[trace]->rightEdge, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits)));
+ }
+ else {
+ m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>@%2[%3+%4],%5</qt>").arg(TraceWidget::prettyFormat(realCursorXPosition, m_base->m_traceArray[trace]->rightEdge, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(m_base->m_traceArray[trace]->leftEdge, m_base->m_traceArray[trace]->rightEdge, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorXPosition - m_base->m_traceArray[trace]->leftEdge, horizontal_range, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits)));
+ }
#endif
m_base->m_traceArray[trace]->graphStatusLabelInner->setText(m_base->m_traceArray[trace]->graphStatusLabel->text());
}
@@ -2469,6 +2474,14 @@ void TraceWidget::setTraceTextOffset(uint traceNumber, double offset) {
setTraceOffset(traceNumber, offset, false);
}
+bool TraceWidget::horizontalRangeModeAbsolute() {
+ return m_useAbsoluteHorizontalRange;
+}
+
+void TraceWidget::setHorizontalRangeModeAbsolute(bool absolute) {
+ m_useAbsoluteHorizontalRange = absolute;
+}
+
void TraceWidget::setTraceTextOffset(uint traceNumber, double offset, bool deferUpdate) {
VERIFY_TRACE_ARRAY_SIZE
diff --git a/clients/tde/src/widgets/tracewidget.h b/clients/tde/src/widgets/tracewidget.h
index 2f58891..7f63307 100644
--- a/clients/tde/src/widgets/tracewidget.h
+++ b/clients/tde/src/widgets/tracewidget.h
@@ -320,6 +320,9 @@ class TraceWidget : public TQWidget
double traceTextOffset(uint traceNumber);
void setTraceTextOffset(uint traceNumber, double offset, bool deferUpdate);
+ bool horizontalRangeModeAbsolute();
+ void setHorizontalRangeModeAbsolute(bool absolute=true);
+
bool userIsInteractingWithCursor();
static TQString prettyFormat(double value, double rangeDetectValue, TQString baseUnits, unsigned int precision=3);