mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +02:00
gotthard:adding the temperature in the client part and getting rid of gettemperature,gotthardString functions
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@53 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
40e945889c
commit
e4495f2bf4
Binary file not shown.
Binary file not shown.
@ -246,7 +246,8 @@ enum dacIndex {
|
|||||||
PREAMP, /**< preamp feedback */
|
PREAMP, /**< preamp feedback */
|
||||||
SHAPER1, /**< shaper1 feedback */
|
SHAPER1, /**< shaper1 feedback */
|
||||||
SHAPER2, /**< shaper2 feedback */
|
SHAPER2, /**< shaper2 feedback */
|
||||||
TEMPERATURE, /**< temperature sensor (adc) */
|
TEMPERATURE_ADC, /**< temperature sensor (adc) */
|
||||||
|
TEMPERATURE_FPGA, /**< temperature sensor (fpga) */
|
||||||
HUMIDITY, /**< humidity sensor (adc) */
|
HUMIDITY, /**< humidity sensor (adc) */
|
||||||
DETECTOR_BIAS, /**< detector bias */
|
DETECTOR_BIAS, /**< detector bias */
|
||||||
VA_POT, /**< power supply va */
|
VA_POT, /**< power supply va */
|
||||||
|
@ -5,74 +5,6 @@
|
|||||||
|
|
||||||
//using namespace std;
|
//using namespace std;
|
||||||
|
|
||||||
|
|
||||||
char* gotthardDetector::gotthardStringname(string name) {
|
|
||||||
|
|
||||||
char retval[100];
|
|
||||||
int fnum, set=0;
|
|
||||||
char val[100];
|
|
||||||
|
|
||||||
|
|
||||||
if (name.length()==0){
|
|
||||||
fnum=F_GET_GOTTHARD;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fnum=F_SET_GOTTHARD;
|
|
||||||
set=1;
|
|
||||||
strcpy(val,name.c_str());
|
|
||||||
}
|
|
||||||
int ret=FAIL;
|
|
||||||
|
|
||||||
|
|
||||||
char mess[100];
|
|
||||||
// int arg[1];
|
|
||||||
// arg[0]=name;
|
|
||||||
|
|
||||||
|
|
||||||
//#ifdef VERBOSE
|
|
||||||
std::cout<< std::endl;
|
|
||||||
if(set)
|
|
||||||
std::cout<< "Setting Stringname" << std::endl;
|
|
||||||
else
|
|
||||||
std::cout<< "Retreiving stringname" << std::endl;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (controlSocket) {
|
|
||||||
std::cout<< "controlsocket worked\n";
|
|
||||||
if (controlSocket->Connect()>=0) {
|
|
||||||
std::cout<< "connectsocket worked\n";
|
|
||||||
std::cout<<"fnum:"<<fnum<<endl;
|
|
||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
|
||||||
//controlSocket->SendDataOnly(arg,sizeof(arg));
|
|
||||||
if(set)
|
|
||||||
controlSocket->SendDataOnly(val,sizeof(val));
|
|
||||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
|
||||||
if (ret==OK) {
|
|
||||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
|
||||||
} else {
|
|
||||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
|
||||||
}
|
|
||||||
controlSocket->Disconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//#ifdef VERBOSE
|
|
||||||
std::cout<< "Stringname set to "<< retval << std::endl;
|
|
||||||
//#endif
|
|
||||||
if (ret==FAIL) {
|
|
||||||
std::cout<< "Setting/Getting stringname failed " << std::endl;
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* detector configuration (no communication to server) */
|
/* detector configuration (no communication to server) */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -819,46 +751,3 @@ int gotthardDetector::writeCalibrationFile(string fname, float gain, float offse
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Please use getDAC(TEMPERATURE) instead of writing your own function*/
|
|
||||||
|
|
||||||
// float gotthardDetector::getTemperature(int imod){
|
|
||||||
|
|
||||||
// float retval;
|
|
||||||
// int fnum=F_GET_TEMPERATURE;
|
|
||||||
// int ret=FAIL;
|
|
||||||
// char mess[100];
|
|
||||||
// //int arg = imod;
|
|
||||||
|
|
||||||
// //#ifdef VERBOSE
|
|
||||||
// std::cout<< "GOTTHARD Getting Temperature of module "<< imod << std::endl;
|
|
||||||
// //#endif
|
|
||||||
// if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
|
||||||
|
|
||||||
// std::cout<< "onlineflag worked\n";
|
|
||||||
// if (controlSocket) {
|
|
||||||
// std::cout<< "controlsocket worked\n";
|
|
||||||
// if (controlSocket->Connect()>=0) {
|
|
||||||
// controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
|
||||||
// controlSocket->SendDataOnly(&imod,sizeof(imod));
|
|
||||||
// controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
|
||||||
// if (ret==OK) {
|
|
||||||
// controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
|
||||||
// } else {
|
|
||||||
// controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
|
||||||
// std::cout<< "Detector returned error: " << mess << std::endl;
|
|
||||||
// }
|
|
||||||
// controlSocket->Disconnect();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //#ifdef VERBOSE
|
|
||||||
// std::cout<< "Temperature is "<< retval << std::endl;
|
|
||||||
// //#endif
|
|
||||||
// if (ret==FAIL) {
|
|
||||||
// std::cout<< "Getting temperature failed " << std::endl;
|
|
||||||
// }
|
|
||||||
// return retval;
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
@ -37,10 +37,6 @@ class gotthardDetector : public slsDetector{
|
|||||||
virtual ~gotthardDetector(){};
|
virtual ~gotthardDetector(){};
|
||||||
|
|
||||||
|
|
||||||
char* gotthardStringname(string name);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
reads configuration file fname calling executeLine
|
reads configuration file fname calling executeLine
|
||||||
|
@ -1746,7 +1746,7 @@ float slsDetector::setDAC(float val, dacIndex index, int imod){
|
|||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Setting DAC/POT "<< index << "of module " << imod << " to " << val << std::endl;
|
std::cout<< "Setting DAC/POT/TEMP "<< index << "of module " << imod << " to " << val << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (controlSocket) {
|
if (controlSocket) {
|
||||||
@ -1779,10 +1779,10 @@ float slsDetector::setDAC(float val, dacIndex index, int imod){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Dac/Pot set to "<< retval << std::endl;
|
std::cout<< "Dac/Pot/Temp set to "<< retval << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
std::cout<< "Set dac/pot failed " << std::endl;
|
std::cout<< "Set dac/pot/temp failed " << std::endl;
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
@ -4492,22 +4492,6 @@ string slsDetector::executeLine(int narg, char *args[], int action) {
|
|||||||
return string("more questions? Refere to software documentation!");
|
return string("more questions? Refere to software documentation!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (var=="gotthardString") {
|
|
||||||
setTCPSocket();
|
|
||||||
if (action==PUT_ACTION)
|
|
||||||
{
|
|
||||||
sval=string(args[1]);
|
|
||||||
std::cout<<"in setting\n";
|
|
||||||
sval=string(args[1]);
|
|
||||||
gotthardStringname(sval);
|
|
||||||
}
|
|
||||||
std::cout<<"in getting\n";
|
|
||||||
strcpy(answer, gotthardStringname(""));
|
|
||||||
return string(answer);
|
|
||||||
} else
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (var=="exitserver") {
|
if (var=="exitserver") {
|
||||||
setTCPSocket();
|
setTCPSocket();
|
||||||
ival=exitServer();
|
ival=exitServer();
|
||||||
@ -5340,16 +5324,18 @@ else if (var=="vref_ds") {
|
|||||||
sprintf(answer,"%f",setDAC(-1,G_IB_TESTC));
|
sprintf(answer,"%f",setDAC(-1,G_IB_TESTC));
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
/* GOTTHARD TEMPERATURE */
|
||||||
/*
|
else if (var=="temp_adc") {
|
||||||
else if (var=="temp") {
|
if (action==PUT_ACTION)
|
||||||
if (action==PUT_ACTION) {
|
|
||||||
return string("cannot set");
|
return string("cannot set");
|
||||||
}
|
sprintf(answer,"%f",setDAC(-1,TEMPERATURE_ADC));
|
||||||
sprintf(answer,"%f",getTemperature());
|
return string(answer);
|
||||||
|
} else if (var=="temp_fpga") {
|
||||||
|
if (action==PUT_ACTION)
|
||||||
|
return string("cannot set");
|
||||||
|
sprintf(answer,"%f",setDAC(-1,TEMPERATURE_FPGA));
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
//timers
|
//timers
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user