mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
040cc9c14f | |||
46e0c0abed | |||
876207c8cd | |||
ec21624aeb | |||
1de5b85ce2 | |||
b4e4033736 | |||
820bc01505 | |||
4e54d1c318 | |||
dec4183e0f | |||
feed09f2f4 | |||
c6aa8d6072 | |||
4ec38a071c | |||
0c4b721e13 | |||
fae884e658 | |||
f20f084991 | |||
20ce79872f | |||
328375924f | |||
a1d91e590e | |||
679db120b0 | |||
7a6797b23e | |||
93f8e8ecb3 | |||
d112956f79 |
@ -41,4 +41,4 @@ deploy:
|
||||
provider: script
|
||||
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||
on:
|
||||
branch: 4.1.1
|
||||
branch: 4.2.0
|
||||
|
115
RELEASE.txt
115
RELEASE.txt
@ -1,14 +1,14 @@
|
||||
SLS Detector Package 4.1.1 released on 15.01.2020 (Bug Fix Release)
|
||||
SLS Detector Package 4.2.0 released on 09.04.2020 (Minor Release)
|
||||
===================================================================
|
||||
|
||||
|
||||
This document describes the differences between 4.1.0 and 4.1.1 releases.
|
||||
This document describes the differences between 4.2.0 and 4.1.1 releases.
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
1. Topics Concerning
|
||||
2. Resolved Issues
|
||||
3. Known Issues
|
||||
2. New Features
|
||||
3. Resolved Issues
|
||||
4. Firmware Requirements
|
||||
5. Download, Documentation & Support
|
||||
|
||||
@ -17,40 +17,101 @@ This document describes the differences between 4.1.0 and 4.1.1 releases.
|
||||
1. Topics Concerning
|
||||
====================
|
||||
|
||||
- detangled receiver streaming from data call back in client
|
||||
and allow for unregister data call back in client
|
||||
- (eiger) software trigger made to work along with blocking acquire
|
||||
- bug fix for locks in blocking acquire
|
||||
- parameter file allows for modular commands
|
||||
- (Eiger) Additional status: Transmitting
|
||||
- (Eiger) Default vcal dac value
|
||||
- (Eiger) Default readout mode
|
||||
- (Eiger) Dynamic range change effect on clock divider
|
||||
- (Eiger) Deactivate a module
|
||||
- (Eiger) Setting all trimbits argument check
|
||||
- (Receiver) performance (memory allocation and alignment, file buffering)
|
||||
- (Receiver) Eiger: Different rx_fifodepth defaults
|
||||
- (Receiver) rx_fifodepth has a higher range
|
||||
- (Receiver) subperiod in master file
|
||||
- (Package) Removed warnings including memory overlap copy
|
||||
- (Users) Added setflippeddatax to users class
|
||||
- (Zmq) Client data streaming fix (Client data call back)
|
||||
|
||||
Compared to 4.1.0,
|
||||
no firmware or on-board detector server update required for this release.
|
||||
Compared to 4.1.1,
|
||||
- no firmware update required for this release
|
||||
- eiger on-board detector server update required for this release
|
||||
|
||||
|
||||
2. Resolved Issues
|
||||
==================
|
||||
|
||||
2. New Features
|
||||
===============
|
||||
|
||||
Receiver
|
||||
--------
|
||||
1. Memory in receiver is now byte aligned and write to every page
|
||||
at memory allocation to ensure complete memory allocated right
|
||||
from start. Removed file buffering when writing to file. Replaced
|
||||
pausing on keepRunning variable with semaphore to reduce cpu
|
||||
load.
|
||||
|
||||
2. (Eiger) Default rx_fifodepth for 32 bit mode is 100, but 1000
|
||||
for other modes. Changing dynamic range will now change bit mode to
|
||||
their defaults.
|
||||
|
||||
|
||||
Client
|
||||
------
|
||||
1. Added setflippeddatax to users class.
|
||||
|
||||
|
||||
Detector Server (Eiger)
|
||||
-----------------------
|
||||
1. Transmitting Status: After acquiring, if the detector is still
|
||||
streaming out data, then the status is Trasnmitting
|
||||
(command line: 'data'). Only after this process, will it become idle.
|
||||
Previously, sls_detector_acquire waited for end of data streaming
|
||||
before returning. It will continue to do so.
|
||||
|
||||
|
||||
|
||||
3. Resolved Issues
|
||||
==================
|
||||
|
||||
Detector Server (Eiger)
|
||||
-----------------------
|
||||
1. Vcal dac set to 0 at on-board detector server start up to
|
||||
reduce noise.
|
||||
|
||||
2. Default Readout mode set to Parallel instead of Non parallel.
|
||||
|
||||
3. Dynamic range 4, 8 or 16 changes the clock divider to full speed,
|
||||
whereas dynamic range of 32 still changes the clock divider to
|
||||
quarter speed. So, default is dynamic range of 16 and full speed
|
||||
at detector server start up.
|
||||
|
||||
4. Setting activate to 0 sent to both control and stop server.
|
||||
So, deactivate a module can be done even if FEB communication fails.
|
||||
Restarting the server will activate the module again.
|
||||
|
||||
5. Verification included for input of setting all trimbits values.
|
||||
Valid input is 0 - 63.
|
||||
|
||||
|
||||
Receiver
|
||||
--------
|
||||
1. Earlier, setting rx_fifodepth to a high value would set to
|
||||
a lower value, printing this low value to console,
|
||||
but not giving an error. Memory allocated can now take in 64 bits.
|
||||
|
||||
1. Registering data call back (registerDataCallback) used to enable data streaming
|
||||
via zmq in both receiver and client. Sending NULL unregistered call back,
|
||||
but did not disable streaming.
|
||||
Now, registering/unregistering this call back will only enable data streaming
|
||||
in client. Data streaming in receiver will have to be explicitly enabled.
|
||||
2. Modifying subexptime now also updates subperiod in master file.
|
||||
Also, the print for subperiod name to console is corrected.
|
||||
|
||||
2. (Eiger)
|
||||
Software trigger triggered via the stop server and hence, can be triggered
|
||||
also during blocking acquire.
|
||||
|
||||
3. If stop acquisition command was given immediately after starting a blocking acquire,
|
||||
it might have hanged the process. This bug is fixed now.
|
||||
Package
|
||||
-------
|
||||
1. Many warnings have been fixed, including those with overlapping
|
||||
memory copies for source and destination.
|
||||
|
||||
4. Parameter file now allows modular commands (using ':'). They are not ignored anymore.
|
||||
|
||||
|
||||
3. Known Issues
|
||||
===============
|
||||
Client
|
||||
------
|
||||
1. Each time client data streaming was enabled to receive, it
|
||||
creates zmq sockets without checking if they were already created.
|
||||
This is fixed now.
|
||||
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@ It is linked in manual/manual-api from slsReceiverSoftware/include ]
|
||||
#include <unistd.h> //usleep
|
||||
#include <errno.h>
|
||||
#include <syscall.h> //tid
|
||||
#include <semaphore.h>
|
||||
using namespace std;
|
||||
|
||||
|
||||
@ -38,15 +39,15 @@ using namespace std;
|
||||
#define PRINT_IN_COLOR(c,f, ...) printf ("\033[%dm" f RESET, 30 + c+1, ##__VA_ARGS__)
|
||||
|
||||
|
||||
/** Variable is true to continue running, set to false upon interrupt */
|
||||
bool keeprunning;
|
||||
/** Semaphore that waits, interrupted upon end */
|
||||
sem_t semaphore;
|
||||
|
||||
/**
|
||||
* Control+C Interrupt Handler
|
||||
* Sets the variable keeprunning to false, to let all the processes know to exit properly
|
||||
* pushes semaphore to stop waiting, to let all the processes know to exit properly
|
||||
*/
|
||||
void sigInterruptHandler(int p){
|
||||
keeprunning = false;
|
||||
sem_post(&semaphore);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,7 +171,7 @@ int main(int argc, char *argv[]) {
|
||||
int numReceivers = 1;
|
||||
int startTCPPort = 1954;
|
||||
int withCallback = 0;
|
||||
keeprunning = true;
|
||||
sem_init(&semaphore,1,0);
|
||||
|
||||
/** - get number of receivers and start tcp port from command line arguments */
|
||||
if ( (argc != 4) || (!sscanf(argv[1],"%d", &startTCPPort)) || (!sscanf(argv[2],"%d", &numReceivers)) || (!sscanf(argv[3],"%d", &withCallback)) )
|
||||
@ -257,9 +258,9 @@ int main(int argc, char *argv[]) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/** - as long as keeprunning is true (changes with Ctrl+C) */
|
||||
while(keeprunning)
|
||||
pause();
|
||||
/** - as long as semaphore waits (changes with Ctrl+C) */
|
||||
sem_wait(&semaphore);
|
||||
sem_destroy(&semaphore);
|
||||
/** - interrupt caught, delete slsReceiverUsers object and exit */
|
||||
delete receiver;
|
||||
cprintf(BLUE,"Exiting Child Process [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||
|
@ -1,12 +1,12 @@
|
||||
package:
|
||||
name: sls_detector_software
|
||||
version: 4.1.1
|
||||
version: 4.2.0
|
||||
|
||||
source:
|
||||
- path: ..
|
||||
|
||||
build:
|
||||
number: 1
|
||||
number: 0
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
@ -50,14 +50,14 @@ requirements:
|
||||
|
||||
outputs:
|
||||
- name: sls_detector_lib
|
||||
version: 4.1.1
|
||||
version: 4.2.0
|
||||
script: copy_lib.sh
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- name: sls_detector_gui
|
||||
version: 4.1.1
|
||||
version: 4.2.0
|
||||
script: copy_gui.sh
|
||||
requirements:
|
||||
build:
|
||||
@ -81,5 +81,5 @@ outputs:
|
||||
- {{ cdt('libxdamage') }} # [linux]
|
||||
- {{ cdt('libxxf86vm') }} # [linux]
|
||||
run:
|
||||
- sls_detector_lib=4.1.1
|
||||
- sls_detector_lib=4.2.0
|
||||
- qwt 6.1.4=hf484d3e_1001
|
||||
|
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv4.1.0.24.5
|
1
serverBin/eigerDetectorServerv4.2.0.24.2
Symbolic link
1
serverBin/eigerDetectorServerv4.2.0.24.2
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv4.2.0.24.2
|
@ -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: b0fd4f4c44ac378744e724cce684aca4a56fe0fc
|
||||
Revision: 536
|
||||
Branch: 4.1.1
|
||||
Repsitory UUID: 1de5b85ce2f40a83dae99272160d6574bb7e788e
|
||||
Revision: 538
|
||||
Branch: 4.2.0
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 4153
|
||||
Last Changed Date: 2020-01-14 15:47:24.000000001 +0100 ./src/qTabSettings.cpp
|
||||
Last Changed Rev: 4175
|
||||
Last Changed Date: 2020-04-14 09:09:45.535926413 +0200 ./src/qTabSettings.cpp
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "b0fd4f4c44ac378744e724cce684aca4a56fe0fc"
|
||||
#define GITREPUUID "1de5b85ce2f40a83dae99272160d6574bb7e788e"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x4153
|
||||
#define GITDATE 0x20200114
|
||||
#define GITBRANCH "4.1.1"
|
||||
#define GITREV 0x4175
|
||||
#define GITDATE 0x20200414
|
||||
#define GITBRANCH "4.2.0"
|
||||
|
@ -85,15 +85,21 @@ public:
|
||||
static double getNSTime(timeUnit unit, double value){
|
||||
double valueNS=value;
|
||||
switch(unit){
|
||||
case HOURS: valueNS*=60;
|
||||
case MINUTES: valueNS*=60;
|
||||
case SECONDS: valueNS*=1000;
|
||||
case MILLISECONDS: valueNS*=1000;
|
||||
case MICROSECONDS: valueNS*=1000;
|
||||
case HOURS:
|
||||
return valueNS * 60 * 60 * 1000 * 1000 * 1000;
|
||||
case MINUTES:
|
||||
return valueNS * 60 * 1000 * 1000 * 1000;
|
||||
case SECONDS:
|
||||
return valueNS * 1000 * 1000 * 1000;
|
||||
case MILLISECONDS:
|
||||
return valueNS * 1000 * 1000;
|
||||
case MICROSECONDS:
|
||||
return valueNS * 1000;
|
||||
case NANOSECONDS:
|
||||
default:;
|
||||
return valueNS;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return valueNS;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -180,131 +180,103 @@ void Beb_GetModuleConfiguration(int* master, int* top, int* normal){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Beb_EndofDataSend(int tengiga){
|
||||
int Beb_IsTransmitting(int* retval, int tengiga, int waitForDelay) {
|
||||
//mapping new memory
|
||||
u_int32_t* csp0base=0;
|
||||
int l_framepktLsbcounter, l_framepktMsbcounter, l_txndelaycounter, l_framedelaycounter;
|
||||
int r_framepktLsbcounter, r_framepktMsbcounter, r_txndelaycounter, r_framedelaycounter;
|
||||
int l_framepktLsbcounter_new, l_framepktMsbcounter_new, l_txndelaycounter_new, l_framedelaycounter_new;
|
||||
int r_framepktLsbcounter_new, r_framepktMsbcounter_new, r_txndelaycounter_new, r_framedelaycounter_new;
|
||||
int addr_l_framepktLsbcounter, addr_l_framepktMsbcounter, addr_l_txndelaycounter, addr_l_framedelaycounter;
|
||||
int addr_r_framepktLsbcounter, addr_r_framepktMsbcounter, addr_r_txndelaycounter, addr_r_framedelaycounter;
|
||||
|
||||
switch(tengiga){
|
||||
case 0:
|
||||
addr_l_framepktLsbcounter = ONE_GIGA_LEFT_INDEX_LSB_COUNTER;
|
||||
addr_l_framepktMsbcounter = ONE_GIGA_LEFT_INDEX_MSB_COUNTER;
|
||||
addr_l_txndelaycounter = ONE_GIGA_LEFT_TXN_DELAY_COUNTER;
|
||||
addr_l_framedelaycounter = ONE_GIGA_LEFT_FRAME_DELAY_COUNTER;
|
||||
addr_r_framepktLsbcounter = ONE_GIGA_RIGHT_INDEX_LSB_COUNTER;
|
||||
addr_r_framepktMsbcounter = ONE_GIGA_RIGHT_INDEX_MSB_COUNTER;
|
||||
addr_r_txndelaycounter = ONE_GIGA_RIGHT_TXN_DELAY_COUNTER;
|
||||
addr_r_framedelaycounter = ONE_GIGA_RIGHT_FRAME_DELAY_COUNTER;
|
||||
break;
|
||||
case 1:
|
||||
addr_l_framepktLsbcounter = TEN_GIGA_LEFT_INDEX_LSB_COUNTER;
|
||||
addr_l_framepktMsbcounter = TEN_GIGA_LEFT_INDEX_MSB_COUNTER;
|
||||
u_int32_t* csp0base = 0;
|
||||
int addr_l_txndelaycounter = 0, addr_l_framedelaycounter = 0;
|
||||
int addr_r_txndelaycounter = 0, addr_r_framedelaycounter = 0;
|
||||
int addr_l_framepktLsbcounter = 0, addr_l_framepktMsbcounter = 0;
|
||||
int addr_r_framepktLsbcounter = 0, addr_r_framepktMsbcounter = 0;
|
||||
if (tengiga) {
|
||||
addr_l_txndelaycounter = TEN_GIGA_LEFT_TXN_DELAY_COUNTER;
|
||||
addr_l_framedelaycounter = TEN_GIGA_LEFT_FRAME_DELAY_COUNTER;
|
||||
addr_r_framepktLsbcounter = TEN_GIGA_RIGHT_INDEX_LSB_COUNTER;
|
||||
addr_r_framepktMsbcounter = TEN_GIGA_RIGHT_INDEX_MSB_COUNTER;
|
||||
addr_r_txndelaycounter = TEN_GIGA_RIGHT_TXN_DELAY_COUNTER;
|
||||
addr_r_framedelaycounter = TEN_GIGA_RIGHT_FRAME_DELAY_COUNTER;
|
||||
break;
|
||||
addr_l_framepktLsbcounter = TEN_GIGA_LEFT_INDEX_LSB_COUNTER;
|
||||
addr_l_framepktMsbcounter = TEN_GIGA_LEFT_INDEX_MSB_COUNTER;
|
||||
addr_r_framepktLsbcounter = TEN_GIGA_RIGHT_INDEX_LSB_COUNTER;
|
||||
addr_r_framepktMsbcounter = TEN_GIGA_RIGHT_INDEX_MSB_COUNTER;
|
||||
} else {
|
||||
addr_l_txndelaycounter = ONE_GIGA_LEFT_TXN_DELAY_COUNTER;
|
||||
addr_l_framedelaycounter = ONE_GIGA_LEFT_FRAME_DELAY_COUNTER;
|
||||
addr_r_txndelaycounter = ONE_GIGA_RIGHT_TXN_DELAY_COUNTER;
|
||||
addr_r_framedelaycounter = ONE_GIGA_RIGHT_FRAME_DELAY_COUNTER;
|
||||
addr_l_framepktLsbcounter = ONE_GIGA_LEFT_INDEX_LSB_COUNTER;
|
||||
addr_l_framepktMsbcounter = ONE_GIGA_LEFT_INDEX_MSB_COUNTER;
|
||||
addr_r_framepktLsbcounter = ONE_GIGA_RIGHT_INDEX_LSB_COUNTER;
|
||||
addr_r_framepktMsbcounter = ONE_GIGA_RIGHT_INDEX_MSB_COUNTER;
|
||||
}
|
||||
|
||||
|
||||
//open file pointer
|
||||
int fd = Beb_open(&csp0base,XPAR_COUNTER_BASEADDR);
|
||||
if(fd < 0){
|
||||
cprintf(BG_RED,"Delay read counter fail\n");
|
||||
return;
|
||||
}else{
|
||||
cprintf(BG_RED,"Could not read Beb Delay read counter\n");
|
||||
return FAIL;
|
||||
} else {
|
||||
//read data first time
|
||||
l_framepktLsbcounter = Beb_Read32(csp0base, addr_l_framepktLsbcounter);
|
||||
l_framepktMsbcounter = Beb_Read32(csp0base, addr_l_framepktMsbcounter);
|
||||
l_txndelaycounter = Beb_Read32(csp0base, addr_l_txndelaycounter);
|
||||
l_framedelaycounter = Beb_Read32(csp0base, addr_l_framedelaycounter);
|
||||
r_framepktLsbcounter = Beb_Read32(csp0base, addr_r_framepktLsbcounter);
|
||||
r_framepktMsbcounter = Beb_Read32(csp0base, addr_r_framepktMsbcounter);
|
||||
r_txndelaycounter = Beb_Read32(csp0base, addr_r_txndelaycounter);
|
||||
r_framedelaycounter = Beb_Read32(csp0base, addr_r_framedelaycounter);
|
||||
//#ifdef VERBOSE
|
||||
printf("\nLeft\n"
|
||||
"FramepacketLsbcounter: %d\n"
|
||||
"FramepacketMsbcounter: %d\n"
|
||||
"Txndelaycounter:%d\n"
|
||||
"Framedelaycounter:%d\n"
|
||||
"\nRight\n"
|
||||
"FramepacketLsbcounter: %d\n"
|
||||
"FramepacketMsbcounter: %d\n"
|
||||
"Txndelaycounter:%d\n"
|
||||
"Framedelaycounter:%d\n\n",
|
||||
l_framepktLsbcounter,l_framepktMsbcounter,l_txndelaycounter,l_framedelaycounter,
|
||||
r_framepktLsbcounter,r_framepktMsbcounter,r_txndelaycounter,r_framedelaycounter);
|
||||
//#endif
|
||||
|
||||
//keep comparing with previous values
|
||||
int maxtimer;
|
||||
while(1){
|
||||
maxtimer = MAX(MAX(l_txndelaycounter,l_framedelaycounter),MAX(r_txndelaycounter,r_framedelaycounter));
|
||||
maxtimer /= 100;
|
||||
printf("Will wait for %d us\n",maxtimer);
|
||||
usleep(maxtimer);
|
||||
|
||||
//read new values
|
||||
l_framepktLsbcounter_new = Beb_Read32(csp0base, addr_l_framepktLsbcounter);
|
||||
l_framepktMsbcounter_new = Beb_Read32(csp0base, addr_l_framepktMsbcounter);
|
||||
l_txndelaycounter_new = Beb_Read32(csp0base, addr_l_txndelaycounter);
|
||||
l_framedelaycounter_new = Beb_Read32(csp0base, addr_l_framedelaycounter);
|
||||
r_framepktLsbcounter_new = Beb_Read32(csp0base, addr_r_framepktLsbcounter);
|
||||
r_framepktMsbcounter_new = Beb_Read32(csp0base, addr_r_framepktMsbcounter);
|
||||
r_txndelaycounter_new = Beb_Read32(csp0base, addr_r_txndelaycounter);
|
||||
r_framedelaycounter_new = Beb_Read32(csp0base, addr_r_framedelaycounter);
|
||||
//#ifdef VERBOSE
|
||||
printf("\nLeft\n"
|
||||
"FramepacketLsbcounter: %d\n"
|
||||
"FramepacketMsbcounter: %d\n"
|
||||
"Txndelaycounter:%d\n"
|
||||
"Framedelaycounter:%d\n"
|
||||
"\nRight\n"
|
||||
"FramepacketLsbcounter: %d\n"
|
||||
"FramepacketMsbcounter: %d\n"
|
||||
"Txndelaycounter:%d\n"
|
||||
"Framedelaycounter:%d\n\n",
|
||||
l_framepktLsbcounter_new,l_framepktMsbcounter_new,l_txndelaycounter_new,l_framedelaycounter_new,
|
||||
r_framepktLsbcounter_new,r_framepktMsbcounter_new,r_txndelaycounter_new,r_framedelaycounter_new);
|
||||
//#endif
|
||||
|
||||
if ((l_framepktLsbcounter == l_framepktLsbcounter_new) &&
|
||||
(l_framepktMsbcounter == l_framepktMsbcounter_new) &&
|
||||
(r_framepktLsbcounter == r_framepktLsbcounter_new) &&
|
||||
(r_framepktMsbcounter == r_framepktMsbcounter_new))
|
||||
break;
|
||||
|
||||
//update old values
|
||||
l_framepktLsbcounter = l_framepktLsbcounter_new;
|
||||
l_framepktMsbcounter = l_framepktMsbcounter_new;
|
||||
l_txndelaycounter = l_txndelaycounter_new;
|
||||
l_framedelaycounter = l_framedelaycounter_new;
|
||||
r_framepktLsbcounter = r_framepktLsbcounter_new;
|
||||
r_framepktMsbcounter = r_framepktMsbcounter_new;
|
||||
r_txndelaycounter = r_txndelaycounter_new;
|
||||
r_framedelaycounter = r_framedelaycounter_new;
|
||||
|
||||
int l_txndelaycounter = Beb_Read32(csp0base, addr_l_txndelaycounter);
|
||||
int l_framedelaycounter = Beb_Read32(csp0base, addr_l_framedelaycounter);
|
||||
int r_txndelaycounter = Beb_Read32(csp0base, addr_r_txndelaycounter);
|
||||
int r_framedelaycounter = Beb_Read32(csp0base, addr_r_framedelaycounter);
|
||||
int l_framepktLsbcounter = Beb_Read32(csp0base, addr_l_framepktLsbcounter);
|
||||
int l_framepktMsbcounter = Beb_Read32(csp0base, addr_l_framepktMsbcounter);
|
||||
int r_framepktLsbcounter = Beb_Read32(csp0base, addr_r_framepktLsbcounter);
|
||||
int r_framepktMsbcounter = Beb_Read32(csp0base, addr_r_framepktMsbcounter);
|
||||
#ifdef VERBOSE
|
||||
printf("\nFirst Read:\n"
|
||||
"\tLeft [Txndelaycounter:%d, Framedelaycounter:%d]\n"
|
||||
"\tRight [Txndelaycounter:%d, Framedelaycounter:%d]\n",
|
||||
"\tLeft [FramepacketLsbcounter:%d, FramepacketMsbcounter:%d]\n"
|
||||
"\tRight [FramepacketLsbcounter:%d, FramepacketMsbcounter:%d]\n",
|
||||
l_txndelaycounter,l_framedelaycounter, r_txndelaycounter,r_framedelaycounter,
|
||||
l_framepktLsbcounter, l_framepktMsbcounter, r_framepktLsbcounter, r_framepktMsbcounter);
|
||||
#endif
|
||||
// wait for max counter delay
|
||||
if (waitForDelay) {
|
||||
int maxtimer = (MAX(MAX(l_txndelaycounter,l_framedelaycounter),MAX(r_txndelaycounter,r_framedelaycounter))) / 100; // counter values in 10 ns
|
||||
printf("Will wait for %d us\n", maxtimer);
|
||||
usleep (maxtimer);
|
||||
}
|
||||
// wait for 1 ms
|
||||
else {
|
||||
printf("Will wait for 1 ms\n");
|
||||
usleep (1 * 1000);
|
||||
}
|
||||
|
||||
printf("Detector has send all data\n");
|
||||
// read values again
|
||||
int l_txndelaycounter2 = Beb_Read32(csp0base, addr_l_txndelaycounter);
|
||||
int l_framedelaycounter2 = Beb_Read32(csp0base, addr_l_framedelaycounter);
|
||||
int r_txndelaycounter2 = Beb_Read32(csp0base, addr_r_txndelaycounter);
|
||||
int r_framedelaycounter2 = Beb_Read32(csp0base, addr_r_framedelaycounter);
|
||||
int l_framepktLsbcounter2 = Beb_Read32(csp0base, addr_l_framepktLsbcounter);
|
||||
int l_framepktMsbcounter2 = Beb_Read32(csp0base, addr_l_framepktMsbcounter);
|
||||
int r_framepktLsbcounter2 = Beb_Read32(csp0base, addr_r_framepktLsbcounter);
|
||||
int r_framepktMsbcounter2 = Beb_Read32(csp0base, addr_r_framepktMsbcounter);
|
||||
#ifdef VERBOSE
|
||||
printf("\nSecond Read:\n"
|
||||
"\tLeft [Txndelaycounter:%d, Framedelaycounter:%d]\n"
|
||||
"\tRight [Txndelaycounter:%d, Framedelaycounter:%d]\n",
|
||||
"\tLeft [FramepacketLsbcounter:%d, FramepacketMsbcounter:%d]\n"
|
||||
"\tRight [FramepacketLsbcounter:%d, FramepacketMsbcounter:%d]\n",
|
||||
l_txndelaycounter2,l_framedelaycounter2, r_txndelaycounter2,r_framedelaycounter2,
|
||||
l_framepktLsbcounter2, l_framepktMsbcounter2, r_framepktLsbcounter2, r_framepktMsbcounter2);
|
||||
#endif
|
||||
// any change in values, it is still transmitting
|
||||
if (l_txndelaycounter != l_txndelaycounter2 || l_framedelaycounter != l_framedelaycounter2 ||
|
||||
r_txndelaycounter != r_txndelaycounter2 || r_framedelaycounter != r_framedelaycounter2 ||
|
||||
l_framepktLsbcounter != l_framepktLsbcounter2 || l_framepktMsbcounter != l_framepktMsbcounter2 ||
|
||||
r_framepktLsbcounter != r_framepktLsbcounter2 || r_framepktMsbcounter != r_framepktMsbcounter2) {
|
||||
*retval = 1;
|
||||
} else {
|
||||
*retval = 0;
|
||||
}
|
||||
//close file pointer
|
||||
Beb_close(fd,csp0base);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* do not work at the moment */
|
||||
int Beb_SetMasterViaSoftware(){
|
||||
|
||||
|
@ -46,7 +46,7 @@ struct BebInfo{
|
||||
|
||||
|
||||
void Beb_GetModuleConfiguration(int* master, int* top, int* normal);
|
||||
void Beb_EndofDataSend(int tengiga);
|
||||
int Beb_IsTransmitting(int* retval, int tengiga, int waitForDelay);
|
||||
|
||||
int Beb_SetMasterViaSoftware();
|
||||
int Beb_SetSlaveViaSoftware();
|
||||
|
@ -1017,7 +1017,8 @@ unsigned int* Feb_Control_GetTrimbits(){
|
||||
|
||||
|
||||
|
||||
unsigned int Feb_Control_AddressToAll(){printf("in Feb_Control_AddressToAll()\n");
|
||||
unsigned int Feb_Control_AddressToAll(){
|
||||
//printf("in Feb_Control_AddressToAll()\n");
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: e4645a8273c8265bc584579d5f7f8eb6dc4379f7
|
||||
Revision: 360
|
||||
Branch: 4.1.0-rc
|
||||
Last Changed Author: GitHub_GitHub
|
||||
Last Changed Rev: 4138
|
||||
Last Changed Date: 2019-10-04 09:28:27.000000001 +0200 ./xparameters.h
|
||||
Repsitory UUID: fae884e65851d15bd0ca541956b3263cf79bc1b2
|
||||
Revision: 362
|
||||
Branch: 4.2.0-rc
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 4166
|
||||
Last Changed Date: 2020-04-03 10:42:36.000000001 +0200 ./Beb.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "e4645a8273c8265bc584579d5f7f8eb6dc4379f7"
|
||||
#define GITAUTH "GitHub_GitHub"
|
||||
#define GITREV 0x4138
|
||||
#define GITDATE 0x20191004
|
||||
#define GITBRANCH "4.1.0-rc"
|
||||
#define GITREPUUID "fae884e65851d15bd0ca541956b3263cf79bc1b2"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x4166
|
||||
#define GITDATE 0x20200403
|
||||
#define GITBRANCH "4.2.0-rc"
|
||||
|
@ -284,6 +284,9 @@ u_int32_t getDetectorIP(){
|
||||
FILE* sysFile = popen("ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2", "r");
|
||||
fgets(output, sizeof(output), sysFile);
|
||||
pclose(sysFile);
|
||||
if (strlen(output) <= 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//converting IPaddress to hex.
|
||||
char* pcword = strtok (output,".");
|
||||
@ -329,7 +332,16 @@ void initControlServer(){
|
||||
|
||||
|
||||
setupDetector();
|
||||
#endif
|
||||
|
||||
// activate (if it gets ip) (later FW will deactivate at startup)
|
||||
if (getDetectorIP() != 0) {
|
||||
Beb_Activate(1);
|
||||
Feb_Control_activate(1);
|
||||
} else {
|
||||
Beb_Activate(0);
|
||||
Feb_Control_activate(0);
|
||||
}
|
||||
#endif
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@ -344,6 +356,16 @@ void initStopServer(){
|
||||
Feb_Control_FebControl();
|
||||
Feb_Control_Init(master,top,normal,getDetectorNumber());
|
||||
printf("FEB Initialization done\n");
|
||||
|
||||
// activate (if it gets ip) (later FW will deactivate at startup)
|
||||
// also needed for stop server for status
|
||||
if (getDetectorIP() != 0) {
|
||||
Beb_Activate(1);
|
||||
Feb_Control_activate(1);
|
||||
} else {
|
||||
Beb_Activate(0);
|
||||
Feb_Control_activate(0);
|
||||
}
|
||||
#endif
|
||||
printf("\n");
|
||||
}
|
||||
@ -1715,19 +1737,23 @@ enum runStatus getRunStatus(){
|
||||
#else
|
||||
|
||||
int i = Feb_Control_AcquisitionInProgress();
|
||||
switch (i) {
|
||||
case STATUS_ERROR:
|
||||
if (i == STATUS_ERROR) {
|
||||
printf("Status: ERROR reading status register\n");
|
||||
return ERROR;
|
||||
case STATUS_IDLE:
|
||||
} else if (i == STATUS_IDLE) {
|
||||
int isTransmitting = 0;
|
||||
if (Beb_IsTransmitting(&isTransmitting, send_to_ten_gig, 0) == FAIL) {
|
||||
return ERROR;
|
||||
}
|
||||
if (isTransmitting) {
|
||||
printf("Status: TRANSMITTING\n");
|
||||
return TRANSMITTING;
|
||||
}
|
||||
printf("Status: IDLE\n");
|
||||
return IDLE;
|
||||
default:
|
||||
printf("Status: RUNNING...\n");
|
||||
return RUNNING;
|
||||
}
|
||||
|
||||
return IDLE;
|
||||
printf("Status: RUNNING...\n");
|
||||
return RUNNING;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1761,8 +1787,18 @@ void readFrame(int *ret, char *mess){
|
||||
}
|
||||
|
||||
//wait for detector to send
|
||||
Beb_EndofDataSend(send_to_ten_gig);
|
||||
|
||||
int isTransmitting = 1;
|
||||
while (isTransmitting) {
|
||||
if (Beb_IsTransmitting(&isTransmitting, send_to_ten_gig, 1) == FAIL) {
|
||||
strcpy(mess,"Could not read delay counters\n");
|
||||
*ret = (int)FAIL;
|
||||
return;
|
||||
}
|
||||
if (isTransmitting) {
|
||||
printf("Transmitting...\n");
|
||||
}
|
||||
}
|
||||
printf("Detector has sent all data\n");
|
||||
|
||||
printf("*****Done Waiting...\n");
|
||||
*ret = (int)FINISHED;
|
||||
|
@ -31,7 +31,7 @@ enum DACINDEX {SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RX
|
||||
2556, /* Vtgstv */ \
|
||||
1000, /* Vcmp_ll */ \
|
||||
1000, /* Vcmp_lr */ \
|
||||
4000, /* cal */ \
|
||||
0, /* cal */ \
|
||||
1000, /* Vcmp_rl */ \
|
||||
1100, /* rxb_rb */ \
|
||||
1100, /* rxb_lb */ \
|
||||
@ -77,10 +77,10 @@ enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
||||
#define DEFAULT_SUBFRAME_DEADTIME (0)
|
||||
#define DEFAULT_DYNAMIC_RANGE (16)
|
||||
|
||||
#define DEFAULT_READOUT_MODE (NONPARALLEL)
|
||||
#define DEFAULT_READOUT_MODE (PARALLEL)
|
||||
#define DEFAULT_READOUT_STOREINRAM_MODE (CONTINOUS_RO)
|
||||
#define DEFAULT_READOUT_OVERFLOW32_MODE (NOOVERFLOW)
|
||||
#define DEFAULT_CLK_SPEED (HALF_SPEED)
|
||||
#define DEFAULT_CLK_SPEED (FULL_SPEED)
|
||||
#define DEFAULT_IO_DELAY (650)
|
||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||
#define DEFAULT_PHOTON_ENERGY (-1)
|
||||
@ -90,6 +90,7 @@ enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
||||
#define DEFAULT_TEST_MODE (0)
|
||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||
|
||||
#define MAX_TRIMBITS_VALUE (63)
|
||||
|
||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS (0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
||||
|
||||
|
@ -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: b0fd4f4c44ac378744e724cce684aca4a56fe0fc
|
||||
Revision: 2101
|
||||
Branch: 4.1.1
|
||||
Repsitory UUID: 1de5b85ce2f40a83dae99272160d6574bb7e788e
|
||||
Revision: 2112
|
||||
Branch: 4.2.0
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 4153
|
||||
Last Changed Date: 2020-01-14 16:16:00.000000001 +0100 ./threadFiles/ThreadPool.o
|
||||
Last Changed Rev: 4175
|
||||
Last Changed Date: 2020-04-14 09:18:10.968379834 +0200 ./sharedMemory/SharedMemory.o
|
||||
|
@ -2670,7 +2670,7 @@ int* multiSlsDetector::getDataFromDetector() {
|
||||
int nodatadet = -1;
|
||||
int nodatadetectortype = false;
|
||||
detectorType types = getDetectorsType();
|
||||
if (types == EIGER || types == JUNGFRAU || GOTTHARD || PROPIX) {
|
||||
if (types == EIGER || types == JUNGFRAU || types == GOTTHARD || types == PROPIX) {
|
||||
nodatadetectortype = true;
|
||||
}
|
||||
|
||||
@ -2972,16 +2972,18 @@ int multiSlsDetector::setDynamicRange(int p) {
|
||||
}
|
||||
|
||||
//for usability for the user
|
||||
if (getDetectorsType() == EIGER) {
|
||||
if (getDetectorsType() == EIGER && p != -1) {
|
||||
if (p == 32) {
|
||||
std::cout << "Setting Clock to Quarter Speed to cope with Dynamic Range of 32" << std::endl;
|
||||
setSpeed(CLOCK_DIVIDER, 2);
|
||||
} else if (p == 16) {
|
||||
std::cout << "Setting Clock to Half Speed for Dynamic Range of 16" << std::endl;
|
||||
setSpeed(CLOCK_DIVIDER, 1);
|
||||
} else {
|
||||
std::cout << "Setting Clock to Full Speed for Dynamic Range of " << p << std::endl;
|
||||
setSpeed(CLOCK_DIVIDER, 0);
|
||||
}
|
||||
updateOffsets();
|
||||
if (thisMultiDetector->receiverOnlineFlag == ONLINE_FLAG) {
|
||||
std::cout << "Setting receiver fifo depth to default" << std::endl;
|
||||
}
|
||||
if (p != -1)
|
||||
updateOffsets();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -3108,17 +3110,18 @@ slsDetectorDefs::externalCommunicationMode multiSlsDetector::setExternalCommunic
|
||||
externalCommunicationMode pol) {
|
||||
externalCommunicationMode ret, ret1;
|
||||
//(Dhanya) FIXME: why first detector or is it the master one?
|
||||
if (detectors.size())
|
||||
if (detectors.size()) {
|
||||
ret = detectors[0]->setExternalCommunicationMode(pol);
|
||||
if (detectors[0]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
if (detectors[0]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
|
||||
for (unsigned int idet = 1; idet < detectors.size(); ++idet) {
|
||||
ret1 = detectors[idet]->setExternalCommunicationMode(pol);
|
||||
if (detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << idet));
|
||||
if (ret != ret1)
|
||||
ret = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
for (unsigned int idet = 1; idet < detectors.size(); ++idet) {
|
||||
ret1 = detectors[idet]->setExternalCommunicationMode(pol);
|
||||
if (detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << idet));
|
||||
if (ret != ret1)
|
||||
ret = GET_EXTERNAL_COMMUNICATION_MODE;
|
||||
}
|
||||
}
|
||||
setMaster();
|
||||
setSynchronization();
|
||||
@ -3129,17 +3132,18 @@ slsDetectorDefs::externalSignalFlag multiSlsDetector::setExternalSignalFlags(
|
||||
externalSignalFlag pol, int signalindex) {
|
||||
externalSignalFlag ret, ret1;
|
||||
//(Dhanya) FIXME: why first detector or is it the master one?
|
||||
if (detectors.size())
|
||||
if (detectors.size()) {
|
||||
ret = detectors[0]->setExternalSignalFlags(pol, signalindex);
|
||||
if (detectors[0]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
if (detectors[0]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
|
||||
for (unsigned int idet = 1; idet < detectors.size(); ++idet) {
|
||||
ret1 = detectors[idet]->setExternalSignalFlags(pol, signalindex);
|
||||
if (detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << idet));
|
||||
if (ret != ret1)
|
||||
ret = GET_EXTERNAL_SIGNAL_FLAG;
|
||||
for (unsigned int idet = 1; idet < detectors.size(); ++idet) {
|
||||
ret1 = detectors[idet]->setExternalSignalFlags(pol, signalindex);
|
||||
if (detectors[idet]->getErrorMask())
|
||||
setErrorMask(getErrorMask() | (1 << idet));
|
||||
if (ret != ret1)
|
||||
ret = GET_EXTERNAL_SIGNAL_FLAG;
|
||||
}
|
||||
}
|
||||
setMaster();
|
||||
setSynchronization();
|
||||
@ -5157,6 +5161,9 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy) {
|
||||
cout << "Destroyed Receiving Data Socket(s)" << endl;
|
||||
return OK;
|
||||
}
|
||||
if (client_downstream) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
cprintf(MAGENTA, "Going to create data sockets\n");
|
||||
|
||||
@ -5592,8 +5599,10 @@ int multiSlsDetector::enableDataStreamingToClient(int enable) {
|
||||
std::cout << "Could not create data threads in client." << std::endl;
|
||||
//only for the first det as theres no general one
|
||||
setErrorMask(getErrorMask() | (1 << 0));
|
||||
detectors[0]->setErrorMask((detectors[0]->getErrorMask()) |
|
||||
if (detectors.size()) {
|
||||
detectors[0]->setErrorMask((detectors[0]->getErrorMask()) |
|
||||
(DATA_STREAMING));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "b0fd4f4c44ac378744e724cce684aca4a56fe0fc"
|
||||
#define GITREPUUID "1de5b85ce2f40a83dae99272160d6574bb7e788e"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x4153
|
||||
#define GITDATE 0x20200114
|
||||
#define GITBRANCH "4.1.1"
|
||||
#define GITREV 0x4175
|
||||
#define GITDATE 0x20200414
|
||||
#define GITBRANCH "4.2.0"
|
||||
|
@ -3689,7 +3689,7 @@ int* slsDetector::getDataFromDetector(int *retval) {
|
||||
|
||||
int nodatadetectortype = false;
|
||||
detectorType types = getDetectorsType();
|
||||
if(types == EIGER || types == JUNGFRAU || GOTTHARD || PROPIX){
|
||||
if(types == EIGER || types == JUNGFRAU || types == GOTTHARD || types == PROPIX){
|
||||
nodatadetectortype = true;
|
||||
}
|
||||
|
||||
@ -3906,7 +3906,9 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, '.')) {
|
||||
sprintf(cword,"%s%02x",cword,atoi(s.c_str()));
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, "%02x", atoi(s.c_str()));
|
||||
strcat(cword, cnum);
|
||||
}
|
||||
bzero(arg[0], 50);
|
||||
strcpy(arg[0],cword);
|
||||
@ -3922,7 +3924,7 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, ':')) {
|
||||
sprintf(cword,"%s%s",cword,s.c_str());
|
||||
strcat(cword, s.c_str());
|
||||
}
|
||||
bzero(arg[1], 50);
|
||||
strcpy(arg[1],cword);
|
||||
@ -3941,7 +3943,7 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, ':')) {
|
||||
sprintf(cword,"%s%s",cword,s.c_str());
|
||||
strcat(cword, s.c_str());
|
||||
}
|
||||
bzero(arg[3], 50);
|
||||
strcpy(arg[3],cword);
|
||||
@ -3957,7 +3959,9 @@ int slsDetector::configureMAC() {
|
||||
bzero(cword, 50);
|
||||
string s;
|
||||
while (getline(ss, s, '.')) {
|
||||
sprintf(cword,"%s%02x",cword,atoi(s.c_str()));
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, "%02x", atoi(s.c_str()));
|
||||
strcat(cword, cnum);
|
||||
}
|
||||
bzero(arg[4], 50);
|
||||
strcpy(arg[4],cword);
|
||||
@ -6122,6 +6126,19 @@ int slsDetector::activate(int const enable) {
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
if (connectStop() == OK){
|
||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
stopSocket->SendDataOnly(&arg,sizeof(arg));
|
||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL) {
|
||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector (Stop server) returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(DETECTOR_ACTIVATE));
|
||||
} else {
|
||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
}
|
||||
disconnectStop();
|
||||
}
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
if(retval==1)
|
||||
@ -9325,6 +9342,18 @@ int slsDetector::enableTenGigabitEthernet(int i) {
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
}
|
||||
if (connectStop() == OK){
|
||||
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
stopSocket->SendDataOnly(&i,sizeof(i));
|
||||
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==FAIL) {
|
||||
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Detector (Stop server) returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(DETECTOR_TEN_GIGA));
|
||||
}
|
||||
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
disconnectStop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -471,6 +471,14 @@ int slsDetectorActions::executeAction(int level) {
|
||||
case headerBefore:
|
||||
fName=getCurrentFileName();
|
||||
nowIndex=getFileIndexFromFileName(getCurrentFileName());
|
||||
// all other parameters should be taken using text client calls in the header scripts!
|
||||
|
||||
sprintf(cmd,"%s nrun=%d fn=%s par=%s", \
|
||||
getActionScript(level).c_str(), \
|
||||
nowIndex, \
|
||||
fName.c_str(), \
|
||||
getActionParameter(level).c_str());
|
||||
break;
|
||||
case headerAfter:
|
||||
|
||||
// all other parameters should be taken using text client calls in the header scripts!
|
||||
|
@ -3066,7 +3066,9 @@ string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action){
|
||||
npos = myDet->getTrimEn(opos);
|
||||
if (npos != -1) {
|
||||
for (int ip=0; ip<npos;++ip) {
|
||||
sprintf(answer,"%s %d",answer,opos[ip]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, " %d", opos[ip]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3708,7 +3710,9 @@ string slsDetectorCommand::cmdPositions(int narg, char *args[], int action){
|
||||
double opos[npos];
|
||||
myDet->getPositions(opos);
|
||||
for (int ip=0; ip<npos;++ip) {
|
||||
sprintf(answer,"%s %f",answer,opos[ip]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, " %f", opos[ip]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
return string(answer);
|
||||
|
||||
@ -3887,9 +3891,11 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) {
|
||||
ns=myDet->getScanSteps(is, values);
|
||||
int p=myDet->getScanPrecision(is);
|
||||
char format[1000];
|
||||
sprintf(format, "%%s %%0.%df",p);
|
||||
sprintf(format, " %%0.%df",p);
|
||||
for (int i=0; i<ns; ++i) {
|
||||
sprintf(answer,format,answer,values[i]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, format, values[i]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
delete [] values;
|
||||
}
|
||||
@ -3954,10 +3960,11 @@ string slsDetectorCommand::cmdScans(int narg, char *args[], int action) {
|
||||
ns=myDet->getScanSteps(is, values);
|
||||
int p=myDet->getScanPrecision(is);
|
||||
char format[1000];
|
||||
sprintf(format, "%%s %%0.%df",p);
|
||||
sprintf(answer,"%d ",ns);
|
||||
sprintf(format, " %%0.%df",p);
|
||||
for (int i=0; i<ns; ++i) {
|
||||
sprintf(answer,format,answer,values[i]);
|
||||
char cnum[50]="";
|
||||
sprintf(cnum, format, values[i]);
|
||||
strcat(answer, cnum);
|
||||
}
|
||||
delete [] values;
|
||||
return string(answer);
|
||||
@ -5850,7 +5857,7 @@ string slsDetectorCommand::cmdTimeLeft(int narg, char *args[], int action) {
|
||||
|
||||
if ((ret!=-1) && (index==ACQUISITION_TIME || index==FRAME_PERIOD || index==DELAY_AFTER_TRIGGER
|
||||
|| index==ACTUAL_TIME || index==MEASUREMENT_TIME ||
|
||||
MEASURED_PERIOD || MEASURED_SUBPERIOD)) {
|
||||
index==MEASURED_PERIOD || index==MEASURED_SUBPERIOD)) {
|
||||
rval=(double)ret*1E-9;
|
||||
sprintf(answer,"%0.9f",rval);
|
||||
} else {
|
||||
|
@ -314,6 +314,10 @@ int slsDetectorUsers::enableGapPixels(int enable) {
|
||||
return myDetector->enableGapPixels(enable);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setFlippedDataX(int value) {
|
||||
return myDetector->setFlippedData(slsDetectorDefs::X, value);
|
||||
}
|
||||
|
||||
std::string slsDetectorUsers::setReceiverFramesDiscardPolicy(std::string f) {
|
||||
return myDetector->getReceiverFrameDiscardPolicy(
|
||||
myDetector->setReceiverFramesDiscardPolicy(
|
||||
|
@ -553,6 +553,12 @@ class slsDetectorUsers
|
||||
*/
|
||||
int enableGapPixels(int enable=-1);
|
||||
|
||||
/** sets the enable which determines if data will be flipped across x axis
|
||||
* @param value 0 or 1 to reset/set or -1 to get value
|
||||
* @return enable flipped data across x axis
|
||||
*/
|
||||
int setFlippedDataX(int value=-1);
|
||||
|
||||
/**
|
||||
* Sets the frames discard policy in receiver
|
||||
* frame discard policy options:
|
||||
|
@ -4361,11 +4361,11 @@ int set_all_trimbits(int file_des){
|
||||
#ifdef VERBOSE
|
||||
printf("setting all trimbits to %d\n",arg);
|
||||
#endif
|
||||
if(arg < -1){
|
||||
if(arg < -1 || arg > MAX_TRIMBITS_VALUE){
|
||||
ret = FAIL;
|
||||
strcpy(mess,"Cant set trimbits to this value\n");
|
||||
sprintf(mess,"Cant set all trimbits to %d. Range 0 - %d\n", arg, MAX_TRIMBITS_VALUE);
|
||||
cprintf(RED, "Warning: %s", mess);
|
||||
}else {
|
||||
} else {
|
||||
if(arg >= 0){
|
||||
ret = setAllTrimbits(arg);
|
||||
//changes settings to undefined
|
||||
|
@ -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: b0fd4f4c44ac378744e724cce684aca4a56fe0fc
|
||||
Revision: 872
|
||||
Branch: 4.1.1
|
||||
Repsitory UUID: 1de5b85ce2f40a83dae99272160d6574bb7e788e
|
||||
Revision: 877
|
||||
Branch: 4.2.0
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 4153
|
||||
Last Changed Date: 2020-01-14 15:47:26.000000001 +0100 ./updateAPIVersion.sh
|
||||
Last Changed Rev: 4175
|
||||
Last Changed Date: 2020-04-14 09:09:45.600925574 +0200 ./updateAPIVersion.sh
|
||||
|
@ -188,10 +188,9 @@ class BinaryFileStatic {
|
||||
* @param fd file pointer
|
||||
* @param owenable overwrite enable
|
||||
* @param fname complete file name
|
||||
* @param filebuffersize file buffer size
|
||||
* @returns 0 for success and 1 for fail
|
||||
*/
|
||||
static int CreateDataFile(FILE*& fd, bool owenable, std::string fname, size_t filebuffersize)
|
||||
static int CreateDataFile(FILE*& fd, bool owenable, std::string fname)
|
||||
{
|
||||
if(!owenable){
|
||||
if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){
|
||||
@ -204,8 +203,8 @@ class BinaryFileStatic {
|
||||
fd = 0;
|
||||
return 1;
|
||||
}
|
||||
//setting file buffer size to 16mb
|
||||
setvbuf(fd,NULL,_IOFBF,filebuffersize);
|
||||
//setting to no file buffering
|
||||
setvbuf(fd,NULL, _IONBF, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -616,7 +616,7 @@ class EigerData : public GeneralData {
|
||||
imageSize = dataSize*packetsPerFrame;
|
||||
maxFramesPerFile = EIGER_MAX_FRAMES_PER_FILE;
|
||||
fifoBufferHeaderSize= FIFO_HEADER_NUMBYTES + sizeof(slsReceiverDefs::sls_receiver_header);
|
||||
defaultFifoDepth = 100;
|
||||
defaultFifoDepth = 1000;
|
||||
threadsPerReceiver = 2;
|
||||
headerPacketSize = 40;
|
||||
standardheader = true;
|
||||
@ -630,6 +630,7 @@ class EigerData : public GeneralData {
|
||||
void SetDynamicRange(int dr, bool tgEnable) {
|
||||
packetsPerFrame = (tgEnable ? 4 : 16) * dr;
|
||||
imageSize = dataSize*packetsPerFrame;
|
||||
defaultFifoDepth = (dr == 32 ? 100 : 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -312,7 +312,7 @@ public:
|
||||
"\"quad\":%u"
|
||||
|
||||
;//"}\n";
|
||||
int length = sprintf(buf, jsonHeaderFormat,
|
||||
sprintf(buf, jsonHeaderFormat,
|
||||
jsonversion, dynamicrange, fileIndex, ndetx, ndety, npixelsx, npixelsy, imageSize,
|
||||
acqIndex, fIndex, (fname == NULL)? "":fname, dummy?0:1,
|
||||
|
||||
@ -326,10 +326,11 @@ public:
|
||||
quadEnable
|
||||
);
|
||||
if (additionalJsonHeader && strlen(additionalJsonHeader)) {
|
||||
length = sprintf(buf, "%s, %s}\n", buf, additionalJsonHeader);
|
||||
} else {
|
||||
length = sprintf(buf, "%s}\n", buf);
|
||||
strcat(buf, ", ");
|
||||
strcat(buf, additionalJsonHeader);
|
||||
}
|
||||
strcat(buf,"}\n");
|
||||
int length = strlen(buf);
|
||||
|
||||
#ifdef VERBOSE
|
||||
if(!index)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "b0fd4f4c44ac378744e724cce684aca4a56fe0fc"
|
||||
#define GITREPUUID "1de5b85ce2f40a83dae99272160d6574bb7e788e"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x4153
|
||||
#define GITDATE 0x20200114
|
||||
#define GITBRANCH "4.1.1"
|
||||
#define GITREV 0x4175
|
||||
#define GITDATE 0x20200414
|
||||
#define GITBRANCH "4.2.0"
|
||||
|
@ -17,11 +17,8 @@
|
||||
|
||||
#define STATISTIC_FRAMENUMBER_INFINITE 20000
|
||||
|
||||
//binary
|
||||
#define FILE_BUFFER_SIZE (16*1024*1024) //16mb
|
||||
|
||||
//fifo
|
||||
#define FIFO_HEADER_NUMBYTES 4
|
||||
#define FIFO_HEADER_NUMBYTES 8
|
||||
|
||||
|
||||
//hdf5
|
||||
|
@ -49,7 +49,7 @@ int BinaryFile::CreateFile(uint64_t fnum) {
|
||||
currentFileName = BinaryFileStatic::CreateFileName(filePath, fileNamePrefix, *fileIndex,
|
||||
(*numImages > 1), fnum, *detIndex, *numUnitsPerDetector, index);
|
||||
|
||||
if (BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName, FILE_BUFFER_SIZE) == FAIL)
|
||||
if (BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
if(!(*silentMode)) {
|
||||
|
@ -46,14 +46,18 @@ int Fifo::CreateFifos(uint32_t fifoItemSize) {
|
||||
fifoFree = new CircularFifo<char>(fifoDepth);
|
||||
fifoStream = new CircularFifo<char>(fifoDepth);
|
||||
//allocate memory
|
||||
size_t mem_len = fifoItemSize * fifoDepth * sizeof(char);
|
||||
size_t mem_len = (size_t)fifoItemSize * (size_t)fifoDepth * sizeof(char);
|
||||
memory = (char*) malloc (mem_len);
|
||||
if (memory == NULL){
|
||||
FILE_LOG(logERROR) << "Could not allocate memory for fifos";
|
||||
return FAIL;
|
||||
}
|
||||
memset(memory, 0, mem_len);
|
||||
FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << mem_len << " bytes";
|
||||
int pagesize = getpagesize();
|
||||
for (size_t i = 0; i < mem_len; i += pagesize) {
|
||||
strcpy(memory + i, "memory");
|
||||
}
|
||||
FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << (double)mem_len/(double)(1024 * 1024) << " MB";
|
||||
|
||||
{ //push free addresses into fifoFree fifo
|
||||
char* buffer = memory;
|
||||
|
@ -397,7 +397,9 @@ void UDPBaseImplementation::setMultiDetectorSize(const int* size) {
|
||||
numDet[i] = size[i]*2;
|
||||
else
|
||||
numDet[i] = size[i];
|
||||
sprintf(message,"%s%d",message,numDet[i]);
|
||||
char cnum[20]="";
|
||||
sprintf(cnum, "%d", numDet[i]);
|
||||
strcat(message, cnum);
|
||||
if (i < MAX_DIMENSIONS-1 )
|
||||
strcat(message,",");
|
||||
}
|
||||
@ -650,7 +652,7 @@ void UDPBaseImplementation::setSubPeriod(const uint64_t i){
|
||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||
|
||||
subPeriod = i;
|
||||
FILE_LOG(logINFO) << "Sub Exposure Time: " << (double)subPeriod/(1E9) << "s";
|
||||
FILE_LOG(logINFO) << "Sub Period: " << (double)subPeriod/(1E9) << "s";
|
||||
}
|
||||
|
||||
int UDPBaseImplementation::setNumberOfFrames(const uint64_t i){
|
||||
|
@ -119,7 +119,9 @@ void UDPStandardImplementation::setMultiDetectorSize(const int* size) {
|
||||
numDet[i] = size[i]*2;
|
||||
else
|
||||
numDet[i] = size[i];
|
||||
sprintf(message,"%s%d",message,numDet[i]);
|
||||
char cnum[20]="";
|
||||
sprintf(cnum, "%d", numDet[i]);
|
||||
strcat(message, cnum);
|
||||
if (i < MAX_DIMENSIONS-1 )
|
||||
strcat(message,",");
|
||||
}
|
||||
@ -386,6 +388,7 @@ int UDPStandardImplementation::setDynamicRange(const uint32_t i) {
|
||||
for (std::vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it)
|
||||
(*it)->SetPixelDimension();
|
||||
|
||||
fifoDepth = generalData->defaultFifoDepth;
|
||||
numberofJobs = -1; //changes to imagesize has to be noted to recreate fifo structure
|
||||
if (SetupFifoStructure() == FAIL)
|
||||
return FAIL;
|
||||
@ -826,6 +829,7 @@ int UDPStandardImplementation::SetupFifoStructure() {
|
||||
for (std::vector<Fifo*>::const_iterator it = fifo.begin(); it != fifo.end(); ++it)
|
||||
delete(*it);
|
||||
fifo.clear();
|
||||
fifoDepth = 0;
|
||||
return FAIL;
|
||||
}
|
||||
//set the listener & dataprocessor threads to point to the right fifo
|
||||
@ -834,7 +838,9 @@ int UDPStandardImplementation::SetupFifoStructure() {
|
||||
if(dataStreamer.size())dataStreamer[i]->SetFifo(fifo[i]);
|
||||
}
|
||||
|
||||
FILE_LOG(logINFO) << "Memory Allocated Per Fifo: " << ( ((generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize)) * fifoDepth) << " bytes" ;
|
||||
FILE_LOG(logINFO) << "Memory Allocated Per Fifo: " << (double)( ((size_t)(generalData->imageSize) * numberofJobs +
|
||||
(size_t)(generalData->fifoBufferHeaderSize)) * (size_t)fifoDepth)/
|
||||
(double)(1024 * 1024) << " MB" ;
|
||||
FILE_LOG(logINFO) << numThreads << " Fifo structure(s) reconstructed";
|
||||
return OK;
|
||||
}
|
||||
|
@ -16,12 +16,12 @@
|
||||
#include <sys/wait.h> //wait
|
||||
#include <unistd.h> //usleep
|
||||
#include <syscall.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
|
||||
bool keeprunning;
|
||||
sem_t semaphore;
|
||||
|
||||
void sigInterruptHandler(int p){
|
||||
keeprunning = false;
|
||||
sem_post(&semaphore);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -65,7 +65,7 @@ void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
keeprunning = true;
|
||||
sem_init(&semaphore,1,0);
|
||||
cprintf(BLUE,"Created [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||
|
||||
// Catch signal SIGINT to close files and call destructors properly
|
||||
@ -148,8 +148,8 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
FILE_LOG(logINFO) << "Ready ... ";
|
||||
cprintf(RESET, "\n[ Press \'Ctrl+c\' to exit ]\n");
|
||||
while(keeprunning)
|
||||
pause();
|
||||
sem_wait(&semaphore);
|
||||
sem_destroy(&semaphore);
|
||||
|
||||
delete receiver;
|
||||
cprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||
|
@ -542,7 +542,7 @@ int slsReceiverTCPIPInterface::set_port() {
|
||||
try {
|
||||
mySocket = new MySocketTCP(p_number);
|
||||
strcpy(mySock->lastClientIP,oldLastClientIP);
|
||||
} catch(SamePortSocketException e) {
|
||||
} catch(SamePortSocketException& e) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not bind port %d. It is already set\n", p_number);
|
||||
FILE_LOG(logERROR) << mess;
|
||||
@ -1039,6 +1039,7 @@ int slsReceiverTCPIPInterface::set_timer() {
|
||||
// else if (receiverBase->getStatus() != IDLE)
|
||||
// receiverNotIdle();
|
||||
else {
|
||||
uint64_t subdeadtime = 0;
|
||||
switch (index[0]) {
|
||||
case ACQUISITION_TIME:
|
||||
ret = receiverBase->setAcquisitionTime(index[1]);
|
||||
@ -1052,7 +1053,9 @@ int slsReceiverTCPIPInterface::set_timer() {
|
||||
receiverBase->setNumberOfFrames(index[1]);
|
||||
break;
|
||||
case SUBFRAME_ACQUISITION_TIME:
|
||||
subdeadtime = receiverBase->getSubPeriod() - receiverBase->getSubExpTime();
|
||||
receiverBase->setSubExpTime(index[1]);
|
||||
receiverBase->setSubPeriod(receiverBase->getSubExpTime() + subdeadtime);
|
||||
break;
|
||||
case SUBFRAME_DEADTIME:
|
||||
receiverBase->setSubPeriod(index[1] + receiverBase->getSubExpTime());
|
||||
@ -1903,14 +1906,14 @@ int slsReceiverTCPIPInterface::set_fifo_depth() {
|
||||
else {
|
||||
ret = receiverBase->setFifoDepth(value);
|
||||
if (ret == FAIL) {
|
||||
strcpy(mess,"Could not set fifo depth");
|
||||
strcpy(mess,"Could not set fifo depth\n");
|
||||
FILE_LOG(logERROR) << mess;
|
||||
}
|
||||
}
|
||||
}
|
||||
//get
|
||||
retval = receiverBase->getFifoDepth();
|
||||
if(value >= 0 && retval != value) {
|
||||
if(ret == OK && value >= 0 && retval != value) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not set fifo depth\n");
|
||||
FILE_LOG(logERROR) << mess;
|
||||
|
Reference in New Issue
Block a user