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