file permissions problem crash in rxr fixed, increased usleep in postprocessing getting rxr data which gives better gui display, allowed for mythen and gotthard sending module compatibility for 64 bit temp solution

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@496 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-03-15 14:37:14 +00:00
parent 922bc929c8
commit 19ad1ae06e
3 changed files with 25 additions and 5 deletions

View File

@ -834,12 +834,22 @@ void slsDetector::deleteModule(sls_detector_module *myMod) {
int slsDetector::sendChannel(sls_detector_channel *myChan) { int slsDetector::sendChannel(sls_detector_channel *myChan) {
return controlSocket->SendDataOnly(myChan, sizeof(sls_detector_channel)); int ts=0;
if(thisDetector->myDetectorType == MYTHEN)
return controlSocket->SendDataOnly(myChan, sizeof(sls_detector_channel));
else{
ts+=controlSocket->SendDataOnly(myChan, 12 );
ts+=controlSocket->SendDataOnly(&(myChan->reg), 8 );
return(ts);
}
} }
int slsDetector::sendChip(sls_detector_chip *myChip) { int slsDetector::sendChip(sls_detector_chip *myChip) {
int ts=0; int ts=0;
ts+=controlSocket->SendDataOnly(myChip,sizeof(sls_detector_chip)); if(thisDetector->myDetectorType == MYTHEN)
ts+=controlSocket->SendDataOnly(myChip,sizeof(sls_detector_chip));
else
ts+=controlSocket->SendDataOnly(myChip,20); // 4 ints + pointless pointer
#ifdef VERY_VERBOSE #ifdef VERY_VERBOSE
std::cout<< "chip structure sent" << std::endl; std::cout<< "chip structure sent" << std::endl;
std::cout<< "now sending " << myChip->nchan << " channles" << std::endl; std::cout<< "now sending " << myChip->nchan << " channles" << std::endl;
@ -855,7 +865,14 @@ int slsDetector::sendChip(sls_detector_chip *myChip) {
int slsDetector::sendModule(sls_detector_module *myMod) { int slsDetector::sendModule(sls_detector_module *myMod) {
int ts=0; int ts=0;
ts+=controlSocket->SendDataOnly(myMod,sizeof(sls_detector_module)); if(thisDetector->myDetectorType == MYTHEN)
ts+=controlSocket->SendDataOnly(myMod,sizeof(sls_detector_module));
else{
ts+=controlSocket->SendDataOnly(myMod, 7*sizeof(int) + 16); // 7 ints + 4 useless pointers, considering 32bit os
ts+=controlSocket->SendDataOnly(&(myMod->gain), sizeof(double));
ts+=controlSocket->SendDataOnly(&(myMod->offset), sizeof(double));
}
ts+=controlSocket->SendDataOnly(myMod->dacs,sizeof(dacs_t)*(myMod->ndac)); ts+=controlSocket->SendDataOnly(myMod->dacs,sizeof(dacs_t)*(myMod->ndac));
ts+=controlSocket->SendDataOnly(myMod->adcs,sizeof(dacs_t)*(myMod->nadc)); ts+=controlSocket->SendDataOnly(myMod->adcs,sizeof(dacs_t)*(myMod->nadc));
ts+=controlSocket->SendDataOnly(myMod->chipregs,sizeof(int)*(myMod->nchip)); ts+=controlSocket->SendDataOnly(myMod->chipregs,sizeof(int)*(myMod->nchip));

View File

@ -412,7 +412,7 @@ void* postProcessing::processData(int delflag) {
cout.flush(); cout.flush();
cout<<flush; cout<<flush;
if (checkJoinThread()) break; if (checkJoinThread()) break;
usleep(20000); usleep(200000);
pthread_mutex_lock(&mg); pthread_mutex_lock(&mg);
caught=getReceiverCurrentFrameIndex(); caught=getReceiverCurrentFrameIndex();

View File

@ -483,7 +483,10 @@ int slsReceiverFunctionList::startWriting(){
if (cbAction<2) { if (cbAction<2) {
rawDataReadyCallBack(currframenum, wbuf,sfilefd, guiData,pRawDataReady); rawDataReadyCallBack(currframenum, wbuf,sfilefd, guiData,pRawDataReady);
} else { } else {
fwrite(wbuf, 1, bufferSize, sfilefd); if(sfilefd)
fwrite(wbuf, 1, bufferSize, sfilefd);
else
cout << "You do not have permissions to overwrite: " << savefilename << endl;
} }
} }