mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
fixed gitinfo
This commit is contained in:
commit
c35203ebfb
@ -7,7 +7,7 @@ option (USE_TEXTCLIENT "Text Client" OFF)
|
||||
option (USE_RECEIVER "Receiver" 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(Qwt 6)
|
||||
|
112
RELEASE.txt
112
RELEASE.txt
@ -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
|
||||
============
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -86,6 +86,7 @@ void AcquisitionFinished(uint64_t frames, void*p){
|
||||
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",frames);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Receiver Data Call back
|
||||
* Prints in different colors(for each receiver process) the different headers for each image call back.
|
||||
@ -103,7 +104,7 @@ void AcquisitionFinished(uint64_t frames, void*p){
|
||||
* @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 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,
|
||||
@ -122,6 +123,48 @@ void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, ui
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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 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 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
|
||||
*/
|
||||
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 &revDatasize, 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)))), revDatasize);
|
||||
|
||||
// if data is modified, eg ROI and size is reduced
|
||||
revDatasize = 26000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Example of main program using the slsReceiverUsers class
|
||||
*
|
||||
@ -209,7 +252,8 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
/* - Call back for raw data */
|
||||
cprintf(BLUE, "Registering GetData() \n");
|
||||
receiver->registerCallBackRawDataReady(GetData,NULL);
|
||||
if (withCallback == 1) receiver->registerCallBackRawDataReady(GetData,NULL);
|
||||
else if (withCallback == 2) receiver->registerCallBackRawDataModifyReady(GetData,NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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.
|
||||
\\ 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.
|
||||
|
||||
@ -694,7 +694,15 @@ Start the server again:
|
||||
\begin{verbatim}
|
||||
./eigerDetectorServer &
|
||||
\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}
|
||||
|
||||
@ -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
|
||||
\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}}
|
||||
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}
|
||||
|
1
serverBin/eigerDetectorServer_developer
Symbolic link
1
serverBin/eigerDetectorServer_developer
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_developer
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.16.1
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.21.0
|
1
serverBin/gotthardDetectorServer_developer
Symbolic link
1
serverBin/gotthardDetectorServer_developer
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_developer
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1
|
1
serverBin/jungfrauDetectorServer_developer
Symbolic link
1
serverBin/jungfrauDetectorServer_developer
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.0.2
|
@ -10,6 +10,17 @@
|
||||
#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;
|
||||
|
||||
#ifndef FRAMEMODE_DEF
|
||||
@ -66,11 +77,30 @@ template <class dataType> class analogDetector {
|
||||
thr=0;
|
||||
myFile=NULL;
|
||||
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
|
||||
*/
|
||||
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
|
||||
@ -111,6 +141,15 @@ template <class dataType> class analogDetector {
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 */
|
||||
@ -271,18 +319,6 @@ template <class dataType> class analogDetector {
|
||||
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){
|
||||
if (cmSub) {
|
||||
@ -319,6 +355,7 @@ template <class dataType> class analogDetector {
|
||||
else return -1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
gets pedestal rms (i.e. noise)
|
||||
\param ix pixel x coordinate
|
||||
@ -383,7 +420,6 @@ template <class dataType> class analogDetector {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
sets pedestal
|
||||
\param ix pixel x coordinate
|
||||
@ -451,17 +487,45 @@ template <class dataType> class analogDetector {
|
||||
virtual void *writeImage(const char * imgname) {
|
||||
float *gm=NULL;
|
||||
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];
|
||||
for (int ix=0; ix<nx; ix++) {
|
||||
for (int iy=0; iy<ny; iy++) {
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
#ifdef ROOTSPECTRUM
|
||||
TH2F *getSpectrum(){return hs;};
|
||||
#endif
|
||||
/**
|
||||
write 32bit tiff file containing the pedestals
|
||||
\param imgname file name to be written
|
||||
@ -472,13 +536,41 @@ template <class dataType> class analogDetector {
|
||||
float *gm=NULL;
|
||||
void *ret;
|
||||
gm=new float[nx*ny];
|
||||
#ifdef ROOTSPECTRUM
|
||||
|
||||
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;
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
@ -594,15 +686,20 @@ template <class dataType> class analogDetector {
|
||||
|
||||
|
||||
newFrame();
|
||||
|
||||
if (cmSub) {
|
||||
addToCommonMode(data);
|
||||
}
|
||||
|
||||
// cout << xmin << " " << xmax << endl;
|
||||
// cout << ymin << " " << ymax << endl;
|
||||
for (int ix=xmin; ix<xmax; ix++) {
|
||||
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);
|
||||
else
|
||||
val=((double*)data)[iy*nx+ix];
|
||||
/* if (cm && cmSub) */
|
||||
/* val-=getCommonMode(ix,iy); */
|
||||
addToPedestal(val,ix,iy, cm);
|
||||
|
||||
/* if (ix==10 && iy==10) */
|
||||
/* 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 ;
|
||||
|
||||
@ -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
|
||||
\returns pointer to the pedestal subtracted data
|
||||
*/
|
||||
// virtual int *subtractPedestal(char *data, int *val=NULL) {
|
||||
|
||||
|
||||
virtual double *subtractPedestal(char *data, double *val=NULL, int cm=0) {
|
||||
virtual int *subtractPedestal(char *data, int *val=NULL, int cm=0) {
|
||||
|
||||
newFrame();
|
||||
|
||||
if (val==NULL)
|
||||
val=new double[nx*ny];
|
||||
val=image;//new double[nx*ny];
|
||||
|
||||
for (int ix=xmin; ix<xmax; ix++) {
|
||||
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;
|
||||
@ -718,17 +836,48 @@ template <class dataType> class analogDetector {
|
||||
|
||||
virtual double subtractPedestal(char *data, int ix, int iy=0, int cm=0) {
|
||||
double g=1.;
|
||||
double val;
|
||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||
if (gmap) {
|
||||
g=gmap[iy*nx+ix];
|
||||
if (g==0) g=-1.;
|
||||
}
|
||||
|
||||
if (det) {
|
||||
return (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy, cm))/g;
|
||||
}
|
||||
if (det)
|
||||
val= (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy,cm))/g;
|
||||
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) {
|
||||
int nph=0;
|
||||
double v;
|
||||
int cm=0;
|
||||
if (cmSub) cm=1;
|
||||
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) {
|
||||
v+=0.5*thr;
|
||||
nph=v/thr;
|
||||
if (nph>0)
|
||||
return nph;
|
||||
} else {
|
||||
// cout << v << endl;
|
||||
//if (v>0)
|
||||
return v;
|
||||
//else
|
||||
//return 0;
|
||||
return 0;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
@ -783,12 +933,11 @@ template <class dataType> class analogDetector {
|
||||
*/
|
||||
int *getNPhotons(char *data, int *nph=NULL) {
|
||||
|
||||
// double val;
|
||||
double val;
|
||||
if (nph==NULL)
|
||||
nph=image;
|
||||
newFrame();
|
||||
|
||||
|
||||
addToCommonMode(data);
|
||||
|
||||
for (int ix=xmin; ix<xmax; ix++) {
|
||||
@ -810,6 +959,23 @@ template <class dataType> class analogDetector {
|
||||
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
|
||||
@ -872,10 +1038,12 @@ template <class dataType> class analogDetector {
|
||||
virtual void processData(char *data,int *val=NULL) {
|
||||
switch(fMode) {
|
||||
case ePedestal:
|
||||
// cout << "ped " << endl;
|
||||
addToPedestal(data);
|
||||
break;
|
||||
default:
|
||||
getNPhotons(data,val);
|
||||
//subtractPedestal(data);
|
||||
getNPhotons(data);
|
||||
}
|
||||
};
|
||||
|
||||
@ -897,12 +1065,12 @@ template <class dataType> class analogDetector {
|
||||
\param f 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
|
||||
\returns current file pointer
|
||||
*/
|
||||
FILE *getFilePointer(){return myFile;};
|
||||
FILE *getFilePointer(){return myFile;};
|
||||
void setMutex(pthread_mutex_t *m){fm=m;};
|
||||
protected:
|
||||
|
||||
@ -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 */
|
||||
frameMode fMode; /**< current detector frame mode */
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -133,44 +133,6 @@
|
||||
</property>
|
||||
</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">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@ -999,6 +961,107 @@ Frame period between exposures.
|
||||
</layout>
|
||||
</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>
|
||||
<tabstops>
|
||||
<tabstop>spinNumMeasurements</tabstop>
|
||||
|
@ -99,7 +99,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_6">
|
||||
<widget class="QWidget" name="gridLayoutWidget_5">
|
||||
@ -548,7 +548,7 @@
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>5</y>
|
||||
<width>314</width>
|
||||
<width>335</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -587,7 +587,7 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>10</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -596,7 +596,7 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkGainPlot">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -614,6 +614,43 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
</property>
|
||||
</widget>
|
||||
</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><nobr>
|
||||
Displays minimum, maximum and sum of values for each plot.
|
||||
<nobr></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Gap Pixels</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
@ -1695,7 +1732,7 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>331</width>
|
||||
<width>357</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -2522,7 +2559,7 @@ Interval between plots has 2 modes. A condition to be satisfied, in order to avo
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>12</y>
|
||||
<width>331</width>
|
||||
<width>365</width>
|
||||
<height>36</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -1,9 +1,18 @@
|
||||
Path: slsDetectorsPackage/slsDetectorGui
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
<<<<<<< HEAD
|
||||
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
|
||||
Revision: 492
|
||||
Branch: developer
|
||||
Last Changed Author: Anna_Bergamaschi
|
||||
Last Changed Rev: 3731
|
||||
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
|
||||
|
@ -1,6 +1,7 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "ab06c33107ecfeb4741d49407903ff80286cf75b"
|
||||
#define GITAUTH "Anna_Bergamaschi"
|
||||
#define GITREV 0x3731
|
||||
#define GITDATE 0x20180315
|
||||
|
||||
#define GITREPUUID "fe2ba8621b33bc00f51c8cd4d33e98b7d4ebfa41"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3747
|
||||
#define GITDATE 0x20180327
|
||||
#define GITBRANCH "developer"
|
||||
|
@ -617,7 +617,6 @@ void saveErrorSignal(QString);
|
||||
void AcquisitionErrorSignal(QString);
|
||||
void UpdatePlotSignal();
|
||||
void GainPlotSignal(bool);
|
||||
void AcquisitionFinishedSignal();
|
||||
};
|
||||
|
||||
|
||||
|
@ -50,14 +50,14 @@ public:
|
||||
*/
|
||||
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
|
||||
* 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 */
|
||||
int GetProgress(){return progressBar->value();};
|
||||
@ -65,10 +65,6 @@ public:
|
||||
|
||||
public slots:
|
||||
|
||||
/** Unconnects start/stop button when acquisition is finished
|
||||
*/
|
||||
void AcquisitionFinished();
|
||||
|
||||
/** update plot is finished,
|
||||
* changes start/stop text and enables/disables all widgets
|
||||
*/
|
||||
@ -131,9 +127,13 @@ private slots:
|
||||
*/
|
||||
void setRunIndex(int index);
|
||||
|
||||
/** starts/stops Acquisition
|
||||
/** starts Acquisition
|
||||
*/
|
||||
void startStopAcquisition();
|
||||
void startAcquisition();
|
||||
|
||||
/** stops Acquisition
|
||||
*/
|
||||
void stopAcquisition();
|
||||
|
||||
/** Set number of frames
|
||||
* @param val number of frames to be set
|
||||
@ -193,8 +193,6 @@ private:
|
||||
QPalette red;
|
||||
/** expert mode */
|
||||
bool expertMode;
|
||||
QIcon *iconStart;
|
||||
QIcon *iconStop;
|
||||
/** to access items in settings combobox */
|
||||
QStandardItemModel* model;
|
||||
|
||||
|
@ -174,6 +174,9 @@ private slots:
|
||||
/** Set histogram options */
|
||||
void SetHistogramOptions();
|
||||
|
||||
/** Enable Gap pixels */
|
||||
void EnableGapPixels(bool enable);
|
||||
|
||||
signals:
|
||||
void DisableZoomSignal(bool);
|
||||
void ResetZMinZMaxSignal(bool,bool,double,double);
|
||||
|
@ -99,8 +99,7 @@ qDetectorMain::qDetectorMain(int argc, char **argv, QApplication *app, int& ret,
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
tempval = GITREV;
|
||||
tempval = (tempval <<32) | GITDATE;
|
||||
tempval = GITDATE;
|
||||
cout << "SLS Detector GUI " << GITBRANCH << " (0x" << hex << tempval << ")" << endl;
|
||||
return;
|
||||
|
||||
@ -337,7 +336,6 @@ void qDetectorMain::Initialization(){
|
||||
// Plotting
|
||||
// When the acquisition is finished, must update the meas tab
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), this, SLOT(EnableTabs()));
|
||||
connect(myPlot, SIGNAL(AcquisitionFinishedSignal()), tab_measurement, SLOT(AcquisitionFinished()));
|
||||
connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_measurement, SLOT(UpdateFinished()));
|
||||
//This should not be called as it will change file name to measurement when run finished
|
||||
//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;
|
||||
#endif
|
||||
char version[200];
|
||||
long long unsigned int retval= GITREV;
|
||||
retval= (retval <<32) | GITDATE;
|
||||
long long unsigned int retval= GITDATE;
|
||||
sprintf(version,"%llx",retval);
|
||||
string thisGUIVersion = string(version);
|
||||
|
||||
|
@ -1296,7 +1296,6 @@ int qDrawPlot::AcquisitionFinished(double currentProgress, int detectorStatus){
|
||||
#ifdef VERBOSE
|
||||
cout << "\nEntering Acquisition Finished with status " ;
|
||||
#endif
|
||||
emit AcquisitionFinishedSignal();
|
||||
QString status = QString(slsDetectorBase::runStatusType(slsDetectorDefs::runStatus(detectorStatus)).c_str());
|
||||
#ifdef VERBOSE
|
||||
cout << status.toAscii().constData() << " and progress " << currentProgress << endl;
|
||||
|
@ -94,12 +94,6 @@ void qTabMeasurement::SetupWidgetWindow(){
|
||||
chkFile->setChecked(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
|
||||
progressTimer = new QTimer(this);
|
||||
|
||||
@ -267,8 +261,10 @@ void qTabMeasurement::Initialization(){
|
||||
connect(dispFileName, SIGNAL(editingFinished()),this, SLOT(setFileName()));
|
||||
//File Index
|
||||
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
|
||||
//Start/Stop Acquisition
|
||||
connect(btnStartStop, SIGNAL(clicked()), this, SLOT(startStopAcquisition()));
|
||||
//Start Acquisition
|
||||
connect(btnStart, SIGNAL(clicked()), this, SLOT(startAcquisition()));
|
||||
//Stop Acquisition
|
||||
connect(btnStop, SIGNAL(clicked()), this, SLOT(stopAcquisition()));
|
||||
//Timing Mode
|
||||
connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(SetTimingMode(int)));//
|
||||
//progress bar
|
||||
@ -309,24 +305,21 @@ void qTabMeasurement::Enable(bool enable){
|
||||
frameNotTimeResolved->setEnabled(enable);
|
||||
|
||||
//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(){
|
||||
if(btnStartStop->isChecked()){
|
||||
|
||||
void qTabMeasurement::startAcquisition(){
|
||||
btnStart->setEnabled(false);
|
||||
//if file write enabled and output dir doesnt exist
|
||||
if((chkFile->isChecked())&&(thisParent->DoesOutputDirExist() == slsDetectorDefs::FAIL)){
|
||||
if(qDefs::Message(qDefs::QUESTION,
|
||||
"<nobr>Your data will not be saved.</nobr><br><nobr>Disable File write and Proceed with acquisition anyway?</nobr>",
|
||||
"qTabMeasurement::startStopAcquisition") == slsDetectorDefs::FAIL){
|
||||
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||
btnStartStop->click();
|
||||
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||
"qTabMeasurement::startAcquisition") == slsDetectorDefs::FAIL){
|
||||
btnStart->setEnabled(true);
|
||||
return;
|
||||
}else{
|
||||
//done because for receiver it cant save a file with blank file path and returns without acquiring even to the gui
|
||||
@ -340,44 +333,25 @@ void qTabMeasurement::startStopAcquisition(){
|
||||
#ifdef VERBOSE
|
||||
cout << endl << endl << "Starting Acquisition" << endl;
|
||||
#endif
|
||||
//btnStartStop->setStyleSheet("color:red");
|
||||
btnStartStop->setText("Stop");
|
||||
btnStartStop->setIcon(*iconStop);
|
||||
lblProgressIndex->setText(QString::number(0));
|
||||
Enable(0);
|
||||
progressBar->setValue(0);
|
||||
progressTimer->start(100);
|
||||
|
||||
emit StartSignal();
|
||||
}else{
|
||||
#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");
|
||||
qDefs::checkErrorMessage(myDet,"qTabMeasurement::startAcquisition");
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
void qTabMeasurement::AcquisitionFinished(){
|
||||
disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||
btnStartStop->setText("Wait");
|
||||
void qTabMeasurement::stopAcquisition(){
|
||||
#ifdef VERBOSE
|
||||
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)));
|
||||
progressTimer->stop();
|
||||
|
||||
/*disconnect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); done in AcquisitionFinished() already */
|
||||
btnStartStop->setText("Start");
|
||||
btnStartStop->setIcon(*iconStart);
|
||||
btnStartStop->setChecked(false);
|
||||
Enable(1);
|
||||
connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition()));
|
||||
btnStart->setEnabled(true);
|
||||
qDefs::checkErrorMessage(myDet,"qTabMeasurement::UpdateFinished");
|
||||
}
|
||||
|
||||
|
@ -156,9 +156,6 @@ void qTabPlot::SetupWidgetWindow(){
|
||||
stackedWidget->setCurrentIndex(0);
|
||||
stackedWidget_2->setCurrentIndex(0);
|
||||
|
||||
//gain plot
|
||||
chkGainPlot->setEnabled(false);
|
||||
|
||||
// Depending on whether the detector is 1d or 2d
|
||||
switch(myDet->getDetectorsType()){
|
||||
case slsDetectorDefs::MYTHEN:
|
||||
@ -174,6 +171,7 @@ void qTabPlot::SetupWidgetWindow(){
|
||||
pagePedestal_2->setEnabled(false);
|
||||
chkBinary->setEnabled(false);
|
||||
chkBinary_2->setEnabled(false);
|
||||
chkGapPixels->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::GOTTHARD:
|
||||
isOriginallyOneD = true;
|
||||
@ -202,6 +200,12 @@ void qTabPlot::SetupWidgetWindow(){
|
||||
//disable histogram initially
|
||||
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");
|
||||
}
|
||||
|
||||
@ -376,6 +380,10 @@ void qTabPlot::Initialization(){
|
||||
//gainplot
|
||||
if (chkGainPlot->isEnabled())
|
||||
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);*/
|
||||
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{
|
||||
boxFrequency->setEnabled(false);
|
||||
disconnect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox()));
|
||||
|
@ -24,6 +24,7 @@ using namespace std;
|
||||
// 0xFFF0000000000000ULL
|
||||
#define MULTI_DETECTORS_NOT_ADDED 0x8000000000000000ULL
|
||||
#define MULTI_HAVE_DIFFERENT_VALUES 0x4000000000000000ULL
|
||||
#define MULTI_CONFIG_FILE_ERROR 0x2000000000000000ULL
|
||||
|
||||
// sls errors
|
||||
#define CRITICAL_ERROR_MASK 0xFFFFFFF
|
||||
@ -91,6 +92,7 @@ using namespace std;
|
||||
#define RESTREAM_STOP_FROM_RECEIVER 0x0000000800000000ULL
|
||||
#define TEMPERATURE_CONTROL 0x0000001000000000ULL
|
||||
#define AUTO_COMP_DISABLE 0x0000002000000000ULL
|
||||
#define CONFIG_FILE 0x0000004000000000ULL
|
||||
// 0x000000FFFFFFFFFFULL
|
||||
|
||||
|
||||
@ -289,6 +291,8 @@ public:
|
||||
if(slsErrorMask&AUTO_COMP_DISABLE)
|
||||
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
|
||||
|
||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 06cdf8ad9204fd306cb1017b91e67452c61715d4
|
||||
Revision: 323
|
||||
Repsitory UUID: da010a03d725b6f18020d2142d58771534414274
|
||||
Revision: 328
|
||||
Branch: developer
|
||||
Last Changed Author: Erik_Frojdh
|
||||
Last Changed Rev: 3671
|
||||
Last Changed Date: 2018-03-13 10:28:12.000000002 +0100 ./FebRegisterDefs.h
|
||||
Last Changed Rev: 3751
|
||||
Last Changed Date: 2018-04-03 16:29:39.000000002 +0200 ./xparameters.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "06cdf8ad9204fd306cb1017b91e67452c61715d4"
|
||||
#define GITREPUUID "da010a03d725b6f18020d2142d58771534414274"
|
||||
#define GITAUTH "Erik_Frojdh"
|
||||
#define GITREV 0x3671
|
||||
#define GITDATE 0x20180313
|
||||
#define GITREV 0x3751
|
||||
#define GITDATE 0x20180403
|
||||
#define GITBRANCH "developer"
|
||||
|
@ -1,9 +1,18 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
<<<<<<< HEAD
|
||||
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
|
||||
Revision: 1846
|
||||
Branch: developer
|
||||
Last Changed Author: Anna_Bergamaschi
|
||||
Last Changed Rev: 3731
|
||||
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
|
||||
|
@ -1289,6 +1289,7 @@ int64_t setExposureTime(int64_t value){
|
||||
/* time is in ns */
|
||||
if (value!=-1)
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/jctbDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 3da6a6df6556312f7467407a8b5691bdc478424e
|
||||
Revision: 21
|
||||
Repsitory UUID: 807189a4923dc257d812c9974f1a4a4d143c2f70
|
||||
Revision: 23
|
||||
Branch: developer
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3597
|
||||
Last Changed Date: 2018-02-07 10:44:13.000000002 +0100 ./server_funcs.h
|
||||
Last Changed Author: Anna_Bergamaschi
|
||||
Last Changed Rev: 3734
|
||||
Last Changed Date: 2018-04-17 12:35:10.000000002 +0200 ./firmware_funcs.c
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "3da6a6df6556312f7467407a8b5691bdc478424e"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3597
|
||||
#define GITDATE 0x20180207
|
||||
#define GITREPUUID "807189a4923dc257d812c9974f1a4a4d143c2f70"
|
||||
#define GITAUTH "Anna_Bergamaschi"
|
||||
#define GITREV 0x3734
|
||||
#define GITDATE 0x20180417
|
||||
#define GITBRANCH "developer"
|
||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/jungfrauDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 06cdf8ad9204fd306cb1017b91e67452c61715d4
|
||||
Revision: 122
|
||||
Repsitory UUID: da010a03d725b6f18020d2142d58771534414274
|
||||
Revision: 135
|
||||
Branch: developer
|
||||
Last Changed Author: Erik_Frojdh
|
||||
Last Changed Rev: 3671
|
||||
Last Changed Date: 2018-03-13 10:29:31.000000002 +0100 ./Makefile.virtual
|
||||
Last Changed Rev: 3751
|
||||
Last Changed Date: 2018-04-03 16:29:40.000000002 +0200 ./RegisterDefs.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "06cdf8ad9204fd306cb1017b91e67452c61715d4"
|
||||
#define GITREPUUID "da010a03d725b6f18020d2142d58771534414274"
|
||||
#define GITAUTH "Erik_Frojdh"
|
||||
#define GITREV 0x3671
|
||||
#define GITDATE 0x20180313
|
||||
#define GITREV 0x3751
|
||||
#define GITDATE 0x20180403
|
||||
#define GITBRANCH "developer"
|
||||
|
@ -1250,6 +1250,10 @@ void configurePll() {
|
||||
#endif
|
||||
u_int32_t val;
|
||||
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]);
|
||||
if (clkPhase[1]>0) {
|
||||
|
@ -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 ADC_OFST_HALF_SPEED_VAL (0x20) //adc pipeline
|
||||
#define ADC_OFST_QUARTER_SPEED_VAL (0x0f)
|
||||
#define ADC_PHASE_HALF_SPEED (0x41)
|
||||
#define ADC_PHASE_QUARTER_SPEED (0x19)
|
||||
#define ADC_PHASE_HALF_SPEED (0x48) //72
|
||||
#define ADC_PHASE_QUARTER_SPEED (0x48) //72
|
||||
|
||||
/* Maybe not required for jungfrau */
|
||||
#define NTRIMBITS (6)
|
||||
|
@ -24,7 +24,7 @@ ID: $Id$
|
||||
#include <sys/shm.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
char ans[MAX_STR_LENGTH];
|
||||
@ -827,8 +827,8 @@ int multiSlsDetector::addSlsDetector(detectorType t, int pos) {
|
||||
#ifdef VERBOSE
|
||||
cout << "Creating detector " << id << " of type " << getDetectorType(t) << endl;
|
||||
#endif
|
||||
slsDetector *s=new slsDetector(pos, t, id, this);
|
||||
s=NULL;
|
||||
new slsDetector(pos, t, id, this);
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "Adding it to the multi detector structure" << endl;
|
||||
#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;
|
||||
|
||||
}
|
||||
@ -5149,6 +5160,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
|
||||
setErrorMask(getErrorMask()|MULTI_CONFIG_FILE_ERROR);
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
@ -5255,6 +5267,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){
|
||||
#endif
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
|
||||
setErrorMask(getErrorMask()|MULTI_CONFIG_FILE_ERROR);
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
@ -6510,6 +6523,10 @@ string multiSlsDetector::getErrorMessage(int &critical){
|
||||
"Please check the console\n");
|
||||
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) {
|
||||
if (detectors[idet]) {
|
||||
@ -6998,4 +7015,3 @@ bool multiSlsDetector::isAcquireReady() {
|
||||
thisMultiDetector->acquiringFlag = true;
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "ab06c33107ecfeb4741d49407903ff80286cf75b"
|
||||
#define GITAUTH "Anna_Bergamaschi"
|
||||
#define GITREV 0x3731
|
||||
#define GITDATE 0x20180315
|
||||
|
||||
#define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3746
|
||||
#define GITDATE 0x20180327
|
||||
|
||||
#define GITBRANCH "developer"
|
||||
|
@ -2246,8 +2246,7 @@ int64_t slsDetector::getId( idMode mode, int imod){
|
||||
#endif
|
||||
if (mode==THIS_SOFTWARE_VERSION) {
|
||||
ret=OK;
|
||||
retval=GITREV;
|
||||
retval=(retval<<32) | GITDATE;
|
||||
retval=GITDATE;
|
||||
} else if (mode==RECEIVER_VERSION) {
|
||||
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
|
||||
if (connectData() == OK){
|
||||
@ -7265,6 +7264,7 @@ int slsDetector::readConfigurationFile(string const fname){
|
||||
infile.close();
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
|
||||
setErrorMask((getErrorMask())|(CONFIG_FILE));
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
@ -7362,6 +7362,7 @@ int slsDetector::writeConfigurationFile(string const fname){
|
||||
}
|
||||
else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
|
||||
setErrorMask((getErrorMask())|(CONFIG_FILE));
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
|
@ -718,7 +718,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
*/
|
||||
|
||||
/*! \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_pFuncPtr=&slsDetectorCommand::cmdSpeed;
|
||||
@ -774,7 +774,7 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
++i;
|
||||
|
||||
/*! \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_pFuncPtr=&slsDetectorCommand::cmdSpeed;
|
||||
@ -5830,7 +5830,6 @@ string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
|
||||
ret=myDet->setSpeed(index,t);
|
||||
@ -5849,21 +5848,23 @@ string slsDetectorCommand::helpSpeed(int narg, char *args[], int action) {
|
||||
ostringstream os;
|
||||
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 << "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 << "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;
|
||||
|
||||
}
|
||||
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 << "waitstates \t gets the waitstates of the bus interface" << 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 << "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;
|
||||
|
||||
}
|
||||
|
@ -275,8 +275,9 @@ int64_t slsDetectorUsers::getThisSoftwareVersion(){
|
||||
return myDetector->getThisSoftwareVersion();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int slsDetectorUsers::enableGapPixels(int enable) {
|
||||
return myDetector->enableGapPixels(enable);
|
||||
}
|
||||
|
||||
void slsDetectorUsers::registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg){
|
||||
myDetector->registerDataCallback(userCallback,pArg);
|
||||
@ -382,3 +383,19 @@ int slsDetectorUsers::setReceiverSilentMode(int i) {
|
||||
int slsDetectorUsers::setHighVoltage(int 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);
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
/**
|
||||
@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);
|
||||
/**
|
||||
@short setsthe maximum detector size
|
||||
@short gets the maximum detector size
|
||||
\param x0 horizontal position origin in channel number
|
||||
\param y0 vertical position origin in channel number
|
||||
\param nx number of channels in horiziontal
|
||||
@ -528,6 +528,14 @@ class slsDetectorUsers
|
||||
*/
|
||||
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
|
||||
\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
|
||||
* @param i 1 sets, 0 unsets (-1 gets)
|
||||
* @return silent mode of receiver
|
||||
* @returns silent mode of receiver
|
||||
*/
|
||||
int setReceiverSilentMode(int i);
|
||||
|
||||
/**
|
||||
* set high voltage
|
||||
* @param i > 0 sets, 0 unsets, (-1 gets)
|
||||
* @return high voltage
|
||||
* @returns high voltage
|
||||
*/
|
||||
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
|
||||
|
@ -259,6 +259,19 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
||||
*/
|
||||
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
|
||||
\param t type port type can be CONTROL_PORT, DATA_PORT, STOP_PORT
|
||||
|
@ -10,8 +10,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
for (int i = 1; i < argc; ++i ) {
|
||||
if (!(strcmp (argv[i],"--version")) || !(strcmp (argv[i],"-v"))) {
|
||||
int64_t tempval = GITREV;
|
||||
tempval = (tempval <<32) | GITDATE;
|
||||
int64_t tempval = GITDATE;
|
||||
cout << argv[0] << " " << GITBRANCH << " (0x" << hex << tempval << ")" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ char mess[MAX_STR_LENGTH];
|
||||
int dataBytes = 10;
|
||||
int isControlServer = 0;
|
||||
int debugflag = 0;
|
||||
#ifdef EIGERD
|
||||
uint32_t dhcpipad = 0;
|
||||
#endif
|
||||
|
||||
/* initialization functions */
|
||||
|
||||
@ -66,6 +69,9 @@ void init_detector(int controlserver) {
|
||||
if (controlserver) {
|
||||
isControlServer = 1;
|
||||
initControlServer();
|
||||
#ifdef EIGERD
|
||||
dhcpipad = getDetectorIP();
|
||||
#endif
|
||||
}
|
||||
else initStopServer();
|
||||
#endif
|
||||
@ -647,7 +653,7 @@ int get_id(int file_des) {
|
||||
n = receiveData(file_des,&arg,sizeof(arg),INT32);
|
||||
if (n < 0) return printSocketReadError();
|
||||
|
||||
if (arg == MODULE_FIRMWARE_VERSION) {
|
||||
if (arg == MODULE_SERIAL_NUMBER) {
|
||||
n = receiveData(file_des,&imod,sizeof(imod),INT32);
|
||||
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("*************************************************\n");
|
||||
}
|
||||
|
||||
// always remember the ip sent from the client (could be for 10g(if not dhcp))
|
||||
if (detipad != getDetectorIP())
|
||||
dhcpipad = detipad;
|
||||
|
||||
//only for 1Gbe
|
||||
if(!enableTenGigabitEthernet(-1)){
|
||||
if (detipad != getDetectorIP()){
|
||||
printf("*************************************************\n");
|
||||
printf("WARNING: actual detector ip address %x does not match the one from client %x\n",getDetectorIP(),detipad);
|
||||
printf("WARNING: Using DHCP IP for Configuring MAC\n");
|
||||
printf("*************************************************\n");
|
||||
detipad = getDetectorIP();
|
||||
printf("WARNING: Matched detector ip to the hardware ip now\n");
|
||||
printf("*************************************************\n");
|
||||
}
|
||||
}
|
||||
} else
|
||||
detipad = dhcpipad;
|
||||
#endif
|
||||
retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit);
|
||||
if(retval==-1) {
|
||||
|
@ -1,9 +1,18 @@
|
||||
Path: slsDetectorsPackage/slsReceiverSoftware
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
<<<<<<< HEAD
|
||||
Repsitory UUID: ab06c33107ecfeb4741d49407903ff80286cf75b
|
||||
Revision: 765
|
||||
Branch: developer
|
||||
Last Changed Author: Anna_Bergamaschi
|
||||
Last Changed Rev: 3731
|
||||
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
|
||||
|
@ -33,12 +33,18 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
* @param freq pointer to streaming frequency
|
||||
* @param timer pointer to timer if streaming frequency is random
|
||||
* @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,
|
||||
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*),
|
||||
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);
|
||||
|
||||
/**
|
||||
@ -393,10 +399,38 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
* detType is the detector type see :: detectorType
|
||||
* version is the version number of this structure format
|
||||
* 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*);
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
|
||||
|
@ -166,12 +166,13 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/**
|
||||
* Create and send Json Header
|
||||
* @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 ny number of pixels in y dim
|
||||
* @param dummy true if its a dummy header
|
||||
* @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 */
|
||||
static const std::string TypeName;
|
||||
|
@ -600,12 +600,36 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
* detType is the detector type see :: detectorType
|
||||
* version is the version number of this structure format
|
||||
* 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);
|
||||
|
||||
|
||||
/**
|
||||
* 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:
|
||||
@ -736,10 +760,38 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
* detType is the detector type see :: detectorType
|
||||
* version is the version number of this structure format
|
||||
* 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*);
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
|
||||
|
@ -689,11 +689,37 @@ class UDPInterface {
|
||||
* detType is the detector type see :: detectorType
|
||||
* version is the version number of this structure format
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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:
|
||||
private:
|
||||
|
@ -24,6 +24,7 @@ using namespace rapidjson;
|
||||
#define MAX_STR_LENGTH 1000
|
||||
|
||||
//#define ZMQ_DETAIL
|
||||
#define ROIVERBOSITY
|
||||
|
||||
class ZmqSocket {
|
||||
|
||||
@ -426,7 +427,15 @@ public:
|
||||
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 {
|
||||
cprintf(RED,"Error: Received weird packet size %d for socket %d\n", length, index);
|
||||
memset(buf,0xFF,size);
|
||||
|
@ -1,6 +1,7 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "ab06c33107ecfeb4741d49407903ff80286cf75b"
|
||||
#define GITAUTH "Anna_Bergamaschi"
|
||||
#define GITREV 0x3731
|
||||
#define GITDATE 0x20180315
|
||||
|
||||
#define GITREPUUID "b8bdbf4da61f95b88893b02ddabc2491b16fa10f"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3746
|
||||
#define GITDATE 0x20180327
|
||||
#define GITBRANCH "developer"
|
||||
|
@ -91,11 +91,37 @@ class slsReceiver : private virtual slsReceiverDefs {
|
||||
* detType is the detector type see :: detectorType
|
||||
* version is the version number of this structure format
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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:
|
||||
|
@ -95,9 +95,36 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
|
||||
* dataPointer is the pointer to the data
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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:
|
||||
|
||||
/**
|
||||
@ -344,10 +371,36 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
|
||||
* detType is the detector type see :: detectorType
|
||||
* version is the version number of this structure format
|
||||
* 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*);
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
|
||||
|
@ -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,
|
||||
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
|
||||
slsReceiver* receiver;
|
||||
};
|
||||
|
@ -35,8 +35,13 @@ bool DataProcessor::SilentMode(false);
|
||||
|
||||
DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
|
||||
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*),
|
||||
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) :
|
||||
|
||||
ThreadObject(NumberofDataProcessors),
|
||||
@ -61,6 +66,7 @@ DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool fwenable, bool* d
|
||||
numFramesCaught(0),
|
||||
currentFrameIndex(0),
|
||||
rawDataReadyCallBack(dataReadycb),
|
||||
rawDataModifyReadyCallBack(dataModifyReadycb),
|
||||
pRawDataReady(pDataReadycb)
|
||||
{
|
||||
if(ThreadObject::CreateThread()){
|
||||
@ -316,7 +322,7 @@ void DataProcessor::ThreadExecution() {
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessAnImage(buffer + FIFO_HEADER_NUMBYTES);
|
||||
ProcessAnImage(buffer);
|
||||
|
||||
//stream (if time/freq to stream) or free
|
||||
if (*dataStreamEnable && SendToStreamer())
|
||||
@ -348,7 +354,7 @@ void DataProcessor::StopProcessing(char* buf) {
|
||||
/** buf includes only the standard header */
|
||||
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;
|
||||
currentFrameIndex = fnum;
|
||||
uint32_t nump = header->packetNumber;
|
||||
@ -381,7 +387,7 @@ void DataProcessor::ProcessAnImage(char* buf) {
|
||||
}
|
||||
|
||||
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]
|
||||
if (xcoordin1D) {
|
||||
@ -409,14 +415,36 @@ void DataProcessor::ProcessAnImage(char* buf) {
|
||||
header->roundRNumber,
|
||||
header->detType,
|
||||
header->version,
|
||||
buf + sizeof(sls_detector_header),
|
||||
generalData->imageSize,
|
||||
buf + FIFO_HEADER_NUMBYTES + sizeof(sls_detector_header),
|
||||
(uint32_t)(*((uint32_t*)buf)),
|
||||
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)
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ void DataStreamer::ThreadExecution() {
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessAnImage(buffer + FIFO_HEADER_NUMBYTES);
|
||||
ProcessAnImage(buffer);
|
||||
|
||||
//free
|
||||
fifo->FreeAddress(buffer);
|
||||
@ -216,7 +216,7 @@ void DataStreamer::StopProcessing(char* buf) {
|
||||
#endif
|
||||
sls_detector_header* header = (sls_detector_header*) (buf);
|
||||
//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);
|
||||
|
||||
fifo->FreeAddress(buf);
|
||||
@ -229,7 +229,7 @@ void DataStreamer::StopProcessing(char* buf) {
|
||||
/** buf includes only the standard header */
|
||||
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;
|
||||
#ifdef VERBOSE
|
||||
cprintf(MAGENTA,"DataStreamer %d: fnum:%lu\n", index,fnum);
|
||||
@ -245,11 +245,11 @@ void DataStreamer::ProcessAnImage(char* buf) {
|
||||
//shortframe gotthard
|
||||
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",
|
||||
(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))
|
||||
cprintf(RED,"Error: Could not send zmq data for fnum %lld and streamer %d\n",
|
||||
(long long int) fnum, index);
|
||||
@ -259,11 +259,11 @@ void DataStreamer::ProcessAnImage(char* buf) {
|
||||
//normal
|
||||
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",
|
||||
(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",
|
||||
(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)
|
||||
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;
|
||||
|
||||
return zmqSocket->SendHeaderData(index, dummy, SLS_DETECTOR_JSON_HEADER_VERSION, *dynamicRange, *fileIndex,
|
||||
nx, ny,generalData->imageSize,
|
||||
nx, ny, size,
|
||||
acquisitionIndex, frameIndex, fileNametoStream,
|
||||
header->frameNumber, header->expLength, header->packetNumber, header->bunchId, header->timestamp,
|
||||
header->modId, header->xCoord, header->yCoord, header->zCoord,
|
||||
|
@ -30,6 +30,7 @@ UDPBaseImplementation::UDPBaseImplementation(){
|
||||
acquisitionFinishedCallBack = NULL;
|
||||
pAcquisitionFinished = NULL;
|
||||
rawDataReadyCallBack = NULL;
|
||||
rawDataModifyReadyCallBack = NULL;
|
||||
pRawDataReady = NULL;
|
||||
}
|
||||
|
||||
@ -614,10 +615,19 @@ void UDPBaseImplementation::registerCallBackAcquisitionFinished(void (*func)(uin
|
||||
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){
|
||||
rawDataReadyCallBack=func;
|
||||
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
|
||||
|
@ -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));
|
||||
dataProcessor.push_back(new DataProcessor(fifo[i], &fileFormatType,
|
||||
fileWriteEnable, &dataStreamEnable, &gapPixelsEnable, &dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS,
|
||||
rawDataReadyCallBack,pRawDataReady));
|
||||
rawDataReadyCallBack, rawDataModifyReadyCallBack, pRawDataReady));
|
||||
if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) {
|
||||
FILE_LOG(logERROR) << "Could not create listener/dataprocessor threads (index:" << i << ")";
|
||||
for (vector<Listener*>::const_iterator it = listener.begin(); it != listener.end(); ++it)
|
||||
|
@ -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,
|
||||
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,
|
||||
"#### %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",
|
||||
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
|
||||
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
|
||||
((uint8_t)(*((uint8_t*)(datapointer)))), datasize);
|
||||
((uint8_t)(*((uint8_t*)(datapointer)))), *datasize);
|
||||
|
||||
}
|
||||
*/
|
||||
|
@ -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){
|
||||
//tcpipInterface
|
||||
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);
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int &success, UDPInterface*
|
||||
acquisitionFinishedCallBack = NULL;
|
||||
pAcquisitionFinished = NULL;
|
||||
rawDataReadyCallBack = NULL;
|
||||
rawDataModifyReadyCallBack = NULL;
|
||||
pRawDataReady = NULL;
|
||||
|
||||
unsigned short int port_no=portNumber;
|
||||
@ -152,8 +153,7 @@ void slsReceiverTCPIPInterface::stop(){
|
||||
|
||||
|
||||
int64_t slsReceiverTCPIPInterface::getReceiverVersion(){
|
||||
int64_t retval = GITREV;
|
||||
retval= (retval <<32) | GITDATE;
|
||||
int64_t retval = GITDATE;
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -170,12 +170,21 @@ void slsReceiverTCPIPInterface::registerCallBackAcquisitionFinished(void (*func)
|
||||
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){
|
||||
rawDataReadyCallBack=func;
|
||||
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);
|
||||
if(rawDataReadyCallBack)
|
||||
receiverBase->registerCallBackRawDataReady(rawDataReadyCallBack,pRawDataReady);
|
||||
if(rawDataModifyReadyCallBack)
|
||||
receiverBase->registerCallBackRawDataModifyReady(rawDataModifyReadyCallBack,pRawDataReady);
|
||||
}
|
||||
myDetectorType = dr;
|
||||
ret = receiverBase->setDetectorType(myDetectorType);
|
||||
|
@ -35,3 +35,8 @@ void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(uint64_t frameN
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user