This commit is contained in:
maliakal_d 2019-07-02 17:11:03 +02:00
parent 455252f2f3
commit 864db79a13
12 changed files with 38 additions and 44 deletions

View File

@ -103,7 +103,8 @@ endif()
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_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)

3
cmk.sh
View File

@ -181,7 +181,8 @@ fi
#Debug
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"
fi

View File

@ -40,7 +40,6 @@ class qCloneWidget : public QMainWindow {
void closeEvent(QCloseEvent *event);
private:
char *GetCurrentTimeStamp();
void DisplayStats(bool enable, QString min, QString max, QString sum);

View File

@ -28,7 +28,7 @@ qCloneWidget::qCloneWidget(QWidget *parent, int id, QString title, QString xTitl
marker(nullptr), nomarker(nullptr), mainLayout(nullptr), boxPlot(nullptr), lblHistTitle(nullptr) {
// Window title
char winTitle[300], currTime[50];
strcpy(currTime, GetCurrentTimeStamp());
strcpy(currTime, NowTime().c_str());
sprintf(winTitle, "Snapshot:%d - %s", id, currTime);
setWindowTitle(QString(winTitle));
@ -204,19 +204,6 @@ void qCloneWidget::closeEvent(QCloseEvent *event) {
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) {
if (enable) {
QWidget *widgetStatistics = new QWidget(this);

View File

@ -284,14 +284,14 @@ void qDetectorMain::Initialization() {
connect(tabs,SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));//( QWidget*)));
// Measurement tab
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
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this, SLOT(SetZoomToolTip(bool)));
// Plotting
// When the acquisition is finished, must update the meas tab
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tabMeasurement, SLOT(UpdateFinished()));
connect(myPlot, SIGNAL(AcquireFinishedSignal()), this, SLOT(EnableTabs()));
connect(myPlot, SIGNAL(AcquireFinishedSignal()), tabMeasurement, SLOT(UpdateFinished()));
// menubar
// Modes Menu

View File

@ -122,7 +122,6 @@ void qDrawPlot::SetupWidgetWindow() {
void qDrawPlot::Initialization() {
connect(this, SIGNAL(AcquireSignal()), this, SLOT(AcquireThread()));
connect(this, SIGNAL(UpdatePlotSignal()), this, SLOT(UpdatePlot()));
}
void qDrawPlot::SetupStatistics() {
@ -207,6 +206,7 @@ void qDrawPlot::SetupPlots() {
// default display data
for (unsigned int px = 0; px < nPixelsX; ++px) {
datax1d[px] = px;
datay1d[0][px] = 0;
}
// add a hist
DetachHists();

View File

@ -100,7 +100,7 @@ void qTabAdvanced::Initialization() {
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
// roi
if (gridRoi->isEnabled()) {
if (tab_roi->isEnabled()) {
connect(btnAddRoi, SIGNAL(clicked()), this, SLOT(AddROISlot()));
connect(btnSetRoi, SIGNAL(clicked()), this, SLOT(SetROI()));
connect(btnGetRoi, SIGNAL(clicked()), this, SLOT(GetROI()));
@ -881,7 +881,7 @@ void qTabAdvanced::Refresh() {
SetDetector(comboDetector->currentIndex());
// roi
if (gridRoi->isEnabled()) {
if (tab_roi->isEnabled()) {
GetROI();
}

View File

@ -308,7 +308,7 @@ void qTabDataOutput::SetRateCorrection() {
void qTabDataOutput::GetSpeed() {
FILE_LOG(logDEBUG) << "Getting Speed";
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed()));
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
try {
int retval = myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER);
@ -327,7 +327,7 @@ void 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) {

View File

@ -23,7 +23,6 @@ qTabDeveloper::qTabDeveloper(QWidget *parent, multiSlsDetector *detector) :
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) {
SetupWidgetWindow();
Initialization();
FILE_LOG(logDEBUG) << "Developer ready";
}
@ -146,6 +145,8 @@ void qTabDeveloper::SetupWidgetWindow() {
layout->addWidget(boxDacs, 1, 0);
CreateADCWidgets();
Initialization();
Refresh();
}
@ -156,7 +157,8 @@ void qTabDeveloper::Initialization() {
connect(spinDacs[i], SIGNAL(editingFinished(int)), this, SLOT(SetDac(int)));
if (comboHV != nullptr) {
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
} else {
}
if (spinHV != nullptr) {
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
}
}
@ -338,9 +340,10 @@ void qTabDeveloper::GetHighVoltage() {
return;
FILE_LOG(logDEBUG) << "Getting High Voltage";
if (comboHV == nullptr) {
if (spinHV != nullptr) {
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
} else {
}
if (comboHV != nullptr) {
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
}
@ -387,9 +390,10 @@ void 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()));
} else {
}
if (comboHV != nullptr) {
connect(comboHV, SIGNAL(currentIndexChanged(int)), this, SLOT(SetHighVoltage()));
}
}

View File

@ -35,20 +35,21 @@ void qTabMeasurement::SetupWidgetWindow() {
// timer to update the progress bar
progressTimer = new QTimer(this);
delayImplemented = 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
switch(myDet->getDetectorTypeAsEnum()) {
case slsDetectorDefs::MOENCH:
lblNumSamples->setEnabled(false);
spinNumSamples->setEnabled(false);
lblNumSamples->setEnabled(true);
spinNumSamples->setEnabled(true);
sampleImplemented = true;
break;
case slsDetectorDefs::EIGER:
lblDelay->setEnabled(false);
spinDelay->setEnabled(false);
comboDelayUnit->setEnabled(false);
delayImplemented = true;
delayImplemented = false;
break;
default:
break;
@ -606,7 +607,7 @@ void qTabMeasurement::Refresh() {
GetExposureTime();
GetAcquisitionPeriod();
GetNumTriggers();
if (delayImplemented) {cprintf(BLUE, "Delay implemented\n");
if (delayImplemented) {
GetDelay();
}
if (sampleImplemented) {

View File

@ -205,19 +205,20 @@ void qTabSettings::SetDynamicRange(int index) {
void qTabSettings::GetThresholdEnergy() {
FILE_LOG(logDEBUG) << "Getting theshold energy";
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy()));
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy(int)));
try {
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");
spinThreshold->setValue(-1);
} else {
spinThreshold->setValue(retval);
}
}*/
spinThreshold->setValue(retval);
} 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) {

View File

@ -218,7 +218,7 @@ int slsReceiverTCPIPInterface::decode_function(Interface &socket) {
} else {
FILE_LOG(logDEBUG1) << "calling function fnum: " << fnum << " ("
<< getFunctionNameFromEnum((enum detFuncs)fnum)
<< ") located at " << flist[fnum];
<< ")";
ret = (this->*flist[fnum])(socket);
FILE_LOG(logDEBUG1)
<< "Function " << getFunctionNameFromEnum((enum detFuncs)fnum)