selective merge from branch 4.0.0 conflict fix

This commit is contained in:
maliakal_d 2018-08-24 13:12:55 +02:00
commit 548036a602
12 changed files with 117 additions and 66 deletions

View File

@ -20,7 +20,7 @@ all: docs detUser slsMultiReceiver
docs: createdocs docspdf docshtml removedocs
createdocs: slsDetectorUsers.doxy slsDetectorUsers.h detectorData.h slsReceiverUsers.h mainClient.cpp mainReceiver.cpp
createdocs: slsDetectorUsers.doxy mainClient.cpp mainReceiver.cpp
doxygen slsDetectorUsers.doxy
docspdf:

View File

@ -54,9 +54,9 @@ int main(int argc, char **argv) {
/** - slsDetectorUsers Object is instantiated with appropriate ID */
int ret = slsReceiverDefs::FAIL;
int ret = 1;
slsDetectorUsers *pDetector = new slsDetectorUsers (ret, id);
if (ret == slsReceiverDefs::FAIL) {
if (ret == 1) {
std::cout << "Error: Could not instantiate slsDetectorUsers" << std::endl;
return EXIT_FAILURE;
}

View File

@ -81,7 +81,11 @@ LATEX_HIDE_INDICES = YES
SOURCE_BROWSER = YES
PREDEFINED = __cplusplus
INPUT = slsDetectorUsers.h detectorData.h slsReceiverUsers.h mainClient.cpp mainReceiver.cpp
INPUT = ../../slsDetectorSoftware/slsDetector/slsDetectorUsers.h \
../../slDetectorSoftware/slsDetectorAnalysis/detectorData.h \
../../slsReceiverSoftware/include/slsReceiverUsers.h \
mainClient.cpp \
mainReceiver.cpp
OUTPUT_DIRECTORY = slsDetectorUsersDocs

View File

@ -61,6 +61,11 @@ The \textit{data receiver}, which can be run on a different machine than the
client, receives the data from the detector and processes it. The receiver can
be configured, controlled and monitored by the client.
\item \textcolor{blue}{slsMultiReceiver}: \\
It is the same as the \textit{slsReceiver}, but that it is a single process
for many multiple slsReceiver child processes. One can configure the start TCP port,
number of slsReceiver processes and if call back should be enabled or not.
\item \textcolor{blue}{slsDetectorGUI}: \\
The \textit{graphical user interface}, which provides a user friendly way
of operating the detectors and data receivers with online data preview.
@ -110,13 +115,13 @@ conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
#Install latest version
conda install sls_detector_software
conda install sls_detector_lib
conda install sls_detector_gui
#Install specific release (GLIBC2.14)
conda install sls_detector_software=3.1.0
#Install specific release
conda install sls_detector_lib=4.0.0
conda install sls_detector_gui=4.0.0
#Scientific Linux 6 version (GLIBC2.12)
conda install sls_detector_software=SL6_3.1.0
\end{verbatim}
\item The package including Python interface
\begin{verbatim}
@ -127,11 +132,9 @@ conda config --add channels sls_detector
#Install latest version
conda install sls_detector
#Install specific release (GLIBC2.14)
conda install sls_detector=3.1.0
#Install specific release
conda install sls_detector=4.0.0
#Scientific Linux 6 version (GLIBC2.12)
conda install sls_detector=SL6_3.1.0
\end{verbatim}
\end{itemize}
@ -148,13 +151,13 @@ acquisition system, or if one wants to download the source code and compile.
\begin{verbatim}
#Clone source code with specific release
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch
3.1.0
4.0.0
\end{verbatim}
\item The package including Python interface
\begin{verbatim}
#Clone source code with specific release
git clone https://github.com/slsdetectorgroup/sls_detector.git --branch
3.1.0
4.0.0
\end{verbatim}
\end{itemize}
@ -437,14 +440,11 @@ the SLS Detector Package or a different detector type.
One can use the \verb=cleansharedmemory.sh= script available under the
slsDetector Package.
One can also just use the following commands to clean the shared memory
segments one by one.
\begin{verbatim}
#displays list of shared memeory segments
ipcs -m
#remove segments that have nattach equal to zero. They key is the first column
ipcrm -M [key]
\end{verbatim}
One can also just delete the files that are typically located under /dev/shm/ folder
and starts with slsDetectorPackage.
One no longer has to delete segments using ipcs.
\section{Software Upgrade}
@ -544,14 +544,14 @@ detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{GOTTHARD Firmware}
\textit{For SLS Detector Package v3.1.0} \\
\textit{For SLS Detector Package v4.0.0} \\
\indent Minimum compatible version: \\
\indent \indent 11.01.2013 \\
\indent Latest version: \\
\indent \indent 08.02.2018 (50um and 25um Master) \\
\indent \indent 26.06.2018 (50um) \\
\indent \indent 08.02.2018 (25 um Master) \\
\indent \indent 09.02.2018 (25 um Slave) \\
Normally, the firmware will be upgraded by us as it requires programming the
FPGA via the USB-Blaster.
@ -636,9 +636,9 @@ detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{EIGER Firmware}
\textit{For SLS Detector Package v3.1.0} \\
\indent Minimum compatible version: 16 \\
\indent Latest version: 20 \\
\textit{For SLS Detector Package v4.0.0} \\
\indent Minimum compatible version: 22 \\
\indent Latest version: 22 \\
\begin{enumerate}
@ -647,6 +647,20 @@ Detector Group.
\item If one does not have the bcp script, that should also be obtained from
the SLS Detector Group. It is required to program the bit files and requires
that tftp be installed on the pc.
\item Bring the detector into programmable mode by either of the following ways.
Both ways end up in just the central LED blinking.
\begin{enumerate}
\item hard reset on the back panel boards resulting in blinking LEDS
\item by having the following program running in the background.
\begin{verbatim}
boot_recovery
\end{verbatim}
\end{enumerate}
\item Start a terminal for each half module and run the following to see
progress.
\begin{verbatim}
nc -p 3000 -u bebxxx 3000
\end{verbatim}
\item Run the following to update firmware
\begin{verbatim}
#update back end fpga
@ -715,9 +729,9 @@ detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{JUNGFRAU Firmware}
\textit{For SLS Detector Package v3.1.0} \\
\indent Minimum compatible version: 13.11.2017 \\
\indent Latest version: 13.11.2017 \\
\textit{For SLS Detector Package v4.0.0} \\
\indent Minimum compatible version: 15.06.2018 \\
\indent Latest version: 15.06.2018 \\
At times, one has to update the firmware, which then also requires updating the

View File

@ -1,5 +1,5 @@
/** API versions */
#define APIRECEIVER 0x180517
#define APIEIGER 0x180815
#define APIJUNGFRAU 0x180628
#define APIGOTTHARD 0x180529
#define APIRECEIVER 0x180718
#define APIEIGER 0x180820
#define APIJUNGFRAU 0x180820
#define APIGOTTHARD 0x180820

View File

@ -657,7 +657,9 @@ enum readOutFlags setReadOutFlags(enum readOutFlags val){
/* parameters - timer */
int64_t setTimer(enum timerIndex ind, int64_t val){
#ifndef VIRTUAL
int64_t subdeadtime = 0;
#endif
int64_t subexptime = 0;
switch(ind){
case FRAME_NUMBER:
@ -723,7 +725,7 @@ int64_t setTimer(enum timerIndex ind, int64_t val){
// get subexptime
subexptime = Feb_Control_GetSubFrameExposureTime();
#else
int64_t subexptime = eiger_virtual_subexptime*10;
subexptime = eiger_virtual_subexptime*10;
#endif
if(val >= 0){
printf(" Setting sub period: %lldns = subexptime(%lld) + subdeadtime(%lld)\n",
@ -787,13 +789,18 @@ int64_t setTimer(enum timerIndex ind, int64_t val){
int64_t getTimeLeft(enum timerIndex ind) {
#ifdef VIRTUAL
return 0;
#else
switch(ind){
case MEASURED_PERIOD: return Feb_Control_GetMeasuredPeriod();
case MEASURED_SUBPERIOD: return Feb_Control_GetSubMeasuredPeriod();
return 0;
default:
cprintf(RED,"This timer left index (%d) not defined for Eiger\n",ind);
return -1;
}
#endif
}
@ -1612,9 +1619,13 @@ int stopStateMachine(){
}
int softwareTrigger() {
#ifdef VIRTUAL
return OK;
#else
if (!Feb_Control_SoftwareTrigger())
return FAIL;
return OK;
#endif
}

View File

@ -10,7 +10,7 @@
#define GOODBYE (-200)
#define PROGRAMMING_MODE (-200)
#define MIN_REQRD_VRSN_T_RD_API 0x171220
#define REQRD_FRMWR_VRSN 0x180226
#define REQRD_FRMWR_VRSN 0x180615
/* Struct Definitions */

View File

@ -44,6 +44,12 @@ To address a specific controller i of detector j use:
<b>sls_detector_clnt j-i:cmd</b>
To use different shared memory segements for different detectors on the same
client pc, one can use environment variable <b>SLSDETNAME</b> set to any string to
different strings to make the shared memory segments unique. One can then use
the same multi detector id for both detectors as they have a different shared memory names.
For additional questions concerning the indexing of the detector, please refer to the SLS Detectors FAQ documentation.
The commands are sudivided into different pages depending on their functionalities:

View File

@ -25,7 +25,6 @@ class multiSlsDetectorCommand;
/*
\mainpage
<CENTER><H1>API for SLS detectors data acquisition</H1></CENTER>
@ -72,12 +71,11 @@ You can find examples of how this classes can be instatiated in mainClient.cpp
*/
/**
@libdoc The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in their acquisition software (EPICS, spec etc.). More advanced configuration functions are not implemented and can be written in a configuration or parameters file that can be read/written.
*/
/**
@short Class for detector functionalities to embed the detector controls in the users custom interface e.g. EPICS, Lima etc.
@short The slsDetectorUsers class is a minimal interface class which should be instantiated by the users in their acquisition software (EPICS, spec etc.). More advanced configuration functions are not implemented and can be written in a configuration or parameters file that can be read/written.
Class for detector functionalities to embed the detector controls in the users custom interface e.g. EPICS, Lima etc.
*/
@ -270,8 +268,6 @@ class slsDetectorUsers
int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
/**
@short gets the maximum detector size
\param x0 horizontal position origin in channel number
\param y0 vertical position origin in channel number
\param nx number of channels in horiziontal
\param ny number of channels in vertical
\returns OK/FAIL
@ -418,6 +414,7 @@ class slsDetectorUsers
/**
@short register calbback for accessing detector final data, also enables data streaming in client and receiver (if receiver exists)
\param userCallback function for plotting/analyzing the data. Its arguments are the data structure d and the frame number f, s is for subframe number for eiger for 32 bit mode
\param pArg argument
*/
void registerDataCallback(int( *userCallback)(detectorData* d, int f, int s, void*), void *pArg);
@ -425,6 +422,7 @@ class slsDetectorUsers
/**
@short register callback for accessing raw data - if the rawDataCallback is registered, no filewriting/postprocessing will be carried on automatically by the software - the raw data are deleted by the software
\param userCallback function for postprocessing and saving the data - p is the pointer to the data, n is the number of channels
\param pArg argument
*/
void registerRawDataCallback(int( *userCallback)(double* p, int n, void*), void *pArg);
@ -461,7 +459,7 @@ class slsDetectorUsers
/** Enable or disable streaming data from receiver (creates transmitting sockets)
* @param enable 0 to disable 1 to enable -1 to only get the value
* @param i 0 to disable 1 to enable -1 to only get the value
* @returns data streaming from receiver enable
*/
int enableDataStreamingFromReceiver(int i=-1);
@ -500,7 +498,7 @@ class slsDetectorUsers
/** (for expert users)
* Set/Get client streaming in ZMQ IP
* By default, it is the IP of receiver hostname
* @param i sets, empty std::string gets
* @param ip sets, empty std::string gets
* @returns client streaming in ZMQ IP
*/
std::string setClientDataStreamingInIP(std::string ip="");
@ -597,38 +595,45 @@ class slsDetectorUsers
/**
@short register calbback for accessing detector final data
\param func function to be called at the end of the acquisition. gets detector status and progress index as arguments
\param pArg argument
*/
void registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg);
/**
@short register calbback for reading detector position
\param func function for reading the detector position
\param arg argument
*/
void registerGetPositionCallback( double (*func)(void*),void *arg);
/**
@short register callback for connecting to the epics channels
\param func function for connecting to the epics channels
\param arg argument
*/
void registerConnectChannelsCallback( int (*func)(void*),void *arg);
/**
@short register callback to disconnect the epics channels
\param func function to disconnect the epics channels
\param arg argument
*/
void registerDisconnectChannelsCallback( int (*func)(void*),void *arg);
/**
@short register callback for moving the detector
\param func function for moving the detector
\param arg argument
*/
void registerGoToPositionCallback( int (*func)(double,void*),void *arg);
/**
@short register callback for moving the detector without waiting
\param func function for moving the detector
\param arg argument
*/
void registerGoToPositionNoWaitCallback( int (*func)(double,void*),void *arg);
/**
@short register calbback reading to I0
\param func function for reading the I0 (called with parameter 0 before the acquisition, 1 after and the return value used as I0)
\param arg argument
*/
void registerGetI0Callback( double (*func)(int,void*),void *arg);
@ -703,13 +708,13 @@ class slsDetectorUsers
/**
@short start receiver listening mode
\param returns OK or FAIL
\returns returns OK or FAIL
*/
int startReceiver();
/**
@short stop receiver listening mode
\param returns OK or FAIL
\returns returns OK or FAIL
*/
int stopReceiver();
@ -744,7 +749,7 @@ class slsDetectorUsers
/**
* reset frames caught in receiver
* should be called before startReceiver()
* @retuns OK or FAIL
* @returns OK or FAIL
*/
int resetFramesCaughtInReceiver();
@ -777,7 +782,7 @@ class slsDetectorUsers
/**
* Set sub frame exposure time (only for Eiger)
* @param i sub frame exposure time (-1 gets)
* @param t sub frame exposure time (-1 gets)
* @param inseconds true if the value is in s, else ns
* @param imod module number (-1 for all)
* @returns sub frame exposure time in ns, or s if specified
@ -787,7 +792,7 @@ class slsDetectorUsers
/**
* Set sub frame dead time (only for Eiger)
* Very advanced feature. Meant to be a constant in config file by an expert for each individual module
* @param i sub frame dead time (-1 gets)
* @param t sub frame dead time (-1 gets)
* @param inseconds true if the value is in s, else ns
* @param imod module number (-1 for all)
* @returns sub frame dead time in ns, or s if specified
@ -804,7 +809,7 @@ class slsDetectorUsers
/**
* Set storage cell that stores first acquisition of the series (Jungfrau)
* @param value storage cell index. Value can be 0 to 15. Default is 15. (-1 gets)
* @param pos storage cell index. Value can be 0 to 15. Default is 15. (-1 gets)
* @returns the storage cell that stores the first acquisition of the series
*/
int setStoragecellStart(int pos=-1);

View File

@ -21,7 +21,12 @@ class detectorData {
\param dr dynamic range or bits per pixel (valid only for non MYTHEN detectors)
\param file_ind file index
*/
detectorData(double *val=NULL, double *err=NULL, double *ang=NULL, double f_ind=-1, const char *fname="", int np=-1, int ny=1, char *cval=NULL, int dbytes=0, int dr=0, long long int file_ind=-1) : values(val), errors(err), angles(ang), progressIndex(f_ind), npoints(np), npy(ny), cvalues(cval), databytes(dbytes), dynamicRange(dr), dgainvalues(NULL), fileIndex(file_ind) {
detectorData(double *val=NULL, double *err=NULL, double *ang=NULL, double f_ind=-1,
const char *fname="", int np=-1, int ny=1, char *cval=NULL, int dbytes=0, int dr=0,
long long int file_ind=-1) :
values(val), errors(err), angles(ang), progressIndex(f_ind),
npoints(np), npy(ny), cvalues(cval), databytes(dbytes),
dynamicRange(dr), dgainvalues(NULL), fileIndex(file_ind) {
strcpy(fileName,fname);
};
@ -30,7 +35,8 @@ class detectorData {
deletes also the arrays pointing to data/errors/angles if not NULL
cvalues are deleted by caller
*/
~detectorData() {if (values) delete [] values; if (errors) delete [] errors; if (angles) delete [] angles; if(dgainvalues) delete [] dgainvalues;};
~detectorData() {if (values) delete [] values; if (errors) delete [] errors;
if (angles) delete [] angles; if(dgainvalues) delete [] dgainvalues;};
//private:
double *values; /**< @short pointer to the data as double array (MYTHEN only) */
double *errors; /**< @short pointer to the errors */

View File

@ -2790,7 +2790,9 @@ int set_timer(int file_des) {
#ifdef VERBOSE
printf("setting timer %d to %lld ns\n",ind,tns);
#endif
#ifdef EIGERD
int64_t subexptime = 0;
#endif
switch(ind) {
#ifdef JUNGFRAUD
case STORAGE_CELL_NUMBER:
@ -5846,7 +5848,7 @@ int check_version(int file_des) {
sprintf(mess,"Client's detector SW API version: (0x%llx). "
"Detector's SW API Version: (0x%llx). "
"Incompatible, update client!\n",
client_requiredVersion, det_apiVersion);
(long long int)client_requiredVersion, (long long int)det_apiVersion);
cprintf(RED, "Warning: %s", mess);
}
@ -5856,7 +5858,7 @@ int check_version(int file_des) {
sprintf(mess,"Detector SW Version: (0x%llx). "
"Client's detector SW API Version: (0x%llx). "
"Incompatible, update detector software!\n",
det_version, client_requiredVersion);
(long long int)det_version, (long long int)client_requiredVersion);
cprintf(RED, "Warning: %s", mess);
}
}

View File

@ -8,9 +8,8 @@ class slsReceiver;
/**
@short Class for implementing the SLS data receiver in the users application. Callbacks can be defined for processing and/or saving data
*/
/**
@libdoc slsReceiverUsers is a class that can be instantiated in the users software to receive the data from the detectors. Callbacks can be defined for processing and/or saving data
slsReceiverUsers is a class that can be instantiated in the users software to receive the data from the detectors. Callbacks can be defined for processing and/or saving data
***********************************************/
class slsReceiverUsers {
@ -21,7 +20,7 @@ public:
* reads config file, creates socket, assigns function table
* @param argc from command line
* @param argv from command line
* @param succecc socket creation was successfull
* @param success socket creation was successfull
*/
slsReceiverUsers(int argc, char *argv[], int &success);
@ -46,16 +45,18 @@ public:
/**
@sort register calbback for starting the acquisition
@short register calbback for starting the acquisition
\param func callback to be called when starting the acquisition. Its arguments are filepath, filename, fileindex, datasize
\param arg argument
\return value is insignificant at the moment, we write depending on file write enable, users get data to write depending on call backs registered
*/
void registerCallBackStartAcquisition(int (*func)(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*),void *arg);
/**
@sort register callback for end of acquisition
@short register callback for end of acquisition
\param func end of acquisition callback. Argument nf is total frames caught
\param arg argument
\returns nothing
*/
void registerCallBackAcquisitionFinished(void (*func)(uint64_t nf, void*),void *arg);
@ -63,8 +64,9 @@ public:
/**
@sort register callback to be called when data are available (to process and/or save the data).
@short register callback to be called when data are available (to process and/or save the data).
\param func raw data ready callback. arguments are sls_receiver_header, dataPointer, dataSize
\param arg argument
\returns nothing
*/
void registerCallBackRawDataReady(void (*func)(char* header,
@ -72,8 +74,9 @@ public:
/**
@sort register callback to be called when data are available (to process and/or save the data).
@short register callback to be called when data are available (to process and/or save the data).
\param func raw data ready callback. arguments are sls_receiver_header, dataPointer, revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
\param arg argument
\returns nothing
*/
void registerCallBackRawDataModifyReady(void (*func)(char* header,