fixed gitinfo

This commit is contained in:
bergamaschi 2018-04-23 14:19:55 +02:00
commit c35203ebfb
64 changed files with 1276 additions and 649 deletions

View File

@ -7,7 +7,7 @@ option (USE_TEXTCLIENT "Text Client" OFF)
option (USE_RECEIVER "Receiver" OFF) option (USE_RECEIVER "Receiver" OFF)
option (USE_GUI "GUI" OFF) option (USE_GUI "GUI" OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-misleading-indentation") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wno-misleading-indentation")
find_package(Qt4) find_package(Qt4)
find_package(Qwt 6) find_package(Qwt 6)

View File

@ -1,113 +1 @@
SLS Detector Package 3.1.1 released on 2018-03-12
=================================================
INTRODUCTION
This document describes the differences between 3.1.0 and 3.1.0 releases.
The conda package of the binaries can be downloaded from
https://github.com/slsdetectorgroup/sls_detector_software.git
The Python interface to the software package (including the package) is at
https://github.com/slsdetectorgroup/sls_detector.git
Manual (both HTML and pdf versions) are provided in
manual/docs/
Documentation from Source Code can be found for the Command Line and for the API in
html:
manual/docs/html/slsDetectorClientDocs/index.html
manual/docs/html/slsDetectorUsersDocs/index.html
pdf:
manual/docs/pdf/slsDetectorClientDocs.pdf
manual/docs/pdf/slsDetectorUsersDocs.pdf
Example including binaries for detector and receiver user classes can be found in
manual/manual-api
User documentation can also be accessed directly at this location:
https://www.psi.ch/detectors/users-support
If you have any software related questions or comments, please send them to:
dhanya.thattil@psi.ch
anna.bergamaschi@psi.ch
If you have any python related questions or comments, please send them to:
erik.frojdh@psi.ch
CONTENTS
- Firmware Requirements
- Changes in User Interface
- New Features
- Resolved Issues
- Known Issues
Firmware Requirements
=====================
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
Gotthard
========
Minimum compatible version : 11.01.2013
Latest version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
-Can not be upgraded remotely.
Eiger
=====
Minimum compatible version : 16
Latest version : 20
-Can be upgraded remotely via bit files.
Jungfrau
========
Minimum compatible version : 13.11.2017
Latest version : 13.11.2017
-Can be upgraded remotely via sls_detector_put programfpga <pof>.
Changes in User Interface
=========================
New Features
============
Resolved Issues
===============
Known Issues
============

View File

@ -86,6 +86,7 @@ void AcquisitionFinished(uint64_t frames, void*p){
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",frames); cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",frames);
} }
/** /**
* Get Receiver Data Call back * Get Receiver Data Call back
* Prints in different colors(for each receiver process) the different headers for each image call back. * Prints in different colors(for each receiver process) the different headers for each image call back.
@ -94,6 +95,42 @@ void AcquisitionFinished(uint64_t frames, void*p){
* @param packetNumber number of packets caught for this frame * @param packetNumber number of packets caught for this frame
* @param bunchId bunch id from beamline * @param bunchId bunch id from beamline
* @param timestamp time stamp in 10MHz clock (not implemented for most) * @param timestamp time stamp in 10MHz clock (not implemented for most)
* @param modId module id (not implemented for most)
* @param xCoord x coordinates (detector id in 1D)
* @param yCoord y coordinates (not implemented)
* @param zCoord z coordinates (not implemented)
* @param debug debug values if any
* @param roundRNumber (not implemented)
* @param detType detector type see :: detectorType
* @param version version of standard header (structure format)
* @param datapointer pointer to data
* @param datasize data size in bytes.
* @param p pointer to object
*/
void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t datasize, void* p){
PRINT_IN_COLOR (modId?modId:xCoord,
"#### %d GetData: ####\n"
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu\t\ttimestamp: %llu\t\tmodId: %u\t\t"
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u\t\troundRNumber: %u\t\tdetType: %u\t\t"
"version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
((uint8_t)(*((uint8_t*)(datapointer)))), datasize);
}
/**
* Get Receiver Data Call back (modified)
* Prints in different colors(for each receiver process) the different headers for each image call back.
* @param frameNumber frame number
* @param expLength real time exposure length (in 100ns) or sub frame number (Eiger 32 bit mode only)
* @param packetNumber number of packets caught for this frame
* @param bunchId bunch id from beamline
* @param timestamp time stamp in 10MHz clock (not implemented for most)
* @param modId module id (not implemented for most) * @param modId module id (not implemented for most)
* @param xCoord x coordinates (detector id in 1D) * @param xCoord x coordinates (detector id in 1D)
* @param yCoord y coordinates (not implemented) * @param yCoord y coordinates (not implemented)
@ -103,12 +140,14 @@ void AcquisitionFinished(uint64_t frames, void*p){
* @param detType detector type see :: detectorType * @param detType detector type see :: detectorType
* @param version version of standard header (structure format) * @param version version of standard header (structure format)
* @param datapointer pointer to data * @param datapointer pointer to data
* @param datasize data size in bytes * @param datasize data size in bytes.
* @param revDatasize new data size in bytes after the callback.
* This will be the size written/streamed. (only smaller value is allowed).
* @param p pointer to object * @param p pointer to object
*/ */
void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp, void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t datasize, void* p){ char* datapointer, uint32_t &revDatasize, void* p){
PRINT_IN_COLOR (modId?modId:xCoord, PRINT_IN_COLOR (modId?modId:xCoord,
"#### %d GetData: ####\n" "#### %d GetData: ####\n"
@ -117,11 +156,15 @@ void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, ui
"version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n", "version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId, xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version, xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
((uint8_t)(*((uint8_t*)(datapointer)))), datasize); ((uint8_t)(*((uint8_t*)(datapointer)))), revDatasize);
// if data is modified, eg ROI and size is reduced
revDatasize = 26000;
} }
/** /**
* Example of main program using the slsReceiverUsers class * Example of main program using the slsReceiverUsers class
* *
@ -209,7 +252,8 @@ int main(int argc, char *argv[]) {
/* - Call back for raw data */ /* - Call back for raw data */
cprintf(BLUE, "Registering GetData() \n"); cprintf(BLUE, "Registering GetData() \n");
receiver->registerCallBackRawDataReady(GetData,NULL); if (withCallback == 1) receiver->registerCallBackRawDataReady(GetData,NULL);
else if (withCallback == 2) receiver->registerCallBackRawDataModifyReady(GetData,NULL);
} }

View File

