mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
sanitizer on, gui:removed qfuture, client: not implemented made specific as to what is not
This commit is contained in:
parent
a2e019ff36
commit
0a596c689b
4
cmk.sh
4
cmk.sh
@ -187,8 +187,8 @@ fi
|
||||
|
||||
#Debug
|
||||
if [ $DEBUG -eq 1 ]; then
|
||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
||||
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
||||
echo "Debug Option enabled"
|
||||
fi
|
||||
|
||||
|
@ -12,7 +12,6 @@ class detectorData;
|
||||
#include "Detector.h"
|
||||
|
||||
class QResizeEvent;
|
||||
#include <QFutureWatcher>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
@ -64,11 +63,11 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
|
||||
private slots:
|
||||
void SetSaveFileName(QString val);
|
||||
void AcquireFinished();
|
||||
void AcquireThread();
|
||||
void UpdatePlot();
|
||||
|
||||
|
||||
signals:
|
||||
void StartAcquireSignal();
|
||||
void AcquireFinishedSignal();
|
||||
void AbortSignal();
|
||||
void UpdateSignal();
|
||||
@ -81,7 +80,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
void DetachHists();
|
||||
static void GetAcquisitionFinishedCallBack(double currentProgress, int detectorStatus, void *this_pointer);
|
||||
static void GetDataCallBack(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex, void *this_pointer);
|
||||
std::string AcquireThread();
|
||||
void AcquisitionFinished(double currentProgress, int detectorStatus);
|
||||
void GetData(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex);
|
||||
void toDoublePixelData(double *dest, char *source, int size, int databytes, int dr, double *gaindest = NULL);
|
||||
@ -102,7 +100,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
SlsQtH1D * gainhist1d{nullptr};
|
||||
SlsQt2DPlot *plot2d{nullptr};
|
||||
SlsQt2DPlot *gainplot2d{nullptr};
|
||||
QFutureWatcher<std::string> *acqResultWatcher;
|
||||
|
||||
bool is1d{true};
|
||||
bool isRunning{false};
|
||||
|
@ -26,7 +26,7 @@ class SlsQt2DHist: public QwtRasterData{
|
||||
double x_width,y_width;
|
||||
|
||||
int nx,ny,nb;
|
||||
double *data;
|
||||
double *data{nullptr};
|
||||
double z_min,z_mean,z_max;
|
||||
bool z_mean_has_been_calculated;
|
||||
|
||||
|
@ -55,9 +55,11 @@ SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) {
|
||||
SlsQt2DPlot::~SlsQt2DPlot() {
|
||||
if (d_spectrogram) {
|
||||
d_spectrogram->detach();
|
||||
//delete d_spectrogram;
|
||||
}
|
||||
if (hist)
|
||||
if (hist) {
|
||||
delete hist;
|
||||
}
|
||||
if (colorMapLinearScale)
|
||||
delete colorMapLinearScale;
|
||||
if (colorMapLogScale)
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <QtConcurrentRun>
|
||||
#include <QResizeEvent>
|
||||
|
||||
|
||||
qDrawPlot::qDrawPlot(QWidget *parent, sls::Detector *detector) : QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -91,15 +90,12 @@ void qDrawPlot::SetupWidgetWindow() {
|
||||
SetupPlots();
|
||||
SetDataCallBack(true);
|
||||
det->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack), this);
|
||||
// future watcher to watch result of AcquireThread only because it uses signals/slots to handle acquire exception
|
||||
acqResultWatcher = new QFutureWatcher<std::string>();
|
||||
|
||||
Initialization();
|
||||
}
|
||||
|
||||
void qDrawPlot::Initialization() {
|
||||
connect(this, SIGNAL(UpdateSignal()), this, SLOT(UpdatePlot()));
|
||||
connect(acqResultWatcher, SIGNAL(finished()), this, SLOT(AcquireFinished()));
|
||||
connect(this, SIGNAL(StartAcquireSignal()), this, SLOT(AcquireThread()));
|
||||
}
|
||||
|
||||
void qDrawPlot::SetupPlots() {
|
||||
@ -640,16 +636,19 @@ void qDrawPlot::StartAcquisition() {
|
||||
xyRangeChanged = true;
|
||||
}
|
||||
|
||||
// acquisition in another thread
|
||||
QFuture<std::string> future = QtConcurrent::run(this, &qDrawPlot::AcquireThread);
|
||||
acqResultWatcher->setFuture(future);
|
||||
|
||||
emit StartAcquireSignal();
|
||||
FILE_LOG(logDEBUG) << "End of Starting Acquisition in qDrawPlot";
|
||||
}
|
||||
|
||||
void qDrawPlot::AcquireFinished() {
|
||||
FILE_LOG(logDEBUG) << "Acquisition Finished";
|
||||
std::string mess = acqResultWatcher->result();
|
||||
void qDrawPlot::AcquireThread() {
|
||||
FILE_LOG(logDEBUG) << "Acquire Thread";
|
||||
std::string mess;
|
||||
try {
|
||||
det->acquire();
|
||||
} catch (const std::exception &e) {
|
||||
mess = std::string(e.what());
|
||||
}
|
||||
FILE_LOG(logINFO) << "Acquisition Finished";
|
||||
// exception in acquire will not call acquisition finished call back, so handle it
|
||||
if (!mess.empty()) {
|
||||
FILE_LOG(logERROR) << "Acquisition Finished with an exception: " << mess;
|
||||
@ -662,17 +661,7 @@ void qDrawPlot::AcquireFinished() {
|
||||
} CATCH_DISPLAY("Could not stop receiver.", "qDrawPlot::AcquireFinished");
|
||||
emit AbortSignal();
|
||||
}
|
||||
FILE_LOG(logDEBUG) << "End of Acquisition Finished";
|
||||
}
|
||||
|
||||
std::string qDrawPlot::AcquireThread() {
|
||||
FILE_LOG(logDEBUG) << "Acquire Thread";
|
||||
try {
|
||||
det->acquire();
|
||||
} catch (const std::exception &e) {
|
||||
return std::string(e.what());
|
||||
}
|
||||
return std::string("");
|
||||
FILE_LOG(logDEBUG) << "End of Acquisition Finished";
|
||||
}
|
||||
|
||||
void qDrawPlot::GetAcquisitionFinishedCallBack(double currentProgress, int detectorStatus, void *this_pointer) {
|
||||
@ -786,6 +775,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, uint32_t subFra
|
||||
} else {
|
||||
Get2dData(rawData);
|
||||
}
|
||||
delete [] rawData;
|
||||
|
||||
FILE_LOG(logDEBUG) << "End of Get Data";
|
||||
emit UpdateSignal();
|
||||
|
@ -492,7 +492,7 @@ std::string CmdProxy::ClockFrequency(int action) {
|
||||
} else {
|
||||
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
|
||||
throw sls::RuntimeError("Not implemented for this detector.");
|
||||
throw sls::RuntimeError("clkfreq not implemented for this detector.");
|
||||
}
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
@ -526,7 +526,7 @@ std::string CmdProxy::ClockPhase(int action) {
|
||||
} else {
|
||||
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
|
||||
throw sls::RuntimeError("Not implemented for this detector.");
|
||||
throw sls::RuntimeError("clkphase not implemented for this detector.");
|
||||
}
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (args.size() == 1) {
|
||||
@ -576,7 +576,7 @@ std::string CmdProxy::MaxClockPhaseShift(int action) {
|
||||
} else {
|
||||
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
|
||||
throw sls::RuntimeError("Not implemented for this detector.");
|
||||
throw sls::RuntimeError("maxclkphaseshift not implemented for this detector.");
|
||||
}
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
@ -603,7 +603,7 @@ std::string CmdProxy::ClockDivider(int action) {
|
||||
} else {
|
||||
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
|
||||
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
|
||||
throw sls::RuntimeError("Not implemented for this detector.");
|
||||
throw sls::RuntimeError("clkdiv not implemented for this detector.");
|
||||
}
|
||||
if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
|
@ -1083,7 +1083,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw RuntimeError("Not implemented for this detector");
|
||||
throw RuntimeError("programfpga not implemented for this detector");
|
||||
}
|
||||
|
||||
FILE_LOG(logINFO)
|
||||
|
@ -2920,7 +2920,7 @@ int slsDetector::enableGapPixels(int val) {
|
||||
|
||||
int slsDetector::setTrimEn(const std::vector<int>& energies) {
|
||||
if (shm()->myDetectorType != EIGER) {
|
||||
throw RuntimeError("Not implemented for this detector.");
|
||||
throw RuntimeError("setTrimEn not implemented for this detector.");
|
||||
}
|
||||
if (energies.size() > MAX_TRIMEN) {
|
||||
std::ostringstream os;
|
||||
@ -2935,7 +2935,7 @@ int slsDetector::setTrimEn(const std::vector<int>& energies) {
|
||||
|
||||
std::vector<int> slsDetector::getTrimEn() {
|
||||
if (shm()->myDetectorType != EIGER) {
|
||||
throw RuntimeError("Not implemented for this detector.");
|
||||
throw RuntimeError("getTrimEn not implemented for this detector.");
|
||||
}
|
||||
return std::vector<int>(shm()->trimEnergies.begin(),
|
||||
shm()->trimEnergies.end());
|
||||
|
Loading…
x
Reference in New Issue
Block a user