Move scope controls into scroll area

FIXME: Timer used to update scroll view width, should tie into layout system somehow
master
Timothy Pearson 5 years ago
parent 5bded609eb
commit af6a130210

@ -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>

@ -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;

@ -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;

Loading…
Cancel
Save