@ -82,8 +82,8 @@ The receiver is a process run on a PC closely connected to the detector. Open on
where xxxx, yyyy are the tcp port numbers. Use 1955 and 1956 for example. Note that in older version of the software {\tt{--mode 1}} was used only for the ``bottom'' half module. Now, the receiver for the bottom is open without arguments anymore, but still in the configuration file one needs to write {\tt{n:flippeddatax 1}}, where {\tt{n}} indicated the half module number, 1 if it is a module. where xxxx, yyyy are the tcp port numbers. Use 1955 and 1956 for example. Note that in older version of the software {\tt{--mode 1}} was used only for the ``bottom'' half module. Now, the receiver for the bottom is open without arguments anymore, but still in the configuration file one needs to write {\tt{n:flippeddatax 1}}, where {\tt{n}} indicated the half module number, 1 if it is a module.
\\ Open as many receiver as half module boards. A single module has two half module boards. \\ Open as many receiver as half module boards. A single module has two half module boards.
From the software version 3.0.1, one can decide weather start a zmq callback from the receiver to the client (for example to visualize data in the slsDetectorGui or another gui). If the zmq steam is not required (cased of the command line for example, one can switch off the streaming with {\tt{./sls\_detector\_put rx\_datastream 0}}, enable it with {\tt{./sls\_detector\_put rx\_datastream 1}}. In the case of inizialising the stream to use the slsDetectorGui, nothing needs to be taken care of by the user. If instead you want to stream the streaming on different channels, the zmq port of the client can be set stealing from the slsDetectorGui stream having {\tt{./sls\_detector\_put n:zmqport 300y}}, where n is each half module independently, matching the receiver stream {\tt{./sls\_detector\_put n:rx\_zmqport 300y}}. From the software version 3.0.1, one can decide weather start a zmq callback from the receiver to the client (for example to visualize data in the slsDetectorGui or another gui). If the zmq steam is not required (cased of the command line for example, one can switch off the streaming with {\tt{./sls\_detector\_put rx\_datastream 0}}, enable it with {\tt{./sls\_detector\_put rx\_datastream 1}}. In the case of inizialising the stream to use the slsDetectorGui, nothing needs to be taken care of by the user. If instead you want to stream the streaming on different channels, the zmq port of the client can be set stealing from the slsDetectorGui stream having {\tt{./sls\_detector\_put zmqport 300y}}. Note taht if this is done globally (not for every half module n independently, then the client automatically takes into account that for every half module, there are 2 zmq stream. The receiver stream {\tt{./sls\_detector\_put rx\_zmqport 300y}} has to match such that the GUI can work.
If one desires to set the zmqport manually, he offset has to be taken into account: {\tt{./sls\_detector\_put 0:rx\_zmqport 300y}}, {\tt{./sls\_detector\_put 1:rx\_zmqport 300y+2}} and so on..
There is an example code that can be compiled in {\tt{manual/manual-api/mainReceiver.cpp}} and gives the executable {\tt{./detReceiver}}, use it with two or more receivers to open all receivers in one single terminal: {\tt{./detReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased. There is an example code that can be compiled in {\tt{manual/manual-api/mainReceiver.cpp}} and gives the executable {\tt{./detReceiver}}, use it with two or more receivers to open all receivers in one single terminal: {\tt{./detReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased.
@ -694,7 +694,15 @@ Start the server again:
\begin{verbatim} \begin{verbatim}
./eigerDetectorServer & ./eigerDetectorServer &
\end{verbatim} \end{verbatim}
\textbf{Note that the server appropiate for the software version used is located inside the package: {\tt{slsDetectorsPackage/serverBin/eigerDetectorServerxx.yy.}}}.
To copy the detector server on many boards, a script can be implemented on the lines of:
\begin{verbatim}
for i in beb111 beb070;
do ssh root@$i killall eigerDetectorServer;
scp eigerDetectorServer root@$i:~/executables/eigerDetectorServer ;
ssh root@$i sync; done
\end{verbatim}
\section{Loading firmware bitfiles} \section{Loading firmware bitfiles}
@ -835,6 +843,10 @@ It is connected to the TCPport which the receiver uses:
%%%#To display only open UDP ports try the following command: netstat -vaun %%%#To display only open UDP ports try the following command: netstat -vaun
\end{itemize} \end{itemize}
\subsection{Zmq socket is blocked}
It is connected to the TCPport which is used. In rare cases, it might be that the TCP port crashes. To find out which process uses the TCPPOrt do: \textbf{netstat -nlp | grep xxxx}, where xxxx is the tcpport number. To display open ports and established TCP connections, enter: \textbf{netstat -vatn}. Kill the process.
\subsection{Client has \textbf{shmget error}} \subsection{Client has \textbf{shmget error}}
Note that occasionally if there is a shared memory of a different size (from an older software version), it will return also a line like this: Note that occasionally if there is a shared memory of a different size (from an older software version), it will return also a line like this:
\begin{verbatim} \begin{verbatim}

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.16.1

View File

@ -1 +0,0 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.21.0

View File

@ -0,0 +1 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer

View File

@ -1 +0,0 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12

View File

@ -1 +0,0 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.0.2

View File

@ -10,6 +10,17 @@
#include "tiffIO.h" #include "tiffIO.h"
#ifdef ROOTSPECTRUM
#include <TPaveText.h>
#include <TLegend.h>
#include <TF1.h>
#include <TGraphErrors.h>
#include <TH2F.h>
#include <TASImage.h>
#include <TImage.h>
#include <TFile.h>
#endif
using namespace std; using namespace std;
#ifndef FRAMEMODE_DEF #ifndef FRAMEMODE_DEF
@ -66,11 +77,30 @@ template <class dataType> class analogDetector {
thr=0; thr=0;
myFile=NULL; myFile=NULL;
fm=new pthread_mutex_t ; fm=new pthread_mutex_t ;
#ifdef ROOTSPECTRUM
hs=new TH2F("hs","hs",2000,-100,10000,nx*ny,-0.5,nx*ny-0.5);
#ifdef ROOTCLUST
hs3=new TH2F("hs3","hs3",2000,-100,3*3*10000,nx*ny,-0.5,nx*ny-0.5);
hs5=new TH2F("hs5","hs5",2000,-100,5*5*10000,nx*ny,-0.5,nx*ny-0.5);
hs7=new TH2F("hs7","hs7",2000,-100,7*7*10000,nx*ny,-0.5,nx*ny-0.5);
hs9=new TH2F("hs9","hs9",2000,-100,9*9*10000,nx*ny,-0.5,nx*ny-0.5);
#endif
#endif
}; };
/** /**
destructor. Deletes the pdestalSubtraction array and the image destructor. Deletes the pdestalSubtraction array and the image
*/ */
virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;}; virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;
#ifdef ROOTSPECTRUM
delete hs;
#ifdef ROOTCLUST
delete hs3;
delete hs5;
delete hs7;
delete hs9;
#endif
#endif
};
/** /**
constructor cloning another analog detector constructor cloning another analog detector
@ -111,6 +141,15 @@ template <class dataType> class analogDetector {
} }
} }
image=new int[nx*ny]; image=new int[nx*ny];
#ifdef ROOTSPECTRUM
hs=(TH2F*)(orig->hs)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
#ifdef ROOTCLUST
hs3=(TH2F*)(orig->hs3)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
hs5=(TH2F*)(orig->hs5)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
hs7=(TH2F*)(orig->hs7)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
hs9=(TH2F*)(orig->hs9)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
#endif
#endif
} }
@ -220,6 +259,15 @@ template <class dataType> class analogDetector {
image[iy*nx+ix]=0; image[iy*nx+ix]=0;
} }
if (cmSub) cmSub->Clear(); if (cmSub) cmSub->Clear();
#ifdef ROOTSPECTRUM
hs->Reset();
#ifdef ROOTCLUST
hs3->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
hs5->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
hs7->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
hs9->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
#endif
#endif
}; };
/** resets the commonModeSubtraction and increases the frame index */ /** resets the commonModeSubtraction and increases the frame index */
@ -271,18 +319,6 @@ template <class dataType> class analogDetector {
else return 0; else return 0;
} }
/* virtual void addToCommonMode(double val, int ix, int iy=0){ */
/* if (ix>=0 && ix<nx && iy>=0 && iy<ny) { */
/* if (cmSub) { */
/* if (det) if (det->isGood(ix, iy)==0) return; */
/* if (getNumpedestals(ix,iy)>0) { */
/* cmSub->addToCommonMode(val-getPedestal(ix,iy), ix, iy); */
/* } */
/* }; */
/* } */
/* } */
virtual void addToCommonMode(char *data){ virtual void addToCommonMode(char *data){
if (cmSub) { if (cmSub) {
@ -304,7 +340,7 @@ template <class dataType> class analogDetector {
} }
} }
} }
/** /**
gets pedestal (and common mode) gets pedestal (and common mode)
\param ix pixel x coordinate \param ix pixel x coordinate
\param iy pixel y coordinate \param iy pixel y coordinate
@ -319,6 +355,7 @@ template <class dataType> class analogDetector {
else return -1; else return -1;
}; };
/** /**
gets pedestal rms (i.e. noise) gets pedestal rms (i.e. noise)
\param ix pixel x coordinate \param ix pixel x coordinate
@ -383,7 +420,6 @@ template <class dataType> class analogDetector {
/** /**
sets pedestal sets pedestal
\param ix pixel x coordinate \param ix pixel x coordinate
@ -451,17 +487,45 @@ template <class dataType> class analogDetector {
virtual void *writeImage(const char * imgname) { virtual void *writeImage(const char * imgname) {
float *gm=NULL; float *gm=NULL;
void *ret; void *ret;
#ifdef ROOTSPECTRUM
TH2F *hmap=new TH2F("hmap","hmap",nx, -0.5,nx-0.5, ny, -0.5, ny-0.5);
#endif
gm=new float[nx*ny]; gm=new float[nx*ny];
for (int ix=0; ix<nx; ix++) { for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) { for (int iy=0; iy<ny; iy++) {
gm[iy*nx+ix]=image[iy*nx+ix]; gm[iy*nx+ix]=image[iy*nx+ix];
#ifdef ROOTSPECTRUM
hmap->SetBinContent(ix+1, iy+1,image[iy*nx+ix]);
#endif
} }
} }
ret=WriteToTiff(gm, imgname, ny, nx); ret=WriteToTiff(gm, imgname, ny, nx);
delete [] gm; delete [] gm;
#ifdef ROOTSPECTRUM
char rootfn[10000];
sprintf(rootfn,"%s.root",imgname);
TFile *f=new TFile(rootfn,"RECREATE");
hs->Write("hs");
#ifdef ROOTCLUST
hs3->Write("hs3");
hs5->Write("hs5");
hs7->Write("hs7");
hs9->Write("hs9");
#endif
hmap->Write("hmap");
f->Close();
delete f;
delete hmap;
#endif
return ret; return ret;
} }
#ifdef ROOTSPECTRUM
TH2F *getSpectrum(){return hs;};
#endif
/** /**
write 32bit tiff file containing the pedestals write 32bit tiff file containing the pedestals
\param imgname file name to be written \param imgname file name to be written
@ -471,15 +535,43 @@ template <class dataType> class analogDetector {
virtual void *writePedestals(const char * imgname) { virtual void *writePedestals(const char * imgname) {
float *gm=NULL; float *gm=NULL;
void *ret; void *ret;
gm=new float[nx*ny]; gm=new float[nx*ny];
for (int ix=0; ix<nx; ix++) { #ifdef ROOTSPECTRUM
for (int iy=0; iy<ny; iy++) {
gm[iy*nx+ix]=stat[iy][ix].getPedestal(); TH2F *hmap=new TH2F("hmap","hmap",nx, -0.5,nx-0.5, ny, -0.5, ny-0.5);
}
#endif
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
/* if (cmSub) */
/* gm[iy*nx+ix]=stat[iy][ix].getPedestal()-cmSub->getCommonMode(); */
/* else */
gm[iy*nx+ix]=stat[iy][ix].getPedestal();
#ifdef ROOTSPECTRUM
hmap->SetBinContent(ix+1, iy+1,gm[iy*nx+ix]);
#endif
} }
ret=WriteToTiff(gm, imgname, ny, nx); }
delete [] gm; ret=WriteToTiff(gm, imgname, ny, nx);
return ret; delete [] gm;
#ifdef ROOTSPECTRUM
char rootfn[10000];
sprintf(rootfn,"%s.root",imgname);
TFile *f=new TFile(rootfn,"RECREATE");
hs->Write("hs");
#ifdef ROOTCLUST
hs3->Write("hs3");
hs5->Write("hs5");
hs7->Write("hs7");
hs9->Write("hs9");
#endif
hmap->Write("hmap");
f->Close();
delete f;
delete hmap;
#endif
return ret;
} }
/** /**
@ -590,19 +682,24 @@ template <class dataType> class analogDetector {
\param data pointer to the data \param data pointer to the data
*/ */
virtual void addToPedestal(char *data, int cm=0) { virtual void addToPedestal(char *data, int cm=0) {
newFrame(); newFrame();
if (cmSub) { if (cmSub) {
addToCommonMode(data); addToCommonMode(data);
} }
// cout << xmin << " " << xmax << endl;
// cout << ymin << " " << ymax << endl;
for (int ix=xmin; ix<xmax; ix++) { for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) { for (int iy=ymin; iy<ymax; iy++) {
addToPedestal(data,ix,iy,1);
addToPedestal(data,ix,iy, 1); #ifdef ROOTSPECTRUM
subtractPedestal(data,ix,iy,cm);
#endif
} }
} }
@ -638,6 +735,20 @@ template <class dataType> class analogDetector {
} }
#ifdef ROOTSPECTRUM
delete hs;
hs=new TH2F("hs","hs",2000,-100,10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
#ifdef ROOTCLUST
delete hs3;
hs3=new TH2F("hs3","hs3",2000,-100,3*3*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
delete hs5;
hs5=new TH2F("hs5","hs5",2000,-100,5*5*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
delete hs7;
hs7=new TH2F("hs7","hs7",2000,-100,7*7*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
delete hs9;
hs9=new TH2F("hs9","hs9",2000,-100,9*9*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
#endif
#endif
}; };
/** /**
@ -671,9 +782,16 @@ template <class dataType> class analogDetector {
val=dataSign*det->getValue(data, ix, iy); val=dataSign*det->getValue(data, ix, iy);
else else
val=((double*)data)[iy*nx+ix]; val=((double*)data)[iy*nx+ix];
/* if (cm && cmSub) */
/* val-=getCommonMode(ix,iy); */ /* if (ix==10 && iy==10) */
addToPedestal(val,ix,iy, cm); /* cout << ix << " " << iy << " " << val ; */
/* if (ix==100 && iy==100) */
/* cout << ix << " " << iy << " " << val; */
addToPedestal(val,ix,iy);
/* if (ix==10 && iy==10) */
/* cout <<" " << getPedestal(ix,iy)<< endl; */
/* if (ix==100 && iy==100) */
/* cout << " " << getPedestal(ix,iy)<< endl; */
} }
return ; return ;
@ -686,18 +804,18 @@ template <class dataType> class analogDetector {
\param val pointer where the pedestal subtracted data should be added. If NULL, the internal image is used \param val pointer where the pedestal subtracted data should be added. If NULL, the internal image is used
\returns pointer to the pedestal subtracted data \returns pointer to the pedestal subtracted data
*/ */
// virtual int *subtractPedestal(char *data, int *val=NULL) {
virtual int *subtractPedestal(char *data, int *val=NULL, int cm=0) {
virtual double *subtractPedestal(char *data, double *val=NULL, int cm=0) {
newFrame(); newFrame();
if (val==NULL) if (val==NULL)
val=new double[nx*ny]; val=image;//new double[nx*ny];
for (int ix=xmin; ix<xmax; ix++) { for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) { for (int iy=ymin; iy<ymax; iy++) {
val[iy*nx+ix]+=subtractPedestal(data, ix, iy, cm); val[iy*nx+ix]+=subtractPedestal(data, ix, iy,cm);
} }
} }
return val; return val;
@ -718,17 +836,48 @@ template <class dataType> class analogDetector {
virtual double subtractPedestal(char *data, int ix, int iy=0, int cm=0) { virtual double subtractPedestal(char *data, int ix, int iy=0, int cm=0) {
double g=1.; double g=1.;
double val;
if (ix>=0 && ix<nx && iy>=0 && iy<ny) { if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
if (gmap) { if (gmap) {
g=gmap[iy*nx+ix]; g=gmap[iy*nx+ix];
if (g==0) g=-1.; if (g==0) g=-1.;
} }
if (det) { if (det)
return (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy, cm))/g; val= (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy,cm))/g;
}
else else
return (((double*)data)[iy*nx+ix]-getPedestal(ix,iy,cm))/g; val= (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g;
#ifdef ROOTSPECTRUM
hs->Fill(val,(iy-ymin)*(xmax-xmin)+(ix-xmin));
#ifdef ROOTCLUST
double v3=0,v5=0,v7=0,v9=0;
for (int iix=-4; iix<5; iix++)
for (int iiy=-4; iiy<5; iiy++) {
if (det)
val= (dataSign*det->getValue(data, ix+iix, iy+iiy)-getPedestal(ix+iix,iy+iiy,cm))/g;
else
val= (((double*)data)[(iy+iiy)*nx+ix+iix]-getPedestal(ix+iix,iy+iiy,cm))/g;
if (iix>-4 && iiy>-4 && iix<4 && iiy<4) {
if (iix>-3 && iiy>-3 && iix<3 && iiy<3){
if (iix>-2 && iiy>-2 && iix<2 && iiy<2){
v3+=val;
}
v5+=val;
}
v7+=val;
}
v9+=val;
}
hs3->Fill(v3,(iy-ymin)*(xmax-xmin)+(ix-xmin));
hs5->Fill(v5,(iy-ymin)*(xmax-xmin)+(ix-xmin));
hs7->Fill(v7,(iy-ymin)*(xmax-xmin)+(ix-xmin));
hs9->Fill(v9,(iy-ymin)*(xmax-xmin)+(ix-xmin));
#endif
#endif
return val;
} }
}; };
@ -756,21 +905,22 @@ template <class dataType> class analogDetector {
virtual int getNPhotons(char *data, int ix, int iy=0) { virtual int getNPhotons(char *data, int ix, int iy=0) {
int nph=0; int nph=0;
double v; double v;
int cm=0;
if (cmSub) cm=1;
if (ix>=0 && ix<nx && iy>=0 && iy<ny) { if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
v=subtractPedestal(data,ix,iy,cm); v=subtractPedestal(data,ix,iy);
/* // cout << v << " " ; */
/* #ifdef ROOTSPECTRUM */
/* // cout << (iy-ymin)*(xmax-xmin)+(ix-xmin) << endl; */
/* hs->Fill(v,(iy-ymin)*(xmax-xmin)+(ix-xmin)); */
/* #endif */
if (thr>0) { if (thr>0) {
v+=0.5*thr; v+=0.5*thr;
nph=v/thr; nph=v/thr;
return nph; if (nph>0)
} else { return nph;
// cout << v << endl; return 0;
//if (v>0)
return v;
//else
//return 0;
} }
return v;
} }
return 0; return 0;
}; };
@ -783,20 +933,19 @@ template <class dataType> class analogDetector {
*/ */
int *getNPhotons(char *data, int *nph=NULL) { int *getNPhotons(char *data, int *nph=NULL) {
// double val; double val;
if (nph==NULL) if (nph==NULL)
nph=image; nph=image;
newFrame(); newFrame();
addToCommonMode(data);
addToCommonMode(data); for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) {
for (int ix=xmin; ix<xmax; ix++) { nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
for (int iy=ymin; iy<ymax; iy++) { }
nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
} }
} return nph;
return nph;
} }
@ -810,6 +959,23 @@ template <class dataType> class analogDetector {
image[iy*nx+ix]=0; image[iy*nx+ix]=0;
} }
} }
#ifdef ROOTSPECTRUM
//cout << "reset histogram " << endl;
if (hs)
hs->Reset();
#ifdef ROOTCLUST
if (hs3)
hs3->Reset();
if (hs5)
hs5->Reset();
if (hs7)
hs7->Reset();
if (hs9)
hs9->Reset();
#endif
//cout << "done " << endl;
#endif
}; };
/** sets/gets number of samples for moving average pedestal calculation /** sets/gets number of samples for moving average pedestal calculation
@ -872,10 +1038,12 @@ template <class dataType> class analogDetector {
virtual void processData(char *data,int *val=NULL) { virtual void processData(char *data,int *val=NULL) {
switch(fMode) { switch(fMode) {
case ePedestal: case ePedestal:
// cout << "ped " << endl;
addToPedestal(data); addToPedestal(data);
break; break;
default: default:
getNPhotons(data,val); //subtractPedestal(data);
getNPhotons(data);
} }
}; };
@ -897,13 +1065,13 @@ template <class dataType> class analogDetector {
\param f file pointer \param f file pointer
\returns current file pointer \returns current file pointer
*/ */
FILE *setFilePointer(FILE *f){myFile=f; return myFile;}; FILE *setFilePointer(FILE *f){myFile=f; return myFile;};
/** gets file pointer where to write the clusters to /** gets file pointer where to write the clusters to
\returns current file pointer \returns current file pointer
*/ */
FILE *getFilePointer(){return myFile;}; FILE *getFilePointer(){return myFile;};
void setMutex(pthread_mutex_t *m){fm=m;}; void setMutex(pthread_mutex_t *m){fm=m;};
protected: protected:
slsDetectorData<dataType> *det; /**< slsDetectorData to be used */ slsDetectorData<dataType> *det; /**< slsDetectorData to be used */
@ -925,7 +1093,15 @@ template <class dataType> class analogDetector {
// int nSigma; /**< number of sigma to be used for conversion into number of photons if threshold is undefined */ // int nSigma; /**< number of sigma to be used for conversion into number of photons if threshold is undefined */
frameMode fMode; /**< current detector frame mode */ frameMode fMode; /**< current detector frame mode */
FILE *myFile; /**< file pointer to write to */ FILE *myFile; /**< file pointer to write to */
#ifdef ROOTSPECTRUM
TH2F *hs;
#ifdef ROOTCLUST
TH2F *hs3;
TH2F *hs5;
TH2F *hs7;
TH2F *hs9;
#endif
#endif
pthread_mutex_t *fm; pthread_mutex_t *fm;
}; };

