mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 07:47:12 +02:00
temp_threshold, temp_control, temp_event done
This commit is contained in:
@ -2606,6 +2606,135 @@ dacs_t slsDetector::getADC(dacIndex index, int imod){
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
int slsDetector::setThresholdTemperature(int val, int imod) {
|
||||
|
||||
int retval = -1;
|
||||
int fnum = F_THRESHOLD_TEMP;
|
||||
int ret = FAIL;
|
||||
char mess[MAX_STR_LENGTH] = "";
|
||||
|
||||
int arg[2];
|
||||
arg[0]=val;
|
||||
arg[1]=imod;
|
||||
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< std::endl;
|
||||
std::cout<< "Setting/Getting Threshold Temperature to "<< val << " of module " << imod << std::endl;
|
||||
#endif
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (connectStop() == OK){
|
||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret!=FAIL) {
|
||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Threshold Temperature returned "<< retval << std::endl;
|
||||
#endif
|
||||
} else {
|
||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(TEMPERATURE_CONTROL));
|
||||
}
|
||||
disconnectStop();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int slsDetector::setTemperatureControl(int val, int imod) {
|
||||
|
||||
int retval = -1;
|
||||
int fnum = F_TEMP_CONTROL;
|
||||
int ret = FAIL;
|
||||
char mess[MAX_STR_LENGTH] = "";
|
||||
|
||||
int arg[2];
|
||||
arg[0]=val;
|
||||
arg[1]=imod;
|
||||
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< std::endl;
|
||||
std::cout<< "Setting/Getting Threshold Temperature to "<< val << " of module " << imod << std::endl;
|
||||
#endif
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (connectStop() == OK){
|
||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret!=FAIL) {
|
||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Threshold Temperature returned "<< retval << std::endl;
|
||||
#endif
|
||||
} else {
|
||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(TEMPERATURE_CONTROL));
|
||||
}
|
||||
disconnectStop();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int slsDetector::setTemperatureEvent(int val, int imod) {
|
||||
|
||||
int retval = -1;
|
||||
int fnum = F_TEMP_EVENT;
|
||||
int ret = FAIL;
|
||||
char mess[MAX_STR_LENGTH] = "";
|
||||
|
||||
int arg[2];
|
||||
arg[0]=val;
|
||||
arg[1]=imod;
|
||||
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< std::endl;
|
||||
std::cout<< "Setting/Getting Threshold Temperature to "<< val << " of module " << imod << std::endl;
|
||||
#endif
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (connectStop() == OK){
|
||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
stopSocket->SendDataOnly(arg,sizeof(arg));
|
||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret!=FAIL) {
|
||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Threshold Temperature returned "<< retval << std::endl;
|
||||
#endif
|
||||
} else {
|
||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(TEMPERATURE_CONTROL));
|
||||
}
|
||||
disconnectStop();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
configure single channel
|
||||
enum channelRegisterBit {
|
||||
|
Reference in New Issue
Block a user