mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
WIP
This commit is contained in:
parent
455252f2f3
commit
864db79a13
@ -103,7 +103,8 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
if(SLS_USE_SANITIZER)
|
if(SLS_USE_SANITIZER)
|
||||||
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
|
||||||
|
#target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||||
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||||
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
|
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||||
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||||
|
3
cmk.sh
3
cmk.sh
@ -181,7 +181,8 @@ fi
|
|||||||
|
|
||||||
#Debug
|
#Debug
|
||||||
if [ $DEBUG -eq 1 ]; then
|
if [ $DEBUG -eq 1 ]; then
|
||||||
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"
|
echo "Debug Option enabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ class qCloneWidget : public QMainWindow {
|
|||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char *GetCurrentTimeStamp();
|
|
||||||
void DisplayStats(bool enable, QString min, QString max, QString sum);
|
void DisplayStats(bool enable, QString min, QString max, QString sum);
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ qCloneWidget::qCloneWidget(QWidget *parent, int id, QString title, QString xTitl
|
|||||||
marker(nullptr), nomarker(nullptr), mainLayout(nullptr), boxPlot(nullptr), lblHistTitle(nullptr) {
|
marker(nullptr), nomarker(nullptr), mainLayout(nullptr), boxPlot(nullptr), lblHistTitle(nullptr) {
|
||||||
// Window title
|
// Window title
|
||||||
char winTitle[300], currTime[50];
|
char winTitle[300], currTime[50];
|
||||||
strcpy(currTime, GetCurrentTimeStamp());
|
strcpy(currTime, NowTime().c_str());
|
||||||
sprintf(winTitle, "Snapshot:%d - %s", id, currTime);
|
sprintf(winTitle, "Snapshot:%d - %s", id, currTime);
|
||||||
setWindowTitle(QString(winTitle));
|
setWindowTitle(QString(winTitle));
|
||||||
|
|
||||||
@ -204,19 +204,6 @@ void qCloneWidget::closeEvent(QCloseEvent *event) {
|
|||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
char *qCloneWidget::GetCurrentTimeStamp() {
|
|
||||||
char output[30];
|
|
||||||
char *result;
|
|
||||||
|
|
||||||
//using sys cmds to get output or str
|
|
||||||
FILE *sysFile = popen("date", "r");
|
|
||||||
fgets(output, sizeof(output), sysFile);
|
|
||||||
pclose(sysFile);
|
|
||||||
|
|
||||||
result = output + 0;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) {
|
void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
QWidget *widgetStatistics = new QWidget(this);
|
QWidget *widgetStatistics = new QWidget(this);
|
||||||
|
@ -284,14 +284,14 @@ void qDetectorMain::Initialization() {
|
|||||||
connect(tabs,SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*)));
|
connect(tabs,SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*)));
|
||||||
// Measurement tab
|
// Measurement tab
|
||||||
connect(tabMeasurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
connect(tabMeasurement, SIGNAL(StartSignal()), this,SLOT(EnableTabs()));
|
||||||
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), tabPlot, SLOT(SetSaveFileName(QString)));
|
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), myPlot, SLOT(SetSaveFileName(QString)));
|
||||||
// Plot tab
|
// Plot tab
|
||||||
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this, SLOT(SetZoomToolTip(bool)));
|
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this, SLOT(SetZoomToolTip(bool)));
|
||||||
|
|
||||||
// Plotting
|
// Plotting
|
||||||
// When the acquisition is finished, must update the meas tab
|
// When the acquisition is finished, must update the meas tab
|
||||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
|
connect(myPlot, SIGNAL(AcquireFinishedSignal()), this, SLOT(EnableTabs()));
|
||||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tabMeasurement, SLOT(UpdateFinished()));
|
connect(myPlot, SIGNAL(AcquireFinishedSignal()), tabMeasurement, SLOT(UpdateFinished()));
|
||||||
|
|
||||||
// menubar
|
// menubar
|
||||||
// Modes Menu
|
// Modes Menu
|
||||||
|
@ -122,7 +122,6 @@ void qDrawPlot::SetupWidgetWindow() {
|
|||||||
|
|
||||||
void qDrawPlot::Initialization() {
|
void qDrawPlot::Initialization() {
|
||||||
connect(this, SIGNAL(AcquireSignal()), this, SLOT(AcquireThread()));
|
connect(this, SIGNAL(AcquireSignal()), this, SLOT(AcquireThread()));
|
||||||
connect(this, SIGNAL(UpdatePlotSignal()), this, SLOT(UpdatePlot()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetupStatistics() {
|
void qDrawPlot::SetupStatistics() {
|
||||||
@ -207,6 +206,7 @@ void qDrawPlot::SetupPlots() {
|
|||||||
// default display data
|
// default display data
|
||||||
for (unsigned int px = 0; px < nPixelsX; ++px) {
|
for (unsigned int px = 0; px < nPixelsX; ++px) {
|
||||||
datax1d[px] = px;
|
datax1d[px] = px;
|
||||||
|
datay1d[0][px] = 0;
|
||||||
}
|
}
|
||||||
// add a hist
|
// add a hist
|
||||||
DetachHists();
|
DetachHists();
|
||||||
|
@ -100,7 +100,7 @@ void qTabAdvanced::Initialization() {
|
|||||||
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
|
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
|
||||||
|
|
||||||
// roi
|
// roi
|
||||||
if (gridRoi->isEnabled()) {
|
if (tab_roi->isEnabled()) {
|
||||||
connect(btnAddRoi, SIGNAL(clicked()), this, SLOT(AddROISlot()));
|
connect(btnAddRoi, SIGNAL(clicked()), this, SLOT(AddROISlot()));
|
||||||
connect(btnSetRoi, SIGNAL(clicked()), this, SLOT(SetROI()));
|
connect(btnSetRoi, SIGNAL(clicked()), this, SLOT(SetROI()));
|
||||||
connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(GetROI()));
|
connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(GetROI()));
|
||||||
@ -881,7 +881,7 @@ void qTabAdvanced::Refresh() {
|
|||||||
SetDetector(comboDetector->currentIndex());
|
SetDetector(comboDetector->currentIndex());
|
||||||
|
|
||||||
// roi
|
// roi
|
||||||
if (gridRoi->isEnabled()) {
|
if (tab_roi->isEnabled()) {
|
||||||
GetROI();
|
GetROI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ void qTabDataOutput::SetRateCorrection() {
|
|||||||
|
|
||||||
void qTabDataOutput::GetSpeed() {
|
void qTabDataOutput::GetSpeed() {
|
||||||
FILE_LOG(logDEBUG) << "Getting Speed";
|
FILE_LOG(logDEBUG) << "Getting Speed";
|
||||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int retval = myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER);
|
int retval = myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER);
|
||||||
@ -327,7 +327,7 @@ void qTabDataOutput::GetSpeed() {
|
|||||||
}
|
}
|
||||||
} CATCH_DISPLAY ("Could not get speed.", "qTabDataOutput::GetSpeed")
|
} CATCH_DISPLAY ("Could not get speed.", "qTabDataOutput::GetSpeed")
|
||||||
|
|
||||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
|
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::SetSpeed(int speed) {
|
void qTabDataOutput::SetSpeed(int speed) {
|
||||||
|
@ -23,7 +23,6 @@ qTabDeveloper::qTabDeveloper(QWidget *parent, multiSlsDetector *detector) :
|
|||||||
QWidget(parent), myDet(detector), detType(slsDetectorDefs::GENERIC), numDACWidgets(0), numADCWidgets(0),
|
QWidget(parent), myDet(detector), detType(slsDetectorDefs::GENERIC), numDACWidgets(0), numADCWidgets(0),
|
||||||
boxDacs(nullptr), boxAdcs(nullptr), lblHV(nullptr), comboHV(nullptr), spinHV(nullptr), dacLayout(nullptr), comboDetector(nullptr), layout(nullptr) {
|
boxDacs(nullptr), boxAdcs(nullptr), lblHV(nullptr), comboHV(nullptr), spinHV(nullptr), dacLayout(nullptr), comboDetector(nullptr), layout(nullptr) {
|
||||||
SetupWidgetWindow();
|
SetupWidgetWindow();
|
||||||
Initialization();
|
|
||||||
FILE_LOG(logDEBUG) << "Developer ready";
|
FILE_LOG(logDEBUG) << "Developer ready";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,6 +145,8 @@ void qTabDeveloper::SetupWidgetWindow() {
|
|||||||
layout->addWidget(boxDacs, 1, 0);
|
layout->addWidget(boxDacs, 1, 0);
|
||||||
CreateADCWidgets();
|
CreateADCWidgets();
|
||||||
|
|
||||||
|
Initialization();
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +157,8 @@ void qTabDeveloper::Initialization() {
|
|||||||
connect(spinDacs[i], SIGNAL(editingFinished(int)), this, SLOT(SetDac(int)));
|
connect(spinDacs[i], SIGNAL(editingFinished(int)), this, SLOT(SetDac(int)));
|
||||||
if (comboHV != nullptr) {
|
if (comboHV != nullptr) {
|
||||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
} else {
|
}
|
||||||
|
if (spinHV != nullptr) {
|
||||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -338,9 +340,10 @@ void qTabDeveloper::GetHighVoltage() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
FILE_LOG(logDEBUG) << "Getting High Voltage";
|
FILE_LOG(logDEBUG) << "Getting High Voltage";
|
||||||
if (comboHV == nullptr) {
|
if (spinHV != nullptr) {
|
||||||
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
} else {
|
}
|
||||||
|
if (comboHV != nullptr) {
|
||||||
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,9 +390,10 @@ void qTabDeveloper::GetHighVoltage() {
|
|||||||
|
|
||||||
} CATCH_DISPLAY ("Could not get high voltage.", "qTabDeveloper::GetHighVoltage")
|
} CATCH_DISPLAY ("Could not get high voltage.", "qTabDeveloper::GetHighVoltage")
|
||||||
|
|
||||||
if (comboHV == nullptr) {
|
if (spinHV != nullptr) {
|
||||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
} else {
|
}
|
||||||
|
if (comboHV != nullptr) {
|
||||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,20 +35,21 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
// timer to update the progress bar
|
// timer to update the progress bar
|
||||||
progressTimer = new QTimer(this);
|
progressTimer = new QTimer(this);
|
||||||
|
|
||||||
delayImplemented = false;
|
|
||||||
sampleImplemented = false;
|
sampleImplemented = false;
|
||||||
|
delayImplemented = true;
|
||||||
|
// by default, delay is disabled in form
|
||||||
|
lblDelay->setEnabled(true);
|
||||||
|
spinDelay->setEnabled(true);
|
||||||
|
comboDelayUnit->setEnabled(true);
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
switch(myDet->getDetectorTypeAsEnum()) {
|
switch(myDet->getDetectorTypeAsEnum()) {
|
||||||
case slsDetectorDefs::MOENCH:
|
case slsDetectorDefs::MOENCH:
|
||||||
lblNumSamples->setEnabled(false);
|
lblNumSamples->setEnabled(true);
|
||||||
spinNumSamples->setEnabled(false);
|
spinNumSamples->setEnabled(true);
|
||||||
sampleImplemented = true;
|
sampleImplemented = true;
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::EIGER:
|
case slsDetectorDefs::EIGER:
|
||||||
lblDelay->setEnabled(false);
|
delayImplemented = false;
|
||||||
spinDelay->setEnabled(false);
|
|
||||||
comboDelayUnit->setEnabled(false);
|
|
||||||
delayImplemented = true;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -606,7 +607,7 @@ void qTabMeasurement::Refresh() {
|
|||||||
GetExposureTime();
|
GetExposureTime();
|
||||||
GetAcquisitionPeriod();
|
GetAcquisitionPeriod();
|
||||||
GetNumTriggers();
|
GetNumTriggers();
|
||||||
if (delayImplemented) {cprintf(BLUE, "Delay implemented\n");
|
if (delayImplemented) {
|
||||||
GetDelay();
|
GetDelay();
|
||||||
}
|
}
|
||||||
if (sampleImplemented) {
|
if (sampleImplemented) {
|
||||||
|
@ -205,19 +205,20 @@ void qTabSettings::SetDynamicRange(int index) {
|
|||||||
|
|
||||||
void qTabSettings::GetThresholdEnergy() {
|
void qTabSettings::GetThresholdEnergy() {
|
||||||
FILE_LOG(logDEBUG) << "Getting theshold energy";
|
FILE_LOG(logDEBUG) << "Getting theshold energy";
|
||||||
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy()));
|
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy(int)));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto retval = myDet->getThresholdEnergy();
|
auto retval = myDet->getThresholdEnergy();
|
||||||
if (retval == -1) {
|
/*if (retval == -1) { commenting out as default is -1, handle this when API changes
|
||||||
qDefs::Message(qDefs::WARNING, "Threshold Energy is inconsistent for all detectors.", "qTabDataOutput::GetThresholdEnergy");
|
qDefs::Message(qDefs::WARNING, "Threshold Energy is inconsistent for all detectors.", "qTabDataOutput::GetThresholdEnergy");
|
||||||
spinThreshold->setValue(-1);
|
spinThreshold->setValue(-1);
|
||||||
} else {
|
} else {
|
||||||
spinThreshold->setValue(retval);
|
spinThreshold->setValue(retval);
|
||||||
}
|
}*/
|
||||||
|
spinThreshold->setValue(retval);
|
||||||
} CATCH_DISPLAY ("Could not get threshold energy.", "qTabDataOutput::GetThresholdEnergy")
|
} CATCH_DISPLAY ("Could not get threshold energy.", "qTabDataOutput::GetThresholdEnergy")
|
||||||
|
|
||||||
connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy()));
|
connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabSettings::SetThresholdEnergy(int index) {
|
void qTabSettings::SetThresholdEnergy(int index) {
|
||||||
|
@ -218,7 +218,7 @@ int slsReceiverTCPIPInterface::decode_function(Interface &socket) {
|
|||||||
} else {
|
} else {
|
||||||
FILE_LOG(logDEBUG1) << "calling function fnum: " << fnum << " ("
|
FILE_LOG(logDEBUG1) << "calling function fnum: " << fnum << " ("
|
||||||
<< getFunctionNameFromEnum((enum detFuncs)fnum)
|
<< getFunctionNameFromEnum((enum detFuncs)fnum)
|
||||||
<< ") located at " << flist[fnum];
|
<< ")";
|
||||||
ret = (this->*flist[fnum])(socket);
|
ret = (this->*flist[fnum])(socket);
|
||||||
FILE_LOG(logDEBUG1)
|
FILE_LOG(logDEBUG1)
|
||||||
<< "Function " << getFunctionNameFromEnum((enum detFuncs)fnum)
|
<< "Function " << getFunctionNameFromEnum((enum detFuncs)fnum)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user