mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
Readoutflags (#61)
* WIP * eiger binary back wih versioning * fixed readout flag in ctbgui, added speedLevel enum * ctbgui: fixed a print out error * ctb readout bug fix * WIP * WIP * WIP
This commit is contained in:
@ -766,7 +766,7 @@ void ctbAcquisition::canvasClicked() {
|
||||
void ctbAcquisition::setCanvas(TCanvas* c) {
|
||||
myCanvas=c;
|
||||
myCanvas->cd();
|
||||
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)0x%p)->canvasClicked()",this));
|
||||
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)%p)->canvasClicked()",this));
|
||||
// myCanvas->AddExec("ex","canvasClicked()");
|
||||
}
|
||||
void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
|
||||
@ -1503,7 +1503,7 @@ void ctbAcquisition::update() {
|
||||
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::update")
|
||||
|
||||
try {
|
||||
roMode = myDet->getReadoutMode().tsquash("Different values");
|
||||
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
||||
setReadoutMode(roMode);
|
||||
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::update")
|
||||
|
||||
@ -1615,7 +1615,7 @@ void ctbAcquisition::toggleAcquisition() {
|
||||
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
||||
|
||||
try {
|
||||
roMode = myDet->getReadoutMode().tsquash("Different values");
|
||||
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
||||
setReadoutMode(roMode);
|
||||
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::toggleAcquisition")
|
||||
|
||||
@ -1798,11 +1798,11 @@ void ctbAcquisition::setDigitalSamples(int n) {
|
||||
void ctbAcquisition::setReadoutMode(int f) {
|
||||
|
||||
roMode=f;
|
||||
slsDetectorDefs::readOutFlags flags=(slsDetectorDefs::readOutFlags)f;
|
||||
if (flags&slsDetectorDefs::DIGITAL_ONLY) {
|
||||
slsDetectorDefs::readoutMode flag=(slsDetectorDefs::readoutMode)f;
|
||||
if (flag == slsDetectorDefs::DIGITAL_ONLY) {
|
||||
nAnalogSamples=0;
|
||||
adclist.clear();
|
||||
} else if (flags&slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
} else if (flag ==slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||
;
|
||||
}
|
||||
else {
|
||||
|
@ -1011,19 +1011,19 @@ void ctbPattern::setDigitalSamples() {
|
||||
|
||||
void ctbPattern::setReadoutMode(Bool_t) {
|
||||
try {
|
||||
int flags = 0;
|
||||
slsDetectorDefs::readoutMode flag = slsDetectorDefs::ANALOG_ONLY;
|
||||
if (cbAnalog->IsOn() && cbDigital->IsOn())
|
||||
flags=2;
|
||||
flag=slsDetectorDefs::ANALOG_AND_DIGITAL;
|
||||
else if (~cbAnalog->IsOn() && cbDigital->IsOn())
|
||||
flags=1;
|
||||
flag=slsDetectorDefs::DIGITAL_ONLY;
|
||||
else if (cbAnalog->IsOn() && ~cbDigital->IsOn())
|
||||
flags=0;
|
||||
flag=slsDetectorDefs::ANALOG_ONLY;
|
||||
else {
|
||||
throw runtime_error("unkown readout flag");
|
||||
}
|
||||
myDet->setReadoutMode(flags);
|
||||
cout << "Set readout flags: " << flags << endl;
|
||||
} CATCH_DISPLAY ("Could not set readout flags", "ctbPattern::setReadoutMode")
|
||||
myDet->setReadoutMode(flag);
|
||||
cout << "Set readout flag: " << flag << endl;
|
||||
} CATCH_DISPLAY ("Could not set readout flag", "ctbPattern::setReadoutMode")
|
||||
|
||||
getReadoutMode();
|
||||
}
|
||||
@ -1037,17 +1037,17 @@ int ctbPattern::getReadoutMode() {
|
||||
try{
|
||||
auto retval = myDet->getReadoutMode().tsquash("Different values");
|
||||
switch(retval) {
|
||||
case 2:
|
||||
case slsDetectorDefs::ANALOG_AND_DIGITAL:
|
||||
cout << "analog and digital" << endl;
|
||||
cbAnalog->SetOn(kTRUE);
|
||||
cbDigital->SetOn(kTRUE);
|
||||
break;
|
||||
case 1:
|
||||
case slsDetectorDefs::DIGITAL_ONLY:
|
||||
cout << "digital only" << endl;
|
||||
cbAnalog->SetOn(kFALSE);
|
||||
cbDigital->SetOn(kTRUE);
|
||||
break;
|
||||
case 0:
|
||||
case slsDetectorDefs::ANALOG_ONLY:
|
||||
cout << "analog only" << endl;
|
||||
cbAnalog->SetOn(kTRUE);
|
||||
cbDigital->SetOn(kFALSE);
|
||||
@ -1055,7 +1055,7 @@ int ctbPattern::getReadoutMode() {
|
||||
default:
|
||||
throw("unknown readout flag");
|
||||
}
|
||||
Emit("readoutModeChanged(int)",retval);
|
||||
Emit("readoutModeChanged(int)",static_cast<int>(retval));
|
||||
return retval;
|
||||
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
||||
|
||||
|
Reference in New Issue
Block a user