summaryrefslogtreecommitdiffstats
path: root/clients/tde/src/part/commanalyzer
diff options
context:
space:
mode:
Diffstat (limited to 'clients/tde/src/part/commanalyzer')
-rw-r--r--clients/tde/src/part/commanalyzer/layout.ui19
-rw-r--r--clients/tde/src/part/commanalyzer/part.cpp352
-rw-r--r--clients/tde/src/part/commanalyzer/part.h6
3 files changed, 261 insertions, 116 deletions
diff --git a/clients/tde/src/part/commanalyzer/layout.ui b/clients/tde/src/part/commanalyzer/layout.ui
index 29d9392..82b011e 100644
--- a/clients/tde/src/part/commanalyzer/layout.ui
+++ b/clients/tde/src/part/commanalyzer/layout.ui
@@ -75,6 +75,25 @@
</size>
</property>
</widget>
+ <widget class="TraceWidget" row="1" column="0" colspan="1">
+ <property name="name">
+ <cstring>traceZoomWidget</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>80</height>
+ </size>
+ </property>
+ </widget>
</grid>
</widget>
<widget class="TQGroupBox" row="0" column="1">
diff --git a/clients/tde/src/part/commanalyzer/part.cpp b/clients/tde/src/part/commanalyzer/part.cpp
index 3e53429..c0200ec 100644
--- a/clients/tde/src/part/commanalyzer/part.cpp
+++ b/clients/tde/src/part/commanalyzer/part.cpp
@@ -21,6 +21,7 @@
#include <tqapplication.h>
#include <unistd.h> //access()
#include <stdint.h>
+#include <cmath>
#include "tracewidget.h"
#include "floatspinbox.h"
@@ -42,7 +43,8 @@ K_EXPORT_COMPONENT_FACTORY( libremotelab_commanalyzer, RemoteLab::Factory )
CommAnalyzerPart::CommAnalyzerPart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList& )
- : RemoteInstrumentPart( parent, name ), m_traceWidget(0), m_commHandlerState(-1), m_commHandlerMode(0), m_commHandlerCommandState(0), m_base(0), stopTraceUpdate(false)
+ : RemoteInstrumentPart( parent, name ), m_traceWidget(0), m_commHandlerState(-1), m_commHandlerMode(0), m_commHandlerCommandState(0), m_connectionActiveAndValid(false),
+ m_base(0), stopTraceUpdate(false)
{
// Initialize important base class variables
m_clientLibraryName = CLIENT_LIBRARY;
@@ -55,17 +57,46 @@ CommAnalyzerPart::CommAnalyzerPart( TQWidget *parentWidget, const char *widgetNa
setWidget(new TQVBox(parentWidget, widgetName));
// Create timers
+ m_forcedUpdateTimer = new TQTimer(this);
+ connect(m_forcedUpdateTimer, SIGNAL(timeout()), this, SLOT(mainEventLoop()));
m_updateTimeoutTimer = new TQTimer(this);
connect(m_updateTimeoutTimer, SIGNAL(timeout()), this, SLOT(mainEventLoop()));
// Create widgets
m_base = new CommAnalyzerBase(widget());
m_traceWidget = m_base->traceWidget;
- m_base->traceWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
- m_base->traceWidget->setTraceEnabled(0, true);
+ m_traceWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
+ m_traceWidget->setTraceEnabled(0, true);
m_traceWidget->setTraceName(0, "Trace 1");
m_traceWidget->setTraceHorizontalUnits(0, "Hz");
m_traceWidget->setTraceVerticalUnits(0, "dBm");
+ m_traceWidget->setNumberOfCursors(4);
+ m_traceWidget->setCursorOrientation(0, TQt::Horizontal);
+ m_traceWidget->setCursorOrientation(1, TQt::Horizontal);
+ m_traceWidget->setCursorOrientation(2, TQt::Vertical);
+ m_traceWidget->setCursorOrientation(3, TQt::Vertical);
+ m_traceWidget->setCursorEnabled(0, true);
+ m_traceWidget->setCursorEnabled(1, true);
+ m_traceWidget->setCursorEnabled(2, true);
+ m_traceWidget->setCursorEnabled(3, true);
+ m_traceWidget->setCursorName(0, "Cursor H1");
+ m_traceWidget->setCursorName(1, "Cursor H2");
+ m_traceWidget->setCursorName(2, "Cursor V1");
+ m_traceWidget->setCursorName(3, "Cursor V2");
+ m_traceWidget->setCursorPosition(0, 25);
+ m_traceWidget->setCursorPosition(1, 75);
+ m_traceWidget->setCursorPosition(2, 25);
+ m_traceWidget->setCursorPosition(3, 75);
+ m_traceWidget->setZoomBoxEnabled(true);
+
+ m_base->traceZoomWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
+ m_base->traceZoomWidget->setTraceEnabled(0, true, false);
+ m_base->traceZoomWidget->setTraceName(0, "Trace 1");
+ m_base->traceZoomWidget->setTraceHorizontalUnits(0, "Hz");
+ m_base->traceZoomWidget->setTraceVerticalUnits(0, "dBm");
+ connect(m_traceWidget, SIGNAL(zoomBoxChanged(const TQRectF&)), this, SLOT(updateZoomWidgetLimits(const TQRectF&)));
+
+ m_base->saRefLevel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed));
m_base->saRefLevel->setFloatMin(-128);
m_base->saRefLevel->setFloatMax(128);
m_base->saRefLevel->setLineStep(1);
@@ -90,6 +121,7 @@ void CommAnalyzerPart::postInit() {
bool CommAnalyzerPart::openURL(const KURL &url) {
int ret;
+ m_connectionActiveAndValid = false;
ret = connectToServer(url.url());
processLockouts();
return (ret != 0);
@@ -102,10 +134,18 @@ bool CommAnalyzerPart::closeURL() {
}
void CommAnalyzerPart::processLockouts() {
+ if (m_connectionActiveAndValid) {
+ m_base->setEnabled(true);
+ }
+ else {
+ m_base->setEnabled(false);
+ }
}
void CommAnalyzerPart::disconnectFromServerCallback() {
+ m_forcedUpdateTimer->stop();
m_updateTimeoutTimer->stop();
+ m_connectionActiveAndValid = false;
}
void CommAnalyzerPart::connectionFinishedCallback() {
@@ -122,42 +162,73 @@ void CommAnalyzerPart::connectionFinishedCallback() {
return;
}
-#define UPDATEDISPLAY_TIMEOUT m_connectionActiveAndValid = false; \
- m_tickerState = 0; \
- m_commHandlerState = 2; \
- m_commHandlerMode = 0; \
- m_socket->clearIncomingData(); \
- setStatusMessage(i18n("Server ping timeout. Please verify the status of your network connection.")); \
- m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE); \
- m_instrumentMutex->unlock(); \
- return;
-
-#define COMMUNICATIONS_FAILED m_connectionActiveAndValid = false; \
- m_tickerState = 0; \
- m_commHandlerState = 2; \
- m_commHandlerMode = 0; \
- m_socket->clearIncomingData(); \
- setStatusMessage(i18n("Instrument communication failure. Please verify the status of your network connection.")); \
- m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE); \
- m_instrumentMutex->unlock(); \
- return;
-
-#define SET_WATCHDOG_TIMER if (!m_updateTimeoutTimer->isActive()) m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE);
-#define PAT_WATCHDOG_TIMER m_updateTimeoutTimer->stop(); m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE);
-
-#define SET_NEXT_STATE(x) if (m_commHandlerMode == 0) { \
- m_commHandlerState = x; \
- } \
- else { \
- m_commHandlerState = 255; \
- }
+void CommAnalyzerPart::connectionStatusChangedCallback() {
+ processLockouts();
+}
+
+void CommAnalyzerPart::setTickerMessage(TQString message) {
+ m_connectionActiveAndValid = true;
+ TQString tickerChar;
+ switch (m_tickerState) {
+ case 0:
+ tickerChar = "-";
+ break;
+ case 1:
+ tickerChar = "\\";
+ break;
+ case 2:
+ tickerChar = "|";
+ break;
+ case 3:
+ tickerChar = "/";
+ break;
+ }
+ setStatusMessage(message + TQString("... %1").arg(tickerChar));
+ m_tickerState++;
+ if (m_tickerState > 3) {
+ m_tickerState = 0;
+ }
+}
+
+#define UPDATEDISPLAY_TIMEOUT m_connectionActiveAndValid = false; \
+ m_tickerState = 0; \
+ m_commHandlerState = 2; \
+ m_commHandlerMode = 0; \
+ m_socket->clearIncomingData(); \
+ setStatusMessage(i18n("Server ping timeout. Please verify the status of your network connection.")); \
+ m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE); \
+ m_instrumentMutex->unlock(); \
+ return;
+
+#define COMMUNICATIONS_FAILED m_connectionActiveAndValid = false; \
+ m_tickerState = 0; \
+ m_commHandlerState = 2; \
+ m_commHandlerMode = 0; \
+ m_socket->clearIncomingData(); \
+ setStatusMessage(i18n("Instrument communication failure. Please verify the status of your network connection.")); \
+ m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE); \
+ m_instrumentMutex->unlock(); \
+ return;
+
+#define SET_WATCHDOG_TIMER if (!m_updateTimeoutTimer->isActive()) m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE);
+#define PAT_WATCHDOG_TIMER m_updateTimeoutTimer->stop(); m_updateTimeoutTimer->start(NETWORK_COMM_TIMEOUT_MS, TRUE); \
+ setTickerMessage(i18n("Connected"));
+
+#define SET_NEXT_STATE(x) if (m_commHandlerMode == 0) { \
+ m_commHandlerState = x; \
+ } \
+ else { \
+ m_commHandlerState = 255; \
+ }
+
+#define EXEC_NEXT_STATE_IMMEDIATELY m_forcedUpdateTimer->start(0, TRUE);
void CommAnalyzerPart::mainEventLoop() {
TQDataStream ds(m_socket);
ds.setPrintableData(true);
if (!m_instrumentMutex->tryLock()) {
- TQTimer::singleShot(0, this, SLOT(mainEventLoop())); // Handle the concurrently received call immediately after current execution
+ EXEC_NEXT_STATE_IMMEDIATELY
return;
}
@@ -169,6 +240,7 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->writeEndOfFrame();
m_commHandlerState = 1;
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerState == 1) {
// Get response data
@@ -182,6 +254,7 @@ void CommAnalyzerPart::mainEventLoop() {
if (result == "ACK") {
SET_NEXT_STATE(2)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -199,6 +272,7 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->writeEndOfFrame();
SET_NEXT_STATE(3)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerState == 3) {
// Get response data
@@ -211,11 +285,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Set spectrum analyzer mode
- ds << TQString("SETMODESPECTRUMANALYZER");
- m_socket->writeEndOfFrame();
-
SET_NEXT_STATE(4)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -228,31 +299,12 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
else if (m_commHandlerState == 4) {
- // Get response data
- if (m_socket->canReadFrame()) {
- PAT_WATCHDOG_TIMER
-
- // Get command status
- TQString result;
- ds >> result;
- m_socket->clearFrameTail();
-
- if (result == "ACK") {
- // Get number of samples in trace, step 1
- ds << TQString("GETTRACESAMPLECOUNT");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(5)
- }
- else {
- COMMUNICATIONS_FAILED
- }
- }
- else {
- if (!m_updateTimeoutTimer->isActive()) {
- UPDATEDISPLAY_TIMEOUT
- }
- }
+ // Get number of samples in trace, step 1
+ ds << TQString("GETTRACESAMPLECOUNT");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(5)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerState == 5) {
// Get response data
@@ -267,12 +319,9 @@ void CommAnalyzerPart::mainEventLoop() {
}
m_socket->clearFrameTail();
- if (result == "ACK") {
- // Get number of horizontal divisions, step 1
- ds << TQString("GETHORIZONTALDIVCOUNT");
- m_socket->writeEndOfFrame();
-
+ if (result == "ACK") {
SET_NEXT_STATE(6)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -285,6 +334,14 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
else if (m_commHandlerState == 6) {
+ // Get number of horizontal divisions, step 1
+ ds << TQString("GETHORIZONTALDIVCOUNT");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(7)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 7) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -298,11 +355,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Get number of vertical divisions, step 1
- ds << TQString("GETVERTICALDIVCOUNT");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(7)
+ SET_NEXT_STATE(8)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -314,7 +368,15 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
}
- else if (m_commHandlerState == 7) {
+ else if (m_commHandlerState == 8) {
+ // Get number of vertical divisions, step 1
+ ds << TQString("GETVERTICALDIVCOUNT");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(9)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 9) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -328,11 +390,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Get reference power level, step 1
- ds << TQString("GETREFERENCEPOWERLEVEL");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(8)
+ SET_NEXT_STATE(10)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -344,7 +403,15 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
}
- else if (m_commHandlerState == 8) {
+ else if (m_commHandlerState == 10) {
+ // Get reference power level, step 1
+ ds << TQString("GETREFERENCEPOWERLEVEL");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(11)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 11) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -358,11 +425,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Get vertical division scale, step 1
- ds << TQString("GETVERTDIVSCALE");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(9)
+ SET_NEXT_STATE(12)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -374,7 +438,15 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
}
- else if (m_commHandlerState == 9) {
+ else if (m_commHandlerState == 12) {
+ // Get vertical division scale, step 1
+ ds << TQString("GETVERTDIVSCALE");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(13)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 13) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -388,11 +460,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Get center frequency, step 1
- ds << TQString("GETCENTERFREQUENCY");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(10)
+ SET_NEXT_STATE(14)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -404,7 +473,15 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
}
- else if (m_commHandlerState == 10) {
+ else if (m_commHandlerState == 14) {
+ // Get center frequency, step 1
+ ds << TQString("GETCENTERFREQUENCY");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(15)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 15) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -418,11 +495,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Get frequency span, step 1
- ds << TQString("GETFREQUENCYSPAN");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(11)
+ SET_NEXT_STATE(16)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -434,7 +508,15 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
}
- else if (m_commHandlerState == 11) {
+ else if (m_commHandlerState == 16) {
+ // Get frequency span, step 1
+ ds << TQString("GETFREQUENCYSPAN");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(17)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 17) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -453,11 +535,8 @@ void CommAnalyzerPart::mainEventLoop() {
}
if (result == "ACK") {
- // Get trace, step 1
- ds << TQString("GETSPECTRUMTRACE");
- m_socket->writeEndOfFrame();
-
- SET_NEXT_STATE(12)
+ SET_NEXT_STATE(18)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -469,7 +548,15 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
}
- else if (m_commHandlerState == 12) {
+ else if (m_commHandlerState == 18) {
+ // Get trace, step 1
+ ds << TQString("GETSPECTRUMTRACE");
+ m_socket->writeEndOfFrame();
+
+ SET_NEXT_STATE(19)
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerState == 19) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -486,12 +573,16 @@ void CommAnalyzerPart::mainEventLoop() {
if (result == "ACK") {
// Update display widget(s)
m_traceWidget->setSamples(0, trace);
+ m_base->traceZoomWidget->setSamples(0, trace);
postProcessTrace();
m_traceWidget->repaint();
+ m_base->traceZoomWidget->repaint();
}
if (result == "ACK") {
- SET_NEXT_STATE(2)
+ //SET_NEXT_STATE(2)
+ SET_NEXT_STATE(18)
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -507,13 +598,15 @@ void CommAnalyzerPart::mainEventLoop() {
// Execute pending command
m_commHandlerMode = 2;
m_socket->clearIncomingData();
+ EXEC_NEXT_STATE_IMMEDIATELY
}
SET_WATCHDOG_TIMER
}
else if (m_commHandlerMode == 2) {
if (m_commHandlerCommandState == 0) {
m_commHandlerMode = 0;
- m_commHandlerState = 2;
+ m_commHandlerState = 10;
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerCommandState == 1) {
// Set reference power level
@@ -522,6 +615,7 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->writeEndOfFrame();
m_commHandlerCommandState = 2;
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else if (m_commHandlerCommandState == 2) {
// Get response data
@@ -534,11 +628,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_socket->clearFrameTail();
if (result == "ACK") {
- // Get reference power level, step 1
- ds << TQString("GETREFERENCEPOWERLEVEL");
- m_socket->writeEndOfFrame();
-
m_commHandlerCommandState = 3;
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -551,6 +642,14 @@ void CommAnalyzerPart::mainEventLoop() {
}
}
else if (m_commHandlerCommandState == 3) {
+ // Get reference power level, step 1
+ ds << TQString("GETREFERENCEPOWERLEVEL");
+ m_socket->writeEndOfFrame();
+
+ m_commHandlerCommandState = 4;
+ EXEC_NEXT_STATE_IMMEDIATELY
+ }
+ else if (m_commHandlerCommandState == 4) {
// Get response data
if (m_socket->canReadFrame()) {
PAT_WATCHDOG_TIMER
@@ -568,7 +667,7 @@ void CommAnalyzerPart::mainEventLoop() {
if (result == "ACK") {
m_commHandlerCommandState = 0;
- TQTimer::singleShot(0, this, SLOT(mainEventLoop()));
+ EXEC_NEXT_STATE_IMMEDIATELY
}
else {
COMMUNICATIONS_FAILED
@@ -587,6 +686,8 @@ void CommAnalyzerPart::mainEventLoop() {
m_commHandlerCommandState = 0;
}
+ processLockouts();
+
m_instrumentMutex->unlock();
}
@@ -594,10 +695,27 @@ void CommAnalyzerPart::postProcessTrace() {
return;
}
+void CommAnalyzerPart::updateZoomWidgetLimits(const TQRectF& zoomRect) {
+ TQRectF fullZoomRect = m_traceWidget->displayLimits(0);
+ 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)))));
+
+printf("[RAJA DEBUG 760.0] Current full limits: x1: %f y1: %f x2: %f y2: %f\n\r", fullZoomRect.x(), fullZoomRect.y(), fullZoomRect.width(), fullZoomRect.height()); fflush(stdout);
+printf("[RAJA DEBUG 760.1] Current zoom limits: x1: %f y1: %f x2: %f y2: %f\n\r", zoomLimitsRect.x(), zoomLimitsRect.y(), zoomLimitsRect.width(), zoomLimitsRect.height()); fflush(stdout);
+
+ m_base->traceZoomWidget->setDisplayLimits(0, zoomLimitsRect);
+}
+
void CommAnalyzerPart::updateGraticule() {
m_traceWidget->setNumberOfSamples(0, m_samplesInTrace);
m_traceWidget->setNumberOfHorizontalDivisions(m_hdivs);
m_traceWidget->setNumberOfVerticalDivisions(m_vdivs);
+printf("[RAJA DEBUG 750.0] m_hdivs: %d m_vdivs: %d m_vscale: %E\n\r", m_hdivs, m_vdivs, m_vscale); fflush(stdout);
+ m_base->traceZoomWidget->setNumberOfSamples(0, m_samplesInTrace);
+ m_base->traceZoomWidget->setNumberOfHorizontalDivisions(m_hdivs);
+ m_base->traceZoomWidget->setNumberOfVerticalDivisions(m_vdivs);
m_leftFrequency = m_centerfreq - (m_spanfreq/2.0);
m_rightFrequency = m_centerfreq + (m_spanfreq/2.0);
@@ -611,7 +729,9 @@ void CommAnalyzerPart::updateGraticule() {
freqpos = freqpos + freqincr;
}
m_traceWidget->setPositions(0, tracepositions);
- m_traceWidget->setDisplayLimits(0, m_leftFrequency, m_rpower, m_rightFrequency, m_rpower-(m_vscale*m_hdivs));
+ m_traceWidget->setDisplayLimits(0, TQRectF(m_leftFrequency, m_rpower, m_rightFrequency, m_rpower-(m_vscale*m_vdivs)));
+ m_base->traceZoomWidget->setPositions(0, tracepositions);
+ updateZoomWidgetLimits(m_traceWidget->zoomBox());
// Also update controls
m_base->saRefLevel->blockSignals(true);
@@ -620,10 +740,12 @@ void CommAnalyzerPart::updateGraticule() {
}
void CommAnalyzerPart::saRefLevelChanged(double newval) {
- m_rpower = newval;
- m_commHandlerMode = 1;
- m_commHandlerCommandState = 1;
- mainEventLoop();
+ if (m_commHandlerMode < 2) {
+ m_rpower = newval;
+ m_commHandlerMode = 1;
+ m_commHandlerCommandState = 1;
+ mainEventLoop();
+ }
}
KAboutData* CommAnalyzerPart::createAboutData() {
diff --git a/clients/tde/src/part/commanalyzer/part.h b/clients/tde/src/part/commanalyzer/part.h
index 252a67c..a45618c 100644
--- a/clients/tde/src/part/commanalyzer/part.h
+++ b/clients/tde/src/part/commanalyzer/part.h
@@ -17,6 +17,7 @@ class TraceWidget;
class TQSocket;
class TQTimer;
class TQMutex;
+class TQRectF;
class CommAnalyzerBase;
namespace RemoteLab
@@ -35,6 +36,7 @@ namespace RemoteLab
public slots:
virtual bool openURL(const KURL &url);
+ void updateZoomWidgetLimits(const TQRectF& zoomRect);
private slots:
void postInit();
@@ -42,7 +44,8 @@ namespace RemoteLab
void updateGraticule();
void connectionFinishedCallback();
void disconnectFromServerCallback();
-// void connectionStatusChangedCallback();
+ void connectionStatusChangedCallback();
+ void setTickerMessage(TQString message);
void mainEventLoop();
virtual void postProcessTrace();
void saRefLevelChanged(double);
@@ -52,6 +55,7 @@ namespace RemoteLab
int m_commHandlerState;
int m_commHandlerMode;
int m_commHandlerCommandState;
+ TQTimer* m_forcedUpdateTimer;
TQTimer* m_updateTimeoutTimer;
bool m_connectionActiveAndValid;
unsigned char m_tickerState;