mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
Compare commits
119 Commits
Author | SHA1 | Date | |
---|---|---|---|
6f7c31b747 | |||
75c2d987c4 | |||
726f5eba29 | |||
4404ee717a | |||
54530ab103 | |||
6126780660 | |||
9b7f9b1be1 | |||
26c829d766 | |||
3fde5c5b55 | |||
3e5f546ebe | |||
9833a7d330 | |||
8f9155e578 | |||
9df1eac3c1 | |||
5ededf9be4 | |||
3e8774798a | |||
8c1974b34e | |||
d89d349247 | |||
910961cf41 | |||
595b7aa5e8 | |||
f72ad4326f | |||
2306e44ae3 | |||
287efde54a | |||
faa25b9e9f | |||
1b92b01a46 | |||
4849063b6c | |||
5cd020ae81 | |||
160fabe02c | |||
90dd8e70e5 | |||
08e121c71f | |||
cb3b337a99 | |||
5d9a952316 | |||
8cc05c5848 | |||
d69d69e892 | |||
07a120fc4a | |||
11e8796847 | |||
f79b009978 | |||
3259bfb008 | |||
934bc5b9db | |||
6d11faed87 | |||
35fc52dae7 | |||
e599bfe56f | |||
764becc271 | |||
7462d1002d | |||
834794ad98 | |||
56c504abbb | |||
4d6346e678 | |||
dc7e448759 | |||
e658cbacda | |||
1e6c6dea71 | |||
0e5d4d1d8e | |||
a2986784d3 | |||
975cbb576e | |||
e48a92d9cd | |||
befdcf7f36 | |||
02f5c472a8 | |||
75ed2cd2e4 | |||
3be045f9b6 | |||
8fae982802 | |||
128ec88b5f | |||
d5fc158330 | |||
864e6e4c81 | |||
343d96ff16 | |||
4142328437 | |||
6c797988c7 | |||
215c262981 | |||
081b809078 | |||
9263567cd8 | |||
58e90a85be | |||
025c836e25 | |||
5d5abae3f4 | |||
e2ad46386e | |||
308d44e452 | |||
69da61b1fb | |||
460168ce04 | |||
4e429c0d77 | |||
bf4fab549d | |||
f7705eb1da | |||
a2217e2066 | |||
aaa02706fc | |||
6a80bc5b54 | |||
b9275646ad | |||
9e2f2697c7 | |||
b6b0df62b6 | |||
0ba537e479 | |||
75ddf535dc | |||
b1de501bef | |||
0f3a63f101 | |||
3b4b2d707f | |||
f405aa1733 | |||
df0fdb7ecb | |||
91b7a87557 | |||
9468b9ca1e | |||
d7982e178e | |||
9cf5714a5b | |||
0c9ac8911a | |||
4730c8c0a9 | |||
43efb8acfd | |||
6ecca8fcb0 | |||
17cb63a57f | |||
4f83fcb001 | |||
ab94af6d29 | |||
7c725cc69b | |||
f0198d2d2e | |||
5ddccbdee4 | |||
8fb39b8c7e | |||
bd5293f4b1 | |||
b91180f5b2 | |||
7c3b5065a5 | |||
9aef802bea | |||
f7d85231f2 | |||
5b3a911e8d | |||
65f5e1c1ab | |||
839896c7e6 | |||
4a7e246604 | |||
7f293115c4 | |||
f59f40a659 | |||
64fd82f92c | |||
cd232fd732 | |||
172fa66b1f |
65
RELEASE.txt
65
RELEASE.txt
@ -1,31 +1,72 @@
|
||||
SLS Detector Package 3.1.1 released on 2018-03-20
|
||||
SLS Detector Package 3.1.4 released on 2018-08-17
|
||||
=================================================
|
||||
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
This document describes the differences between 3.1.0 into 3.1.0 releases.
|
||||
This document describes the differences between 3.1.4 into 3.1.3 releases.
|
||||
|
||||
|
||||
Topics Concerning
|
||||
==================
|
||||
Jungfrau adcphase
|
||||
Eiger in 10 GbE mode
|
||||
- get settings in users class
|
||||
- HDF5 in Receiver
|
||||
- gotthard timer accuracy
|
||||
|
||||
|
||||
Resolved Issues
|
||||
===============
|
||||
|
||||
Detector Server and Client
|
||||
--------------------------
|
||||
1. (Jungfrau) Bug fix: Same adc phase given to the PLL will still shift
|
||||
adc by one step. One can now give same adc phase repeatedly.
|
||||
Client
|
||||
------
|
||||
1. Users class setSettings(-1) gave undefined settings. Has been fixed.
|
||||
|
||||
Updated Command Line Manual for adcphase and clkdivider.
|
||||
2. Users class timers give more precise values now.
|
||||
|
||||
3. When deleting slsDetector object, Stop socket deletion includes a close on
|
||||
default file descriptor zero (which it didn't open, just set for flag).
|
||||
This is fixed with temporary solution, to connect stop socket at checkOnline
|
||||
to set file descriptor to the right one. Later releases will use exception
|
||||
to handle constructor error flags.
|
||||
|
||||
|
||||
Detector Server
|
||||
---------------
|
||||
1. (Gotthard) Timers converted from time in nanoseconds to number of cycles
|
||||
is made more precise now. Clock value changed from 32.1E+6 to 32.007729E+6.
|
||||
|
||||
|
||||
Receiver
|
||||
--------
|
||||
1. Jungfrau Single Module Master files did not link to the HDF5 data file properly.
|
||||
This is fixed now.
|
||||
|
||||
2. Relative linking is used in the HDF5, instead of absolute now.
|
||||
|
||||
|
||||
|
||||
New Features
|
||||
============
|
||||
|
||||
Client
|
||||
------
|
||||
1. Timers can be set/retrieved individually. It has been introduced because
|
||||
Gotthard 25um can have different delays for master and slave modules.
|
||||
|
||||
Receiver
|
||||
--------
|
||||
1. HDF5 x dimension (#images). Max made unlimited. Chunked Dataset by default.
|
||||
|
||||
When receiver gets an image more than #frames, the HDF5 dataset will
|
||||
extend itself in the x dimension by another #frames. So, one can do
|
||||
(in Jungfrau, Gotthard, NOT Eiger)
|
||||
sls_detector_put resetframescaught 0
|
||||
sls_detector_put receiver start
|
||||
sls_detector_put status start
|
||||
sls_detector_put status start
|
||||
...
|
||||
sls_detector_put receiver stop
|
||||
|
||||
2. (Eiger) Bug Fix: This bug was introduced in 3.1.0 release.
|
||||
In 10GbE mode, if "detectorip" is before "tengiga", the detector still
|
||||
used the 1G IP (DHCP IP). This is fixed in this release.
|
||||
|
||||
|
||||
|
@ -71,11 +71,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
/** - registering data callback */
|
||||
pDetector->registerDataCallback(&dataCallback, NULL);
|
||||
/** - if receiver exists, enable data streaming from receiver to get the data */
|
||||
pDetector->enableDataStreamingFromReceiver(1);
|
||||
/** - create zmq sockets in client to enable data streaming in of data from receiver/different process */
|
||||
pDetector->enableDataStreamingToClient(1);
|
||||
|
||||
|
||||
|
||||
/** - ensuring detector status is idle before starting acquisition. exiting if not idle */
|
||||
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1
|
1
serverBin/gotthardDetectorServerv3.1.4.0
Symbolic link
1
serverBin/gotthardDetectorServerv3.1.4.0
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.4.0
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.1.0
|
1
serverBin/jungfrauDetectorServerv3.1.3.0
Symbolic link
1
serverBin/jungfrauDetectorServerv3.1.3.0
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.3.0
|
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorGui
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105
|
||||
Revision: 452
|
||||
Branch: 3.1.0-rc
|
||||
Last Changed Author: Erik_Frojdh
|
||||
Last Changed Rev: 3458
|
||||
Last Changed Date: 2018-03-09 10:55:40.000000002 +0100 ./src/qTabSettings.cpp
|
||||
Repsitory UUID: 1b92b01a466aa1986b8198700274af75477a1e54
|
||||
Revision: 455
|
||||
Branch: 3.1.4
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3492
|
||||
Last Changed Date: 2018-08-17 16:36:24.000000002 +0200 ./src/qTabSettings.cpp
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105"
|
||||
#define GITAUTH "Erik_Frojdh"
|
||||
#define GITREV 0x3458
|
||||
#define GITDATE 0x20180309
|
||||
#define GITBRANCH "3.1.0-rc"
|
||||
#define GITREPUUID "1b92b01a466aa1986b8198700274af75477a1e54"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3492
|
||||
#define GITDATE 0x20180817
|
||||
#define GITBRANCH "3.1.4"
|
||||
|
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 85aa47b8353bb84f52c435a967a03ddf46af5dd1
|
||||
Revision: 1716
|
||||
Branch: 3.1.1-rc
|
||||
Repsitory UUID: 1b92b01a466aa1986b8198700274af75477a1e54
|
||||
Revision: 1726
|
||||
Branch: 3.1.4
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3465
|
||||
Last Changed Date: 2018-03-19 18:13:27.000000002 +0100 ./threadFiles/ThreadPool.o
|
||||
Last Changed Rev: 3492
|
||||
Last Changed Date: 2018-08-17 17:57:11.000000002 +0200 ./threadFiles/ThreadPool.o
|
||||
|
@ -905,21 +905,16 @@ int64_t getFrames(){
|
||||
|
||||
int64_t setExposureTime(int64_t value){
|
||||
/* time is in ns */
|
||||
if (value!=-1) {
|
||||
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||
value*=(1E-9*CLK_FREQ);
|
||||
if(fabs(actualvalue-value)>= 0.5){
|
||||
if(actualvalue > value)
|
||||
value++;
|
||||
else
|
||||
value--;
|
||||
}
|
||||
if (value != -1) {
|
||||
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
|
||||
}
|
||||
return set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (set64BitReg(value,SET_EXPTIME_LSB_REG, SET_EXPTIME_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t getExposureTime(){
|
||||
return get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_EXPTIME_LSB_REG, GET_EXPTIME_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t setGates(int64_t value){
|
||||
@ -933,23 +928,16 @@ int64_t getGates(){
|
||||
int64_t setPeriod(int64_t value){
|
||||
/* time is in ns */
|
||||
if (value!=-1) {
|
||||
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||
value*=(1E-9*CLK_FREQ);
|
||||
if(fabs(actualvalue-value)>= 0.5){
|
||||
if(actualvalue > value)
|
||||
value++;
|
||||
else
|
||||
value--;
|
||||
}
|
||||
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (set64BitReg(value,SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t getPeriod(){
|
||||
return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t setDelay(int64_t value){
|
||||
@ -959,16 +947,11 @@ int64_t setDelay(int64_t value){
|
||||
value += masterdefaultdelay;
|
||||
cprintf(BLUE,"Actual delay for master: %lld\n", (long long int) value);
|
||||
}
|
||||
double actualvalue = value*(1E-9*CLK_FREQ);
|
||||
value*=(1E-9*CLK_FREQ);
|
||||
if(fabs(actualvalue-value)>= 0.5){
|
||||
if(actualvalue > value)
|
||||
value++;
|
||||
else
|
||||
value--;
|
||||
}
|
||||
value = (value * 1E-3 * CLK_FREQ ) + 0.5;
|
||||
}
|
||||
int64_t retval = set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
|
||||
int64_t retval = (set64BitReg(value,SET_DELAY_LSB_REG, SET_DELAY_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
if (masterflags == IS_MASTER) {
|
||||
cprintf(BLUE,"Actual delay read from master: %lld\n", (long long int) retval);
|
||||
retval -= masterdefaultdelay;
|
||||
@ -978,7 +961,8 @@ int64_t setDelay(int64_t value){
|
||||
}
|
||||
|
||||
int64_t getDelay(){
|
||||
return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t setTrains(int64_t value){
|
||||
@ -996,37 +980,26 @@ int64_t setProbes(int64_t value){
|
||||
|
||||
|
||||
int64_t setProgress() {
|
||||
|
||||
//????? eventually call after setting the registers
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int64_t getProgress() {
|
||||
|
||||
|
||||
//should be done in firmware!!!!
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int64_t getActualTime(){
|
||||
return get64BitReg(GET_ACTUAL_TIME_LSB_REG, GET_ACTUAL_TIME_MSB_REG)/(1E-9*CLK_FREQ);
|
||||
return (get64BitReg(GET_ACTUAL_TIME_LSB_REG, GET_ACTUAL_TIME_MSB_REG) /
|
||||
(1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
int64_t getMeasurementTime(){
|
||||
int64_t v=get64BitReg(GET_MEASUREMENT_TIME_LSB_REG, GET_MEASUREMENT_TIME_MSB_REG);
|
||||
/* u_int64_t mask=0x8000000000000000;
|
||||
if (v & mask ) {
|
||||
#ifdef VERBOSE
|
||||
printf("no measurement time left\n");
|
||||
#endif
|
||||
return -1E+9;
|
||||
} else*/
|
||||
return v/(1E-9*CLK_FREQ);
|
||||
return (v / (1E-3 * CLK_FREQ)) + 0.5;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 675d69392a6497d42b23057c7c8783c8dad768d0
|
||||
Revision: 223
|
||||
Branch: 3.1.0-rc
|
||||
Repsitory UUID: d69d69e8928f90b053a0e5ffccb9cfc4e9c5f960
|
||||
Revision: 225
|
||||
Branch: 3.1.4-rc
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3447
|
||||
Last Changed Date: 2018-02-27 14:04:08.000000002 +0100 ./server_funcs.c
|
||||
Last Changed Rev: 3483
|
||||
Last Changed Date: 2018-07-25 14:56:37.000000002 +0200 ./firmware_funcs.c
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "675d69392a6497d42b23057c7c8783c8dad768d0"
|
||||
#define GITREPUUID "d69d69e8928f90b053a0e5ffccb9cfc4e9c5f960"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3447
|
||||
#define GITDATE 0x20180227
|
||||
#define GITBRANCH "3.1.0-rc"
|
||||
#define GITREV 0x3483
|
||||
#define GITDATE 0x20180725
|
||||
#define GITBRANCH "3.1.4-rc"
|
||||
|
Binary file not shown.
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.4.0
Executable file
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.4.0
Executable file
Binary file not shown.
@ -54,7 +54,7 @@
|
||||
#define DEBUGOUT
|
||||
#endif
|
||||
|
||||
#define CLK_FREQ 32.1E+6
|
||||
#define CLK_FREQ 32.007729
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -75,8 +75,8 @@
|
||||
#define TIME_FROM_START_MSB_REG (0x11 << 11)
|
||||
|
||||
/* Get Delay 64 bit register */
|
||||
#define GET_DELAY_LSB_REG (0x12 << 11)
|
||||
#define GET_DELAY_MSB_REG (0x13 << 11)
|
||||
#define GET_DELAY_LSB_REG (0x12 << 11) // different kind of delay
|
||||
#define GET_DELAY_MSB_REG (0x13 << 11) // different kind of delay
|
||||
|
||||
/* Get Cycles 64 bit register */
|
||||
#define GET_CYCLES_LSB_REG (0x14 << 11)
|
||||
@ -321,8 +321,8 @@
|
||||
|
||||
|
||||
/* Set Delay 64 bit register */
|
||||
#define SET_DELAY_LSB_REG (0x60 << 11)
|
||||
#define SET_DELAY_MSB_REG (0x61 << 11)
|
||||
#define SET_DELAY_LSB_REG (0x60 << 11) // different kind of delay
|
||||
#define SET_DELAY_MSB_REG (0x61 << 11) // different kind of delay
|
||||
|
||||
/* Set Cycles 64 bit register */
|
||||
#define SET_CYCLES_LSB_REG (0x62 << 11)
|
||||
|
Binary file not shown.
BIN
slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.3.0
Executable file
BIN
slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.3.0
Executable file
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: 85aa47b8353bb84f52c435a967a03ddf46af5dd1
|
||||
Revision: 118
|
||||
Branch: 3.1.1-rc
|
||||
Repsitory UUID: e599bfe56f512ea6a262483f61ffd8d67d6c6fcd
|
||||
Revision: 119
|
||||
Branch: 3.1.3
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3465
|
||||
Last Changed Date: 2018-03-19 17:26:38.000000002 +0100 ./RegisterDefs.h
|
||||
Last Changed Rev: 3475
|
||||
Last Changed Date: 2018-06-28 15:11:57.000000002 +0200 ./RegisterDefs.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "85aa47b8353bb84f52c435a967a03ddf46af5dd1"
|
||||
#define GITREPUUID "e599bfe56f512ea6a262483f61ffd8d67d6c6fcd"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3465
|
||||
#define GITDATE 0x20180319
|
||||
#define GITBRANCH "3.1.1-rc"
|
||||
#define GITREV 0x3475
|
||||
#define GITDATE 0x20180628
|
||||
#define GITBRANCH "3.1.3"
|
||||
|
@ -155,18 +155,21 @@ int testBus() {
|
||||
printf("\nTesting Bus...\n");
|
||||
|
||||
int ret = OK;
|
||||
u_int32_t addr = SET_DELAY_LSB_REG;
|
||||
u_int32_t addr = SET_TRIGGER_DELAY_LSB_REG;
|
||||
int times = 1000 * 1000;
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < times; ++i) {
|
||||
bus_w(addr, i * 100);
|
||||
if (i * 100 != bus_r(SET_DELAY_LSB_REG)) {
|
||||
cprintf(RED,"ERROR: Mismatch! Wrote 0x%x, read 0x%x\n", i * 100, bus_r(SET_DELAY_LSB_REG));
|
||||
if (i * 100 != bus_r(addr)) {
|
||||
cprintf(RED,"ERROR: Mismatch! Wrote 0x%x, read 0x%x\n",
|
||||
i * 100, bus_r(addr));
|
||||
ret = FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
bus_w(addr, 0);
|
||||
|
||||
if (ret == OK)
|
||||
printf("Successfully tested bus %d times\n", times);
|
||||
return ret;
|
||||
@ -697,12 +700,12 @@ int64_t getTimeLeft(enum timerIndex ind){
|
||||
retval = get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-3 * CLK_SYNC);
|
||||
printf("Getting period left: %lldns\n", (long long int)retval);
|
||||
break;
|
||||
|
||||
/*
|
||||
case DELAY_AFTER_TRIGGER:
|
||||
retval = get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) / (1E-3 * CLK_SYNC);
|
||||
retval = get64BitReg(xxx) / (1E-3 * CLK_SYNC);
|
||||
printf("Getting delay left: %lldns\n", (long long int)retval);
|
||||
break;
|
||||
|
||||
*/
|
||||
case CYCLES_NUMBER:
|
||||
retval = get64BitReg(GET_CYCLES_LSB_REG, GET_CYCLES_MSB_REG);
|
||||
printf("Getting number of cycles left: %lld\n", (long long int)retval);
|
||||
|
@ -1974,10 +1974,26 @@ void multiSlsDetector::resetFinalDataQueue() {
|
||||
GATE_INTEGRATED_TIME
|
||||
}
|
||||
*/
|
||||
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t){
|
||||
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int imod){
|
||||
|
||||
int64_t ret=-100;
|
||||
|
||||
// single (for gotthard 25 um)
|
||||
if (imod != -1) {
|
||||
if (imod >= 0 && imod < thisMultiDetector->numberOfDetectors) {
|
||||
if (detectors[imod]) {
|
||||
ret = detectors[imod]->setTimer(index,t,imod);
|
||||
if(detectors[imod]->getErrorMask())
|
||||
setErrorMask(getErrorMask()|(1<<imod));
|
||||
return ret;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// multi
|
||||
if(!threadpool){
|
||||
cout << "Error in creating threadpool. Exiting" << endl;
|
||||
return -1;
|
||||
@ -1987,8 +2003,8 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t){
|
||||
for(int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet){
|
||||
if(detectors[idet]){
|
||||
iret[idet]= new int64_t(-1);
|
||||
Task* task = new Task(new func2_t<int64_t,timerIndex,int64_t>(&slsDetector::setTimer,
|
||||
detectors[idet],index,t,iret[idet]));
|
||||
Task* task = new Task(new func3_t<int64_t,timerIndex,int64_t,int>(&slsDetector::setTimer,
|
||||
detectors[idet],index,t,imod,iret[idet]));
|
||||
threadpool->add_task(task);
|
||||
}
|
||||
}
|
||||
|
@ -688,9 +688,10 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
set/get timer value
|
||||
\param index timer index
|
||||
\param t time in ns or number of...(e.g. frames, gates, probes)
|
||||
\param imod module number (gotthard delay can have different values)
|
||||
\returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
||||
*/
|
||||
int64_t setTimer(timerIndex index, int64_t t=-1);
|
||||
int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1);
|
||||
/**
|
||||
set/get timer value
|
||||
\param index timer index
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "85aa47b8353bb84f52c435a967a03ddf46af5dd1"
|
||||
#define GITREPUUID "1b92b01a466aa1986b8198700274af75477a1e54"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3465
|
||||
#define GITDATE 0x20180319
|
||||
#define GITBRANCH "3.1.1-rc"
|
||||
#define GITREV 0x3492
|
||||
#define GITDATE 0x20180817
|
||||
#define GITBRANCH "3.1.4"
|
||||
|
@ -270,7 +270,10 @@ slsDetector::~slsDetector(){
|
||||
else
|
||||
printf("Shared memory %d detached\n", shmId);
|
||||
#endif
|
||||
delete thisReceiver;
|
||||
if(controlSocket) delete controlSocket;
|
||||
if(stopSocket) delete stopSocket;
|
||||
if(dataSocket) delete dataSocket;
|
||||
if(thisReceiver) delete thisReceiver;
|
||||
};
|
||||
|
||||
slsDetector::slsDetector(int pos, char *name, int id, int cport,multiSlsDetector *p) : slsDetectorUtils(),
|
||||
@ -1318,6 +1321,26 @@ string slsDetector::checkOnline() {
|
||||
disconnectControl();
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "online!" << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
//still cannot connect to socket, controlSocket=0
|
||||
if(stopSocket){
|
||||
if (connectStop() == FAIL) {
|
||||
stopSocket->SetTimeOut(5);
|
||||
thisDetector->onlineFlag=OFFLINE_FLAG;
|
||||
delete stopSocket;
|
||||
stopSocket=NULL;
|
||||
retval = string(thisDetector->hostname);
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "stop offline!" << std::endl;
|
||||
#endif
|
||||
} else {
|
||||
thisDetector->onlineFlag=ONLINE_FLAG;
|
||||
stopSocket->SetTimeOut(100);
|
||||
disconnectStop();
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "stop online!" << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -3698,6 +3721,9 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
||||
std::cout<< "slsDetector setSettings "<< std::endl;
|
||||
#endif
|
||||
|
||||
if (isettings == -1)
|
||||
return getSettings(imod);
|
||||
|
||||
//only set client shared memory variable for Eiger, settings threshold loads the module data (trimbits, dacs etc.)
|
||||
if (thisDetector->myDetectorType == EIGER) {
|
||||
switch(isettings) {
|
||||
@ -4583,7 +4609,7 @@ int slsDetector::startAndReadAllNoWait(){
|
||||
GATE_INTEGRATED_TIME
|
||||
}
|
||||
*/
|
||||
int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
int64_t slsDetector::setTimer(timerIndex index, int64_t t, int imod){
|
||||
|
||||
|
||||
int fnum=F_SET_TIMER,fnum2=F_SET_RECEIVER_TIMER;
|
||||
@ -7392,7 +7418,7 @@ int slsDetector::programFPGA(string fname){
|
||||
#endif
|
||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||
if (connectControl() == OK){
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));cprintf(BG_RED,"size of filesize:%lu\n",sizeof(filesize));
|
||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
controlSocket->SendDataOnly(&filesize,sizeof(filesize));
|
||||
//check opening error
|
||||
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
|
@ -1205,9 +1205,10 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
set/get timer value
|
||||
\param index timer index
|
||||
\param t time in ns or number of...(e.g. frames, gates, probes)
|
||||
\param imod module number (pointless in slsDetector)
|
||||
\returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
||||
*/
|
||||
int64_t setTimer(timerIndex index, int64_t t=-1);
|
||||
int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1);
|
||||
|
||||
/**
|
||||
get current timer value
|
||||
|
@ -369,16 +369,17 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
||||
set/get timer value
|
||||
\param index timer index
|
||||
\param t time in ns or number of...(e.g. frames, gates, probes)
|
||||
\param imod module number
|
||||
\returns timer set value in ns or number of...(e.g. frames, gates, probes)
|
||||
*/
|
||||
virtual int64_t setTimer(timerIndex index, int64_t t=-1)=0;
|
||||
int64_t setExposureTime(int64_t t=-1){return setTimer(ACQUISITION_TIME,t);};
|
||||
int64_t setSubFrameExposureTime(int64_t t=-1){return setTimer(SUBFRAME_ACQUISITION_TIME,t);};
|
||||
int64_t setExposurePeriod(int64_t t=-1){return setTimer(FRAME_PERIOD,t);};
|
||||
int64_t setDelayAfterTrigger(int64_t t=-1){return setTimer(DELAY_AFTER_TRIGGER,t);};
|
||||
int64_t setNumberOfGates(int64_t t=-1){return setTimer(GATES_NUMBER,t);};
|
||||
int64_t setNumberOfFrames(int64_t t=-1){return setTimer(FRAME_NUMBER,t);};
|
||||
int64_t setNumberOfCycles(int64_t t=-1){return setTimer(CYCLES_NUMBER,t);};
|
||||
virtual int64_t setTimer(timerIndex index, int64_t t=-1, int imod = -1) = 0;
|
||||
int64_t setExposureTime(int64_t t=-1, int imod = -1){return setTimer(ACQUISITION_TIME,t,imod);};
|
||||
int64_t setSubFrameExposureTime(int64_t t=-1, int imod = -1){return setTimer(SUBFRAME_ACQUISITION_TIME,t,imod);};
|
||||
int64_t setExposurePeriod(int64_t t=-1, int imod = -1){return setTimer(FRAME_PERIOD,t,imod);};
|
||||
int64_t setDelayAfterTrigger(int64_t t=-1, int imod = -1){return setTimer(DELAY_AFTER_TRIGGER,t,imod);};
|
||||
int64_t setNumberOfGates(int64_t t=-1, int imod = -1){return setTimer(GATES_NUMBER,t,imod);};
|
||||
int64_t setNumberOfFrames(int64_t t=-1, int imod = -1){return setTimer(FRAME_NUMBER,t,imod);};
|
||||
int64_t setNumberOfCycles(int64_t t=-1, int imod = -1){return setTimer(CYCLES_NUMBER,t,imod);};
|
||||
|
||||
|
||||
/** sets/gets the value of important readout speed parameters
|
||||
|
@ -5464,11 +5464,8 @@ string slsDetectorCommand::cmdTimer(int narg, char *args[], int action) {
|
||||
else
|
||||
return string("cannot scan timer value ")+string(args[1]);
|
||||
if (index==ACQUISITION_TIME || index==SUBFRAME_ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER) {
|
||||
// t=(int64_t)(val*1E+9); for precision of eg.0.0000325, following done
|
||||
val*=1E9;
|
||||
t = (int64_t)val;
|
||||
if(fabs(val-t)) // to validate precision loss
|
||||
t = t + val - t; //even t += vak-t loses precision
|
||||
// +0.5 for precision of eg.0.0000325
|
||||
t = ( val * 1E9 + 0.5);
|
||||
}else t=(int64_t)val;
|
||||
}
|
||||
|
||||
|
@ -151,43 +151,58 @@ int slsDetectorUsers::setThresholdEnergy(int e_eV){
|
||||
return myDetector->setThresholdEnergy(e_eV);
|
||||
}
|
||||
|
||||
double slsDetectorUsers::setExposureTime(double t, bool inseconds){
|
||||
int64_t tms = (int64_t)(t * (1E+9));
|
||||
if (t < 0) tms = -1;
|
||||
double slsDetectorUsers::setExposureTime(double t, bool inseconds, int imod){
|
||||
if(!inseconds)
|
||||
return myDetector->setExposureTime((int64_t)t);
|
||||
else
|
||||
return ((1E-9) * (double)myDetector->setExposureTime(tms));
|
||||
return myDetector->setExposureTime((int64_t)t,imod);
|
||||
else {
|
||||
// + 0.5 to round for precision lost from converting double to int64_t
|
||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||
if (t < 0) tms = -1;
|
||||
tms = myDetector->setExposureTime(tms,imod);
|
||||
if (tms < 0)
|
||||
return -1;
|
||||
return ((1E-9) * (double)tms);
|
||||
}
|
||||
}
|
||||
|
||||
double slsDetectorUsers::setExposurePeriod(double t, bool inseconds){
|
||||
int64_t tms = (int64_t)(t * (1E+9));
|
||||
if (t < 0) tms = -1;
|
||||
double slsDetectorUsers::setExposurePeriod(double t, bool inseconds, int imod){
|
||||
if(!inseconds)
|
||||
return myDetector->setExposurePeriod((int64_t)t);
|
||||
else
|
||||
return ((1E-9) * (double)myDetector->setExposurePeriod(tms));
|
||||
return myDetector->setExposurePeriod((int64_t)t,imod);
|
||||
else {
|
||||
// + 0.5 to round for precision lost from converting double to int64_t
|
||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||
if (t < 0) tms = -1;
|
||||
tms = myDetector->setExposurePeriod(tms,imod);
|
||||
if (tms < 0)
|
||||
return -1;
|
||||
return ((1E-9) * (double)tms);
|
||||
}
|
||||
}
|
||||
|
||||
double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds){
|
||||
int64_t tms = (int64_t)(t * (1E+9));
|
||||
if (t < 0) tms = -1;
|
||||
double slsDetectorUsers::setDelayAfterTrigger(double t, bool inseconds, int imod){
|
||||
if(!inseconds)
|
||||
return myDetector->setDelayAfterTrigger((int64_t)t);
|
||||
else
|
||||
return ((1E-9) * (double)myDetector->setDelayAfterTrigger(tms));
|
||||
return myDetector->setDelayAfterTrigger((int64_t)t,imod);
|
||||
else {
|
||||
// + 0.5 to round for precision lost from converting double to int64_t
|
||||
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
|
||||
if (t < 0) tms = -1;
|
||||
tms = myDetector->setDelayAfterTrigger(tms,imod);
|
||||
if (tms < 0)
|
||||
return -1;
|
||||
return ((1E-9) * (double)tms);
|
||||
}
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::setNumberOfGates(int64_t t){
|
||||
return myDetector->setNumberOfGates(t);
|
||||
int64_t slsDetectorUsers::setNumberOfGates(int64_t t, int imod){
|
||||
return myDetector->setNumberOfGates(t,imod);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::setNumberOfFrames(int64_t t){
|
||||
return myDetector->setNumberOfFrames(t);
|
||||
int64_t slsDetectorUsers::setNumberOfFrames(int64_t t, int imod){
|
||||
return myDetector->setNumberOfFrames(t,imod);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::setNumberOfCycles(int64_t t){
|
||||
return myDetector->setNumberOfCycles(t);
|
||||
int64_t slsDetectorUsers::setNumberOfCycles(int64_t t, int imod){
|
||||
return myDetector->setNumberOfCycles(t,imod);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setTimingMode(int pol){
|
||||
|
@ -315,47 +315,53 @@ class slsDetectorUsers
|
||||
@short set/get exposure time value
|
||||
\param t time in sn (-1 gets)
|
||||
\param inseconds true if the value is in s, else ns
|
||||
\param imod module number (-1 for all)
|
||||
\returns timer set value in ns, or s if specified
|
||||
*/
|
||||
|
||||
double setExposureTime(double t=-1, bool inseconds=false);
|
||||
double setExposureTime(double t=-1, bool inseconds=false, int imod = -1);
|
||||
|
||||
/**
|
||||
@short set/get exposure period
|
||||
\param t time in ns (-1 gets)
|
||||
\param inseconds true if the value is in s, else ns
|
||||
\param imod module number (-1 for all)
|
||||
\returns timer set value in ns, or s if specified
|
||||
*/
|
||||
double setExposurePeriod(double t=-1, bool inseconds=false);
|
||||
double setExposurePeriod(double t=-1, bool inseconds=false, int imod = -1);
|
||||
|
||||
/**
|
||||
@short set/get delay after trigger
|
||||
\param t time in ns (-1 gets)
|
||||
\param inseconds true if the value is in s, else ns
|
||||
\param imod module number (-1 for all)
|
||||
\returns timer set value in ns, or s if specified
|
||||
*/
|
||||
double setDelayAfterTrigger(double t=-1, bool inseconds=false);
|
||||
double setDelayAfterTrigger(double t=-1, bool inseconds=false, int imod = -1);
|
||||
|
||||
/**
|
||||
@short set/get number of gates
|
||||
\param t number of gates (-1 gets)
|
||||
\param imod module number (-1 for all)
|
||||
\returns number of gates
|
||||
*/
|
||||
int64_t setNumberOfGates(int64_t t=-1);
|
||||
int64_t setNumberOfGates(int64_t t=-1, int imod = -1);
|
||||
|
||||
/**
|
||||
@short set/get number of frames i.e. number of exposure per trigger
|
||||
\param t number of frames (-1 gets)
|
||||
\param imod module number (-1 for all)
|
||||
\returns number of frames
|
||||
*/
|
||||
int64_t setNumberOfFrames(int64_t t=-1);
|
||||
int64_t setNumberOfFrames(int64_t t=-1, int imod = -1);
|
||||
|
||||
/**
|
||||
@short set/get number of cycles i.e. number of triggers
|
||||
\param t number of frames (-1 gets)
|
||||
\param imod module number (-1 for all)
|
||||
\returns number of frames
|
||||
*/
|
||||
int64_t setNumberOfCycles(int64_t t=-1);
|
||||
int64_t setNumberOfCycles(int64_t t=-1, int imod = -1);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2627,36 +2627,50 @@ int get_time_left(int file_des) {
|
||||
printf("getting time left on timer %d \n",ind);
|
||||
#endif
|
||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||
switch(ind) {
|
||||
#ifdef MYTHEND
|
||||
case PROBES_NUMBER:
|
||||
#endif
|
||||
case FRAME_NUMBER:
|
||||
case ACQUISITION_TIME:
|
||||
case FRAME_PERIOD:
|
||||
case DELAY_AFTER_TRIGGER:
|
||||
#ifndef JUNGFRAUD
|
||||
case GATES_NUMBER:
|
||||
#endif
|
||||
case CYCLES_NUMBER:
|
||||
case PROGRESS:
|
||||
case ACTUAL_TIME:
|
||||
case MEASUREMENT_TIME:
|
||||
|
||||
#ifdef JUNGFRAUD
|
||||
case FRAMES_FROM_START:
|
||||
case FRAMES_FROM_START_PG:
|
||||
#endif
|
||||
retval=getTimeLeft(ind);
|
||||
break;
|
||||
default:
|
||||
if (ind == DELAY_AFTER_TRIGGER) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,"Timer Left Index (%d) is not implemented for this detector\n", (int)ind);
|
||||
sprintf(mess,"Timer Left Index (%d) is not implemented for this release.\n", (int)ind);
|
||||
cprintf(RED, "%s", mess);
|
||||
break;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
printf("Time left on timer %d is %lld\n",ind, retval);
|
||||
} else {
|
||||
#endif
|
||||
|
||||
switch(ind) {
|
||||
#ifdef MYTHEND
|
||||
case PROBES_NUMBER:
|
||||
#endif
|
||||
case FRAME_NUMBER:
|
||||
case ACQUISITION_TIME:
|
||||
case FRAME_PERIOD:
|
||||
case DELAY_AFTER_TRIGGER:
|
||||
#ifndef JUNGFRAUD
|
||||
case GATES_NUMBER:
|
||||
#endif
|
||||
case CYCLES_NUMBER:
|
||||
case PROGRESS:
|
||||
case ACTUAL_TIME:
|
||||
case MEASUREMENT_TIME:
|
||||
#ifdef JUNGFRAUD
|
||||
case FRAMES_FROM_START:
|
||||
case FRAMES_FROM_START_PG:
|
||||
#endif
|
||||
retval=getTimeLeft(ind);
|
||||
break;
|
||||
default:
|
||||
ret = FAIL;
|
||||
sprintf(mess,"Timer Left Index (%d) is not implemented for this detector\n", (int)ind);
|
||||
cprintf(RED, "%s", mess);
|
||||
break;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
printf("Time left on timer %d is %lld\n",ind, retval);
|
||||
#endif
|
||||
|
||||
#ifdef JUNGFRAUD
|
||||
} // end of if (ind == DELAY_AFTER_TRIGGER)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
if (ret==OK && differentClients)
|
||||
ret=FORCE_UPDATE;
|
||||
|
@ -15,9 +15,7 @@ receiverInterface::receiverInterface(MySocketTCP *socket):dataSocket(socket){}
|
||||
|
||||
|
||||
|
||||
receiverInterface::~receiverInterface(){
|
||||
delete dataSocket;
|
||||
}
|
||||
receiverInterface::~receiverInterface(){}
|
||||
|
||||
|
||||
|
||||
|
@ -110,7 +110,7 @@ class SuperTask: public virtual slsDetectorDefs {
|
||||
public:
|
||||
SuperTask():
|
||||
m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0),m10(0),m11(0),m12(0),m13(0),m14(0),m15(0),m16(0),m17(0),m18(0){};
|
||||
~SuperTask(){};
|
||||
virtual ~SuperTask(){};
|
||||
protected:
|
||||
/** Function signature defined
|
||||
* First argument is Return type, the remaining are arguments
|
||||
@ -127,7 +127,7 @@ protected:
|
||||
func2_t <int, string,int>* m10;
|
||||
func2_t <dacs_t, dacIndex,int>* m11;
|
||||
func2_t <detectorSettings, detectorSettings,int>* m12;
|
||||
func2_t <int64_t, timerIndex,int64_t>* m13;
|
||||
func3_t <int64_t, timerIndex,int64_t,int>* m13;
|
||||
func2_t <string, networkParameter,string>* m14;
|
||||
func3_t <int, int,int,int>* m15;
|
||||
func4_t <int, trimMode,int,int,int>* m16;
|
||||
@ -152,14 +152,39 @@ public:
|
||||
Task(func2_t <int, string,int>* t): SuperTask(),fnum(10){m10 = t;};
|
||||
Task(func2_t <dacs_t, dacIndex,int>* t): SuperTask(),fnum(11){m11 = t;};
|
||||
Task(func2_t <detectorSettings, detectorSettings,int>* t): SuperTask(),fnum(12){m12 = t;};
|
||||
Task(func2_t <int64_t, timerIndex,int64_t>* t): SuperTask(),fnum(13){m13 = t;};
|
||||
Task(func3_t <int64_t, timerIndex,int64_t,int>* t): SuperTask(),fnum(13){m13 = t;};
|
||||
Task(func2_t <string, networkParameter,string>* t): SuperTask(),fnum(14){m14 = t;};
|
||||
Task(func3_t <int, int,int,int>* t): SuperTask(),fnum(15){m15 = t;};
|
||||
Task(func4_t <int, trimMode,int,int,int>* t): SuperTask(),fnum(16){m16 = t;};
|
||||
Task(func4_t <int, int,int,detectorSettings,int>* t): SuperTask(),fnum(17){m17 = t;};
|
||||
Task(func4_t <dacs_t, dacs_t,dacIndex,int,int>* t): SuperTask(),fnum(18){m18 = t;};
|
||||
|
||||
~Task(){}
|
||||
virtual ~Task(){
|
||||
switch(fnum) {
|
||||
case 1: delete m1; break;
|
||||
case 2: delete m2; break;
|
||||
case 3: delete m3; break;
|
||||
case 4: delete m4; break;
|
||||
case 5: delete m5; break;
|
||||
case 6: delete m6; break;
|
||||
case 7: delete m7; break;
|
||||
case 8: delete m8; break;
|
||||
case 9: delete m9; break;
|
||||
case 10: delete m10; break;
|
||||
case 11: delete m11; break;
|
||||
case 12: delete m12; break;
|
||||
case 13: delete m13; break;
|
||||
case 14: delete m14; break;
|
||||
case 15: delete m15; break;
|
||||
case 16: delete m16; break;
|
||||
case 17: delete m17; break;
|
||||
case 18: delete m18; break;
|
||||
default:
|
||||
cprintf(RED, "Error: Task not defined. Abort!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void operator()(){
|
||||
switch(fnum) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsReceiverSoftware
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: b389402d647e939342dbb2c9317c688c0eb6b105
|
||||
Revision: 708
|
||||
Branch: 3.1.0-rc
|
||||
Last Changed Author: Erik_Frojdh
|
||||
Last Changed Rev: 3458
|
||||
Last Changed Date: 2018-03-09 12:23:14.000000002 +0100 ./src/Listener.cpp
|
||||
Repsitory UUID: 1b92b01a466aa1986b8198700274af75477a1e54
|
||||
Revision: 715
|
||||
Branch: 3.1.4
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3492
|
||||
Last Changed Date: 2018-08-17 16:36:25.000000002 +0200 ./src/utilities.cpp
|
||||
|
@ -198,9 +198,10 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
|
||||
/**
|
||||
* End of Acquisition
|
||||
* @param anyPacketsCaught true if any packets are caught, else false
|
||||
* @param numf number of images caught
|
||||
*/
|
||||
void EndofAcquisition(uint64_t numf);
|
||||
void EndofAcquisition(bool anyPacketsCaught, uint64_t numf);
|
||||
|
||||
|
||||
private:
|
||||
|
@ -159,9 +159,10 @@ class File : private virtual slsReceiverDefs {
|
||||
|
||||
/**
|
||||
* End of Acquisition
|
||||
* @param anyPacketsCaught true if any packets are caught, else false
|
||||
* @param numf number of images caught
|
||||
*/
|
||||
virtual void EndofAcquisition(uint64_t numf) {
|
||||
virtual void EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
|
||||
cprintf(RED,"This is a generic function EndofAcquisition that should be overloaded by a derived class\n");
|
||||
}
|
||||
|
||||
|
@ -111,9 +111,10 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
|
||||
|
||||
/**
|
||||
* End of Acquisition
|
||||
* @param anyPacketsCaught true if any packets are caught, else false
|
||||
* @param numf number of images caught
|
||||
*/
|
||||
void EndofAcquisition(uint64_t numf);
|
||||
void EndofAcquisition(bool anyPacketsCaught, uint64_t numf);
|
||||
|
||||
/**
|
||||
* Create Virtual File
|
||||
@ -180,5 +181,8 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
|
||||
/** Dataset array for parameters */
|
||||
DataSet* dataset_para[HDF5FileStatic::NumberofParameters];
|
||||
|
||||
/** Number of Images (including extended during acquisition) */
|
||||
uint64_t extNumImages;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
@ -112,7 +112,7 @@ public:
|
||||
}
|
||||
} catch(Exception error) {
|
||||
cprintf(RED,"Error in closing HDF5 handles of index %d\n", ind);
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ public:
|
||||
}
|
||||
} catch(Exception error) {
|
||||
cprintf(RED,"Error in closing master HDF5 handles\n");
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ public:
|
||||
}
|
||||
catch(Exception error){
|
||||
cprintf(RED,"Error in writing to file in object %d\n",ind);
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -187,6 +187,12 @@ public:
|
||||
|
||||
/**
|
||||
* Write Parameter Arrays as datasets (to virtual file)
|
||||
* @param ind self index
|
||||
* @param dpace_para parameter dataspace
|
||||
* @param fnum frame number current
|
||||
* @param dset_para parameter dataset
|
||||
* @param header image header
|
||||
* @returns 0 for success and 1 for fail
|
||||
*/
|
||||
static int WriteParameterDatasets(int ind, DataSpace* dspace_para, uint64_t fnum,
|
||||
DataSet* dset_para[],sls_detector_header* header)
|
||||
@ -213,12 +219,50 @@ public:
|
||||
}
|
||||
catch(Exception error){
|
||||
cprintf(RED,"Error in writing parameters to file in object %d\n",ind);
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend datasets in #images dimension (x dimension)
|
||||
* @param ind self index
|
||||
* @param dpace data space pointer address
|
||||
* @param dset data set pointer
|
||||
* @param dspace_para parameter dataspace address pointer
|
||||
* @param dset dataset parameter pointer
|
||||
* @param initialNumImages initial number of images
|
||||
* @returns 0 for success and 1 for fail
|
||||
*/
|
||||
static int ExtendDataset(int ind, DataSpace*& dspace, DataSet* dset,
|
||||
DataSpace*& dspace_para, DataSet* dset_para[],
|
||||
uint64_t initialNumImages) {
|
||||
try{
|
||||
Exception::dontPrint(); //to handle errors
|
||||
|
||||
hsize_t dims[3];
|
||||
dspace->getSimpleExtentDims(dims);
|
||||
dims[0] += initialNumImages;
|
||||
|
||||
dset->extend(dims);
|
||||
delete dspace;
|
||||
dspace = new DataSpace(dset->getSpace());
|
||||
|
||||
hsize_t dims_para[1] = {dims[0]};
|
||||
for (int i = 0; i < NumberofParameters; ++i)
|
||||
dset_para[i]->extend(dims_para);
|
||||
delete dspace_para;
|
||||
dspace_para = new DataSpace(dset_para[0]->getSpace());
|
||||
|
||||
}
|
||||
catch(Exception error){
|
||||
cprintf(RED,"Error in extending dataset in object %d\n",ind);
|
||||
error.printErrorStack();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create master file
|
||||
@ -246,9 +290,9 @@ public:
|
||||
FileAccPropList flist;
|
||||
flist.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||
if(!owenable)
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_EXCL, NULL, flist );
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_EXCL, FileCreatPropList::DEFAULT, flist );
|
||||
else
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, NULL, flist );
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, flist );
|
||||
|
||||
//variables
|
||||
DataSpace dataspace = DataSpace (H5S_SCALAR);
|
||||
@ -328,7 +372,7 @@ public:
|
||||
|
||||
} catch(Exception error) {
|
||||
cprintf(RED,"Error in creating master HDF5 handles\n");
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -374,9 +418,9 @@ public:
|
||||
FileAccPropList fapl;
|
||||
fapl.setFcloseDegree(H5F_CLOSE_STRONG);
|
||||
if(!owenable)
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_EXCL, NULL,fapl );
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_EXCL, FileCreatPropList::DEFAULT,fapl );
|
||||
else
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, NULL, fapl );
|
||||
fd = new H5File( fname.c_str(), H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl );
|
||||
|
||||
//attributes - version
|
||||
double dValue=version;
|
||||
@ -386,7 +430,8 @@ public:
|
||||
|
||||
//dataspace
|
||||
hsize_t srcdims[3] = {nDimx, nDimy, nDimz};
|
||||
dspace = new DataSpace (3,srcdims);
|
||||
hsize_t srcdimsmax[3] = {H5S_UNLIMITED, nDimy, nDimz};
|
||||
dspace = new DataSpace (3,srcdims,srcdimsmax);
|
||||
|
||||
//dataset name
|
||||
ostringstream osfn;
|
||||
@ -396,23 +441,28 @@ public:
|
||||
|
||||
//dataset
|
||||
//chunked dataset if greater than max_chunked_images
|
||||
if(nDimx > maxchunkedimages){
|
||||
DSetCreatPropList plist;
|
||||
hsize_t chunk_dims[3] ={maxchunkedimages, nDimy, nDimz};
|
||||
plist.setChunk(3, chunk_dims);
|
||||
dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace, plist));
|
||||
}else
|
||||
dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace));
|
||||
// always create chunked dataset as unlimited is only supported with chunked layout
|
||||
DSetCreatPropList plist;
|
||||
hsize_t chunk_dims[3] ={maxchunkedimages, nDimy, nDimz};
|
||||
plist.setChunk(3, chunk_dims);
|
||||
dset = new DataSet (fd->createDataSet(dsetname.c_str(), dtype, *dspace, plist));
|
||||
|
||||
//create parameter datasets
|
||||
hsize_t dims[1] = {nDimx};
|
||||
dspace_para = new DataSpace (1,dims);
|
||||
hsize_t dimsmax[1] = {H5S_UNLIMITED};
|
||||
dspace_para = new DataSpace (1,dims,dimsmax);
|
||||
|
||||
// always create chunked dataset as unlimited is only supported with chunked layout
|
||||
DSetCreatPropList paralist;
|
||||
hsize_t chunkpara_dims[3] ={maxchunkedimages};
|
||||
paralist.setChunk(1, chunkpara_dims);
|
||||
|
||||
for (int i = 0; i < NumberofParameters; ++i)
|
||||
dset_para[i] = new DataSet(fd->createDataSet(ParameterNames[i], ParameterDataTypes[i], *dspace_para));
|
||||
dset_para[i] = new DataSet(fd->createDataSet(ParameterNames[i], ParameterDataTypes[i], *dspace_para, paralist));
|
||||
}
|
||||
catch(Exception error){
|
||||
cprintf(RED,"Error in creating HDF5 handles in object %d\n",ind);
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
fd->close();
|
||||
return 1;
|
||||
}
|
||||
@ -488,7 +538,7 @@ public:
|
||||
hid_t vdsDataspace = H5Screate_simple(3, vdsdims ,NULL);
|
||||
if (vdsDataspace < 0)
|
||||
return CloseFileOnError(fd, string("Error in creating virtual dataspace in virtual file ") + virtualFileName + string("\n"));
|
||||
hsize_t vdsdims_para[2] = {numf, numDety * numDetz};
|
||||
hsize_t vdsdims_para[2] = {numf, (unsigned int)numDety * numDetz};
|
||||
hid_t vdsDataspace_para = H5Screate_simple(2, vdsdims_para, NULL);
|
||||
if (vdsDataspace_para < 0)
|
||||
return CloseFileOnError(fd, string("Error in creating virtual dataspace (parameters) in virtual file ") + virtualFileName + string("\n"));
|
||||
@ -541,6 +591,14 @@ public:
|
||||
string srcFileName = HDF5FileStatic::CreateFileName(fpath, fnameprefix, findex,
|
||||
frindexenable, framesSaved, dindex, numunits, i);
|
||||
|
||||
// find relative path
|
||||
string relative_srcFileName = srcFileName;
|
||||
{
|
||||
size_t i = srcFileName.rfind('/', srcFileName.length());
|
||||
if (i != string::npos)
|
||||
relative_srcFileName = (srcFileName.substr(i+1, srcFileName.length() - i));
|
||||
}
|
||||
|
||||
//source dataset name
|
||||
ostringstream osfn;
|
||||
osfn << "/data";
|
||||
@ -549,23 +607,25 @@ public:
|
||||
|
||||
//source dataspace
|
||||
hsize_t srcdims[3] = {nDimx, nDimy, nDimz};
|
||||
hid_t srcDataspace = H5Screate_simple(3, srcdims, NULL);
|
||||
hsize_t srcdimsmax[3] = {H5S_UNLIMITED, nDimy, nDimz};
|
||||
hid_t srcDataspace = H5Screate_simple(3, srcdims, srcdimsmax);
|
||||
if (srcDataspace < 0)
|
||||
return CloseFileOnError(fd, string("Error in creating source dataspace in virtual file ") + virtualFileName + string("\n"));
|
||||
hsize_t srcdims_para[1] = {nDimx};
|
||||
hid_t srcDataspace_para = H5Screate_simple(1, srcdims_para, NULL);
|
||||
hsize_t srcdimsmax_para[1] = {H5S_UNLIMITED};
|
||||
hid_t srcDataspace_para = H5Screate_simple(1, srcdims_para, srcdimsmax_para);
|
||||
if (srcDataspace_para < 0)
|
||||
return CloseFileOnError(fd, string("Error in creating source dataspace (parameters) in virtual file ") + virtualFileName + string("\n"));
|
||||
|
||||
//mapping
|
||||
if (H5Pset_virtual(dcpl, vdsDataspace, srcFileName.c_str(), srcDatasetName.c_str(), srcDataspace) < 0) {
|
||||
if (H5Pset_virtual(dcpl, vdsDataspace, relative_srcFileName.c_str(), srcDatasetName.c_str(), srcDataspace) < 0) {
|
||||
cprintf(RED,"could not set mapping for paramter 1\n");
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
for (int k = 0; k < NumberofParameters; ++k) {
|
||||
if (H5Pset_virtual(dcpl_para[k], vdsDataspace_para, srcFileName.c_str(), ParameterNames[k], srcDataspace_para) < 0) {
|
||||
if (H5Pset_virtual(dcpl_para[k], vdsDataspace_para, relative_srcFileName.c_str(), ParameterNames[k], srcDataspace_para) < 0) {
|
||||
cprintf(RED,"could not set mapping for paramter %d\n", k);
|
||||
error = true;
|
||||
break;
|
||||
@ -587,7 +647,7 @@ public:
|
||||
return CloseFileOnError(fd, string("Error in mapping files in virtual file ") + virtualFileName + string("\n"));
|
||||
|
||||
//dataset
|
||||
string virtualDatasetName = string("/virtual_") + srcDataseName;
|
||||
string virtualDatasetName = /*string("/virtual_") + */srcDataseName;
|
||||
hid_t vdsdataset = H5Dcreate2 (fd, virtualDatasetName.c_str(), GetDataTypeinC(dataType), vdsDataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
||||
if (vdsdataset < 0)
|
||||
return CloseFileOnError(fd, string("Error in creating virutal dataset in virtual file ") + virtualFileName + string("\n"));
|
||||
@ -596,7 +656,7 @@ public:
|
||||
//virtual parameter dataset
|
||||
for (int i = 0; i < NumberofParameters; ++i) {
|
||||
hid_t vdsdataset_para = H5Dcreate2 (fd,
|
||||
(string("/virtual_") + string (ParameterNames[i])).c_str(),
|
||||
(/*string("/virtual_") + */string (ParameterNames[i])).c_str(),
|
||||
GetDataTypeinC(ParameterDataTypes[i]), vdsDataspace_para, H5P_DEFAULT, dcpl_para[i], H5P_DEFAULT);
|
||||
if (vdsdataset_para < 0)
|
||||
return CloseFileOnError(fd, string("Error in creating virutal dataset (parameters) in virtual file ") + virtualFileName + string("\n"));
|
||||
@ -697,7 +757,7 @@ public:
|
||||
oldfd->close();
|
||||
} catch(Exception error){
|
||||
cprintf(RED,"Error in copying virtual files\n");
|
||||
error.printError();
|
||||
error.printErrorStack();
|
||||
free(data_out);
|
||||
oldfd->close();
|
||||
newfd->close();
|
||||
@ -739,6 +799,14 @@ public:
|
||||
return CloseFileOnError( vfd, string("Error in opening virtual file\n"));
|
||||
}
|
||||
|
||||
// find relative path
|
||||
string relative_virtualfname = virtualfname;
|
||||
{
|
||||
size_t i = virtualfname.rfind('/', virtualfname.length());
|
||||
if (i != string::npos)
|
||||
relative_virtualfname = (virtualfname.substr(i+1, virtualfname.length() - i));
|
||||
}
|
||||
|
||||
//**data dataset**
|
||||
hid_t vdset = H5Dopen2( vfd, virtualDatasetname.c_str(), H5P_DEFAULT);
|
||||
if (vdset < 0) {
|
||||
@ -746,7 +814,7 @@ public:
|
||||
return CloseFileOnError( vfd, string("Error in opening virtual data dataset\n"));
|
||||
}
|
||||
sprintf(linkname, "/entry/data/%s",virtualDatasetname.c_str());
|
||||
if(H5Lcreate_external( virtualfname.c_str(), virtualDatasetname.c_str(),
|
||||
if(H5Lcreate_external( relative_virtualfname.c_str(), virtualDatasetname.c_str(),
|
||||
mfd, linkname, H5P_DEFAULT, H5P_DEFAULT) < 0) {
|
||||
H5Fclose(mfd); mfd = 0;
|
||||
return CloseFileOnError( vfd, string("Error in creating link to data dataset\n"));
|
||||
@ -755,13 +823,13 @@ public:
|
||||
|
||||
//**paramter datasets**
|
||||
for (int i = 0; i < NumberofParameters; ++i){
|
||||
hid_t vdset_para = H5Dopen2( vfd, (string("/virtual_") + string (ParameterNames[i])).c_str(), H5P_DEFAULT);
|
||||
hid_t vdset_para = H5Dopen2( vfd, (/*string("/virtual_") + */string (ParameterNames[i])).c_str(), H5P_DEFAULT);
|
||||
if (vdset_para < 0) {
|
||||
H5Fclose(mfd); mfd = 0;
|
||||
return CloseFileOnError( vfd, string("Error in opening virtual parameter dataset to create link\n"));
|
||||
}
|
||||
sprintf(linkname, "/entry/data/%s",(string("/virtual_") + string (ParameterNames[i])).c_str());
|
||||
if(H5Lcreate_external( virtualfname.c_str(), (string("/virtual_") + string (ParameterNames[i])).c_str(),
|
||||
sprintf(linkname, "/entry/data/%s",(/*string("/virtual_") + */string (ParameterNames[i])).c_str());
|
||||
if(H5Lcreate_external( relative_virtualfname.c_str(), (/*string("/virtual_") + */string (ParameterNames[i])).c_str(),
|
||||
mfd, linkname, H5P_DEFAULT, H5P_DEFAULT) < 0) {
|
||||
H5Fclose(mfd); mfd = 0;
|
||||
return CloseFileOnError( vfd, string("Error in creating link to virtual parameter dataset\n"));
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "b389402d647e939342dbb2c9317c688c0eb6b105"
|
||||
#define GITAUTH "Erik_Frojdh"
|
||||
#define GITREV 0x3458
|
||||
#define GITDATE 0x20180309
|
||||
#define GITBRANCH "3.1.0-rc"
|
||||
#define GITREPUUID "1b92b01a466aa1986b8198700274af75477a1e54"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3492
|
||||
#define GITDATE 0x20180817
|
||||
#define GITBRANCH "3.1.4"
|
||||
|
@ -282,9 +282,9 @@ void DataProcessor::CloseFiles() {
|
||||
file->CloseAllFiles();
|
||||
}
|
||||
|
||||
void DataProcessor::EndofAcquisition(uint64_t numf) {
|
||||
void DataProcessor::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
|
||||
if (file && file->GetFileType() == HDF5) {
|
||||
file->EndofAcquisition(numf);
|
||||
file->EndofAcquisition(anyPacketsCaught, numf);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,8 @@ HDF5File::HDF5File(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
numFramesInFile(0),
|
||||
numActualPacketsInFile(0),
|
||||
numFilesinAcquisition(0),
|
||||
dataspace_para(0)
|
||||
dataspace_para(0),
|
||||
extNumImages(0)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
PrintMembers();
|
||||
@ -97,7 +98,7 @@ int HDF5File::CreateFile(uint64_t fnum) {
|
||||
//first time
|
||||
if(!fnum) UpdateDataType();
|
||||
|
||||
uint64_t framestosave = ((*numImages - fnum) > maxFramesPerFile) ? maxFramesPerFile : (*numImages-fnum);
|
||||
uint64_t framestosave = ((extNumImages - fnum) > maxFramesPerFile) ? maxFramesPerFile : (extNumImages-fnum);
|
||||
pthread_mutex_lock(&Mutex);
|
||||
if (HDF5FileStatic::CreateDataFile(index, *overWriteEnable, currentFileName, *frameIndexEnable,
|
||||
fnum, framestosave, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX),
|
||||
@ -111,9 +112,9 @@ int HDF5File::CreateFile(uint64_t fnum) {
|
||||
if (dataspace == NULL)
|
||||
cprintf(RED,"Got nothing!\n");
|
||||
|
||||
if(!silentMode)
|
||||
if(!silentMode) {
|
||||
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
|
||||
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -145,6 +146,19 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
|
||||
numFramesInFile++;
|
||||
numActualPacketsInFile += nump;
|
||||
pthread_mutex_lock(&Mutex);
|
||||
|
||||
// extend dataset (when receiver start followed by many status starts (jungfrau)))
|
||||
if (fnum >= extNumImages) {
|
||||
if (HDF5FileStatic::ExtendDataset(index, dataspace, dataset,
|
||||
dataspace_para, dataset_para, *numImages) == OK) {
|
||||
if (!silentMode) {
|
||||
cprintf(BLUE,"%d Extending HDF5 dataset by %lu, Total x Dimension: %lu\n",
|
||||
index, extNumImages, extNumImages + *numImages);
|
||||
}
|
||||
extNumImages += *numImages;
|
||||
}
|
||||
}
|
||||
|
||||
if (HDF5FileStatic::WriteDataFile(index, buffer + sizeof(sls_detector_header),
|
||||
fnum%maxFramesPerFile, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX),
|
||||
dataspace, dataset, datatype) == OK) {
|
||||
@ -163,18 +177,23 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
||||
uint32_t nx, uint32_t ny, uint64_t at, uint64_t st, uint64_t ap) {
|
||||
|
||||
//beginning of every acquisition
|
||||
numFramesInFile = 0;
|
||||
numActualPacketsInFile = 0;
|
||||
extNumImages = *numImages;
|
||||
|
||||
if (master && (*detIndex==0)) {
|
||||
virtualfd = 0;
|
||||
masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex);
|
||||
if(!silentMode)
|
||||
if(!silentMode){
|
||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||
}
|
||||
pthread_mutex_lock(&Mutex);
|
||||
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable,
|
||||
*dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION);
|
||||
@ -185,11 +204,11 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
||||
}
|
||||
|
||||
|
||||
void HDF5File::EndofAcquisition(uint64_t numf) {
|
||||
void HDF5File::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
|
||||
//not created before
|
||||
if (!virtualfd) {
|
||||
if (!virtualfd && anyPacketsCaught) {
|
||||
|
||||
//only one file and one sub image
|
||||
//only one file and one sub image (link current file in master)
|
||||
if (((numFilesinAcquisition == 1) && (numDetY*numDetX) == 1)) {
|
||||
//dataset name
|
||||
ostringstream osfn;
|
||||
@ -217,7 +236,7 @@ int HDF5File::CreateVirtualFile(uint64_t numf) {
|
||||
virtualfd, masterFileName,
|
||||
filePath, fileNamePrefix, *fileIndex, *frameIndexEnable,
|
||||
*detIndex, *numUnitsPerDetector,
|
||||
maxFramesPerFile, numf,
|
||||
maxFramesPerFile, numf+1,
|
||||
"data", datatype,
|
||||
numDetY, numDetX, nPixelsY, ((*dynamicRange==4) ? (nPixelsX/2) : nPixelsX),
|
||||
HDF5_WRITER_VERSION);
|
||||
|
@ -290,7 +290,7 @@ void UDPBaseImplementation::setFilePath(const char c[]){
|
||||
else
|
||||
FILE_LOG(logERROR) << "FilePath does not exist: " << filePath;
|
||||
}
|
||||
FILE_LOG(logINFO) << "Info: File path: " << filePath;
|
||||
FILE_LOG(logINFO) << "File path: " << filePath;
|
||||
}
|
||||
|
||||
void UDPBaseImplementation::setFileIndex(const uint64_t i){
|
||||
|
@ -462,8 +462,9 @@ void UDPStandardImplementation::stopReceiver(){
|
||||
if((*it)->GetMeasurementStartedFlag())
|
||||
anycaught = true;
|
||||
}
|
||||
if (anycaught)
|
||||
dataProcessor[0]->EndofAcquisition(maxIndexCaught); //to create virtual file
|
||||
|
||||
//to create virtual file & set files/acquisition to 0 (only hdf5 at the moment)
|
||||
dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
|
||||
}
|
||||
|
||||
while(DataStreamer::GetRunningMask()){
|
||||
@ -480,7 +481,7 @@ void UDPStandardImplementation::stopReceiver(){
|
||||
tot += dataProcessor[i]->GetNumFramesCaught();
|
||||
|
||||
uint64_t missingpackets = numberOfFrames*generalData->packetsPerFrame-listener[i]->GetPacketsCaught();
|
||||
if (missingpackets) {
|
||||
if ((int)missingpackets > 0) {
|
||||
cprintf(RED, "\n[Port %d]\n",udpPortNum[i]);
|
||||
cprintf(RED, "Missing Packets\t\t: %lld\n",(long long int)missingpackets);
|
||||
cprintf(RED, "Complete Frames\t\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught());
|
||||
@ -562,12 +563,15 @@ void UDPStandardImplementation::shutDownUDPSockets() {
|
||||
|
||||
void UDPStandardImplementation::closeFiles() {
|
||||
uint64_t maxIndexCaught = 0;
|
||||
bool anycaught = false;
|
||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) {
|
||||
(*it)->CloseFiles();
|
||||
maxIndexCaught = max(maxIndexCaught, (*it)->GetProcessedMeasurementIndex());
|
||||
if((*it)->GetMeasurementStartedFlag())
|
||||
anycaught = true;
|
||||
}
|
||||
if (maxIndexCaught)
|
||||
dataProcessor[0]->EndofAcquisition(maxIndexCaught);
|
||||
//to create virtual file & set files/acquisition to 0 (only hdf5 at the moment)
|
||||
dataProcessor[0]->EndofAcquisition(anycaught, maxIndexCaught);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user