View File

@ -133,44 +133,6 @@
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QPushButton" name="btnStartStop">
<property name="geometry">
<rect>
<x>30</x>
<y>289</y>
<width>319</width>
<height>31</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Starts or Stops Acquisition</string>
</property>
<property name="text">
<string>Start</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/start.png</normaloff>:/icons/images/start.png</iconset>
</property>
<property name="shortcut">
<string>Shift+Space</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
<widget class="QFrame" name="frameTimeResolved"> <widget class="QFrame" name="frameTimeResolved">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -999,6 +961,107 @@ Frame period between exposures.
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>297</y>
<width>318</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnStart">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Starts Acquisition</string>
</property>
<property name="text">
<string>Start</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/start.png</normaloff>:/icons/images/start.png</iconset>
</property>
<property name="shortcut">
<string>Shift+Space</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnStop">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Stops Acquisition</string>
</property>
<property name="text">
<string>Stop</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/stop.png</normaloff>:/icons/images/stop.png</iconset>
</property>
<property name="shortcut">
<string>Shift+Space</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>spinNumMeasurements</tabstop> <tabstop>spinNumMeasurements</tabstop>

View File

@ -99,7 +99,7 @@
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="page_6"> <widget class="QWidget" name="page_6">
<widget class="QWidget" name="gridLayoutWidget_5"> <widget class="QWidget" name="gridLayoutWidget_5">
@ -548,7 +548,7 @@
<rect> <rect>
<x>25</x> <x>25</x>
<y>5</y> <y>5</y>
<width>314</width> <width>335</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -587,7 +587,7 @@ Displays minimum, maximum and sum of values for each plot.
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>100</width> <width>10</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -596,7 +596,7 @@ Displays minimum, maximum and sum of values for each plot.
<item> <item>
<widget class="QCheckBox" name="chkGainPlot"> <widget class="QCheckBox" name="chkGainPlot">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -614,6 +614,43 @@ Displays minimum, maximum and sum of values for each plot.
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_22">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkGapPixels">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Displays minimum, maximum and sum of values for each plot.
&lt;nobr&gt;</string>
</property>
<property name="text">
<string>Gap Pixels</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -1695,7 +1732,7 @@ Displays minimum, maximum and sum of values for each plot.
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>331</width> <width>357</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -2522,7 +2559,7 @@ Interval between plots has 2 modes. A condition to be satisfied, in order to avo
<rect> <rect>
<x>10</x> <x>10</x>
<y>12</y> <y>12</y>
<width>331</width> <width>365</width>
<height>36</height> <height>36</height>
</rect> </rect>
</property> </property>

View File

@ -1,9 +1,18 @@
Path: slsDetectorsPackage/slsDetectorGui Path: slsDetectorsPackage/slsDetectorGui
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
Revision: 492 Revision: 492
Branch: developer Branch: developer
Last Changed Author: Anna_Bergamaschi Last Changed Author: Anna_Bergamaschi
Last Changed Rev: 3731 Last Changed Rev: 3731
Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/qTabMeasurement.cpp Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/qTabMeasurement.cpp
=======
Repsitory UUID: fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41
Revision: 493
Branch: developer
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3747
Last Changed Date: 2018-03-27 17:30:53.000000002 +0200 ./include/qTabMeasurement.h
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3

View File

@ -1,6 +1,7 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "ab06c33107ecfeb4741d49407903ff80286cf75b"
#define GITAUTH "Anna_Bergamaschi" #define GITREPUUID "fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41"
#define GITREV 0x3731 #define GITAUTH "Dhanya_Thattil"
#define GITDATE 0x20180315 #define GITREV 0x3747
#define GITDATE 0x20180327
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -617,7 +617,6 @@ void saveErrorSignal(QString);
void AcquisitionErrorSignal(QString); void AcquisitionErrorSignal(QString);
void UpdatePlotSignal(); void UpdatePlotSignal();
void GainPlotSignal(bool); void GainPlotSignal(bool);
void AcquisitionFinishedSignal();
}; };

View File

@ -50,14 +50,14 @@ public:
*/ */
void SetExpertMode(bool enable); void SetExpertMode(bool enable);
/** Returns the status of the Start/Stop Acquisition button /** Returns the status of the acquisition in gui
*/ */
bool GetStartStatus(){return btnStartStop->isChecked();}; bool GetStartStatus(){return (!btnStart->isEnabled());};
/** Click the Start/Stop Acquisition button /** Click the Start/Stop Acquisition button
* This is used if this command came from gui client * This is used if this command came from gui client
*/ */
void ClickStartStop(){btnStartStop->click();myPlot->SetClientInitiated();}; void ClickStartStop(){startAcquisition();myPlot->SetClientInitiated();};
/** Returns progress bar value */ /** Returns progress bar value */
int GetProgress(){return progressBar->value();}; int GetProgress(){return progressBar->value();};
@ -65,10 +65,6 @@ public:
public slots: public slots:
/** Unconnects start/stop button when acquisition is finished
*/
void AcquisitionFinished();
/** update plot is finished, /** update plot is finished,
* changes start/stop text and enables/disables all widgets * changes start/stop text and enables/disables all widgets
*/ */
@ -131,9 +127,13 @@ private slots:
*/ */
void setRunIndex(int index); void setRunIndex(int index);
/** starts/stops Acquisition /** starts Acquisition
*/ */
void startStopAcquisition(); void startAcquisition();
/** stops Acquisition
*/
void stopAcquisition();
/** Set number of frames /** Set number of frames
* @param val number of frames to be set * @param val number of frames to be set
@ -193,8 +193,6 @@ private:
QPalette red; QPalette red;
/** expert mode */ /** expert mode */
bool expertMode; bool expertMode;
QIcon *iconStart;
QIcon *iconStop;
/** to access items in settings combobox */ /** to access items in settings combobox */
QStandardItemModel* model; QStandardItemModel* model;

View File

@ -174,6 +174,9 @@ private slots:
/** Set histogram options */ /** Set histogram options */
void SetHistogramOptions(); void SetHistogramOptions();
/** Enable Gap pixels */
void EnableGapPixels(bool enable);
signals: signals:
void DisableZoomSignal(bool); void DisableZoomSignal(bool);
void ResetZMinZMaxSignal(bool,bool,double,double); void ResetZMinZMaxSignal(bool,bool,double,double);

View File

