bug fix: 1000+ errors on gui startup(setreceiveronline not done), removed gui mesage popup for different output paths, fixed jungfrau to have multiple detectors in x dir in gui

This commit is contained in:
maliakal_d 2018-02-26 12:44:32 +01:00
parent ebe1ff4563
commit 7859df6aa3
4 changed files with 30 additions and 21 deletions

View File

@ -305,11 +305,8 @@ void qDetectorMain::SetUpDetector(const string fName){
cout << endl << "Type : " << slsDetectorBase::getDetectorType(detType) << "\nDetector : " << host << endl; cout << endl << "Type : " << slsDetectorBase::getDetectorType(detType) << "\nDetector : " << host << endl;
//#endif //#endif
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG); myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
if(detType != slsDetectorDefs::MYTHEN) { if(detType != slsDetectorDefs::MYTHEN)
if(myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) { myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
}else cprintf(RED,"is not online!\n");
}
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector"); qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
} }

View File

@ -535,8 +535,10 @@ void qTabDataOutput::GetOutputDir(){
dispOutputDir->setText(QString(myDet->getFilePath().c_str())); dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
//multi file path blank means sls file paths are different //multi file path blank means sls file paths are different
if (dispOutputDir->text().isEmpty()) { if (dispOutputDir->text().isEmpty()) {
#ifdef VERYVERBOSE
qDefs::Message(qDefs::INFORMATION,"The file path for individual units are different.\n" qDefs::Message(qDefs::INFORMATION,"The file path for individual units are different.\n"
"Hence, leaving the common field blank.","qTabDataOutput::GetOutputDir"); "Hence, leaving the common field blank.","qTabDataOutput::GetOutputDir");
#endif
#ifdef VERBOSE #ifdef VERBOSE
cout << "The file path for individual units are different.\n" cout << "The file path for individual units are different.\n"
"Hence, leaving the common field blank." << endl; "Hence, leaving the common field blank." << endl;

View File

@ -5952,7 +5952,8 @@ int multiSlsDetector::getData(const int isocket, const bool masking, int* image,
if(masking){ if(masking){
unsigned int snel = size/sizeof(int); unsigned int snel = size/sizeof(int);
for(unsigned int i=0;i<snel;++i){ for(unsigned int i=0;i<snel;++i){
image[i] = (image[i] & 0x3FFF3FFF); if((unsigned int)image[i] != 0xFFFFFFFF)
image[i] = (image[i] & 0x3FFF3FFF);
} }
} }
@ -5970,8 +5971,10 @@ void multiSlsDetector::readFrameFromReceiver(){
int numSockets = thisMultiDetector->numberOfDetectors; int numSockets = thisMultiDetector->numberOfDetectors;
int numSocketsPerSLSDetector = 1; int numSocketsPerSLSDetector = 1;
bool jungfrau = false; bool jungfrau = false;
bool eiger = false;
switch(getDetectorsType()){ switch(getDetectorsType()){
case EIGER: case EIGER:
eiger = true;
numSocketsPerSLSDetector = 2; numSocketsPerSLSDetector = 2;
numSockets *= numSocketsPerSLSDetector; numSockets *= numSocketsPerSLSDetector;
maxX = thisMultiDetector->numberOfChannel[X]; maxX = thisMultiDetector->numberOfChannel[X];
@ -5979,6 +5982,8 @@ void multiSlsDetector::readFrameFromReceiver(){
break; break;
case JUNGFRAU: case JUNGFRAU:
jungfrau = true; jungfrau = true;
maxX = thisMultiDetector->numberOfChannel[X];
maxY = thisMultiDetector->numberOfChannel[Y];
break; break;
default: default:
break; break;
@ -6007,7 +6012,7 @@ void multiSlsDetector::readFrameFromReceiver(){
//calculating offsets (for eiger interleaving ports) //calculating offsets (for eiger interleaving ports)
int offsetX[numSockets]; int offsetY[numSockets]; int offsetX[numSockets]; int offsetY[numSockets];
int bottom[numSockets]; int bottom[numSockets];
if(maxX){ if(eiger){
for(int i=0; i<numSockets; ++i){ for(int i=0; i<numSockets; ++i){
offsetY[i] = (maxY - (thisMultiDetector->offsetY[i/numSocketsPerSLSDetector] + slsmaxY)) * maxX * bytesperchannel; offsetY[i] = (maxY - (thisMultiDetector->offsetY[i/numSocketsPerSLSDetector] + slsmaxY)) * maxX * bytesperchannel;
//the left half or right half //the left half or right half
@ -6070,7 +6075,7 @@ void multiSlsDetector::readFrameFromReceiver(){
} }
//assemble data with interleaving //assemble data with interleaving
if(maxX){ if(eiger){
//bottom //bottom
if(bottom[isocket]){ if(bottom[isocket]){
@ -6093,7 +6098,11 @@ void multiSlsDetector::readFrameFromReceiver(){
//assemble data with no interleaving, assumed detectors appended vertically //assemble data with no interleaving, assumed detectors appended vertically
else{ else{
memcpy((char*)multiframe+slsdatabytes*isocket,(char*)image,slsdatabytes); for(int i=0;i<slsmaxY;++i){
memcpy(((char*)multiframe) + (((thisMultiDetector->offsetY[isocket] + i) * maxX) + thisMultiDetector->offsetX[isocket])* (int)bytesperchannel,
(char*)image+ (i*slsmaxX*(int)bytesperchannel),
(slsmaxX*(int)bytesperchannel));
}
} }
} }

View File

@ -630,17 +630,18 @@ int slsReceiverTCPIPInterface::send_update() {
char defaultVal[MAX_STR_LENGTH]; char defaultVal[MAX_STR_LENGTH];
memset(defaultVal, 0, sizeof(defaultVal)); memset(defaultVal, 0, sizeof(defaultVal));
char* path = NULL; char* path = NULL;
int n = 0;
mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP)); n += mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP));
// filepath // filepath
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
path = receiverBase->getFilePath(); path = receiverBase->getFilePath();
#endif #endif
if (path == NULL) if (path == NULL)
mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH); n += mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
else { else {
mySock->SendDataOnly(path,MAX_STR_LENGTH); n += mySock->SendDataOnly(path,MAX_STR_LENGTH);
delete[] path; delete[] path;
} }
@ -649,9 +650,9 @@ int slsReceiverTCPIPInterface::send_update() {
path = receiverBase->getFileName(); path = receiverBase->getFileName();
#endif #endif
if(path == NULL) if(path == NULL)
mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH); n += mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
else { else {
mySock->SendDataOnly(path,MAX_STR_LENGTH); n += mySock->SendDataOnly(path,MAX_STR_LENGTH);
delete[] path; delete[] path;
} }
@ -659,43 +660,43 @@ int slsReceiverTCPIPInterface::send_update() {
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=receiverBase->getFileIndex(); ind=receiverBase->getFileIndex();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
//file format //file format
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFileFormat(); ind=(int)receiverBase->getFileFormat();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
// file write enable // file write enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFileWriteEnable(); ind=(int)receiverBase->getFileWriteEnable();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
// file overwrite enable // file overwrite enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getOverwriteEnable(); ind=(int)receiverBase->getOverwriteEnable();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
// receiver read frequency // receiver read frequency
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFrameToGuiFrequency(); ind=(int)receiverBase->getFrameToGuiFrequency();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
// streaming port // streaming port
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getStreamingPort(); ind=(int)receiverBase->getStreamingPort();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
// data streaming enable // data streaming enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS #ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getDataStreamEnable(); ind=(int)receiverBase->getDataStreamEnable();
#endif #endif
mySock->SendDataOnly(&ind,sizeof(ind)); n += mySock->SendDataOnly(&ind,sizeof(ind));
if (!lockStatus) if (!lockStatus)
strcpy(mySock->lastClientIP,mySock->thisClientIP); strcpy(mySock->lastClientIP,mySock->thisClientIP);