mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 15:27:13 +02:00
Merge branch 'moench' of https://github.com/slsdetectorgroup/slsDetectorPackage into moench
This commit is contained in:
5
cmk.sh
5
cmk.sh
@ -60,6 +60,7 @@ while getopts ":bchd:j:trge" opt ; do
|
|||||||
b)
|
b)
|
||||||
echo "Building of CMake files Required"
|
echo "Building of CMake files Required"
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
echo "Clean Required"
|
echo "Clean Required"
|
||||||
@ -69,6 +70,7 @@ while getopts ":bchd:j:trge" opt ; do
|
|||||||
echo "Building of CMake files with HDF5 option Required"
|
echo "Building of CMake files with HDF5 option Required"
|
||||||
HDF5=1
|
HDF5=1
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
d)
|
d)
|
||||||
echo "New HDF5 directory: $OPTARG"
|
echo "New HDF5 directory: $OPTARG"
|
||||||
@ -82,16 +84,19 @@ while getopts ":bchd:j:trge" opt ; do
|
|||||||
echo "Compiling Options: Text Client"
|
echo "Compiling Options: Text Client"
|
||||||
TEXTCLIENT=1
|
TEXTCLIENT=1
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
r)
|
r)
|
||||||
echo "Compiling Options: Receiver"
|
echo "Compiling Options: Receiver"
|
||||||
RECEIVER=1
|
RECEIVER=1
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
g)
|
g)
|
||||||
echo "Compiling Options: GUI"
|
echo "Compiling Options: GUI"
|
||||||
GUI=1
|
GUI=1
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
e)
|
e)
|
||||||
echo "Compiling Options: Debug"
|
echo "Compiling Options: Debug"
|
||||||
|
@ -4952,6 +4952,9 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy) {
|
|||||||
cout << "Destroyed Receiving Data Socket(s)" << endl;
|
cout << "Destroyed Receiving Data Socket(s)" << endl;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
if (client_downstream) {
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
cprintf(MAGENTA, "Going to create data sockets\n");
|
cprintf(MAGENTA, "Going to create data sockets\n");
|
||||||
|
|
||||||
|
@ -3242,13 +3242,13 @@ string slsDetector::getSettingsDir() {
|
|||||||
return std::string(thisDetector->settingsDir);
|
return std::string(thisDetector->settingsDir);
|
||||||
}
|
}
|
||||||
string slsDetector::setSettingsDir(string s) {
|
string slsDetector::setSettingsDir(string s) {
|
||||||
sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;
|
sprintf(thisDetector->settingsDir, "%s", s.c_str()); return thisDetector->settingsDir;
|
||||||
}
|
}
|
||||||
string slsDetector::getCalDir() {
|
string slsDetector::getCalDir() {
|
||||||
return thisDetector->calDir;
|
return thisDetector->calDir;
|
||||||
}
|
}
|
||||||
string slsDetector::setCalDir(string s) {
|
string slsDetector::setCalDir(string s) {
|
||||||
sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;
|
sprintf(thisDetector->calDir, "%s", s.c_str()); return thisDetector->calDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4432,7 +4432,7 @@ int64_t slsDetector::getTimeLeft(timerIndex index, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
int fnum=F_GET_TIME_LEFT;
|
int fnum=F_GET_TIME_LEFT;
|
||||||
int64_t retval;
|
int64_t retval = FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int ret=OK;
|
int ret=OK;
|
||||||
|
|
||||||
@ -6057,8 +6057,10 @@ int slsDetector::setUDPConnection() {
|
|||||||
std::cout << "could not configure mac" << endl;
|
std::cout << "could not configure mac" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else
|
}else{
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
|
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
|
||||||
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printReceiverConfiguration();
|
printReceiverConfiguration();
|
||||||
#endif
|
#endif
|
||||||
|
@ -846,6 +846,7 @@ virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
|
|||||||
case RUNNING: return std::string("running");\
|
case RUNNING: return std::string("running");\
|
||||||
case TRANSMITTING: return std::string("data"); \
|
case TRANSMITTING: return std::string("data"); \
|
||||||
case RUN_FINISHED: return std::string("finished"); \
|
case RUN_FINISHED: return std::string("finished"); \
|
||||||
|
case STOPPED: return std::string("stopped"); \
|
||||||
default: return std::string("idle"); \
|
default: return std::string("idle"); \
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
@ -64,9 +64,12 @@ int slsDetectorUtils::acquire(int delflag){
|
|||||||
if(!receiver){
|
if(!receiver){
|
||||||
setDetectorIndex(-1);
|
setDetectorIndex(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pthread_mutex_lock(&mg);
|
||||||
int nc=setTimer(CYCLES_NUMBER,-1);
|
int nc=setTimer(CYCLES_NUMBER,-1);
|
||||||
int nf=setTimer(FRAME_NUMBER,-1);
|
int nf=setTimer(FRAME_NUMBER,-1);
|
||||||
|
pthread_mutex_unlock(&mg);
|
||||||
|
|
||||||
if (nc==0) nc=1;
|
if (nc==0) nc=1;
|
||||||
if (nf==0) nf=1;
|
if (nf==0) nf=1;
|
||||||
int multiframe = nc*nf;
|
int multiframe = nc*nf;
|
||||||
|
@ -93,7 +93,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
|
|||||||
*/
|
*/
|
||||||
virtual std::string setFilePath(std::string s) {
|
virtual std::string setFilePath(std::string s) {
|
||||||
pthread_mutex_lock(&mf);
|
pthread_mutex_lock(&mf);
|
||||||
sprintf(filePath, s.c_str());
|
sprintf(filePath, "%s", s.c_str());
|
||||||
pthread_mutex_unlock(&mf);
|
pthread_mutex_unlock(&mf);
|
||||||
return std::string(filePath);
|
return std::string(filePath);
|
||||||
};
|
};
|
||||||
|
@ -105,7 +105,5 @@ install(TARGETS slsReceiverShared slsReceiverStatic slsReceiver
|
|||||||
PUBLIC_HEADER DESTINATION include)
|
PUBLIC_HEADER DESTINATION include)
|
||||||
|
|
||||||
|
|
||||||
#install(FILES ${ZMQ_STATIC_ARCHIVE}
|
install(FILES ${ZMQ_STATIC_ARCHIVE}
|
||||||
#DESTINATION lib)
|
DESTINATION lib)
|
||||||
install(FILES
|
|
||||||
DESTINATION lib)
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define FILE_BUFFER_SIZE (16*1024*1024) //16mb
|
#define FILE_BUFFER_SIZE (16*1024*1024) //16mb
|
||||||
|
|
||||||
//fifo
|
//fifo
|
||||||
#define FIFO_HEADER_NUMBYTES 4
|
#define FIFO_HEADER_NUMBYTES 8
|
||||||
|
|
||||||
|
|
||||||
//hdf5
|
//hdf5
|
||||||
|
@ -16,12 +16,13 @@
|
|||||||
#include <sys/wait.h> //wait
|
#include <sys/wait.h> //wait
|
||||||
#include <unistd.h> //usleep
|
#include <unistd.h> //usleep
|
||||||
#include <syscall.h>
|
#include <syscall.h>
|
||||||
|
#include <semaphore.h>
|
||||||
|
|
||||||
|
sem_t semaphore;
|
||||||
|
|
||||||
bool keeprunning;
|
|
||||||
|
|
||||||
void sigInterruptHandler(int p){
|
void sigInterruptHandler(int p){
|
||||||
keeprunning = false;
|
sem_post(&semaphore);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -65,7 +66,7 @@ void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
keeprunning = true;
|
sem_init(&semaphore,1,0);
|
||||||
cprintf(BLUE,"Created [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
cprintf(BLUE,"Created [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
|
|
||||||
// Catch signal SIGINT to close files and call destructors properly
|
// Catch signal SIGINT to close files and call destructors properly
|
||||||
@ -148,8 +149,8 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
FILE_LOG(logINFO) << "Ready ... ";
|
FILE_LOG(logINFO) << "Ready ... ";
|
||||||
cprintf(RESET, "\n[ Press \'Ctrl+c\' to exit ]\n");
|
cprintf(RESET, "\n[ Press \'Ctrl+c\' to exit ]\n");
|
||||||
while(keeprunning)
|
sem_wait(&semaphore);
|
||||||
pause();
|
sem_destroy(&semaphore);
|
||||||
|
|
||||||
delete receiver;
|
delete receiver;
|
||||||
cprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
cprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
|
Reference in New Issue
Block a user