mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 08:09:21 +01:00
receiver read frequency from gui can be set now
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@567 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@@ -6095,8 +6095,6 @@ int* slsDetector::readFrameFromReceiver(char* fName, int &fIndex){
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
cout << "Acquisition stopped" << endl;
|
||||
|
||||
dataSocket->Disconnect();
|
||||
}
|
||||
@@ -6333,12 +6331,15 @@ int64_t slsDetector::clearAllErrorMask(){
|
||||
|
||||
|
||||
|
||||
int slsDetector::setReadReceiverFrequency(int i){
|
||||
int slsDetector::setReadReceiverFrequency(int getFromReceiver,int i){
|
||||
int fnum=F_READ_RECEIVER_FREQUENCY;
|
||||
int ret = FAIL;
|
||||
int retval=-1;
|
||||
int arg = i;
|
||||
|
||||
if(!getFromReceiver)
|
||||
return retval;
|
||||
|
||||
if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Sending read frequency to receiver " << arg << std::endl;
|
||||
@@ -6350,6 +6351,11 @@ int slsDetector::setReadReceiverFrequency(int i){
|
||||
if(ret==FORCE_UPDATE)
|
||||
updateReceiver();
|
||||
}
|
||||
|
||||
if ((i > 0) && (retval != i)){
|
||||
cout << "could not set receiver read frequency:" << retval << endl;
|
||||
setErrorMask((getErrorMask())|(RECEIVER_READ_FREQUENCY));
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -1593,12 +1593,15 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
/** sets the receiver udp port \sa sharedSlsDetector */
|
||||
int setReceiverUDPPort(int udpport);
|
||||
|
||||
/** Sets the variable readRxrFrequency.
|
||||
/** Sets the read receiver frequency
|
||||
if Receiver read upon gui request, readRxrFrequency=0,
|
||||
else every nth frame to be sent to gui
|
||||
@param getFromReceiver is 1 if it should ask the receiver,
|
||||
0 if it can get it from multislsdetecter
|
||||
@param i is the receiver read frequency
|
||||
/returns read receiver frequency
|
||||
*/
|
||||
int setReadReceiverFrequency(int i=-1);
|
||||
int setReadReceiverFrequency(int getFromReceiver, int i=-1);
|
||||
|
||||
/**
|
||||
* Waits for receiver read to finish after stopping acquisition
|
||||
|
||||
@@ -232,7 +232,8 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
||||
virtual string createFileName()=0;
|
||||
|
||||
|
||||
virtual void incrementProgress(int i=1)=0;
|
||||
virtual void incrementProgress()=0;
|
||||
virtual void setCurrentProgress(int i=0)=0;
|
||||
virtual double getCurrentProgress()=0;
|
||||
virtual void incrementFileIndex()=0;
|
||||
virtual int setTotalProgress()=0;
|
||||
@@ -474,6 +475,16 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
||||
virtual int* readFrameFromReceiver(char* fName, int &fIndex)=0;
|
||||
|
||||
|
||||
/** Sets the read receiver frequency
|
||||
if Receiver read upon gui request, readRxrFrequency=0,
|
||||
else every nth frame to be sent to gui
|
||||
@param getFromReceiver is 1 if it should ask the receiver,
|
||||
0 if it can get it from multislsdetecter
|
||||
@param i is the receiver read frequency
|
||||
/returns read receiver frequency
|
||||
*/
|
||||
virtual int setReadReceiverFrequency(int getFromReceiver, int i=-1)=0;
|
||||
|
||||
|
||||
/** returns detector type string from detector type index
|
||||
\param t string can be Mythen, Pilatus, Eiger, Gotthard, Agipd, Unknown
|
||||
|
||||
@@ -3766,9 +3766,9 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
||||
if (!sscanf(args[1],"%d",&ival))
|
||||
return string("Could not scan read frequency mode ")+string(args[1]);
|
||||
if(ival>=0)
|
||||
myDet->setReadReceiverFrequency(ival);
|
||||
myDet->setReadReceiverFrequency(1,ival);
|
||||
}
|
||||
sprintf(answer,"%d",myDet->setReadReceiverFrequency());
|
||||
sprintf(answer,"%d",myDet->setReadReceiverFrequency(1));
|
||||
return string(answer);
|
||||
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ void slsDetectorUtils::acquire(int delflag){
|
||||
void *status;
|
||||
|
||||
|
||||
|
||||
|
||||
if ((*correctionMask&(1<< ANGULAR_CONVERSION)) || (*correctionMask&(1<< I0_NORMALIZATION)) || getActionMode(angCalLog) || (getScanMode(0)==positionScan)|| (getScanMode(1)==positionScan)) {
|
||||
if (connectChannels==0)
|
||||
if (connect_channels) {
|
||||
@@ -127,6 +125,11 @@ void slsDetectorUtils::acquire(int delflag){
|
||||
if(setReceiverOnline()==OFFLINE_FLAG)
|
||||
*stoppedFlag=1;
|
||||
|
||||
//multi detectors shouldnt have different receiver read frequencies enabled/disabled
|
||||
if(setReadReceiverFrequency(0) < 0){
|
||||
std::cout << "Error: The receiver read frequency is invalid:" << setReadReceiverFrequency(0) << std::endl;
|
||||
*stoppedFlag=1;
|
||||
}
|
||||
|
||||
//resets frames caught in receiver
|
||||
resetFramesCaught();
|
||||
@@ -619,9 +622,9 @@ double slsDetectorUtils::getCurrentProgress() {
|
||||
|
||||
|
||||
|
||||
void slsDetectorUtils::incrementProgress(int i) {
|
||||
void slsDetectorUtils::incrementProgress() {
|
||||
pthread_mutex_lock(&mp);
|
||||
progressIndex+=i;
|
||||
progressIndex++;
|
||||
cout << fixed << setprecision(2) << setw (6) << 100.*((double)progressIndex)/((double)totalProgress) << " \%";
|
||||
pthread_mutex_unlock(&mp);
|
||||
#ifdef VERBOSE
|
||||
@@ -633,7 +636,18 @@ void slsDetectorUtils::incrementProgress(int i) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
void slsDetectorUtils::setCurrentProgress(int i){
|
||||
pthread_mutex_lock(&mp);
|
||||
progressIndex++;
|
||||
progressIndex=i;
|
||||
cout << fixed << setprecision(2) << setw (6) << 100.*((double)progressIndex)/((double)totalProgress) << " \%";
|
||||
pthread_mutex_unlock(&mp);
|
||||
#ifdef VERBOSE
|
||||
cout << endl;
|
||||
#else
|
||||
cout << "\r" << flush;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int slsDetectorUtils::retrieveDetectorSetup(string const fname1, int level){
|
||||
|
||||
@@ -444,8 +444,8 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
||||
double getCurrentProgress();
|
||||
|
||||
|
||||
void incrementProgress(int i=1);
|
||||
|
||||
void incrementProgress();
|
||||
void setCurrentProgress(int i=0);
|
||||
|
||||
|
||||
/**
|
||||
@@ -672,12 +672,15 @@ virtual int setROI(int n=-1,ROI roiLimits[]=NULL)=0;
|
||||
*/
|
||||
virtual ROI* getROI(int &n)=0;
|
||||
|
||||
/** Sets the variable readRxrFrequency.
|
||||
/** Sets the read receiver frequency
|
||||
if Receiver read upon gui request, readRxrFrequency=0,
|
||||
else every nth frame to be sent to gui
|
||||
@param getFromReceiver is 1 if it should ask the receiver,
|
||||
0 if it can get it from multislsdetecter
|
||||
@param i is the receiver read frequency
|
||||
/returns read receiver frequency
|
||||
*/
|
||||
virtual int setReadReceiverFrequency(int i=-1)=0;
|
||||
virtual int setReadReceiverFrequency(int getFromReceiver, int i=-1)=0;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user