@ -99,8 +99,7 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, int& ret,
break; break;
case 'v': case 'v':
tempval = GITREV; tempval = GITDATE;
tempval = (tempval <<32) | GITDATE;
cout << "SLS Detector GUI " << GITBRANCH << " (0x" << hex << tempval << ")" << endl; cout << "SLS Detector GUI " << GITBRANCH << " (0x" << hex << tempval << ")" << endl;
return; return;
@ -337,7 +336,6 @@ void qDetectorMain::Initialization(){
// Plotting // Plotting
// When the acquisition is finished, must update the meas tab // When the acquisition is finished, must update the meas tab
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs())); connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
connect(myPlot, SIGNAL(AcquisitionFinishedSignal()), tab_measurement, SLOT(AcquisitionFinished()));
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished())); connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished()));
//This should not be called as it will change file name to measurement when run finished //This should not be called as it will change file name to measurement when run finished
//connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_plot, SLOT(Refresh())); //connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_plot, SLOT(Refresh()));
@ -666,8 +664,7 @@ void qDetectorMain::ExecuteHelp(QAction *action){
cout << "About: Common GUI for Mythen, Eiger, Gotthard, Jungfrau, Moench and Propix detectors" << endl; cout << "About: Common GUI for Mythen, Eiger, Gotthard, Jungfrau, Moench and Propix detectors" << endl;
#endif #endif
char version[200]; char version[200];
long long unsigned int retval= GITREV; long long unsigned int retval= GITDATE;
retval= (retval <<32) | GITDATE;
sprintf(version,"%llx",retval); sprintf(version,"%llx",retval);
string thisGUIVersion = string(version); string thisGUIVersion = string(version);

View File

@ -1296,7 +1296,6 @@ int qDrawPlot::AcquisitionFinished(double currentProgress, int detectorStatus){
#ifdef VERBOSE #ifdef VERBOSE
cout << "\nEntering Acquisition Finished with status " ; cout << "\nEntering Acquisition Finished with status " ;
#endif #endif
emit AcquisitionFinishedSignal();
QString status = QString(slsDetectorBase::runStatusType(slsDetectorDefs::runStatus(detectorStatus)).c_str()); QString status = QString(slsDetectorBase::runStatusType(slsDetectorDefs::runStatus(detectorStatus)).c_str());
#ifdef VERBOSE #ifdef VERBOSE
cout << status.toAscii().constData() << " and progress " << currentProgress << endl; cout << status.toAscii().constData() << " and progress " << currentProgress << endl;

View File

@ -94,12 +94,6 @@ void qTabMeasurement::SetupWidgetWindow(){
chkFile->setChecked(myDet->enableWriteToFile()); chkFile->setChecked(myDet->enableWriteToFile());
dispFileName->setEnabled(myDet->enableWriteToFile()); dispFileName->setEnabled(myDet->enableWriteToFile());
//creating the icons for the buttons
iconStart = new QIcon(":/icons/images/start.png");
iconStop = new QIcon(":/icons/images/stop.png");
//Timer to update the progress bar //Timer to update the progress bar
progressTimer = new QTimer(this); progressTimer = new QTimer(this);
@ -267,8 +261,10 @@ void qTabMeasurement::Initialization(){
connect(dispFileName, SIGNAL(editingFinished()),this, SLOT(setFileName())); connect(dispFileName, SIGNAL(editingFinished()),this, SLOT(setFileName()));
//File Index //File Index
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int))); connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
//Start/Stop Acquisition //Start Acquisition
connect(btnStartStop, SIGNAL(clicked()), this, SLOT(startStopAcquisition())); connect(btnStart, SIGNAL(clicked()), this, SLOT(startAcquisition()));
//Stop Acquisition
connect(btnStop, SIGNAL(clicked()), this, SLOT(stopAcquisition()));
//Timing Mode //Timing Mode
connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(SetTimingMode(int)));// connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(SetTimingMode(int)));//
//progress bar //progress bar
@ -309,75 +305,53 @@ void qTabMeasurement::Enable(bool enable){
frameNotTimeResolved->setEnabled(enable); frameNotTimeResolved->setEnabled(enable);
//shortcut each time, else it doesnt work a second time //shortcut each time, else it doesnt work a second time
btnStartStop->setShortcut(QApplication::translate("TabMeasurementObject", "Shift+Space", 0, QApplication::UnicodeUTF8)); btnStart->setShortcut(QApplication::translate("TabMeasurementObject", "Shift+Space", 0, QApplication::UnicodeUTF8));
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::startStopAcquisition(){ void qTabMeasurement::startAcquisition(){
if(btnStartStop->isChecked()){ btnStart->setEnabled(false);
//if file write enabled and output dir doesnt exist
//if file write enabled and output dir doesnt exist if((chkFile->isChecked())&&(thisParent->DoesOutputDirExist() == slsDetectorDefs::FAIL)){
if((chkFile->isChecked())&&(thisParent->DoesOutputDirExist() == slsDetectorDefs::FAIL)){ if(qDefs::Message(qDefs::QUESTION,
if(qDefs::Message(qDefs::QUESTION, "<nobr>Your data will not be saved.</nobr><br><nobr>Disable File write and Proceed with acquisition anyway?</nobr>",
"<nobr>Your data will not be saved.</nobr><br><nobr>Disable File write and Proceed with acquisition anyway?</nobr>", "qTabMeasurement::startAcquisition") == slsDetectorDefs::FAIL){
"qTabMeasurement::startStopAcquisition") == slsDetectorDefs::FAIL){ btnStart->setEnabled(true);
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); return;
btnStartStop->click(); }else{
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); //done because for receiver it cant save a file with blank file path and returns without acquiring even to the gui
return; disconnect(chkFile, SIGNAL(toggled(bool)), this, SLOT(EnableFileWrite(bool)));
}else{ chkFile->setChecked(false);
//done because for receiver it cant save a file with blank file path and returns without acquiring even to the gui EnableFileWrite(false);
disconnect(chkFile, SIGNAL(toggled(bool)), this, SLOT(EnableFileWrite(bool))); connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(EnableFileWrite(bool)));
chkFile->setChecked(false); }
EnableFileWrite(false); }
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(EnableFileWrite(bool)));
}
}
#ifdef VERBOSE #ifdef VERBOSE
cout << endl << endl << "Starting Acquisition" << endl; cout << endl << endl << "Starting Acquisition" << endl;
#endif #endif
//btnStartStop->setStyleSheet("color:red"); lblProgressIndex->setText(QString::number(0));
btnStartStop->setText("Stop"); Enable(0);
btnStartStop->setIcon(*iconStop); progressBar->setValue(0);
lblProgressIndex->setText(QString::number(0)); progressTimer->start(100);
Enable(0);
progressBar->setValue(0);
progressTimer->start(100);
emit StartSignal(); emit StartSignal();
}else{ qDefs::checkErrorMessage(myDet,"qTabMeasurement::startAcquisition");
#ifdef VERBOSE
cout << "Stopping Acquisition" << endl<< endl;
#endif
//emit StopSignal(); commented out to prevent undefined state
myDet->stopAcquisition();
/* commented out to prevent undefined state
myDet->waitForReceiverReadToFinish();
UpdateProgress();
//spin index
disconnect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
spinIndex->setValue(myDet->getFileIndex());
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
progressTimer->stop();
btnStartStop->setText("Start");
btnStartStop->setIcon(*iconStart);
btnStartStop->setChecked(false);
Enable(1);*/
}
qDefs::checkErrorMessage(myDet,"qTabMeasurement::startStopAcquisition");
} }
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabMeasurement::AcquisitionFinished(){ void qTabMeasurement::stopAcquisition(){
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); #ifdef VERBOSE
btnStartStop->setText("Wait"); cout << "Stopping Acquisition" << endl<< endl;
#endif
myDet->stopAcquisition();
qDefs::checkErrorMessage(myDet,"qTabMeasurement::stopAcquisition");
} }
@ -391,12 +365,8 @@ void qTabMeasurement::UpdateFinished(){
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int))); connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
progressTimer->stop(); progressTimer->stop();
/*disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); done in AcquisitionFinished() already */
btnStartStop->setText("Start");
btnStartStop->setIcon(*iconStart);
btnStartStop->setChecked(false);
Enable(1); Enable(1);
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); btnStart->setEnabled(true);
qDefs::checkErrorMessage(myDet,"qTabMeasurement::UpdateFinished"); qDefs::checkErrorMessage(myDet,"qTabMeasurement::UpdateFinished");
} }

View File

@ -156,9 +156,6 @@ void qTabPlot::SetupWidgetWindow(){
stackedWidget->setCurrentIndex(0); stackedWidget->setCurrentIndex(0);
stackedWidget_2->setCurrentIndex(0); stackedWidget_2->setCurrentIndex(0);
//gain plot
chkGainPlot->setEnabled(false);
// Depending on whether the detector is 1d or 2d // Depending on whether the detector is 1d or 2d
switch(myDet->getDetectorsType()){ switch(myDet->getDetectorsType()){
case slsDetectorDefs::MYTHEN: case slsDetectorDefs::MYTHEN:
@ -174,6 +171,7 @@ void qTabPlot::SetupWidgetWindow(){
pagePedestal_2->setEnabled(false); pagePedestal_2->setEnabled(false);
chkBinary->setEnabled(false); chkBinary->setEnabled(false);
chkBinary_2->setEnabled(false); chkBinary_2->setEnabled(false);
chkGapPixels->setEnabled(true);
break; break;
case slsDetectorDefs::GOTTHARD: case slsDetectorDefs::GOTTHARD:
isOriginallyOneD = true; isOriginallyOneD = true;
@ -202,6 +200,12 @@ void qTabPlot::SetupWidgetWindow(){
//disable histogram initially //disable histogram initially
boxHistogram->hide(); boxHistogram->hide();
if (chkGapPixels->isEnabled()) {
int ret = myDet->enableGapPixels(-1);
qDefs::checkErrorMessage(myDet,"qTabPlot::SetupWidgetWindow");
chkGapPixels->setChecked((ret == 1) ? true : false);
}
qDefs::checkErrorMessage(myDet,"qTabPlot::SetupWidgetWindow"); qDefs::checkErrorMessage(myDet,"qTabPlot::SetupWidgetWindow");
} }
@ -376,6 +380,10 @@ void qTabPlot::Initialization(){
//gainplot //gainplot
if (chkGainPlot->isEnabled()) if (chkGainPlot->isEnabled())
connect(chkGainPlot, SIGNAL(toggled(bool)),myPlot, SIGNAL(GainPlotSignal(bool))); connect(chkGainPlot, SIGNAL(toggled(bool)),myPlot, SIGNAL(GainPlotSignal(bool)));
// gap pixels
if (chkGapPixels->isEnabled())
connect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
} }
@ -1471,6 +1479,24 @@ void qTabPlot::SetHistogramOptions(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabPlot::EnableGapPixels(bool enable) {
#ifdef VERBOSE
cout << "Setting Gap pixels to " << enable << endl;
#endif
disconnect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
myDet->enableGapPixels(enable);
int ret = myDet->enableGapPixels(-1);
qDefs::checkErrorMessage(myDet,"qTabPlot::SetScanArgument");
chkGapPixels->setChecked((ret == 1) ? true : false);
connect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
}
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
@ -1487,6 +1513,14 @@ void qTabPlot::Refresh(){
comboFrequency->setCurrentIndex(1);*/ comboFrequency->setCurrentIndex(1);*/
SetFrequency(); SetFrequency();
if (chkGapPixels->isEnabled()) {
disconnect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
int ret = myDet->enableGapPixels(-1);
qDefs::checkErrorMessage(myDet,"qTabPlot::Refresh");
chkGapPixels->setChecked((ret == 1) ? true : false);
connect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
}
}else{ }else{
boxFrequency->setEnabled(false); boxFrequency->setEnabled(false);
disconnect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox())); disconnect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox()));

View File

