diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-14 21:08:12 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-14 21:08:12 -0500 |
commit | 47f193b7dea740d95b0827855d0d4d3faefe3b72 (patch) | |
tree | f352d6bd7a680919a388cc6596c8b1189431790e /clients/tde/src/part/scope | |
parent | 663e2f7a3d1ae0a40f45e760c3ae6998d79c1a2f (diff) | |
download | ulab-47f193b7dea740d95b0827855d0d4d3faefe3b72.tar.gz ulab-47f193b7dea740d95b0827855d0d4d3faefe3b72.zip |
Fix scope
Diffstat (limited to 'clients/tde/src/part/scope')
-rw-r--r-- | clients/tde/src/part/scope/layout.ui | 26 | ||||
-rw-r--r-- | clients/tde/src/part/scope/part.cpp | 32 | ||||
-rw-r--r-- | clients/tde/src/part/scope/part.h | 2 |
3 files changed, 59 insertions, 1 deletions
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 @@ </widget> </grid> </widget> + <widget class="TQGroupBox" row="0" column="1"> + <property name="name"> + <cstring>groupOscilloscopeAcquisitionControls</cstring> + </property> + <property name="title"> + <string>Acquisition Controls</string> + </property> + <grid> + <widget class="TQPushButton" row="0" column="0" colspan="1"> + <property name="name"> + <cstring>acqStart</cstring> + </property> + <property name="text"> + <string>Start Acquisition</string> + </property> + </widget> + <widget class="TQPushButton" row="0" column="1" colspan="1"> + <property name="name"> + <cstring>acqStop</cstring> + </property> + <property name="text"> + <string>Stop Acquisition</string> + </property> + </widget> + </grid> + </widget> </grid> </widget> </grid> 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 <tqvbox.h> #include <tqsocket.h> #include <tqmutex.h> +#include <tqpushbutton.h> #include <tqeventloop.h> #include <tqapplication.h> #include <unistd.h> //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; traceno<m_maxNumberOfTraces; traceno++) { TQRectF fullZoomRect = m_traceWidget->displayLimits(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); |