git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@146 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2012-03-16 13:05:38 +00:00
parent 794ab4fdfc
commit 2076fb75f5
2 changed files with 8 additions and 10 deletions

View File

@ -142,8 +142,7 @@ slsDetector::slsDetector(int id) :slsDetectorUtils(),
{ {
detectorType type=(detectorType)getDetectorType(id); detectorType type=(detectorType)getDetectorType(id);
while (shmId<0) { while (shmId<0) {
/**Initlializes shared memory \sa initSharedMemory /**Initlializes shared memory \sa initSharedMemory
@ -278,7 +277,7 @@ detectorType slsDetector::getDetectorType(char *name, int cport) {
char m[100]; char m[100];
#ifdef VERBOSE #ifdef VERBOSE
cout << "Getting detector type " << endl; cout << "Getting detector type " << endl;
#endif #endif
if (s->Connect()>=0) { if (s->Connect()>=0) {
s->SendDataOnly(&fnum,sizeof(fnum)); s->SendDataOnly(&fnum,sizeof(fnum));
s->ReceiveDataOnly(&retval,sizeof(retval)); s->ReceiveDataOnly(&retval,sizeof(retval));
@ -288,7 +287,7 @@ detectorType slsDetector::getDetectorType(char *name, int cport) {
#ifdef VERBOSE #ifdef VERBOSE
cout << "Detector type is "<< t << endl; cout << "Detector type is "<< t << endl;
#endif #endif
} else { } else {
s->ReceiveDataOnly(m,sizeof(m)); s->ReceiveDataOnly(m,sizeof(m));
@ -2780,18 +2779,17 @@ int slsDetector::updateDetectorNoWait() {
// int it; // int it;
int64_t retval;// tns=-1; int64_t retval;// tns=-1;
char lastClientIP[INET_ADDRSTRLEN]; char lastClientIP[INET_ADDRSTRLEN];
switch(thisDetector->myDetectorType){ switch(thisDetector->myDetectorType){
case GOTTHARD: case GOTTHARD:
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP)); n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
#ifdef VERBOSE #ifdef VERBOSE
cout << "Updating detector last modified by " << lastClientIP << endl;// commented out by dhanya for now cout << "Updating detector last modighfied by " << lastClientIP << std::endl;// commented out by dhanya for now
#endif #endif
break; break;
default: default:
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP)); n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
#ifdef VERBOSE #ifdef VERBOSE
cout << "Updating detector last modified by " << lastClientIP << endl; cout << "Updating detector last modified by " << lastClientIP << std::endl;
#endif #endif
n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm)); n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
thisDetector->nMod[X]=nm; thisDetector->nMod[X]=nm;

View File

@ -962,7 +962,7 @@ string slsDetectorCommand::cmdHostname(int narg, char *args[], int action){
if (vvstr.fail()) if (vvstr.fail())
ivar=-1; ivar=-1;
} }
if (action==PUT_ACTION) { if (action==PUT_ACTION) {
//add by hostname //add by hostname
if (ivar==-1) { if (ivar==-1) {
@ -2711,9 +2711,9 @@ string slsDetectorCommand::cmdADC(int narg, char *args[], int action) {
adc=TEMPERATURE_FPGA; adc=TEMPERATURE_FPGA;
else else
return string("cannot decode adc ")+cmd; return string("cannot decode adc ")+cmd;
myDet->setOnline(ONLINE_FLAG); myDet->setOnline(ONLINE_FLAG);
sprintf(answer,"%f",myDet->getADC(adc)); sprintf(answer,"%f",myDet->getADC(adc));
return string(answer); return string(answer);