@ -24,6 +24,7 @@ using namespace std;
// 0xFFF0000000000000ULL // 0xFFF0000000000000ULL
#define MULTI_DETECTORS_NOT_ADDED 0x8000000000000000ULL #define MULTI_DETECTORS_NOT_ADDED 0x8000000000000000ULL
#define MULTI_HAVE_DIFFERENT_VALUES 0x4000000000000000ULL #define MULTI_HAVE_DIFFERENT_VALUES 0x4000000000000000ULL
#define MULTI_CONFIG_FILE_ERROR 0x2000000000000000ULL
// sls errors // sls errors
#define CRITICAL_ERROR_MASK 0xFFFFFFF #define CRITICAL_ERROR_MASK 0xFFFFFFF
@ -91,6 +92,7 @@ using namespace std;
#define RESTREAM_STOP_FROM_RECEIVER 0x0000000800000000ULL #define RESTREAM_STOP_FROM_RECEIVER 0x0000000800000000ULL
#define TEMPERATURE_CONTROL 0x0000001000000000ULL #define TEMPERATURE_CONTROL 0x0000001000000000ULL
#define AUTO_COMP_DISABLE 0x0000002000000000ULL #define AUTO_COMP_DISABLE 0x0000002000000000ULL
#define CONFIG_FILE 0x0000004000000000ULL
// 0x000000FFFFFFFFFFULL // 0x000000FFFFFFFFFFULL
@ -289,6 +291,8 @@ public:
if(slsErrorMask&AUTO_COMP_DISABLE) if(slsErrorMask&AUTO_COMP_DISABLE)
retval.append("Could not set/get auto comparator disable\n"); retval.append("Could not set/get auto comparator disable\n");
if(slsErrorMask&CONFIG_FILE)
retval.append("Could not load/write config file\n");
//------------------------------------------------------ length of message //------------------------------------------------------ length of message

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 06cdf8ad9204fd306cb1017b91e67452c61715d4 Repsitory UUID: da010a03d725b6f18020d2142d58771534414274
Revision: 323 Revision: 328
Branch: developer Branch: developer
Last Changed Author: Erik_Frojdh Last Changed Author: Erik_Frojdh
Last Changed Rev: 3671 Last Changed Rev: 3751
Last Changed Date: 2018-03-13 10:28:12.000000002 +0100 ./FebRegisterDefs.h Last Changed Date: 2018-04-03 16:29:39.000000002 +0200 ./xparameters.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "06cdf8ad9204fd306cb1017b91e67452c61715d4" #define GITREPUUID "da010a03d725b6f18020d2142d58771534414274"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Erik_Frojdh"
#define GITREV 0x3671 #define GITREV 0x3751
#define GITDATE 0x20180313 #define GITDATE 0x20180403
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -1,9 +1,18 @@
Path: slsDetectorsPackage/slsDetectorSoftware Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
Revision: 1846 Revision: 1846
Branch: developer Branch: developer
Last Changed Author: Anna_Bergamaschi Last Changed Author: Anna_Bergamaschi
Last Changed Rev: 3731 Last Changed Rev: 3731
Last Changed Date: 2018-03-15 12:30:34.000000002 +0100 ./threadFiles/ThreadPool.o Last Changed Date: 2018-03-15 12:30:34.000000002 +0100 ./threadFiles/ThreadPool.o
=======
Repsitory UUID: b8bdbf4da61f95b88893b02ddabc2491b16fa10f
Revision: 1852
Branch: developer
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3746
Last Changed Date: 2018-03-27 10:47:02.000000002 +0200 ./slsDetector/slsDetector.o
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3

View File

