diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-14 19:50:23 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-14 19:50:23 -0500 |
commit | 663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f (patch) | |
tree | 88d87fd5190e03dc6237d5ae5ad13df490ee1545 /clients/tde/src | |
parent | c50fa83bfd137b6b5aa7f9c1e4c310ddde75e585 (diff) | |
download | ulab-663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f.tar.gz ulab-663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f.zip |
Fix scope
Diffstat (limited to 'clients/tde/src')
-rw-r--r-- | clients/tde/src/app/views/instrumentview.cpp | 1 | ||||
-rw-r--r-- | clients/tde/src/part/scope/part.cpp | 46 | ||||
-rw-r--r-- | clients/tde/src/widgets/tracewidget.cpp | 6 |
3 files changed, 41 insertions, 12 deletions
diff --git a/clients/tde/src/app/views/instrumentview.cpp b/clients/tde/src/app/views/instrumentview.cpp index 4cad117..429f670 100644 --- a/clients/tde/src/app/views/instrumentview.cpp +++ b/clients/tde/src/app/views/instrumentview.cpp @@ -48,6 +48,7 @@ void InstrumentView::init() { m_instrumentPart = (InstrumentPart *)factory->create(TQT_TQOBJECT(this), "part", "KParts::RemoteInstrumentPart"); connect(m_instrumentPart, SIGNAL(statusMessageSet(const TQString&)), this, SLOT(setStatusMessage(const TQString&))); connect(m_instrumentPart, SIGNAL(usingFixedSizeChanged(bool)), this, SLOT(setUsingFixedSize(bool))); + connect(m_instrumentPart, SIGNAL(resizeToHintRequested()), this, SLOT(setChildSizeToHint())); } } diff --git a/clients/tde/src/part/scope/part.cpp b/clients/tde/src/part/scope/part.cpp index 387c901..d12fd32 100644 --- a/clients/tde/src/part/scope/part.cpp +++ b/clients/tde/src/part/scope/part.cpp @@ -127,7 +127,12 @@ bool ScopePart::closeURL() { void ScopePart::processLockouts() { if (m_connectionActiveAndValid) { - m_base->setEnabled(true); + if ((m_commHandlerMode < 2) && (m_commHandlerState < 50)) { + m_base->setEnabled(false); + } + else { + m_base->setEnabled(true); + } } else { m_base->setEnabled(false); @@ -211,8 +216,10 @@ void ScopePart::setTickerMessage(TQString message) { } \ else { \ m_commHandlerState = 255; \ - } \ - printf("[RAJA DEBUG 640.0] Entering state %d\n\r", m_commHandlerState); fflush(stdout); + } \ + if (m_commHandlerState < 50) { \ + setTickerMessage(i18n("Loading")); \ + } #define EXEC_NEXT_STATE_IMMEDIATELY m_forcedUpdateTimer->start(0, TRUE); @@ -573,6 +580,9 @@ void ScopePart::mainEventLoop() { if (result == "ACK") { // Update display widget(s) updateGraticule(); + // HACK + // Force resize of parent frame + emit(usingFixedSizeChanged(false)); } if (result == "ACK") { @@ -624,8 +634,8 @@ void ScopePart::mainEventLoop() { if (result == "ACK") { // Update display widget(s) 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->setSamples(m_currentOpChannel-1, trace); m_base->traceZoomWidget->setPositions(m_currentOpChannel-1, positions); postProcessTrace(); m_traceWidget->repaint(true); @@ -718,13 +728,15 @@ void ScopePart::postProcessTrace() { } void ScopePart::updateZoomWidgetLimits(const TQRectF& zoomRect) { - TQRectF fullZoomRect = m_traceWidget->displayLimits(0); - double widthSpan = fullZoomRect.width()-fullZoomRect.x(); - double heightSpan = fullZoomRect.height()-fullZoomRect.y(); + for (int traceno=1; traceno<=m_maxNumberOfTraces; traceno++) { + TQRectF fullZoomRect = m_traceWidget->displayLimits(traceno); + double widthSpan = fullZoomRect.width()-fullZoomRect.x(); + double heightSpan = fullZoomRect.height()-fullZoomRect.y(); - TQRectF zoomLimitsRect((fullZoomRect.x()+(widthSpan*(zoomRect.x()/100.0))), (fullZoomRect.y()+(heightSpan*(zoomRect.y()/100.0))), (fullZoomRect.x()+(widthSpan*((zoomRect.x()/100.0)+(zoomRect.width()/100.0)))), (fullZoomRect.y()+(heightSpan*((zoomRect.y()/100.0)+(zoomRect.height()/100.0))))); + TQRectF zoomLimitsRect((fullZoomRect.x()+(widthSpan*(zoomRect.x()/100.0))), (fullZoomRect.y()+(heightSpan*(zoomRect.y()/100.0))), (fullZoomRect.x()+(widthSpan*((zoomRect.x()/100.0)+(zoomRect.width()/100.0)))), (fullZoomRect.y()+(heightSpan*((zoomRect.y()/100.0)+(zoomRect.height()/100.0))))); - m_base->traceZoomWidget->setDisplayLimits(0, zoomLimitsRect); + m_base->traceZoomWidget->setDisplayLimits(traceno, zoomLimitsRect); + } } void ScopePart::updateGraticule() { @@ -734,9 +746,14 @@ void ScopePart::updateGraticule() { 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)); + m_traceWidget->setTraceColor(1, TQColor(128, 255, 128)); + m_traceWidget->setTraceColor(2, TQColor(255, 255, 128)); + m_traceWidget->setTraceColor(3, TQColor(128, 128, 255)); + + m_base->traceZoomWidget->setTraceColor(0, TQColor(255, 255, 255)); + m_base->traceZoomWidget->setTraceColor(1, TQColor(128, 255, 128)); + m_base->traceZoomWidget->setTraceColor(2, TQColor(255, 255, 128)); + m_base->traceZoomWidget->setTraceColor(3, TQColor(128, 128, 255)); for (int traceno=1; traceno<=m_maxNumberOfTraces; traceno++) { m_traceWidget->setTraceEnabled(traceno-1, m_channelActive[traceno]); @@ -744,6 +761,11 @@ void ScopePart::updateGraticule() { m_traceWidget->setTraceHorizontalUnits(traceno-1, "s"); m_traceWidget->setTraceVerticalUnits(traceno-1, "V"); + m_base->traceZoomWidget->setTraceEnabled(traceno-1, m_channelActive[traceno], false); + m_base->traceZoomWidget->setTraceName(traceno-1, TQString("Channel %1").arg(traceno)); + m_base->traceZoomWidget->setTraceHorizontalUnits(traceno-1, "s"); + m_base->traceZoomWidget->setTraceVerticalUnits(traceno-1, "V"); + m_traceWidget->setNumberOfSamples(traceno-1, m_samplesInTrace[traceno]); m_base->traceZoomWidget->setNumberOfSamples(traceno-1, m_samplesInTrace[traceno]); diff --git a/clients/tde/src/widgets/tracewidget.cpp b/clients/tde/src/widgets/tracewidget.cpp index b814e43..2d44afc 100644 --- a/clients/tde/src/widgets/tracewidget.cpp +++ b/clients/tde/src/widgets/tracewidget.cpp @@ -379,6 +379,7 @@ GraticuleWidget::GraticuleWidget(TraceWidget* parent, const char* name) : TQWidg setPaletteBackgroundColor(TQt::black); setPaletteForegroundColor(TQColor(0,128,0)); setMouseTracking(true); + setCursor(tqcrossCursor); } GraticuleWidget::~GraticuleWidget() { @@ -530,7 +531,11 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) { double vertical_range = (m_base->m_traceArray[trace]->bottomEdge-m_base->m_traceArray[trace]->topEdge); double realCursorYPosition = (m_base->m_traceArray[trace]->topEdge+((scaledYPos/100.0)*vertical_range)); double realCursorXPosition = (m_base->m_traceArray[trace]->leftEdge+((scaledXPos/100.0)*horizontal_range)); +#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, 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()); } } @@ -598,6 +603,7 @@ TraceWidget::TraceWidget(TQWidget* parent, const char* name) : TQWidget(parent, m_traceLabelLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum), 0, 255); m_rightPaneLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding), 255, 0); m_primaryLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum), 1, 128); + m_statusLabelLayout->setSpacing(0); setPaletteBackgroundColor(TQt::black); setPaletteForegroundColor(TQColor(0,128,0)); |