mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +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:
parent
9649982932
commit
d112956f79
45
RELEASE.txt
45
RELEASE.txt
@ -1,8 +1,8 @@
|
||||
SLS Detector Package 4.1.1 released on 15.01.2020 (Bug Fix Release)
|
||||
SLS Detector Package 4.2.0 released on 10.03.2020 (Minor Release)
|
||||
===================================================================
|
||||
|
||||
|
||||
This document describes the differences between 4.1.0 and 4.1.1 releases.
|
||||
This document describes the differences between 4.2.0 and 4.1.1 releases.
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
@ -17,37 +17,38 @@ This document describes the differences between 4.1.0 and 4.1.1 releases.
|
||||
1. Topics Concerning
|
||||
====================
|
||||
|
||||
- detangled receiver streaming from data call back in client
|
||||
and allow for unregister data call back in client
|
||||
- (eiger) software trigger made to work along with blocking acquire
|
||||
- bug fix for locks in blocking acquire
|
||||
- parameter file allows for modular commands
|
||||
- (Eiger) detector server startup with vcal = 0 to reduce noise
|
||||
- Deactivate will deactivate a module even if FEB does not work.
|
||||
- trimbits check
|
||||
- zmqsocket
|
||||
- fifo size (memory allocation print to mb)
|
||||
- subexptime also sets subperiod in master fle
|
||||
- minor check if no detectors ()xxxxxxxxxxxxxxxxxxxxxxx
|
||||
- setflippeddatax in users xxxxx
|
||||
- memory alignment in receiver
|
||||
|
||||
Compared to 4.1.0,
|
||||
no firmware or on-board detector server update required for this release.
|
||||
|
||||
|
||||
2. Resolved Issues
|
||||
==================
|
||||
|
||||
Client
|
||||
------
|
||||
Detector Server (Eiger)
|
||||
-----------------------
|
||||
|
||||
1. Registering data call back (registerDataCallback) used to enable data streaming
|
||||
via zmq in both receiver and client. Sending NULL unregistered call back,
|
||||
but did not disable streaming.
|
||||
Now, registering/unregistering this call back will only enable data streaming
|
||||
in client. Data streaming in receiver will have to be explicitly enabled.
|
||||
1. Vcal dac set to 0 at on-board detector server start up to
|
||||
reduce noise.
|
||||
|
||||
2. (Eiger)
|
||||
Software trigger triggered via the stop server and hence, can be triggered
|
||||
also during blocking acquire.
|
||||
2. Deactivate will deactivate a module even if FEB does not work.
|
||||
|
||||
3. If stop acquisition command was given immediately after starting a blocking acquire,
|
||||
it might have hanged the process. This bug is fixed now.
|
||||
3. Trimbits values checked for values 0 - 63.
|
||||
|
||||
4. Parameter file now allows modular commands (using ':'). They are not ignored anymore.
|
||||
Receiver
|
||||
--------
|
||||
|
||||
1. zmq socket send memory not overlapping
|
||||
2. fifo size not be large (and memory allocated print to mb)
|
||||
|
||||
- subexptime also sets subperiod in master fle
|
||||
|
||||
3. Known Issues
|
||||
===============
|
||||
|
@ -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));
|
||||
|
@ -85,15 +85,21 @@ public:
|
||||
static double getNSTime(timeUnit unit, double value){
|
||||
double valueNS=value;
|
||||
switch(unit){
|
||||
case HOURS: valueNS*=60;
|
||||
case MINUTES: valueNS*=60;
|
||||
case SECONDS: valueNS*=1000;
|
||||
case MILLISECONDS: valueNS*=1000;
|
||||
case MICROSECONDS: valueNS*=1000;
|
||||
case HOURS:
|
||||
return valueNS * 60 * 60 * 1000 * 1000 * 1000;
|
||||
case MINUTES:
|
||||
return valueNS * 60 * 1000 * 1000 * 1000;
|
||||
case SECONDS:
|
||||
return valueNS * 1000 * 1000 * 1000;
|
||||
case MILLISECONDS:
|
||||
return valueNS * 1000 * 1000;
|
||||
case MICROSECONDS:
|
||||
return valueNS * 1000;
|
||||
case NANOSECONDS:
|
||||
default:;
|
||||
}
|
||||
return valueNS;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: e4645a8273c8265bc584579d5f7f8eb6dc4379f7
|
||||
Revision: 360
|
||||
Branch: 4.1.0-rc
|
||||
Last Changed Author: GitHub_GitHub
|
||||
Last Changed Rev: 4138
|
||||
Last Changed Date: 2019-10-04 09:28:27.000000001 +0200 ./xparameters.h
|
||||
Repsitory UUID: 9649982932b2db75b9bf720ce4a13e7cdb059430
|
||||
Revision: 361
|
||||
Branch: 4.1.2-rc
|
||||
Last Changed Author: Gemma_Tinti
|
||||
Last Changed Rev: 4157
|
||||
Last Changed Date: 2020-03-09 18:18:12.000000001 +0100 ./xparameters.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "e4645a8273c8265bc584579d5f7f8eb6dc4379f7"
|
||||
#define GITAUTH "GitHub_GitHub"
|
||||
#define GITREV 0x4138
|
||||
#define GITDATE 0x20191004
|
||||
#define GITBRANCH "4.1.0-rc"
|
||||
#define GITREPUUID "9649982932b2db75b9bf720ce4a13e7cdb059430"
|
||||
#define GITAUTH "Gemma_Tinti"
|
||||
#define GITREV 0x4157
|
||||
#define GITDATE 0x20200309
|
||||
#define GITBRANCH "4.1.2-rc"
|
||||
|
@ -284,6 +284,9 @@ u_int32_t getDetectorIP(){
|
||||
FILE* sysFile = popen("ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2", "r");
|
||||
fgets(output, sizeof(output), sysFile);
|
||||
pclose(sysFile);
|
||||
if (strlen(output) <= 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//converting IPaddress to hex.
|
||||
char* pcword = strtok (output,".");
|
||||
@ -329,6 +332,15 @@ void initControlServer(){
|
||||
|
||||
|
||||
setupDetector();
|
||||
|
||||
// activate (if it gets ip) (later FW will deactivate at startup)
|
||||
if (getDetectorIP() != 0) {
|
||||
Beb_Activate(1);
|
||||
Feb_Control_activate(1);
|
||||
} else {
|
||||
Beb_Activate(0);
|
||||
Feb_Control_activate(0);
|
||||
}
|
||||
#endif
|
||||
printf("\n");
|
||||
}
|
||||
@ -344,6 +356,16 @@ void initStopServer(){
|
||||
Feb_Control_FebControl();
|
||||
Feb_Control_Init(master,top,normal,getDetectorNumber());
|
||||
printf("FEB Initialization done\n");
|
||||
|
||||
// activate (if it gets ip) (later FW will deactivate at startup)
|
||||
// also needed for stop server for status
|
||||
if (getDetectorIP() != 0) {
|
||||
Beb_Activate(1);
|
||||
Feb_Control_activate(1);
|
||||
} else {
|
||||
Beb_Activate(0);
|
||||
Feb_Control_activate(0);
|
||||
}
|
||||
#endif
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ enum DACINDEX {SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RX
|
||||
2556, /* Vtgstv */ \
|
||||
1000, /* Vcmp_ll */ \
|
||||
1000, /* Vcmp_lr */ \
|
||||
4000, /* cal */ \
|
||||
0, /* cal */ \
|
||||
1000, /* Vcmp_rl */ \
|
||||
1100, /* rxb_rb */ \
|
||||
1100, /* rxb_lb */ \
|
||||
@ -90,6 +90,7 @@ enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
||||
#define DEFAULT_TEST_MODE (0)
|
||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||
|
||||
#define MAX_TRIMBITS_VALUE (63)
|
||||
|
||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS (0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
||||
|
||||
|
@ -2670,7 +2670,7 @@ int* multiSlsDetector::getDataFromDetector() {
|
||||
int nodatadet = -1;
|
||||
int nodatadetectortype = false;
|
||||
detectorType types = getDetectorsType();
|
||||
if (types == EIGER || types == JUNGFRAU || GOTTHARD || PROPIX) {
|
||||
if (types == EIGER || types == JUNGFRAU || types == GOTTHARD || types == PROPIX) {
|
||||
nodatadetectortype = true;
|
||||
}
|
||||
|
||||
@ -3108,7 +3108,7 @@ slsDetectorDefs::externalCommunicationMode multiSlsDetector::setExternalCommunic
|
||||
externalCommunicationMode pol) {
|
||||
externalCommunicationMode ret, ret1;
|
||||
//(Dhanya) FIXME: why first detector or is it the master one?
|
||||
if (detectors.size())
|
||||
if (detectors.size()) {
|
||||
ret = detectors[0]->setExternalCommunicationMode(pol);
|
||||
if (detectors[0]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
@ -3120,6 +3120,7 @@ slsDetectorDefs::externalCommunicationMode multiSlsDetector::setExternalCommunic
|
||||
if (ret != ret1)
|
||||
ret = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
}
|
||||
}
|
||||
setMaster();
|
||||
setSynchronization();
|
||||
return ret;
|
||||
@ -3129,7 +3130,7 @@ slsDetectorDefs::externalSignalFlag multiSlsDetector::setExternalSignalFlags(
|
||||
externalSignalFlag pol, int signalindex) {
|
||||
externalSignalFlag ret, ret1;
|
||||
//(Dhanya) FIXME: why first detector or is it the master one?
|
||||
if (detectors.size())
|
||||
if (detectors.size()) {
|
||||
ret = detectors[0]->setExternalSignalFlags(pol, signalindex);
|
||||
if (detectors[0]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
@ -3141,6 +3142,7 @@ slsDetectorDefs::externalSignalFlag multiSlsDetector::setExternalSignalFlags(
|
||||
if (ret != ret1)
|
||||
ret = GET_EXTERNAL_SIGNAL_FLAG;
|
||||
}
|
||||
}
|
||||
setMaster();
|
||||
setSynchronization();
|
||||
return ret;
|
||||
@ -5592,11 +5594,13 @@ int multiSlsDetector::enableDataStreamingToClient(int enable) {
|
||||
std::cout << "Could not create data threads in client." << std::endl;
|
||||
//only for the first det as theres no general one
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
if (detectors.size()) {
|
||||
detectors[0]->setErrorMask((detectors[0]->getErrorMask()) |
|
||||
(DATA_STREAMING));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return client_downstream;
|
||||
}
|
||||
|
||||
|
@ -3689,7 +3689,7 @@ int* slsDetector::getDataFromDetector(int *retval) {
|
||||
|
||||
int nodatadetectortype = false;
|
||||
detectorType types = getDetectorsType();
|
||||
if(types == EIGER || types == JUNGFRAU || GOTTHARD || PROPIX){
|
||||
if(types == EIGER || types == JUNGFRAU || types == GOTTHARD || types == PROPIX){
|
||||
nodatadetectortype = true;
|
||||
}
|
||||
|
||||
@ -3906,7 +3906,9 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, '.')) {
|
||||
sprintf(cword,"%s%02x",cword,atoi(s.c_str()));
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, "%02x", atoi(s.c_str()));
|
||||
strcat(cword, cnum);
|
||||
}
|
||||
bzero(arg[0], 50);
|
||||
strcpy(arg[0],cword);
|
||||
@ -3922,7 +3924,7 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, ':')) {
|
||||
sprintf(cword,"%s%s",cword,s.c_str());
|
||||
strcat(cword, s.c_str());
|
||||
}
|
||||
bzero(arg[1], 50);
|
||||
strcpy(arg[1],cword);
|
||||
@ -3941,7 +3943,7 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, ':')) {
|
||||
sprintf(cword,"%s%s",cword,s.c_str());
|
||||
strcat(cword, s.c_str());
|
||||
}
|
||||
bzero(arg[3], 50);
|
||||
strcpy(arg[3],cword);
|
||||
@ -3957,7 +3959,9 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, '.')) {
|
||||
sprintf(cword,"%s%02x",cword,atoi(s.c_str()));
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, "%02x", atoi(s.c_str()));
|
||||
strcat(cword, cnum);
|
||||
}
|
||||
bzero(arg[4], 50);
|
||||
strcpy(arg[4],cword);
|
||||
@ -6122,6 +6126,19 @@ int slsDetector::activate(int const enable) {
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
if (connectStop() == OK){
|
||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
stopSocket->SendDataOnly(&arg,sizeof(arg));
|
||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL) {
|
||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector (Stop server) returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(DETECTOR_ACTIVATE));
|
||||
} else {
|
||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
}
|
||||
disconnectStop();
|
||||
}
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
if(retval==1)
|
||||
|
@ -471,6 +471,14 @@ int slsDetectorActions::executeAction(int level) {
|
||||
case headerBefore:
|
||||
fName=getCurrentFileName();
|
||||
nowIndex=getFileIndexFromFileName(getCurrentFileName());
|
||||
// all other parameters should be taken using text client calls in the header scripts!
|
||||
|
||||
sprintf(cmd,"%s nrun=%d fn=%s par=%s", \
|
||||
getActionScript(level).c_str(), \
|
||||
nowIndex, \
|
||||
fName.c_str(), \
|
||||
getActionParameter(level).c_str());
|
||||
break;
|
||||
case headerAfter:
|
||||
|
||||
// all other parameters should be taken using text client calls in the header scripts!
|
||||
|
@ -3066,7 +3066,9 @@ string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action){
|
||||
npos = myDet->getTrimEn(opos);
|
||||
if (npos != -1) {
|
||||
for (int ip=0; ip<npos;++ip) {
|
||||
sprintf(answer,"%s %d",answer,opos[ip]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, " %d", opos[ip]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3708,7 +3710,9 @@ string slsDetectorCommand::cmdPositions(int narg, char *args[], int action){
|
||||
double opos[npos];
|
||||
myDet->getPositions(opos);
|
||||
for (int ip=0; ip<npos;++ip) {
|
||||
sprintf(answer,"%s %f",answer,opos[ip]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, " %f", opos[ip]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
return string(answer);
|
||||
|
||||
@ -3887,9 +3891,11 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) {
|
||||
ns=myDet->getScanSteps(is, values);
|
||||
int p=myDet->getScanPrecision(is);
|
||||
char format[1000];
|
||||
sprintf(format, "%%s %%0.%df",p);
|
||||
sprintf(format, " %%0.%df",p);
|
||||
for (int i=0; i<ns; ++i) {
|
||||
sprintf(answer,format,answer,values[i]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, format, values[i]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
delete [] values;
|
||||
}
|
||||
@ -3954,10 +3960,11 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) {
|
||||
ns=myDet->getScanSteps(is, values);
|
||||
int p=myDet->getScanPrecision(is);
|
||||
char format[1000];
|
||||
sprintf(format, "%%s %%0.%df",p);
|
||||
sprintf(answer,"%d ",ns);
|
||||
sprintf(format, " %%0.%df",p);
|
||||
for (int i=0; i<ns; ++i) {
|
||||
sprintf(answer,format,answer,values[i]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, format, values[i]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
delete [] values;
|
||||
return string(answer);
|
||||
@ -5850,7 +5857,7 @@ string slsDetectorCommand::cmdTimeLeft(int narg, char *args[], int action) {
|
||||
|
||||
if ((ret!=-1) && (index==ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER
|
||||
|| index==ACTUAL_TIME || index==MEASUREMENT_TIME ||
|
||||
MEASURED_PERIOD || MEASURED_SUBPERIOD)) {
|
||||
index==MEASURED_PERIOD || index==MEASURED_SUBPERIOD)) {
|
||||
rval=(double)ret*1E-9;
|
||||
sprintf(answer,"%0.9f",rval);
|
||||
} else {
|
||||
|
@ -314,6 +314,10 @@ int slsDetectorUsers::enableGapPixels(int enable) {
|
||||
return myDetector->enableGapPixels(enable);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setFlippedDataX(int value) {
|
||||
return myDetector->setFlippedData(slsDetectorDefs::X, value);
|
||||
}
|
||||
|
||||
std::string slsDetectorUsers::setReceiverFramesDiscardPolicy(std::string f) {
|
||||
return myDetector->getReceiverFrameDiscardPolicy(
|
||||
myDetector->setReceiverFramesDiscardPolicy(
|
||||
|
@ -553,6 +553,12 @@ class slsDetectorUsers
|
||||
*/
|
||||
int enableGapPixels(int enable=-1);
|
||||
|
||||
/** sets the enable which determines if data will be flipped across x axis
|
||||
* @param value 0 or 1 to reset/set or -1 to get value
|
||||
* @return enable flipped data across x axis
|
||||
*/
|
||||
int setFlippedDataX(int value=-1);
|
||||
|
||||
/**
|
||||
* Sets the frames discard policy in receiver
|
||||
* frame discard policy options:
|
||||
|
@ -4361,11 +4361,11 @@ int set_all_trimbits(int file_des){
|
||||
#ifdef VERBOSE
|
||||
printf("setting all trimbits to %d\n",arg);
|
||||
#endif
|
||||
if(arg < -1){
|
||||
if(arg < -1 || arg > MAX_TRIMBITS_VALUE){
|
||||
ret = FAIL;
|
||||
strcpy(mess,"Cant set trimbits to this value\n");
|
||||
sprintf(mess,"Cant set all trimbits to %d. Range 0 - %d\n", arg, MAX_TRIMBITS_VALUE);
|
||||
cprintf(RED, "Warning: %s", mess);
|
||||
}else {
|
||||
} else {
|
||||
if(arg >= 0){
|
||||
ret = setAllTrimbits(arg);
|
||||
//changes settings to undefined
|
||||
|
@ -312,7 +312,7 @@ public:
|
||||
"\"quad\":%u"
|
||||
|
||||
;//"}\n";
|
||||
int length = sprintf(buf, jsonHeaderFormat,
|
||||
sprintf(buf, jsonHeaderFormat,
|
||||
jsonversion, dynamicrange, fileIndex, ndetx, ndety, npixelsx, npixelsy, imageSize,
|
||||
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
|
||||
|
||||
@ -326,10 +326,11 @@ public:
|
||||
quadEnable
|
||||
);
|
||||
if (additionalJsonHeader && strlen(additionalJsonHeader)) {
|
||||
length = sprintf(buf, "%s, %s}\n", buf, additionalJsonHeader);
|
||||
} else {
|
||||
length = sprintf(buf, "%s}\n", buf);
|
||||
strcat(buf, ", ");
|
||||
strcat(buf, additionalJsonHeader);
|
||||
}
|
||||
strcat(buf,"}\n");
|
||||
int length = strlen(buf);
|
||||
|
||||
#ifdef VERBOSE
|
||||
if(!index)
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define FILE_BUFFER_SIZE (16*1024*1024) //16mb
|
||||
|
||||
//fifo
|
||||
#define FIFO_HEADER_NUMBYTES 4
|
||||
#define FIFO_HEADER_NUMBYTES 8
|
||||
|
||||
|
||||
//hdf5
|
||||
|
@ -46,14 +46,14 @@ int Fifo::CreateFifos(uint32_t fifoItemSize) {
|
||||
fifoFree = new CircularFifo<char>(fifoDepth);
|
||||
fifoStream = new CircularFifo<char>(fifoDepth);
|
||||
//allocate memory
|
||||
size_t mem_len = fifoItemSize * fifoDepth * sizeof(char);
|
||||
size_t mem_len = (size_t)fifoItemSize * (size_t)fifoDepth * sizeof(char);
|
||||
memory = (char*) malloc (mem_len);
|
||||
if (memory == NULL){
|
||||
FILE_LOG(logERROR) << "Could not allocate memory for fifos";
|
||||
return FAIL;
|
||||
}
|
||||
memset(memory, 0, mem_len);
|
||||
FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << mem_len << " bytes";
|
||||
FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << (double)mem_len/(double)(1024 * 1024) << " MB";
|
||||
|
||||
{ //push free addresses into fifoFree fifo
|
||||
char* buffer = memory;
|
||||
|
@ -397,7 +397,9 @@ void UDPBaseImplementation::setMultiDetectorSize(const int* size) {
|
||||
numDet[i] = size[i]*2;
|
||||
else
|
||||
numDet[i] = size[i];
|
||||
sprintf(message,"%s%d",message,numDet[i]);
|
||||
char cnum[20]="";
|
||||
sprintf(cnum, "%d", numDet[i]);
|
||||
strcat(message, cnum);
|
||||
if (i < MAX_DIMENSIONS-1 )
|
||||
strcat(message,",");
|
||||
}
|
||||
@ -650,7 +652,7 @@ void UDPBaseImplementation::setSubPeriod(const uint64_t i){
|
||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||
|
||||
subPeriod = i;
|
||||
FILE_LOG(logINFO) << "Sub Exposure Time: " << (double)subPeriod/(1E9) << "s";
|
||||
FILE_LOG(logINFO) << "Sub Period: " << (double)subPeriod/(1E9) << "s";
|
||||
}
|
||||
|
||||
int UDPBaseImplementation::setNumberOfFrames(const uint64_t i){
|
||||
|
@ -119,7 +119,9 @@ void UDPStandardImplementation::setMultiDetectorSize(const int* size) {
|
||||
numDet[i] = size[i]*2;
|
||||
else
|
||||
numDet[i] = size[i];
|
||||
sprintf(message,"%s%d",message,numDet[i]);
|
||||
char cnum[20]="";
|
||||
sprintf(cnum, "%d", numDet[i]);
|
||||
strcat(message, cnum);
|
||||
if (i < MAX_DIMENSIONS-1 )
|
||||
strcat(message,",");
|
||||
}
|
||||
@ -834,7 +836,7 @@ int UDPStandardImplementation::SetupFifoStructure() {
|
||||
if(dataStreamer.size())dataStreamer[i]->SetFifo(fifo[i]);
|
||||
}
|
||||
|
||||
FILE_LOG(logINFO) << "Memory Allocated Per Fifo: " << ( ((generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize)) * fifoDepth) << " bytes" ;
|
||||
FILE_LOG(logINFO) << "Memory Allocated Per Fifo: " << (double)( ((generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize)) * fifoDepth)/ (double)(1024 * 1024) << " MB" ;
|
||||
FILE_LOG(logINFO) << numThreads << " Fifo structure(s) reconstructed";
|
||||
return OK;
|
||||
}
|
||||
|
@ -16,12 +16,12 @@
|
||||
#include <sys/wait.h> //wait
|
||||
#include <unistd.h> //usleep
|
||||
#include <syscall.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
|
||||
bool keeprunning;
|
||||
sem_t semaphore;
|
||||
|
||||
void sigInterruptHandler(int p){
|
||||
keeprunning = false;
|
||||
sem_post(&semaphore);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -65,7 +65,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 +148,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));
|
||||
|
@ -542,7 +542,7 @@ int slsReceiverTCPIPInterface::set_port() {
|
||||
try {
|
||||
mySocket = new MySocketTCP(p_number);
|
||||
strcpy(mySock->lastClientIP,oldLastClientIP);
|
||||
} catch(SamePortSocketException e) {
|
||||
} catch(SamePortSocketException& e) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not bind port %d. It is already set\n", p_number);
|
||||
FILE_LOG(logERROR) << mess;
|
||||
@ -1039,6 +1039,7 @@ int slsReceiverTCPIPInterface::set_timer() {
|
||||
// else if (receiverBase->getStatus() != IDLE)
|
||||
// receiverNotIdle();
|
||||
else {
|
||||
uint64_t subdeadtime = 0;
|
||||
switch (index[0]) {
|
||||
case ACQUISITION_TIME:
|
||||
ret = receiverBase->setAcquisitionTime(index[1]);
|
||||
@ -1052,7 +1053,9 @@ int slsReceiverTCPIPInterface::set_timer() {
|
||||
receiverBase->setNumberOfFrames(index[1]);
|
||||
break;
|
||||
case SUBFRAME_ACQUISITION_TIME:
|
||||
subdeadtime = receiverBase->getSubPeriod() - receiverBase->getSubExpTime();
|
||||
receiverBase->setSubExpTime(index[1]);
|
||||
receiverBase->setSubPeriod(receiverBase->getSubExpTime() + subdeadtime);
|
||||
break;
|
||||
case SUBFRAME_DEADTIME:
|
||||
receiverBase->setSubPeriod(index[1] + receiverBase->getSubExpTime());
|
||||
|
Loading…
x
Reference in New Issue
Block a user