mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +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 */
|
||||
SHAPER1, /**< shaper1 feedback */
|
||||
SHAPER2, /**< shaper2 feedback */
|
||||
TEMPERATURE, /**< temperature sensor (adc) */
|
||||
TEMPERATURE_ADC, /**< temperature sensor (adc) */
|
||||
TEMPERATURE_FPGA, /**< temperature sensor (fpga) */
|
||||
HUMIDITY, /**< humidity sensor (adc) */
|
||||
DETECTOR_BIAS, /**< detector bias */
|
||||
VA_POT, /**< power supply va */
|
||||
|
@ -5,74 +5,6 @@
|
||||
|
||||
//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) */
|
||||
|
||||
/*
|
||||
@ -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(){};
|
||||
|
||||
|
||||
char* gotthardStringname(string name);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
reads configuration file fname calling executeLine
|
||||
|
@ -1746,7 +1746,7 @@ float slsDetector::setDAC(float val, dacIndex index, int imod){
|
||||
|
||||
#ifdef VERBOSE
|
||||
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
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (controlSocket) {
|
||||
@ -1779,10 +1779,10 @@ float slsDetector::setDAC(float val, dacIndex index, int imod){
|
||||
}
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Dac/Pot set to "<< retval << std::endl;
|
||||
std::cout<< "Dac/Pot/Temp set to "<< retval << std::endl;
|
||||
#endif
|
||||
if (ret==FAIL) {
|
||||
std::cout<< "Set dac/pot failed " << std::endl;
|
||||
std::cout<< "Set dac/pot/temp failed " << std::endl;
|
||||
}
|
||||
return retval;
|
||||
|
||||
@ -4492,22 +4492,6 @@ string slsDetector::executeLine(int narg, char *args[], int action) {
|
||||
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") {
|
||||
setTCPSocket();
|
||||
ival=exitServer();
|
||||
@ -5283,7 +5267,7 @@ string slsDetector::executeLine(int narg, char *args[], int action) {
|
||||
return string(answer);
|
||||
}
|
||||
/* GOTTHARD POTS */
|
||||
else if (var=="vref_ds") {
|
||||
else if (var=="vref_ds") {
|
||||
if (action==PUT_ACTION) {
|
||||
sscanf(args[1],"%f",&fval);
|
||||
setDAC(fval,G_VREF_DS );
|
||||
@ -5340,17 +5324,19 @@ else if (var=="vref_ds") {
|
||||
sprintf(answer,"%f",setDAC(-1,G_IB_TESTC));
|
||||
return string(answer);
|
||||
}
|
||||
|
||||
/*
|
||||
else if (var=="temp") {
|
||||
if (action==PUT_ACTION) {
|
||||
return string("cannot set");
|
||||
/* GOTTHARD TEMPERATURE */
|
||||
else if (var=="temp_adc") {
|
||||
if (action==PUT_ACTION)
|
||||
return string("cannot set");
|
||||
sprintf(answer,"%f",setDAC(-1,TEMPERATURE_ADC));
|
||||
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);
|
||||
}
|
||||
sprintf(answer,"%f",getTemperature());
|
||||
return string(answer);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//timers
|
||||
|
||||
else if (var=="exptime") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user