mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 01:50:40 +02:00
-1 in getadc fixed in gui as well
This commit is contained in:
parent
7b1f935da2
commit
7aaf95a565
@ -17,6 +17,7 @@ class multiSlsDetector;
|
|||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
@ -101,7 +102,7 @@ private:
|
|||||||
QLabel *lblAdcs[20];
|
QLabel *lblAdcs[20];
|
||||||
MyDoubleSpinBox *spinDacs[20];
|
MyDoubleSpinBox *spinDacs[20];
|
||||||
QLabel *lblDacsmV[20];
|
QLabel *lblDacsmV[20];
|
||||||
QDoubleSpinBox *spinAdcs[20];
|
QLineEdit *spinAdcs[20];
|
||||||
QLabel *lblHV;
|
QLabel *lblHV;
|
||||||
QComboBox *comboHV;
|
QComboBox *comboHV;
|
||||||
QTimer *adcTimer;
|
QTimer *adcTimer;
|
||||||
|
@ -295,11 +295,8 @@ void qTabDeveloper::CreateADCWidgets(){
|
|||||||
|
|
||||||
for(int i=0;i<NUM_ADC_WIDGETS;i++){
|
for(int i=0;i<NUM_ADC_WIDGETS;i++){
|
||||||
lblAdcs[i] = new QLabel(QString(adcNames[i].c_str()),boxAdcs);
|
lblAdcs[i] = new QLabel(QString(adcNames[i].c_str()),boxAdcs);
|
||||||
spinAdcs[i] = new QDoubleSpinBox(boxAdcs);
|
spinAdcs[i] = new QLineEdit(boxAdcs);
|
||||||
spinAdcs[i]->setMaximum(10000);
|
spinAdcs[i]->setReadOnly(true);
|
||||||
spinAdcs[i]->setMinimum(-1);
|
|
||||||
if(NUM_ADC_WIDGETS)
|
|
||||||
spinAdcs[i]->setSuffix(0x00b0+QString("C"));
|
|
||||||
|
|
||||||
adcLayout->addWidget(lblAdcs[i],(int)(i/2),((i%2)==0)?1:4);
|
adcLayout->addWidget(lblAdcs[i],(int)(i/2),((i%2)==0)?1:4);
|
||||||
adcLayout->addWidget(spinAdcs[i],(int)(i/2),((i%2)==0)?2:5);
|
adcLayout->addWidget(spinAdcs[i],(int)(i/2),((i%2)==0)?2:5);
|
||||||
@ -522,25 +519,23 @@ void qTabDeveloper::RefreshAdcs(){
|
|||||||
for(int i=0;i<NUM_ADC_WIDGETS;i++){
|
for(int i=0;i<NUM_ADC_WIDGETS;i++){
|
||||||
//all detectors
|
//all detectors
|
||||||
if(!detid){
|
if(!detid){
|
||||||
if(detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::JUNGFRAU){
|
double value = (double)myDet->getADC(getSLSIndex(i+NUM_DAC_WIDGETS),-1);
|
||||||
double value = (double)myDet->getADC(getSLSIndex(i+NUM_DAC_WIDGETS),-1);
|
|
||||||
if(value == -1)
|
|
||||||
spinAdcs[i]->setValue(value);
|
|
||||||
else {
|
|
||||||
printf("value:%f\n",value/1000);
|
|
||||||
spinAdcs[i]->setValue(value/1000.00);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(value == -1)
|
||||||
|
spinAdcs[i]->setText(QString("Different values"));
|
||||||
|
else {
|
||||||
|
if(detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::JUNGFRAU)
|
||||||
|
value/=1000.00;
|
||||||
|
spinAdcs[i]->setText(QString::number(value,'f',2)+0x00b0+QString("C"));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
spinAdcs[i]->setValue((double)myDet->getADC(getSLSIndex(i+NUM_DAC_WIDGETS),-1));
|
|
||||||
}
|
}
|
||||||
//specific detector
|
//specific detector
|
||||||
else{
|
else{
|
||||||
|
double value = (double)det->getADC(getSLSIndex(i+NUM_DAC_WIDGETS));
|
||||||
|
|
||||||
if(detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::JUNGFRAU)
|
if(detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::JUNGFRAU)
|
||||||
spinAdcs[i]->setValue((double)det->getADC(getSLSIndex(i+NUM_DAC_WIDGETS))/1000.00);
|
value/=1000.00;
|
||||||
else
|
spinAdcs[i]->setText(QString::number(value,'f',2)+0x00b0+QString("C"));
|
||||||
spinAdcs[i]->setValue((double)det->getADC(getSLSIndex(i+NUM_DAC_WIDGETS)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5245,8 +5245,13 @@ string slsDetectorCommand::cmdADC(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
myDet->setOnline(ONLINE_FLAG);
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
#ifdef DACS_INT
|
#ifdef DACS_INT
|
||||||
if (myDet->getDetectorsType() == EIGER || myDet->getDetectorsType() == JUNGFRAU)
|
if (myDet->getDetectorsType() == EIGER || myDet->getDetectorsType() == JUNGFRAU){
|
||||||
sprintf(answer,"%.2f",(double)myDet->getADC(adc)/1000.00);
|
int val = myDet->getADC(adc);
|
||||||
|
if (val == -1)
|
||||||
|
sprintf(answer,"%d",val);
|
||||||
|
else
|
||||||
|
sprintf(answer,"%.2f", (double)val/1000.000);
|
||||||
|
}
|
||||||
else sprintf(answer,"%d",myDet->getADC(adc));
|
else sprintf(answer,"%d",myDet->getADC(adc));
|
||||||
#else
|
#else
|
||||||
sprintf(answer,"%f",myDet->getADC(adc));
|
sprintf(answer,"%f",myDet->getADC(adc));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user