From 47f193b7dea740d95b0827855d0d4d3faefe3b72 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 14 Jul 2012 21:08:12 -0500 Subject: Fix scope --- clients/tde/src/part/scope/layout.ui | 26 ++++++++++++++++++++++++++ clients/tde/src/part/scope/part.cpp | 32 +++++++++++++++++++++++++++++++- clients/tde/src/part/scope/part.h | 2 ++ 3 files changed, 59 insertions(+), 1 deletion(-) (limited to 'clients/tde/src/part/scope') diff --git a/clients/tde/src/part/scope/layout.ui b/clients/tde/src/part/scope/layout.ui index 9b69b57..6a28939 100644 --- a/clients/tde/src/part/scope/layout.ui +++ b/clients/tde/src/part/scope/layout.ui @@ -159,6 +159,32 @@ + + + groupOscilloscopeAcquisitionControls + + + Acquisition Controls + + + + + acqStart + + + Start Acquisition + + + + + acqStop + + + Stop Acquisition + + + + diff --git a/clients/tde/src/part/scope/part.cpp b/clients/tde/src/part/scope/part.cpp index d12fd32..aefaa20 100644 --- a/clients/tde/src/part/scope/part.cpp +++ b/clients/tde/src/part/scope/part.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include //access() @@ -93,6 +94,9 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject * m_base->saRefLevel->setFloatMax(128); m_base->saRefLevel->setLineStep(1); + connect(m_base->acqStart, SIGNAL(clicked()), this, SLOT(startDAQ())); + connect(m_base->acqStop, SIGNAL(clicked()), this, SLOT(stopDAQ())); + connect(m_base->saRefLevel, SIGNAL(floatValueChanged(double)), this, SLOT(saRefLevelChanged(double))); TQTimer::singleShot(0, this, TQT_SLOT(postInit())); @@ -711,6 +715,15 @@ void ScopePart::mainEventLoop() { } } } + else if (m_commHandlerCommandState == 3) { + if (stopTraceUpdate == false) { + m_commHandlerCommandState = 0; + EXEC_NEXT_STATE_IMMEDIATELY + } + else { + setTickerMessage(i18n("Data acquisition stopped")); + } + } } } else { @@ -727,8 +740,25 @@ void ScopePart::postProcessTrace() { return; } +void ScopePart::startDAQ() { + // RAJA FIXME + // Also process lockouts... +} + +void ScopePart::stopDAQ() { + // RAJA FIXME + // Also process lockouts... + + if (m_commHandlerMode < 2) { + stopTraceUpdate = true; + m_commHandlerMode = 1; + m_commHandlerCommandState = 3; + mainEventLoop(); + } +} + void ScopePart::updateZoomWidgetLimits(const TQRectF& zoomRect) { - for (int traceno=1; traceno<=m_maxNumberOfTraces; traceno++) { + for (int traceno=0; tracenodisplayLimits(traceno); double widthSpan = fullZoomRect.width()-fullZoomRect.x(); double heightSpan = fullZoomRect.height()-fullZoomRect.y(); diff --git a/clients/tde/src/part/scope/part.h b/clients/tde/src/part/scope/part.h index 55c20c0..7034300 100644 --- a/clients/tde/src/part/scope/part.h +++ b/clients/tde/src/part/scope/part.h @@ -49,6 +49,8 @@ namespace RemoteLab void connectionStatusChangedCallback(); void setTickerMessage(TQString message); void mainEventLoop(); + void startDAQ(); + void stopDAQ(); virtual void postProcessTrace(); void saRefLevelChanged(double); -- cgit v1.2.1