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