diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-09-14 16:04:55 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-09-14 16:04:55 -0500 |
commit | 3b2621f9fea99c0c10b908941aaa919387b29fee (patch) | |
tree | 224e973b43dd938a6ce1f56c3b7a2241d9113b0e /clients/tde/src | |
parent | 8f56bf61ff4210b41226393d240fab14f01eee61 (diff) | |
download | ulab-3b2621f9fea99c0c10b908941aaa919387b29fee.tar.gz ulab-3b2621f9fea99c0c10b908941aaa919387b29fee.zip |
Fix a number of memory initialization glitches
Fix math waveform offset saving
Fix insane memory usage during SASL negotiation
Diffstat (limited to 'clients/tde/src')
-rw-r--r-- | clients/tde/src/part/scope/part.cpp | 105 | ||||
-rw-r--r-- | clients/tde/src/part/scope/part.h | 2 | ||||
-rw-r--r-- | clients/tde/src/widgets/tracewidget.cpp | 10 |
3 files changed, 62 insertions, 55 deletions
diff --git a/clients/tde/src/part/scope/part.cpp b/clients/tde/src/part/scope/part.cpp index cb38e07..274480a 100644 --- a/clients/tde/src/part/scope/part.cpp +++ b/clients/tde/src/part/scope/part.cpp @@ -455,7 +455,7 @@ void TimebaseControlWidget::sdivChanged(int index) { ScopePart::ScopePart( 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_connectionActiveAndValid(false), - m_triggerChannel(-1), m_settingsChanged(false), m_base(0), stopTraceUpdate(false) + m_tickerState(0), m_triggerChannel(-1), m_running(false), m_triggerLevel(0), m_settingsChanged(false), m_base(0), m_stopTraceUpdate(false) { // Initialize important base class variables m_clientLibraryName = CLIENT_LIBRARY; @@ -619,7 +619,7 @@ void ScopePart::processLockouts() { } // Middle area - if (((m_commHandlerMode < 2) && (m_commHandlerState < 50)) || (stopTraceUpdate)) { + if (((m_commHandlerMode < 2) && (m_commHandlerState < 50)) || (m_stopTraceUpdate)) { m_base->groupOscilloscopeCaptureControls->setEnabled(false); } else { @@ -627,7 +627,7 @@ void ScopePart::processLockouts() { } // Least area - if (stopTraceUpdate) { + if (m_stopTraceUpdate) { m_base->acqStop->setEnabled(false); m_base->acqStart->setEnabled(true); m_base->waveformSave->setEnabled(true); @@ -793,7 +793,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -803,7 +803,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -836,7 +836,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -846,7 +846,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -882,7 +882,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -892,7 +892,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -928,7 +928,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -938,7 +938,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -950,7 +950,6 @@ void ScopePart::mainEventLoop() { else if (m_commHandlerState == ScopeState_PermittedSecondsDivRequest) { // Get permitted seconds/div settings, step 1 ds << TQString("GETPERMITTEDSDIVS"); - ds << m_currentOpChannel; m_socket->writeEndOfFrame(); SET_NEXT_STATE_DATA_WAITING(ScopeState_PermittedSecondsDivRequest+1) @@ -977,7 +976,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -987,7 +986,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1028,7 +1027,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1038,7 +1037,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1090,7 +1089,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1100,7 +1099,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1144,7 +1143,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1154,7 +1153,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1201,7 +1200,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1211,7 +1210,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1255,7 +1254,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1265,7 +1264,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1308,7 +1307,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1318,7 +1317,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1356,7 +1355,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1366,7 +1365,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1403,7 +1402,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1413,7 +1412,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1455,7 +1454,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1465,7 +1464,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1510,7 +1509,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1520,7 +1519,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1594,7 +1593,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1604,7 +1603,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1667,7 +1666,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1677,7 +1676,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1731,7 +1730,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1741,7 +1740,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1782,7 +1781,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1792,7 +1791,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1833,7 +1832,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1843,7 +1842,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1884,7 +1883,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1894,7 +1893,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -1951,7 +1950,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -1961,7 +1960,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -2010,7 +2009,7 @@ void ScopePart::mainEventLoop() { EXEC_NEXT_STATE_IMMEDIATELY } else { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { COMMUNICATIONS_FAILED } else { @@ -2020,7 +2019,7 @@ void ScopePart::mainEventLoop() { } else { if (!m_updateTimeoutTimer->isActive()) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { UPDATEDISPLAY_TIMEOUT } else { @@ -2030,7 +2029,7 @@ void ScopePart::mainEventLoop() { } } else if (m_commHandlerCommandState == 3) { - if (stopTraceUpdate == false) { + if (m_stopTraceUpdate == false) { m_commHandlerCommandState = 0; EXEC_NEXT_STATE_IMMEDIATELY } @@ -2055,14 +2054,14 @@ void ScopePart::postProcessTrace() { } void ScopePart::startDAQ() { - stopTraceUpdate = false; + m_stopTraceUpdate = false; if (m_socket) m_socket->clearIncomingData(); EXEC_NEXT_STATE_IMMEDIATELY } void ScopePart::stopDAQ() { if (m_commHandlerMode < 2) { - stopTraceUpdate = true; + m_stopTraceUpdate = true; for (int i=0; i<=MAXTRACES;i++) { m_channelActiveSet[i] = false; m_voltsDivSet[i] = false; diff --git a/clients/tde/src/part/scope/part.h b/clients/tde/src/part/scope/part.h index 18d2e75..f483a6b 100644 --- a/clients/tde/src/part/scope/part.h +++ b/clients/tde/src/part/scope/part.h @@ -266,7 +266,7 @@ namespace RemoteLab MathOperatorList m_availableMathOperators; ScopeBase* m_base; TQMutex* m_instrumentMutex; - bool stopTraceUpdate; + bool m_stopTraceUpdate; }; } diff --git a/clients/tde/src/widgets/tracewidget.cpp b/clients/tde/src/widgets/tracewidget.cpp index 8ceba00..5aec418 100644 --- a/clients/tde/src/widgets/tracewidget.cpp +++ b/clients/tde/src/widgets/tracewidget.cpp @@ -49,6 +49,10 @@ #define CURSOR_MOVE_CAPTURE_DISTANCE 0 TQRectF::TQRectF() { + m_x = 0; + m_y = 0; + m_w = 0; + m_h = 0; m_valid = false; } @@ -537,6 +541,9 @@ TQSize TraceCursorLabelLayout::minimumSize() const TraceData::TraceData(TraceWidget* parent, TQWidget* labelParent) : TQObject(), parentWidget(parent) { color = TQColor(0, 255, 0); numberOfSamples = 0; + sampleMax = 0; + sampleMin = 0; + sampleAverage = 0; leftEdgeIndex = -1; rightEdgeIndex = -1; offset = 0.0; @@ -812,7 +819,7 @@ void TraceData::setVPosition() { double newoffset; ok = false; - newoffset = KInputDialog::getDouble(i18n("Set Trace Offset"), i18n("New offset for %1 (%2):").arg(traceName).arg(verticalUnits), offset, (double)-2147483647, (double)2147483647, 0.1, 1, &ok, parentWidget); + newoffset = KInputDialog::getDouble(i18n("Set Trace Offset"), i18n("New offset for %1 (%2):").arg(traceName).arg(verticalUnits), offset, double(INT_MIN), double(INT_MAX), 0.1, 1, &ok, parentWidget); if (ok) { offset = newoffset; emit(offsetChanged(offset)); @@ -1825,6 +1832,7 @@ void TraceWidget::setSamples(uint traceNumber, TQDoubleArray& tqda, bool deferUp m_traceArray[traceNumber]->sampleAverage = m_traceArray[traceNumber]->sampleAverage / m_traceArray[traceNumber]->numberOfSamples; if (!deferUpdate) { + updateTraceText(); updateCursorText(); m_graticuleWidget->repaint(false); } |