mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
added busy command, converted get frames etc to an integer output
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
Path: slsDetectorsPackage/slsDetectorSoftware
|
Path: slsDetectorsPackage/slsDetectorSoftware
|
||||||
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
||||||
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
||||||
Repsitory UUID: 41885150589a8a90e3deb5f3844c7132d45195ec
|
Repsitory UUID: ef36cb7a54e1ae34ad1e85a46da6c121902108e6
|
||||||
Revision: 1450
|
Revision: 1451
|
||||||
Branch: 3.0-rc
|
Branch: 3.0-rc
|
||||||
Last Changed Author: Dhanya_Maliakal
|
Last Changed Author: Dhanya_Maliakal
|
||||||
Last Changed Rev: 1455
|
Last Changed Rev: 1456
|
||||||
Last Changed Date: 2017-08-04 18:47:04.000000002 +0200 ./threadFiles/ThreadPool.h
|
Last Changed Date: 2017-08-08 18:21:02.000000002 +0200 ./multiSlsDetector/multiSlsDetector.cpp
|
||||||
|
@ -6089,6 +6089,11 @@ int multiSlsDetector::pulseChip(int n) {
|
|||||||
|
|
||||||
void multiSlsDetector::setAcquiringFlag(bool b){
|
void multiSlsDetector::setAcquiringFlag(bool b){
|
||||||
thisMultiDetector->acquiringFlag = b;
|
thisMultiDetector->acquiringFlag = b;
|
||||||
|
for(int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++){
|
||||||
|
if(detectors[idet]){
|
||||||
|
detectors[idet]->setAcquiringFlag(b);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool multiSlsDetector::getAcquiringFlag(){
|
bool multiSlsDetector::getAcquiringFlag(){
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//#define SVNPATH ""
|
//#define SVNPATH ""
|
||||||
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
|
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
|
||||||
//#define SVNREPPATH ""
|
//#define SVNREPPATH ""
|
||||||
#define SVNREPUUIDLIB "41885150589a8a90e3deb5f3844c7132d45195ec"
|
#define SVNREPUUIDLIB "ef36cb7a54e1ae34ad1e85a46da6c121902108e6"
|
||||||
//#define SVNREV 0x1455
|
//#define SVNREV 0x1456
|
||||||
//#define SVNKIND ""
|
//#define SVNKIND ""
|
||||||
//#define SVNSCHED ""
|
//#define SVNSCHED ""
|
||||||
#define SVNAUTHLIB "Dhanya_Maliakal"
|
#define SVNAUTHLIB "Dhanya_Maliakal"
|
||||||
#define SVNREVLIB 0x1455
|
#define SVNREVLIB 0x1456
|
||||||
#define SVNDATELIB 0x20170804
|
#define SVNDATELIB 0x20170808
|
||||||
//
|
//
|
||||||
|
@ -37,6 +37,10 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
|||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
descrToFuncMap[i].m_pFuncName="busy"; //
|
||||||
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdStatus;
|
||||||
|
i++;
|
||||||
|
|
||||||
descrToFuncMap[i].m_pFuncName="datastream"; //
|
descrToFuncMap[i].m_pFuncName="datastream"; //
|
||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream;
|
||||||
i++;
|
i++;
|
||||||
@ -1440,20 +1444,30 @@ string slsDetectorCommand::cmdStatus(int narg, char *args[], int action) {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n");
|
cout << string("Executing command ")+string(args[0])+string(" ( ")+cmd+string(" )\n");
|
||||||
#endif
|
#endif
|
||||||
myDet->setOnline(ONLINE_FLAG);
|
|
||||||
if (action==PUT_ACTION) {
|
if (action==HELP_ACTION)
|
||||||
//myDet->setThreadedProcessing(0);
|
return helpStatus(narg,args,action);
|
||||||
if (string(args[1])=="start")
|
|
||||||
myDet->startAcquisition();
|
if (cmd=="status") {
|
||||||
else if (string(args[1])=="stop")
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
myDet->stopAcquisition();
|
if (action==PUT_ACTION) {
|
||||||
else
|
//myDet->setThreadedProcessing(0);
|
||||||
return string("unknown action");
|
if (string(args[1])=="start")
|
||||||
} else if (action==HELP_ACTION) {
|
myDet->startAcquisition();
|
||||||
return helpStatus(narg,args,HELP_ACTION);
|
else if (string(args[1])=="stop")
|
||||||
|
myDet->stopAcquisition();
|
||||||
|
else
|
||||||
|
return string("unknown action");
|
||||||
|
}
|
||||||
|
runStatus s=myDet->getRunStatus();
|
||||||
|
return myDet->runStatusType(s);
|
||||||
}
|
}
|
||||||
runStatus s=myDet->getRunStatus();
|
else if (cmd=="busy") {
|
||||||
return myDet->runStatusType(s);
|
char answer[100];
|
||||||
|
sprintf(answer,"%d", myDet->getAcquiringFlag());
|
||||||
|
return string(answer);
|
||||||
|
}
|
||||||
|
else return string("cannot scan command ")+string(cmd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1462,8 +1476,10 @@ string slsDetectorCommand::cmdStatus(int narg, char *args[], int action) {
|
|||||||
string slsDetectorCommand::helpStatus(int narg, char *args[], int action) {
|
string slsDetectorCommand::helpStatus(int narg, char *args[], int action) {
|
||||||
|
|
||||||
ostringstream os;
|
ostringstream os;
|
||||||
if (action==GET_ACTION || action==HELP_ACTION)
|
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||||
os << string("status \t gets the detector status - can be: running, error, transmitting, finished, waiting or idle\n");
|
os << string("status \t gets the detector status - can be: running, error, transmitting, finished, waiting or idle\n");
|
||||||
|
os << string("busy \t gets the status of acquire- can be: 0 or 1. 0 for idle, 1 for running\n");
|
||||||
|
}
|
||||||
if (action==PUT_ACTION || action==HELP_ACTION)
|
if (action==PUT_ACTION || action==HELP_ACTION)
|
||||||
os << string("status \t controls the detector acquisition - can be start or stop \n");
|
os << string("status \t controls the detector acquisition - can be start or stop \n");
|
||||||
return os.str();
|
return os.str();
|
||||||
@ -4356,8 +4372,10 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) {
|
|||||||
myDet->setFrameIndex(-1);
|
myDet->setFrameIndex(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index==FRAME_NUMBER || index==GATES_NUMBER || index==PROBES_NUMBER || index==CYCLES_NUMBER || index==MEASUREMENTS_NUMBER)
|
||||||
sprintf(answer,"%0.9f",rval);
|
sprintf(answer,"%d",(int)rval);
|
||||||
|
else
|
||||||
|
sprintf(answer,"%0.9f",rval);
|
||||||
return string(answer);
|
return string(answer);
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,11 +42,7 @@ slsDetectorUtils::slsDetectorUtils() {
|
|||||||
|
|
||||||
|
|
||||||
int slsDetectorUtils::acquire(int delflag){
|
int slsDetectorUtils::acquire(int delflag){
|
||||||
struct timespec begin,end;
|
//ensure acquire isnt started multiple times by same client
|
||||||
clock_gettime(CLOCK_REALTIME, &begin);
|
|
||||||
|
|
||||||
|
|
||||||
//ensure acquire isnt started multiple times by same client
|
|
||||||
if(getAcquiringFlag() == false)
|
if(getAcquiringFlag() == false)
|
||||||
setAcquiringFlag(true);
|
setAcquiringFlag(true);
|
||||||
else{
|
else{
|
||||||
@ -54,6 +50,9 @@ int slsDetectorUtils::acquire(int delflag){
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct timespec begin,end;
|
||||||
|
clock_gettime(CLOCK_REALTIME, &begin);
|
||||||
|
|
||||||
//not in the loop for real time acqusition yet,
|
//not in the loop for real time acqusition yet,
|
||||||
//in the real time acquisition loop, processing thread will wait for a post each time
|
//in the real time acquisition loop, processing thread will wait for a post each time
|
||||||
sem_init(&sem_newRTAcquisition,1,0);
|
sem_init(&sem_newRTAcquisition,1,0);
|
||||||
|
Reference in New Issue
Block a user