summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2019-06-23 18:09:27 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2019-06-23 18:09:41 -0500
commitaf6a13021057009105e7248ddff23529044344ba (patch)
tree5b3d62597a5e88c411898fe312ddf62bc4419c21
parent5bded609ebd25e774da43f898502ce7231af087b (diff)
downloadulab-af6a13021057009105e7248ddff23529044344ba.zip
ulab-af6a13021057009105e7248ddff23529044344ba.tar.gz
Move scope controls into scroll area
FIXME: Timer used to update scroll view width, should tie into layout system somehow
-rw-r--r--clients/tde/src/part/scope/layout.ui233
-rw-r--r--clients/tde/src/part/scope/part.cpp18
-rw-r--r--clients/tde/src/part/scope/part.h2
3 files changed, 148 insertions, 105 deletions
diff --git a/clients/tde/src/part/scope/layout.ui b/clients/tde/src/part/scope/layout.ui
index e14cb65..16b0d0c 100644
--- a/clients/tde/src/part/scope/layout.ui
+++ b/clients/tde/src/part/scope/layout.ui
@@ -78,126 +78,128 @@
</widget>
</grid>
</widget>
- <widget class="TQGroupBox" row="0" column="1">
+ <widget class="TQScrollView" row="0" column="1" rowspan="10">
<property name="name">
- <cstring>groupOscilloscopeCaptureControls</cstring>
+ <cstring>oscilloscopeControlCanvas</cstring>
</property>
- <property name="title">
- <string>Capture Controls</string>
- </property>
- <grid>
- <widget class="TQPushButton" row="0" column="0" colspan="1">
- <property name="name">
- <cstring>runControlStartButton</cstring>
- </property>
- <property name="text">
- <string>Run</string>
- </property>
- </widget>
- <widget class="TQPushButton" row="0" column="1" colspan="1">
- <property name="name">
- <cstring>runControlStopButton</cstring>
- </property>
- <property name="text">
- <string>Stop</string>
- </property>
- </widget>
- <widget class="TQWidget" row="1" column="0" colspan="2">
- <property name="name">
- <cstring>timebaseControlLayoutWidget</cstring>
- </property>
- </widget>
- <widget class="TQWidget" row="2" column="0" colspan="2">
- <property name="name">
- <cstring>traceControlLayoutWidget</cstring>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="TQGroupBox" row="1" column="1">
- <property name="name">
- <cstring>groupOscilloscopeAnalysisControls</cstring>
- </property>
- <property name="title">
- <string>Analysis Controls</string>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
</property>
- <grid>
- <widget class="TQWidget" row="0" column="0" colspan="1">
- <property name="name">
- <cstring>postProcessTraceControlLayoutWidget</cstring>
- </property>
- </widget>
- <widget class="TQWidget" row="1" column="0" colspan="1">
- <property name="name">
- <cstring>mathTraceControlLayoutWidget</cstring>
- </property>
- </widget>
- </grid>
</widget>
- <widget class="TQGroupBox" row="2" column="1">
+ <widget class="TQWidget">
<property name="name">
- <cstring>groupOscilloscopeAcquisitionControls</cstring>
- </property>
- <property name="title">
- <string>Acquisition Controls</string>
+ <cstring>oscilloscopeControlCanvasWidget</cstring>
</property>
<grid>
- <widget class="TQPushButton" row="0" column="0" colspan="1">
+ <widget class="TQGroupBox" row="0" column="0">
<property name="name">
- <cstring>acqStart</cstring>
- </property>
- <property name="text">
- <string>Start Acquisition</string>
- </property>
+ <cstring>groupOscilloscopeCaptureControls</cstring>
+ </property>
+ <property name="title">
+ <string>Capture Controls</string>
+ </property>
+ <grid>
+ <widget class="TQPushButton" row="0" column="0" colspan="1">
+ <property name="name">
+ <cstring>runControlStartButton</cstring>
+ </property>
+ <property name="text">
+ <string>Run</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="1" colspan="1">
+ <property name="name">
+ <cstring>runControlStopButton</cstring>
+ </property>
+ <property name="text">
+ <string>Stop</string>
+ </property>
+ </widget>
+ <widget class="TQWidget" row="1" column="0" colspan="2">
+ <property name="name">
+ <cstring>timebaseControlLayoutWidget</cstring>
+ </property>
+ </widget>
+ <widget class="TQWidget" row="2" column="0" colspan="2">
+ <property name="name">
+ <cstring>traceControlLayoutWidget</cstring>
+ </property>
+ </widget>
+ </grid>
</widget>
- <widget class="TQPushButton" row="0" column="1" colspan="1">
+ <widget class="TQGroupBox" row="1" column="0">
<property name="name">
- <cstring>acqStop</cstring>
- </property>
- <property name="text">
- <string>Stop Acquisition</string>
- </property>
+ <cstring>groupOscilloscopeAnalysisControls</cstring>
+ </property>
+ <property name="title">
+ <string>Analysis Controls</string>
+ </property>
+ <grid>
+ <widget class="TQWidget" row="0" column="0" colspan="1">
+ <property name="name">
+ <cstring>postProcessTraceControlLayoutWidget</cstring>
+ </property>
+ </widget>
+ <widget class="TQWidget" row="1" column="0" colspan="1">
+ <property name="name">
+ <cstring>mathTraceControlLayoutWidget</cstring>
+ </property>
+ </widget>
+ </grid>
</widget>
- <widget class="TQPushButton" row="1" column="0" colspan="1">
+ <widget class="TQGroupBox" row="2" column="0">
<property name="name">
- <cstring>waveformSave</cstring>
- </property>
- <property name="text">
- <string>Save Waveforms</string>
- </property>
+ <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>
+ <widget class="TQPushButton" row="1" column="0" colspan="1">
+ <property name="name">
+ <cstring>waveformSave</cstring>
+ </property>
+ <property name="text">
+ <string>Save Waveforms</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="1" colspan="1">
+ <property name="name">
+ <cstring>waveformRecall</cstring>
+ </property>
+ <property name="text">
+ <string>Recall Waveforms</string>
+ </property>
+ </widget>
+ </grid>
</widget>
- <widget class="TQPushButton" row="1" column="1" colspan="1">
+ <widget class="TQGroupBox" row="3" column="0">
<property name="name">
- <cstring>waveformRecall</cstring>
+ <cstring>groupOscilloscopeTestNotes</cstring>
</property>
- <property name="text">
- <string>Recall Waveforms</string>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="TQGroupBox" row="3" column="1">
- <property name="name">
- <cstring>groupOscilloscopeTestNotes</cstring>
- </property>
- <property name="title">
- <string>Notes</string>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>3</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>1</verstretch>
- </sizepolicy>
- </property>
- <grid>
- <widget class="KTextEdit" row="0" column="0" colspan="1">
- <property name="name">
- <cstring>userNotes</cstring>
- </property>
- <property name="text">
- <string></string>
+ <property name="title">
+ <string>Notes</string>
</property>
<property name="sizePolicy">
<sizepolicy>
@@ -207,7 +209,28 @@
<verstretch>1</verstretch>
</sizepolicy>
</property>
+ <grid>
+ <widget class="KTextEdit" row="0" column="0" colspan="1">
+ <property name="name">
+ <cstring>userNotes</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
</widget>
+ <property name="margin">
+ <number>0</number>
+ </property>
</grid>
</widget>
</grid>
diff --git a/clients/tde/src/part/scope/part.cpp b/clients/tde/src/part/scope/part.cpp
index e5ebfa4..401fd66 100644
--- a/clients/tde/src/part/scope/part.cpp
+++ b/clients/tde/src/part/scope/part.cpp
@@ -529,6 +529,9 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *
connect(m_forcedUpdateTimer, SIGNAL(timeout()), this, SLOT(mainEventLoop()));
m_updateTimeoutTimer = new TQTimer(this);
connect(m_updateTimeoutTimer, SIGNAL(timeout()), this, SLOT(mainEventLoop()));
+ m_controlWidgetViewFixupTimer = new TQTimer(this);
+ connect(m_controlWidgetViewFixupTimer, SIGNAL(timeout()), this, SLOT(controlWidgetViewSetWidth()));
+ m_controlWidgetViewFixupTimer->start(100, FALSE);
// Initialize data
m_hdivs = 0;
@@ -579,6 +582,10 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *
// Create widgets
m_base = new ScopeBase(widget());
+ m_base->oscilloscopeControlCanvas->addChild(m_base->oscilloscopeControlCanvasWidget);
+ m_base->oscilloscopeControlCanvas->setHScrollBarMode(TQScrollView::AlwaysOff);
+ m_base->oscilloscopeControlCanvas->setFrameShape(TQFrame::NoFrame);
+ m_base->oscilloscopeControlCanvas->setMargin(0);
m_traceControlWidgetGrid = new TQGridLayout(m_base->traceControlLayoutWidget);
m_postProcessTraceControlWidgetGrid = new TQGridLayout(m_base->postProcessTraceControlLayoutWidget);
m_mathTraceControlWidgetGrid = new TQGridLayout(m_base->mathTraceControlLayoutWidget);
@@ -643,6 +650,8 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *
}
ScopePart::~ScopePart() {
+ m_controlWidgetViewFixupTimer->stop();
+
if (m_instrumentMutex->locked()) {
printf("[WARNING] Exiting when data transfer still in progress!\n\r"); fflush(stdout);
}
@@ -2471,6 +2480,15 @@ void ScopePart::updateTraceControlWidgets() {
}
}
+void ScopePart::controlWidgetViewSetWidth() {
+ if (m_base->oscilloscopeControlCanvas->contentsHeight() > m_base->oscilloscopeControlCanvas->height()) {
+ m_base->oscilloscopeControlCanvas->setFixedWidth(m_base->oscilloscopeControlCanvas->contentsWidth() + m_base->oscilloscopeControlCanvas->verticalScrollBar()->sliderRect().width());
+ }
+ else {
+ m_base->oscilloscopeControlCanvas->setFixedWidth(m_base->oscilloscopeControlCanvas->contentsWidth());
+ }
+}
+
void ScopePart::traceControlEnableChanged(bool enabled) {
int i;
int channel = -1;
diff --git a/clients/tde/src/part/scope/part.h b/clients/tde/src/part/scope/part.h
index 2aa2130..46e2f5d 100644
--- a/clients/tde/src/part/scope/part.h
+++ b/clients/tde/src/part/scope/part.h
@@ -217,6 +217,7 @@ namespace RemoteLab
void postInit();
void processLockouts();
void updateGraticule();
+ void controlWidgetViewSetWidth();
void connectionFinishedCallback();
void disconnectFromServerCallback();
void connectionStatusChangedCallback();
@@ -258,6 +259,7 @@ namespace RemoteLab
int m_commHandlerCommandState;
TQTimer* m_forcedUpdateTimer;
TQTimer* m_updateTimeoutTimer;
+ TQTimer* m_controlWidgetViewFixupTimer;
bool m_connectionActiveAndValid;
unsigned char m_tickerState;
TQ_INT16 m_maxNumberOfTraces;