This commit is contained in:
maliakal_d 2019-07-02 13:50:20 +02:00
parent fc2cc7e00c
commit 975076043f
6 changed files with 16 additions and 17 deletions

View File

@ -145,7 +145,7 @@ class qDrawPlot : public QWidget {
unsigned int nHists{1}; unsigned int nHists{1};
double *datax1d{nullptr}; double *datax1d{nullptr};
std::vector<double *> datay1d; std::vector<double *> datay1d;
double *data2d; double *data2d{nullptr};
//options //options
bool isPlot{true}; bool isPlot{true};

View File

@ -229,6 +229,8 @@ void qDetectorMain::SetUpWidgetWindow() {
heightCentralWidget = centralwidget->size().height(); heightCentralWidget = centralwidget->size().height();
// Default zoom Tool Tip // Default zoom Tool Tip
zoomToolTip = dockWidgetPlot->toolTip(); zoomToolTip = dockWidgetPlot->toolTip();
Initialization();
} }
void qDetectorMain::SetUpDetector(const std::string fName, int multiID) { void qDetectorMain::SetUpDetector(const std::string fName, int multiID) {
@ -273,8 +275,6 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) {
//FIXME: not needed anymore due to client creating socket each time //FIXME: not needed anymore due to client creating socket each time
//myDet->setOnline(slsDetectorDefs::ONLINE_FLAG); //myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
//myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG); //myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
Initialization();
} }
void qDetectorMain::Initialization() { void qDetectorMain::Initialization() {

View File

@ -111,8 +111,8 @@ void qDrawPlot::SetupWidgetWindow() {
fileSaveName = "Image"; fileSaveName = "Image";
} }
SetupStatistics();
SetupPlots(); SetupPlots();
SetupStatistics();
SetDataCallBack(true); SetDataCallBack(true);
myDet->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack), this); myDet->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack), this);
myDet->registerProgressCallback(&(GetProgressCallBack), this); myDet->registerProgressCallback(&(GetProgressCallBack), this);
@ -219,7 +219,7 @@ void qDrawPlot::SetupPlots() {
plot2d = new SlsQt2DPlotLayout(boxPlot); plot2d = new SlsQt2DPlotLayout(boxPlot);
// default display data // default display data
if (data2d) if (data2d)
delete[] data2d; delete [] data2d;
data2d = new double[nPixelsY * nPixelsX]; data2d = new double[nPixelsY * nPixelsX];
for (unsigned int px = 0; px < nPixelsX; ++px) for (unsigned int px = 0; px < nPixelsX; ++px)
for (unsigned int py = 0; py < nPixelsY; ++py) for (unsigned int py = 0; py < nPixelsY; ++py)

View File

@ -178,11 +178,11 @@ void qTabDeveloper::CreateDACWidgets() {
dacLayout = new QGridLayout(boxDacs); dacLayout = new QGridLayout(boxDacs);
for (int i = 0; i < numDACWidgets; ++i) { for (int i = 0; i < numDACWidgets; ++i) {
lblDacs[i] = new QLabel(QString(dacNames[i].c_str()), boxDacs); lblDacs.push_back(new QLabel(QString(dacNames[i].c_str()), boxDacs));
spinDacs[i] = new MyDoubleSpinBox(i, boxDacs); spinDacs.push_back(new MyDoubleSpinBox(i, boxDacs));
spinDacs[i]->setMinimum(-1); spinDacs[i]->setMinimum(-1);
spinDacs[i]->setMaximum(10000); spinDacs[i]->setMaximum(10000);
lblDacsmV[i] = new QLabel("", boxDacs); lblDacsmV.push_back(new QLabel("", boxDacs));
dacLayout->addWidget(lblDacs[i], (int)(i / 2), ((i % 2) == 0) ? 1 : 5); dacLayout->addWidget(lblDacs[i], (int)(i / 2), ((i % 2) == 0) ? 1 : 5);
dacLayout->addWidget(spinDacs[i], (int)(i / 2), ((i % 2) == 0) ? 2 : 6); dacLayout->addWidget(spinDacs[i], (int)(i / 2), ((i % 2) == 0) ? 2 : 6);
@ -210,8 +210,8 @@ void qTabDeveloper::CreateADCWidgets() {
QGridLayout *adcLayout = new QGridLayout(boxAdcs); QGridLayout *adcLayout = new QGridLayout(boxAdcs);
for (int i = 0; i < numADCWidgets; ++i) { for (int i = 0; i < numADCWidgets; ++i) {
lblAdcs[i] = new QLabel(QString(adcNames[i].c_str()), boxAdcs); lblAdcs.push_back(new QLabel(QString(adcNames[i].c_str()), boxAdcs));
spinAdcs[i] = new QLineEdit(boxAdcs); spinAdcs.push_back(new QLineEdit(boxAdcs));
spinAdcs[i]->setReadOnly(true); spinAdcs[i]->setReadOnly(true);
adcLayout->addWidget(lblAdcs[i], (int)(i / 2), ((i % 2) == 0) ? 1 : 4); adcLayout->addWidget(lblAdcs[i], (int)(i / 2), ((i % 2) == 0) ? 1 : 4);

View File

@ -224,7 +224,7 @@ void qTabMeasurement::SetTimingMode(int val) {
void qTabMeasurement::GetNumMeasurements() { void qTabMeasurement::GetNumMeasurements() {
FILE_LOG(logDEBUG) << "Getting number of measurements"; FILE_LOG(logDEBUG) << "Getting number of measurements";
disconnect(spinNumMeasurements, SIGNAL(valueChanged(int)), this, SLOT(SetNumMeasurements(int))); disconnect(spinNumMeasurements, SIGNAL(valueChanged(int)), this, SLOT(SetNumMeasurements(int)));
spinNumFrames->setValue(myPlot->GetNumMeasurements()); spinNumMeasurements->setValue(myPlot->GetNumMeasurements());
connect(spinNumMeasurements, SIGNAL(valueChanged(int)), this, SLOT(SetNumMeasurements(int))); connect(spinNumMeasurements, SIGNAL(valueChanged(int)), this, SLOT(SetNumMeasurements(int)));
} }
@ -606,7 +606,7 @@ void qTabMeasurement::Refresh() {
GetExposureTime(); GetExposureTime();
GetAcquisitionPeriod(); GetAcquisitionPeriod();
GetNumTriggers(); GetNumTriggers();
if (delayImplemented) { if (delayImplemented) {cprintf(BLUE, "Delay implemented\n");
GetDelay(); GetDelay();
} }
if (sampleImplemented) { if (sampleImplemented) {

View File

@ -4185,15 +4185,16 @@ int multiSlsDetector::acquire() {
multi_shm()->stoppedFlag = 1; multi_shm()->stoppedFlag = 1;
} }
// let processing thread listen to these packets // let processing thread listen to these packets
sem_post(&sem_newRTAcquisition); if (multi_shm()->stoppedFlag == 0)
sem_post(&sem_newRTAcquisition);
} }
if (multi_shm()->stoppedFlag == 0) if (multi_shm()->stoppedFlag == 0)
startAndReadAll(); startAndReadAll();
// stop receiver // stop receiver
std::lock_guard<std::mutex> lock(mg);
if (receiver) { if (receiver) {
std::lock_guard<std::mutex> lock(mg);
if (stopReceiver() == FAIL) { if (stopReceiver() == FAIL) {
multi_shm()->stoppedFlag = 1; multi_shm()->stoppedFlag = 1;
} else { } else {
@ -4203,11 +4204,9 @@ int multiSlsDetector::acquire() {
// external process to be // external process to be
// done sending data to gui // done sending data to gui
} }
incrementFileIndex();
} }
incrementFileIndex();
// waiting for the data processing thread to finish! // waiting for the data processing thread to finish!
setJoinThreadFlag(true); setJoinThreadFlag(true);
sem_post(&sem_newRTAcquisition); sem_post(&sem_newRTAcquisition);