mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 08:38:00 +02:00
eiger server: vcal=0, rx_fifodepth to greater than 32 bit, trimval argument range check, activate to both control and stop server, end of eiger server (if detectorip normal) set activate to 1 (for future eiger firmware), added setflippeddatax to users, removing warnings and check of detector size before accessing detector[0], updating subexptime also updated subperiod in master file, remove keeprunning in rxr that keeps it busy to semaphore
This commit is contained in:
@ -31,6 +31,7 @@ It is linked in manual/manual-api from slsReceiverSoftware/include ]
|
||||
#include <unistd.h> //usleep
|
||||
#include <errno.h>
|
||||
#include <syscall.h> //tid
|
||||
#include <semaphore.h>
|
||||
using namespace std;
|
||||
|
||||
|
||||
@ -38,15 +39,15 @@ using namespace std;
|
||||
#define PRINT_IN_COLOR(c,f, ...) printf ("\033[%dm" f RESET, 30 + c+1, ##__VA_ARGS__)
|
||||
|
||||
|
||||
/** Variable is true to continue running, set to false upon interrupt */
|
||||
bool keeprunning;
|
||||
/** Semaphore that waits, interrupted upon end */
|
||||
sem_t semaphore;
|
||||
|
||||
/**
|
||||
* Control+C Interrupt Handler
|
||||
* Sets the variable keeprunning to false, to let all the processes know to exit properly
|
||||
* pushes semaphore to stop waiting, to let all the processes know to exit properly
|
||||
*/
|
||||
void sigInterruptHandler(int p){
|
||||
keeprunning = false;
|
||||
sem_post(&semaphore);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,7 +171,7 @@ int main(int argc, char *argv[]) {
|
||||
int numReceivers = 1;
|
||||
int startTCPPort = 1954;
|
||||
int withCallback = 0;
|
||||
keeprunning = true;
|
||||
sem_init(&semaphore,1,0);
|
||||
|
||||
/** - get number of receivers and start tcp port from command line arguments */
|
||||
if ( (argc != 4) || (!sscanf(argv[1],"%d", &startTCPPort)) || (!sscanf(argv[2],"%d", &numReceivers)) || (!sscanf(argv[3],"%d", &withCallback)) )
|
||||
@ -257,9 +258,9 @@ int main(int argc, char *argv[]) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/** - as long as keeprunning is true (changes with Ctrl+C) */
|
||||
while(keeprunning)
|
||||
pause();
|
||||
/** - as long as semaphore waits (changes with Ctrl+C) */
|
||||
sem_wait(&semaphore);
|
||||
sem_destroy(&semaphore);
|
||||
/** - interrupt caught, delete slsReceiverUsers object and exit */
|
||||
delete receiver;
|
||||
cprintf(BLUE,"Exiting Child Process [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||
|
Reference in New Issue
Block a user