From b498043ea612fa3148bf1d7ea2a39c46092addf8 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Tue, 5 Dec 2017 16:03:49 +0100 Subject: [PATCH] remember old read freq if not 0 in gui --- slsDetectorGui/src/qTabPlot.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index 9cd16607b..a53395462 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -773,6 +773,8 @@ void qTabPlot::EnableScanBox(){ disconnect(btnGroupPlotType,SIGNAL(buttonClicked(int)),this, SLOT(SetPlot())); disconnect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox())); + int oldfreqvalue = myDet->setReadReceiverFrequency(); + int mode0 = myDet->getScanMode(0); int mode1 = myDet->getScanMode(1); @@ -943,6 +945,18 @@ void qTabPlot::EnableScanBox(){ pageHistogram_2->setEnabled(false); } + + // if it was set to read every frame + if (oldfreqvalue != 0 && (comboFrequency->currentIndex() != 1 || spinNthFrame->value() != oldfreqvalue)) { + disconnect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency())); + disconnect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency())); + comboFrequency->setCurrentIndex(1); + spinNthFrame->setValue(1); + SetFrequency(); + connect(spinNthFrame, SIGNAL(editingFinished()), this, SLOT(SetFrequency())); + connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFrequency())); + } + connect(btnGroupPlotType,SIGNAL(buttonClicked(int)),this, SLOT(SetPlot())); connect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox()));