Compare commits

..

5 Commits

Author SHA1 Message Date
d64d0b5ac1 fixed altera pll clk dividers for ctb 2022-11-17 16:19:37 +01:00
745fca7201 binarie sin 2022-10-18 13:27:33 +02:00
9bc709b470 changing vco of new pll to 800mhz 2022-10-18 13:26:41 +02:00
64d0c35474 binary ctb in 2022-09-28 17:36:42 +02:00
c0eeae6d6d added gated clk for another pll for ctb 2022-09-28 17:35:45 +02:00
169 changed files with 6179 additions and 11681 deletions

View File

@ -83,8 +83,6 @@ endif()
#Maybe have an option guarding this?
set(SLS_INTERNAL_RAPIDJSON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson)
set(SLS_INTERNAL_QWT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/qwt-6.1.5)
set(ClangFormat_EXCLUDE_PATTERNS "build/"
"libs/"
"slsDetectorCalibration/"
@ -225,7 +223,6 @@ if (SLS_USE_RECEIVER)
endif (SLS_USE_RECEIVER)
if (SLS_USE_GUI)
add_subdirectory(libs/qwt)
add_subdirectory(slsDetectorGui)
endif (SLS_USE_GUI)

27
RELEASE.txt Normal file → Executable file
View File

@ -98,35 +98,8 @@ This document describes the differences between v7.0.0 and v6.x.x
- ctb and moench Fw fixed (to work with pattern commdand) )addreess length
- setting rx_hostname (or udp_dstip with rx_hostname not none) will always set udp_dstmac. solves problem of chaing udp_dstip and udp_dstmac stays the same
- jungfrau reset core and usleep removed (fix for 6.1.1 is now fixed in firmware)
- m3 clock update, m3 clk 4 and 5 cannot be set
- g2 change clkdivs 2 3 4 to defaults for burst and cw mode.
- ctb and moench: allowing 1g non blocking acquire to send data
- m3 and g2 rr
- m3 and g2 temp
- gain plot zooming fixed (disabled, acc. to main plot)
- ctb, moench, jungfrau (pll reset at start fixed, before no defines)
- pybind built into package, no need to update submodule when previous release had different pybind version
- adcvpp moved from dac.. and api added (ctb, moench)
- qt4->qt5
- in built qt5 6.1.5 because rhel7 is not upto date with qt5, removed findqwt.cmake
- made a fix in qwt lib (qwt_plot_layout.h) to work with 5.15 and lower versions
- qt5 forms fixed, qt4 many hard coding forms switched to forms including qtabwidget, scrolls etc, fonts moved to forms
- docking option enabled by default, removed option to disable docking feature from "Mode"
- added qVersionResolve utility functions to handle compatibility before and after qt5.12
- qtplots (ian's code) takes in gain mode enable to set some settings within the class, with proper gain plot ticks
- ensure gain plots have no zooming of z axis in 2d and y axis in 1d
- fixed some error messages in server side that were empty for fail in funcs (mostly minor as if this error, major issues)
- eiger (removed feb reset in stop acquisition as it caused processing bit to randomly not go high (leads to infinite loop waiting for it to go high). This is anyway done at prepare acquisition and set trimbits.
- left AND right registers monitored for processing bit done
- febProcessinginprogress returns STATUS_IDLE and not IDLE
- In feb stop acquisition, if processing bit is running forever, checks for 1 s, then if acq done bit is high, returns ok, else throws
- feb stop acquisition returns 1 if success and fucntion in list calling it compares properly instead of STATUS_IDLE (no effect, but incorrect logic)
- chipsignals to trimquad should only monitor right fpga (not both as it will throw)
- fixed error messages of readregister inconsistent values
- setmodule and read frame was returning fail without setting error messages (leading to broken tcp connection due to no error message) )
- gui nios temperature added
- detector header change (bunchid, reserved, debug, roundRnumber) ->detSpec1 - 4
-ctb and moench (allowing all clkdivs (totaldiv was a float instead of int))
2. Resolved Issues
==================

118
cmake/FindQwt.cmake Executable file
View File

@ -0,0 +1,118 @@
# Qt Widgets for Technical Applications
# available at http://www.http://qwt.sourceforge.net/
#
# The module defines the following variables:
# QWT_FOUND - the system has Qwt
# QWT_INCLUDE_DIR - where to find qwt_plot.h
# QWT_INCLUDE_DIRS - qwt includes
# QWT_LIBRARY - where to find the Qwt library
# QWT_LIBRARIES - aditional libraries
# QWT_MAJOR_VERSION - major version
# QWT_MINOR_VERSION - minor version
# QWT_PATCH_VERSION - patch version
# QWT_VERSION_STRING - version (ex. 5.2.1)
# QWT_ROOT_DIR - root dir (ex. /usr/local)
#=============================================================================
# Copyright 2010-2013, Julien Schueller
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# The views and conclusions contained in the software and documentation are those
# of the authors and should not be interpreted as representing official policies,
# either expressed or implied, of the FreeBSD Project.
#=============================================================================
find_path ( QWT_INCLUDE_DIR
NAMES qwt_plot.h
HINTS $ENV{QWTDIR} $ENV{QWTDIR}/src ${QT_INCLUDE_DIR}
PATH_SUFFIXES qwt qwt-qt3 qwt-qt4 qwt-qt5
)
set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} )
# version
set ( _VERSION_FILE ${QWT_INCLUDE_DIR}/qwt_global.h )
if ( EXISTS ${_VERSION_FILE} )
file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QWT_VERSION_STR" )
if ( _VERSION_LINE )
string ( REGEX REPLACE ".*define[ ]+QWT_VERSION_STR[ ]+\"(.*)\".*" "\\1" QWT_VERSION_STRING "${_VERSION_LINE}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QWT_MAJOR_VERSION "${QWT_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QWT_MINOR_VERSION "${QWT_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QWT_PATCH_VERSION "${QWT_VERSION_STRING}" )
endif ()
endif ()
# check version
set ( _QWT_VERSION_MATCH TRUE )
if ( Qwt_FIND_VERSION AND QWT_VERSION_STRING )
if ( Qwt_FIND_VERSION_EXACT )
if ( NOT Qwt_FIND_VERSION VERSION_EQUAL QWT_VERSION_STRING )
set ( _QWT_VERSION_MATCH FALSE )
endif ()
else ()
if ( QWT_VERSION_STRING VERSION_LESS Qwt_FIND_VERSION )
set ( _QWT_VERSION_MATCH FALSE )
endif ()
endif ()
endif ()
find_library ( QWT_LIBRARY
NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
HINTS $ENV{QWTDIR}/lib ${QT_LIBRARY_DIR}
)
set ( QWT_LIBRARIES ${QWT_LIBRARY} )
# try to guess root dir from include dir
if ( QWT_INCLUDE_DIR )
string ( REGEX REPLACE "(.*)/include.*" "\\1" QWT_ROOT_DIR ${QWT_INCLUDE_DIR} )
# try to guess root dir from library dir
elseif ( QWT_LIBRARY )
string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QWT_ROOT_DIR ${QWT_LIBRARY} )
endif ()
# handle the QUIETLY and REQUIRED arguments
include ( FindPackageHandleStandardArgs )
if ( CMAKE_VERSION LESS 2.8.3 )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH )
else ()
find_package_handle_standard_args( Qwt REQUIRED_VARS QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH VERSION_VAR QWT_VERSION_STRING )
endif ()
mark_as_advanced (
QWT_LIBRARY
QWT_LIBRARIES
QWT_INCLUDE_DIR
QWT_INCLUDE_DIRS
QWT_MAJOR_VERSION
QWT_MINOR_VERSION
QWT_PATCH_VERSION
QWT_VERSION_STRING
QWT_ROOT_DIR
)

View File

@ -988,7 +988,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
ped=0;
aval=dataStructure->getValue(data->data,x,y);
//aval=dataStructure->getChannel(data->data,x,y);
// cout << x << " " <<y << " "<< aval << endl;
cout << x << " " <<y << " "<< aval << endl;
if (cbGetPedestal->IsOn()) {
if (photonFinder) {
photonFinder->addToPedestal(aval,x,y);

View File

@ -0,0 +1,112 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <math.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int iarg;
char fname[10000];
uint64_t word;
int val[64];
int bit[64];
FILE *fdin;
int nb=2;
int off=0;
int ioff=0;
int dr=24;
int idr=0;
int ib=0;
int iw=0;
bit[0]=19;
bit[1]=8;
// for (iarg=0; iarg<argc; iarg++) printf("%d %s\n",iarg, argv[iarg]);
if (argc<2) printf("Error: usage is %s fname [dr off b0 b1 bn]\n");
if (argc>2) dr=atoi(argv[2]);
if (argc>3) off=atoi(argv[3]);
if (argc>4) {
for (ib=0; ib<64; ib++) {
if (argc>4+ib) {
bit[ib]=atoi(argv[4+ib]);
nb++;
}
}
}
idr=0;
for (ib=0; ib<nb; ib++) {
val[ib]=0;
}
fdin=fopen(argv[1],"rb");
if (fdin==NULL) {
printf("Cannot open input file %s for reading\n",argv[1]);
return 200;
}
while (fread((void*)&word, 8, 1, fdin)) {
// printf("%llx\n",word);
if (ioff<off) ioff++;
else {
for (ib=0; ib<nb; ib++) {
if (word&(1<<bit[ib])) val[ib]|=(1<<idr);
}
idr++;
if (idr==dr) {
idr=0;
fprintf(stdout,"%d\t",iw++);
for (ib=0; ib<nb; ib++) {
#ifdef HEX
fprintf(stdout,"%08llx\t",val[ib]);
#else
fprintf(stdout,"%lld\t",val[ib]);
#endif
val[ib]=0;
}
fprintf(stdout,"\n");
}
}
}
if (idr!=0) {
fprintf(stdout,"%d\t",iw++);
for (ib=0; ib<nb; ib++) {
#ifdef HEX
fprintf(stdout,"%08llx\t",val[ib]);
#else
fprintf(stdout,"%lld\t",val[ib]);
#endif
val[ib]=0;
}
fprintf(stdout,"\n");
}
fclose(fdin);
return 0;
}

View File

@ -0,0 +1,179 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/****************************************************************************
usage to generate a patter test.pat from test.p
gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ; ./test.exe ; rm test.exe
*************************************************************************/
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <math.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAXLOOPS 3
#define MAXTIMERS 3
#define MAXWORDS 1024
uint64_t pat=0;
uint64_t iopat=0;
uint64_t clkpat=0;
int iaddr=0;
int waitaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
int startloopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
int stoploopaddr[3]={MAXWORDS,MAXWORDS,MAXWORDS};
int start=0, stop=0;
uint64_t waittime[3]={0,0,0};
int nloop[3]={0,0,0};
char infile[10000], outfile[10000];
FILE *fd, *fd1;
uint64_t PAT[MAXWORDS];
int i,ii,iii,j,jj,jjj,pixx,pixy,memx,memy,muxout,memclk,colclk,rowclk,muxclk,memcol,memrow,loopcounter;
void setstart() {
start=iaddr;
}
void setstop() {
stop=iaddr;
}
void setinput(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat &= ~mask;
}
void setoutput(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat |= mask;
}
/*
void setclk(int bit) {
uint64_t mask=1;
mask=mask<<bit;
iopat |= mask;
clkpat |= mask;
}
*/
void clearbit(int bit){
uint64_t mask=1;
mask=mask<<bit;
pat &= ~mask;
}
void setbit(int bit){
uint64_t mask=1;
mask=mask<<bit;
pat |= mask;
}
int checkbit(int bit) {
uint64_t mask=1;
mask=mask<<bit;
return (pat & mask ) >>bit;
}
void setstartloop(int iloop) {
if (iloop>=0 && iloop<MAXLOOPS)
startloopaddr[iloop]=iaddr;
}
void setstoploop(int iloop) {
if (iloop>=0 && iloop<MAXLOOPS)
stoploopaddr[iloop]=iaddr;
}
void setnloop(int iloop, int n) {
if (iloop>=0 && iloop<MAXLOOPS)
nloop[iloop]=n;
}
void setwaitpoint(int iloop) {
if (iloop>=0 && iloop<MAXTIMERS)
waitaddr[iloop]=iaddr;
}
void setwaittime(int iloop, uint64_t t) {
if (iloop>=0 && iloop<MAXTIMERS)
waittime[iloop]=t;
}
void pw(){
if (iaddr<MAXWORDS)
PAT[iaddr]= pat;
fprintf(fd,"patword 0x%04x 0x%016llx\n",iaddr, pat);
iaddr++;
if (iaddr>=MAXWORDS) printf("ERROR: too many word in the pattern (%d instead of %d)!",iaddr, MAXWORDS);
}
int parseCommand(int clk, int cmdbit, int cmd, int length) {
int ibit;
clearbit(clk);
for (ibit=0; ibit<length; ibit++) {
if (cmd&(1>>ibit))
setbit(cmdbit);
else
clearbit(cmdbit);
pw();
/******/
setbit(clk);
pw();
/******/
}
};
main(void) {
int iloop=0;
fd=fopen(OUTFILE,"w");
#include INFILE
fprintf(fd,"patioctrl 0x%016llx\n",iopat);
//fprintf(fd,"patclkctrl 0x%016llx\n",clkpat);
fprintf(fd,"patlimits 0x%04x 0x%04x\n",start, stop);
for (iloop=0; iloop<MAXLOOPS; iloop++) {
fprintf(fd,"patloop%d 0x%04x 0x%04x\n",iloop, startloopaddr[iloop], stoploopaddr[iloop]);
if ( startloopaddr[iloop]<0 || stoploopaddr[iloop]<= startloopaddr[iloop]) nloop[iloop]=0;
fprintf(fd,"patnloop%d %d\n",iloop, nloop[iloop]);
}
for (iloop=0; iloop<MAXTIMERS; iloop++) {
fprintf(fd,"patwait%d 0x%04x\n",iloop, waitaddr[iloop]);
if (waitaddr[iloop]<0) waittime[iloop]=0;
fprintf(fd,"patwaittime%d %lld\n",iloop, waittime[iloop]);
}
close((int)fd);
fd1=fopen(OUTFILEBIN,"w");
fwrite(PAT,sizeof(uint64_t),iaddr, fd1);
close((int)fd1);
}

View File

@ -55,9 +55,6 @@ set(SPHINX_SOURCE_FILES
src/troubleshooting.rst
src/receivers.rst
src/slsreceiver.rst
src/udpheader.rst
src/udpconfig.rst
src/udpdetspec.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})

View File

@ -66,15 +66,6 @@ Welcome to slsDetectorPackage's documentation!
virtualserver
serverdefaults
.. toctree::
:caption: Detector UDP Header
:maxdepth: 2
udpheader
udpconfig
udpdetspec
.. toctree::
:caption: Receiver
:maxdepth: 2

View File

@ -27,18 +27,13 @@ Build from source using CMake
---------------------------------
Note that on some systems, for example RH7, cmake v3+ is available under the cmake3 alias.
It is also required to clone with the option --recursive to get the pybind11 submodules used
in the package. (Only needed for older versions than v7.0.0)
It is also required to clone with the option --recursive to get the git submodules used
in the package.
.. code-block:: bash
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
# if older than v7.0.0 and using python, update pybind11 submodules
cd slsDetectorPackage
git submodule update --init
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
make -j12 #or whatever number of cores you are using to build
@ -60,29 +55,27 @@ These are mainly aimed at those not familiar with using ccmake and cmake.
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>] [-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>] [r] [s] [t] [u] [z]
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds only gui
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
-d: HDF5 Custom Directory
-k: CMake command
-l: Install directory
-t: Build/Rebuilds only text client
-r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui
-s: Simulator
-u: Chip Test Gui
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
# get all options
./cmk.sh -?

View File

@ -17,22 +17,6 @@ environments.
.. warning ::
If you use conda avoid also installing packages with pip.
---------------------
PYBIND11
---------------------
**v7.0.0 of slsDetectorPackage:**
#. It is packaged into libs (pybind)
#. No longer a submodule of the slsDetectorPackage
**Older than v7.0.0:**
#. Submodule in libs (pybind11)
#. Switching between versions will require an update of the submodule as well using:
.. code-block:: bash
git submodule update --init #from the main slsDetectorPackage folder
---------------------
PYTHONPATH

View File

@ -4,8 +4,41 @@ Receivers
Receiver processes can be run on same or different machines as the client, receives the data from the detector (via UDP packets).
When using the slsReceiver/ slsMultiReceiver, they can be further configured by the client control software (via TCP/IP) to set file name, file path, progress of acquisition etc.
Detector UDP Header
---------------------
| The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
**The SLS Detector Header**
.. table:: <-------------------------------- 8 bytes -------------------------------->
:align: center
:widths: 30,30,30,30
+--------------------------------------------------------------------+
|frameNumber |
+---------------------------------+----------------------------------+
|expLength |packetNumber |
+---------------------------------+----------------------------------+
|bunchId |
+--------------------------------------------------------------------+
|timestamp |
+----------------+----------------+----------------+-----------------+
|modId |row |column |reserved |
+----------------+----------------+----------------+--------+--------+
|debug |roundRNumber |detType |version |
+---------------------------------+----------------+--------+--------+
UDP configuration in Config file
----------------------------------
#. UDP source port is hardcoded in detector server, starting at 32410.
#. **udp_dstport** : UDP destination port number. Port in receiver pc to listen to packets from the detector.
#. **udp_dstip** : IP address of UDP destination interface. IP address of interface in receiver pc to listen to packets from detector. If **auto** is used (only when using slsReceiver/ slsMultiReceiver), the IP of **rx_hostname** is picked up.
#. **udp_dstmac** : Mac address of UDP destination interface. MAC address of interface in receiver pc to list to packets from detector. Only required when using custom receiver, else slsReceiver/slsMultiReceiver picks it up from **udp_dstip**.
#. **udp_srcip** : IP address of UDP source interface. IP address of detector UDP interface to send packets from. Do not use for Eiger 1Gb interface (uses its hardware IP). For others, must be in the same subnet as **udp_dstip**.
#. **udp_srcmac** : MAC address of UDP source interface. MAC address of detector UDP interface to send packets from. Do not use for Eiger (uses hardware mac). For others, it is not necessary, but can help for switch and debugging to put unique values for each module.
To know more about detector receiver configuration, please check out :ref:`detector udp header and udp commands in the config file <detector udp header>`
Custom Receiver
----------------

View File

@ -1,14 +1,5 @@
Getting Started
===============
Detector Servers include:
* Control server [default port: 1952]
* Almost all client communication.
* Stop server [default port: 1953]
* Client requests for detector status, stop acquisition, temperature, advanced read/write registers.
When using a blocking acquire command (sls_detector_acquire or Detector::acquire), the control server is blocked until end of acquisition. However, stop server commands could be used in parallel.
Detector Servers
=================
Location
---------
@ -33,6 +24,17 @@ Arguments
-s, --stopserver : Stop server. Do not use as it is created by control server
Basics
------------
Detector Servers include:
* Control server [default port: 1952]
* Almost all client communication.
* Stop server [default port: 1953]
* Client requests for detector status, stop acquisition, temperature, advanced read/write registers.
When using a blocking acquire command (sls_detector_acquire or Detector::acquire), the control server is blocked until end of acquisition. However, stop server commands could be used in parallel.
.. _Automatic start servers:
Automatic start

View File

@ -1,6 +1,6 @@
.. _Detector Server Upgrade:
Upgrade
========
Detector Server Upgrade
=======================
**Location:** slsDetectorPackage/serverBin/ folder for every release.
@ -14,7 +14,7 @@ Upgrade
Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet.
6.1.1+ (no tftp required)
From 6.1.1 and above (no tftp required)
---------------------------------------
#. Program from console
@ -60,7 +60,7 @@ Troubleshooting with tftp
#. text file busy: You are trying to copy the same server.
< 5.0.0
--------
Older than 5.0.0
-----------------
Please contact us.

View File

@ -144,30 +144,6 @@ Receiver PC Tuning Options
| xth1 is example interface name.
| These settings are lost at pc reboot.
#. Disable CPU frequency scaling and set system to performance
* Check current policy (default might be powersave or schedutil)
.. code-block:: bash
# check current active governor and range of cpu freq policy
cpupower frequency-info --policy
# list all available governors for this kernel
cpupower frequency-info --governors
* Temporarily (until shut down)
.. code-block:: bash
# set to performance
sudo cpupower frequency-set -g performance
* Permanently
.. code-block:: bash
# edit /etc/sysconfig/cpupower to preference
# enable or disable permanently
sudo systemctl enable cpupower
#. Give user speicific user scheduling privileges.
.. code-block:: bash

View File

@ -1,33 +0,0 @@
.. _detector udp header:
Config file
============
Commands to configure the UDP in the config file:
Source Port
-----------
Hardcoded in detector server, starting at 32410.
udp_srcip - Source IP
---------------------
IP address of detector UDP interface to send packets from. Do not use for Eiger 1Gb interface (uses its hardware IP). For others, must be in the same subnet as **udp_dstip**.
udp_srcmac - Source MAC
-----------------------
MAC address of detector UDP interface to send packets from. Do not use for Eiger (uses hardware mac). For others, it is not necessary, but can help for switch and debugging to put unique values for each module.
udp_dstport - Desintation Port
-------------------------------
Port in receiver pc to listen to packets from the detector.
udp_dstip - Destination IP
--------------------------
IP address of interface in receiver pc to listen to packets from detector. If **auto** is used (only when using slsReceiver/ slsMultiReceiver), the IP of **rx_hostname** is picked up.
udp_dstmac - Destination MAC
----------------------------
MAC address of interface in receiver pc to list to packets from detector. Only required when using custom receiver, else slsReceiver/slsMultiReceiver picks it up from **udp_dstip**.

View File

@ -1,19 +0,0 @@
Detector Specific Fields
========================
Eiger
-----
.. table::
+----------+------------------------------+
| detSpec1 | 0x0 |
+----------+------------------------------+
| detSpec2 | 0x0 |
+----------+------------------------------+
| detSpec3 | e14a |
+----------+------------------------------+
| detSpec4 | Round Robin Interface Number |
+----------+------------------------------+

View File

@ -1,75 +0,0 @@
.. _detector udp header:
Format
=======
The UDP data format for the packets consist of a common header for all detectors, followed by the data for that one packet.
Current Version
---------------------------
**v3.0 (slsDetectorPackage v7.0.0+)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
:align: center
:widths: 30,30,30,15,15
+---------------------------------------------------------------+
| frameNumber |
+-------------------------------+-------------------------------+
| expLength | packetNumber |
+-------------------------------+-------------------------------+
| **detSpec1** |
+---------------------------------------------------------------+
| timestamp |
+---------------+---------------+---------------+---------------+
| modId | row | column | **detSpec2** |
+---------------+---------------+---------------+-------+-------+
| **detSpec3** | **detSpec4** |detType|version|
+-------------------------------+---------------+-------+-------+
Previous Versions
-----------------
**v2.0 (Package v4.0.0 - 6.x.x)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
:align: center
:widths: 30,30,30,15,15
+---------------------------------------------------------------+
| frameNumber |
+-------------------------------+-------------------------------+
| expLength | packetNumber |
+-------------------------------+-------------------------------+
| bunchid |
+---------------------------------------------------------------+
| timestamp |
+---------------+---------------+---------------+---------------+
| modId | **row** | **column** | **reserved** |
+---------------+---------------+---------------+-------+-------+
| debug | roundRNumber |detType|version|
+-------------------------------+---------------+-------+-------+
**v1.0 (Package v3.0.0 - 3.1.5)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
:align: center
:widths: 30,30,30,15,15
+---------------------------------------------------------------+
| frameNumber |
+-------------------------------+-------------------------------+
| expLength | packetNumber |
+-------------------------------+-------------------------------+
| bunchid |
+---------------------------------------------------------------+
| timestamp |
+---------------+---------------+---------------+---------------+
| modId | xCoord | yCoord | zCoord |
+---------------+---------------+---------------+-------+-------+
| debug | roundRNumber |detType|version|
+-------------------------------+---------------+-------+-------+

View File

@ -1,6 +1,6 @@
.. _Virtual Detector Servers:
Simulators
===========
Detector Simulators
===================
Compilation
-----------

24
evalVersionVariables.sh Executable file
View File

@ -0,0 +1,24 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
GITREPO1='git remote -v'
GITREPO2=" | grep \"fetch\" | cut -d' ' -f1"
BRANCH1='git branch -v'
BRANCH2=" | grep '*' | cut -d' ' -f2"
REPUID1='git log --pretty=format:"%H" -1'
AUTH1_1='git log --pretty=format:"%cn" -1'
AUTH1_2=" | cut -d' ' -f1"
AUTH2_1='git log --pretty=format:"%cn" -1'
AUTH2_2=" | cut -d' ' -f2"
FOLDERREV1='git log --oneline . ' #used for all the individual server folders
FOLDERREV2=" | wc -l" #used for all the individual server folders
REV1='git log --oneline '
REV2=" | wc -l"
GITREPO=`eval $GITREPO1 $GITREPO2`
BRANCH=`eval $BRANCH1 $BRANCH2`
REPUID=`eval $REPUID1`
AUTH1=`eval $AUTH1_1 $AUTH1_2`
AUTH2=`eval $AUTH2_1 $AUTH2_2`
REV=`eval $REV1 $REV2`
FOLDERREV=`eval $FOLDERREV1 $FOLDERREV2`

View File

@ -3,33 +3,33 @@
### edit with hostname or IP address of your detector
############################################
#hostname bchip181+
hostname bchip135
hostname bchip119.psi.ch
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011
rx_hostname mpc2011:1777
#############################################
### edit with 10 Gbs IP of your server
############################################
udp_dstip 10.1.1.102
udp_dstip 10.1.2.102
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
udp_srcip 10.1.1.19
udp_dstport 32411
udp_srcip 10.1.2.19
udp_dstport 32000
#############################################
### edit with 10 Gbs IP of your server
############################################
rx_zmqip 10.1.1.102
rx_zmqport 50003
rx_zmqip 10.1.2.102
rx_zmqport 77000
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
zmqip 129.129.202.57
zmqport 50001
zmqip 129.129.202.132
zmqport 77001
@ -38,7 +38,7 @@ rx_zmqstream 1
frames 100000
frames 1000
period 0.0006
exptime 0.00035
@ -62,3 +62,9 @@ highvoltage 90
#adcreg 0x14 0x40
frames 10
period 0.1
rx_jsonpara subframes 1
rx_jsonpara frameMode raw
rx_jsonpara detectorMode analog

