diff options
Diffstat (limited to 'clients')
-rw-r--r-- | clients/tde/src/part/scope/part.cpp | 27 | ||||
-rw-r--r-- | clients/tde/src/widgets/tracewidget.cpp | 5 | ||||
-rw-r--r-- | clients/tde/src/widgets/tracewidget.h | 4 |
3 files changed, 21 insertions, 15 deletions
diff --git a/clients/tde/src/part/scope/part.cpp b/clients/tde/src/part/scope/part.cpp index a3400c4..387c901 100644 --- a/clients/tde/src/part/scope/part.cpp +++ b/clients/tde/src/part/scope/part.cpp @@ -623,10 +623,10 @@ void ScopePart::mainEventLoop() { if (result == "ACK") { // Update display widget(s) - m_traceWidget->setSamples(m_currentOpChannel, trace); - m_base->traceZoomWidget->setSamples(m_currentOpChannel, trace); - m_traceWidget->setPositions(m_currentOpChannel, positions); - m_base->traceZoomWidget->setPositions(m_currentOpChannel, positions); + m_traceWidget->setSamples(m_currentOpChannel-1, trace); + m_base->traceZoomWidget->setSamples(m_currentOpChannel-1, trace); + m_traceWidget->setPositions(m_currentOpChannel-1, positions); + m_base->traceZoomWidget->setPositions(m_currentOpChannel-1, positions); postProcessTrace(); m_traceWidget->repaint(true); m_base->traceZoomWidget->repaint(true); @@ -733,16 +733,21 @@ void ScopePart::updateGraticule() { m_base->traceZoomWidget->setNumberOfHorizontalDivisions(m_hdivs); m_base->traceZoomWidget->setNumberOfVerticalDivisions(m_vdivs); + m_traceWidget->setTraceColor(0, TQColor(255, 255, 255)); + m_traceWidget->setTraceColor(1, TQColor(0, 255, 0)); + m_traceWidget->setTraceColor(2, TQColor(255, 255, 0)); + m_traceWidget->setTraceColor(3, TQColor(64, 64, 255)); + for (int traceno=1; traceno<=m_maxNumberOfTraces; traceno++) { - m_traceWidget->setTraceEnabled(traceno, m_channelActive[traceno]); - m_traceWidget->setTraceName(traceno, TQString("Channel %1").arg(traceno)); - m_traceWidget->setTraceHorizontalUnits(traceno, "s"); - m_traceWidget->setTraceVerticalUnits(traceno, "V"); + m_traceWidget->setTraceEnabled(traceno-1, m_channelActive[traceno]); + m_traceWidget->setTraceName(traceno-1, TQString("Channel %1").arg(traceno)); + m_traceWidget->setTraceHorizontalUnits(traceno-1, "s"); + m_traceWidget->setTraceVerticalUnits(traceno-1, "V"); - m_traceWidget->setNumberOfSamples(traceno, m_samplesInTrace[traceno]); - m_base->traceZoomWidget->setNumberOfSamples(traceno, m_samplesInTrace[traceno]); + m_traceWidget->setNumberOfSamples(traceno-1, m_samplesInTrace[traceno]); + m_base->traceZoomWidget->setNumberOfSamples(traceno-1, m_samplesInTrace[traceno]); - m_traceWidget->setDisplayLimits(traceno, TQRectF(0.0, (m_voltsDiv[traceno]*m_vdivs)/2.0, (m_secsDiv[traceno]*m_hdivs), (m_voltsDiv[traceno]*m_vdivs)/-2.0)); + m_traceWidget->setDisplayLimits(traceno-1, TQRectF(0.0, (m_voltsDiv[traceno]*m_vdivs)/2.0, (m_secsDiv[traceno]*m_hdivs), (m_voltsDiv[traceno]*m_vdivs)/-2.0)); printf("[RAJA DEBUG 700.0] m_voltsDiv[%d]: %f m_vdivs: %d m_secsDiv[%d]: %f m_hdivs: %d\n\r", traceno, m_voltsDiv[traceno], m_vdivs, traceno, m_secsDiv[traceno], m_hdivs); fflush(stdout); } diff --git a/clients/tde/src/widgets/tracewidget.cpp b/clients/tde/src/widgets/tracewidget.cpp index 911bf70..b814e43 100644 --- a/clients/tde/src/widgets/tracewidget.cpp +++ b/clients/tde/src/widgets/tracewidget.cpp @@ -667,6 +667,7 @@ void TraceWidget::setDisplayLimits(uint traceNumber, TQRectF limits) { m_traceArray[traceNumber]->topEdge = limits.y(); m_traceArray[traceNumber]->bottomEdge = limits.height(); + m_graticuleWidget->updateGraticule(); m_graticuleWidget->repaint(true); updateTraceText(); updateCursorText(); @@ -761,13 +762,13 @@ void TraceWidget::setPositions(uint traceNumber, TQDoubleArray& tqda) { m_graticuleWidget->repaint(true); } -TQColor& TraceWidget::traceColor(uint traceNumber) { +TQColor TraceWidget::traceColor(uint traceNumber) { VERIFY_TRACE_ARRAY_SIZE return m_traceArray[traceNumber]->color; } -void TraceWidget::setTraceColor(uint traceNumber, TQColor& color) { +void TraceWidget::setTraceColor(uint traceNumber, TQColor color) { VERIFY_TRACE_ARRAY_SIZE m_traceArray[traceNumber]->color = color; diff --git a/clients/tde/src/widgets/tracewidget.h b/clients/tde/src/widgets/tracewidget.h index b569074..0536ee9 100644 --- a/clients/tde/src/widgets/tracewidget.h +++ b/clients/tde/src/widgets/tracewidget.h @@ -174,8 +174,8 @@ class TraceWidget : public TQWidget void setSamples(uint traceNumber, TQDoubleArray&); TQDoubleArray& positions(uint traceNumber); void setPositions(uint traceNumber, TQDoubleArray&); - TQColor& traceColor(uint traceNumber); - void setTraceColor(uint traceNumber, TQColor&); + TQColor traceColor(uint traceNumber); + void setTraceColor(uint traceNumber, TQColor); bool traceEnabled(uint traceNumber); void setTraceEnabled(uint traceNumber, bool enabled, bool showText=true); TQString traceName(uint traceNumber); |