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;
//#endif
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
if(detType != slsDetectorDefs::MYTHEN) {
if(myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) {
myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
}else cprintf(RED,"is not online!\n");
}
if(detType != slsDetectorDefs::MYTHEN)
myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
qDefs::checkErrorMessage(myDet,"qDetectorMain::SetUpDetector");
}

View File

@ -535,8 +535,10 @@ void qTabDataOutput::GetOutputDir(){
dispOutputDir->setText(QString(myDet->getFilePath().c_str()));
//multi file path blank means sls file paths are different
if (dispOutputDir->text().isEmpty()) {
#ifdef VERYVERBOSE
qDefs::Message(qDefs::INFORMATION,"The file path for individual units are different.\n"
"Hence, leaving the common field blank.","qTabDataOutput::GetOutputDir");
#endif
#ifdef VERBOSE
cout << "The file path for individual units are different.\n"
"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){
unsigned int snel = size/sizeof(int);
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 numSocketsPerSLSDetector = 1;
bool jungfrau = false;
bool eiger = false;
switch(getDetectorsType()){
case EIGER:
eiger = true;
numSocketsPerSLSDetector = 2;
numSockets *= numSocketsPerSLSDetector;
maxX = thisMultiDetector->numberOfChannel[X];
@ -5979,6 +5982,8 @@ void multiSlsDetector::readFrameFromReceiver(){
break;
case JUNGFRAU:
jungfrau = true;
maxX = thisMultiDetector->numberOfChannel[X];
maxY = thisMultiDetector->numberOfChannel[Y];
break;
default:
break;
@ -6007,7 +6012,7 @@ void multiSlsDetector::readFrameFromReceiver(){
//calculating offsets (for eiger interleaving ports)
int offsetX[numSockets]; int offsetY[numSockets];
int bottom[numSockets];
if(maxX){
if(eiger){
for(int i=0; i<numSockets; ++i){
offsetY[i] = (maxY - (thisMultiDetector->offsetY[i/numSocketsPerSLSDetector] + slsmaxY)) * maxX * bytesperchannel;
//the left half or right half
@ -6070,7 +6075,7 @@ void multiSlsDetector::readFrameFromReceiver(){
}
//assemble data with interleaving
if(maxX){
if(eiger){
//bottom
if(bottom[isocket]){
@ -6093,7 +6098,11 @@ void multiSlsDetector::readFrameFromReceiver(){
//assemble data with no interleaving, assumed detectors appended vertically
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];
memset(defaultVal, 0, sizeof(defaultVal));
char* path = NULL;
int n = 0;
mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP));
n += mySock->SendDataOnly(mySock->lastClientIP,sizeof(mySock->lastClientIP));
// filepath
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
path = receiverBase->getFilePath();
#endif
if (path == NULL)
mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
n += mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
else {
mySock->SendDataOnly(path,MAX_STR_LENGTH);
n += mySock->SendDataOnly(path,MAX_STR_LENGTH);
delete[] path;
}
@ -649,9 +650,9 @@ int slsReceiverTCPIPInterface::send_update() {
path = receiverBase->getFileName();
#endif
if(path == NULL)
mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
n += mySock->SendDataOnly(defaultVal,MAX_STR_LENGTH);
else {
mySock->SendDataOnly(path,MAX_STR_LENGTH);
n += mySock->SendDataOnly(path,MAX_STR_LENGTH);
delete[] path;
}
@ -659,43 +660,43 @@ int slsReceiverTCPIPInterface::send_update() {
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=receiverBase->getFileIndex();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
//file format
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFileFormat();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
// file write enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFileWriteEnable();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
// file overwrite enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getOverwriteEnable();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
// receiver read frequency
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getFrameToGuiFrequency();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
// streaming port
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getStreamingPort();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
// data streaming enable
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
ind=(int)receiverBase->getDataStreamEnable();
#endif
mySock->SendDataOnly(&ind,sizeof(ind));
n += mySock->SendDataOnly(&ind,sizeof(ind));
if (!lockStatus)
strcpy(mySock->lastClientIP,mySock->thisClientIP);