diff --git a/slsDetectorSoftware/MySocketTCP/rec b/slsDetectorSoftware/MySocketTCP/rec index 1bb8670a3..b652bb8f4 100755 Binary files a/slsDetectorSoftware/MySocketTCP/rec and b/slsDetectorSoftware/MySocketTCP/rec differ diff --git a/slsDetectorSoftware/MySocketTCP/send b/slsDetectorSoftware/MySocketTCP/send index d5523b016..251a9eeb9 100755 Binary files a/slsDetectorSoftware/MySocketTCP/send and b/slsDetectorSoftware/MySocketTCP/send differ diff --git a/slsDetectorSoftware/commonFiles/sls_detector_defs.h b/slsDetectorSoftware/commonFiles/sls_detector_defs.h index 0b6f34031..cb88a0486 100755 --- a/slsDetectorSoftware/commonFiles/sls_detector_defs.h +++ b/slsDetectorSoftware/commonFiles/sls_detector_defs.h @@ -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 */ diff --git a/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp b/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp index 54e7cc45c..96c24f9ca 100644 --- a/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp +++ b/slsDetectorSoftware/gotthardDetector/gotthardDetector.cpp @@ -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:"<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; - -// } diff --git a/slsDetectorSoftware/gotthardDetector/gotthardDetector.h b/slsDetectorSoftware/gotthardDetector/gotthardDetector.h index fbae64fe6..09ebe4454 100644 --- a/slsDetectorSoftware/gotthardDetector/gotthardDetector.h +++ b/slsDetectorSoftware/gotthardDetector/gotthardDetector.h @@ -37,10 +37,6 @@ class gotthardDetector : public slsDetector{ virtual ~gotthardDetector(){}; - char* gotthardStringname(string name); - - - /** reads configuration file fname calling executeLine diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index dc401f537..efc9f0a82 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -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") {