@ -1289,6 +1289,7 @@ int64_t setExposureTime(int64_t value){
/* time is in ns */ /* time is in ns */
if (value!=-1) if (value!=-1)
value*=(1E-3*clkDivider[0]);//(1E-9*CLK_FREQ); value*=(1E-3*clkDivider[0]);//(1E-9*CLK_FREQ);
setPatternWaitTime(0,value);
return set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-3*clkDivider[0]);//(1E-9*CLK_FREQ); return set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-3*clkDivider[0]);//(1E-9*CLK_FREQ);
} }

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jctbDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/jctbDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 3da6a6df6556312f7467407a8b5691bdc478424e Repsitory UUID: 807189a4923dc257d812c9974f1a4a4d143c2f70
Revision: 21 Revision: 23
Branch: developer Branch: developer
Last Changed Author: Dhanya_Thattil Last Changed Author: Anna_Bergamaschi
Last Changed Rev: 3597 Last Changed Rev: 3734
Last Changed Date: 2018-02-07 10:44:13.000000002 +0100 ./server_funcs.h Last Changed Date: 2018-04-17 12:35:10.000000002 +0200 ./firmware_funcs.c

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "3da6a6df6556312f7467407a8b5691bdc478424e" #define GITREPUUID "807189a4923dc257d812c9974f1a4a4d143c2f70"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "Anna_Bergamaschi"
#define GITREV 0x3597 #define GITREV 0x3734
#define GITDATE 0x20180207 #define GITDATE 0x20180417
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 06cdf8ad9204fd306cb1017b91e67452c61715d4 Repsitory UUID: da010a03d725b6f18020d2142d58771534414274
Revision: 122 Revision: 135
Branch: developer Branch: developer
Last Changed Author: Erik_Frojdh Last Changed Author: Erik_Frojdh
Last Changed Rev: 3671 Last Changed Rev: 3751
Last Changed Date: 2018-03-13 10:29:31.000000002 +0100 ./Makefile.virtual Last Changed Date: 2018-04-03 16:29:40.000000002 +0200 ./RegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "06cdf8ad9204fd306cb1017b91e67452c61715d4" #define GITREPUUID "da010a03d725b6f18020d2142d58771534414274"
#define GITAUTH "Erik_Frojdh" #define GITAUTH "Erik_Frojdh"
#define GITREV 0x3671 #define GITREV 0x3751
#define GITDATE 0x20180313 #define GITDATE 0x20180403
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -1250,6 +1250,10 @@ void configurePll() {
#endif #endif
u_int32_t val; u_int32_t val;
int32_t phase=0, inv=0; int32_t phase=0, inv=0;
// ensuring PLL is never configured with same phase
if (clkPhase[1] == 0) {
return;
}
printf("Configuring PLL with phase in %d\n", clkPhase[1]); printf("Configuring PLL with phase in %d\n", clkPhase[1]);
if (clkPhase[1]>0) { if (clkPhase[1]>0) {

View File

@ -101,8 +101,8 @@ enum NETWORKINDEX { TXN_FRAME };
#define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL) #define CONFIG_QUARTER_SPEED (CONFIG_TDMA_DISABLE_VAL + CONFIG_QUARTER_SPEED_10MHZ_VAL + CONFIG_MODE_1_X_10GBE_VAL)
#define ADC_OFST_HALF_SPEED_VAL (0x20) //adc pipeline #define ADC_OFST_HALF_SPEED_VAL (0x20) //adc pipeline
#define ADC_OFST_QUARTER_SPEED_VAL (0x0f) #define ADC_OFST_QUARTER_SPEED_VAL (0x0f)
#define ADC_PHASE_HALF_SPEED (0x41) #define ADC_PHASE_HALF_SPEED (0x48) //72
#define ADC_PHASE_QUARTER_SPEED (0x19) #define ADC_PHASE_QUARTER_SPEED (0x48) //72
/* Maybe not required for jungfrau */ /* Maybe not required for jungfrau */
#define NTRIMBITS (6) #define NTRIMBITS (6)

View File

@ -24,7 +24,7 @@ ID: $Id$
#include <sys/shm.h> #include <sys/shm.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
using namespace std;
char ans[MAX_STR_LENGTH]; char ans[MAX_STR_LENGTH];
@ -827,8 +827,8 @@ int multiSlsDetector::addSlsDetector(detectorType t, int pos) {
#ifdef VERBOSE #ifdef VERBOSE
cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl; cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl;
#endif #endif
slsDetector *s=new slsDetector(pos, t, id, this); new slsDetector(pos, t, id, this);
s=NULL;
#ifdef VERBOSE #ifdef VERBOSE
cout << "Adding it to the multi detector structure" << endl; cout << "Adding it to the multi detector structure" << endl;
#endif #endif
@ -4563,6 +4563,17 @@ int64_t multiSlsDetector::getId(idMode mode, int imod) {
} }
} }
ret = -100; int64_t ret1;
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet)
if (detectors[idet]){
ret1=detectors[idet]->getId(mode, imod);
if(ret==-100)
ret=ret1;
else if (ret!=ret1)
ret=-1;
}
return ret;
return -1; return -1;
} }
@ -5149,6 +5160,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){
} else { } else {
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl; std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
setErrorMask(getErrorMask()|MULTI_CONFIG_FILE_ERROR);
return FAIL; return FAIL;
} }
#ifdef VERBOSE #ifdef VERBOSE
@ -5255,6 +5267,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){
#endif #endif
} else { } else {
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl; std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
setErrorMask(getErrorMask()|MULTI_CONFIG_FILE_ERROR);
ret = FAIL; ret = FAIL;
} }
@ -6510,6 +6523,10 @@ string multiSlsDetector::getErrorMessage(int &critical){
"Please check the console\n"); "Please check the console\n");
critical = 0; critical = 0;
} }
if(multiMask & MULTI_CONFIG_FILE_ERROR) {
retval.append("Could not load Config File\n");
critical = 0;
}
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet) { for (int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet) {
if (detectors[idet]) { if (detectors[idet]) {
@ -6998,4 +7015,3 @@ bool multiSlsDetector::isAcquireReady() {
thisMultiDetector->acquiringFlag = true; thisMultiDetector->acquiringFlag = true;
return OK; return OK;
} }

View File

@ -1,6 +1,8 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "ab06c33107ecfeb4741d49407903ff80286cf75b"
#define GITAUTH "Anna_Bergamaschi" #define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f"
#define GITREV 0x3731 #define GITAUTH "Dhanya_Thattil"
#define GITDATE 0x20180315 #define GITREV 0x3746
#define GITDATE 0x20180327
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -2246,8 +2246,7 @@ int64_t slsDetector::getId( idMode mode, int imod){
#endif #endif
if (mode==THIS_SOFTWARE_VERSION) { if (mode==THIS_SOFTWARE_VERSION) {
ret=OK; ret=OK;
retval=GITREV; retval=GITDATE;
retval=(retval<<32) | GITDATE;
} else if (mode==RECEIVER_VERSION) { } else if (mode==RECEIVER_VERSION) {
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) { if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
if (connectData() == OK){ if (connectData() == OK){
@ -7265,6 +7264,7 @@ int slsDetector::readConfigurationFile(string const fname){
infile.close(); infile.close();
} else { } else {
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl; std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
setErrorMask((getErrorMask())|(CONFIG_FILE));
return FAIL; return FAIL;
} }
#ifdef VERBOSE #ifdef VERBOSE
@ -7362,6 +7362,7 @@ int slsDetector::writeConfigurationFile(string const fname){
} }
else { else {
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl; std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
setErrorMask((getErrorMask())|(CONFIG_FILE));
return FAIL; return FAIL;
} }
#ifdef VERBOSE #ifdef VERBOSE

View File

@ -718,7 +718,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
*/ */
/*! \page config /*! \page config
- <b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. MYTHEN[???]. \c Returns \c (int) - <b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. MYTHEN[???]. \c Returns \c (int)
*/ */
descrToFuncMap[i].m_pFuncName="clkdivider"; // descrToFuncMap[i].m_pFuncName="clkdivider"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed;
@ -774,7 +774,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
++i; ++i;
/*! \page config /*! \page config
- <b>adcphase [i]</b> Sets/gets the ADC clock frequency in MHz. For the new chiptestboard!\c Returns \c (int) - <b>adcphase [i]</b> Sets/gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER) \c Returns \c (int)
*/ */
descrToFuncMap[i].m_pFuncName="adcphase"; // descrToFuncMap[i].m_pFuncName="adcphase"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdSpeed;
@ -5830,7 +5830,6 @@ string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) {
} }
myDet->setOnline(ONLINE_FLAG); myDet->setOnline(ONLINE_FLAG);
ret=myDet->setSpeed(index,t); ret=myDet->setSpeed(index,t);
@ -5849,21 +5848,23 @@ string slsDetectorCommand::helpSpeed(int narg, char *args[], int action) {
ostringstream os; ostringstream os;
if (action==PUT_ACTION || action==HELP_ACTION) { if (action==PUT_ACTION || action==HELP_ACTION) {
os << "clkdivider c \t sets readout clock divider" << std::endl; os << "clkdivider c \t sets readout clock divider. For Jungfrau, it also overwrites adcphase to recommended default" << std::endl;
os << "setlength c\t sets the length of the set/reset signals (in clock cycles)" << std::endl; os << "setlength c\t sets the length of the set/reset signals (in clock cycles)" << std::endl;
os << "waitstates c \t sets the waitstates of the bus interface" << std::endl; os << "waitstates c \t sets the waitstates of the bus interface" << std::endl;
os << "totdivider c\t sets the clock divider in tot mode" << std::endl; os << "totdivider c\t sets the clock divider in tot mode" << std::endl;
os << "totdutycycle c\t sets the duty cycle of the tot clock" << std::endl; os << "totdutycycle c\t sets the duty cycle of the tot clock" << std::endl;
os << "adcphase c\t Sets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER)" << std::endl;
os << std::endl; os << std::endl;
} }
if (action==GET_ACTION || action==HELP_ACTION) { if (action==GET_ACTION || action==HELP_ACTION) {
os << "clkdivider \t gets readout clock divider" << std::endl; os << "clkdivider \t gets readout clock divider. For Jungfrau, it also overwrites adcphase to recommended default" << std::endl;
os << "setlength \t gets the length of the set/reset signals (in clock cycles)" << std::endl; os << "setlength \t gets the length of the set/reset signals (in clock cycles)" << std::endl;
os << "waitstates \t gets the waitstates of the bus interface" << std::endl; os << "waitstates \t gets the waitstates of the bus interface" << std::endl;
os << "totdivider \t gets the clock divider in tot mode" << std::endl; os << "totdivider \t gets the clock divider in tot mode" << std::endl;
os << "totdutycycle \t gets the duty cycle of the tot clock" << std::endl; os << "totdutycycle \t gets the duty cycle of the tot clock" << std::endl;
os << "adcphase \t gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER)" << std::endl;
os << std::endl; os << std::endl;
} }

View File

@ -275,8 +275,9 @@ int64_t slsDetectorUsers::getThisSoftwareVersion(){
return myDetector->getThisSoftwareVersion(); return myDetector->getThisSoftwareVersion();
} }
int slsDetectorUsers::enableGapPixels(int enable) {
return myDetector->enableGapPixels(enable);
}
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg){ void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg){
myDetector->registerDataCallback(userCallback,pArg); myDetector->registerDataCallback(userCallback,pArg);
@ -382,3 +383,19 @@ int slsDetectorUsers::setReceiverSilentMode(int i) {
int slsDetectorUsers::setHighVoltage(int i) { int slsDetectorUsers::setHighVoltage(int i) {
return myDetector->setHighVoltage(i); return myDetector->setHighVoltage(i);
} }
int slsDetectorUsers::resetFramesCaughtInReceiver() {
return myDetector->resetFramesCaught();
}
int slsDetectorUsers::setReceiverFifoDepth(int i) {
return myDetector->setReceiverFifoDepth(i);
}
int slsDetectorUsers::setFlowControl10G(int i) {
return myDetector->setFlowControl10G(i);
}
int slsDetectorUsers::setTenGigabitEthernet(int i) {
return myDetector->enableTenGigabitEthernet(i);
}

View File

@ -77,7 +77,7 @@ 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. @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 functionalitiesto embed the detector controls in the users custom interface e.g. EPICS, Lima etc. @short Class for detector functionalities to embed the detector controls in the users custom interface e.g. EPICS, Lima etc.
*/ */
@ -270,7 +270,7 @@ class slsDetectorUsers
*/ */
int getDetectorSize(int &x0, int &y0, int &nx, int &ny); int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
/** /**
@short setsthe maximum detector size @short gets the maximum detector size
\param x0 horizontal position origin in channel number \param x0 horizontal position origin in channel number
\param y0 vertical position origin in channel number \param y0 vertical position origin in channel number
\param nx number of channels in horiziontal \param nx number of channels in horiziontal
@ -528,6 +528,14 @@ class slsDetectorUsers
*/ */
int64_t getThisSoftwareVersion(); int64_t getThisSoftwareVersion();
/**
* Enable gap pixels, only for Eiger and for 8,16 and 32 bit mode.
* 4 bit mode gap pixels only in gui call back (registerDataCallback)
* @param enable 1 sets, 0 unsets, -1 gets
* @return gap pixel enable or -1 for error
*/
int enableGapPixels(int enable=-1);
/** /**
@short register calbback for accessing detector final data @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 func function to be called at the end of the acquisition. gets detector status and progress index as arguments
@ -658,17 +666,45 @@ class slsDetectorUsers
/** /**
* set receiver in silent mode * set receiver in silent mode
* @param i 1 sets, 0 unsets (-1 gets) * @param i 1 sets, 0 unsets (-1 gets)
* @return silent mode of receiver * @returns silent mode of receiver
*/ */
int setReceiverSilentMode(int i); int setReceiverSilentMode(int i);
/** /**
* set high voltage * set high voltage
* @param i > 0 sets, 0 unsets, (-1 gets) * @param i > 0 sets, 0 unsets, (-1 gets)
* @return high voltage * @returns high voltage
*/ */
int setHighVoltage(int i); int setHighVoltage(int i);
/**
* reset frames caught in receiver
* should be called before startReceiver()
* @retuns OK or FAIL
*/
int resetFramesCaughtInReceiver();
/**
* set receiver fifo depth
* @param i number of images in fifo depth (-1 gets)
* @returns receiver fifo depth
*/
int setReceiverFifoDepth(int i = -1);
/**
* set flow control for 10Gbe (Eiger only)
* @param i 1 sets, 0 unsets (-1 gets)
* @return flow control enable for 10 Gbe
*/
int setFlowControl10G(int i = -1);
/**
* enable/disable 10GbE (Eiger only)
* @param i 1 sets, 0 unsets (-1 gets)
* @return 10GbE enable
*/
int setTenGigabitEthernet(int i = -1);
/************************************************************************ /************************************************************************
STATIC FUNCTIONS STATIC FUNCTIONS

View File

@ -259,6 +259,19 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
*/ */
virtual string setNetworkParameter(networkParameter i, string s)=0; virtual string setNetworkParameter(networkParameter i, string s)=0;
int setFlowControl10G(int i = -1) {
string sret="";
if (i != -1) {
ostringstream o;
o << ((i >= 1) ? 1 : 0);
string sval = o.str();
sret = setNetworkParameter(FLOW_CONTROL_10G, sval);
} else
sret = getNetworkParameter(FLOW_CONTROL_10G);
return atoi(sret.c_str());
}
/** /**
changes/gets the port number changes/gets the port number
\param t type port type can be CONTROL_PORT, DATA_PORT, STOP_PORT \param t type port type can be CONTROL_PORT, DATA_PORT, STOP_PORT

View File

@ -10,8 +10,7 @@ int main(int argc, char *argv[])
{ {
for (int i = 1; i < argc; ++i ) { for (int i = 1; i < argc; ++i ) {
if (!(strcmp (argv[i],"--version")) || !(strcmp (argv[i],"-v"))) { if (!(strcmp (argv[i],"--version")) || !(strcmp (argv[i],"-v"))) {
int64_t tempval = GITREV; int64_t tempval = GITDATE;
tempval = (tempval <<32) | GITDATE;
cout << argv[0] << " " << GITBRANCH << " (0x" << hex << tempval << ")" << endl; cout << argv[0] << " " << GITBRANCH << " (0x" << hex << tempval << ")" << endl;
return 0; return 0;
} }

View File

@ -41,6 +41,9 @@ char mess[MAX_STR_LENGTH];
int dataBytes = 10; int dataBytes = 10;
int isControlServer = 0; int isControlServer = 0;
int debugflag = 0; int debugflag = 0;
#ifdef EIGERD
uint32_t dhcpipad = 0;
#endif
/* initialization functions */ /* initialization functions */
@ -66,6 +69,9 @@ void init_detector(int controlserver) {
if (controlserver) { if (controlserver) {
isControlServer = 1; isControlServer = 1;
initControlServer(); initControlServer();
#ifdef EIGERD
dhcpipad = getDetectorIP();
#endif
} }
else initStopServer(); else initStopServer();
#endif #endif
@ -647,7 +653,7 @@ int get_id(int file_des) {
n = receiveData(file_des,&arg,sizeof(arg),INT32); n = receiveData(file_des,&arg,sizeof(arg),INT32);
if (n < 0) return printSocketReadError(); if (n < 0) return printSocketReadError();
if (arg == MODULE_FIRMWARE_VERSION) { if (arg == MODULE_SERIAL_NUMBER) {
n = receiveData(file_des,&imod,sizeof(imod),INT32); n = receiveData(file_des,&imod,sizeof(imod),INT32);
if (n < 0) return printSocketReadError(); if (n < 0) return printSocketReadError();
} }
@ -3678,16 +3684,19 @@ int configure_mac(int file_des) {
printf("WARNING: Matched detectormac to the hardware mac now\n"); printf("WARNING: Matched detectormac to the hardware mac now\n");
printf("*************************************************\n"); printf("*************************************************\n");
} }
// always remember the ip sent from the client (could be for 10g(if not dhcp))
if (detipad != getDetectorIP())
dhcpipad = detipad;
//only for 1Gbe //only for 1Gbe
if(!enableTenGigabitEthernet(-1)){ if(!enableTenGigabitEthernet(-1)){
if (detipad != getDetectorIP()){ printf("*************************************************\n");
printf("*************************************************\n"); printf("WARNING: Using DHCP IP for Configuring MAC\n");
printf("WARNING: actual detector ip address %x does not match the one from client %x\n",getDetectorIP(),detipad); printf("*************************************************\n");
detipad = getDetectorIP(); detipad = getDetectorIP();
printf("WARNING: Matched detector ip to the hardware ip now\n"); } else
printf("*************************************************\n"); detipad = dhcpipad;
}
}
#endif #endif
retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit); retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit);
if(retval==-1) { if(retval==-1) {

View File

@ -1,9 +1,18 @@
Path: slsDetectorsPackage/slsReceiverSoftware Path: slsDetectorsPackage/slsReceiverSoftware
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
<<<<<<< HEAD
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
Revision: 765 Revision: 765
Branch: developer Branch: developer
Last Changed Author: Anna_Bergamaschi Last Changed Author: Anna_Bergamaschi
Last Changed Rev: 3731 Last Changed Rev: 3731
Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/slsReceiverTCPIPInterface.cpp Last Changed Date: 2018-03-15 12:27:06.000000002 +0100 ./src/slsReceiverTCPIPInterface.cpp
=======
Repsitory UUID: b8bdbf4da61f95b88893b02ddabc2491b16fa10f
Revision: 767
Branch: developer
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3746
Last Changed Date: 2018-03-27 10:43:44.000000002 +0200 ./src/slsReceiverTCPIPInterface.cpp
>>>>>>> 7cd35f24b87501374fbaf45693a2adf16dfae3e3

View File

@ -33,12 +33,18 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
* @param freq pointer to streaming frequency * @param freq pointer to streaming frequency
* @param timer pointer to timer if streaming frequency is random * @param timer pointer to timer if streaming frequency is random
* @param dataReadycb pointer to data ready call back function * @param dataReadycb pointer to data ready call back function
* @param pDataReadycb pointer to arguments of data ready call back function * @param pDataReadycb pointer to arguments of data ready call back function. To write/stream a smaller size of processed data, change this value (only smaller value is allowed).
*/ */
DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr, DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
uint32_t* freq, uint32_t* timer, uint32_t* freq, uint32_t* timer,
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t,
uint64_t, uint16_t, uint16_t, uint16_t, uint16_t,
uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*), char*, uint32_t, void*),
void (*dataModifyReadycb)(uint64_t, uint32_t, uint32_t, uint64_t,
uint64_t, uint16_t, uint16_t, uint16_t, uint16_t,
uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &, void*),
void *pDataReadycb); void *pDataReadycb);
/** /**
@ -376,27 +382,55 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
//call back //call back
/** /**
* Call back for raw data * Call back for raw data
* args to raw data ready callback are * args to raw data ready callback are
* frameNumber is the frame number * frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number * packetNumber is the packet number
* bunchId is the bunch id from beamline * bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock * timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom) * modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system * xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system * yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system * zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes * debug is for debugging purposes
* roundRNumber is the round robin set number * roundRNumber is the round robin set number
* detType is the detector type see :: detectorType * detType is the detector type see :: detectorType
* version is the version number of this structure format * version is the version number of this structure format
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes.
*/ */
void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void (*rawDataReadyCallBack)(uint64_t, uint32_t,
char*, uint32_t, void*); uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
void (*rawDataModifyReadyCallBack)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &, void*);
void *pRawDataReady; void *pRawDataReady;

View File

@ -166,12 +166,13 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
/** /**
* Create and send Json Header * Create and send Json Header
* @param header header of image * @param header header of image
* @param size data size (could have been modified in call back)
* @param nx number of pixels in x dim * @param nx number of pixels in x dim
* @param ny number of pixels in y dim * @param ny number of pixels in y dim
* @param dummy true if its a dummy header * @param dummy true if its a dummy header
* @returns 0 if error, else 1 * @returns 0 if error, else 1
*/ */
int SendHeader(sls_detector_header* header, uint32_t nx = 0, uint32_t ny = 0, bool dummy = true); int SendHeader(sls_detector_header* header, uint32_t size = 0, uint32_t nx = 0, uint32_t ny = 0, bool dummy = true);
/** type of thread */ /** type of thread */
static const std::string TypeName; static const std::string TypeName;

View File

@ -583,29 +583,53 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
*/ */
void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg); void registerCallBackAcquisitionFinished(void (*func)(uint64_t, void*),void *arg);
/** /**
* Call back for raw data * Call back for raw data
* args to raw data ready callback are * args to raw data ready callback are
* frameNumber is the frame number * frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number * packetNumber is the packet number
* bunchId is the bunch id from beamline * bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock * timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom) * modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system * xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system * yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system * zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes * debug is for debugging purposes
* roundRNumber is the round robin set number * roundRNumber is the round robin set number
* detType is the detector type see :: detectorType * detType is the detector type see :: detectorType
* version is the version number of this structure format * version is the version number of this structure format
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes.
*/ */
void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t,
char*, uint32_t, void*),void *arg); uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
void registerCallBackRawDataModifyReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &,void*),void *arg);
protected: protected:
@ -719,27 +743,55 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
void *pAcquisitionFinished; void *pAcquisitionFinished;
/** /**
* Call back for raw data * Call back for raw data
* args to raw data ready callback are * args to raw data ready callback are
* frameNumber is the frame number * frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) * expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number * packetNumber is the packet number
* bunchId is the bunch id from beamline * bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock * timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom) * modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system * xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system * yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system * zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes * debug is for debugging purposes
* roundRNumber is the round robin set number * roundRNumber is the round robin set number
* detType is the detector type see :: detectorType * detType is the detector type see :: detectorType
* version is the version number of this structure format * version is the version number of this structure format
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes.
*/ */
void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void (*rawDataReadyCallBack)(uint64_t, uint32_t,
char*, uint32_t, void*); uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
void (*rawDataModifyReadyCallBack)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &, void*);
void *pRawDataReady; void *pRawDataReady;

