mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
frame index updated for receiver
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@320 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
1f69778a6f
commit
e94677cbf5
@ -1062,6 +1062,9 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
|
|||||||
std::cout<< "offline!" << std::endl;
|
std::cout<< "offline!" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
//default receiver off. if it was on by default, client doesnt know
|
||||||
|
if(thisDetector->onlineFlag==ONLINE_FLAG)
|
||||||
|
detectorSendToReceiver(false);
|
||||||
return retval;
|
return retval;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5643,6 +5646,24 @@ int slsDetector::getFramesCaughtByReceiver(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int slsDetector::getCurrentFrameIndex(){
|
||||||
|
int fnum=F_GET_FRAME_INDEX;
|
||||||
|
int ret = FAIL;
|
||||||
|
int retval=-1;
|
||||||
|
|
||||||
|
if (setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG) {
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout << "Getting Current Frame Index of Receiver " << std::endl;
|
||||||
|
#endif
|
||||||
|
ret=thisReceiver->getInt(fnum,retval);
|
||||||
|
if(ret==FORCE_UPDATE)
|
||||||
|
ret=updateReceiver();
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::lockReceiver(int lock){
|
int slsDetector::lockReceiver(int lock){
|
||||||
int fnum=F_LOCK_RECEIVER;
|
int fnum=F_LOCK_RECEIVER;
|
||||||
|
@ -1454,6 +1454,11 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
*/
|
*/
|
||||||
int getFramesCaughtByReceiver();
|
int getFramesCaughtByReceiver();
|
||||||
|
|
||||||
|
/** gets the current frame index of receiver
|
||||||
|
\returns current frame index of receiver
|
||||||
|
*/
|
||||||
|
int getCurrentFrameIndex();
|
||||||
|
|
||||||
/** Locks/Unlocks the connection to the receiver
|
/** Locks/Unlocks the connection to the receiver
|
||||||
/param lock sets (1), usets (0), gets (-1) the lock
|
/param lock sets (1), usets (0), gets (-1) the lock
|
||||||
/returns lock status of the receiver
|
/returns lock status of the receiver
|
||||||
|
@ -664,6 +664,10 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
|||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
descrToFuncMap[i].m_pFuncName="frameindex";
|
||||||
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdReceiver;
|
||||||
|
i++;
|
||||||
|
|
||||||
descrToFuncMap[i].m_pFuncName="r_lock"; //
|
descrToFuncMap[i].m_pFuncName="r_lock"; //
|
||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLock;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdLock;
|
||||||
i++;
|
i++;
|
||||||
@ -3521,6 +3525,17 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
|||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(cmd=="frameindex"){
|
||||||
|
if (action==PUT_ACTION)
|
||||||
|
return string("cannot put");
|
||||||
|
else{
|
||||||
|
sprintf(answer,"%d",myDet->getCurrentFrameIndex());
|
||||||
|
return string(answer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
return string("could not decode command");
|
return string("could not decode command");
|
||||||
|
|
||||||
@ -3536,6 +3551,7 @@ string slsDetectorCommand::helpReceiver(int narg, char *args[], int action) {
|
|||||||
if (action==GET_ACTION || action==HELP_ACTION){
|
if (action==GET_ACTION || action==HELP_ACTION){
|
||||||
os << "receiver \t returns the status of receiver - can be running or idle" << std::endl;
|
os << "receiver \t returns the status of receiver - can be running or idle" << std::endl;
|
||||||
os << "framescaught \t returns the number of frames caught by receiver(average for multi)" << std::endl;
|
os << "framescaught \t returns the number of frames caught by receiver(average for multi)" << std::endl;
|
||||||
|
os << "frameindex \t returns the current frame index of receiver(average for multi)" << std::endl;
|
||||||
}
|
}
|
||||||
return os.str();
|
return os.str();
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
|||||||
double getCurrentProgress();
|
double getCurrentProgress();
|
||||||
|
|
||||||
|
|
||||||
void incrementProgress();
|
void incrementProgress(int i=-1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -611,10 +611,15 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
|||||||
virtual string getFileName()=0;
|
virtual string getFileName()=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\returns frames caught by receiver(average for multi)
|
\returns frames caught by receiver
|
||||||
*/
|
*/
|
||||||
virtual int getFramesCaughtByReceiver()=0;
|
virtual int getFramesCaughtByReceiver()=0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
\returns current frame index of receiver
|
||||||
|
*/
|
||||||
|
virtual int getCurrentFrameIndex()=0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
static const int64_t thisSoftwareVersion=0x20120124;
|
static const int64_t thisSoftwareVersion=0x20120124;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user