27
genVersionHeader.sh Executable file
View File

@ -0,0 +1,27 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
#####! /bin/awk -f
if [ $# -lt 3 ]
then
echo "wrong usage"
exit -1
fi
fin=$1
ftmp=$2
fout=$3
#dat=echo "date '+%Y%m%d'"
echo "Updating $fout"
#echo "in: $fin tmp: $ftmp out: $fout"
#awk 'NR==FNR {if ($3=="Date:") {l[FNR]=$4; gsub("-","",l[FNR]);} else { if (match($0,"Rev")) {l[FNR]=$(NF);} else {l[FNR]="\""$(NF)"\"";};};next} {$0=$1" "$2" "l[FNR]}1' $fin $ftmp > $fout
awk 'BEGIN {l[0]=0; "date +%Y%m%d" | getline l[1]; l[2]="\"/\""; l[3]="\"nobody\""; l[3]="\"nobody\""; l[4]="\"0000-0000-0000\"";} \
NR==FNR {if (match($0,"Rev")) {l[0]="0x"$(NF);} else if (match($0,"Date")) {l[1]="0x"$4; gsub("-","",l[1]);} else if (match($0,"URL")) {l[2]="\""$(NF)"\"";} else if (match($0,"Author")) {l[3]="\""$(NF)"\"";} else if (match($0,"UUID")) {l[4]="\""$(NF)"\"";} else if (match($0,"Branch")) {l[5]="\""$(NF)"\"";};next;}
{if (match($2,"REV")) {$0=$1" "$2" "l[0];} else if (match($2,"DATE")) {$0=$1" "$2" "l[1];} else if (match($2,"URL")) {$0=$1" "$2" "l[2];} else if (match($2,"AUTH")) {$0=$1" "$2" "l[3];} else if (match($2,"UUID")) {$0=$1" "$2" "l[4];} else if (match($2,"BRANCH")) {$0=$1" "$2" "l[5];}}1' $fin $ftmp > $fout

View File

@ -50,8 +50,8 @@ TEST_CASE("Set control port then create a new object with this control port",
Is this the best way to initialize the detectors
Using braces to make the object go out of scope
*/
int old_cport = DEFAULT_TCP_CNTRL_PORTNO;
int old_sport = DEFAULT_TCP_STOP_PORTNO;
int old_cport = DEFAULT_PORTNO;
int old_sport = DEFAULT_PORTNO + 1;
int new_cport = 1993;
int new_sport = 2000;
{
@ -79,7 +79,7 @@ TEST_CASE("Set control port then create a new object with this control port",
Module d(test::type);
d.setHostname(test::hostname);
CHECK(d.getStopPort() == DEFAULT_TCP_STOP_PORTNO);
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
d.freeSharedMemory();
}

View File

@ -1,57 +0,0 @@
#inspired by: https://github.com/ericriff/qwt/blob/master/CMakeLists.txt
# Build a static version of qwt from tar file
cmake_minimum_required(VERSION 3.12)
project(qwt)
set(PROJECT_VERSION 6.1.5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Extract qwt sources from the supplied source file
set(INTERNALQWTDIR "qwt-source/")
set(QWTBASE ${CMAKE_CURRENT_BINARY_DIR}/${INTERNALQWTDIR})
file(MAKE_DIRECTORY ${QWTBASE})
execute_process(
COMMAND tar -xf ${CMAKE_CURRENT_SOURCE_DIR}/qwt-6.1.5.tar.bz2 -C ${QWTBASE} --strip-components=1
RESULT_VARIABLE ret
)
if(ret AND NOT ret EQUAL 0)
message( FATAL_ERROR "Could not unpack qwt")
endif()
# Without this define moc files are not included and linking of examples fails.
add_definitions(-DQWT_MOC_INCLUDE)
find_package(Qt5 REQUIRED
COMPONENTS
Core
Gui
Widgets
OpenGL
Concurrent
PrintSupport
Svg
)
file(GLOB QWT_SOURCES ${QWTBASE}src/*.cpp)
file(GLOB QWT_HEADERS ${QWTBASE}src/*.h)
add_library(qwt STATIC ${QWT_SOURCES} ${QWT_HEADERS} )
target_include_directories(qwt PUBLIC
$<BUILD_INTERFACE:${QWTBASE}/src>
)
target_link_libraries(qwt PUBLIC
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::OpenGL
Qt5::Concurrent
Qt5::PrintSupport
Qt5::Svg
)
# Disable all warnings in QWT since we dont want to patch the library
target_compile_options(qwt PRIVATE -w)

Binary file not shown.

View File

@ -1,110 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int iarg;
char fname[10000];
uint64_t word;
int val[64];
int bit[64];
FILE *fdin;
int nb = 2;
int off = 0;
int ioff = 0;
int dr = 24;
int idr = 0;
int ib = 0;
int iw = 0;
bit[0] = 19;
bit[1] = 8;
// for (iarg=0; iarg<argc; iarg++) printf("%d %s\n",iarg, argv[iarg]);
if (argc < 2)
printf("Error: usage is %s fname [dr off b0 b1 bn]\n");
if (argc > 2)
dr = atoi(argv[2]);
if (argc > 3)
off = atoi(argv[3]);
if (argc > 4) {
for (ib = 0; ib < 64; ib++) {
if (argc > 4 + ib) {
bit[ib] = atoi(argv[4 + ib]);
nb++;
}
}
}
idr = 0;
for (ib = 0; ib < nb; ib++) {
val[ib] = 0;
}
fdin = fopen(argv[1], "rb");
if (fdin == NULL) {
printf("Cannot open input file %s for reading\n", argv[1]);
return 200;
}
while (fread((void *)&word, 8, 1, fdin)) {
// printf("%llx\n",word);
if (ioff < off)
ioff++;
else {
for (ib = 0; ib < nb; ib++) {
if (word & (1 << bit[ib]))
val[ib] |= (1 << idr);
}
idr++;
if (idr == dr) {
idr = 0;
fprintf(stdout, "%d\t", iw++);
for (ib = 0; ib < nb; ib++) {
#ifdef HEX
fprintf(stdout, "%08llx\t", val[ib]);
#else
fprintf(stdout, "%lld\t", val[ib]);
#endif
val[ib] = 0;
}
fprintf(stdout, "\n");
}
}
}
if (idr != 0) {
fprintf(stdout, "%d\t", iw++);
for (ib = 0; ib < nb; ib++) {
#ifdef HEX
fprintf(stdout, "%08llx\t", val[ib]);
#else
fprintf(stdout, "%lld\t", val[ib]);
#endif
val[ib] = 0;
}
fprintf(stdout, "\n");
}
fclose(fdin);
return 0;
}

View File

@ -1,183 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
/****************************************************************************
usage to generate a patter test.pat from test.p
gcc -DINFILE="\"test.p\"" -DOUTFILE="\"test.pat\"" -o test.exe generator.c ;
./test.exe ; rm test.exe
*************************************************************************/
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
#define MAXLOOPS 6
#define MAXTIMERS 6
#define MAXWORDS 8191
uint64_t pat = 0;
uint64_t iopat = 0;
uint64_t clkpat = 0;
unsigned iaddr = 0;
unsigned waitaddr[MAXTIMERS] = {MAXWORDS, MAXWORDS, MAXWORDS,
MAXWORDS, MAXWORDS, MAXWORDS};
unsigned startloopaddr[MAXLOOPS] = {MAXWORDS, MAXWORDS, MAXWORDS,
MAXWORDS, MAXWORDS, MAXWORDS};
unsigned stoploopaddr[MAXLOOPS] = {MAXWORDS, MAXWORDS, MAXWORDS,
MAXWORDS, MAXWORDS, MAXWORDS};
unsigned start = 0, stop = 0;
uint64_t waittime[MAXTIMERS] = {0, 0, 0, 0, 0, 0};
unsigned nloop[MAXLOOPS] = {0, 0, 0, 0, 0, 0};
char infile[10000], outfile[10000];
FILE *fd, *fd1;
uint64_t PAT[MAXWORDS];
int iopat_enable = 0;
int i, ii, iii, j, jj, jjj, pixx, pixy, memx, memy, muxout, memclk, colclk,
rowclk, muxclk, memcol, memrow, loopcounter;
void setstart() { start = iaddr; }
void setstop() { stop = iaddr; }
void setinput(int bit) {
uint64_t mask = 1;
mask = mask << bit;
iopat &= ~mask;
iopat_enable = 1;
}
void setoutput(int bit) {
uint64_t mask = 1;
mask = mask << bit;
iopat |= mask;
iopat_enable = 1;
}
void clearbit(int bit) {
uint64_t mask = 1;
mask = mask << bit;
pat &= ~mask;
}
void setbit(int bit) {
uint64_t mask = 1;
mask = mask << bit;
pat |= mask;
}
int checkbit(int bit) {
uint64_t mask = 1;
mask = mask << bit;
return (pat & mask) >> bit;
}
void setstartloop(int iloop) {
if (iloop >= 0 && iloop < MAXLOOPS) {
startloopaddr[iloop] = iaddr;
}
}
void setstoploop(int iloop) {
if (iloop >= 0 && iloop < MAXLOOPS) {
stoploopaddr[iloop] = iaddr;
}
}
void setnloop(int iloop, int n) {
if (iloop >= 0 && iloop < MAXLOOPS) {
nloop[iloop] = n;
}
}
void setwaitpoint(int iloop) {
if (iloop >= 0 && iloop < MAXTIMERS) {
waitaddr[iloop] = iaddr;
}
}
void setwaittime(int iloop, uint64_t t) {
if (iloop >= 0 && iloop < MAXTIMERS) {
waittime[iloop] = t;
}
}
void pw() {
if (iaddr < MAXWORDS) {
PAT[iaddr] = pat;
}
fprintf(fd, "patword 0x%04x 0x%016llx\n", iaddr, pat);
iaddr++;
if (iaddr >= MAXWORDS) {
printf("ERROR: too many word in the pattern (%d instead of %d)!", iaddr,
MAXWORDS);
}
}
int parseCommand(int clk, int cmdbit, int cmd, int length) {
int ibit;
clearbit(clk);
for (ibit = 0; ibit < length; ibit++) {
if (cmd & (1 >> ibit)) {
setbit(cmdbit);
} else {
clearbit(cmdbit);
}
pw();
/******/
setbit(clk);
pw();
/******/
}
};
int main() {
int iloop = 0;
fd = fopen(OUTFILE, "w");
#include INFILE
fprintf(fd, "patlimits 0x%04x 0x%04x\n", start, stop);
if (iopat_enable == 1) {
fprintf(fd, "patioctrl 0x%016llx\n", iopat);
}
for (iloop = 0; iloop < MAXLOOPS; iloop++) {
if ((startloopaddr[iloop] != MAXWORDS) &&
(stoploopaddr[iloop] != MAXWORDS)) {
fprintf(fd, "patloop %d 0x%04x 0x%04x\n", iloop,
startloopaddr[iloop], stoploopaddr[iloop]);
if (stoploopaddr[iloop] <= startloopaddr[iloop]) {
nloop[iloop] = 0;
}
fprintf(fd, "patnloop %d %u\n", iloop, nloop[iloop]);
}
}
for (iloop = 0; iloop < MAXTIMERS; iloop++) {
if (waitaddr[iloop] != MAXWORDS) {
fprintf(fd, "patwait %d 0x%04x\n", iloop, waitaddr[iloop]);
fprintf(fd, "patwaittime %d %llu\n", iloop, waittime[iloop]);
}
}
fclose(fd);
fd1 = fopen(OUTFILEBIN, "w");
fwrite(PAT, sizeof(uint64_t), iaddr, fd1);
fclose(fd1);
return 0;
}

View File

@ -1,4 +0,0 @@
BIT0 output0 1
BIT1 output1 1
BIT2 output2 1
BIT3 output3 1

View File

@ -1,97 +0,0 @@
//define signals and directions (Input, outputs, clocks)
#define output0 0
setoutput(output0);
#define output1 1
setoutput(output1);
#define output2 2
setoutput(output2);
#define output3 3
setoutput(output3);
#define input0 4
setinput(input0);
#define input1 5
setinput(input1);
#define input2 6
setinput(input2);
#define input3 7
setinput(input3);
#define PW pw()
#define SB(x) setbit(x)
#define CB(x) clearbit(x)
#define CLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw()
#define LCLOCK clearbit(CLKBIT); pw();setbit(CLKBIT);pw();clearbit(CLKBIT); pw()
#define CLOCKS(x) for (i=0;i<x;i++) {clearbit(CLKBIT);pw(); setbit(CLKBIT); pw();}
#define STOP setstop();
#define START setstart();
#define REPEAT(x) for (i=0;i<(x);i++) {pw();}
#define DOFOR(x) for (j=0;j<(x);j++) {
// }
#define INST0 CB(output3);CB(output2);CB(output1);CB(output0);PW;
#define INST1 CB(output3);CB(output2);CB(output1);SB(output0);PW;
#define INST2 CB(output3);CB(output2);SB(output1);CB(output0);PW;
#define INST3 CB(output3);CB(output2);SB(output1);SB(output0);PW;
#define INST4 CB(output3);SB(output2);CB(output1);CB(output0);PW;
#define INST5 CB(output3);SB(output2);CB(output1);SB(output0);PW;
#define INST6 CB(output3);SB(output2);SB(output1);CB(output0);PW;
#define INST7 CB(output3);SB(output2);SB(output1);SB(output0);PW;
#define INST8 SB(output3);CB(output2);CB(output1);CB(output0);PW;
#define INST9 SB(output3);CB(output2);CB(output1);SB(output0);PW;
#define INST10 SB(output3);CB(output2);SB(output1);CB(output0);PW;
#define INST11 SB(output3);CB(output2);SB(output1);SB(output0);PW;
#define INST12 SB(output3);SB(output2);CB(output1);CB(output0);PW;
START;
INST0;
setwaitpoint(0);
setwaittime(0,5);
INST1;
setstartloop(5);
setnloop(5,2);
INST2;
setstartloop(0);
setnloop(0,2);
INST3;
INST4;
setstoploop(0);
setstoploop(5);
INST5;
INST6;
setwaitpoint(4);
setwaittime(1,0);
INST7;
INST8;
setstartloop(2);
setnloop(2,0);
INST9;
INST10;
setstoploop(2);
INST11;
STOP;
INST12;

View File

@ -1,25 +0,0 @@
patword 0x0000 0x0000000000000000
patword 0x0001 0x0000000000000001
patword 0x0002 0x0000000000000002
patword 0x0003 0x0000000000000003
patword 0x0004 0x0000000000000004
patword 0x0005 0x0000000000000005
patword 0x0006 0x0000000000000006
patword 0x0007 0x0000000000000007
patword 0x0008 0x0000000000000008
patword 0x0009 0x0000000000000009
patword 0x000a 0x000000000000000a
patword 0x000b 0x000000000000000b
patword 0x000c 0x000000000000000c
patlimits 0x0000 0x000c
patioctrl 0x000000000000000f
patloop 0 0x0003 0x0005
patnloop 0 2
patloop 2 0x0009 0x000b
patnloop 2 0
patloop 5 0x0002 0x0005
patnloop 5 2
patwait 0 0x0001
patwaittime 0 5
patwait 4 0x0007
patwaittime 4 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

View File

@ -1,584 +0,0 @@
# -*- coding: utf-8 -*-
"""
Created on Wed May 24 09:44:53 2017
Plot the pattern for New Chip Test Box (.pat)
Changes:
- 2017-11-21 Adapt it to python-3
- 2017-09-25 All can be plotted
- 2017-09-22 Can be plotted but the loop and wait not work yet
@author: zhang_j1
"""
import matplotlib.pyplot as plt
from numpy import *
from matplotlib.pyplot import *
from matplotlib.patches import Rectangle
import os
###############################################################################
# Input the folder of the pattern file
Folder = "./patterns/"
# Prefix name of the .pat and .alias file
File_pat = "test_v2"
# COLORS AND LINE STYLES
# alternating colors of the plots (2 needed)
colors_plot = ['tab:blue', 'tab:orange']
# Wait colors and line styles (6 needed from 0 to 5)
colors_wait = ['b', 'g', 'r', 'c', 'm', 'y']
linestyles_wait = ['--', '--', '--', '--', '--', '--']
alpha_wait = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
alpha_wait_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
# Loop colors and line styles (6 needed from 0 to 5)
colors_loop = ['tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:ping', 'tab:grey']
linestyles_loop = ['-.', '-.', '-.', '-.', '-.', '-.']
alpha_loop = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
alpha_loop_rect = [0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
# Display the count of clocks
clock_vertical_lines_spacing = 1
show_clocks_number = True
# Verbosity
verbose = False
###############################################################################
# Define a hex to binary function
# global definition
# base = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F]
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A')+6)]
# dec2bin
def dec2bin(string_num):
num = int(string_num)
mid = []
while True:
if num == 0:
break
num, rem = divmod(num, 2)
mid.append(base[rem])
return ''.join([str(x) for x in mid[::-1]])
# dec2binary: better than dec2bin
def dec2binary(dec_num, width=None):
return binary_repr(int(dec_num), width=width)
# hex2dec
def hex2dec(string_num):
return str(int(string_num.upper(), 16))
# hex2bin
def hex2bin(string_num):
return dec2bin(hex2dec(string_num.upper()))
# hex2bin
def hex2binary(string_num, width=None):
return dec2binary(hex2dec(string_num.upper()), width=width)
# Look at the alias file and generate the lookup table for pin names
# Create a 64 bit look up table
table = []
for i in range(64):
# for special bit
if i+1 == 59:
table.append([str(i+1), "external_trigger"])
elif i+1 == 63:
table.append([str(i+1), "adc_enable"])
elif i+1 == 62:
table.append([str(i+1), "dbit_enable"])
else:
table.append([str(i+1), ""])
# Loop all lines
with open(Folder+"/" + File_pat + ".alias") as f:
lines = f.readlines()
f.close()
nlines = len(lines)
for i in range(nlines):
# whether the line is bit definition
if lines[i][0:3] == "BIT":
# split words
words = lines[i].split()
bit_num = int(words[0][3:])
table[bit_num][0] = words[0][3:]
table[bit_num][1] = words[1]
if verbose:
print(table)
# Load the pattern and get all lines
# Loop all lines
with open(Folder+"/"+File_pat+".pat") as f_pat:
lines_pat = f_pat.readlines()
f_pat.close()
# number of lines for pattern file
nlines_pat = len(lines_pat)
# a counter
cnt = 0
if verbose:
print("The total number of lines of pattern:", nlines_pat)
# Loop all lines of pattern
waittime0 = None
waittime1 = None
waittime2 = None
waittime3 = None
waittime4 = None
waittime5 = None
nloop0 = None
nloop1 = None
nloop2 = None
nloop3 = None
nloop4 = None
nloop5 = None
for k in range(nlines_pat):
# content of line
words_line = lines_pat[k].split()
if words_line[0] == "patword":
# print words_line from b0 to b63
bits = hex2binary(words_line[-1], 64)[::-1]
if verbose:
print("The bits for line-", k+1, "is:", bits)
# convert string bits to decimal array
num_bits = array(list(map(str, bits)), dtype="uint16")
if cnt == 0:
mat_pat = num_bits
else:
# add bits to matrix
mat_pat = concatenate((mat_pat, num_bits), axis=0)
cnt = cnt + 1
# print("The matrix of pattern:", mat_pat.reshape(int(cnt), int(len(num_bits))))
# Look at the io: 0 for sending to ASIC, 1 for reading from ASIC
if words_line[0] == "patioctrl":
# print words_line
if verbose:
print(words_line[-1])
bits = hex2binary(words_line[-1], 64)[::-1]
if verbose:
print(bits)
# convert string bits to decimal array
out_bits = array(list(map(str, bits)), dtype="uint16")
if verbose:
print(words_line)
# Deal with waiting point
# ====== WAIT ======
if words_line[0] == "patwait" and words_line[1] == "0":
wait0 = int(hex2dec(words_line[2]))
if verbose:
print("wait 0 at:", wait0)
if words_line[0] == "patwaittime" and words_line[1] == "0":
waittime0 = int(words_line[2])
if verbose:
print("wait 0 for:", waittime0)
if words_line[0] == "patwait" and words_line[1] == "1":
wait1 = int(hex2dec(words_line[2]))
if verbose:
print("wait 1 at:", wait1)
if words_line[0] == "patwaittime" and words_line[1] == "1":
waittime1 = int(words_line[2])
if verbose:
print("wait 1 for:", waittime1)
if words_line[0] == "patwait" and words_line[1] == "2":
wait2 = int(hex2dec(words_line[2]))
if verbose:
print("wait 2 at:", wait2)
if words_line[0] == "patwaittime" and words_line[1] == "2":
waittime2 = int(words_line[2])
if verbose:
print("wait 2 for:", waittime2)
if words_line[0] == "patwait" and words_line[1] == "3":
wait3 = int(hex2dec(words_line[2]))
if verbose:
print("wait 0 at:", wait3)
if words_line[0] == "patwaittime" and words_line[1] == "3":
waittime3 = int(words_line[2])
if verbose:
print("wait 0 for:", waittime3)
if words_line[0] == "patwait" and words_line[1] == "4":
wait4 = int(hex2dec(words_line[2]))
if verbose:
print("wait 1 at:", wait4)
if words_line[0] == "patwaittime" and words_line[1] == "4":
waittime4 = int(words_line[2])
if verbose:
print("wait 1 for:", waittime4)
if words_line[0] == "patwait" and words_line[1] == "5":
wait5 = int(hex2dec(words_line[2]))
if verbose:
print("wait 2 at:", wait5)
if words_line[0] == "patwaittime" and words_line[1] == "5":
waittime5 = int(words_line[2])
if verbose:
print("wait 2 for:", waittime5)
# ====== LOOPS ======
if words_line[0] == "patloop" and words_line[1] == "0":
loop0_start = int(hex2dec(words_line[2]))
loop0_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 0 start:", loop0_start, ", end:", loop0_end)
if words_line[0] == "patnloop" and words_line[1] == "0":
nloop0 = int(words_line[2])
if verbose:
print("loop 0 times:", nloop0)
if words_line[0] == "patloop" and words_line[1] == "1":
loop1_start = int(hex2dec(words_line[2]))
loop1_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 1 start:", loop1_start, ", end:", loop1_end)
if words_line[0] == "patnloop" and words_line[1] == "1":
nloop1 = int(words_line[2])
if verbose:
print("loop 1 times:", nloop1)
if words_line[0] == "patloop" and words_line[1] == "2":
loop2_start = int(hex2dec(words_line[2]))
loop2_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 2 start:", loop2_start, ", end:", loop2_end)
if words_line[0] == "patnloop" and words_line[1] == "2":
nloop2 = int(words_line[2])
if verbose:
print("loop 2 times:", nloop2)
if words_line[0] == "patloop" and words_line[1] == "3":
loop3_start = int(hex2dec(words_line[2]))
loop3_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 3 start:", loop3_start, ", end:", loop3_end)
if words_line[0] == "patnloop" and words_line[1] == "3":
nloop3 = int(words_line[2])
if verbose:
print("loop 3 times:", nloop3)
if words_line[0] == "patloop" and words_line[1] == "4":
loop4_start = int(hex2dec(words_line[2]))
loop4_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 4 start:", loop4_start, ", end:", loop4_end)
if words_line[0] == "patnloop" and words_line[1] == "4":
nloop4 = int(words_line[2])
if verbose:
print("loop 4 times:", nloop4)
if words_line[0] == "patloop" and words_line[1] == "5":
loop5_start = int(hex2dec(words_line[2]))
loop5_end = int(hex2dec(words_line[3]))
if verbose:
print("loop 5 start:", loop5_start, ", end:", loop5_end)
if words_line[0] == "patnloop" and words_line[1] == "5":
nloop5 = int(words_line[2])
if verbose:
print("loop 5 times:", nloop5)
# print(out_bits)
# internal counter
avail_index = []
avail_name = []
# Remove non-used bits
for i in range(64):
# if out_bits[0][i] == 1:
if out_bits[i] == 1:
avail_index.append(i)
avail_name.append(table[i][1])
if verbose:
print(avail_index)
print(avail_name)
# number of effective used bits
nbiteff = len(avail_name)
# subMat = mat_ext[:,index]
# print(mat_pat.shape)
subMat = mat_pat.reshape(int(cnt), int(len(num_bits)))[0:, avail_index]
# subMat = mat_pat[avail_index]
timing = linspace(0, subMat.shape[0]-1, subMat.shape[0])
rcParams['figure.figsize'] = 15, 5
# ============= PLOTTING =============
rcParams["font.weight"] = "bold"
rcParams["axes.labelweight"] = "bold"
fig2, axs2 = subplots(nbiteff, sharex='all')
subplots_adjust(wspace=0, hspace=0)
# axs2[nbiteff - 1].set(xlabel='Timing [clk]')
for idx, i in enumerate(range(nbiteff)):
axs2[idx].plot(subMat.T[i], "-", drawstyle="steps-post", linewidth=2.0, color=colors_plot[idx % 2])
x_additional = range(len(subMat.T[i]) - 1, len(subMat.T[i]) + 2)
additional_stuff = [subMat.T[i][-1]] * 3
axs2[idx].plot(x_additional, additional_stuff,
"--", drawstyle="steps-post", linewidth=2.0, color=colors_plot[idx % 2], alpha=0.5)
axs2[idx].yaxis.set_ticks([0.5], minor=False)
axs2[idx].xaxis.set_ticks(arange(0, len(subMat.T[i]) + 10, clock_vertical_lines_spacing))
axs2[idx].yaxis.set_ticklabels([avail_name[i]])
axs2[idx].get_yticklabels()[0].set_color(colors_plot[idx % 2])
axs2[idx].grid(1, 'both', 'both', alpha=0.5)
axs2[idx].yaxis.grid(which="both", color=colors_plot[idx % 2], alpha=0.2)
if idx != nbiteff - 1:
if not show_clocks_number:
axs2[idx].xaxis.set_ticklabels([])
axs2[idx].set(xlabel=' ', ylim=(-0.2, 1.2))
else:
axs2[idx].set(xlabel='Timing [clk]', ylim=(-0.2, 1.2))
# axs2[idx].set_xlim(left=0)
axs2[idx].set_xlim(left=0, right=len(subMat.T[i]) + 1)
axs2[idx].spines['top'].set_visible(False)
axs2[idx].spines['right'].set_alpha(0.2)
axs2[idx].spines['right'].set_visible(True)
axs2[idx].spines['bottom'].set_visible(False)
axs2[idx].spines['left'].set_visible(False)
# =====================================================================================================
# Plot the wait lines
# Wait 0
if waittime0 is not None:
if waittime0 == 0:
axs2[idx].plot([wait0, wait0], [-10, 10],
linestyle=linestyles_wait[0], color=colors_wait[0], alpha=alpha_wait[0], linewidth=2.0)
axs2[idx].plot([wait0 + 1, wait0 + 1], [-10, 10],
linestyle=linestyles_wait[0], color=colors_wait[0], linewidth=2.0, alpha=alpha_wait[0])
axs2[idx].add_patch(Rectangle((wait0, -10), 1, 20,
label="wait 0: skipped" if idx == 0 else "",
facecolor=colors_wait[0], alpha=alpha_wait_rect[0], hatch='\\\\'))
else:
axs2[idx].plot([wait0, wait0], [-10, 10],
linestyle=linestyles_wait[0], color=colors_wait[0],
label="wait 0: " + str(waittime0) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[0])
# Wait 1
if waittime1 is not None:
if waittime1 == 0:
axs2[idx].plot([wait1, wait1], [-10, 10],
linestyle=linestyles_wait[1], color=colors_wait[1], alpha=alpha_wait[1], linewidth=2.0)
axs2[idx].plot([wait1 + 1, wait1 + 1], [-10, 10],
linestyle=linestyles_wait[1], color=colors_wait[1], linewidth=2.0, alpha=alpha_wait[1])
axs2[idx].add_patch(Rectangle((wait1, -10), 1, 20,
label="wait 1: skipped" if idx == 0 else "",
facecolor=colors_wait[1], alpha=alpha_wait_rect[1], hatch='\\\\'))
else:
axs2[idx].plot([wait1, wait1], [-10, 10],
linestyle=linestyles_wait[1], color=colors_wait[1],
label="wait 1: " + str(waittime1) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[1])
# Wait 2
if waittime2 is not None:
if waittime2 == 0:
axs2[idx].plot([wait2, wait2], [-10, 10],
linestyle=linestyles_wait[2], color=colors_wait[2], alpha=alpha_wait[2], linewidth=2.0)
axs2[idx].plot([wait2 + 1, wait2 + 1], [-10, 10],
linestyle=linestyles_wait[2], color=colors_wait[2], linewidth=2.0, alpha=alpha_wait[2])
axs2[idx].add_patch(Rectangle((wait2, -10), 1, 20,
label="wait 2: skipped" if idx == 0 else "",
facecolor=colors_wait[2], alpha=alpha_wait_rect[2], hatch='\\\\'))
else:
axs2[idx].plot([wait2, wait2], [-10, 10],
linestyle=linestyles_wait[2], color=colors_wait[2],
label="wait 2: " + str(waittime2) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[2])
# Wait 3
if waittime3 is not None:
if waittime3 == 0:
axs2[idx].plot([wait3, wait3], [-10, 10],
linestyle=linestyles_wait[3], color=colors_wait[3], alpha=alpha_wait[3], linewidth=2.0)
axs2[idx].plot([wait3 + 1, wait3 + 1], [-10, 10],
linestyle=linestyles_wait[3], color=colors_wait[3], linewidth=2.0, alpha=alpha_wait[3])
axs2[idx].add_patch(Rectangle((wait3, -10), 1, 20,
label="wait 3: skipped" if idx == 0 else "",
facecolor=colors_wait[3], alpha=alpha_wait_rect[3], hatch='\\\\'))
else:
axs2[idx].plot([wait3, wait3], [-10, 10],
linestyle=linestyles_wait[3], color=colors_wait[3],
label="wait 3: " + str(waittime3) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[3])
# Wait 4
if waittime4 is not None:
if waittime4 == 0:
axs2[idx].plot([wait4, wait4], [-10, 10],
linestyle=linestyles_wait[4], color=colors_wait[4], alpha=alpha_wait[4], linewidth=2.0)
axs2[idx].plot([wait4 + 1, wait4 + 1], [-10, 10],
linestyle=linestyles_wait[4], color=colors_wait[4], linewidth=2.0, alpha=alpha_wait[4])
axs2[idx].add_patch(Rectangle((wait4, -10), 1, 20,
label="wait 4: skipped" if idx == 0 else "",
facecolor=colors_wait[4], alpha=alpha_wait_rect[4], hatch='\\\\'))
else:
axs2[idx].plot([wait4, wait4], [-10, 10],
linestyle=linestyles_wait[4], color=colors_wait[4],
label="wait 4: " + str(waittime4) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[4])
# Wait 5
if waittime5 is not None:
if waittime5 == 0:
axs2[idx].plot([wait5, wait5], [-10, 10],
linestyle=linestyles_wait[5], color=colors_wait[5], alpha=alpha_wait[5], linewidth=2.0)
axs2[idx].plot([wait5 + 1, wait5 + 1], [-10, 10],
linestyle=linestyles_wait[5], color=colors_wait[5], linewidth=2.0, alpha=alpha_wait[5])
axs2[idx].add_patch(Rectangle((wait5, -10), 1, 20,
label="wait 5: skipped" if idx == 0 else "",
facecolor=colors_wait[5], alpha=alpha_wait_rect[5], hatch='\\\\'))
else:
axs2[idx].plot([wait5, wait5], [-10, 10],
linestyle=linestyles_wait[5], color=colors_wait[5],
label="wait 5: " + str(waittime5) + " clk" if idx == 0 else "",
linewidth=2.0, alpha=alpha_wait[5])
# =====================================================================================================
# Plot the loop lines
# Loop 0
if nloop0 is not None:
if nloop0 == 0:
axs2[idx].plot([loop0_start, loop0_start], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0],
alpha=alpha_loop[0], linewidth=2.0)
axs2[idx].plot([loop0_end + 1, loop0_end + 1], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[0], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop0_start, -10), loop0_end + 1 - loop0_start, 20,
label="loop 0: skipped" if idx == 0 else "",
facecolor=colors_loop[0], alpha=alpha_loop_rect[0], hatch='//'))
else:
axs2[idx].plot([loop0_start, loop0_start], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[0],
label="loop 0: " + str(nloop0) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop0_end, loop0_end], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[0], linewidth=2.0)
# Loop 1
if nloop1 is not None:
if nloop1 == 0:
axs2[idx].plot([loop1_start, loop1_start], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1],
alpha=alpha_loop[1], linewidth=2.0)
axs2[idx].plot([loop1_end + 1, loop1_end + 1], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1], alpha=alpha_loop[1], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop1_start, -10), loop1_end + 1 - loop1_start, 20,
label="loop 1: skipped" if idx == 0 else "",
facecolor=colors_loop[1], alpha=alpha_loop_rect[1], hatch='//'))
else:
axs2[idx].plot([loop1_start, loop1_start], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1], alpha=alpha_loop[1],
label="loop 1: " + str(nloop1) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop1_end, loop1_end], [-10, 10],
linestyle=linestyles_loop[1], color=colors_loop[1], alpha=alpha_loop[1], linewidth=2.0)
# Loop 2
if nloop2 is not None:
if nloop2 == 0:
axs2[idx].plot([loop2_start, loop2_start], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2],
alpha=alpha_loop[2], linewidth=2.0)
axs2[idx].plot([loop2_end + 1, loop2_end + 1], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2], alpha=alpha_loop[2], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop2_start, -10), loop2_end + 1 - loop2_start, 20,
label="loop 2: skipped" if idx == 0 else "",
facecolor=colors_loop[2], alpha=alpha_loop_rect[2], hatch='//'))
else:
axs2[idx].plot([loop2_start, loop2_start], [-10, 10],
linestyle=linestyles_loop[2], color=colors_loop[2], alpha=alpha_loop[2],
label="loop 2: " + str(nloop2) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop2_end, loop2_end], [-10, 10],
linestyle=linestyles_loop[0], color=colors_loop[0], alpha=alpha_loop[2], linewidth=2.0)
# Loop 3
if nloop3 is not None:
if nloop3 == 0:
axs2[idx].plot([loop3_start, loop3_start], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3],
alpha=alpha_loop[3], linewidth=2.0)
axs2[idx].plot([loop3_end + 1, loop3_end + 1], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3], alpha=alpha_loop[3], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop3_start, -10), loop3_end + 1 - loop3_start, 20,
label="loop 3: skipped" if idx == 0 else "",
facecolor=colors_loop[3], alpha=alpha_loop_rect[3], hatch='//'))
else:
axs2[idx].plot([loop3_start, loop3_start], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3], alpha=alpha_loop[3],
label="loop 3: " + str(nloop3) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop3_end, loop3_end], [-10, 10],
linestyle=linestyles_loop[3], color=colors_loop[3], alpha=alpha_loop[3], linewidth=2.0)
# Loop 4
if nloop4 is not None:
if nloop4 == 0:
axs2[idx].plot([loop4_start, loop4_start], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4],
alpha=alpha_loop[4], linewidth=2.0)
axs2[idx].plot([loop4_end + 1, loop4_end + 1], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4], alpha=alpha_loop[4], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop4_start, -10), loop4_end + 1 - loop4_start, 20,
label="loop 4: skipped" if idx == 0 else "",
facecolor=colors_loop[4], alpha=alpha_loop_rect[4], hatch='//'))
else:
axs2[idx].plot([loop4_start, loop4_start], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4], alpha=alpha_loop[4],
label="loop 4: " + str(nloop4) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop4_end, loop4_end], [-10, 10],
linestyle=linestyles_loop[4], color=colors_loop[4], alpha=alpha_loop[4], linewidth=2.0)
# Loop 5
if nloop5 is not None:
if nloop5 == 0:
axs2[idx].plot([loop5_start, loop5_start], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5],
alpha=alpha_loop[5], linewidth=2.0)
axs2[idx].plot([loop5_end + 1, loop5_end + 1], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5], alpha=alpha_loop[5], linewidth=2.0)
axs2[idx].add_patch(Rectangle((loop5_start, -10), loop5_end + 1 - loop5_start, 20,
label="loop 5: skipped" if idx == 0 else "",
facecolor=colors_loop[5], alpha=alpha_loop_rect[5], hatch='//'))
else:
axs2[idx].plot([loop5_start, loop5_start], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5], alpha=alpha_loop[5],
label="loop 5: " + str(nloop5) + " times" if idx == 0 else "", linewidth=2.0)
axs2[idx].plot([loop5_end, loop5_end], [-10, 10],
linestyle=linestyles_loop[5], color=colors_loop[5], alpha=alpha_loop[5], linewidth=2.0)
n_cols = count_nonzero([waittime0 != 0, waittime1 != 0, waittime2 != 0, waittime3 != 0, waittime4 != 0, waittime5 != 0,
nloop0 != 0, nloop1 != 0, nloop2 != 0, nloop3 != 0, nloop4 != 0, nloop5 != 0])
fig2.legend(loc="upper center", ncol=n_cols)
# manager = get_current_fig_manager()
# manager.window.showMaximized()
figure = plt.gcf() # get current figure
figure.set_size_inches(20, 10)
# when saving, specify the DPI
# tight_layout()
plt.savefig(Folder+"/"+File_pat+".png", dpi=300)
# Remove the white space around the plot -- only works on Unix (ImageMagick command)
os.system(f'mogrify -trim {Folder}/{File_pat}.png')
show()

