|
|
|
@ -638,6 +638,7 @@ ScopePart::ScopePart( TQWidget *parentWidget, const char *widgetName, TQObject *
|
|
|
|
|
connect(m_traceWidget, SIGNAL(zoomBoxChanged(const TQRectF&)), this, SLOT(updateZoomWidgetLimits(const TQRectF&)));
|
|
|
|
|
connect(m_traceWidget, SIGNAL(offsetChanged(uint, double)), m_base->traceZoomWidget, SLOT(setTraceOffset(uint, double)));
|
|
|
|
|
|
|
|
|
|
connect(m_base->dumpSamples, SIGNAL(clicked()), this, SLOT(dumpSamples()));
|
|
|
|
|
connect(m_base->acqStart, SIGNAL(clicked()), this, SLOT(startDAQ()));
|
|
|
|
|
connect(m_base->acqStop, SIGNAL(clicked()), this, SLOT(stopDAQ()));
|
|
|
|
|
connect(m_base->runControlStartButton, SIGNAL(clicked()), this, SLOT(startScope()));
|
|
|
|
@ -2133,6 +2134,30 @@ void ScopePart::startDAQ() {
|
|
|
|
|
EXEC_NEXT_STATE_IMMEDIATELY
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScopePart::dumpSamples() {
|
|
|
|
|
// Calculate left and right extent of zoom area
|
|
|
|
|
TQRectF currentZoomBox = m_traceWidget->zoomBox();
|
|
|
|
|
|
|
|
|
|
TQString csvData = "";
|
|
|
|
|
for (int traceno=1; traceno<=m_maxNumberOfTraces; traceno++) {
|
|
|
|
|
if (m_channelActive[traceno]) {
|
|
|
|
|
TQString saveFileName = TQString("/tmp/trace%1.csv").arg(traceno);
|
|
|
|
|
TQFile file(saveFileName);
|
|
|
|
|
file.open(IO_WriteOnly);
|
|
|
|
|
csvData = "";
|
|
|
|
|
int start_sample = ((m_samplesInTrace[traceno] * currentZoomBox.x()) / 100.0);
|
|
|
|
|
int end_sample = ((m_samplesInTrace[traceno] * currentZoomBox.width()) / 100.0) + start_sample;
|
|
|
|
|
TQDoubleArray positions = m_traceWidget->positions(traceno-1);
|
|
|
|
|
TQDoubleArray values = m_traceWidget->samples(traceno-1);
|
|
|
|
|
for (int sample=start_sample; sample<end_sample; sample++) {
|
|
|
|
|
csvData += TQString("%1,%2\n").arg(positions[sample]).arg(values[sample]);
|
|
|
|
|
}
|
|
|
|
|
csvData += "\n";
|
|
|
|
|
file.writeBlock(csvData.ascii(), strlen(csvData.ascii()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScopePart::stopDAQ() {
|
|
|
|
|
if (m_commHandlerMode < 2) {
|
|
|
|
|
m_stopTraceUpdate = true;
|
|
|
|
|