View File

@ -689,11 +689,37 @@ class UDPInterface {
* detType is the detector type see :: detectorType * detType is the detector type see :: detectorType
* version is the version number of this structure format * version is the version number of this structure format
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes.
*/ */
virtual void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, virtual void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg) = 0; char*, uint32_t, void*),void *arg) = 0;
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
virtual void registerCallBackRawDataModifyReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &,void*),void *arg) = 0;
protected: protected:
private: private:

View File

@ -24,6 +24,7 @@ using namespace rapidjson;
#define MAX_STR_LENGTH 1000 #define MAX_STR_LENGTH 1000
//#define ZMQ_DETAIL //#define ZMQ_DETAIL
#define ROIVERBOSITY
class ZmqSocket { class ZmqSocket {
@ -426,7 +427,15 @@ public:
memcpy(buf, (char*)zmq_msg_data(&message), size); memcpy(buf, (char*)zmq_msg_data(&message), size);
} }
//incorrect size //incorrect size (smaller)
else if (length < size){
#ifdef ROIVERBOSITY
cprintf(RED,"Error: Received smaller packet size %d for socket %d\n", length, index);
#endif
memcpy(buf, (char*)zmq_msg_data(&message), length);
memset(buf+length,0xFF,size-length);
}
//incorrect size (larger)
else { else {
cprintf(RED,"Error: Received weird packet size %d for socket %d\n", length, index); cprintf(RED,"Error: Received weird packet size %d for socket %d\n", length, index);
memset(buf,0xFF,size); memset(buf,0xFF,size);

View File

@ -1,6 +1,7 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "ab06c33107ecfeb4741d49407903ff80286cf75b"
#define GITAUTH "Anna_Bergamaschi" #define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f"
#define GITREV 0x3731 #define GITAUTH "Dhanya_Thattil"
#define GITDATE 0x20180315 #define GITREV 0x3746
#define GITDATE 0x20180327
#define GITBRANCH "developer" #define GITBRANCH "developer"

View File

@ -91,11 +91,37 @@ class slsReceiver : private virtual slsReceiverDefs {
* detType is the detector type see :: detectorType * detType is the detector type see :: detectorType
* version is the version number of this structure format * version is the version number of this structure format
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes.
*/ */
void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t,
uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t,
uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg); char*, uint32_t, void*),void *arg);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
void registerCallBackRawDataModifyReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &,void*),void *arg);
private: private:

View File

@ -95,9 +95,36 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes
*/ */
void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t,
uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t,
uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg); char*, uint32_t, void*),void *arg);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
void registerCallBackRawDataModifyReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &,void*),void *arg);
private: private:
/** /**
@ -344,10 +371,36 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
* detType is the detector type see :: detectorType * detType is the detector type see :: detectorType
* version is the version number of this structure format * version is the version number of this structure format
* dataPointer is the pointer to the data * dataPointer is the pointer to the data
* dataSize in bytes is the size of the data in bytes * dataSize in bytes is the size of the data in bytes.
*/ */
void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void (*rawDataReadyCallBack)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t,
uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*); char*, uint32_t, void*);
/**
* Call back for raw data (modified)
* args to raw data ready callback are
* frameNumber is the frame number
* expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
* packetNumber is the packet number
* bunchId is the bunch id from beamline
* timestamp is the time stamp with 10 MHz clock
* modId is the unique module id (unique even for left, right, top, bottom)
* xCoord is the x coordinate in the complete detector system
* yCoord is the y coordinate in the complete detector system
* zCoord is the z coordinate in the complete detector system
* debug is for debugging purposes
* roundRNumber is the round robin set number
* detType is the detector type see :: detectorType
* version is the version number of this structure format
* dataPointer is the pointer to the data
* revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
*/
void (*rawDataModifyReadyCallBack)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &, void*);
void *pRawDataReady; void *pRawDataReady;

View File

@ -71,6 +71,16 @@ public:
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t datasize, void*),void *arg); char* datapointer, uint32_t datasize, void*),void *arg);
/**
@sort register callback to be called when data are available (to process and/or save the data).
\param func raw data ready callback. arguments are frameNumber, expLength, packetNumber, bunchId, timestamp, modId, xCoord, yCoord, zCoord, debug, roundRNumber, detType, version, dataPointer, revDatasize is the reference of data size in bytes. Can be modified to the new size to be written/streamed. (only smaller value).
\returns nothing
*/
void registerCallBackRawDataModifyReady(void (*func)(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t &revDatasize, void*),void *arg);
//receiver object //receiver object
slsReceiver* receiver; slsReceiver* receiver;
}; };

View File