View File

@ -14,6 +14,7 @@ pycmd = dir(Detector)
# dacs are in general not included in the python commands and we expect to
# set them from the specialized class or using an enum
dacs = [
'adcvpp',
'iodelay',
'list',
'rxb_lb',

View File

@ -2,9 +2,8 @@
BIT32_MASK=0xFFFFFFFF
MAX_RX_DBIT=64
DEFAULT_TCP_CNTRL_PORTNO=1952
DEFAULT_TCP_STOP_PORTNO=1953
DEFAULT_TCP_RX_PORTNO=1954
DEFAULT_PORTNO=1952
DEFAULT_UDP_PORTNO=50001
DEFAULT_ZMQ_CL_PORTNO=30001
DEFAULT_ZMQ_RX_PORTNO=30001
DEFAULT_UDP_SRC_PORTNO=32410

View File

@ -225,9 +225,9 @@ class Detector(CppDetectorApi):
Example
-------
>>> d.detectorserverversion
'7.0.0'
'0x200910'
"""
return self.getDetectorServerVersion()
return ut.lhex(self.getDetectorServerVersion())
@property
@element
@ -249,15 +249,15 @@ class Detector(CppDetectorApi):
Example
-------
>>> d.clientversion
'7.0.1'
'0x200810'
"""
return self.getClientVersion()
return hex(self.getClientVersion())
@property
@element
def rx_version(self):
"""Receiver version """
return self.getReceiverVersion()
"""Receiver version in format [0xYYMMDD]."""
return ut.lhex(self.getReceiverVersion())
@property
@element
@ -2833,6 +2833,16 @@ class Detector(CppDetectorApi):
def runclk(self, freq):
ut.set_using_dict(self.setRUNClock, freq)
@property
@element
def gatedclk(self):
"""[Ctb][Moench] Run clock in MHz."""
return self.getGatedClock()
@gatedclk.setter
def gatedclk(self, freq):
ut.set_using_dict(self.setGatedClock, freq)
@property
@element
def romode(self):

View File

@ -55,17 +55,16 @@ void init_det(py::module &m) {
(int (Detector::*)() const) & Detector::getShmId);
CppDetectorApi.def("getPackageVersion", (std::string(Detector::*)() const) &
Detector::getPackageVersion);
CppDetectorApi.def("getClientVersion", (std::string(Detector::*)() const) &
CppDetectorApi.def("getClientVersion", (int64_t(Detector::*)() const) &
Detector::getClientVersion);
CppDetectorApi.def("getFirmwareVersion",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getFirmwareVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getDetectorServerVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &
Detector::getDetectorServerVersion,
py::arg() = Positions{});
CppDetectorApi.def("getDetectorServerVersion",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getDetectorServerVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getKernelVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &
@ -79,11 +78,10 @@ void init_det(py::module &m) {
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getModuleId,
py::arg() = Positions{});
CppDetectorApi.def(
"getReceiverVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &
Detector::getReceiverVersion,
py::arg() = Positions{});
CppDetectorApi.def("getReceiverVersion",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getReceiverVersion,
py::arg() = Positions{});
CppDetectorApi.def(
"getDetectorType",
(Result<defs::detectorType>(Detector::*)(sls::Positions) const) &
@ -204,16 +202,6 @@ void init_det(py::module &m) {
CppDetectorApi.def(
"setSynchronization",
(void (Detector::*)(bool)) & Detector::setSynchronization, py::arg());
CppDetectorApi.def(
"getBadChannels",
(void (Detector::*)(const std::string &, sls::Positions) const) &
Detector::getBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"setBadChannels",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def("isVirtualDetectorServer",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::isVirtualDetectorServer,
@ -1352,6 +1340,16 @@ void init_det(py::module &m) {
(void (Detector::*)(const int, const int, const int, sls::Positions)) &
Detector::setADCConfiguration,
py::arg(), py::arg(), py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"getBadChannels",
(void (Detector::*)(const std::string &, sls::Positions) const) &
Detector::getBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"setBadChannels",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setBadChannels,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getCounterMask",
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
Detector::getCounterMask,
@ -1495,14 +1493,6 @@ void init_det(py::module &m) {
(void (Detector::*)(defs::dacIndex, int, sls::Positions)) &
Detector::setVoltage,
py::arg(), py::arg(), py::arg() = Positions{});
CppDetectorApi.def("getADCVpp",
(Result<int>(Detector::*)(bool, sls::Positions) const) &
Detector::getADCVpp,
py::arg() = false, py::arg() = Positions{});
CppDetectorApi.def("setADCVpp",
(void (Detector::*)(int, bool, sls::Positions)) &
Detector::setADCVpp,
py::arg(), py::arg() = false, py::arg() = Positions{});
CppDetectorApi.def("getADCEnableMask",
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
Detector::getADCEnableMask,

View File

@ -171,19 +171,17 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
/* return NULL; */
/* }; */
// not present in base class
virtual char *readNextFrame(ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(std::ifstream &filebin) {
int ff=-1;
return readNextFrame(filebin, ff);
}
virtual char *readNextFrame(std::ifstream &filebin, int &ff) {
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
// not present in base class
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np) {
virtual char *readNextFrame(ifstream &filebin, int &ff, int &np) {
char *data = new char[dataSize];
char *d = readNextFrame(filebin, ff, np, data);
if (d == NULL) {
@ -193,10 +191,18 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
return data;
}
// not present in base class
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np,
virtual char *readNextFrame(ifstream &filebin, int &ff, int &np,
char *data) {
char *retval = 0;
int nd;
int fnum = -1;
np = 0;
int pn;
// cout << dataSize << endl;
if (ff >= 0)
fnum = ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize)) {
ff = getFrameNumber(data);
@ -204,8 +210,8 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
return data;
}
}
return nullptr;
}
return NULL;
};
/**
@ -219,7 +225,7 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
found
*/
char *findNextFrame(char *data, int &ndata, int dsize) override {
virtual char *findNextFrame(char *data, int &ndata, int dsize) {
if (dsize < dataSize)
ndata = dsize;
else
@ -227,7 +233,6 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
return data;
}
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
};

View File

@ -207,7 +207,7 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
int getFrameNumber(char *buff) {
return ((header *)buff)->detHeader.frameNumber;
};
}
/**
@ -220,10 +220,74 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
*/
int getPacketNumber(char *buff) {
return ((header *)buff)->detHeader.packetNumber;
};
}
/* int getFrameNumber(char *buff) { */
/* // return ((jf_header *)buff)->bunchNumber; */
/* }; */
/* /\** */
/* Returns the packet number for the given dataset. purely virtual func */
/* \param buff pointer to the dataset */
/* \returns packet number number */
/* *\/ */
/* int getPacketNumber(char *buff) { */
/* return 0; */
/* } ; */
/* /\** */
/* Loops over a memory slot until a complete frame is found (i.e. all
* packets 0 to nPackets, same frame number). purely virtual func */
/* \param data pointer to the memory to be analyzed */
/* \param ndata reference to the amount of data found for the frame, in
* case the frame is incomplete at the end of the memory slot */
/* \param dsize size of the memory slot to be analyzed */
/* \returns pointer to the beginning of the last good frame (might be
* incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
/* *\/ */
/* virtual char *findNextFrame(char *data, int &ndata, int
* dsize){ndata=dsize; setDataSize(dsize); return data;}; */
/* /\** */
/* Loops over a file stream until a complete frame is found (i.e. all
* packets 0 to nPackets, same frame number). Can be overloaded for
* different kind of detectors! */
/* \param filebin input file stream (binary) */
/* \returns pointer to the begin of the last good frame, NULL if no
* frame is found or last frame is incomplete */
/* */
/* char *readNextFrame(ifstream &filebin){ */
/* // int afifo_length=0; */
/* uint16_t *afifo_cont; */
/* int ib=0; */
/* if (filebin.is_open()) { */
/* afifo_cont=new uint16_t[dataSize/2]; */
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
/* ib+=2; */
/* if (ib==dataSize) break; */
/* } */
/* if (ib>0) { */
/* iframe++; */
/* // cout << ib << "-" << endl; */
/* return (char*)afifo_cont; */
/* } else { */
/* delete [] afifo_cont; */
/* return NULL; */
/* } */
/* } */
/* return NULL; */
/* }; */
char *readNextFrame(ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);

View File

@ -1,177 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef JUNGFRAUMODULEDATA_H
#define JUNGFRAUMODULEDATA_H
#include "slsDetectorData.h"
//#define VERSION_V2
/**
@short structure for a Detector Packet or Image Header
@li frameNumber is the frame number
@li expLength is the subframe number (32 bit eiger) or real time exposure
time in 100ns (others)
@li packetNumber is the packet number
@li bunchId is the bunch id from beamline
@li timestamp is the time stamp with 10 MHz clock
@li modId is the unique module id (unique even for left, right, top, bottom)
@li xCoord is the x coordinate in the complete detector system
@li yCoord is the y coordinate in the complete detector system
@li zCoord is the z coordinate in the complete detector system
@li debug is for debugging purposes
@li roundRNumber is the round robin set number
@li detType is the detector type see :: detectorType
@li version is the version number of this structure format
*/
typedef struct {
uint64_t bunchNumber; /**< is the frame number */
uint64_t pre; /**< something */
} jf_header;
using namespace std;
class jungfrauModuleData : public slsDetectorData<uint16_t> {
private:
int iframe;
public:
/**
Implements the slsReceiverData structure for the moench02 prototype read
out by a module i.e. using the slsReceiver (160x160 pixels, 40 packets
1286 large etc.) \param c crosstalk parameter for the output buffer
*/
jungfrauModuleData()
: slsDetectorData<uint16_t>(1024, 512,
1024* 512 * 2 + sizeof(jf_header)) {
for (int ix = 0; ix < 1024; ix++) {
for (int iy = 0; iy < 512; iy++) {
dataMap[iy][ix] = sizeof(jf_header) + (1024 * iy + ix) * 2;
#ifdef HIGHZ
dataMask[iy][ix] = 0x3fff;
#endif
}
}
iframe = 0;
// cout << "data struct created" << endl;
};
/**
Returns the value of the selected channel for the given dataset as
double. \param data pointer to the dataset (including headers etc) \param
ix pixel number in the x direction \param iy pixel number in the y
direction \returns data for the selected channel, with inversion if
required as double
*/
virtual double getValue(char *data, int ix, int iy = 0) {
uint16_t val = getChannel(data, ix, iy) & 0x3fff;
/* if (ix==0 && iy==0) */
/* cout << val << endl; */
return val;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
/* class jfrau_packet_header_t { */
/* public: */
/* unsigned char reserved[4]; */
/* unsigned char packetNumber[1]; */
/* unsigned char frameNumber[3]; */
/* unsigned char bunchid[8]; */
/* }; */
int getFrameNumber(char *buff) {
return ((jf_header *)buff)->bunchNumber;
};
/**
Returns the packet number for the given dataset. purely virtual func
\param buff pointer to the dataset
\returns packet number number
*/
int getPacketNumber(char *buff) {
return 0;
};
char *readNextFrame(ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(ifstream &filebin, int &ff, int &np) {
char *data = new char[dataSize];
char *d = readNextFrame(filebin, ff, np, data);
if (d == NULL) {
delete[] data;
data = NULL;
}
return data;
};
char *readNextFrame(ifstream &filebin, int &ff, int &np,char *data) {
char *retval = 0;
int nd;
int fnum = -1;
np = 0;
int pn;
// cout << dataSize << endl;
if (ff >= 0)
fnum = ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize)) {
ff = getFrameNumber(data);
np = getPacketNumber(data);
return data;
}
}
return NULL;
};
/**
Loops over a memory slot until a complete frame is found (i.e. all
packets 0 to nPackets, same frame number). purely virtual func \param
data pointer to the memory to be analyzed \param ndata reference to the
amount of data found for the frame, in case the frame is incomplete at
the end of the memory slot \param dsize size of the memory slot to be
analyzed \returns pointer to the beginning of the last good frame (might
be incomplete if ndata smaller than dataSize), or NULL if no frame is
found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize) {
if (dsize < dataSize)
ndata = dsize;
else
ndata = dataSize;
return data;
};
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
};
#endif

View File

@ -2,36 +2,7 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef MOENCH03T1RECDATANEW_H
#define MOENCH03T1RECDATANEW_H
//#define MYROOT
#ifndef MYROOT
#include "sls/sls_detector_defs.h"
#endif
#ifdef MYROOT
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t bunchId;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t reserved;
uint32_t debug;
uint16_t roundRNumber;
uint8_t detType;
uint8_t version;
} sls_detector_header;
#define MAX_NUM_PACKETS 512
// using sls_bitset = std::bitset<MAX_NUM_PACKETS>;
// using bitset_storage = uint8_t[MAX_NUM_PACKETS / 8];
struct sls_receiver_header {
sls_detector_header detHeader; /**< is the detector header */
uint8_t packetsMask[64]; /**< is the packets caught bit mask */
};
#endif
#include "slsDetectorData.h"
class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
@ -46,12 +17,8 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
double ghost[200][25];
// Single point of definition if we need to customize
#ifndef MYROOT
using header = sls::defs::sls_receiver_header;
#endif
#ifdef MYROOT
sls_receiver_header header;
#endif
public:
/**
Implements the slsReceiverData structure for the moench02 prototype read
@ -80,7 +47,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
int npackets = 40;
int i;
int adc4(0);
int off=sizeof(header);
for (int ip = 0; ip < npackets; ip++) {
for (int is = 0; is < 128; is++) {
@ -95,13 +62,13 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
} else {
row = 200 + i / sc_width;
}
dataMap[row][col] = off +
dataMap[row][col] = sizeof(header) +
(nadc * i + iadc) * 2; //+16*(ip+1);
#ifdef HIGHZ
dataMask[row][col] = 0x3fff; // invert data
#endif
if (dataMap[row][col] < 0 ||
dataMap[row][col] >= off + nSamples * 2 * 32)
dataMap[row][col] >= nSamples * 2 * 32)
std::cout << "Error: pointer " << dataMap[row][col]
<< " out of range " << std::endl;
}
@ -121,7 +88,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
xmap[ibyte] = -1;
ymap[ibyte] = -1;
}
off = sizeof(header) / 2;
int off = sizeof(header) / 2;
for (ipacket = 0; ipacket < npackets; ipacket++) {
for (ibyte = 0; ibyte < 8192 / 2; ibyte++) {
i = ipacket * 8208 / 2 + ibyte;
@ -208,7 +175,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
*/
int getFrameNumber(char *buff) {
return ((sls::defs::sls_receiver_header *)buff)->detHeader.frameNumber;
return ((header *)buff)->detHeader.frameNumber;
}
/**
@ -221,7 +188,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
*/
int getPacketNumber(char *buff) {
return ((sls::defs::sls_receiver_header *)buff)->detHeader.packetNumber;
return ((header *)buff)->detHeader.packetNumber;
}
char *readNextFrame(std::ifstream &filebin) override {

View File

@ -5,8 +5,6 @@
#include "slsDetectorData.h"
#include "sls/sls_detector_defs.h"
#define CTB
using namespace std;
class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
@ -19,9 +17,6 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
const int dSamples;
int off;
// Single point of definition if we need to customize
using header = sls::defs::sls_receiver_header;
public:
/**
Implements the slsReceiverData structure for the moench02 prototype read
@ -33,7 +28,7 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
// slsDetectorData<uint16_t>(400, 400, nas*2*32+nds*8), aSamples(nas),
// dSamples(nds), nadc(32), sc_width(25), sc_height(200) {
moench04CtbZmq10GbData(int nas = 5000, int nds = 0, int oo = 2 * 2)
moench04CtbZmq10GbData(int nas = 5000, int nds = 0)
: slsDetectorData<uint16_t>(400, 400,
#ifdef RAWDATA
sizeof(slsDetectorDefs::sls_receiver_header) +
@ -41,7 +36,7 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
((nas > 0) && (nds > 0)
? max(nas, nds) * (32 * 2 + 8)
: nas * 32 * 2 + nds * 8)),
nadc(32), sc_width(25), sc_height(200), aSamples(nas), dSamples(nds), off(oo) {
nadc(32), sc_width(25), sc_height(200), aSamples(nas), dSamples(nds) {
#ifdef RAWDATA
off=sizeof(slsDetectorDefs::sls_receiver_header);
#endif
@ -91,10 +86,14 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
} else {
row = 200 + i / sc_width;
}
dataMap[row][col] =
((nadc ) * i + iadc) * 2 + off;
if (nds > 0)
dataMap[row][col] =
((nadc + 4) * i + iadc) * 2 + off; //+16*(ip+1);
else
dataMap[row][col] =
(nadc * i + iadc) * 2 + off; //+16*(ip+1);
if (dataMap[row][col] < 0 ||
dataMap[row][col] >= aSamples * 2 * 32 + off)
dataMap[row][col] >= aSamples * 2 * 32 + off)
cout << "Error: pointer " << dataMap[row][col]
<< " out of range " << endl;
}
@ -109,7 +108,6 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
int getGain(char *data, int x, int y) {
// int aoff=aSamples*2*32;
int aoff=off+aSamples*2*32;
int irow;
int isc = x / sc_width;
int icol = x % sc_width;

View File

@ -1,17 +1,15 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
#module add CBFlib/0.9.5
INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../tiffio/include
INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../tiffio/include/
LDFLAG= ../tiffio/src/tiffIO.cpp -L/usr/lib64/ -lpthread -lm -lstdc++ -pthread -lrt -ltiff -O3 -std=c++11
MAIN=jungfrauClusterFinder.cpp
all: jungfrauRawDataProcess
all: jungfrauClusterFinder jungfrauMakeEta jungfrauInterpolation jungfrauNoInterpolation jungfrauPhotonCounter jungfrauAnalog
jungfrauRawDataProcess: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcess jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL
jungfrauClusterFinder: jungfrauClusterFinder.cpp $(INCS) clean

View File

@ -34,10 +34,6 @@ add_executable(moench04RawDataProcess moenchRawDataProcess.cpp)
target_compile_definitions(moench04RawDataProcess PRIVATE MOENCH04)
list(APPEND MOENCH_EXECUTABLES moench04RawDataProcess)
add_executable(moench04RawDataProcessDGS moenchRawDataProcess.cpp)
target_compile_definitions(moench04RawDataProcessDGS PRIVATE MOENCH04_DGS MOENCH04)
list(APPEND MOENCH_EXECUTABLES moench04RawDataProcessDGS)
#interpolation stuff
add_executable(moench03MakeEta moench03Interpolation.cpp)

View File

@ -62,30 +62,20 @@ int main(int argc, char *argv[]) {
int nped = 10000;
int cf = 0;
int numberOfPackets=40;
#ifdef RECT
cout << "Should be rectangular but now it will crash! No data structure defined!" << endl;
#endif
#ifndef MOENCH04
moench03T1ReceiverDataNew *decoder = new moench03T1ReceiverDataNew();
cout << "MOENCH03!" << endl;
#endif
#ifdef MOENCH04
#ifndef MOENCH04_DGS
moench04CtbZmq10GbData *decoder = new moench04CtbZmq10GbData(5000,0);
moench04CtbZmq10GbData *decoder = new moench04CtbZmq10GbData();
cout << "MOENCH04!" << endl;
#endif
#ifdef MOENCH04_DGS
moench04CtbZmq10GbData *decoder = new moench04CtbZmq10GbData(5000,5000);
cout << "MOENCH04 DGS!" << endl;
numberOfPackets=45;
#endif
#endif
int nx = 400, ny = 400;
@ -259,7 +249,7 @@ int main(int argc, char *argv[]) {
if (filebin.is_open()) {
ff = -1;
while (decoder->readNextFrame(filebin, ff, np, buff)) {
if (np == numberOfPackets) {
if (np == 40) {
mt->pushData(buff);
mt->nextThread();
mt->popFree(buff);
@ -341,7 +331,7 @@ int main(int argc, char *argv[]) {
ff = -1;
ifr = 0;
while (decoder->readNextFrame(filebin, ff, np, buff)) {
if (np == numberOfPackets) {
if (np == 40) {
// //push
mt->pushData(buff);
// // //pop
@ -349,7 +339,7 @@ int main(int argc, char *argv[]) {
mt->popFree(buff);
ifr++;
if (ifr % 100 == 0)
if (ifr % 100 == 0)
cout << ifr << " " << ff << endl;
if (nframes > 0) {
if (ifr % nframes == 0) {
@ -361,10 +351,8 @@ int main(int argc, char *argv[]) {
ifile++;
}
}
} else {
cout << "bp " << ifr << " " << ff << " " << np << endl;
//break;
}
} else
cout << ifr << " " << ff << " " << np << endl;
ff = -1;
}
cout << "--" << endl;

View File

@ -429,30 +429,28 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
for (ic = -(clusterSize / 2); ic < (clusterSize / 2) + 1;
ic++) {
if ( (iy + ir) >= 0 && (iy + ir) < ny &&
if ((iy + ir) >= 0 && (iy + ir) < ny &&
(ix + ic) >= 0 && (ix + ic) < nx) {
if ((iy + ir) > iy && (ix + ic) > ix ) {
if ((iy + ir) >= iy && (ix + ic) >= ix ) {
val[(iy + ir) * nx + ix + ic] =
subtractPedestal(data, ix + ic, iy + ir, cm);
val[(iy + ir) * nx + ix + ic] =
subtractPedestal(data, ix + ic, iy + ir, cm);
}
v = &(val[(iy + ir) * nx + ix + ic]);
tot += *v;
if (ir <= 0 && ic <= 0)
bl += *v;
if (ir <= 0 && ic >= 0)
br += *v;
if (ir >= 0 && ic <= 0)
tl += *v;
if (ir >= 0 && ic >= 0)
}
v = &(val[(iy + ir) * nx + ix + ic]);
tot += *v;
if (ir <= 0 && ic <= 0)
bl += *v;
if (ir <= 0 && ic >= 0)
br += *v;
if (ir >= 0 && ic <= 0)
tl += *v;
if (ir >= 0 && ic >= 0)
tr += *v;
if (*v > max) //{
max = *v;
//}
if (*v > max) //{
max = *v;
//}
}
}
}

View File

@ -5,12 +5,12 @@
//Write 32bit float data to tiff file
//Always returns nullptr, prints message on failure
void *WriteToTiff(float *imgData, const char *imgname, int ncol, int nrow);
void *WriteToTiff(float *imgData, const char *imgname, int nrow, int ncol);
//Read 32bit float data from tiff file, returns pointer to data and sets
//image dimensions in the out parameters nrow, ncol.
//Returns nullptr on failure
//The caller is responsible to deallocate the memory that the returned
//pointer points to.
float *ReadFromTiff(const char *imgname, uint32_t &ncol, uint32_t &nrow);
float *ReadFromTiff(const char *imgname, uint32_t &nrow, uint32_t &ncol);

View File

@ -5,7 +5,7 @@
#include <iostream>
#include <tiffio.h>
void *WriteToTiff(float *imgData, const char *imgname, int ncol, int nrow) {
void *WriteToTiff(float *imgData, const char *imgname, int nrow, int ncol) {
constexpr uint32_t sampleperpixel = 1;
TIFF *tif = TIFFOpen(imgname, "w");
if (tif) {
@ -30,7 +30,7 @@ void *WriteToTiff(float *imgData, const char *imgname, int ncol, int nrow) {
return nullptr;
}
float *ReadFromTiff(const char *imgname, uint32_t &ncol, uint32_t &nrow) {
float *ReadFromTiff(const char *imgname, uint32_t &nrow, uint32_t &ncol) {
TIFF *tif = TIFFOpen(imgname, "r");
if (tif) {
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &ncol);

View File

@ -1,16 +1,12 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5 5.9 COMPONENTS Widgets Core Gui REQUIRED)
find_package(Qt4 REQUIRED)
find_package(Qwt 6.1 REQUIRED)
find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
set(SOURCES
slsDetectorPlotting/src/SlsQt1DPlot.cpp
slsDetectorPlotting/src/SlsQt1DZoomer.cpp
@ -28,7 +24,6 @@ set(SOURCES
src/qTabDeveloper.cpp
src/qTabMessages.cpp
src/qDacWidget.cpp
src/qVersionResolve.cpp
)
set(FORMS
@ -46,7 +41,7 @@ set(FORMS
forms/form_cloneplot.ui
)
qt5_wrap_ui(FORMS_H ${FORMS})
qt4_wrap_ui(FORMS_H ${FORMS})
set(HEADERS
slsDetectorPlotting/include/SlsQt1DPlot.h
@ -67,16 +62,15 @@ set(HEADERS
include/qTabDeveloper.h
include/qTabMessages.h
include/qDacWidget.h
include/qVersionResolve.h
)
set(RESOURCES
include/icons.qrc
)
qt5_add_resources(RESOURCES_SRCS ${RESOURCES})
qt4_add_resources(RESOURCES_SRCS ${RESOURCES})
add_definitions(
${Qt5Widgets_DEFINITIONS} -DPRINT_LOG #-DVERBOSE
-DPRINT_LOG #-DVERBOSE
)
add_executable(slsDetectorGui
@ -90,30 +84,31 @@ target_include_directories(slsDetectorGui PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/slsDetectorPlotting/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<BUILD_INTERFACE:${QT5Widgets_INCLUDE_DIRS}>"
"$<BUILD_INTERFACE:${SLS_INTERNAL_QWT_DIR}/include>"
"$<BUILD_INTERFACE:${QT_INCLUDE_DIR}>"
"$<BUILD_INTERFACE:${QT_QTCORE_INCLUDE_DIR}>"
"$<BUILD_INTERFACE:${QT_QTGUI_INCLUDE_DIR}>"
"$<BUILD_INTERFACE:${QWT_INCLUDE_DIR}>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
)
target_link_libraries(slsDetectorGui PUBLIC
slsProjectOptions
slsDetectorStatic
${QT_QTCORE_LIBRARIES}
${QT_QTGUI_LIBRARIES}
${QWT_LIBRARIES}
PNG::PNG
ZLIB::ZLIB
Qt5::Widgets
Qt5::Gui
Qt5::Core
Qt4::QtOpenGL
Qt4::QtSvg
expat
PRIVATE
slsProjectWarnings
qwt
)
set_target_properties(slsDetectorGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
#Instruct CMake to run moc automatically when needed
AUTOMOC ON
)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET slsDetectorGui PROPERTY INTERPROCEDURAL_OPTIMIZATION True)

View File

@ -16,17 +16,44 @@
<height>300</height>
</size>
</property>
<property name="font">
<font>
<family>Carlito</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="boxPlot">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Sample Plot</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="plotLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblCompleteImage">
<property name="sizePolicy">
@ -191,16 +218,7 @@
</size>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
@ -358,48 +376,6 @@
</layout>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QGroupBox" name="boxPlot">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Carlito</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Sample Plot</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="plotLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
@ -408,7 +384,7 @@
<x>0</x>
<y>0</y>
<width>376</width>
<height>17</height>
<height>27</height>
</rect>
</property>
<widget class="QMenu" name="menuSave">

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>300</width>
<height>28</height>
<height>30</height>
</rect>
</property>
<property name="sizePolicy">
@ -19,102 +19,25 @@
<property name="minimumSize">
<size>
<width>300</width>
<height>28</height>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>28</height>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="lblDac">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>vref_comp_fe:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="lblDacmV">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>2999 mV</string>
</property>
</widget>
</item>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="spinDac">
<property name="minimumSize">
@ -129,18 +52,6 @@
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>Set dac in dac units</string>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
@ -150,26 +61,57 @@
<property name="maximum">
<double>10000.000000000000000</double>
</property>
<property name="value">
<double>2799.000000000000000</double>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblDac">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QLabel" name="lblDacmV">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="minimumSize">
<size>
<width>5</width>
<height>20</height>
<width>60</width>
<height>25</height>
</size>
</property>
</spacer>
<property name="maximumSize">
<size>
<width>60</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>---mV</string>
</property>
</widget>
</item>
</layout>
</widget>

View File

@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>882</height>
<height>906</height>
</rect>
</property>
<property name="sizePolicy">
@ -139,8 +139,7 @@
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
@ -150,9 +149,6 @@
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/mountain.png</normaloff>:/icons/images/mountain.png</iconset>
</property>
<property name="toolTip">
<string/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhNone</set>
</property>
@ -175,616 +171,84 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>400</height>
<height>395</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>524287</width>
<height>400</height>
<height>395</height>
</size>
</property>
<layout class="QGridLayout" name="layoutTabs"/>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
<pointsize>9</pointsize>
</font>
</property>
<layout class="QGridLayout" name="layoutTabs">
<item row="0" column="0">
<widget class="QTabWidget" name="tabs">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>185</red>
<green>185</green>
<blue>185</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>185</red>
<green>185</green>
<blue>185</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>185</red>
<green>185</green>
<blue>185</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tMeasurement">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Measurement</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QScrollArea" name="scrollMeasurement">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>778</width>
<height>351</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tSettings">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollSettings">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tDataOutput">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Data Output</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollDataOutput">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tPlot">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Plot</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollPlot">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_4">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tAdvanced">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Advanced</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollAdvanced">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_5">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tDebugging">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Debugging</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollDebugging">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_6">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tDeveloper">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Developer</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollDeveloper">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_7">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tTerminal">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>Terminal</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_14">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollTerminal">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_8">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>333</height>
</rect>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="defaultUp">
<bool>false</bool>
</property>
<property name="nativeMenuBar">
<bool>true</bool>
</property>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuUtilities">
<property name="title">
<string>Utilities</string>
</property>
<addaction name="actionLoadConfiguration"/>
<addaction name="actionLoadTrimbits"/>
<addaction name="actionSaveTrimbits"/>
<addaction name="actionLoadParameters"/>
</widget>
<widget class="QMenu" name="menuModes">
<property name="title">
<string>Modes</string>
</property>
<addaction name="actionDebug"/>
<addaction name="actionExpert"/>
<addaction name="actionDockable"/>
</widget>
<addaction name="menuUtilities"/>
<addaction name="menuModes"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QDockWidget" name="dockWidgetPlot">
<property name="enabled">
@ -798,8 +262,8 @@
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>54</height>
<width>36</width>
<height>425</height>
</size>
</property>
<property name="maximumSize">
@ -810,15 +274,24 @@
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt; color:#00007f;&quot;&gt;Left Click :zoom in&lt;/span&gt;&lt;br&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt; color:#00007f;&quot;&gt;Right Click : zoom out by 1&lt;/span&gt;&lt;br&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt; color:#00007f;&quot;&gt;Middle Click : panning&lt;/span&gt;&lt;br&gt;&lt;span style=&quot; font-family:'Sans Serif'; font-size:9pt; color:#00007f;&quot;&gt;Ctrl+Right Click : zoom out to full size&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#00007f;&quot;&gt;Left Click :zoom in&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#00007f;&quot;&gt;Righ&lt;/span&gt;&lt;span style=&quot; color:#00007f;&quot;&gt;t Click &lt;/span&gt;&lt;span style=&quot; color:#00007f;&quot;&gt;: zoom out by 1&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#00007f;&quot;&gt;Middle Click : panning&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#00007f;&quot;&gt;Ctrl+Right Click : zoom out to full size&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string/>
@ -827,7 +300,7 @@
<enum>Qt::LeftToRight</enum>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFloatable</set>
<set>QDockWidget::NoDockWidgetFeatures</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea</set>
@ -848,7 +321,7 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
<height>400</height>
</size>
</property>
<property name="maximumSize">
@ -896,125 +369,27 @@
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menu">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>22</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<widget class="QMenu" name="menuUtilities">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Utilities</string>
</property>
<addaction name="actionLoadConfiguration"/>
<addaction name="actionLoadTrimbits"/>
<addaction name="actionSaveTrimbits"/>
<addaction name="actionLoadParameters"/>
</widget>
<widget class="QMenu" name="menuModes">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Modes</string>
</property>
<addaction name="actionDebug"/>
<addaction name="actionExpert"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuUtilities"/>
<addaction name="menuModes"/>
<addaction name="menuHelp"/>
</widget>
<action name="actionLoadConfiguration">
<property name="text">
<string>Load Configuration</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionLoadTrimbits">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Load Trimbits</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionSaveTrimbits">
<property name="text">
<string>Save Trimbits</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionLoadParameters">
<property name="text">
<string>Load Parameters</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionDebug">
<property name="checkable">
@ -1023,12 +398,6 @@
<property name="text">
<string>Debug</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionExpert">
<property name="checkable">
@ -1037,36 +406,23 @@
<property name="text">
<string>Expert</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionDockable">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Dockable</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
<string>Dockable Windows</string>
</property>
</action>
<action name="actionAbout">
<property name="text">
<string>About</string>
<string>&amp;About</string>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</action>
<action name="actionSaveTrimbits">
<property name="text">
<string>Save Trimbits</string>
</property>
</action>
</widget>

View File

@ -16,12 +16,6 @@
<height>425</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
@ -83,15 +77,6 @@
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;ROI enabled at Receiver level (affects only file write)&lt;/p&gt;&lt;p&gt;#rx_roi#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Rx Roi Enabled</string>
</property>
@ -110,10 +95,8 @@
</property>
<property name="font">
<font>
<family>Cantarell</family>
<family>Sans Serif</family>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="title">
@ -126,16 +109,7 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="plotLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
@ -164,26 +138,8 @@
<height>16</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Data Statistics&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
@ -209,12 +165,6 @@
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Max: </string>
</property>
@ -231,12 +181,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>-</string>
</property>
@ -275,12 +219,6 @@
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Min: </string>
</property>
@ -297,12 +235,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>-</string>
</property>
@ -316,12 +248,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>-</string>
</property>
@ -360,12 +286,6 @@
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Sum: </string>
</property>
@ -447,15 +367,6 @@
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If sub images have missing packets&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Complete Image</string>
</property>
@ -521,14 +432,6 @@
</disabled>
</palette>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If sub images have missing packets&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Missing Packets</string>
</property>

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>770</width>
<height>364</height>
<width>775</width>
<height>345</height>
</rect>
</property>
<property name="sizePolicy">
@ -24,16 +24,10 @@
</property>
<property name="maximumSize">
<size>
<width>770</width>
<height>370</height>
<width>775</width>
<height>365</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
@ -43,12 +37,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>File</string>
</property>
@ -67,18 +55,6 @@
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>105</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The file path can be different depending on the Module chosen.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -135,14 +111,8 @@
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of data file in receiver. Can be modified in Measurement tab.&lt;br/&gt;#fname# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of file. Can be modified in Measurement tab.&lt;br/&gt;#fname# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Name Prefix: </string>
@ -157,20 +127,14 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>35</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Directory where one saves the data in receiver. &lt;br/&gt;#fpath# &lt;br/&gt;&lt;br/&gt;Disabled if receiver pc is not same as client pc. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
Disabled if receiver pc is not same as client pc.
</string>
</property>
<property name="text">
<string>Browse</string>
@ -232,14 +196,8 @@
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File Format of data file in receiver&lt;br/&gt;#fformat# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File Format&lt;br/&gt;#fileformat# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Format:</string>
@ -260,20 +218,8 @@
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>105</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File Format of data file in receiver&lt;br/&gt;#fformat# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File Format&lt;br/&gt;#fileformat# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
@ -338,14 +284,13 @@
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Directory where one saves the data in receiver. &lt;br/&gt;#fpath# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
<property name="text">
<string>Path:</string>
@ -369,15 +314,9 @@
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@ -409,14 +348,9 @@
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overwrite enable of data file in receiver&lt;/p&gt;&lt;p&gt; #foverwrite#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Overwrite Enable
#overwrite#</string>
</property>
<property name="text">
<string>Overwrite</string>
@ -463,23 +397,16 @@
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Directory where one saves the data in receiver. &lt;br/&gt;#fpath# &lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
</widget>
</item>
@ -504,12 +431,6 @@
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="boxCorrection_2">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Options</string>
</property>
@ -527,15 +448,6 @@
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Speed of Detector readout&lt;/p&gt;&lt;p&gt;#speed#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Clock Divider:</string>
</property>
@ -571,18 +483,9 @@
<property name="maximumSize">
<size>
<width>200</width>
<height>25</height>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Speed of Detector readout&lt;/p&gt;&lt;p&gt;#speed#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Full Speed</string>
@ -618,25 +521,6 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkTenGiga">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable 10GbE&lt;/p&gt;&lt;p&gt;#tengiga#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>10GbE</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@ -644,15 +528,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable Parallel readout&lt;/p&gt;&lt;p&gt;#parallel#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Parallel Readout</string>
</property>
@ -660,6 +535,23 @@
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkTenGiga">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Compression using Root. Available only for Gotthard in Expert Mode.
&lt;/nobr&gt;&lt;br&gt;&lt;nobr&gt;
#r_compression#
&lt;/nobr&gt;</string>
</property>
<property name="text">
<string>10GbE</string>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
@ -667,15 +559,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable Rate Correction&lt;/p&gt;&lt;p&gt;#ratecorr#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Rate:</string>
</property>
@ -686,15 +569,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Default Dead Time for Rate Correction&lt;/p&gt;&lt;p&gt;#ratecorr#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Default Dead Time</string>
</property>
@ -710,7 +584,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<width>10</width>
<height>20</height>
</size>
</property>
@ -721,15 +595,6 @@
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Custom Dead Time for Rate Correction&lt;/p&gt;&lt;p&gt;#ratecorr#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Custom Dead Time:</string>
</property>
@ -752,21 +617,6 @@
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Custom Dead Time for Rate Correction&lt;/p&gt;&lt;p&gt;#ratecorr#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
@ -802,19 +652,6 @@
</item>
</layout>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@ -826,13 +663,6 @@
<tabstop>btnOutputBrowse</tabstop>
<tabstop>comboFileFormat</tabstop>
<tabstop>chkOverwriteEnable</tabstop>
<tabstop>chkParallel</tabstop>
<tabstop>comboClkDivider</tabstop>
<tabstop>chkRate</tabstop>
<tabstop>radioDefaultDeadtime</tabstop>
<tabstop>radioCustomDeadtime</tabstop>
<tabstop>spinCustomDeadTime</tabstop>
<tabstop>chkTenGiga</tabstop>
</tabstops>
<resources>
<include location="../include/icons.qrc"/>

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>740</width>
<height>320</height>
<width>775</width>
<height>345</height>
</rect>
</property>
<property name="sizePolicy">
@ -24,140 +24,40 @@
</property>
<property name="maximumSize">
<size>
<width>740</width>
<height>330</height>
<width>775</width>
<height>400</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="1" column="0" colspan="5">
<item row="1" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>5</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>330</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tabDAC">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>330</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>DACs</string>
</attribute>
<layout class="QGridLayout" name="gridlayoutDac">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>10</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
</layout>
<layout class="QGridLayout" name="gridlayoutDac"/>
</widget>
<widget class="QWidget" name="tabADC">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<attribute name="title">
<string>ADCs</string>
</attribute>
<layout class="QGridLayout" name="gridlayoutAdc">
<property name="horizontalSpacing">
<number>10</number>
</property>
</layout>
<layout class="QGridLayout" name="gridlayoutAdc"/>
</widget>
</widget>
</item>
<item row="0" column="0" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>350</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QLabel" name="lblReadout">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Readout: </string>
</property>
</widget>
</item>
<item row="0" column="3" colspan="2">
<item row="0" column="1">
<widget class="QComboBox" name="comboDetector">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -168,32 +68,42 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
<height>28</height>
</size>
</property>
<property name="maximumSize">
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16777215</width>
<height>25</height>
<width>500</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblReadout">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Select readout to read dac or adc info</string>
<property name="text">
<string>Readout: </string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>comboDetector</tabstop>
<tabstop>tabWidget</tabstop>
</tabstops>
<resources>
<include location="../include/icons.qrc"/>
</resources>

File diff suppressed because it is too large Load Diff

View File

@ -28,24 +28,12 @@
<height>345</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1" colspan="3">
<widget class="QTextEdit" name="dispLog">
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@ -59,23 +47,11 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/icons/images/upload.png&quot;/&gt; = previous command&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/icons/images/download.png&quot;/&gt; = clears current command&lt;/p&gt;&lt;p&gt;[Return or Enter key] = executes current command&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Up arrow key picks up the previous command.&lt;/p&gt;&lt;p&gt;Down arrow key clears the current command.&lt;/p&gt;&lt;p&gt;Return or Enter key executes the current command&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -87,27 +63,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>35</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>Clear log</string>
</property>
<property name="text">
<string>Clear</string>
</property>
@ -125,27 +86,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>35</height>
</size>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="toolTip">
<string>Save log</string>
</property>
<property name="text">
<string>Save</string>
</property>
@ -163,12 +109,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Cantarell</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Command:</string>
</property>
@ -190,9 +130,9 @@
</layout>
</widget>
<tabstops>
<tabstop>btnSave</tabstop>
<tabstop>btnClear</tabstop>
<tabstop>dispCommand</tabstop>
<tabstop>btnClear</tabstop>
<tabstop>btnSave</tabstop>
</tabstops>
<resources>
<include location="../include/icons.qrc"/>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,10 +41,7 @@ class qDefs : public QWidget {
*/
qDefs(){};
static QFont GetDefaultFont() {
return QFont("Cantarell", 10, QFont::Normal);
}
static const int Q_FONT_SIZE = 9;
static const int DATA_GAIN_PLOT_RATIO = 5;
static const int MIN_HEIGHT_GAIN_PLOT_1D = 75;
static const int GUI_ZMQ_RCV_HWM = 2;

View File

@ -4,6 +4,9 @@
#include "qDefs.h"
#include "sls/Detector.h"
#include "ui_form_detectormain.h"
#include <QTabWidget>
class QScrollArea;
class QResizeEvent;
namespace sls {
@ -18,6 +21,15 @@ class qTabDebugging;
class qTabDeveloper;
class qTabMessages;
/** To Over-ride the QTabWidget class to get the tabBar protected
* methodTabWidget */
class MyTabWidget : public QTabWidget {
public:
MyTabWidget(QWidget *parent = 0) { setParent(parent); }
/** Overridden protected method from QTabWidget */
QTabBar *tabBar() { return QTabWidget::tabBar(); }
};
class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
Q_OBJECT
@ -63,6 +75,8 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
slsDetectorDefs::detectorType detType;
std::unique_ptr<Detector> det;
qDrawPlot *plot;
MyTabWidget *tabs;
QScrollArea *scroll[NumberOfTabs];
qTabMeasurement *tabMeasurement;
qTabDataOutput *tabDataOutput;
qTabPlot *tabPlot;
@ -71,7 +85,9 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
qTabDebugging *tabDebugging;
qTabDeveloper *tabDeveloper;
qTabMessages *tabMessages;
int isDeveloper{false};
int isDeveloper;
int heightPlotWindow;
int heightCentralWidget;
QString zoomToolTip;
QColor defaultTabColor;
};

View File

@ -64,8 +64,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
void resizeEvent(QResizeEvent *event);
private slots:
void Zoom1DGainPlot(const QRectF &rect);
void Zoom2DGainPlot(const QRectF &rect);
void SetSaveFileName(QString val);
void UpdatePlot();

View File

@ -4,6 +4,9 @@
#include "sls/Detector.h"
#include "ui_form_tab_debugging.h"
class QTreeWidget;
class QTreeWidgetItem;
namespace sls {
class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
@ -15,20 +18,22 @@ class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
void Refresh();
private slots:
void GetDetectorStatus();
void GetInfo();
void EnableTest();
void SetParameters(QTreeWidgetItem *item);
void TestDetector();
private:
void SetupWidgetWindow();
void Initialization();
void PopulateDetectors();
void GetFirmwareVersion();
void GetServerSoftwareVersion();
void GetReceiverVersion();
void GetDetectorStatus();
Detector *det;
/** Tree Widget displaying the detectors, modules */
QTreeWidget *treeDet;
QLabel *lblDetectorHostname;
QLabel *lblDetectorFirmware;
QLabel *lblDetectorSoftware;
};
} // namespace sls

View File

@ -103,6 +103,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
int numMeasurements{1};
int currentMeasurement{0};
mutable std::mutex mProgress;
};
} // namespace sls

View File

@ -38,8 +38,8 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
void CheckAspectRatio();
void SetZRange();
void SetStreamingFrequency();
void SelectHwm(int value);
void SetHwm(int value);
void SetStreamingHwm(int value);
void SetReceivingHwm(int value);
signals:
void DisableZoomSignal(bool);
@ -50,11 +50,8 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
void Select1DPlot(bool enable);
void GetGapPixels();
void GetStreamingFrequency();
void GetHwm();
void GetStreamingHwm();
void SetStreamingHwm(int value);
void GetReceivingHwm();
void SetReceivingHwm(int value);
void SetXYRange();
void MaintainAspectRatio(int dimension);
@ -69,8 +66,6 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
static QString defaultImageXAxisTitle;
static QString defaultImageYAxisTitle;
static QString defaultImageZAxisTitle;
enum { SND_HWM, RX_HWM };
};
} // namespace sls

View File

@ -1,13 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include <QFontMetrics>
#include <QString>
namespace sls {
int qResolve_GetQFontWidth(const QFontMetrics fm, const QString &text,
int len = -1);
} // namespace sls

View File

@ -92,7 +92,7 @@ class SlsQt1DPlot : public QwtPlot {
Q_OBJECT
public:
SlsQt1DPlot(QWidget * = NULL, bool gain = false);
SlsQt1DPlot(QWidget * = NULL);
~SlsQt1DPlot();
void SetTitle(QString title);
@ -145,8 +145,6 @@ class SlsQt1DPlot : public QwtPlot {
void DisableRoiBox();
private:
bool gainPlot{false};
SlsQtH1DList *hist_list{nullptr};
SlsQt1DZoomer *zoomer{nullptr};
QwtPlotPanner *panner{nullptr};
@ -171,16 +169,9 @@ class SlsQt1DPlot : public QwtPlot {
QwtPlotShapeItem *roiBox{nullptr};
signals:
void PlotZoomedSignal(const QRectF &);
public slots:
void SetZoomX(const QRectF &rect);
void UnZoom();
void Update();
private slots:
void GetPannedCoord(int, int);
};
} // namespace sls

View File

@ -19,7 +19,7 @@ class SlsQt2DPlot : public QwtPlot {
Q_OBJECT
public:
SlsQt2DPlot(QWidget * = NULL, bool gain = false);
SlsQt2DPlot(QWidget * = NULL);
~SlsQt2DPlot();
void SetTitle(QString title);
void SetXTitle(QString title);
@ -76,19 +76,10 @@ class SlsQt2DPlot : public QwtPlot {
public slots:
void showSpectrogram(bool on);
void SetZoom(const QRectF &rect);
private slots:
void GetPannedCoord(int, int);
signals:
void PlotZoomedSignal(const QRectF &);
private:
void SetupZoom();
void SetupColorMap();
bool gainPlot{false};
QwtLinearColorMap *myColourMap(QVector<double> colourStops);
QwtLinearColorMap *myColourMap(int log = 0);

View File

@ -3,10 +3,6 @@
/* TODO! short description */
#include "SlsQt1DPlot.h"
#include "qDefs.h"
#include "qVersionResolve.h"
#include "sls/logger.h"
#include <iostream>
#include <qwt_legend.h>
#include <qwt_math.h>
@ -336,8 +332,7 @@ void SlsQtH1DList::Remove(SlsQtH1D *hist) {
}
// 1d plot stuff
SlsQt1DPlot::SlsQt1DPlot(QWidget *parent, bool gain)
: QwtPlot(parent), gainPlot(gain) {
SlsQt1DPlot::SlsQt1DPlot(QWidget *parent) : QwtPlot(parent) {
// n_histograms_attached=0;
hline = vline = nullptr;
hist_list = new SlsQtH1DList();
@ -355,19 +350,6 @@ SlsQt1DPlot::SlsQt1DPlot(QWidget *parent, bool gain)
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating);
setFont(qDefs::GetDefaultFont());
SetTitleFont(qDefs::GetDefaultFont());
SetXFont(qDefs::GetDefaultFont());
SetYFont(qDefs::GetDefaultFont());
if (gainPlot) {
SetTitle("");
SetYTitle("Gain");
DisableZoom(true);
// set only major ticks from 0 to 3
auto div = axisScaleEngine(QwtPlot::yLeft)->divideScale(0, 3, 3, 0, 1);
setAxisScaleDiv(QwtPlot::yLeft, div);
}
}
SlsQt1DPlot::~SlsQt1DPlot() {
@ -482,16 +464,6 @@ void SlsQt1DPlot::DisableRoiBox() {
}
}
void SlsQt1DPlot::SetZoomX(const QRectF &rect) {
double xmin = 0, xmax = 0, ymin = 0, ymax = 0;
rect.getCoords(&xmin, &ymin, &xmax, &ymax);
LOG(logDEBUG1) << "Zoomed in at " << xmin << "\t" << xmax << "\t" << ymin
<< "\t" << ymax;
SetXMinMax(xmin, xmax);
// SetYMinMax(ymin, ymax);
replot();
}
void SlsQt1DPlot::UnZoom() {
setAxisScale(QwtPlot::xBottom, zoomer->x(), zoomer->x() + zoomer->w());
setAxisScale(QwtPlot::yLeft, zoomer->y(), zoomer->y() + zoomer->h());
@ -508,22 +480,6 @@ void SlsQt1DPlot::SetZoom(double xmin, double ymin, double x_width,
Update();
}
void SlsQt1DPlot::GetPannedCoord(int, int) {
double xmin = invTransform(QwtPlot::xBottom, 0);
double xmax = invTransform(QwtPlot::xBottom, canvas()->rect().width());
double ymax = invTransform(QwtPlot::yLeft, 0);
double ymin = invTransform(QwtPlot::yLeft, canvas()->rect().height());
LOG(logDEBUG1) << "Rect1 " << xmin << "\t" << xmax << "\t" << ymin << "\t"
<< ymax;
QPointF topLeft = QPointF(xmin, ymin);
QPointF bottomRight = QPointF(xmax, ymax);
const QRectF rectf = QRectF(topLeft, bottomRight);
rectf.getCoords(&xmin, &ymin, &xmax, &ymax);
LOG(logDEBUG1) << "RectF " << xmin << "\t" << xmax << "\t" << ymin << "\t"
<< ymax;
emit PlotZoomedSignal(rectf);
}
void SlsQt1DPlot::RemoveHLine() {
if (hline)
hline->detach();
@ -560,7 +516,7 @@ void SlsQt1DPlot::InsertVLine(double x) {
void SlsQt1DPlot::SetupZoom() {
// LeftButton for the zooming
// MiddleButton for the panning
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
@ -572,22 +528,18 @@ void SlsQt1DPlot::SetupZoom() {
panner = new QwtPlotPanner((QwtPlotCanvas *)canvas());
panner->setAxisEnabled(QwtPlot::yRight, false);
panner->setMouseButton(Qt::MiddleButton);
panner->setMouseButton(Qt::MidButton);
// Avoid jumping when labels with more/less digits
// appear/disappear when scrolling vertically
const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
sd->setMinimumExtent(qResolve_GetQFontWidth(fm, "100.00"));
sd->setMinimumExtent(fm.width("100.00"));
const QColor c(Qt::darkBlue);
zoomer->setRubberBandPen(c);
zoomer->setTrackerPen(c);
connect(zoomer, SIGNAL(zoomed(const QRectF &)), this,
SIGNAL(PlotZoomedSignal(const QRectF &)));
connect(panner, SIGNAL(panned(int, int)), this,
SLOT(GetPannedCoord(int, int)));
}
// Set a plain canvas frame and align the scales to it
@ -646,7 +598,7 @@ void SlsQt1DPlot::DisableZoom(bool disable) {
Qt::RightButton);
}
if (panner)
panner->setMouseButton(Qt::MiddleButton);
panner->setMouseButton(Qt::MidButton);
}
}
}

View File

@ -1,16 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include "SlsQt2DPlot.h"
#include "qDefs.h"
#include "qVersionResolve.h"
#include "sls/logger.h"
// #include "sls/ansi.h"
//Suppressing warning until qwt has a fix, avoid
//patching and should be backwards compatible
//https://doc.qt.io/qt-5/qflags-obsolete.html
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include <qlist.h>
#include <qprinter.h>
#include <qtoolbutton.h>
#include <qwt_color_map.h>
#include <qwt_plot_layout.h>
@ -20,15 +14,13 @@
#include <qwt_scale_draw.h>
#include <qwt_scale_engine.h>
#include <qwt_scale_widget.h>
#pragma GCC diagnostic pop
#include <cmath>
#include <iostream>
namespace sls {
SlsQt2DPlot::SlsQt2DPlot(QWidget *parent, bool gain)
: QwtPlot(parent), gainPlot(gain) {
SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) {
isLog = 0;
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating);
@ -40,23 +32,7 @@ SlsQt2DPlot::SlsQt2DPlot(QWidget *parent, bool gain)
d_spectrogram->attach(this);
plotLayout()->setAlignCanvasToScales(true);
FillTestPlot();
setFont(qDefs::GetDefaultFont());
SetTitleFont(qDefs::GetDefaultFont());
SetXFont(qDefs::GetDefaultFont());
SetYFont(qDefs::GetDefaultFont());
SetZFont(qDefs::GetDefaultFont());
Update();
if (gainPlot) {
setTitle("Gain");
SetZTitle("");
enableAxis(QwtPlot::yLeft, false);
enableAxis(QwtPlot::xBottom, false);
DisableZoom(true);
// set only major ticks from 0 to 3
auto div = axisScaleEngine(QwtPlot::yRight)->divideScale(0, 3, 3, 0, 1);
setAxisScaleDiv(QwtPlot::yRight, div);
}
}
SlsQt2DPlot::~SlsQt2DPlot() = default;
@ -142,7 +118,7 @@ void SlsQt2DPlot::FillTestPlot(int mode) {
void SlsQt2DPlot::SetupZoom() {
// LeftButton for the zooming
// MiddleButton for the panning
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
@ -153,23 +129,18 @@ void SlsQt2DPlot::SetupZoom() {
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton);
panner = new QwtPlotPanner(canvas());
panner->setAxisEnabled(QwtPlot::yRight, false);
panner->setMouseButton(Qt::MiddleButton);
panner->setMouseButton(Qt::MidButton);
// Avoid jumping when labels with more/less digits
// appear/disappear when scrolling vertically
const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
sd->setMinimumExtent(qResolve_GetQFontWidth(fm, "100.00"));
sd->setMinimumExtent(fm.width("100.00"));
const QColor c(Qt::darkBlue);
zoomer->setRubberBandPen(c);
zoomer->setTrackerPen(c);
connect(zoomer, SIGNAL(zoomed(const QRectF &)), this,
SIGNAL(PlotZoomedSignal(const QRectF &)));
connect(panner, SIGNAL(panned(int, int)), this,
SLOT(GetPannedCoord(int, int)));
}
void SlsQt2DPlot::UnZoom(bool replot) {
@ -182,32 +153,6 @@ void SlsQt2DPlot::UnZoom(bool replot) {
// zoomer->zoom(0);
}
void SlsQt2DPlot::GetPannedCoord(int, int) {
double xmin = invTransform(QwtPlot::xBottom, 0);
double xmax = invTransform(QwtPlot::xBottom, canvas()->rect().width());
double ymax = invTransform(QwtPlot::yLeft, 0);
double ymin = invTransform(QwtPlot::yLeft, canvas()->rect().height());
LOG(logDEBUG1) << "Rect1 " << xmin << "\t" << xmax << "\t" << ymin << "\t"
<< ymax;
QPointF topLeft = QPointF(xmin, ymin);
QPointF bottomRight = QPointF(xmax, ymax);
const QRectF rectf = QRectF(topLeft, bottomRight);
rectf.getCoords(&xmin, &ymin, &xmax, &ymax);
LOG(logDEBUG1) << "RectF " << xmin << "\t" << xmax << "\t" << ymin << "\t"
<< ymax;
emit PlotZoomedSignal(rectf);
}
void SlsQt2DPlot::SetZoom(const QRectF &rect) {
double xmin = 0, xmax = 0, ymin = 0, ymax = 0;
rect.getCoords(&xmin, &ymin, &xmax, &ymax);
LOG(logDEBUG1) << "Plot zooming in to " << xmin << " " << xmax << " "
<< ymin << " " << ymax;
SetXMinMax(xmin, xmax);
SetYMinMax(ymin, ymax);
replot();
}
void SlsQt2DPlot::SetZoom(double xmin, double ymin, double x_width,
double y_width) {
zoomer->setZoomBase(QRectF(xmin, ymin, x_width, y_width));
@ -244,7 +189,7 @@ void SlsQt2DPlot::DisableZoom(bool disable) {
Qt::RightButton);
}
if (panner)
panner->setMouseButton(Qt::MiddleButton);
panner->setMouseButton(Qt::MidButton);
}
}
}
@ -288,12 +233,10 @@ void SlsQt2DPlot::Update() {
hist->SetMinimumToFirstGreaterThanZero();
const QwtInterval zInterval = d_spectrogram->data()->interval(Qt::ZAxis);
rightAxis->setColorMap(zInterval, myColourMap(isLog));
if (!zoomer->zoomRectIndex())
UnZoom();
if (!gainPlot) {
setAxisScale(QwtPlot::yRight, zInterval.minValue(),
zInterval.maxValue());
}
setAxisScale(QwtPlot::yRight, zInterval.minValue(), zInterval.maxValue());
plotLayout()->setAlignCanvasToScales(true);
replot();
}

View File

@ -49,6 +49,7 @@ void qCloneWidget::SetupWidgetWindow(QString title) {
std::string(" - ") + Logger::Timestamp();
setWindowTitle(QString(winTitle.c_str()));
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
boxPlot->setTitle(title);
// 1d
@ -107,7 +108,7 @@ void qCloneWidget::SavePlot() {
QString fName = filePath + QString('/') + fileName + QString("_clone") +
QString("%1").arg(id) + QString("_acq") +
QString("%1").arg(acqIndex) + QString(".png");
LOG(logINFO) << "Saving Clone:" << fName.toLatin1().constData();
LOG(logINFO) << "Saving Clone:" << fName.toAscii().constData();
// save
QImage img(centralwidget->size().width(), centralwidget->size().height(),
QImage::Format_RGB32);

View File

@ -61,7 +61,7 @@ void qDacWidget::GetDac() {
void qDacWidget::SetDac() {
int val = (int)spinDac->value();
LOG(logINFO) << "Setting dac:" << lblDac->text().toLatin1().data() << " : "
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() << " : "
<< val;
try {

View File

@ -16,28 +16,21 @@
#include "sls/versionAPI.h"
#include <QFileDialog>
#include <QPlastiqueStyle>
#include <QResizeEvent>
#include <QScrollArea>
#include <QSizePolicy>
#include "sls/Version.h"
#include <getopt.h>
#include <string>
#include <sys/stat.h>
std::string getClientVersion() {
try {
sls::Version v(APILIB);
return v.concise();
} catch (...) {
return std::string("unknown");
}
}
int main(int argc, char **argv) {
// options
std::string fname;
bool isDeveloper = false;
int64_t tempval = 0;
int multiId = 0;
// parse command line for config
@ -79,7 +72,9 @@ int main(int argc, char **argv) {
break;
case 'v':
LOG(sls::logINFO) << "SLS Detector GUI " << getClientVersion();
tempval = APIGUI;
LOG(sls::logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
<< std::hex << tempval << ")";
return 0;
case 'h':
@ -100,6 +95,7 @@ int main(int argc, char **argv) {
}
QApplication app(argc, argv);
app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication
try {
sls::qDetectorMain det(multiId, fname, isDeveloper);
det.show();
@ -117,7 +113,7 @@ namespace sls {
qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
bool isDevel)
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC),
isDeveloper(isDevel) {
isDeveloper(isDevel), heightPlotWindow(0), heightCentralWidget(0) {
setupUi(this);
SetUpDetector(fname, multiId);
@ -126,45 +122,94 @@ qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
qDetectorMain::~qDetectorMain() {
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));
for (int i = 0; i < NumberOfTabs; ++i) {
delete scroll[i];
}
}
void qDetectorMain::SetUpWidgetWindow() {
setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
// plot setup
plot = new qDrawPlot(dockWidgetPlot, det.get());
LOG(logDEBUG) << "DockPlot ready";
dockWidgetPlot->setWidget(plot);
dockWidgetPlot->setFloating(false);
zoomToolTip = dockWidgetPlot->toolTip();
// tabs setup
tabs = new MyTabWidget(this);
layoutTabs->addWidget(tabs);
// creating all the other tab widgets
tabMeasurement = new qTabMeasurement(tMeasurement, det.get(), plot);
tabDataOutput = new qTabDataOutput(tDataOutput, det.get());
tabPlot = new qTabPlot(tPlot, det.get(), plot);
tabSettings = new qTabSettings(tSettings, det.get());
tabAdvanced = new qTabAdvanced(tAdvanced, det.get(), plot);
tabDebugging = new qTabDebugging(tDebugging, det.get());
tabDeveloper = new qTabDeveloper(tDeveloper, det.get());
tabMeasurement = new qTabMeasurement(this, det.get(), plot);
tabDataOutput = new qTabDataOutput(this, det.get());
tabPlot = new qTabPlot(this, det.get(), plot);
tabSettings = new qTabSettings(this, det.get());
tabAdvanced = new qTabAdvanced(this, det.get(), plot);
tabDebugging = new qTabDebugging(this, det.get());
tabDeveloper = new qTabDeveloper(this, det.get());
scrollMeasurement->setWidget(tabMeasurement);
scrollDataOutput->setWidget(tabDataOutput);
scrollPlot->setWidget(tabPlot);
scrollSettings->setWidget(tabSettings);
scrollAdvanced->setWidget(tabAdvanced);
scrollDebugging->setWidget(tabDebugging);
scrollDeveloper->setWidget(tabDeveloper);
scrollTerminal->setWidget(tabMessages);
// creating the scroll area widgets for the tabs
for (int i = 0; i < NumberOfTabs; ++i) {
scroll[i] = new QScrollArea();
scroll[i]->setFrameShape(QFrame::NoFrame);
}
// setting the tab widgets to the scrollareas
scroll[MEASUREMENT]->setWidget(tabMeasurement);
scroll[DATAOUTPUT]->setWidget(tabDataOutput);
scroll[PLOT]->setWidget(tabPlot);
scroll[SETTINGS]->setWidget(tabSettings);
scroll[ADVANCED]->setWidget(tabAdvanced);
scroll[DEBUGGING]->setWidget(tabDebugging);
scroll[DEVELOPER]->setWidget(tabDeveloper);
// inserting all the tabs
tabs->insertTab(MEASUREMENT, scroll[MEASUREMENT], "Measurement");
tabs->insertTab(DATAOUTPUT, scroll[DATAOUTPUT], "Data Output");
tabs->insertTab(PLOT, scroll[PLOT], "Plot");
tabs->insertTab(SETTINGS, scroll[SETTINGS], "Settings");
tabs->insertTab(ADVANCED, scroll[ADVANCED], "Advanced");
tabs->insertTab(DEBUGGING, scroll[DEBUGGING], "Debugging");
tabs->insertTab(DEVELOPER, scroll[DEVELOPER], "Developer");
// no scroll buttons this way
tabs->insertTab(MESSAGES, tabMessages, "Terminal");
// swap tabs so that messages is last tab
tabs->tabBar()->moveTab(tabs->indexOf(tabMeasurement), MEASUREMENT);
tabs->tabBar()->moveTab(tabs->indexOf(tabSettings), SETTINGS);
tabs->tabBar()->moveTab(tabs->indexOf(tabDataOutput), DATAOUTPUT);
tabs->tabBar()->moveTab(tabs->indexOf(tabPlot), PLOT);
tabs->tabBar()->moveTab(tabs->indexOf(tabAdvanced), ADVANCED);
tabs->tabBar()->moveTab(tabs->indexOf(tabDebugging), DEBUGGING);
tabs->tabBar()->moveTab(tabs->indexOf(tabDeveloper), DEVELOPER);
tabs->tabBar()->moveTab(tabs->indexOf(tabMessages), MESSAGES);
tabs->setCurrentIndex(MEASUREMENT);
// other tab properties
// Default tab color
defaultTabColor = tabs->tabBar()->tabTextColor(DATAOUTPUT);
// set current tab to blue
// Set the current tab(measurement) to blue as it is the current one
tabs->tabBar()->setTabTextColor(0, QColor(0, 0, 200, 255));
tabs->tabBar()->setExpanding(true);
// mode setup - to set up the tabs initially as disabled, not in form so
// done here
LOG(logINFO)
<< "Dockable Mode: 0, Debug Mode: 0, Expert Mode: 0, Developer Mode: "
<< isDeveloper;
tabs->setTabEnabled(DEBUGGING, false);
tabs->setTabEnabled(ADVANCED, false);
tabs->setTabEnabled(DEVELOPER, isDeveloper);
actionLoadTrimbits->setVisible(false);
actionSaveTrimbits->setVisible(false);
LOG(logINFO) << "Debug Mode: 0, Expert Mode: 0, Developer Mode: "
<< isDeveloper;
dockWidgetPlot->setFloating(false);
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
// Other setup
// Height of plot and central widget
heightPlotWindow = dockWidgetPlot->size().height();
heightCentralWidget = centralwidget->size().height();
// Default zoom Tool Tip
zoomToolTip = dockWidgetPlot->toolTip();
Initialization();
}
@ -175,7 +220,7 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
det = make_unique<Detector>(multiID);
// create messages tab to capture config file loading logs
tabMessages = new qTabMessages(tTerminal);
tabMessages = new qTabMessages(this);
// loads the config file at startup
if (!config_file.empty())
@ -305,8 +350,18 @@ void qDetectorMain::EnableModes(QAction *action) {
actionSaveTrimbits->setVisible(visible);
tabSettings->SetExportMode(enable);
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
} else {
LOG(logERROR) << "Unknown action";
}
// Set DockableMode
else {
enable = actionDockable->isChecked();
if (enable) {
dockWidgetPlot->setFeatures(QDockWidget::DockWidgetFloatable);
} else {
dockWidgetPlot->setFloating(false);
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
}
LOG(logINFO) << "Dockable Mode: " << qDefs::stringEnable(enable);
}
}
@ -323,7 +378,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
// Gets called when cancelled as well
if (!fName.isEmpty()) {
refreshTabs = true;
det->loadConfig(std::string(fName.toLatin1().constData()));
det->loadConfig(std::string(fName.toAscii().constData()));
qDefs::Message(qDefs::INFORMATION,
"The Configuration Parameters have been "
"configured successfully.",
@ -341,7 +396,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
// Gets called when cancelled as well
if (!fName.isEmpty()) {
refreshTabs = true;
det->loadParameters(std::string(fName.toLatin1().constData()));
det->loadParameters(std::string(fName.toAscii().constData()));
qDefs::Message(qDefs::INFORMATION,
"The Detector Parameters have been "
"configured successfully.",
@ -361,7 +416,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
fileDialog->setFileMode(QFileDialog::AnyFile);
if (fileDialog->exec() == QDialog::Accepted) {
fName = fileDialog->selectedFiles()[0];
det->loadTrimbits(std::string(fName.toLatin1().constData()));
det->loadTrimbits(std::string(fName.toAscii().constData()));
qDefs::Message(qDefs::INFORMATION,
"The Trimbits have been loaded successfully.",
"qDetectorMain::ExecuteUtilities");
@ -377,7 +432,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
this, tr("Save Detector Trimbits"), fPath,
tr("Trimbit files (*.trim noise.sn*);;All Files(*)"));
if (!fName.isEmpty()) {
det->saveTrimbits(std::string(fName.toLatin1().constData()));
det->saveTrimbits(std::string(fName.toAscii().constData()));
qDefs::Message(qDefs::INFORMATION,
"The Trimbits have been saved successfully.",
"qDetectorMain::ExecuteUtilities");
@ -408,9 +463,10 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, "
"Gotthard, Gotthard2 and Moench detectors";
std::string guiVersion = ToStringHex(APIGUI);
std::string clientVersion = "unknown";
try {
clientVersion = det->getClientVersion();
clientVersion = ToStringHex(det->getClientVersion());
}
CATCH_DISPLAY("Could not get client version.",
"qDetectorMain::ExecuteHelp")
@ -419,8 +475,9 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
qDefs::INFORMATION,
"<p style=\"font-family:verdana;\">"
"<b>SLS Detector Client version: " +
clientVersion +
"<b>SLS Detector GUI version:&nbsp;&nbsp;&nbsp;" +
guiVersion +
"<br>SLS Detector Client version: " + clientVersion +
"</b><br><br>"
"Common GUI to control the SLS Detectors: "
@ -487,17 +544,36 @@ void qDetectorMain::Refresh(int index) {
void qDetectorMain::ResizeMainWindow(bool b) {
LOG(logDEBUG1) << "Resizing Main Window: height:" << height();
// undocked from the main window
if (b) {
setMaximumHeight(centralwidget->height() + menu->height());
LOG(logINFO) << "Plot undocked from main window";
// sets the main window height to a smaller maximum to get rid of space
setMaximumHeight(height() - heightPlotWindow - 9);
dockWidgetPlot->setMinimumHeight(0);
LOG(logINFO) << "Undocking from main window";
} else {
setMaximumHeight(QWIDGETSIZE_MAX);
LOG(logINFO) << "Plot docked back to main window";
// the minimum for plot will be set when the widget gets resized
// automatically
}
}
void qDetectorMain::resizeEvent(QResizeEvent *event) {
tabs->tabBar()->setFixedWidth(width());
if (!dockWidgetPlot->isFloating()) {
dockWidgetPlot->setMinimumHeight(height() - centralwidget->height() -
50);
centralwidget->setMaximumHeight(heightCentralWidget);
}
// adjusting tab width
if (width() >= 800) {
tabs->tabBar()->setFixedWidth(width() + 61);
} else {
tabs->tabBar()->setMinimumWidth(0);
tabs->tabBar()->setExpanding(true);
tabs->tabBar()->setUsesScrollButtons(true);
}
event->accept();
}

View File

@ -12,8 +12,7 @@
#include <QFileDialog>
#include <QPainter>
#include <QResizeEvent>
#include <QtConcurrent/QtConcurrentRun>
#include <qwt_scale_engine.h>
#include <QtConcurrentRun>
namespace sls {
@ -99,6 +98,8 @@ void qDrawPlot::Initialization() {
}
void qDrawPlot::SetupPlots() {
setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
// default image size
slsDetectorDefs::xy res = det->getDetectorSize();
nPixelsX = res.x;
@ -106,10 +107,10 @@ void qDrawPlot::SetupPlots() {
LOG(logINFO) << "nPixelsX:" << nPixelsX;
LOG(logINFO) << "nPixelsY:" << nPixelsY;
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
widgetStatistics->hide();
lblCompleteImage->hide();
lblInCompleteImage->hide();
lblRxRoiEnabled->hide();
// setup 1d data
@ -135,6 +136,11 @@ void qDrawPlot::SetupPlots() {
hists1d.append(h);
// setup 1d plot
plot1d = new SlsQt1DPlot(boxPlot);
plot1d->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot1d->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot1d->SetXFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot1d->SetYFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot1d->SetTitle("");
plot1d->SetXTitle(xTitle1d);
plot1d->SetYTitle(yTitle1d);
@ -152,13 +158,25 @@ void qDrawPlot::SetupPlots() {
gainhist1d->SetLineColor(0);
gainhist1d->setStyleLinesorDots(isLines);
gainhist1d->setSymbolMarkers(isMarkers);
gainhist1d->setItemAttribute(QwtPlotItem::Legend, false);
// setup 1d gain plot
gainplot1d = new SlsQt1DPlot(boxPlot, true);
gainplot1d = new SlsQt1DPlot(boxPlot);
gainplot1d->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
gainplot1d->SetYFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
gainplot1d->SetTitle("");
gainplot1d->SetYTitle("Gain");
// set ticks to just 3
QList<double> majorTicks({0, 1, 2, 3});
QwtScaleDiv div(0, 3, QList<double>(), QList<double>(), majorTicks);
gainplot1d->setAxisScaleDiv(QwtPlot::yLeft, div);
// gainplot1d->axisScaleDraw(QwtPlot::xBottom)->enableComponent(QwtScaleDraw::Ticks,
// false);
// gainplot1d->axisScaleDraw(QwtPlot::yLeft)->enableComponent(QwtScaleDraw::Labels,
// false);
gainhist1d->setItemAttribute(QwtPlotItem::Legend, false);
gainhist1d->Attach(gainplot1d);
gainplot1d->hide();
connect(plot1d, SIGNAL(PlotZoomedSignal(const QRectF &)), this,
SLOT(Zoom1DGainPlot(const QRectF &)));
// setup 2d data
@ -185,17 +203,30 @@ void qDrawPlot::SetupPlots() {
plot2d = new SlsQt2DPlot(boxPlot);
plot2d->SetData(nPixelsX, -0.5, nPixelsX - 0.5, nPixelsY, -0.5,
nPixelsY - 0.5, data2d);
plot2d->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot2d->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot2d->SetXFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot2d->SetYFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot2d->SetZFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
plot2d->setTitle("");
plot2d->SetXTitle(xTitle2d);
plot2d->SetYTitle(yTitle2d);
plot2d->SetZTitle(zTitle2d);
gainplot2d = new SlsQt2DPlot(boxPlot, true);
gainplot2d = new SlsQt2DPlot(boxPlot);
gainplot2d->SetData(nPixelsX, -0.5, nPixelsX - 0.5, nPixelsY, -0.5,
nPixelsY - 0.5, gainData);
gainplot2d->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
gainplot2d->setTitle("Gain");
gainplot2d->SetZTitle("");
gainplot2d->enableAxis(QwtPlot::yLeft, false);
// gainplot2d->enableAxis(1, false);
gainplot2d->enableAxis(QwtPlot::xBottom, false);
// set ticks to just 3
gainplot2d->setAxisScaleDiv(QwtPlot::yRight, div);
gainplot2d->hide();
connect(plot2d, SIGNAL(PlotZoomedSignal(const QRectF &)), this,
SLOT(Zoom2DGainPlot(const QRectF &)));
// layout of plots
int ratio = qDefs::DATA_GAIN_PLOT_RATIO - 1;
@ -206,16 +237,6 @@ void qDrawPlot::SetupPlots() {
Qt::AlignRight | Qt::AlignTop);
}
void qDrawPlot::Zoom1DGainPlot(const QRectF &rect) {
std::lock_guard<std::mutex> lock(mPlots);
gainplot1d->SetZoomX(rect);
}
void qDrawPlot::Zoom2DGainPlot(const QRectF &rect) {
std::lock_guard<std::mutex> lock(mPlots);
gainplot2d->SetZoom(rect);
}
void qDrawPlot::resizeEvent(QResizeEvent *event) {
if (gainplot2d->isVisible()) {
gainplot2d->setFixedWidth(plot2d->width() /
@ -264,13 +285,13 @@ void qDrawPlot::Select1dPlot(bool enable) {
void qDrawPlot::SetPlotTitlePrefix(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Title to " << title.toLatin1().constData();
LOG(logINFO) << "Setting Title to " << title.toAscii().constData();
plotTitlePrefix = title;
}
void qDrawPlot::SetXAxisTitle(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting X Axis Title to " << title.toLatin1().constData();
LOG(logINFO) << "Setting X Axis Title to " << title.toAscii().constData();
if (is1d) {
xTitle1d = title;
} else {
@ -280,7 +301,7 @@ void qDrawPlot::SetXAxisTitle(QString title) {
void qDrawPlot::SetYAxisTitle(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Y Axis Title to " << title.toLatin1().constData();
LOG(logINFO) << "Setting Y Axis Title to " << title.toAscii().constData();
if (is1d) {
yTitle1d = title;
} else {
@ -290,7 +311,7 @@ void qDrawPlot::SetYAxisTitle(QString title) {
void qDrawPlot::SetZAxisTitle(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Z Axis Title to " << title.toLatin1().constData();
LOG(logINFO) << "Setting Z Axis Title to " << title.toAscii().constData();
zTitle2d = title;
}
@ -472,7 +493,7 @@ void qDrawPlot::EnableGainPlot(bool enable) {
void qDrawPlot::SetSaveFileName(QString val) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logDEBUG) << "Setting Clone/Save File Name to "
<< val.toLatin1().constData();
<< val.toAscii().constData();
fileSaveName = val;
}
@ -487,6 +508,14 @@ void qDrawPlot::ClonePlot() {
if (is1d) {
LOG(logDEBUG) << "Cloning 1D Image";
cloneplot1D = new SlsQt1DPlot();
cloneplot1D->setFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot1D->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot1D->SetXFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot1D->SetYFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot1D->SetTitle(plot1d->title().text());
cloneplot1D->SetXTitle(xTitle1d);
cloneplot1D->SetYTitle(yTitle1d);
@ -496,7 +525,6 @@ void qDrawPlot::ClonePlot() {
h->SetLineColor(iHist);
h->setStyleLinesorDots(isLines);
h->setSymbolMarkers(isMarkers);
h->setItemAttribute(QwtPlotItem::Legend, false);
cloneplotHists1D.append(h);
h->Attach(cloneplot1D);
}
@ -506,14 +534,32 @@ void qDrawPlot::ClonePlot() {
h->setStyleLinesorDots(isLines);
h->setSymbolMarkers(isMarkers);
h->setItemAttribute(QwtPlotItem::Legend, false);
clonegainplot1D = new SlsQt1DPlot(NULL, true);
clonegainplot1D = new SlsQt1DPlot();
clonegainplot1D->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
clonegainplot1D->SetYFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
clonegainplot1D->SetTitle("");
clonegainplot1D->SetYTitle("Gain");
// set ticks to just 3
QList<double> majorTicks({0, 1, 2, 3});
QwtScaleDiv div(0, 3, QList<double>(), QList<double>(), majorTicks);
clonegainplot1D->setAxisScaleDiv(QwtPlot::yLeft, div);
h->Attach(clonegainplot1D);
connect(cloneplot1D, SIGNAL(PlotZoomedSignal(const QRectF &)),
clonegainplot1D, SLOT(SetZoomX(const QRectF &)));
}
} else {
LOG(logDEBUG) << "Cloning 2D Image";
cloneplot2D = new SlsQt2DPlot();
cloneplot2D->setFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot2D->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot2D->SetXFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot2D->SetYFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot2D->SetZFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
cloneplot2D->setTitle(plot2d->title().text());
cloneplot2D->SetXTitle(xTitle2d);
cloneplot2D->SetYTitle(yTitle2d);
@ -523,11 +569,23 @@ void qDrawPlot::ClonePlot() {
cloneplot2D->SetZRange(isZRange[0], isZRange[1], zRange[0], zRange[1]);
if (isGainDataExtracted) {
clonegainplot2D = new SlsQt2DPlot(NULL, true);
clonegainplot2D = new SlsQt2DPlot();
clonegainplot2D->SetTitleFont(
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
clonegainplot2D->SetTitle("Gain");
clonegainplot2D->SetZTitle("");
clonegainplot2D->enableAxis(QwtPlot::yLeft, false);
clonegainplot2D->enableAxis(QwtPlot::xBottom, false);
// set ticks to just 3
QList<double> majorTicks({0, 1, 2, 3});
QwtScaleDiv div(0, 3, QList<double>(), QList<double>(), majorTicks);
clonegainplot2D->setAxisScaleDiv(QwtPlot::yRight, div);
clonegainplot2D->enableAxis(0, false);
clonegainplot2D->enableAxis(1, false);
clonegainplot2D->enableAxis(2, false);
clonegainplot2D->SetData(nPixelsX, -0.5, nPixelsX - 0.5, nPixelsY,
-0.5, nPixelsY - 0.5, gainData);
connect(cloneplot2D, SIGNAL(PlotZoomedSignal(const QRectF &)),
clonegainplot2D, SLOT(SetZoom(const QRectF &)));
}
}
@ -1046,14 +1104,12 @@ void qDrawPlot::Update2dPlot() {
void qDrawPlot::Update1dXYRange() {
if (!isXYRange[qDefs::XMIN] && !isXYRange[qDefs::XMAX]) {
plot1d->EnableXAutoScaling();
gainplot1d->EnableXAutoScaling();
} else {
double xmin = (isXYRange[qDefs::XMIN] ? xyRange[qDefs::XMIN]
: plot1d->GetXMinimum());
double xmax = (isXYRange[qDefs::XMAX] ? xyRange[qDefs::XMAX]
: plot1d->GetXMaximum());
plot1d->SetXMinMax(xmin, xmax);
gainplot1d->SetXMinMax(xmin, xmax);
}
if (!isXYRange[qDefs::YMIN] && !isXYRange[qDefs::YMAX]) {
@ -1066,35 +1122,29 @@ void qDrawPlot::Update1dXYRange() {
plot1d->SetYMinMax(ymin, ymax);
}
plot1d->Update();
gainplot1d->Update();
}
void qDrawPlot::Update2dXYRange() {
if (!isXYRange[qDefs::XMIN] && !isXYRange[qDefs::XMAX]) {
plot2d->EnableXAutoScaling();
gainplot2d->EnableXAutoScaling();
} else {
double xmin = (isXYRange[qDefs::XMIN] ? xyRange[qDefs::XMIN]
: plot2d->GetXMinimum());
double xmax = (isXYRange[qDefs::XMAX] ? xyRange[qDefs::XMAX]
: plot2d->GetXMaximum());
plot2d->SetXMinMax(xmin, xmax);
gainplot2d->SetXMinMax(xmin, xmax);
}
if (!isXYRange[qDefs::YMIN] && !isXYRange[qDefs::YMAX]) {
plot2d->EnableYAutoScaling();
gainplot2d->EnableYAutoScaling();
} else {
double ymin = (isXYRange[qDefs::YMIN] ? xyRange[qDefs::YMIN]
: plot2d->GetYMinimum());
double ymax = (isXYRange[qDefs::YMAX] ? xyRange[qDefs::YMAX]
: plot2d->GetYMaximum());
plot2d->SetYMinMax(ymin, ymax);
gainplot2d->SetYMinMax(ymin, ymax);
}
plot2d->Update();
gainplot2d->Update();
}
void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,

View File

@ -400,7 +400,7 @@ void qTabAdvanced::GetRxrZMQIP() {
void qTabAdvanced::SetDetector() {
LOG(logDEBUG) << "Set Detector: "
<< comboDetector->currentText().toLatin1().data();
<< comboDetector->currentText().toAscii().data();
GetControlPort();
GetStopPort();
@ -441,7 +441,7 @@ void qTabAdvanced::SetDetectorUDPIP(bool force) {
// return forces modification (inconsistency from command line)
if (dispDetectorUDPIP->isModified() || force) {
dispDetectorUDPIP->setModified(false);
std::string s = dispDetectorUDPIP->text().toLatin1().constData();
std::string s = dispDetectorUDPIP->text().toAscii().constData();
LOG(logINFO) << "Setting Detector UDP IP:" << s;
try {
det->setSourceUDPIP(IpAddr{s}, {comboDetector->currentIndex()});
@ -458,7 +458,7 @@ void qTabAdvanced::SetDetectorUDPMAC(bool force) {
// return forces modification (inconsistency from command line)
if (dispDetectorUDPMAC->isModified() || force) {
dispDetectorUDPMAC->setModified(false);
std::string s = dispDetectorUDPMAC->text().toLatin1().constData();
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
try {
det->setSourceUDPMAC(MacAddr{s}, {comboDetector->currentIndex()});
@ -485,7 +485,7 @@ void qTabAdvanced::SetCltZMQIP(bool force) {
// return forces modification (inconsistency from command line)
if (dispZMQIP->isModified() || force) {
dispZMQIP->setModified(false);
std::string s = dispZMQIP->text().toLatin1().constData();
std::string s = dispZMQIP->text().toAscii().constData();
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
try {
det->setClientZmqIp(IpAddr{s}, {comboDetector->currentIndex()});
@ -502,7 +502,7 @@ void qTabAdvanced::SetRxrHostname(bool force) {
// return forces modification (inconsistency from command line)
if (dispRxrHostname->isModified() || force) {
dispRxrHostname->setModified(false);
std::string s = dispRxrHostname->text().toLatin1().constData();
std::string s = dispRxrHostname->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver Hostname:" << s;
try {
det->setRxHostname(s, {comboDetector->currentIndex()});
@ -542,7 +542,7 @@ void qTabAdvanced::SetRxrUDPIP(bool force) {
// return forces modification (inconsistency from command line)
if (dispRxrUDPIP->isModified() || force) {
dispRxrUDPIP->setModified(false);
std::string s = dispRxrUDPIP->text().toLatin1().constData();
std::string s = dispRxrUDPIP->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
try {
det->setDestinationUDPIP(IpAddr{s},
@ -560,7 +560,7 @@ void qTabAdvanced::SetRxrUDPMAC(bool force) {
// return forces modification (inconsistency from command line)
if (dispRxrUDPMAC->isModified() || force) {
dispRxrUDPMAC->setModified(false);
std::string s = dispRxrUDPMAC->text().toLatin1().constData();
std::string s = dispRxrUDPMAC->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
try {
det->setDestinationUDPMAC(MacAddr{s},
@ -588,7 +588,7 @@ void qTabAdvanced::SetRxrZMQIP(bool force) {
// return forces modification (inconsistency from command line)
if (dispRxrZMQIP->isModified() || force) {
dispRxrZMQIP->setModified(false);
std::string s = dispRxrZMQIP->text().toLatin1().constData();
std::string s = dispRxrZMQIP->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
try {
det->setRxZmqIP(IpAddr{s}, {comboDetector->currentIndex()});

View File

@ -192,7 +192,7 @@ void qTabDataOutput::SetOutputDir(bool force) {
dispOutputDir->setModified(false);
QString path = dispOutputDir->text();
LOG(logDEBUG) << "Setting output directory to "
<< path.toLatin1().constData();
<< path.toAscii().constData();
// empty
if (path.isEmpty()) {
@ -208,7 +208,7 @@ void qTabDataOutput::SetOutputDir(bool force) {
path.chop(1);
}
}
std::string spath = std::string(path.toLatin1().constData());
std::string spath = std::string(path.toAscii().constData());
try {
det->setFilePath(spath, {comboDetector->currentIndex() - 1});
}
@ -245,7 +245,7 @@ void qTabDataOutput::GetFileFormat() {
void qTabDataOutput::SetFileFormat(int format) {
LOG(logINFO) << "Setting File Format to "
<< comboFileFormat->currentText().toLatin1().data();
<< comboFileFormat->currentText().toAscii().data();
try {
det->setFileFormat(static_cast<slsDetectorDefs::fileFormat>(
comboFileFormat->currentIndex()));
@ -388,7 +388,7 @@ void qTabDataOutput::GetSpeed() {
void qTabDataOutput::SetSpeed(int speed) {
LOG(logINFO) << "Setting Readout Speed to "
<< comboClkDivider->currentText().toLatin1().data();
<< comboClkDivider->currentText().toAscii().data();
try {
det->setReadoutSpeed(static_cast<slsDetectorDefs::speedLevel>(speed));
}

View File

@ -3,36 +3,49 @@
#include "qTabDebugging.h"
#include "qDefs.h"
#include "sls/ToString.h"
#include <QDesktopWidget>
#include <QGridLayout>
#include <QTreeWidget>
namespace sls {
qTabDebugging::qTabDebugging(QWidget *parent, Detector *detector)
: QWidget(parent), det(detector) {
: QWidget(parent), det(detector), treeDet(nullptr),
lblDetectorHostname(nullptr), lblDetectorFirmware(nullptr),
lblDetectorSoftware(nullptr) {
setupUi(this);
SetupWidgetWindow();
LOG(logDEBUG) << "Debugging ready";
}
qTabDebugging::~qTabDebugging() {}
qTabDebugging::~qTabDebugging() {
delete treeDet;
delete lblDetectorHostname;
delete lblDetectorFirmware;
delete lblDetectorSoftware;
}
void qTabDebugging::SetupWidgetWindow() {
// enabling according to det type
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
groupTest->setEnabled(false);
} else {
EnableTest();
lblDetector->setText("Half Module:");
chkDetectorFirmware->setEnabled(false);
chkDetectorBus->setEnabled(false);
btnTest->setEnabled(false);
}
PopulateDetectors();
Initialization();
Refresh();
}
void qTabDebugging::Initialization() {
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this,
SLOT(GetInfo()));
connect(chkDetectorFirmware, SIGNAL(toggled(bool)), this,
SLOT(EnableTest()));
connect(chkDetectorBus, SIGNAL(toggled(bool)), this, SLOT(EnableTest()));
if (groupTest->isEnabled()) {
SLOT(GetDetectorStatus()));
connect(btnGetInfo, SIGNAL(clicked()), this, SLOT(GetInfo()));
if (btnTest->isEnabled()) {
connect(btnTest, SIGNAL(clicked()), this, SLOT(TestDetector()));
}
}
@ -40,73 +53,20 @@ void qTabDebugging::Initialization() {
void qTabDebugging::PopulateDetectors() {
LOG(logDEBUG) << "Populating detectors";
try {
comboDetector->clear();
comboDetector->addItem("All");
auto res = det->getHostname();
if (det->size() > 1) {
for (auto &it : res) {
comboDetector->addItem(QString(it.c_str()));
}
}
comboDetector->setCurrentIndex(0);
comboDetector->clear();
auto res = det->getHostname();
for (auto &it : res) {
comboDetector->addItem(QString(it.c_str()));
}
CATCH_DISPLAY("Could not populate readouts for debugging",
"qTabDebugging::PopulateDetectors")
}
void qTabDebugging::GetFirmwareVersion() {
LOG(logDEBUG) << "Firmware Version";
try {
auto retval =
det->getFirmwareVersion({comboDetector->currentIndex() - 1})
.squash(-1);
std::string s = "inconsistent";
if (retval != -1) {
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
s = ToString(retval);
} else {
s = ToStringHex(retval);
}
}
dispFirmwareVersion->setText(s.c_str());
}
CATCH_DISPLAY("Could not get firmware version.",
"qTabDebugging::GetFirmwareVersion")
}
void qTabDebugging::GetServerSoftwareVersion() {
LOG(logDEBUG) << "Server Software Version";
try {
std::string s =
det->getDetectorServerVersion({comboDetector->currentIndex() - 1})
.squash("inconsistent");
dispSoftwareVersion->setText(s.c_str());
}
CATCH_DISPLAY("Could not get on-board software version.",
"qTabDebugging::GetServerSoftwareVersion")
}
void qTabDebugging::GetReceiverVersion() {
LOG(logDEBUG) << "Server Receiver Version";
try {
std::string s =
det->getReceiverVersion({comboDetector->currentIndex() - 1})
.squash("inconsistent");
dispReceiverVersion->setText(s.c_str());
}
CATCH_DISPLAY("Could not receiver version.",
"qTabDebugging::GetReceiverVersion")
}
void qTabDebugging::GetDetectorStatus() {
LOG(logDEBUG) << "Getting Status";
try {
std::string s =
ToString(det->getDetectorStatus({comboDetector->currentIndex() - 1})
.squash(defs::runStatus::ERROR));
lblStatus->setText(QString(s.c_str()).toUpper());
std::string status = ToString(
det->getDetectorStatus({comboDetector->currentIndex()})[0]);
lblStatus->setText(QString(status.c_str()).toUpper());
}
CATCH_DISPLAY("Could not get detector status.",
"qTabDebugging::GetDetectorStatus")
@ -114,53 +74,174 @@ void qTabDebugging::GetDetectorStatus() {
void qTabDebugging::GetInfo() {
LOG(logDEBUG) << "Getting Readout Info";
GetFirmwareVersion();
GetServerSoftwareVersion();
GetReceiverVersion();
GetDetectorStatus();
// open info in a new popup
QFrame *popup1 = new QFrame(this, Qt::Popup | Qt::SubWindow);
QList<QTreeWidgetItem *> items;
QGridLayout *layout = new QGridLayout(popup1);
treeDet = new QTreeWidget(popup1);
layout->addWidget(treeDet, 0, 0);
QFrame *dispFrame = new QFrame(popup1);
QGridLayout *formLayout = new QGridLayout(dispFrame);
lblDetectorHostname = new QLabel("");
lblDetectorFirmware = new QLabel("");
lblDetectorSoftware = new QLabel("");
// to make sure the size is constant
lblDetectorFirmware->setFixedWidth(100);
layout->addWidget(dispFrame, 0, 1);
QString detName =
QString(ToString(det->getDetectorType().squash()).c_str());
switch (det->getDetectorType().squash()) {
case slsDetectorDefs::EIGER:
formLayout->addWidget(new QLabel("Half Module:"), 0, 0);
formLayout->addItem(
new QSpacerItem(15, 20, QSizePolicy::Fixed, QSizePolicy::Fixed), 0,
1);
formLayout->addWidget(lblDetectorHostname, 0, 2);
formLayout->addWidget(new QLabel("Half Module Firmware Version:"), 1,
0);
formLayout->addWidget(lblDetectorFirmware, 1, 2);
formLayout->addWidget(new QLabel("Half Module Software Version:"), 2,
0);
formLayout->addWidget(lblDetectorSoftware, 2, 2);
treeDet->setHeaderLabel("Eiger Detector");
// get num modules
for (int i = 0; i < comboDetector->count() / 2; ++i)
items.append(
new QTreeWidgetItem((QTreeWidget *)nullptr,
QStringList(QString("Module %1").arg(i))));
treeDet->insertTopLevelItems(0, items);
// gets det names
for (int i = 0; i < comboDetector->count(); ++i) {
QList<QTreeWidgetItem *> childItems;
childItems.append(new QTreeWidgetItem(
(QTreeWidget *)nullptr,
QStringList(QString("Half Module (%1)")
.arg(comboDetector->itemText(i)))));
treeDet->topLevelItem(i * 2)->insertChildren(0, childItems);
}
break;
default:
formLayout->addWidget(new QLabel("Module:"), 0, 0);
formLayout->addItem(
new QSpacerItem(15, 20, QSizePolicy::Fixed, QSizePolicy::Fixed), 0,
1);
formLayout->addWidget(lblDetectorHostname, 0, 2);
formLayout->addWidget(new QLabel("Module Firmware Version:"), 1, 0);
formLayout->addWidget(lblDetectorFirmware, 1, 2);
formLayout->addWidget(new QLabel("Module Software Version:"), 2, 0);
formLayout->addWidget(lblDetectorSoftware, 2, 2);
treeDet->setHeaderLabel(QString(detName + " Detector"));
// gets det names
for (int i = 0; i < comboDetector->count(); ++i)
items.append(new QTreeWidgetItem(
(QTreeWidget *)nullptr,
QStringList(
QString("Module (%1)").arg(comboDetector->itemText(i)))));
treeDet->insertTopLevelItems(0, items);
break;
}
// show and center widget
int x = ((parentWidget()->width()) - (popup1->frameGeometry().width())) / 2;
int y =
((parentWidget()->height()) - (popup1->frameGeometry().height())) / 2;
QDesktopWidget *desktop = QApplication::desktop();
int screen = desktop->screenNumber(this);
popup1->setWindowModality(Qt::WindowModal);
popup1->move((desktop->screenGeometry(screen).x()) + x,
(desktop->screenGeometry(screen).y()) + y);
popup1->show();
// put the first parameters
SetParameters(treeDet->topLevelItem(0));
// connect to slots
connect(treeDet, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this,
SLOT(SetParameters(QTreeWidgetItem *)));
}
void qTabDebugging::EnableTest() {
btnTest->setEnabled(chkDetectorFirmware->isChecked() ||
chkDetectorBus->isChecked());
lblBusTestOk->hide();
lblBusTestFail->hide();
lblFwTestOk->hide();
lblFwTestFail->hide();
void qTabDebugging::SetParameters(QTreeWidgetItem *item) {
// eiger: if half module clicked, others: true always
bool ignoreOrHalfModuleClicked = true;
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
if (!(item->text(0).contains("Half Module"))) {
ignoreOrHalfModuleClicked = false;
}
}
if (ignoreOrHalfModuleClicked) {
// find index
for (int i = 0; i < comboDetector->count(); ++i) {
if (item == treeDet->topLevelItem(i))
break;
}
try {
auto retval = std::string("0x") +
std::to_string((unsigned long)det->getFirmwareVersion(
{comboDetector->currentIndex()})[0]);
lblDetectorFirmware->setText(QString(retval.c_str()));
retval =
std::string("0x") +
std::to_string((unsigned long)det->getDetectorServerVersion(
{comboDetector->currentIndex()})[0]);
lblDetectorSoftware->setText(QString(retval.c_str()));
}
CATCH_DISPLAY("Could not get versions.", "qTabDebugging::SetParameters")
}
}
void qTabDebugging::TestDetector() {
LOG(logINFO) << "Testing Readout";
// hide results if clicking button again
EnableTest();
// detector firmware
if (chkDetectorFirmware->isChecked()) {
try {
det->executeFirmwareTest({comboDetector->currentIndex() - 1});
LOG(logINFO) << "Detector Firmware Test: Pass";
lblFwTestOk->show();
} catch (std::exception &e) {
LOG(logWARNING)
<< "Detector Firmware Test: Fail (" << e.what() << ")";
lblFwTestFail->show();
try {
QString moduleName = "Module";
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
moduleName = "Half Module";
}
}
// detector CPU-FPGA bus
if (chkDetectorBus->isChecked()) {
try {
det->executeBusTest({comboDetector->currentIndex() - 1});
LOG(logINFO) << "Detector Bus Test: Pass";
lblBusTestOk->show();
} catch (std::exception &e) {
LOG(logWARNING) << "Detector Bus Test: Fail (" << e.what() << ")";
lblBusTestFail->show();
// construct message
QString message = QString("<nobr>Test Results for %1:</nobr><br><br>")
.arg(comboDetector->currentText());
// detector firmware
if (chkDetectorFirmware->isChecked()) {
try {
det->executeFirmwareTest({comboDetector->currentIndex()});
message.append(QString("<nobr>%1 Firmware: PASS</nobr><br>")
.arg(moduleName));
LOG(logINFO) << "Detector Firmware Test: Pass";
}
CATCH_DISPLAY("Firmware test failed.",
"qTabDebugging::TestDetector")
}
// detector CPU-FPGA bus
if (chkDetectorBus->isChecked()) {
try {
det->executeBusTest({comboDetector->currentIndex()});
message.append(
QString("<nobr>%1 Bus: PASS</nobr><br>").arg(moduleName));
LOG(logINFO) << "Detector Bus Test: Pass";
}
CATCH_DISPLAY("Bus test failed.", "qTabDebugging::TestDetector")
}
// display message
qDefs::Message(qDefs::INFORMATION, message.toAscii().constData(),
"qTabDebugging::TestDetector");
}
CATCH_DISPLAY("Could not execute digital test.",
"qTabDebugging::TestDetector")
}
void qTabDebugging::Refresh() { GetInfo(); }
void qTabDebugging::Refresh() {
LOG(logDEBUG) << "**Updating Debugging Tab";
GetDetectorStatus();
LOG(logDEBUG) << "**Updated Debugging Tab";
}
} // namespace sls

View File

@ -200,9 +200,6 @@ void qTabDeveloper::SetupWidgetWindow() {
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vthreshold: ", getSLSIndex(detType, tempid++)));
adcWidgets.push_back(new qDacWidget(
this, det, false,
"Temperature FPGA: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::GOTTHARD2:
@ -245,9 +242,6 @@ void qTabDeveloper::SetupWidgetWindow() {
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vcom_adc2: ", getSLSIndex(detType, tempid++)));
adcWidgets.push_back(new qDacWidget(
this, det, false,
"Temperature FPGA: ", getSLSIndex(detType, tempid++)));
break;
default:
break;
@ -285,19 +279,15 @@ void qTabDeveloper::Initialization() {
void qTabDeveloper::PopulateDetectors() {
LOG(logDEBUG) << "Populating detectors";
try {
comboDetector->clear();
comboDetector->addItem("All");
auto res = det->getHostname();
if (det->size() > 1) {
for (auto &it : res) {
comboDetector->addItem(QString(it.c_str()));
}
comboDetector->clear();
comboDetector->addItem("All");
auto res = det->getHostname();
if (det->size() > 1) {
for (auto &it : res) {
comboDetector->addItem(QString(it.c_str()));
}
comboDetector->setCurrentIndex(0);
}
CATCH_DISPLAY("Could not populate readouts for dacs/adcs",
"qTabDeveloper::PopulateDetectors")
comboDetector->setCurrentIndex(0);
}
slsDetectorDefs::dacIndex
@ -471,8 +461,6 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
return slsDetectorDefs::VDCSH;
case 16:
return slsDetectorDefs::VTHRESHOLD;
case 17:
return slsDetectorDefs::TEMPERATURE_FPGA;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
@ -509,8 +497,6 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
return slsDetectorDefs::VB_OPA_FD;
case 13:
return slsDetectorDefs::VCOM_ADC2;
case 14:
return slsDetectorDefs::TEMPERATURE_FPGA;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));

View File

@ -20,7 +20,6 @@ qTabMeasurement::qTabMeasurement(QWidget *parent, Detector *detector,
qTabMeasurement::~qTabMeasurement() { delete progressTimer; }
void qTabMeasurement::SetupWidgetWindow() {
setFont(QFont("Carlito", 9, QFont::Normal));
// palette
red = QPalette();
red.setColor(QPalette::Active, QPalette::WindowText, Qt::red);
@ -385,7 +384,7 @@ void qTabMeasurement::GetTimingMode() {
void qTabMeasurement::SetTimingMode(int val) {
LOG(logINFO) << "Setting timing mode:"
<< comboTimingMode->currentText().toLatin1().data();
<< comboTimingMode->currentText().toAscii().data();
try {
det->setTimingMode(static_cast<slsDetectorDefs::timingMode>(val));
EnableWidgetsforTimingMode();
@ -421,7 +420,7 @@ void qTabMeasurement::GetBurstMode() {
void qTabMeasurement::SetBurstMode(int val) {
LOG(logINFO) << "Setting burst mode:"
<< comboBurstMode->currentText().toLatin1().data();
<< comboBurstMode->currentText().toAscii().data();
try {
det->setBurstMode(static_cast<slsDetectorDefs::burstMode>(val));
ShowTriggerDelay();
@ -801,7 +800,7 @@ void qTabMeasurement::SetFileName(bool force) {
if (dispFileName->isModified() || force) {
dispFileName->setModified(false);
std::string val =
std::string(dispFileName->text().toLatin1().constData());
std::string(dispFileName->text().toAscii().constData());
LOG(logINFO) << "Setting File Name Prefix:" << val;
try {
det->setFileNamePrefix(val);
@ -967,7 +966,7 @@ void qTabMeasurement::AcquireFinished() {
void qTabMeasurement::AbortAcquire(QString exmsg) {
LOG(logINFORED) << "Abort Acquire";
qDefs::ExceptionMessage("Acquire unsuccessful.",
exmsg.toLatin1().constData(),
exmsg.toAscii().constData(),
"qDrawPlot::AcquireFinished");
isAcquisitionStopped = true;
AcquireFinished();
@ -979,7 +978,8 @@ void qTabMeasurement::Enable(bool enable) {
// shortcut each time, else it doesnt work a second time
btnStart->setShortcut(QApplication::translate("TabMeasurementObject",
"Shift+Space", nullptr));
"Shift+Space", nullptr,
QApplication::UnicodeUTF8));
}
void qTabMeasurement::Refresh() {

View File

@ -78,9 +78,9 @@ void qTabMessages::ExecuteCommand() {
QString command = param.at(0);
param.removeFirst();
LOG(logINFO) << "Executing Command:[" << command.toLatin1().constData()
LOG(logINFO) << "Executing Command:[" << command.toAscii().constData()
<< "] with Arguments:["
<< param.join(" ").toLatin1().constData() << "]";
<< param.join(" ").toAscii().constData() << "]";
process->setProcessChannelMode(QProcess::MergedChannels);
process->start(command, param);
@ -117,15 +117,15 @@ void qTabMessages::SaveLog() {
outfile.setFileName(fName);
if (outfile.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream out(&outfile);
out << dispLog->toPlainText() << '\n';
out << dispLog->toPlainText() << endl;
std::string mess =
std::string("The Log has been successfully saved to ") +
fName.toLatin1().constData();
fName.toAscii().constData();
qDefs::Message(qDefs::INFORMATION, mess, "TabMessages::SaveLog");
LOG(logINFO) << mess;
} else {
LOG(logWARNING) << "Attempt to save log file failed: "
<< fName.toLatin1().constData();
<< fName.toAscii().constData();
qDefs::Message(qDefs::WARNING, "Attempt to save log file failed.",
"qTabMessages::SaveLog");
}

View File

@ -29,7 +29,6 @@ void qTabPlot::SetupWidgetWindow() {
stackedWidget1D->setCurrentIndex(0);
stackedWidget2D->setCurrentIndex(0);
// Plot Axis
// its not spinboxes to not take value when checkbox checked
dispXMin->setValidator(new QDoubleValidator(dispXMin));
dispYMin->setValidator(new QDoubleValidator(dispYMin));
dispZMin->setValidator(new QDoubleValidator(dispZMin));
@ -74,11 +73,9 @@ void qTabPlot::SetupWidgetWindow() {
Initialization();
Refresh();
// update both zmq high water mark to GUI_ZMQ_RCV_HWM (2)
comboHwm->setCurrentIndex(SND_HWM);
spinHwm->setValue(qDefs::GUI_ZMQ_RCV_HWM);
comboHwm->setCurrentIndex(RX_HWM);
spinHwm->setValue(qDefs::GUI_ZMQ_RCV_HWM);
// set zmq high water mark to GUI_ZMQ_RCV_HWM (2)
spinSndHwm->setValue(qDefs::GUI_ZMQ_RCV_HWM);
spinRcvHwm->setValue(qDefs::GUI_ZMQ_RCV_HWM);
if (chkGapPixels->isEnabled()) {
chkGapPixels->setChecked(true);
@ -88,9 +85,10 @@ void qTabPlot::SetupWidgetWindow() {
void qTabPlot::Initialization() {
// Plotting frequency box
connect(chkNoPlot, SIGNAL(toggled(bool)), this, SLOT(SetPlot()));
connect(comboHwm, SIGNAL(currentIndexChanged(int)), this,
SLOT(SelectHwm(int)));
connect(spinHwm, SIGNAL(valueChanged(int)), this, SLOT(SetHwm(int)));
connect(spinSndHwm, SIGNAL(valueChanged(int)), this,
SLOT(SetStreamingHwm(int)));
connect(spinRcvHwm, SIGNAL(valueChanged(int)), this,
SLOT(SetReceivingHwm(int)));
connect(comboFrequency, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetStreamingFrequency()));
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
@ -198,14 +196,15 @@ void qTabPlot::Initialization() {
void qTabPlot::Select1DPlot(bool enable) {
LOG(logDEBUG) << "Selecting " << (enable ? "1" : "2") << "D Plot";
is1d = enable;
stackedPlotOptions->setCurrentIndex(is1d ? 0 : 1);
chkZAxis->setEnabled(!is1d);
dispZAxis->setEnabled(!is1d);
chkZMin->setEnabled(!is1d);
chkZMax->setEnabled(!is1d);
dispZMin->setEnabled(!is1d);
dispZMax->setEnabled(!is1d);
plot->Select1dPlot(is1d);
box1D->setEnabled(enable);
box2D->setEnabled(!enable);
chkZAxis->setEnabled(!enable);
dispZAxis->setEnabled(!enable);
chkZMin->setEnabled(!enable);
chkZMax->setEnabled(!enable);
dispZMin->setEnabled(!enable);
dispZMax->setEnabled(!enable);
plot->Select1dPlot(enable);
SetTitles();
SetXYRange();
if (!is1d) {
@ -222,12 +221,14 @@ void qTabPlot::SetPlot() {
plotEnable = true;
}
comboFrequency->setEnabled(plotEnable);
comboHwm->setEnabled(plotEnable);
spinHwm->setEnabled(plotEnable);
lblSndHwm->setEnabled(plotEnable);
spinSndHwm->setEnabled(plotEnable);
lblRcvHwm->setEnabled(plotEnable);
spinRcvHwm->setEnabled(plotEnable);
stackedTimeInterval->setEnabled(plotEnable);
stackedPlotOptions->setEnabled(plotEnable);
btnSave->setEnabled(plotEnable);
btnClone->setEnabled(plotEnable);
box1D->setEnabled(plotEnable);
box2D->setEnabled(plotEnable);
boxSave->setEnabled(plotEnable);
boxPlotAxis->setEnabled(plotEnable);
if (plotEnable) {
@ -248,6 +249,8 @@ void qTabPlot::Set1DPlotOptionsRight() {
stackedWidget1D->setCurrentIndex(0);
else
stackedWidget1D->setCurrentIndex(i + 1);
box1D->setTitle(
QString("1D Plot Options %1").arg(stackedWidget1D->currentIndex() + 1));
}
void qTabPlot::Set1DPlotOptionsLeft() {
@ -257,6 +260,8 @@ void qTabPlot::Set1DPlotOptionsLeft() {
stackedWidget1D->setCurrentIndex(stackedWidget1D->count() - 1);
else
stackedWidget1D->setCurrentIndex(i - 1);
box1D->setTitle(
QString("1D Plot Options %1").arg(stackedWidget1D->currentIndex() + 1));
}
void qTabPlot::Set2DPlotOptionsRight() {
@ -266,6 +271,8 @@ void qTabPlot::Set2DPlotOptionsRight() {
stackedWidget2D->setCurrentIndex(0);
else
stackedWidget2D->setCurrentIndex(i + 1);
box2D->setTitle(
QString("2D Plot Options %1").arg(stackedWidget2D->currentIndex() + 1));
}
void qTabPlot::Set2DPlotOptionsLeft() {
@ -275,6 +282,8 @@ void qTabPlot::Set2DPlotOptionsLeft() {
stackedWidget2D->setCurrentIndex(stackedWidget2D->count() - 1);
else
stackedWidget2D->setCurrentIndex(i - 1);
box2D->setTitle(
QString("2D Plot Options %1").arg(stackedWidget2D->currentIndex() + 1));
}
void qTabPlot::EnablePersistency(bool enable) {
@ -702,34 +711,20 @@ void qTabPlot::SetStreamingFrequency() {
&qTabPlot::GetStreamingFrequency)
}
void qTabPlot::SelectHwm(int value) { GetHwm(); }
void qTabPlot::GetHwm() {
if (comboHwm->currentIndex() == SND_HWM)
GetStreamingHwm();
else
GetReceivingHwm();
}
void qTabPlot::SetHwm(int value) {
if (comboHwm->currentIndex() == SND_HWM)
SetStreamingHwm(value);
else
SetReceivingHwm(value);
}
void qTabPlot::GetStreamingHwm() {
LOG(logDEBUG) << "Getting Streaming Hwm for receiver";
disconnect(spinHwm, SIGNAL(valueChanged(int)), this, SLOT(SetHwm(int)));
disconnect(spinSndHwm, SIGNAL(valueChanged(int)), this,
SLOT(SetStreamingHwm(int)));
try {
int value = det->getRxZmqHwm().tsquash(
"Inconsistent streaming hwm for all receivers.");
LOG(logDEBUG) << "Got streaming hwm for receiver " << value;
spinHwm->setValue(value);
spinSndHwm->setValue(value);
}
CATCH_DISPLAY("Could not get streaming hwm for receiver.",
"qTabPlot::GetStreamingHwm")
connect(spinHwm, SIGNAL(valueChanged(int)), this, SLOT(SetHwm(int)));
connect(spinSndHwm, SIGNAL(valueChanged(int)), this,
SLOT(SetStreamingHwm(int)));
}
void qTabPlot::SetStreamingHwm(int value) {
@ -738,20 +733,17 @@ void qTabPlot::SetStreamingHwm(int value) {
det->setRxZmqHwm(value);
}
CATCH_HANDLE("Could not set streaming hwm for receiver.",
"qTabPlot::SetStreamingHwm", this, &qTabPlot::GetHwm)
"qTabPlot::SetStreamingHwm", this, &qTabPlot::GetStreamingHwm)
}
void qTabPlot::GetReceivingHwm() {
LOG(logDEBUG) << "Getting Receiving Hwm for client";
disconnect(spinHwm, SIGNAL(valueChanged(int)), this, SLOT(SetHwm(int)));
try {
int value = det->getClientZmqHwm();
LOG(logDEBUG) << "Got receiving hwm for client " << value;
spinHwm->setValue(value);
}
CATCH_DISPLAY("Could not get receiving hwm for client.",
"qTabPlot::GetReceivingHwm")
connect(spinHwm, SIGNAL(valueChanged(int)), this, SLOT(SetHwm(int)));
}
void qTabPlot::SetReceivingHwm(int value) {
@ -760,7 +752,7 @@ void qTabPlot::SetReceivingHwm(int value) {
det->setClientZmqHwm(value);
}
CATCH_HANDLE("Could not set receiving hwm from client.",
"qTabPlot::SetReceivingHwm", this, &qTabPlot::GetHwm)
"qTabPlot::SetReceivingHwm", this, &qTabPlot::GetReceivingHwm)
}
void qTabPlot::Refresh() {
@ -768,8 +760,19 @@ void qTabPlot::Refresh() {
if (!plot->GetIsRunning()) {
boxFrequency->setEnabled(true);
// streaming frequency
if (!chkNoPlot->isChecked()) {
comboFrequency->setEnabled(true);
stackedTimeInterval->setEnabled(true);
lblSndHwm->setEnabled(true);
spinSndHwm->setEnabled(true);
lblRcvHwm->setEnabled(true);
spinRcvHwm->setEnabled(true);
}
GetStreamingFrequency();
GetHwm();
GetStreamingHwm();
GetReceivingHwm();
// gain plot, gap pixels enable
switch (det->getDetectorType().squash()) {
case slsDetectorDefs::EIGER:

View File

@ -18,6 +18,7 @@ qTabSettings::qTabSettings(QWidget *parent, Detector *detector)
qTabSettings::~qTabSettings() {}
void qTabSettings::SetupWidgetWindow() {
comboHV->hide();
lblComboHV->hide();
lblSpinHV->hide();
@ -401,7 +402,7 @@ void qTabSettings::SetGainMode(int index) {
}
LOG(logINFO) << "Setting Gain Mode to "
<< comboGainMode->currentText().toLatin1().data();
<< comboGainMode->currentText().toAscii().data();
auto val = static_cast<slsDetectorDefs::gainMode>(index);
try {
@ -448,7 +449,7 @@ void qTabSettings::GetDynamicRange() {
void qTabSettings::SetDynamicRange(int index) {
LOG(logINFO) << "Setting dynamic range to "
<< comboDynamicRange->currentText().toLatin1().data();
<< comboDynamicRange->currentText().toAscii().data();
try {
switch (index) {
case DYNAMICRANGE_32:

View File

@ -1,17 +0,0 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include "qVersionResolve.h"
#include <iostream>
namespace sls {
int qResolve_GetQFontWidth(const QFontMetrics fm, const QString &text,
int len) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
return fm.horizontalAdvance(text, len);
#else
return fm.width(text, len);
#endif
};
} // namespace sls

View File

@ -11,9 +11,9 @@ install(TARGETS slsProjectCSettings
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
add_subdirectory(ctbDetectorServer)
add_subdirectory(eigerDetectorServer)
add_subdirectory(gotthardDetectorServer)
add_subdirectory(jungfrauDetectorServer)
add_subdirectory(mythen3DetectorServer)
add_subdirectory(gotthard2DetectorServer)
add_subdirectory(moenchDetectorServer)
#add_subdirectory(eigerDetectorServer)
#add_subdirectory(gotthardDetectorServer)
#add_subdirectory(jungfrauDetectorServer)
#add_subdirectory(mythen3DetectorServer)
#add_subdirectory(gotthard2DetectorServer)
#add_subdirectory(moenchDetectorServer)

View File

@ -1,84 +1,43 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
# empty branch = developer branch in updateAPIVersion.sh
branch=""
det_list=("ctbDetectorServer"
"gotthardDetectorServer"
"gotthard2DetectorServer"
"jungfrauDetectorServer"
"mythen3DetectorServer"
"moenchDetectorServer"
)
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
# arguments
if [ $# -eq 0 ]; then
# no argument, all servers
declare -a det=${det_list[@]}
echo "Compiling all servers"
elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
# 'all' servers
if [[ $1 == "all" ]]; then
declare -a det=${det_list[@]}
echo "Compiling all servers"
else
# only one server
# arg not in list
if [[ $det_list != *$1* ]]; then
echo -e "Invalid argument 1: $1. $usage"
return -1
fi
declare -a det=("${1}")
#echo "Compiling only $1"
fi
# branch
if [ $# -eq 2 ]; then
# arg in list
if [[ $det_list == *$2* ]]; then
echo -e "Invalid argument 2: $2. $usage"
return -1
fi
branch+=$2
#echo "with branch $branch"
fi
declare -a det=("ctbDetectorServer"
"gotthardDetectorServer"
"gotthard2DetectorServer"
"jungfrauDetectorServer"
"mythen3DetectorServer"
"moenchDetectorServer"
)
else
echo -e "Too many arguments.$usage"
return -1
declare -a det=("${1}")
fi
declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")
echo -e "list is ${det[@]}"
# compile each server
idet=0
for i in ${det[@]}
for ((i=0;i<${#det[@]};++i))
do
dir=$i
file="${i}_developer"
dir=${det[i]}
file="${det[i]}_developer"
echo -e "Compiling $dir [$file]"
cd $dir
make clean
if make version API_BRANCH=$branch; then
deterror[$idet]="OK"
if make version; then
deterror[i]="OK"
else
deterror[$idet]="FAIL"
deterror[i]="FAIL"
fi
mv bin/$dir bin/$file
git add -f bin/$file
cp bin/$file /tftpboot/
cd ..
echo -e "\n\n"
((++idet))
done
echo -e "Results:"
idet=0
for i in ${det[@]}
for ((i=0;i<${#det[@]};++i))
do
printf "%s\t\t= %s\n" "$i" "${deterror[$idet]}"
((++idet))
printf "%s\t\t= %s\n" "${det[i]}" "${deterror[i]}"
done

View File

@ -1,86 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
# empty branch = developer branch in updateAPIVersion.sh
branch=""
det_list=("ctbDetectorServer"
"gotthardDetectorServer"
"gotthard2DetectorServer"
"jungfrauDetectorServer"
"mythen3DetectorServer"
"moenchDetectorServer"
)
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
# arguments
if [ $# -eq 0 ]; then
# no argument, all servers
declare -a det=${det_list[@]}
echo "Compiling all servers"
elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
# 'all' servers
if [[ $1 == "all" ]]; then
declare -a det=${det_list[@]}
echo "Compiling all servers"
else
# only one server
# arg not in list
if [[ $det_list != *$1* ]]; then
echo -e "Invalid argument 1: $1. $usage"
return -1
fi
declare -a det=("${1}")
#echo "Compiling only $1"
fi
# branch
if [ $# -eq 2 ]; then
# arg in list
if [[ $det_list == *$2* ]]; then
echo -e "Invalid argument 2: $2. $usage"
return -1
fi
branch+=$2
#echo "with branch $branch"
fi
else
echo -e "Too many arguments.$usage"
return -1
fi
declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")
echo -e "list is ${det[@]}"
# compile each server
idet=0
for i in ${det[@]}
do
dir=$i
file="${i}_developer"
echo -e "Compiling $dir [$file]"
cd $dir
make clean
if make API_BRANCH=$branch; then
deterror[$idet]="OK"
else
deterror[$idet]="FAIL"
fi
mv bin/$dir bin/$file
git add -f bin/$file
cp bin/$file /tftpboot/
cd ..
echo -e "\n\n"
((++idet))
done
echo -e "Results:"
idet=0
for i in ${det[@]}
do
printf "%s\t\t= %s\n" "$i" "${deterror[$idet]}"
((++idet))
done

View File

@ -1,32 +1,32 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
deterror="OK"
dir="eigerDetectorServer"
file="${dir}_developer"
branch=""
declare -a det=("eigerDetectorServer")
# arguments
if [ $# -eq 1 ]; then
branch+=$1
#echo "with branch $branch"
elif [ ! $# -eq 0 ]; then
echo -e "Only one optional argument allowed for branch."
return -1
fi
declare -a deterror=("OK" "OK" "OK" "OK")
echo -e "Compiling $dir [$file]"
cd $dir
make clean
if make version API_BRANCH=$branch; then
deterror="OK"
else
deterror="FAIL"
fi
for ((i=0;i<${#det[@]};++i))
do
dir=${det[i]}
file="${det[i]}_developer"
echo -e "Compiling $dir [$file]"
cd $dir
make clean
if make version; then
deterror[i]="OK"
else
deterror[i]="FAIL"
fi
mv bin/$dir bin/$file
git add -f bin/$file
cp bin/$file /tftpboot/
cd ..
echo -e "\n\n"
printf "Result:\t\t= %s\n" "${deterror}"
mv bin/$dir bin/$file
git add -f bin/$file
cp bin/$file /tftpboot/
cd ..
echo -e "\n\n"
done
echo -e "Results:"
for ((i=0;i<${#det[@]};++i))
do
printf "%s\t\t= %s\n" "${det[i]}" "${deterror[i]}"
done

View File

@ -25,11 +25,10 @@ version: clean versioning $(PROGS)
boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APICTB
version_path=slsDetectorServers/ctbDetectorServer
versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
$(PROGS): $(OBJS)

View File

@ -380,6 +380,22 @@
#define PLL_CNTRL_ADDR_OFST (16)
#define PLL_CNTRL_ADDR_MSK (0x0000003F << PLL_CNTRL_ADDR_OFST)
/* Reconfiguratble PLL Paramater RW register */
#define PLL_A_PARAM_REG (0x93 << MEM_MAP_SHIFT)
/* Reconfiguratble PLL Control RW regiser */
#define PLL_A_CNTRL_REG (0x94 << MEM_MAP_SHIFT)
#define PLL_A_CNTRL_RCNFG_PRMTR_RST_OFST (0)
#define PLL_A_CNTRL_RCNFG_PRMTR_RST_MSK \
(0x00000001 << PLL_A_CNTRL_RCNFG_PRMTR_RST_OFST)
#define PLL_A_CNTRL_WR_PRMTR_OFST (2)
#define PLL_A_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_A_CNTRL_WR_PRMTR_OFST)
#define PLL_A_CNTRL_PLL_RST_OFST (3)
#define PLL_A_CNTRL_PLL_RST_MSK (0x00000001 << PLL_A_CNTRL_PLL_RST_OFST)
#define PLL_A_CNTRL_ADDR_OFST (16)
#define PLL_A_CNTRL_ADDR_MSK (0x0000003F << PLL_A_CNTRL_ADDR_OFST)
/* Pattern Control RW register */
#define PATTERN_CNTRL_REG (0x52 << MEM_MAP_SHIFT)

View File

@ -62,7 +62,7 @@ uint32_t adcEnableMask_1g = BIT32_MSK;
uint8_t adcEnableMask_10g = 0xFF;
int32_t clkPhase[NUM_CLOCKS] = {};
uint32_t clkFrequency[NUM_CLOCKS] = {40, 20, 20, 200};
uint32_t clkFrequency[NUM_CLOCKS] = {40, 20, 20, 200, 400};
int dacValues[NDAC] = {};
// software limit that depends on the current chip on the ctb
int vLimit = 0;
@ -121,10 +121,9 @@ void basictests() {
uint32_t ipadd = getDetectorIP();
uint64_t macadd = getDetectorMAC();
int64_t fwversion = getFirmwareVersion();
char swversion[MAX_STR_LENGTH] = {0};
memset(swversion, 0, MAX_STR_LENGTH);
getServerVersion(swversion);
int64_t swversion = getServerVersion();
int64_t sw_fw_apiversion = 0;
int64_t client_sw_apiversion = getClientServerAPIVersion();
if (fwversion >= MIN_REQRD_VRSN_T_RD_API)
sw_fw_apiversion = getFirmwareAPIVersion();
@ -137,13 +136,15 @@ void basictests() {
"Detector MAC Addr:\t\t 0x%llx\n\n"
"Firmware Version:\t\t 0x%llx\n"
"Software Version:\t\t %s\n"
"Software Version:\t\t 0x%llx\n"
"F/w-S/w API Version:\t\t 0x%llx\n"
"Required Firmware Version:\t 0x%x\n"
"Client-Software API Version:\t 0x%llx\n"
"********************************************************\n",
hversion, hsnumber, ipadd, (long long unsigned int)macadd,
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
REQRD_FRMWR_VRSN));
(long long int)fwversion, (long long int)swversion,
(long long int)sw_fw_apiversion, REQRD_FRMWR_VRSN,
(long long int)client_sw_apiversion));
#ifndef VIRTUAL
// return if flag is not zero, debug mode
@ -324,7 +325,9 @@ int testBus() {
/* Ids */
void getServerVersion(char *version) { strcpy(version, APICTB); }
uint64_t getServerVersion() { return APICTB; }
uint64_t getClientServerAPIVersion() { return APICTB; }
uint64_t getFirmwareVersion() {
#ifdef VIRTUAL
@ -468,6 +471,7 @@ void setupDetector() {
clkFrequency[ADC_CLK] = DEFAULT_ADC_CLK;
clkFrequency[SYNC_CLK] = DEFAULT_SYNC_CLK;
clkFrequency[DBIT_CLK] = DEFAULT_DBIT_CLK;
clkFrequency[GATED_CLK] = DEFAULT_GATED_CLK;
for (int i = 0; i < NDAC; ++i)
dacValues[i] = -1;
}
@ -486,11 +490,13 @@ void setupDetector() {
setupUDPCommParameters();
// altera pll
ALTERA_PLL_SetDefines(PLL_CNTRL_REG, PLL_PARAM_REG,
PLL_CNTRL_RCNFG_PRMTR_RST_MSK, PLL_CNTRL_WR_PRMTR_MSK,
PLL_CNTRL_PLL_RST_MSK, PLL_CNTRL_ADDR_MSK,
PLL_CNTRL_ADDR_OFST);
ALTERA_PLL_ResetPLLAndReconfiguration();
ALTERA_PLL_SetDefines(
PLL_CNTRL_REG, PLL_PARAM_REG, PLL_CNTRL_RCNFG_PRMTR_RST_MSK,
PLL_CNTRL_WR_PRMTR_MSK, PLL_CNTRL_PLL_RST_MSK, PLL_CNTRL_ADDR_MSK,
PLL_CNTRL_ADDR_OFST, PLL_A_CNTRL_REG, PLL_A_PARAM_REG);
// both plls
ALTERA_PLL_ResetPLLAndReconfiguration(0);
ALTERA_PLL_ResetPLLAndReconfiguration(1);
resetCore();
resetPeripheral();
@ -1781,34 +1787,45 @@ int setFrequency(enum CLKINDEX ind, int val) {
return FAIL;
}
int pllIndex = 0;
int vcofreq = PLL_VCO_FREQ_MHZ;
if (ind == GATED_CLK) {
pllIndex = 1;
vcofreq = PLL_A_VCO_FREQ_MHZ;
}
// Remembering adcphase/ dbit phase in degrees
int adcPhase = getPhase(ADC_CLK, 1);
LOG(logDEBUG1, ("\tRemembering ADC phase: %d degrees\n", adcPhase));
int dbitPhase = getPhase(DBIT_CLK, 1);
LOG(logDEBUG1, ("\tRemembering DBIT phase: %d degrees\n", dbitPhase));
int adcPhase = 0, dbitPhase = 0;
if (pllIndex == 0) {
adcPhase = getPhase(ADC_CLK, 1);
LOG(logDEBUG1, ("\tRemembering ADC phase: %d degrees\n", adcPhase));
dbitPhase = getPhase(DBIT_CLK, 1);
LOG(logDEBUG1, ("\tRemembering DBIT phase: %d degrees\n", dbitPhase));
}
// Calculate and set output frequency
clkFrequency[ind] =
ALTERA_PLL_SetOuputFrequency(ind, PLL_VCO_FREQ_MHZ, val);
ALTERA_PLL_SetOuputFrequency(pllIndex, ind, vcofreq, val);
LOG(logINFO, ("\t%s clock (%d) frequency set to %d MHz\n", clock_names[ind],
ind, clkFrequency[ind]));
// phase reset by pll (when setting output frequency)
clkPhase[ADC_CLK] = 0;
clkPhase[DBIT_CLK] = 0;
if (pllIndex == 0) {
clkPhase[ADC_CLK] = 0;
clkPhase[DBIT_CLK] = 0;
// set the phase (reset by pll)
LOG(logINFO, ("\tCorrecting ADC phase to %d degrees\n", adcPhase));
setPhase(ADC_CLK, adcPhase, 1);
LOG(logINFO, ("\tCorrecting DBIT phase to %d degrees\n", dbitPhase));
setPhase(DBIT_CLK, dbitPhase, 1);
// set the phase (reset by pll)
LOG(logINFO, ("\tCorrecting ADC phase to %d degrees\n", adcPhase));
setPhase(ADC_CLK, adcPhase, 1);
LOG(logINFO, ("\tCorrecting DBIT phase to %d degrees\n", dbitPhase));
setPhase(DBIT_CLK, dbitPhase, 1);
// required to reconfigure as adc clock is stopped temporarily when
// resetting pll (in changing output frequency)
AD9257_Configure();
// required to reconfigure as adc clock is stopped temporarily when
// resetting pll (in changing output frequency)
AD9257_Configure();
if (ind != SYNC_CLK) {
configureSyncFrequency(ind);
if (ind != SYNC_CLK) {
configureSyncFrequency(ind);
}
}
return OK;
}

View File

@ -86,8 +86,8 @@ enum DACINDEX {
D_PWR_A,
D_PWR_IO
};
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
#define CLK_NAMES "run", "adc", "sync", "dbit"
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, GATED_CLK, NUM_CLOCKS };
#define CLK_NAMES "run", "adc", "sync", "dbit", "gated"
/* Hardware Definitions */
#define NCHAN (36)
@ -124,6 +124,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
#define DEFAULT_ADC_CLK (40) // 20
#define DEFAULT_SYNC_CLK (40) // 20
#define DEFAULT_DBIT_CLK (200)
#define DEFAULT_GATED_CLK (400)
#define UDP_HEADER_MAX_FRAME_VALUE (0xFFFFFFFFFFFF)
@ -160,5 +161,6 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
#define BIT32_MSK (0xFFFFFFFF)
#define BIT16_MASK (0xFFFF)
#define MAXIMUM_ADC_CLK (65)
#define PLL_VCO_FREQ_MHZ (800)
#define MAXIMUM_ADC_CLK (65)
#define PLL_VCO_FREQ_MHZ (800)
#define PLL_A_VCO_FREQ_MHZ (800)

View File

@ -395,11 +395,35 @@ int Feb_Control_ReceiveHighVoltage(unsigned int *value) {
// normal
if (Feb_Control_normal) {
if (readADCFromFile(NORMAL_HIGHVOLTAGE_INPUTPORT, value) == FAIL) {
LOG(logERROR, ("Could not get high voltage\n"));
// open file
FILE *fd = fopen(NORMAL_HIGHVOLTAGE_INPUTPORT, "r");
if (fd == NULL) {
LOG(logERROR,
("Could not open file for writing to get high voltage\n"));
return 0;
}
// read, assigning line to null and readbytes to 0 then getline
// allocates initial buffer
size_t readbytes = 0;
char *line = NULL;
if (getline(&line, &readbytes, fd) == -1) {
LOG(logERROR, ("could not read file to get high voltage\n"));
return 0;
}
// read again to read the updated value
rewind(fd);
free(line);
readbytes = 0;
readbytes = getline(&line, &readbytes, fd);
if (readbytes == -1) {
LOG(logERROR, ("could not read file to get high voltage\n"));
return 0;
}
// Remove the trailing 0
*value = atoi(line) / 10;
free(line);
fclose(fd);
}
// 9m
@ -690,7 +714,7 @@ int Feb_Control_ProcessingInProgress() {
unsigned int regr = 0, regl = 0;
// deactivated should return end of processing
if (!Feb_Control_activated)
return STATUS_IDLE;
return IDLE;
if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
&regr)) {
@ -704,9 +728,8 @@ int Feb_Control_ProcessingInProgress() {
"processing status\n"));
return STATUS_ERROR;
}
LOG(logDEBUG1, ("regl:0x%x regr:0x%x\n", regl, regr));
// processing done
if (regr & regl & FEB_REG_STATUS_ACQ_DONE_MSK) {
if ((regr | regl) & FEB_REG_STATUS_ACQ_DONE_MSK) {
return STATUS_IDLE;
}
// processing running
@ -1031,7 +1054,6 @@ int Feb_Control_StopAcquisition() {
// wait for feb processing to be done
int is_processing = Feb_Control_ProcessingInProgress();
int check_error = 0;
int check_stuck = 0;
while (is_processing != STATUS_IDLE) {
usleep(500);
is_processing = Feb_Control_ProcessingInProgress();
@ -1043,29 +1065,12 @@ int Feb_Control_StopAcquisition() {
break;
check_error++;
} // reset check_error for next time
else {
else
check_error = 0;
}
// check stuck only 2000 times (1s)
if (is_processing == STATUS_RUNNING) {
if (check_stuck == 2000) {
LOG(logERROR,
("Unable to get feb processing done signal\n"));
// at least it is idle
if (Feb_Control_AcquisitionInProgress() == STATUS_IDLE) {
return 1;
}
LOG(logERROR, ("Unable to get acquisition done signal\n"));
return 0;
}
check_stuck++;
} // reset check_stuck for next time
else {
check_stuck = 0;
}
}
LOG(logINFO, ("Feb: Processing done (to stop acq)\n"));
return 0;
}
return 1;
}
@ -1625,9 +1630,7 @@ int Feb_Control_SetChipSignalsToTrimQuad(int enable) {
LOG(logINFO, ("%s chip signals to trim quad\n",
enable ? "Enabling" : "Disabling"));
unsigned int regval = 0;
// right fpga only
uint32_t righOffset = DAQ_REG_HRDWRE + Feb_Control_rightAddress;
if (!Feb_Control_ReadRegister(righOffset, &regval)) {
if (!Feb_Control_ReadRegister(DAQ_REG_HRDWRE, &regval)) {
LOG(logERROR, ("Could not set chip signals to trim quad\n"));
return 0;
}
@ -1637,7 +1640,7 @@ int Feb_Control_SetChipSignalsToTrimQuad(int enable) {
regval &= ~(DAQ_REG_HRDWRE_PROGRAM_MSK | DAQ_REG_HRDWRE_M8_MSK);
}
if (!Feb_Control_WriteRegister(righOffset, regval)) {
if (!Feb_Control_WriteRegister(DAQ_REG_HRDWRE, regval)) {
LOG(logERROR, ("Could not set chip signals to trim quad\n"));
return 0;
}
@ -1673,19 +1676,19 @@ int Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
int run[2] = {0, 0};
// both registers
if (offset < Feb_Control_leftAddress) {
if (offset < 0x100) {
run[0] = 1;
run[1] = 1;
}
// right registers only
else if (offset >= Feb_Control_rightAddress) {
else if (offset >= 0x200) {
run[0] = 1;
actualOffset = offset - Feb_Control_rightAddress;
actualOffset = offset - 0x200;
}
// left registers only
else {
run[1] = 1;
actualOffset = offset - Feb_Control_leftAddress;
actualOffset = offset - 0x100;
}
for (int iloop = 0; iloop < 2; ++iloop) {
@ -1723,19 +1726,19 @@ int Feb_Control_ReadRegister(uint32_t offset, uint32_t *retval) {
uint32_t value[2] = {0, 0};
int run[2] = {0, 0};
// both registers
if (offset < Feb_Control_leftAddress) {
if (offset < 0x100) {
run[0] = 1;
run[1] = 1;
}
// right registers only
else if (offset >= Feb_Control_rightAddress) {
else if (offset >= 0x200) {
run[0] = 1;
actualOffset = offset - Feb_Control_rightAddress;
actualOffset = offset - 0x200;
}
// left registers only
else {
run[1] = 1;
actualOffset = offset - Feb_Control_leftAddress;
actualOffset = offset - 0x100;
}
for (int iloop = 0; iloop < 2; ++iloop) {
@ -1756,10 +1759,11 @@ int Feb_Control_ReadRegister(uint32_t offset, uint32_t *retval) {
}
}
}
// Inconsistent values when reading both registers
if ((run[0] & run[1]) & (value[0] != value[1])) {
LOG(logERROR, ("Inconsistent values read from %s 0x%x and %s 0x%x\n",
side[0], value[0], side[1], value[1]));
// Inconsistent values
if (value[0] != value[1]) {
LOG(logERROR,
("Inconsistent values read from left 0x%x and right 0x%x\n",
value[0], value[1]));
return 0;
}
return 1;

View File

@ -25,11 +25,10 @@ version: clean versioning $(PROGS) #hv9m_blackfin_server
boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIEIGER
version_path=slsDetectorServers/eigerDetectorServer
versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
$(PROGS): $(OBJS)

View File

@ -117,10 +117,9 @@ void basictests() {
uint32_t ipadd = getDetectorIP();
uint64_t macadd = getDetectorMAC();
int64_t fwversion = getFirmwareVersion();
char swversion[MAX_STR_LENGTH] = {0};
memset(swversion, 0, MAX_STR_LENGTH);
getServerVersion(swversion);
int64_t swversion = getServerVersion();
int64_t sw_fw_apiversion = getFirmwareAPIVersion();
int64_t client_sw_apiversion = getClientServerAPIVersion();
LOG(logINFOBLUE,
("**************************************************\n"
@ -128,13 +127,16 @@ void basictests() {
"Detector MAC Addr:\t\t 0x%llx\n"
"Firmware Version:\t\t %lld\n"
"Software Version:\t\t %s\n"
"Software Version:\t\t 0x%llx\n"
"F/w-S/w API Version:\t\t %lld\n"
"Required Firmware Version:\t %d\n"
"Client-Software API Version:\t 0x%llx\n"
"\n"
"********************************************************\n",
(unsigned int)ipadd, (long long unsigned int)macadd,
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
REQUIRED_FIRMWARE_VERSION));
(long long int)fwversion, (long long int)swversion,
(long long int)sw_fw_apiversion, REQUIRED_FIRMWARE_VERSION,
(long long int)client_sw_apiversion));
// update default udpdstip and udpdstmac (1g is hardware ip and hardware
// mac)
@ -206,7 +208,9 @@ int getTestImageMode() { return eiger_virtual_test_mode; }
/* Ids */
void getServerVersion(char *version) { strcpy(version, APIEIGER); }
uint64_t getServerVersion() { return APIEIGER; }
uint64_t getClientServerAPIVersion() { return APIEIGER; }
u_int64_t getFirmwareVersion() {
#ifdef VIRTUAL
@ -2181,9 +2185,6 @@ int setTrimbits(int *chanregs, char *mess) {
// if quad, set M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(1)) {
sprintf(mess, "Could not set module. Could not enable chip signals to "
"set trimbits\n");
LOG(logERROR, (mess));
sharedMemory_unlockLocalLink();
return FAIL;
}
@ -2197,9 +2198,6 @@ int setTrimbits(int *chanregs, char *mess) {
// if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sprintf(mess, "Could not set module. Could not disable chip "
"signals to set trimbits\n");
LOG(logERROR, (mess));
sharedMemory_unlockLocalLink();
return FAIL;
}
@ -2210,9 +2208,6 @@ int setTrimbits(int *chanregs, char *mess) {
// if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sprintf(mess, "Could not set module. Could not disable chip signals to "
"set trimbits\n");
LOG(logERROR, (mess));
sharedMemory_unlockLocalLink();
return FAIL;
}
@ -2424,43 +2419,42 @@ int setTransmissionDelayRight(int value) {
/* aquisition */
int startStateMachine() {
sharedMemory_lockAcqFlag();
int prepareAcquisition() {
#ifndef VIRTUAL
sharedMemory_lockLocalLink();
LOG(logINFO, ("Going to prepare for acquisition with counter_bit:%d\n",
Feb_Control_Get_Counter_Bit()));
Feb_Control_PrepareForAcquisition();
sharedMemory_unlockLocalLink();
#endif
return OK;
}
int startStateMachine() {
#ifdef VIRTUAL
// create udp socket
if (createUDPSocket(0) != OK) {
sharedMemory_unlockAcqFlag();
return FAIL;
}
if (createUDPSocket(1) != OK) {
sharedMemory_unlockAcqFlag();
return FAIL;
}
LOG(logINFOBLUE, ("Starting State Machine\n"));
if (sharedMemory_getStop() != 0) {
LOG(logERROR, ("Cant start acquisition. "
"Stop server has not updated stop status to 0\n"));
sharedMemory_unlockAcqFlag();
return FAIL;
}
sharedMemory_setStatus(RUNNING);
if (pthread_create(&virtual_tid, NULL, &start_timer, NULL)) {
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
sharedMemory_setStatus(IDLE);
sharedMemory_unlockAcqFlag();
return FAIL;
}
LOG(logINFO, ("Virtual Acquisition started\n"));
sharedMemory_unlockAcqFlag();
return OK;
#else
sharedMemory_lockLocalLink();
LOG(logINFO, ("Going to prepare for acquisition with counter_bit:%d\n",
Feb_Control_Get_Counter_Bit()));
Feb_Control_PrepareForAcquisition();
LOG(logINFO, ("Acquisition started bit toggled\n"));
int ret = OK, prev_flag;
// get the DAQ toggle bit
@ -2478,13 +2472,12 @@ int startStateMachine() {
LOG(logERROR,
("Acquisition did not LOG(logERROR ouble reading register\n"));
sharedMemory_unlockLocalLink();
sharedMemory_unlockAcqFlag();
return FAIL;
}
LOG(logINFOGREEN, ("Acquisition started\n"));
}
sharedMemory_unlockLocalLink();
sharedMemory_unlockAcqFlag();
return ret;
#endif
}
@ -2778,10 +2771,6 @@ void *start_timer(void *arg) {
#endif
int stopStateMachine() {
// acq lock for seamless stop
sharedMemory_lockAcqFlag();
LOG(logINFORED, ("Stopping state machine\n"));
// if scan active, stop scan
if (sharedMemory_getScanStatus() == RUNNING) {
@ -2794,15 +2783,13 @@ int stopStateMachine() {
usleep(500);
sharedMemory_setStop(0);
LOG(logINFO, ("Stopped State Machine\n"));
sharedMemory_unlockAcqFlag();
return OK;
#else
sharedMemory_lockLocalLink();
// sends last frames from fifo and wait for feb processing done
if (!Feb_Control_StopAcquisition()) {
if ((Feb_Control_StopAcquisition() != STATUS_IDLE)) {
LOG(logERROR, ("failed to stop acquisition\n"));
sharedMemory_unlockLocalLink();
sharedMemory_unlockAcqFlag();
return FAIL;
}
sharedMemory_unlockLocalLink();
@ -2813,7 +2800,6 @@ int stopStateMachine() {
// wait for beb to send out all packets
if (Beb_IsTransmitting(&isTransmitting, send_to_ten_gig, 1) == FAIL) {
LOG(logERROR, ("failed to stop beb acquisition\n"));
sharedMemory_unlockAcqFlag();
return FAIL;
}
if (isTransmitting) {
@ -2828,7 +2814,6 @@ int stopStateMachine() {
sharedMemory_unlockLocalLink();
if (!Beb_StopAcquisition()) {
LOG(logERROR, ("failed to stop acquisition\n"));
sharedMemory_unlockAcqFlag();
return FAIL;
}
@ -2838,7 +2823,6 @@ int stopStateMachine() {
Beb_SetNextFrameNumber(retval + 1);
}
LOG(logINFOBLUE, ("Stopping state machine complete\n\n"));
sharedMemory_unlockAcqFlag();
return OK;
#endif
}
@ -2919,8 +2903,7 @@ void waitForAcquisitionEnd(int *ret, char *mess) {
sharedMemory_lockLocalLink();
if (Feb_Control_WaitForFinishedFlag(5000, 1) == STATUS_ERROR) {
sharedMemory_unlockLocalLink();
strcpy(mess, "Could not wait for finished flag\n");
LOG(logERROR, (mess));
LOG(logERROR, ("Waiting for finished flag\n"));
*ret = FAIL;
return;
}
@ -2936,7 +2919,6 @@ void waitForAcquisitionEnd(int *ret, char *mess) {
sharedMemory_unlockLocalLink();
if (i == STATUS_ERROR) {
strcpy(mess, "Could not read feb processing done register\n");
LOG(logERROR, (mess));
*ret = (int)FAIL;
return;
}
@ -2948,7 +2930,6 @@ void waitForAcquisitionEnd(int *ret, char *mess) {
// wait for beb to send out all packets
if (Beb_IsTransmitting(&isTransmitting, send_to_ten_gig, 1) == FAIL) {
strcpy(mess, "Could not read delay counters\n");
LOG(logERROR, (mess));
*ret = (int)FAIL;
return;
}

Some files were not shown because too many files have changed in this diff Show More