Merge branch 'developer' into nohardexit

This commit is contained in:
maliakal_d 2020-01-31 17:36:22 +01:00
commit 8bae1059db
7 changed files with 84 additions and 6 deletions

View File

@ -160,4 +160,5 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
unsigned int nPixelsY{0}; unsigned int nPixelsY{0};
const static int npixelsx_jctb = 400; const static int npixelsx_jctb = 400;
int npixelsy_jctb{0}; int npixelsy_jctb{0};
uint32_t pixelMask{0};
}; };

View File

@ -229,6 +229,7 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) {
case slsDetectorDefs::JUNGFRAU: case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH: case slsDetectorDefs::MOENCH:
case slsDetectorDefs::MYTHEN3: case slsDetectorDefs::MYTHEN3:
case slsDetectorDefs::GOTTHARD2:
break; break;
default: default:
std::ostringstream os; std::ostringstream os;
@ -446,7 +447,7 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
clientVersion + clientVersion +
"<br><br>" "<br><br>"
"Common GUI to control the SLS Detectors: " "Common GUI to control the SLS Detectors: "
"Eiger, Gotthard, Jungfrau and Moench.<br><br>" "Eiger, Jungfrau, Mythen3, Gotthard, Gotthard2 and Moench.<br><br>"
"It can be operated in parallel with the command " "It can be operated in parallel with the command "
"line interface:<br>" "line interface:<br>"
"sls_detector_put,<br>sls_detector_get,<br>sls_" "sls_detector_put,<br>sls_detector_get,<br>sls_"

View File

@ -52,6 +52,19 @@ qDrawPlot::~qDrawPlot() {
void qDrawPlot::SetupWidgetWindow() { void qDrawPlot::SetupWidgetWindow() {
detType = det->getDetectorType().squash(); detType = det->getDetectorType().squash();
switch (detType) {
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
pixelMask = ((1 << 15) - 1);
FILE_LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask << std::dec;
break;
case slsDetectorDefs::GOTTHARD2:
pixelMask = ((1 << 13) - 1);
FILE_LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask << std::dec;
break;
default:
break;
}
// save // save
try { try {
std::string temp = det->getFilePath().squash("/tmp/"); std::string temp = det->getFilePath().squash("/tmp/");
@ -879,7 +892,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data
int halfbyte = 0; int halfbyte = 0;
char cbyte = '\0'; char cbyte = '\0';
// mythen 3 debugging // mythen3 / gotthard2 debugging
int discardBits = numDiscardBits; int discardBits = numDiscardBits;
switch (dr) { switch (dr) {
@ -903,14 +916,15 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data
case 16: case 16:
if (detType == slsDetectorDefs::JUNGFRAU || if (detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::MOENCH) { detType == slsDetectorDefs::MOENCH ||
detType == slsDetectorDefs::GOTTHARD2) {
// show gain plot // show gain plot
if (gaindest != NULL) { if (gaindest != NULL) {
for (ichan = 0; ichan < size; ++ichan) { for (ichan = 0; ichan < size; ++ichan) {
uint16_t temp = (*((u_int16_t *)source)); uint16_t temp = (*((u_int16_t *)source));
gaindest[ichan] = ((temp & 0xC000) >> 14); gaindest[ichan] = ((temp & 0xC000) >> 14);
dest[ichan] = (temp & 0x3FFF); dest[ichan] = (temp & pixelMask);
source += 2; source += 2;
} }
} }
@ -918,7 +932,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data
// only data plot // only data plot
else { else {
for (ichan = 0; ichan < size; ++ichan) { for (ichan = 0; ichan < size; ++ichan) {
dest[ichan] = ((*((u_int16_t *)source)) & 0x3FFF); dest[ichan] = ((*((u_int16_t *)source)) & pixelMask);
source += 2; source += 2;
} }
} }

View File

@ -30,6 +30,7 @@ void qTabAdvanced::SetupWidgetWindow() {
tab_roi->setEnabled(true); tab_roi->setEnabled(true);
break; break;
case slsDetectorDefs::MYTHEN3: case slsDetectorDefs::MYTHEN3:
case slsDetectorDefs::GOTTHARD2:
lblDiscardBits->setEnabled(true); lblDiscardBits->setEnabled(true);
spinDiscardBits->setEnabled(true); spinDiscardBits->setEnabled(true);
default: default:

View File

@ -113,6 +113,26 @@ void qTabDeveloper::SetupWidgetWindow() {
dacWidgets.push_back(new qDacWidget(this, det, true, "vtrim: ", getSLSIndex(detType, tempid++))); dacWidgets.push_back(new qDacWidget(this, det, true, "vtrim: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vdcsh: ", getSLSIndex(detType, tempid++))); dacWidgets.push_back(new qDacWidget(this, det, true, "vdcsh: ", getSLSIndex(detType, tempid++)));
break; break;
case slsDetectorDefs::GOTTHARD2:
lblSpinHV->show();
spinHV->show();
hvmin = 0;
dacWidgets.push_back(new qDacWidget(this, det, true, "vref_h_adc: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vb_comp_fe: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vb_comp_adc: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vcom_cds: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vref_rstore: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vb_opa_1st: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vref_comp_fe: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vcom_adc1: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vref_prech: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vref_l_adc: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vref_cds: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vb_cs: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vb_opa_fd: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vcom_adc2: ", getSLSIndex(detType, tempid++)));
break;
default: default:
break; break;
} }
@ -367,6 +387,41 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorTy
} }
break; break;
case slsDetectorDefs::GOTTHARD2:
switch (index) {
case 0:
return slsDetectorDefs::VREF_H_ADC;
case 1:
return slsDetectorDefs::VB_COMP_FE;
case 2:
return slsDetectorDefs::VB_COMP_ADC;
case 3:
return slsDetectorDefs::VCOM_CDS;
case 4:
return slsDetectorDefs::VREF_RSTORE;
case 5:
return slsDetectorDefs::VB_OPA_1ST;
case 6:
return slsDetectorDefs::VREF_COMP_FE;
case 7:
return slsDetectorDefs::VCOM_ADC1;
case 8:
return slsDetectorDefs::VREF_PRECH;
case 9:
return slsDetectorDefs::VREF_L_ADC;
case 10:
return slsDetectorDefs::VREF_CDS;
case 11:
return slsDetectorDefs::VB_CS;
case 12:
return slsDetectorDefs::VB_OPA_FD;
case 13:
return slsDetectorDefs::VCOM_ADC2;
default:
throw sls::RuntimeError(std::string("Unknown dac/adc index") + std::to_string(index));
}
break;
default: default:
throw sls::RuntimeError(std::string("Unknown detector type")); throw sls::RuntimeError(std::string("Unknown detector type"));
} }

View File

@ -60,6 +60,7 @@ void qTabPlot::SetupWidgetWindow() {
switch(det->getDetectorType().squash()) { switch(det->getDetectorType().squash()) {
case slsDetectorDefs::GOTTHARD: case slsDetectorDefs::GOTTHARD:
case slsDetectorDefs::MYTHEN3: case slsDetectorDefs::MYTHEN3:
case slsDetectorDefs::GOTTHARD2:
is1d = true; is1d = true;
break; break;
case slsDetectorDefs::EIGER: case slsDetectorDefs::EIGER:

View File

@ -83,6 +83,11 @@ void qTabSettings::SetupDetectorSettings() {
item[(int)FORCESWITCHG1]->setEnabled(true); item[(int)FORCESWITCHG1]->setEnabled(true);
item[(int)FORCESWITCHG2]->setEnabled(true); item[(int)FORCESWITCHG2]->setEnabled(true);
break; break;
case slsDetectorDefs::GOTTHARD2:
item[(int)DYNAMICGAIN]->setEnabled(true);
item[(int)FIXGAIN1]->setEnabled(true);
item[(int)FIXGAIN2]->setEnabled(true);
break;
default: default:
FILE_LOG(logDEBUG) << "Unknown detector type. Exiting GUI."; FILE_LOG(logDEBUG) << "Unknown detector type. Exiting GUI.";
qDefs::Message(qDefs::CRITICAL, qDefs::Message(qDefs::CRITICAL,