@ -35,8 +35,13 @@ bool DataProcessor::SilentMode(false);
DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr, DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
uint32_t* freq, uint32_t* timer, uint32_t* freq, uint32_t* timer,
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t,
uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*), char*, uint32_t, void*),
void (*dataModifyReadycb)(uint64_t, uint32_t, uint32_t, uint64_t,
uint64_t, uint16_t, uint16_t, uint16_t, uint16_t,
uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &, void*),
void *pDataReadycb) : void *pDataReadycb) :
ThreadObject(NumberofDataProcessors), ThreadObject(NumberofDataProcessors),
@ -61,6 +66,7 @@ DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* d
numFramesCaught(0), numFramesCaught(0),
currentFrameIndex(0), currentFrameIndex(0),
rawDataReadyCallBack(dataReadycb), rawDataReadyCallBack(dataReadycb),
rawDataModifyReadyCallBack(dataModifyReadycb),
pRawDataReady(pDataReadycb) pRawDataReady(pDataReadycb)
{ {
if(ThreadObject::CreateThread()){ if(ThreadObject::CreateThread()){
@ -316,7 +322,7 @@ void DataProcessor::ThreadExecution() {
return; return;
} }
ProcessAnImage(buffer + FIFO_HEADER_NUMBYTES); ProcessAnImage(buffer);
//stream (if time/freq to stream) or free //stream (if time/freq to stream) or free
if (*dataStreamEnable && SendToStreamer()) if (*dataStreamEnable && SendToStreamer())
@ -348,7 +354,7 @@ void DataProcessor::StopProcessing(char* buf) {
/** buf includes only the standard header */ /** buf includes only the standard header */
void DataProcessor::ProcessAnImage(char* buf) { void DataProcessor::ProcessAnImage(char* buf) {
sls_detector_header* header = (sls_detector_header*) (buf); sls_detector_header* header = (sls_detector_header*) (buf + FIFO_HEADER_NUMBYTES);
uint64_t fnum = header->frameNumber; uint64_t fnum = header->frameNumber;
currentFrameIndex = fnum; currentFrameIndex = fnum;
uint32_t nump = header->packetNumber; uint32_t nump = header->packetNumber;
@ -381,7 +387,7 @@ void DataProcessor::ProcessAnImage(char* buf) {
} }
if (*gapPixelsEnable && (*dynamicRange!=4)) if (*gapPixelsEnable && (*dynamicRange!=4))
InsertGapPixels(buf + sizeof(sls_detector_header), *dynamicRange); InsertGapPixels(buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header), *dynamicRange);
// x coord is 0 for detector in pos [0,0,0] // x coord is 0 for detector in pos [0,0,0]
if (xcoordin1D) { if (xcoordin1D) {
@ -409,14 +415,36 @@ void DataProcessor::ProcessAnImage(char* buf) {
header->roundRNumber, header->roundRNumber,
header->detType, header->detType,
header->version, header->version,
buf + sizeof(sls_detector_header), buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header),
generalData->imageSize, (uint32_t)(*((uint32_t*)buf)),
pRawDataReady); pRawDataReady);
} }
else if (rawDataModifyReadyCallBack) {cprintf(BG_GREEN,"Calling rawdatamodify\n");
uint32_t revsize = (uint32_t)(*((uint32_t*)buf));
rawDataModifyReadyCallBack(
header->frameNumber,
header->expLength,
header->packetNumber,
header->bunchId,
header->timestamp,
header->modId,
header->xCoord,
header->yCoord,
header->zCoord,
header->debug,
header->roundRNumber,
header->detType,
header->version,
buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header),
revsize,
pRawDataReady);
(*((uint32_t*)buf)) = revsize;
}
if (file) if (file)
file->WriteToFile(buf, sizeof(sls_detector_header) + generalData->imageSize, fnum-firstMeasurementIndex, nump); file->WriteToFile(buf + FIFO_HEADER_NUMBYTES, sizeof(sls_detector_header) + (uint32_t)(*((uint32_t*)buf)), fnum-firstMeasurementIndex, nump);

View File

@ -200,7 +200,7 @@ void DataStreamer::ThreadExecution() {
return; return;
} }
ProcessAnImage(buffer + FIFO_HEADER_NUMBYTES); ProcessAnImage(buffer);
//free //free
fifo->FreeAddress(buffer); fifo->FreeAddress(buffer);
@ -216,7 +216,7 @@ void DataStreamer::StopProcessing(char* buf) {
#endif #endif
sls_detector_header* header = (sls_detector_header*) (buf); sls_detector_header* header = (sls_detector_header*) (buf);
//send dummy header and data //send dummy header and data
if (!SendHeader(header, 0, 0, true)) if (!SendHeader(header, 0, 0, 0, true))
cprintf(RED,"Error: Could not send zmq dummy header for streamer %d\n", index); cprintf(RED,"Error: Could not send zmq dummy header for streamer %d\n", index);
fifo->FreeAddress(buf); fifo->FreeAddress(buf);
@ -229,7 +229,7 @@ void DataStreamer::StopProcessing(char* buf) {
/** buf includes only the standard header */ /** buf includes only the standard header */
void DataStreamer::ProcessAnImage(char* buf) { void DataStreamer::ProcessAnImage(char* buf) {
sls_detector_header* header = (sls_detector_header*) (buf); sls_detector_header* header = (sls_detector_header*) (buf + FIFO_HEADER_NUMBYTES);
uint64_t fnum = header->frameNumber; uint64_t fnum = header->frameNumber;
#ifdef VERBOSE #ifdef VERBOSE
cprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index,fnum); cprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index,fnum);
@ -245,11 +245,11 @@ void DataStreamer::ProcessAnImage(char* buf) {
//shortframe gotthard //shortframe gotthard
if (completeBuffer) { if (completeBuffer) {
if (!SendHeader(header, generalData->nPixelsXComplete, generalData->nPixelsYComplete, false)) if (!SendHeader(header, (uint32_t)(*((uint32_t*)buf)), generalData->nPixelsXComplete, generalData->nPixelsYComplete, false))
cprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n", cprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n",
(long long int) fnum, index); (long long int) fnum, index);
memcpy(completeBuffer + ((generalData->imageSize)**shortFrameEnable), buf + sizeof(sls_detector_header), generalData->imageSize); memcpy(completeBuffer + ((generalData->imageSize)**shortFrameEnable), buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header), (uint32_t)(*((uint32_t*)buf)) ); // new size possibly from callback
if (!zmqSocket->SendData(completeBuffer, generalData->imageSizeComplete)) if (!zmqSocket->SendData(completeBuffer, generalData->imageSizeComplete))
cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n", cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
(long long int) fnum, index); (long long int) fnum, index);
@ -259,11 +259,11 @@ void DataStreamer::ProcessAnImage(char* buf) {
//normal //normal
else { else {
if (!SendHeader(header, generalData->nPixelsX, generalData->nPixelsY, false)) if (!SendHeader(header, (uint32_t)(*((uint32_t*)buf)), generalData->nPixelsX, generalData->nPixelsY, false)) // new size possibly from callback
cprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n", cprintf(RED,"Error: Could not send zmq header for fnum %lld and streamer %d\n",
(long long int) fnum, index); (long long int) fnum, index);
if (!zmqSocket->SendData(buf + sizeof(sls_detector_header), generalData->imageSize)) if (!zmqSocket->SendData(buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header), (uint32_t)(*((uint32_t*)buf)) )) // new size possibly from callback
cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n", cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
(long long int) fnum, index); (long long int) fnum, index);
} }
@ -271,7 +271,7 @@ void DataStreamer::ProcessAnImage(char* buf) {
int DataStreamer::SendHeader(sls_detector_header* header, uint32_t nx, uint32_t ny, bool dummy) { int DataStreamer::SendHeader(sls_detector_header* header, uint32_t size, uint32_t nx, uint32_t ny, bool dummy) {
if (dummy) if (dummy)
return zmqSocket->SendHeaderData(index, dummy,SLS_DETECTOR_JSON_HEADER_VERSION); return zmqSocket->SendHeaderData(index, dummy,SLS_DETECTOR_JSON_HEADER_VERSION);
@ -280,7 +280,7 @@ int DataStreamer::SendHeader(sls_detector_header* header, uint32_t nx, uint32_t
uint64_t acquisitionIndex = header->frameNumber - firstAcquisitionIndex; uint64_t acquisitionIndex = header->frameNumber - firstAcquisitionIndex;
return zmqSocket->SendHeaderData(index, dummy, SLS_DETECTOR_JSON_HEADER_VERSION, *dynamicRange, *fileIndex, return zmqSocket->SendHeaderData(index, dummy, SLS_DETECTOR_JSON_HEADER_VERSION, *dynamicRange, *fileIndex,
nx, ny,generalData->imageSize, nx, ny, size,
acquisitionIndex, frameIndex, fileNametoStream, acquisitionIndex, frameIndex, fileNametoStream,
header->frameNumber, header->expLength, header->packetNumber, header->bunchId, header->timestamp, header->frameNumber, header->expLength, header->packetNumber, header->bunchId, header->timestamp,
header->modId, header->xCoord, header->yCoord, header->zCoord, header->modId, header->xCoord, header->yCoord, header->zCoord,

View File

@ -30,6 +30,7 @@ UDPBaseImplementation::UDPBaseImplementation(){
acquisitionFinishedCallBack = NULL; acquisitionFinishedCallBack = NULL;
pAcquisitionFinished = NULL; pAcquisitionFinished = NULL;
rawDataReadyCallBack = NULL; rawDataReadyCallBack = NULL;
rawDataModifyReadyCallBack = NULL;
pRawDataReady = NULL; pRawDataReady = NULL;
} }
@ -614,10 +615,19 @@ void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(uin
pAcquisitionFinished=arg; pAcquisitionFinished=arg;
} }
void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void UDPBaseImplementation::registerCallBackRawDataReady(void (*func)(uint64_t,
uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg){ char*, uint32_t, void*),void *arg){
rawDataReadyCallBack=func; rawDataReadyCallBack=func;
pRawDataReady=arg; pRawDataReady=arg;
} }
void UDPBaseImplementation::registerCallBackRawDataModifyReady(void (*func)(uint64_t,
uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t&, void*),void *arg){
rawDataModifyReadyCallBack=func;
pRawDataReady=arg;
}
//#endif //#endif

View File

@ -367,7 +367,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) {
listener.push_back(new Listener(myDetectorType, fifo[i], &status, &udpPortNum[i], eth, &activated, &numberOfFrames, &dynamicRange)); listener.push_back(new Listener(myDetectorType, fifo[i], &status, &udpPortNum[i], eth, &activated, &numberOfFrames, &dynamicRange));
dataProcessor.push_back(new DataProcessor(fifo[i], &fileFormatType, dataProcessor.push_back(new DataProcessor(fifo[i], &fileFormatType,
fileWriteEnable, &dataStreamEnable, &gapPixelsEnable, &dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS, fileWriteEnable, &dataStreamEnable, &gapPixelsEnable, &dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS,
rawDataReadyCallBack,pRawDataReady)); rawDataReadyCallBack, rawDataModifyReadyCallBack, pRawDataReady));
if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) { if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) {
FILE_LOG(logERROR) << "Could not create listener/dataprocessor threads (index:" << i << ")"; FILE_LOG(logERROR) << "Could not create listener/dataprocessor threads (index:" << i << ")";
for (vector<Listener*>::const_iterator it = listener.begin(); it != listener.end(); ++it) for (vector<Listener*>::const_iterator it = listener.begin(); it != listener.end(); ++it)

View File

@ -42,7 +42,7 @@ void AcquisitionFinished(uint64_t frames, void*p){
void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp, void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version, uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t datasize, void* p){ char* datapointer, uint32_t* datasize, void* p){
PRINT_IN_COLOR (xCoord, PRINT_IN_COLOR (xCoord,
"#### %d GetData: ####\n" "#### %d GetData: ####\n"
@ -51,7 +51,7 @@ void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, ui
"version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n", "version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId, xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version, xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
((uint8_t)(*((uint8_t*)(datapointer)))), datasize); ((uint8_t)(*((uint8_t*)(datapointer)))), *datasize);
} }
*/ */

View File

@ -150,7 +150,9 @@ void slsReceiver::registerCallBackAcquisitionFinished(void (*func)(uint64_t, voi
} }
void slsReceiver::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void slsReceiver::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t,
uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg){ char*, uint32_t, void*),void *arg){
//tcpipInterface //tcpipInterface
if(udp_interface) if(udp_interface)
@ -160,3 +162,13 @@ void slsReceiver::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t,
} }
void slsReceiver::registerCallBackRawDataModifyReady(void (*func)(uint64_t, uint32_t,
uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t,
uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &, void*),void *arg){
//tcpipInterface
if(udp_interface)
udp_interface->registerCallBackRawDataModifyReady(func,arg);
else
tcpipInterface->registerCallBackRawDataModifyReady(func,arg);
}

View File

@ -46,6 +46,7 @@ slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int &success, UDPInterface*
acquisitionFinishedCallBack = NULL; acquisitionFinishedCallBack = NULL;
pAcquisitionFinished = NULL; pAcquisitionFinished = NULL;
rawDataReadyCallBack = NULL; rawDataReadyCallBack = NULL;
rawDataModifyReadyCallBack = NULL;
pRawDataReady = NULL; pRawDataReady = NULL;
unsigned short int port_no=portNumber; unsigned short int port_no=portNumber;
@ -152,8 +153,7 @@ void slsReceiverTCPIPInterface::stop(){
int64_t slsReceiverTCPIPInterface::getReceiverVersion(){ int64_t slsReceiverTCPIPInterface::getReceiverVersion(){
int64_t retval = GITREV; int64_t retval = GITDATE;
retval= (retval <<32) | GITDATE;
return retval; return retval;
} }
@ -170,12 +170,21 @@ void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func)
pAcquisitionFinished=arg; pAcquisitionFinished=arg;
} }
void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, void slsReceiverTCPIPInterface::registerCallBackRawDataReady(void (*func)(uint64_t,
uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t, void*),void *arg){ char*, uint32_t, void*),void *arg){
rawDataReadyCallBack=func; rawDataReadyCallBack=func;
pRawDataReady=arg; pRawDataReady=arg;
} }
void slsReceiverTCPIPInterface::registerCallBackRawDataModifyReady(void (*func)(uint64_t,
uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t,
uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
char*, uint32_t &,void*),void *arg){
rawDataModifyReadyCallBack=func;
pRawDataReady=arg;
}
@ -785,6 +794,8 @@ int slsReceiverTCPIPInterface::set_detector_type(){
receiverBase->registerCallBackAcquisitionFinished(acquisitionFinishedCallBack,pAcquisitionFinished); receiverBase->registerCallBackAcquisitionFinished(acquisitionFinishedCallBack,pAcquisitionFinished);
if(rawDataReadyCallBack) if(rawDataReadyCallBack)
receiverBase->registerCallBackRawDataReady(rawDataReadyCallBack,pRawDataReady); receiverBase->registerCallBackRawDataReady(rawDataReadyCallBack,pRawDataReady);
if(rawDataModifyReadyCallBack)
receiverBase->registerCallBackRawDataModifyReady(rawDataModifyReadyCallBack,pRawDataReady);
} }
myDetectorType = dr; myDetectorType = dr;
ret = receiverBase->setDetectorType(myDetectorType); ret = receiverBase->setDetectorType(myDetectorType);

View File

@ -35,3 +35,8 @@ void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(uint64_t frameN
receiver->registerCallBackRawDataReady(func,arg); receiver->registerCallBackRawDataReady(func,arg);
} }
void slsReceiverUsers::registerCallBackRawDataModifyReady(void (*func)(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
char* datapointer, uint32_t& revDatasize, void*), void *arg){
receiver->registerCallBackRawDataModifyReady(func,arg);
}