Compare commits

..

44 Commits

Author SHA1 Message Date
908afc790d jungfrau: new firmware version 2020-03-06 18:08:08 +01:00
d6e174ea11 jungfrau: adc phase changed again 2020-03-06 17:54:38 +01:00
f255becffe jungfrau: adcphase values nad dbit values done for new boards 2020-03-06 17:49:22 +01:00
0a596c689b sanitizer on, gui:removed qfuture, client: not implemented made specific as to what is not 2020-03-06 15:41:15 +01:00
a2e019ff36 moench: updated adcpipeline from 14 to 15 2020-03-06 10:47:21 +01:00
959d62ed66 moench: default clocks and phase are same as ctb at startup 2020-03-05 18:03:53 +01:00
1d2a46cdbe moench:dsamples=0 at startup 2020-03-05 17:13:58 +01:00
aeb9ddfe62 moench:dbit clock updated to 40 2020-03-05 17:10:37 +01:00
4a802bd2e4 gotthard2: switching between continuous to burst mode (burstperiod got reset: fixed) 2020-03-05 16:35:52 +01:00
c2639854fa ctb gui works with moench detector 2020-03-05 14:53:24 +01:00
dec4d00fbf ctb: gui call back fix 2020-03-05 11:31:36 +01:00
e3f9ef0b25 moench and eiger updated as well 2020-03-05 10:24:59 +01:00
9ca86c2edb ctb, gotthard, gotthard2, jungfrau, mythen updated 2020-03-05 10:21:24 +01:00
c64b09ee79 Jungfraufix (#84)
* jungfrau: added dbitphase, different pll clkindex 0 with different wr bit
2020-03-04 17:06:18 +01:00
4e2f685b76 gotthard2: gain plot fix with clones 2020-03-04 14:39:44 +01:00
6e4a3353a3 moench: removed commented out settings 2020-03-04 13:53:28 +01:00
042e5715e6 conflict fix 2020-03-04 13:51:58 +01:00
e143204ce1 Corrected settings and patter for moench detector 2020-03-04 13:33:42 +01:00
5f3af794ce moench bug fix: power chip enable 2020-03-04 12:34:32 +01:00
e7df925d6b moench sample config file in examples 2020-03-04 11:32:11 +01:00
7859cf78e9 moench: allow power chip 2020-03-04 10:41:10 +01:00
1b996d1703 revised gain plot; updated version api 2020-03-04 10:25:38 +01:00
2fcb41426a Merge pull request #82 from slsdetectorgroup/moenchUpdated
Moench updated
2020-03-04 10:22:09 +01:00
032475fc14 gainplot clone revised 2020-03-04 10:17:51 +01:00
5430288ce8 merge fix 2020-03-03 17:57:55 +01:00
a61c5e0206 Merge pull request #81 from slsdetectorgroup/readme
Updated readme
2020-03-03 17:56:05 +01:00
582a3c6878 Update README.md 2020-03-03 17:55:16 +01:00
134611c638 gotthard2: switching between period and burst period (not delay and burst period), internal frequency depending on timing source (for all except actualtime and measurement time) 2020-03-03 17:49:28 +01:00
06bd6dfd53 Merge branch 'developer' into moenchUpdated 2020-03-03 16:37:31 +01:00
fca7d51cb4 moench: removed hardcoding ny in call back for gui 2020-03-03 16:30:28 +01:00
85aca0ffad moench: insignficant dac naming fix 2020-03-03 16:21:45 +01:00
fac95516cf moench: insignficant naming fix 2020-03-03 16:07:37 +01:00
8abc32e7f1 moench: default pattern file in server, settings, tests 2020-03-03 16:00:01 +01:00
1efacc9475 cleaning up headers 2020-03-03 11:33:28 +01:00
b2d88b441a removed comments 2020-03-03 11:17:26 +01:00
75e083ae46 find tests and commands 2020-03-03 11:04:05 +01:00
9699e064d3 WIP 2020-03-03 10:12:26 +01:00
c6c3a68520 WIP 2020-03-03 10:08:20 +01:00
5e92c5b67e WIP 2020-03-03 09:38:05 +01:00
0947cefe08 WIP 2020-03-03 09:29:25 +01:00
6bbcf6173d moench: first version 2020-03-02 18:34:10 +01:00
ecc3b36204 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-03-02 14:50:48 +01:00
913df8ecae Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2020-02-28 12:26:48 +01:00
c10e04c4eb explicitly setting rx zmq datastream int the ctb Gui 2020-02-28 12:25:48 +01:00
75 changed files with 3568 additions and 2327 deletions

111
README.md
View File

@ -2,90 +2,67 @@
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
### Binaries
Documentation to obtain the binaries via the conda package is available for [lib](https://github.com/slsdetectorgroup/sls_detector_lib) and [gui](https://github.com/slsdetectorgroup/sls_detector_gui)
Binaries for the slsDetectorPackage are available through conda.
```
#Add conda channels
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda install slsdetlib #only shared lib and command line
conda install slsdet #python bindings (includes slsdetlib)
conda install slsdetgui #gui (includes qt4)
#Install specific version
conda install slsdet=2020.03.02.dev0 #developer version from 3 March 2020
```
### Source code
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
One can also obtain the source code from this repository and compile.
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
```
#### Setup dependencies
* Gui Client <br>
Requirements: Qt 4.8 and Qwt 6.0
```
export QTDIR=/usr/local/Trolltech/
export QWTDIR=/usr/local/qwt-6.0.1/
```
If either of them does not exist, the GUI client will not be built.
#### Dependencies
* Lib: c++11 compiler (gcc=>4.8), ZeroMQ 4
* Gui: Qt 4.8 and Qwt 6.0
* Calibration wizards and ctbGUI: ROOT
* Optional: HDF5
* Advanced user Calibration wizards<br>
Requirements: ROOT
```
export ROOTSYS=/usr/local/root-5.34
```
#### Compilation
Compiling can be done in two ways.
Compiling can be done in two ways. Either with the convenience script
cmk.sh or directly with cmake for more control.
**1. Compile using script cmk.sh**<br>
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<br>
Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]<br>
* -[no option]: only make<br>
* -c: Clean<br>
* -b: Builds/Rebuilds CMake files normal mode<br>
* -h: Builds/Rebuilds Cmake files with HDF5 package<br>
* -d: HDF5 Custom Directory<br>
* -t: Build/Rebuilds only text client<br>
* -r: Build/Rebuilds only receiver<br>
* -g: Build/Rebuilds only gui<br>
* -j: Number of threads to compile through<br>
* -e: Debug mode
Basic Option:
./cmk.sh -b
For only make:
./cmk.sh
For make clean;make:
./cmk.sh -c
For using hdf5 without custom dir /blabla:
./cmk.sh -h -d /blabla
For rebuilding cmake without hdf5
./cmk.sh -b
For using multiple cores to compile faster:
./cmk.sh -j9<br>
For rebuilding only certain sections<br>
./cmk.sh -tg #only text client and gui<br>
./cmk.sh -r #only receiver<br>
Usage: [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
-[no option]: only make
-c: Clean
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-d: HDF5 Custom 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
eg. Rebuild when you switch to a new build and compile in parallel:
./cmk.sh -bj5
**2. Compile without script**<br>
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory.
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory. This would create a debug build with address sanitizers.
```
$ cd ..
$ mkdir slsDetectorPackage-build
$ cd slsDetectorPackage-build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
$ make
```
Use the following as an example to compile statically and using specific hdf5 folder
```
$ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
```
After compiling, the libraries and executables will be found at `bin` directory
```
$ ls bin/
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
sls_detector_acquire sls_detector_get slsDetectorGui sls_detector_help sls_detector_put slsReceiver slsMultiReceiver
$ mkdir build
$ cd build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
$ make -j12 #or whatever number of threads wanted
```

4
cmk.sh
View File

@ -187,8 +187,8 @@ fi
#Debug
if [ $DEBUG -eq 1 ]; then
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
echo "Debug Option enabled"
fi

View File

@ -664,7 +664,9 @@ hframe=new TGHorizontalFrame(this, 800,50);
try {
myDet->registerDataCallback(&dataCallback, (void*)this);
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
try {
myDet->setRxZmqDataStream(true);
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
cout <<"Done" << endl;
// mgAdcs=new TMultiGraph();
@ -886,7 +888,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
// cout <<"global plot is " << globalPlot << endl;
// cout << "*******************************************" <<endl;
// cout <<"------Plot: "<< index << " prog:" << data->progressIndex << " npoints:" << data->npoints << " npy: " << data->npy << " " << data->fileName << " bytes: " << data->databytes << " dr:"<< data->dynamicRange << " fi: " << data ->fileIndex << endl;
cout <<"------Plot: "<< index << " prog:" << data->progressIndex << " nx:" << data->nx << " ny: " << data->ny << " " << data->fileName << " bytes: " << data->databytes << " dr:"<< data->dynamicRange << " fi: " << data ->fileIndex << endl;
if (globalPlot || cbGetPedestal->IsOn()) {
//#ifdef TESTADC
// cout <<"------"<< index << " " << ip << " " << data->npoints << endl;
@ -982,7 +984,8 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
for (int y=0; y<ny; y++) {
ped=0;
aval=dataStructure->getValue(data->data,x,y);
// cout << x << " " <<y << " "<< aval << endl;
//aval=dataStructure->getChannel(data->data,x,y);
cout << x << " " <<y << " "<< aval << endl;
if (cbGetPedestal->IsOn()) {
if (photonFinder) {
photonFinder->addToPedestal(aval,x,y);
@ -1154,7 +1157,19 @@ void ctbAcquisition::changePlot(){
if (rbPlotOff->IsOn()) {
adcPlot=0;
dbitPlot=0;
try {
myDet->registerDataCallback(nullptr, this);
} CATCH_DISPLAY ("Could not get unregister call back.", "ctbAcquisition::ctbAcquisition")
try {
myDet->setRxZmqDataStream(false);
} CATCH_DISPLAY ("Could not get unset RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
} else {
try {
myDet->registerDataCallback(&dataCallback, (void*)this);
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
try {
myDet->setRxZmqDataStream(true);
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
adcPlot=0;
dbitPlot=0;
for (int ii=0; ii<NADCS; ii++)

View File

@ -108,15 +108,26 @@ string ctbDac::getLabel() {
}
int ctbDac::getMoenchDacId() {
slsDetectorDefs::dacIndex moenchDacIndices[8] = {slsDetectorDefs::VBP_COLBUF, slsDetectorDefs::VIPRE, slsDetectorDefs::VIN_CM, slsDetectorDefs::VB_SDA, slsDetectorDefs::VCASC_SFP, slsDetectorDefs::VOUT_CM, slsDetectorDefs::VIPRE_CDS, slsDetectorDefs::IBIAS_SFP};
if (id >= 8) {
return id;
}
return static_cast<int>(moenchDacIndices[id]);
}
void ctbDac::setValue(Long_t a) {setValue();}
void ctbDac::setValue() {
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
try {
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(id), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
int sid = id;
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
sid = getMoenchDacId();
}
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
getValue();
@ -128,7 +139,11 @@ void ctbDac::setOn(Bool_t b) {
setValue();
} else {
try {
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(id), -100, false);
int sid = id;
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
sid = getMoenchDacId();
}
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), -100, false);
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
}
getValue();
@ -136,7 +151,11 @@ void ctbDac::setOn(Bool_t b) {
int ctbDac::getValue() {
try {
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(id), dacsUnit->IsOn()).tsquash("Different values");
int sid = id;
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
sid = getMoenchDacId();
}
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsUnit->IsOn()).tsquash("Different values");
cout << "dac " << id << " " << val << endl;
dacsValue->SetText(to_string(val).c_str());
if (val >= 0) {

View File

@ -45,7 +45,7 @@ class ctbDac : public TGHorizontalFrame {
int setLabel(char *tit, int mv);
string getLabel();
int getMoenchDacId();
ClassDef(ctbDac,0)
@ -54,8 +54,6 @@ class ctbDac : public TGHorizontalFrame {
class ctbDacs : public TGGroupFrame {
private:
ctbDac *dacs[NDACS+2];
sls::Detector* myDet;

View File

@ -71,10 +71,10 @@ class ctbDefs {
std::string exceptionMessage,
std::string source) {
// because sls_detector_exceptions cannot be included
if (exceptionMessage.find("hared memory")) {
if (exceptionMessage.find("hared memory") != std::string::npos) {
throw;
}
if (exceptionMessage.find("annot connect")) {
if (exceptionMessage.find("annot connect") != std::string::npos) {
throw;
}
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());

View File

@ -259,8 +259,10 @@ ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
cout << "connect mtab" << endl;
try{
setReadoutMode(pat->getReadoutMode());
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
setADCEnable(adcs->setEnable());
setAnalogSamples(pat->getAnalogSamples());
setDigitalSamples(pat->getDigitalSamples());

View File

@ -1036,32 +1036,41 @@ void ctbPattern::readoutModeChanged(int flags) {
}
int ctbPattern::getReadoutMode() {
try{
auto retval = myDet->getReadoutMode().tsquash("Different values");
switch(retval) {
case slsDetectorDefs::ANALOG_AND_DIGITAL:
cout << "analog and digital" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::DIGITAL_ONLY:
cout << "digital only" << endl;
cbAnalog->SetOn(kFALSE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::ANALOG_ONLY:
cout << "analog only" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
break;
default:
throw("unknown readout flag");
}
int retval=slsDetectorDefs::ANALOG_ONLY;
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
try{
retval = myDet->getReadoutMode().tsquash("Different values");
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
switch(retval) {
case slsDetectorDefs::ANALOG_AND_DIGITAL:
cout << "analog and digital" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::DIGITAL_ONLY:
cout << "digital only" << endl;
cbAnalog->SetOn(kFALSE);
cbDigital->SetOn(kTRUE);
break;
case slsDetectorDefs::ANALOG_ONLY:
cout << "analog only" << endl;
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
break;
default:
throw("unknown readout flag");
}
} else {
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
}
Emit("readoutModeChanged(int)",static_cast<int>(retval));
return retval;
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
return -1;
}
int ctbPattern::getAnalogSamples() {
@ -1076,12 +1085,16 @@ int ctbPattern::getAnalogSamples() {
}
int ctbPattern::getDigitalSamples() {
try{
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
eDigitalSamples->SetNumber((Double_t)retval);
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
return eDigitalSamples->GetNumber();
} CATCH_DISPLAY ("Could not get number of triggers.", "ctbPattern::update")
int retval=0;
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
try{
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
} CATCH_DISPLAY ("Could not get number of digital samples.", "ctbPattern::getDigitalSamples")
}
eDigitalSamples->SetNumber((Double_t)retval);
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
return eDigitalSamples->GetNumber();
return -1;
}

View File

@ -0,0 +1,501 @@
initialchecks 0
#############################################
### edit with hostname or IP address of your detector
############################################
hostname bchip181+
runclk 40
adcclk 20
dbitclk 40
patword 0000 0000000000000000
patword 0001 0000000000000000
patword 0002 0008000900080000
patword 0003 0008000900080000
patword 0004 0008000900080000
patword 0005 0008000900080000
patword 0006 0008000900080000
patword 0007 0008000900080000
patword 0008 0008000900080000
patword 0009 0008000900080000
patword 000a 0008000900080000
patword 000b 0008000900080000
patword 000c 0008000900080000
patword 000d 0008000900080000
patword 000e 0008000900080000
patword 000f 0008000900080000
patword 0010 0008000900080000
patword 0011 0008000900080000
patword 0012 0008000900080000
patword 0013 0008000900080000
patword 0014 0008000900080000
patword 0015 0008000900080000
patword 0016 0008400900080020
patword 0017 0008400900080020
patword 0018 0008599f0418503a
patword 0019 0008599f0418503a
patword 001a 0108599f0418503a
patword 001b 0108599f0418503a
patword 001c 0108599f0418503a
patword 001d 0108599f0418503a
patword 001e 0108599f0418503a
patword 001f 0108599f0418503a
patword 0020 0108599f0418503a
patword 0021 0108599f0418503a
patword 0022 0108599f0418503a
patword 0023 0108599f0418503a
patword 0024 0108599f0418503a
patword 0025 0108599f0418503a
patword 0026 0108599f0418503a
patword 0027 0108599f0418503a
patword 0028 0108599f0418503a
patword 0029 0108599f0418503a
patword 002a 0108599f0418503a
patword 002b 0108599f0418503a
patword 002c 0108599f0418503a
patword 002d 0108599f0418503a
patword 002e 0108599f0418503a
patword 002f 0108599f0418503a
patword 0030 0108599f0418503a
patword 0031 0108599f0418503a
patword 0032 0108599f0418503a
patword 0033 0108599f0418503a
patword 0034 0108599f0418503a
patword 0035 0108599f0418503a
patword 0036 0108599f0418503a
patword 0037 0108599f0418503a
patword 0038 0108599f0418503a
patword 0039 0108599f0418503a
patword 003a 0108599f0418503a
patword 003b 0108599f0418503a
patword 003c 0108599f0418503a
patword 003d 0108599f0418503a
patword 003e 0108599f0418503a
patword 003f 0108599f0418503a
patword 0040 0108599f0418503a
patword 0041 0108599f0418503a
patword 0042 0108599f0418503a
patword 0043 0108599f0418503a
patword 0044 0108599f0418503a
patword 0045 0108599f0418503a
patword 0046 0108599f0418503a
patword 0047 0108599f0418503a
patword 0048 0108599f0418503a
patword 0049 0108599f0418503a
patword 004a 0108599f0418503a
patword 004b 0108599f0418503a
patword 004c 0108599f0418503a
patword 004d 0108599f0418503a
patword 004e 0108599f0418503a
patword 004f 0108599f0418503a
patword 0050 0108599f0418503a
patword 0051 0108599f0418503a
patword 0052 0108599f0418503a
patword 0053 0108599f0418503a
patword 0054 0108599f0418503a
patword 0055 0108599f0418503a
patword 0056 0108599f0418503a
patword 0057 0108599f0418503a
patword 0058 0108599f0418503a
patword 0059 0108599f0418503a
patword 005a 0108599f0418503a
patword 005b 0108599f0418503a
patword 005c 0108599f0418503a
patword 005d 0108599f0418503a
patword 005e 0108599f0418503a
patword 005f 0108599f0418503a
patword 0060 0108599f0418503a
patword 0061 0108599f0418503a
patword 0062 0108599f0418503a
patword 0063 0108599f0418503a
patword 0064 0108599f0418503a
patword 0065 0108599f0418503a
patword 0066 0108599f0418503a
patword 0067 0108599f0418503a
patword 0068 0108599f0418503a
patword 0069 0108599f0418503a
patword 006a 0108599f0418503a
patword 006b 0108599f0418503a
patword 006c 0108599f0418503a
patword 006d 0108599f0418503a
patword 006e 0108599f0418503a
patword 006f 0108599f0418503a
patword 0070 0108599f0418503a
patword 0071 0108599f0418503a
patword 0072 0108599f0418503a
patword 0073 0108599f0418503a
patword 0074 0108599f0418503a
patword 0075 0108599f0418503a
patword 0076 0108599f0418503a
patword 0077 0108599f0418503a
patword 0078 0108599f0418503a
patword 0079 0108599f0418503a
patword 007a 0108599f0418503a
patword 007b 0108599f0418503a
patword 007c 0108599f0418503a
patword 007d 0108599f0418503a
patword 007e 010859960418503a
patword 007f 010859960418503a
patword 0080 010859960418503a
patword 0081 010859960418503a
patword 0082 010859960418503a
patword 0083 010859960418503a
patword 0084 010859960418503a
patword 0085 010859960418503a
patword 0086 010859960418503a
patword 0087 010859960418503a
patword 0088 010859960418503a
patword 0089 010859960418503a
patword 008a 010859960418503a
patword 008b 010859960418503a
patword 008c 010859960418503a
patword 008d 010859960418503a
patword 008e 010859960418503a
patword 008f 010859960418503a
patword 0090 010859960418503a
patword 0091 010859960418503a
patword 0092 010819960418501a
patword 0093 010819960418501a
patword 0094 010819960418501a
patword 0095 010819960418501a
patword 0096 030819960418501a
patword 0097 030819960418501a
patword 0098 030819960418501a
patword 0099 030819960418501a
patword 009a 030819960418501a
patword 009b 030819960418501a
patword 009c 030819960418501a
patword 009d 030819960418501a
patword 009e 030819960418501a
patword 009f 030819960418501a
patword 00a0 030819960418501a
patword 00a1 030819960418501a
patword 00a2 030819960418501a
patword 00a3 030819960418501a
patword 00a4 030819960418501a
patword 00a5 030819960418501a
patword 00a6 030819960418501a
patword 00a7 030819960418501a
patword 00a8 030819960418501a
patword 00a9 030819960418501a
patword 00aa 030819960418501a
patword 00ab 030819960418501a
patword 00ac 030819960008501a
patword 00ad 030819960008501a
patword 00ae 030819960008501a
patword 00af 030819960008501a
patword 00b0 030819960008501a
patword 00b1 030819960008501a
patword 00b2 030819960008501a
patword 00b3 030819960008501a
patword 00b4 030819960008501a
patword 00b5 030819960008501a
patword 00b6 030819960008501a
patword 00b7 030819960008501a
patword 00b8 030819960008501a
patword 00b9 030819960008501a
patword 00ba 030819960008501a
patword 00bb 030819960008501a
patword 00bc 030819960008501a
patword 00bd 030819960008501a
patword 00be 030819960008501a
patword 00bf 030819960008501a
patword 00c0 0308199f0008501a
patword 00c1 0308199f0008501a
patword 00c2 0308199f0008501a
patword 00c3 0308199f0008501a
patword 00c4 0308199f0008501a
patword 00c5 0308199f0008501a
patword 00c6 0308199f0008501a
patword 00c7 0308199f0008501a
patword 00c8 0308199f0008501a
patword 00c9 0308199f0008501a
patword 00ca 0308199f0008501a
patword 00cb 0308199f0008501a
patword 00cc 0308199f0008501a
patword 00cd 0308199f0008501a
patword 00ce 0308199f0008501a
patword 00cf 0308199f0008501a
patword 00d0 0308199f0008501a
patword 00d1 0308199f0008501a
patword 00d2 0308199f0008501a
patword 00d3 0308199f0008501a
patword 00d4 0308599f0008503a
patword 00d5 0308599f0008503a
patword 00d6 030c599f000850ba
patword 00d7 030c599f000850ba
patword 00d8 030c599f000850ba
patword 00d9 030c599f000850ba
patword 00da 030c599f000850ba
patword 00db 030c599f000850ba
patword 00dc 030c599f000850ba
patword 00dd 030c599f000850ba
patword 00de 030c599f000850ba
patword 00df 030c599f000850ba
patword 00e0 030c599f000850ba
patword 00e1 030c599f000850ba
patword 00e2 030c599f000850ba
patword 00e3 030c599f000850ba
patword 00e4 030c599f000850ba
patword 00e5 030c599f000850ba
patword 00e6 030c599f000850ba
patword 00e7 030c599f000850ba
patword 00e8 030c599f000850ba
patword 00e9 030c599f000850ba
patword 00ea 030c799f010858ba
patword 00eb 030c799f010858ba
patword 00ec 030c599f000850ba
patword 00ed 030c599f000850ba
patword 00ee 030c599f000850ba
patword 00ef 030c599f000850ba
patword 00f0 030c599f000850ba
patword 00f1 030c599f000850ba
patword 00f2 030c599f000850ba
patword 00f3 030c599f000850ba
patword 00f4 030c599f000850ba
patword 00f5 030c599f000850ba
patword 00f6 030c599f000850ba
patword 00f7 030c599f000850ba
patword 00f8 030c599f000850ba
patword 00f9 030c599f000850ba
patword 00fa 030c599f000850ba
patword 00fb 030c599f000850ba
patword 00fc 030c599f000850ba
patword 00fd 030c599f000850ba
patword 00fe 030c599f000850ba
patword 00ff 030c599f000850ba
patword 0100 030c599f000850ba
patword 0101 030c599f000850ba
patword 0102 030c599f400850ba
patword 0103 030c599f400850ba
patword 0104 030c599f600850ba
patword 0105 030c599f400850ba
patword 0106 030c599f400850ba
patword 0107 030c599f400850ba
patword 0108 870c599f682e50ba
patword 0109 870c599f482850ba
patword 010a 870c599f000e50ba
patword 010b 870c599f000850ba
patword 010c 870c599f000e50ba
patword 010d 870c599f000850ba
patword 010e 870c599f000e50ba
patword 010f 870c599f000850ba
patword 0110 870c599f000e50ba
patword 0111 870c599f000850ba
patword 0112 870c599f000e50ba
patword 0113 870c599f000850ba
patword 0114 870c599f000e50ba
patword 0115 870c599f000850ba
patword 0116 870c599f000e50ba
patword 0117 870c599f000850ba
patword 0118 870c599f000e50ba
patword 0119 870c599f000850ba
patword 011a 870c599f000e50ba
patword 011b 870c599f000850ba
patword 011c 870c599f000e50ba
patword 011d 870c599f000850ba
patword 011e 870c599f000e50ba
patword 011f 870c599f000850ba
patword 0120 870c599f000e50ba
patword 0121 870c599f000850ba
patword 0122 870c599f200e50ba
patword 0123 870c599f000850ba
patword 0124 870c599f000e50ba
patword 0125 870c599f000850ba
patword 0126 870c599f000e50ba
patword 0127 870c599f000850ba
patword 0128 870c599f000e50ba
patword 0129 870c599f000850ba
patword 012a 870c599f000e50ba
patword 012b 870c599f000850ba
patword 012c 870c599f000e50ba
patword 012d 870c599f000850ba
patword 012e 870c599f000e50ba
patword 012f 870c599f000850ba
patword 0130 870c599f000e50ba
patword 0131 870c599f000850ba
patword 0132 870c599f000e50ba
patword 0133 870c599f000850ba
patword 0134 870c599f000e50ba
patword 0135 870c599f000850ba
patword 0136 870c599f000e50ba
patword 0137 870c599f000850ba
patword 0138 870c599f000e50ba
patword 0139 870c599f000850ba
patword 013a 870c599f282e50ba
patword 013b 870c599f082850ba
patword 013c 870c599f000e50ba
patword 013d 870c599f000850ba
patword 013e 870c599f000e50ba
patword 013f 870c599f000850ba
patword 0140 870c599f000e50ba
patword 0141 870c599f000850ba
patword 0142 870c599f000e50ba
patword 0143 870c599f000850ba
patword 0144 870c599f000e50ba
patword 0145 870c599f000850ba
patword 0146 870c599f000e50ba
patword 0147 870c599f000850ba
patword 0148 870c599f000e50ba
patword 0149 870c599f000850ba
patword 014a 870c599f000e50ba
patword 014b 870c599f000850ba
patword 014c 870c599f000e50ba
patword 014d 870c599f000850ba
patword 014e 870c599f000e50ba
patword 014f 870c599f000850ba
patword 0150 870c599f000e50ba
patword 0151 870c599f000850ba
patword 0152 870c599f000e50ba
patword 0153 870c599f000850ba
patword 0154 870c599f200e50ba
patword 0155 870c599f000850ba
patword 0156 870c599f000e50ba
patword 0157 870c599f000850ba
patword 0158 870c599f000e50ba
patword 0159 870c599f000850ba
patword 015a 870c599f000e50ba
patword 015b 870c599f000850ba
patword 015c 870c599f000e50ba
patword 015d 870c599f000850ba
patword 015e 870c599f000e50ba
patword 015f 870c599f000850ba
patword 0160 870c599f000e50ba
patword 0161 870c599f000850ba
patword 0162 870c599f000e50ba
patword 0163 870c599f000850ba
patword 0164 870c599f000e50ba
patword 0165 870c599f000850ba
patword 0166 870c599f000e50ba
patword 0167 870c599f000850ba
patword 0168 870c599f000e50ba
patword 0169 870c599f000850ba
patword 016a 870c599f000e50ba
patword 016b 870c599f000850ba
patword 016c 070c599f000850ba
patword 016d 070c599f000850ba
patword 016e 000c599f000850ba
patword 016f 000c599f000850ba
patword 0170 0008599f200e503a
patword 0171 0008599f0008503a
patword 0172 0008599f200e503a
patword 0173 0008599f0008503a
patword 0174 0008599f0008503a
patword 0175 0008599f0008503a
patword 0176 0008599f0008503a
patword 0177 0008599f0008503a
patword 0178 0008599f0008503a
patword 0179 0008599f0008503a
patword 017a 0008599f0008503a
patword 017b 0008599f0008503a
patword 017c 0008599f0008503a
patword 017d 0008599f0008503a
patword 017e 0008599f0008503a
patword 017f 0008599f0008503a
patword 0180 0008599f0008503a
patword 0181 0008599f0008503a
patword 0182 0008599f0008503a
patword 0183 0008599f0008503a
patword 0184 0008599f0008503a
patword 0185 0008599f0008503a
patword 0186 0008599f0008503a
patword 0187 0008599f0008503a
patword 0188 0008599f0008503a
patword 0189 0008599f0008503a
patword 018a 0008599f0008503a
patword 018b 0008599f0008503a
patword 018c 0008599f0008503a
patword 018d 0008599f0008503a
patioctrl 8f0effff6dbffdbf
patclkctrl 0000000000000000
patlimits 0000 018c
patloop0 013a 016b
patnloop0 199
patloop1 0400 0400
patnloop1 0
patloop2 0400 0400
patnloop2 0
patwait0 00aa
patwaittime0 10000
patwait1 0400
patwaittime1 0
patwait2 0400
patwaittime2 0
#0:rx_tcpport 1977
#############################################
### edit with 10 Gbs IP of your server
############################################
#0:udp_dstip 10.1.1.102
0:udp_dstip 129.129.202.136
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
#0:udp_srcip 10.1.1.19
0:udp_srcip 129.129.202.13
0:udp_dstport 33410
#############################################
### edit with 10 Gbs IP of your server
############################################
#zmqip 129.129.202.110
#rx_zmqip 10.1.1.102
#rx_zmqport 30001
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
#zmqip 129.129.202.110
#zmqport 50001
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011
tengiga 0
rx_datastream 1
rx_readfreq 1
dac 6 800
dac 0 1300
dac 4 1428
dac 1 1000
dac 7 900
dac 3 680
dac 2 1400
dac 5 1200
adcinvert 4a342593
#0xb5cbda6c
asamples 5000
dsamples 0
adcphase 30 deg
adcpipeline 14
adcreg 14 40
frames 1000
period 0.001
#############################################
### edit with directory you want to write to
############################################
fpath /tmp/
fwrite 0
romode analog
#rx_jsonaddheader frameMode
rx_jsonpara frameMode newpedestal
#rx_jsonaddheader detectorMode
rx_jsonpara detectorMode analog
#flags newpedestal
#flags analog
reg 0x5e 0x00010000
#powerchip 1
vhighvoltage 90

View File

@ -1,496 +1,61 @@
#initialchecks 0
#############################################
### edit with hostname or IP address of your detector
############################################
hostname bchip181+
runclk 40
adcclk 20
dbitclk 40
patword 0000 0000000000000000
patword 0001 0000000000000000
patword 0002 0008000900080000
patword 0003 0008000900080000
patword 0004 0008000900080000
patword 0005 0008000900080000
patword 0006 0008000900080000
patword 0007 0008000900080000
patword 0008 0008000900080000
patword 0009 0008000900080000
patword 000a 0008000900080000
patword 000b 0008000900080000
patword 000c 0008000900080000
patword 000d 0008000900080000
patword 000e 0008000900080000
patword 000f 0008000900080000
patword 0010 0008000900080000
patword 0011 0008000900080000
patword 0012 0008000900080000
patword 0013 0008000900080000
patword 0014 0008000900080000
patword 0015 0008000900080000
patword 0016 0008400900080020
patword 0017 0008400900080020
patword 0018 0008599f0418503a
patword 0019 0008599f0418503a
patword 001a 0108599f0418503a
patword 001b 0108599f0418503a
patword 001c 0108599f0418503a
patword 001d 0108599f0418503a
patword 001e 0108599f0418503a
patword 001f 0108599f0418503a
patword 0020 0108599f0418503a
patword 0021 0108599f0418503a
patword 0022 0108599f0418503a
patword 0023 0108599f0418503a
patword 0024 0108599f0418503a
patword 0025 0108599f0418503a
patword 0026 0108599f0418503a
patword 0027 0108599f0418503a
patword 0028 0108599f0418503a
patword 0029 0108599f0418503a
patword 002a 0108599f0418503a
patword 002b 0108599f0418503a
patword 002c 0108599f0418503a
patword 002d 0108599f0418503a
patword 002e 0108599f0418503a
patword 002f 0108599f0418503a
patword 0030 0108599f0418503a
patword 0031 0108599f0418503a
patword 0032 0108599f0418503a
patword 0033 0108599f0418503a
patword 0034 0108599f0418503a
patword 0035 0108599f0418503a
patword 0036 0108599f0418503a
patword 0037 0108599f0418503a
patword 0038 0108599f0418503a
patword 0039 0108599f0418503a
patword 003a 0108599f0418503a
patword 003b 0108599f0418503a
patword 003c 0108599f0418503a
patword 003d 0108599f0418503a
patword 003e 0108599f0418503a
patword 003f 0108599f0418503a
patword 0040 0108599f0418503a
patword 0041 0108599f0418503a
patword 0042 0108599f0418503a
patword 0043 0108599f0418503a
patword 0044 0108599f0418503a
patword 0045 0108599f0418503a
patword 0046 0108599f0418503a
patword 0047 0108599f0418503a
patword 0048 0108599f0418503a
patword 0049 0108599f0418503a
patword 004a 0108599f0418503a
patword 004b 0108599f0418503a
patword 004c 0108599f0418503a
patword 004d 0108599f0418503a
patword 004e 0108599f0418503a
patword 004f 0108599f0418503a
patword 0050 0108599f0418503a
patword 0051 0108599f0418503a
patword 0052 0108599f0418503a
patword 0053 0108599f0418503a
patword 0054 0108599f0418503a
patword 0055 0108599f0418503a
patword 0056 0108599f0418503a
patword 0057 0108599f0418503a
patword 0058 0108599f0418503a
patword 0059 0108599f0418503a
patword 005a 0108599f0418503a
patword 005b 0108599f0418503a
patword 005c 0108599f0418503a
patword 005d 0108599f0418503a
patword 005e 0108599f0418503a
patword 005f 0108599f0418503a
patword 0060 0108599f0418503a
patword 0061 0108599f0418503a
patword 0062 0108599f0418503a
patword 0063 0108599f0418503a
patword 0064 0108599f0418503a
patword 0065 0108599f0418503a
patword 0066 0108599f0418503a
patword 0067 0108599f0418503a
patword 0068 0108599f0418503a
patword 0069 0108599f0418503a
patword 006a 0108599f0418503a
patword 006b 0108599f0418503a
patword 006c 0108599f0418503a
patword 006d 0108599f0418503a
patword 006e 0108599f0418503a
patword 006f 0108599f0418503a
patword 0070 0108599f0418503a
patword 0071 0108599f0418503a
patword 0072 0108599f0418503a
patword 0073 0108599f0418503a
patword 0074 0108599f0418503a
patword 0075 0108599f0418503a
patword 0076 0108599f0418503a
patword 0077 0108599f0418503a
patword 0078 0108599f0418503a
patword 0079 0108599f0418503a
patword 007a 0108599f0418503a
patword 007b 0108599f0418503a
patword 007c 0108599f0418503a
patword 007d 0108599f0418503a
patword 007e 010859960418503a
patword 007f 010859960418503a
patword 0080 010859960418503a
patword 0081 010859960418503a
patword 0082 010859960418503a
patword 0083 010859960418503a
patword 0084 010859960418503a
patword 0085 010859960418503a
patword 0086 010859960418503a
patword 0087 010859960418503a
patword 0088 010859960418503a
patword 0089 010859960418503a
patword 008a 010859960418503a
patword 008b 010859960418503a
patword 008c 010859960418503a
patword 008d 010859960418503a
patword 008e 010859960418503a
patword 008f 010859960418503a
patword 0090 010859960418503a
patword 0091 010859960418503a
patword 0092 010819960418501a
patword 0093 010819960418501a
patword 0094 010819960418501a
patword 0095 010819960418501a
patword 0096 030819960418501a
patword 0097 030819960418501a
patword 0098 030819960418501a
patword 0099 030819960418501a
patword 009a 030819960418501a
patword 009b 030819960418501a
patword 009c 030819960418501a
patword 009d 030819960418501a
patword 009e 030819960418501a
patword 009f 030819960418501a
patword 00a0 030819960418501a
patword 00a1 030819960418501a
patword 00a2 030819960418501a
patword 00a3 030819960418501a
patword 00a4 030819960418501a
patword 00a5 030819960418501a
patword 00a6 030819960418501a
patword 00a7 030819960418501a
patword 00a8 030819960418501a
patword 00a9 030819960418501a
patword 00aa 030819960418501a
patword 00ab 030819960418501a
patword 00ac 030819960008501a
patword 00ad 030819960008501a
patword 00ae 030819960008501a
patword 00af 030819960008501a
patword 00b0 030819960008501a
patword 00b1 030819960008501a
patword 00b2 030819960008501a
patword 00b3 030819960008501a
patword 00b4 030819960008501a
patword 00b5 030819960008501a
patword 00b6 030819960008501a
patword 00b7 030819960008501a
patword 00b8 030819960008501a
patword 00b9 030819960008501a
patword 00ba 030819960008501a
patword 00bb 030819960008501a
patword 00bc 030819960008501a
patword 00bd 030819960008501a
patword 00be 030819960008501a
patword 00bf 030819960008501a
patword 00c0 0308199f0008501a
patword 00c1 0308199f0008501a
patword 00c2 0308199f0008501a
patword 00c3 0308199f0008501a
patword 00c4 0308199f0008501a
patword 00c5 0308199f0008501a
patword 00c6 0308199f0008501a
patword 00c7 0308199f0008501a
patword 00c8 0308199f0008501a
patword 00c9 0308199f0008501a
patword 00ca 0308199f0008501a
patword 00cb 0308199f0008501a
patword 00cc 0308199f0008501a
patword 00cd 0308199f0008501a
patword 00ce 0308199f0008501a
patword 00cf 0308199f0008501a
patword 00d0 0308199f0008501a
patword 00d1 0308199f0008501a
patword 00d2 0308199f0008501a
patword 00d3 0308199f0008501a
patword 00d4 0308599f0008503a
patword 00d5 0308599f0008503a
patword 00d6 030c599f000850ba
patword 00d7 030c599f000850ba
patword 00d8 030c599f000850ba
patword 00d9 030c599f000850ba
patword 00da 030c599f000850ba
patword 00db 030c599f000850ba
patword 00dc 030c599f000850ba
patword 00dd 030c599f000850ba
patword 00de 030c599f000850ba
patword 00df 030c599f000850ba
patword 00e0 030c599f000850ba
patword 00e1 030c599f000850ba
patword 00e2 030c599f000850ba
patword 00e3 030c599f000850ba
patword 00e4 030c599f000850ba
patword 00e5 030c599f000850ba
patword 00e6 030c599f000850ba
patword 00e7 030c599f000850ba
patword 00e8 030c599f000850ba
patword 00e9 030c599f000850ba
patword 00ea 030c799f010858ba
patword 00eb 030c799f010858ba
patword 00ec 030c599f000850ba
patword 00ed 030c599f000850ba
patword 00ee 030c599f000850ba
patword 00ef 030c599f000850ba
patword 00f0 030c599f000850ba
patword 00f1 030c599f000850ba
patword 00f2 030c599f000850ba
patword 00f3 030c599f000850ba
patword 00f4 030c599f000850ba
patword 00f5 030c599f000850ba
patword 00f6 030c599f000850ba
patword 00f7 030c599f000850ba
patword 00f8 030c599f000850ba
patword 00f9 030c599f000850ba
patword 00fa 030c599f000850ba
patword 00fb 030c599f000850ba
patword 00fc 030c599f000850ba
patword 00fd 030c599f000850ba
patword 00fe 030c599f000850ba
patword 00ff 030c599f000850ba
patword 0100 030c599f000850ba
patword 0101 030c599f000850ba
patword 0102 030c599f400850ba
patword 0103 030c599f400850ba
patword 0104 030c599f600850ba
patword 0105 030c599f400850ba
patword 0106 030c599f400850ba
patword 0107 030c599f400850ba
patword 0108 870c599f682e50ba
patword 0109 870c599f482850ba
patword 010a 870c599f000e50ba
patword 010b 870c599f000850ba
patword 010c 870c599f000e50ba
patword 010d 870c599f000850ba
patword 010e 870c599f000e50ba
patword 010f 870c599f000850ba
patword 0110 870c599f000e50ba
patword 0111 870c599f000850ba
patword 0112 870c599f000e50ba
patword 0113 870c599f000850ba
patword 0114 870c599f000e50ba
patword 0115 870c599f000850ba
patword 0116 870c599f000e50ba
patword 0117 870c599f000850ba
patword 0118 870c599f000e50ba
patword 0119 870c599f000850ba
patword 011a 870c599f000e50ba
patword 011b 870c599f000850ba
patword 011c 870c599f000e50ba
patword 011d 870c599f000850ba
patword 011e 870c599f000e50ba
patword 011f 870c599f000850ba
patword 0120 870c599f000e50ba
patword 0121 870c599f000850ba
patword 0122 870c599f200e50ba
patword 0123 870c599f000850ba
patword 0124 870c599f000e50ba
patword 0125 870c599f000850ba
patword 0126 870c599f000e50ba
patword 0127 870c599f000850ba
patword 0128 870c599f000e50ba
patword 0129 870c599f000850ba
patword 012a 870c599f000e50ba
patword 012b 870c599f000850ba
patword 012c 870c599f000e50ba
patword 012d 870c599f000850ba
patword 012e 870c599f000e50ba
patword 012f 870c599f000850ba
patword 0130 870c599f000e50ba
patword 0131 870c599f000850ba
patword 0132 870c599f000e50ba
patword 0133 870c599f000850ba
patword 0134 870c599f000e50ba
patword 0135 870c599f000850ba
patword 0136 870c599f000e50ba
patword 0137 870c599f000850ba
patword 0138 870c599f000e50ba
patword 0139 870c599f000850ba
patword 013a 870c599f282e50ba
patword 013b 870c599f082850ba
patword 013c 870c599f000e50ba
patword 013d 870c599f000850ba
patword 013e 870c599f000e50ba
patword 013f 870c599f000850ba
patword 0140 870c599f000e50ba
patword 0141 870c599f000850ba
patword 0142 870c599f000e50ba
patword 0143 870c599f000850ba
patword 0144 870c599f000e50ba
patword 0145 870c599f000850ba
patword 0146 870c599f000e50ba
patword 0147 870c599f000850ba
patword 0148 870c599f000e50ba
patword 0149 870c599f000850ba
patword 014a 870c599f000e50ba
patword 014b 870c599f000850ba
patword 014c 870c599f000e50ba
patword 014d 870c599f000850ba
patword 014e 870c599f000e50ba
patword 014f 870c599f000850ba
patword 0150 870c599f000e50ba
patword 0151 870c599f000850ba
patword 0152 870c599f000e50ba
patword 0153 870c599f000850ba
patword 0154 870c599f200e50ba
patword 0155 870c599f000850ba
patword 0156 870c599f000e50ba
patword 0157 870c599f000850ba
patword 0158 870c599f000e50ba
patword 0159 870c599f000850ba
patword 015a 870c599f000e50ba
patword 015b 870c599f000850ba
patword 015c 870c599f000e50ba
patword 015d 870c599f000850ba
patword 015e 870c599f000e50ba
patword 015f 870c599f000850ba
patword 0160 870c599f000e50ba
patword 0161 870c599f000850ba
patword 0162 870c599f000e50ba
patword 0163 870c599f000850ba
patword 0164 870c599f000e50ba
patword 0165 870c599f000850ba
patword 0166 870c599f000e50ba
patword 0167 870c599f000850ba
patword 0168 870c599f000e50ba
patword 0169 870c599f000850ba
patword 016a 870c599f000e50ba
patword 016b 870c599f000850ba
patword 016c 070c599f000850ba
patword 016d 070c599f000850ba
patword 016e 000c599f000850ba
patword 016f 000c599f000850ba
patword 0170 0008599f200e503a
patword 0171 0008599f0008503a
patword 0172 0008599f200e503a
patword 0173 0008599f0008503a
patword 0174 0008599f0008503a
patword 0175 0008599f0008503a
patword 0176 0008599f0008503a
patword 0177 0008599f0008503a
patword 0178 0008599f0008503a
patword 0179 0008599f0008503a
patword 017a 0008599f0008503a
patword 017b 0008599f0008503a
patword 017c 0008599f0008503a
patword 017d 0008599f0008503a
patword 017e 0008599f0008503a
patword 017f 0008599f0008503a
patword 0180 0008599f0008503a
patword 0181 0008599f0008503a
patword 0182 0008599f0008503a
patword 0183 0008599f0008503a
patword 0184 0008599f0008503a
patword 0185 0008599f0008503a
patword 0186 0008599f0008503a
patword 0187 0008599f0008503a
patword 0188 0008599f0008503a
patword 0189 0008599f0008503a
patword 018a 0008599f0008503a
patword 018b 0008599f0008503a
patword 018c 0008599f0008503a
patword 018d 0008599f0008503a
patioctrl 8f0effff6dbffdbf
patclkctrl 0000000000000000
patlimits 0000 018c
patloop0 013a 016b
patnloop0 199
patloop1 0400 0400
patnloop1 0
patloop2 0400 0400
patnloop2 0
patwait0 00aa
patwaittime0 10000
patwait1 0400
patwaittime1 0
patwait2 0400
patwaittime2 0
#0:rx_tcpport 1977
#############################################
### edit with 10 Gbs IP of your server
############################################
0:udp_dstip 10.1.2.102
udp_dstip 10.1.1.102
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
0:udp_srcip 10.1.2.19
udp_srcip 10.1.1.19
udp_dstport 33410
0:udp_dstport 32410
#############################################
### edit with 10 Gbs IP of your server
############################################
#zmqip 129.129.202.110
rx_zmqip 10.1.1.102
rx_zmqport 30001
#rx_zmqip 10.1.1.102
#rx_zmqport 30001
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
#zmqip 129.129.202.110
#zmqport 50001
#zmqip 129.129.202.136
#zmqport 40001
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
0:rx_hostname mpc2011
rx_hostname mpc2011
tengiga 1
#rx_datastream 1
#rx_readfreq 1
rx_datastream 1
dac 6 800
dac 0 1300
dac 4 1428
dac 1 1000
dac 7 900
dac 3 680
dac 2 1400
dac 5 1200
adcinvert 4a342593
samples 5000
adcphase 30 deg
adcpipeline 14
adcreg 14 40
frames 1000
frames 1
period 0.001
#############################################
### edit with directory you want to write to
############################################
fpath /tmp/
fpath /mnt/moench_data/scratch/
fwrite 0
rx_datastream 1
romode analog
#rx_jsonaddheader frameMode
rx_jsonpara frameMode newpedestal
#rx_jsonaddheader detectorMode
rx_jsonpara detectorMode analog
#flags newpedestal
#flags analog
rx_discardpolicy discardpartial
reg 0x5e 0x00010000
#powerchip 1
adcpipeline 15
powerchip 1
vhighvoltage 90
adcreg 14 40

View File

@ -4,10 +4,11 @@ out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.ge
cmd = out.stdout.splitlines()
cmd.pop(0)
from sls_detector import Detector, Eiger, Ctb
from slsdet import Detector, Eiger, Ctb
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
#Add commands that we should not expect as direct commands in python
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',

View File

@ -1,11 +1,19 @@
"""
Utility to find and list which command line functions have tests and
where the tests are located
"""
#local import for for parsing c++
import parse
from pathlib import Path
#General python stuff
import os
import locale
import argparse
path = Path('../../slsDetectorSoftware/tests/')
import subprocess
from pathlib import Path
#Realative path from this dir
path = Path('../../slsDetectorSoftware/tests/')
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--startswith", help="for filter", type = str, default=None)
args = parser.parse_args()
@ -15,15 +23,12 @@ tested = []
for fname in files:
with open(path/fname) as f:
data = f.read()
data = parse.remove_comments(data)
data = data.splitlines()
for line in data:
if 'TEST_CASE' in line or 'SECTION' in line:
cmd = line.split("\"")[1]
tested.append(cmd)
tested.append([cmd, fname])
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
all_cmd = out.stdout.splitlines()
@ -33,18 +38,18 @@ all_cmd.pop(0)
if args.startswith is not None:
all_cmd = [cmd for cmd in all_cmd if cmd.startswith(args.startswith)]
tested = [cmd for cmd in tested if cmd.startswith(args.startswith)]
tested = [cmd for cmd in tested if cmd[0].startswith(args.startswith)]
tn = [cmd[0] for cmd in tested]
not_tested = [cmd for cmd in all_cmd if cmd not in tested]
misnamed = [cmd for cmd in tested if cmd not in all_cmd]
tested = [cmd for cmd in tested if cmd in all_cmd]
not_tested = [cmd for cmd in all_cmd if cmd not in tn]
misnamed = [cmd for cmd in tn if cmd not in all_cmd]
tested = [cmd for cmd in tested if cmd[0] in all_cmd]
print("\nThe following commands are tested:")
for cmd in tested:
print(cmd)
print(f'{cmd[0]:>18} : {cmd[1]}')
print("\nThe following commands are NOT tested:")
for cmd in not_tested:

View File

@ -149,6 +149,7 @@ int main(int argc, char *argv[]) {
if (argc>=9) {
nframes=atoi(argv[8]);
}
int xmin=0, xmax=nx, ymin=0, ymax=ny;
if (argc>=13) {
xmin=atoi(argv[9]);
@ -185,6 +186,7 @@ int main(int argc, char *argv[]) {
cout << "pedestal file is " << pedfile << endl;
if (thr>0)
cout << "threshold is " << thr << endl;
cout << "Nframes is " << nframes << endl;
uint32 nnx, nny;
double *gmap;

View File

@ -471,47 +471,18 @@ int main(int argc, char *argv[]) {
// #ifndef DEVELOPER
// #ifndef MOENCH_BRANCH
// zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, 0,0, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex,0 , packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, additionalJsonHeader);
// zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, 1,1, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex,0 , packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, additionalJsonHeader);
// #endif
// #endif
// #ifdef DEVELOPER
#ifdef CTBGUI
zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 0,0,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,additionalJsonHeader);
#endif
#ifndef CTBGUI
zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 0,0,nnx,1,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,additionalJsonHeader);
#endif
// #ifdef CTBGUI
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 0,0,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,additionalJsonHeader);
// #endif
// #ifdef MOENCH_BRANCH
// /*
// int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
// uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
// uint64_t acqIndex = 0, uint64_t fIndex = 0, char* fname = NULL,
// uint64_t frameNumber = 0, uint32_t expLength = 0, uint32_t packetNumber = 0,
// uint64_t bunchId = 0, uint64_t timestamp = 0,
// uint16_t modId = 0, uint16_t row = 0, uint16_t column = 0, uint16_t reserved = 0,
// uint32_t debug = 0, uint16_t roundRNumber = 0,
// uint8_t detType = 0, uint8_t version = 0, int* flippedData = 0,
// char* additionalJsonHeader = 0) {
// int ZmqSocket::SendHeaderData(int 0, bool false, uint32_t SLS_DETECTOR_JSON_HEADER_VERSION , uint32_t dr, uint64_t fileindex, uint32_t 0, uint32_t 0, uint32_t, uint64_t, uint64_t, char*, uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, int*, char*)
// */
// //zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 0,0,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version);//, 0,additionalJsonHeader);
// zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex, subFrameIndex, packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, flippedData, additionalJsonHeader);
// /* old
// zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex, subFrameIndex, packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, flippedData, additionalJsonHeader);
// */
// /*
// new
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 0,0,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,additionalJsonHeader);
// */
// #endif
// #ifndef CTBGUI
zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,additionalJsonHeader);
//#endif
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
@ -809,6 +780,7 @@ int main(int argc, char *argv[]) {
mt->pushData(buff);
mt->nextThread();
mt->popFree(buff);
cprintf(GREEN, "Frame\n");
} else {
cprintf(RED, "Incomplete frame: received only %d packet\n", packetNumber);
//length =

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>350</height>
<width>376</width>
<height>425</height>
</rect>
</property>
<property name="minimumSize">
@ -240,7 +240,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<width>376</width>
<height>28</height>
</rect>
</property>

View File

@ -214,6 +214,46 @@
<string>Very Low Gain</string>
</property>
</item>
<item>
<property name="text">
<string>G1_HG</string>
</property>
</item>
<item>
<property name="text">
<string>G1_LG</string>
</property>
</item>
<item>
<property name="text">
<string>G2_HC_HG</string>
</property>
</item>
<item>
<property name="text">
<string>G2_HC_LG</string>
</property>
</item>
<item>
<property name="text">
<string>G2_LC_HG</string>
</property>
</item>
<item>
<property name="text">
<string>G2_LC_LG</string>
</property>
</item>
<item>
<property name="text">
<string>G4_HG</string>
</property>
</item>
<item>
<property name="text">
<string>G4_LG</string>
</property>
</item>
<item>
<property name="text">
<string>Undefined</string>

View File

@ -16,7 +16,7 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
Q_OBJECT
public:
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2, SlsQt2DPlot *gp,
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2, SlsQt1DPlot *gp1, SlsQt2DPlot *gp,
QString title, QString filePath, QString fileName,
int64_t aIndex, bool displayStats, QString min, QString max,
QString sum);
@ -37,6 +37,7 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
int id;
SlsQt1DPlot *plot1d{nullptr};
SlsQt2DPlot *plot2d{nullptr};
SlsQt1DPlot *gainplot1d{nullptr};
SlsQt2DPlot *gainplot2d{nullptr};
QString filePath{"/"};
QString fileName{"run"};

View File

@ -31,6 +31,7 @@ class qDefs : public QWidget {
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 void DisplayExceptions(std::string emsg, std::string src) {
try {

View File

@ -12,7 +12,6 @@ class detectorData;
#include "Detector.h"
class QResizeEvent;
#include <QFutureWatcher>
#include <mutex>
@ -64,11 +63,11 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
private slots:
void SetSaveFileName(QString val);
void AcquireFinished();
void AcquireThread();
void UpdatePlot();
signals:
void StartAcquireSignal();
void AcquireFinishedSignal();
void AbortSignal();
void UpdateSignal();
@ -81,7 +80,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
void DetachHists();
static void GetAcquisitionFinishedCallBack(double currentProgress, int detectorStatus, void *this_pointer);
static void GetDataCallBack(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex, void *this_pointer);
std::string AcquireThread();
void AcquisitionFinished(double currentProgress, int detectorStatus);
void GetData(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex);
void toDoublePixelData(double *dest, char *source, int size, int databytes, int dr, double *gaindest = NULL);
@ -102,7 +100,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
SlsQtH1D * gainhist1d{nullptr};
SlsQt2DPlot *plot2d{nullptr};
SlsQt2DPlot *gainplot2d{nullptr};
QFutureWatcher<std::string> *acqResultWatcher;
bool is1d{true};
bool isRunning{false};
@ -161,8 +158,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
unsigned int nPixelsX{0};
unsigned int nPixelsY{0};
const static int npixelsx_jctb = 400;
int npixelsy_jctb{0};
uint32_t pixelMask{0};
uint32_t gainMask{0};
int gainOffset{0};

View File

@ -41,6 +41,14 @@ private:
FORCESWITCHG1,
FORCESWITCHG2,
VERLOWGAIN,
G1_HIGHGAIN,
G1_LOWGAIN,
G2_HIGHCAP_HIGHGAIN,
G2_HIGHCAP_LOWGAIN,
G2_LOWCAP_HIGHGAIN,
G2_LOWCAP_LOWGAIN,
G4_HIGHGAIN,
G4_LOWGAIN,
UNDEFINED,
UNINITIALIZED,
NUMSETTINGS

View File

@ -26,7 +26,7 @@ class SlsQt2DHist: public QwtRasterData{
double x_width,y_width;
int nx,ny,nb;
double *data;
double *data{nullptr};
double z_min,z_mean,z_max;
bool z_mean_has_been_calculated;

View File

@ -55,9 +55,11 @@ SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) {
SlsQt2DPlot::~SlsQt2DPlot() {
if (d_spectrogram) {
d_spectrogram->detach();
//delete d_spectrogram;
}
if (hist)
if (hist) {
delete hist;
}
if (colorMapLinearScale)
delete colorMapLinearScale;
if (colorMapLogScale)

View File

@ -11,10 +11,10 @@
int qCloneWidget::NumClones{0};
qCloneWidget::qCloneWidget(QWidget *parent, SlsQt1DPlot* p1, SlsQt2DPlot* p2, SlsQt2DPlot* gp,
qCloneWidget::qCloneWidget(QWidget *parent, SlsQt1DPlot* p1, SlsQt2DPlot* p2, SlsQt1DPlot *gp1, SlsQt2DPlot* gp,
QString title, QString fPath, QString fName, int64_t aIndex,
bool displayStats, QString min, QString max, QString sum):
QMainWindow(parent), plot1d(p1), plot2d(p2), gainplot2d(gp), filePath(fPath), fileName(fName), acqIndex(aIndex) {
QMainWindow(parent), plot1d(p1), plot2d(p2), gainplot1d(gp1), gainplot2d(gp), filePath(fPath), fileName(fName), acqIndex(aIndex) {
setupUi(this);
id = qCloneWidget::NumClones++;
SetupWidgetWindow(title);
@ -26,6 +26,8 @@ qCloneWidget::~qCloneWidget() {
delete plot1d;
if (plot2d)
delete plot2d;
if (gainplot1d)
delete gainplot1d;
if (gainplot2d)
delete gainplot2d;
}
@ -40,21 +42,35 @@ void qCloneWidget::SetupWidgetWindow(QString title) {
// 1d
if (plot1d != nullptr) {
plotLayout->addWidget(plot1d);
if (gainplot1d == nullptr) {
plotLayout->addWidget(plot1d);
} else {
int ratio = qDefs::DATA_GAIN_PLOT_RATIO - 1;
plotLayout->addWidget(plot1d, 0, 0, ratio, ratio);
plotLayout->addWidget(gainplot1d, ratio, 0, 1, ratio, Qt::AlignTop);
}
}
// 2d
else {
if (gainplot2d == nullptr) {
plotLayout->addWidget(plot2d);
} else {
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
int ratio = qDefs::DATA_GAIN_PLOT_RATIO - 1;
plotLayout->addWidget(plot2d, 0, 0, ratio, ratio);
plotLayout->addWidget(gainplot2d, 0, ratio, 1, 1, Qt::AlignRight | Qt::AlignTop);
}
}
connect(actionSaveClone, SIGNAL(triggered()), this, SLOT(SavePlot()));
this->show();
if (gainplot1d != nullptr) {
gainplot1d->setMinimumHeight(qDefs::MIN_HEIGHT_GAIN_PLOT_1D);
gainplot1d->setFixedWidth(plot1d->width());
// gainplot1d->setFixedHeight(plot1d->height() / qDefs::DATA_GAIN_PLOT_RATIO - 1);
}
if (gainplot2d != nullptr) {
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
}
}
void qCloneWidget::DisplayStats(bool enable, QString min, QString max, QString sum) {
@ -92,6 +108,10 @@ void qCloneWidget::SavePlot() {
}
void qCloneWidget::resizeEvent(QResizeEvent *event) {
if (gainplot1d != nullptr) {
gainplot1d->setFixedWidth(plot1d->width());
gainplot1d->setFixedHeight(plot1d->height() / qDefs::DATA_GAIN_PLOT_RATIO);
}
if (gainplot2d != nullptr) {
gainplot2d->setFixedWidth(plot2d->width() / qDefs::DATA_GAIN_PLOT_RATIO);
gainplot2d->setFixedHeight(plot2d->height() / qDefs::DATA_GAIN_PLOT_RATIO);

View File

@ -431,8 +431,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
void qDetectorMain::ExecuteHelp(QAction *action) {
if (action == actionAbout) {
FILE_LOG(logINFO) << "About Common GUI for Eiger, Gotthard, Jungfrau "
"and Moench detectors";
FILE_LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, Gotthard, Gotthard2 and Moench detectors";
std::string guiVersion = std::to_string(APIGUI);
std::string clientVersion = "unknown";
@ -449,7 +448,7 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
clientVersion +
"<br><br>"
"Common GUI to control the SLS Detectors: "
"Eiger, Jungfrau, Mythen3, Gotthard, Gotthard2 and Moench.<br><br>"
"Jungfrau, Eiger, Mythen3, Gotthard, Gotthard2 and Moench.<br><br>"
"It can be operated in parallel with the command "
"line interface:<br>"
"sls_detector_put,<br>sls_detector_get,<br>sls_"

View File

@ -13,7 +13,6 @@
#include <QtConcurrentRun>
#include <QResizeEvent>
qDrawPlot::qDrawPlot(QWidget *parent, sls::Detector *detector) : QWidget(parent), det(detector) {
setupUi(this);
SetupWidgetWindow();
@ -60,7 +59,6 @@ void qDrawPlot::SetupWidgetWindow() {
detType = det->getDetectorType().squash();
switch (detType) {
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
pixelMask = ((1 << 14) - 1);
gainMask = (3 << 14);
gainOffset = 14;
@ -92,15 +90,12 @@ void qDrawPlot::SetupWidgetWindow() {
SetupPlots();
SetDataCallBack(true);
det->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack), this);
// future watcher to watch result of AcquireThread only because it uses signals/slots to handle acquire exception
acqResultWatcher = new QFutureWatcher<std::string>();
Initialization();
}
void qDrawPlot::Initialization() {
connect(this, SIGNAL(UpdateSignal()), this, SLOT(UpdatePlot()));
connect(acqResultWatcher, SIGNAL(finished()), this, SLOT(AcquireFinished()));
connect(this, SIGNAL(StartAcquireSignal()), this, SLOT(AcquireThread()));
}
void qDrawPlot::SetupPlots() {
@ -111,13 +106,6 @@ void qDrawPlot::SetupPlots() {
nPixelsX = res.x;
nPixelsY = res.y;
switch(detType) {
case slsDetectorDefs::MOENCH:
try{
npixelsy_jctb = (det->getNumberOfAnalogSamples().tsquash("Inconsistent values for number of analog samples") * 2)/25;// for moench 03
nPixelsX = npixelsx_jctb;
nPixelsY = npixelsy_jctb;
} CATCH_DISPLAY ("Could not get number of analog samples.", "qDrawPlot::SetupPlots")
break;
case slsDetectorDefs::EIGER:
try{
if (det->getQuad().tsquash("Inconsistent values for quad type")) {
@ -193,7 +181,7 @@ void qDrawPlot::SetupPlots() {
// 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->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);
@ -244,7 +232,7 @@ void qDrawPlot::SetupPlots() {
//gainplot2d->enableAxis(1, false);
gainplot2d->enableAxis(QwtPlot::xBottom, false);
// set ticks to just 3
gainplot2d->setAxisScaleDiv( QwtPlot::yRight, div );
gainplot2d->setAxisScaleDiv( QwtPlot::yRight, div);
gainplot2d->hide();
// layout of plots
@ -495,6 +483,7 @@ void qDrawPlot::ClonePlot() {
SlsQt1DPlot* cloneplot1D = nullptr;
SlsQt2DPlot* cloneplot2D = nullptr;
SlsQt1DPlot* clonegainplot1D = nullptr;
SlsQt2DPlot* clonegainplot2D = nullptr;
if (is1d) {
@ -516,6 +505,24 @@ void qDrawPlot::ClonePlot() {
cloneplotHists1D.append(h);
h->Attach(cloneplot1D);
}
if (isGainDataExtracted) {
SlsQtH1D *h = new SlsQtH1D("", nPixelsX, datax1d, gainDatay1d);
h->SetLineColor(0);
h->setStyleLinesorDots(isLines);
h->setSymbolMarkers(isMarkers);
h->setItemAttribute(QwtPlotItem::Legend, false);
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);
}
} else {
FILE_LOG(logDEBUG) << "Cloning 2D Image";
cloneplot2D = new SlsQt2DPlot();
@ -533,19 +540,26 @@ void qDrawPlot::ClonePlot() {
if (isGainDataExtracted) {
clonegainplot2D = new SlsQt2DPlot();
clonegainplot2D->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
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);
clonegainplot2D->SetTitle("");
}
}
qCloneWidget* q = new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot2D,
boxPlot->title(), fileSavePath, fileSaveName, currentAcqIndex,
new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
clonegainplot2D, boxPlot->title(), fileSavePath, fileSaveName, currentAcqIndex,
displayStatistics, lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text());
q->show();
}
void qDrawPlot::SavePlot() {
@ -622,16 +636,19 @@ void qDrawPlot::StartAcquisition() {
xyRangeChanged = true;
}
// acquisition in another thread
QFuture<std::string> future = QtConcurrent::run(this, &qDrawPlot::AcquireThread);
acqResultWatcher->setFuture(future);
emit StartAcquireSignal();
FILE_LOG(logDEBUG) << "End of Starting Acquisition in qDrawPlot";
}
void qDrawPlot::AcquireFinished() {
FILE_LOG(logDEBUG) << "Acquisition Finished";
std::string mess = acqResultWatcher->result();
void qDrawPlot::AcquireThread() {
FILE_LOG(logDEBUG) << "Acquire Thread";
std::string mess;
try {
det->acquire();
} catch (const std::exception &e) {
mess = std::string(e.what());
}
FILE_LOG(logINFO) << "Acquisition Finished";
// exception in acquire will not call acquisition finished call back, so handle it
if (!mess.empty()) {
FILE_LOG(logERROR) << "Acquisition Finished with an exception: " << mess;
@ -647,16 +664,6 @@ void qDrawPlot::AcquireFinished() {
FILE_LOG(logDEBUG) << "End of Acquisition Finished";
}
std::string qDrawPlot::AcquireThread() {
FILE_LOG(logDEBUG) << "Acquire Thread";
try {
det->acquire();
} catch (const std::exception &e) {
return std::string(e.what());
}
return std::string("");
}
void qDrawPlot::GetAcquisitionFinishedCallBack(double currentProgress, int detectorStatus, void *this_pointer) {
((qDrawPlot *)this_pointer)->AcquisitionFinished(currentProgress, detectorStatus);
FILE_LOG(logDEBUG) << "Acquisition Finished Call back successful";
@ -768,6 +775,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, uint32_t subFra
} else {
Get2dData(rawData);
}
delete [] rawData;
FILE_LOG(logDEBUG) << "End of Get Data";
emit UpdateSignal();
@ -984,7 +992,6 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size, int data
case 16:
if (detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::MOENCH ||
detType == slsDetectorDefs::GOTTHARD2) {
// show gain plot

View File

@ -82,14 +82,14 @@ void qTabDeveloper::SetupWidgetWindow() {
case slsDetectorDefs::MOENCH:
lblSpinHV->show();
spinHV->show();
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 0: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 1: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 2: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 3: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 4: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 5: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "v Dac 6: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "i Dac 7: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vbp_colbuf: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vipre: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vin_cm: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vb_sda: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vcasc_sfp: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vout_cm: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "vipre_cds: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(this, det, true, "ibias_sfp: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::MYTHEN3:
@ -343,10 +343,27 @@ slsDetectorDefs::dacIndex qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorTy
break;
case slsDetectorDefs::MOENCH:
if (index >= 0 && index < (int)dacWidgets.size()) {
return (slsDetectorDefs::dacIndex)index;
switch (index) {
case 0:
return slsDetectorDefs::VBP_COLBUF;
case 1:
return slsDetectorDefs::VIPRE;
case 2:
return slsDetectorDefs::VIN_CM;
case 3:
return slsDetectorDefs::VB_SDA;
case 4:
return slsDetectorDefs::VCASC_SFP;
case 5:
return slsDetectorDefs::VOUT_CM;
case 6:
return slsDetectorDefs::VIPRE_CDS;
case 7:
return slsDetectorDefs::IBIAS_SFP;
default:
throw sls::RuntimeError(std::string("Unknown dac/adc index") + std::to_string(index));
}
throw sls::RuntimeError(std::string("Unknown dac/adc index") + std::to_string(index));
break;
case slsDetectorDefs::MYTHEN3:
switch (index) {

View File

@ -72,7 +72,6 @@ void qTabPlot::SetupWidgetWindow() {
chkGapPixels->setEnabled(true);
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
chkGainPlot->setEnabled(true);
chkGainPlot->setChecked(true);
plot->EnableGainPlot(true);
@ -585,7 +584,6 @@ void qTabPlot::Refresh() {
GetGapPixels();
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
chkGainPlot->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD2:

View File

@ -20,7 +20,6 @@ void qTabSettings::SetupWidgetWindow() {
// enabling according to det type
switch(det->getDetectorType().squash()) {
case slsDetectorDefs::MOENCH:
case slsDetectorDefs::MYTHEN3:
lblSettings->setEnabled(false);
comboSettings->setEnabled(false);
@ -83,11 +82,21 @@ void qTabSettings::SetupDetectorSettings() {
item[(int)FORCESWITCHG1]->setEnabled(true);
item[(int)FORCESWITCHG2]->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD2:
case slsDetectorDefs::GOTTHARD2:
item[(int)DYNAMICGAIN]->setEnabled(true);
item[(int)FIXGAIN1]->setEnabled(true);
item[(int)FIXGAIN2]->setEnabled(true);
break;
case slsDetectorDefs::MOENCH:
item[(int)G1_HIGHGAIN]->setEnabled(true);
item[(int)G1_LOWGAIN]->setEnabled(true);
item[(int)G2_HIGHCAP_HIGHGAIN]->setEnabled(true);
item[(int)G2_HIGHCAP_LOWGAIN]->setEnabled(true);
item[(int)G2_LOWCAP_HIGHGAIN]->setEnabled(true);
item[(int)G2_LOWCAP_LOWGAIN]->setEnabled(true);
item[(int)G4_HIGHGAIN]->setEnabled(true);
item[(int)G4_LOWGAIN]->setEnabled(true);
break;
default:
FILE_LOG(logDEBUG) << "Unknown detector type. Exiting GUI.";
qDefs::Message(qDefs::CRITICAL,

View File

@ -4,13 +4,14 @@ if [ $# -eq 0 ]; then
"gotthard2DetectorServer"
"jungfrauDetectorServer"
"mythen3DetectorServer"
"moenchDetectorServer"
)
else
declare -a det=("${1}")
echo "got something"
fi
declare -a deterror=("OK" "OK" "OK" "OK")
declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")
for ((i=0;i<${#det[@]};++i))
do

View File

@ -515,7 +515,7 @@ void setupDetector() {
// 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);
bus_w(ADC_PORT_INVERT_REG, 0);// depends on chip
setADCInvertRegister(0);// depends on chip
FILE_LOG(logINFOBLUE, ("Setting Default parameters\n"));
cleanFifos(); // FIXME: why twice?

View File

@ -107,7 +107,6 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
#define BIT32_MSK (0xFFFFFFFF)
#define BIT16_MASK (0xFFFF)
#define ADC_PORT_INVERT_VAL (0x453b2593)
#define MAXIMUM_ADC_CLK (65)
#define PLL_VCO_FREQ_MHZ (800)

View File

@ -23,7 +23,7 @@ target_include_directories(gotthard2DetectorServer_virtual
)
target_compile_definitions(gotthard2DetectorServer_virtual
PUBLIC GOTTHARD2D VIRTUAL STOP_SERVER DEBUG1
PUBLIC GOTTHARD2D VIRTUAL STOP_SERVER #DEBUG1
)
target_link_libraries(gotthard2DetectorServer_virtual

View File

@ -5,7 +5,7 @@ support_lib = ../../slsSupportLib/include/
CROSS = nios2-buildroot-linux-gnu-
CC = $(CROSS)gcc
CFLAGS += -Wall -DGOTTHARD2D -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) -DDEBUG1 #-DVERBOSEI #-DVERBOSE
CFLAGS += -Wall -DGOTTHARD2D -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE
LDLIBS += -lm
PROGS = gotthard2DetectorServer
DESTDIR ?= bin

View File

@ -228,7 +228,7 @@
#define SET_DELAY_LSB_REG (0x22 * REG_OFFSET + BASE_FLOW_CONTROL)
#define SET_DELAY_MSB_REG (0x23 * REG_OFFSET + BASE_FLOW_CONTROL)
/* Cylces 64bit Write-register */
/* Cylces (also #bursts) 64bit Write-register */
#define SET_CYCLES_LSB_REG (0x24 * REG_OFFSET + BASE_FLOW_CONTROL)
#define SET_CYCLES_MSB_REG (0x25 * REG_OFFSET + BASE_FLOW_CONTROL)
@ -236,7 +236,7 @@
#define SET_FRAMES_LSB_REG (0x26 * REG_OFFSET + BASE_FLOW_CONTROL)
#define SET_FRAMES_MSB_REG (0x27 * REG_OFFSET + BASE_FLOW_CONTROL)
/* Period 64bit Write-register */
/* Period (also burst period) 64bit Write-register */
#define SET_PERIOD_LSB_REG (0x28 * REG_OFFSET + BASE_FLOW_CONTROL)
#define SET_PERIOD_MSB_REG (0x29 * REG_OFFSET + BASE_FLOW_CONTROL)

View File

@ -39,6 +39,7 @@ int virtual_stop = 0;
enum detectorSettings thisSettings = UNINITIALIZED;
int32_t clkPhase[NUM_CLOCKS] = {};
uint32_t clkFrequency[NUM_CLOCKS] = {};
uint32_t systemFrequency = 0;
int highvoltage = 0;
int dacValues[NDAC] = {0};
int onChipdacValues[ONCHIP_NDAC][NCHIP] = {0};
@ -49,7 +50,6 @@ uint8_t adcConfiguration[NCHIP][NADC];
int burstMode = BURST_INTERNAL;
int64_t numTriggers = 1;
int64_t numBursts = 1;
int64_t delayAfterTriggerNs = 0;
int64_t burstPeriodNs = 0;
int detPos[2] = {};
@ -346,6 +346,7 @@ void setupDetector() {
clkFrequency[SYSTEM_C1] = DEFAULT_SYSTEM_C1;
clkFrequency[SYSTEM_C2] = DEFAULT_SYSTEM_C2;
clkFrequency[SYSTEM_C3] = DEFAULT_SYSTEM_C3;
systemFrequency = INT_SYSTEM_C0_FREQUENCY;
detPos[0] = 0;
detPos[1] = 0;
@ -356,7 +357,6 @@ void setupDetector() {
burstMode = BURST_INTERNAL;
numTriggers = 1;
numBursts = 1;
delayAfterTriggerNs = 0;
burstPeriodNs = 0;
{
int i, j;
@ -394,6 +394,7 @@ void setupDetector() {
// on chip dacs
ASIC_Driver_SetDefines(ONCHIP_DAC_DRIVER_FILE_NAME);
#endif
setTimingSource(DEFAULT_TIMING_SOURCE);
// Default values
setHighVoltage(DEFAULT_HIGH_VOLTAGE);
@ -448,7 +449,6 @@ void setupDetector() {
setBurstPeriod(DEFAULT_BURST_PERIOD);
setTiming(DEFAULT_TIMING_MODE);
setCurrentSource(DEFAULT_CURRENT_SOURCE);
setTimingSource(DEFAULT_TIMING_SOURCE);
}
int readConfigFile() {
@ -824,7 +824,7 @@ int setPeriod(int64_t val) {
setPeriodBurst(0);
return setPeriodCont(val);
} else {
setPeriodCont(0);
//setPeriodCont(0);
return setPeriodBurst(val);
}
}
@ -867,12 +867,12 @@ int setExptimeCont(int64_t val) {
}
int setExptimeBoth(int64_t val) {
val *= (1E-9 * clkFrequency[SYSTEM_C0]);
val *= (1E-9 * systemFrequency);
set64BitReg(val, ASIC_INT_EXPTIME_LSB_REG, ASIC_INT_EXPTIME_MSB_REG);
// validate for tolerance
int64_t retval = getExptimeBoth();
val /= (1E-9 * clkFrequency[SYSTEM_C0]);
val /= (1E-9 * systemFrequency);
if (val != retval) {
return FAIL;
}
@ -880,18 +880,18 @@ int setExptimeBoth(int64_t val) {
}
int64_t getExptimeBoth() {
return get64BitReg(ASIC_INT_EXPTIME_LSB_REG, ASIC_INT_EXPTIME_MSB_REG) / (1E-9 * clkFrequency[SYSTEM_C0]);
return get64BitReg(ASIC_INT_EXPTIME_LSB_REG, ASIC_INT_EXPTIME_MSB_REG) / (1E-9 * systemFrequency);
}
int setPeriodBurst(int64_t val) {
FILE_LOG(logINFO, ("Setting period %lld ns [Burst mode]\n", val));
val *= (1E-9 * clkFrequency[SYSTEM_C0]);
val *= (1E-9 * systemFrequency);
set64BitReg(val, ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG);
// validate for tolerance
int64_t retval = getPeriodBurst();
val /= (1E-9 * clkFrequency[SYSTEM_C0]);
val /= (1E-9 * systemFrequency);
if (val != retval) {
return FAIL;
}
@ -900,17 +900,17 @@ int setPeriodBurst(int64_t val) {
int64_t getPeriodBurst() {
FILE_LOG(logDEBUG, ("Getting period [Burst mode]\n"));
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG)/ (1E-9 * clkFrequency[SYSTEM_C0]);
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG)/ (1E-9 * systemFrequency);
}
int setPeriodCont(int64_t val) {
FILE_LOG(logINFO, ("Setting period %lld ns [Continuous mode]\n", val));
val *= (1E-9 * FIXED_PLL_FREQUENCY);
val *= (1E-9 * systemFrequency);
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
// validate for tolerance
int64_t retval = getPeriodCont();
val /= (1E-9 * FIXED_PLL_FREQUENCY);
val /= (1E-9 * systemFrequency);
if (val != retval) {
return FAIL;
}
@ -919,7 +919,7 @@ int setPeriodCont(int64_t val) {
int64_t getPeriodCont() {
FILE_LOG(logDEBUG, ("Getting period [Continuous mode]\n"));
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/ (1E-9 * FIXED_PLL_FREQUENCY);
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG)/ (1E-9 * systemFrequency);
}
int setDelayAfterTrigger(int64_t val) {
@ -928,17 +928,12 @@ int setDelayAfterTrigger(int64_t val) {
return FAIL;
}
FILE_LOG(logINFO, ("Setting delay after trigger %lld ns\n", val));
delayAfterTriggerNs = val;
val *= (1E-9 * FIXED_PLL_FREQUENCY);
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
FILE_LOG(logINFO, ("\tBurst and Auto mode: not writing delay to register\n"));
} else {
set64BitReg(val, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
}
val *= (1E-9 * systemFrequency);
set64BitReg(val, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
// validate for tolerance
int64_t retval = getDelayAfterTrigger();
val /= (1E-9 * FIXED_PLL_FREQUENCY);
val /= (1E-9 * systemFrequency);
if (val != retval) {
return FAIL;
}
@ -946,10 +941,7 @@ int setDelayAfterTrigger(int64_t val) {
}
int64_t getDelayAfterTrigger() {
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
return delayAfterTriggerNs;
}
return get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG) / (1E-9 * FIXED_PLL_FREQUENCY);
return get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG) / (1E-9 * systemFrequency);
}
int setBurstPeriod(int64_t val) {
@ -959,16 +951,16 @@ int setBurstPeriod(int64_t val) {
}
FILE_LOG(logINFO, ("Setting burst period %lld ns\n", val));
burstPeriodNs = val;
val *= (1E-9 * FIXED_PLL_FREQUENCY);
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
set64BitReg(val, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
val *= (1E-9 * systemFrequency);
if (burstMode != BURST_OFF) {
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
} else {
FILE_LOG(logINFO, ("\tNot (Burst and Auto mode): not writing burst period to register\n"));
FILE_LOG(logINFO, ("\t(Continuous mode): not writing burst period to register\n"));
}
// validate for tolerance
int64_t retval = getBurstPeriod();
val /= (1E-9 * FIXED_PLL_FREQUENCY);
val /= (1E-9 * systemFrequency);
if (val != retval) {
return FAIL;
}
@ -976,8 +968,8 @@ int setBurstPeriod(int64_t val) {
}
int64_t getBurstPeriod() {
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
return get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG) / (1E-9 * FIXED_PLL_FREQUENCY);
if (burstMode != BURST_OFF) {
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) / (1E-9 * systemFrequency);
}
return burstPeriodNs;
}
@ -991,11 +983,11 @@ int64_t getNumTriggersLeft() {
}
int64_t getDelayAfterTriggerLeft() {
return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) / (1E-9 * FIXED_PLL_FREQUENCY);
return get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) / (1E-9 * systemFrequency);
}
int64_t getPeriodLeft() {
return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-9 * FIXED_PLL_FREQUENCY);
return get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-9 * systemFrequency);
}
int64_t getFramesFromStart() {
@ -1210,8 +1202,6 @@ void setTiming( enum timingMode arg){
FILE_LOG(logINFO, ("\tUpdating trigger/burst and delay/burst period registers\n"))
setNumTriggers(numTriggers);
setNumBursts(numBursts);
setDelayAfterTrigger(delayAfterTriggerNs);
setBurstPeriod(burstPeriodNs);
}
enum timingMode getTiming() {
@ -1574,6 +1564,10 @@ int setClockDivider(enum CLKINDEX ind, int val) {
ALTERA_PLL_C10_SetOuputFrequency (pllIndex, clkIndex, newfreq);
clkFrequency[ind] = newfreq;
FILE_LOG(logINFO, ("\t%s clock (%d) divider set to %d (%d Hz)\n", clock_names[ind], ind, val, clkFrequency[ind]));
// update system frequency
if (ind == SYSTEM_C0) {
setTimingSource(getTimingSource());
}
// phase is reset by pll (when setting output frequency)
if (ind >= READOUT_C0) {
@ -1890,10 +1884,9 @@ int setBurstMode(enum burstMode burst) {
return FAIL;
}
FILE_LOG(logINFO, ("\tUpdating trigger/burst and delay/burst period registers\n"))
FILE_LOG(logINFO, ("\tUpdating trigger/burst and burst period registers\n"))
setNumTriggers(numTriggers);
setNumBursts(numBursts);
setDelayAfterTrigger(delayAfterTriggerNs);
setBurstPeriod(burstPeriodNs);
// set number of frames and period again (set registers according to timing mode)
@ -1982,10 +1975,12 @@ void setTimingSource(enum timingSourceType value) {
case TIMING_INTERNAL:
FILE_LOG(logINFO, ("Setting timing source to internal\n"));
bus_w(addr, (bus_r(addr) &~ CONTROL_TIMING_SOURCE_EXT_MSK));
systemFrequency = INT_SYSTEM_C0_FREQUENCY;
break;
case TIMING_EXTERNAL:
FILE_LOG(logINFO, ("Setting timing source to exernal\n"));
bus_w(addr, (bus_r(addr) | CONTROL_TIMING_SOURCE_EXT_MSK));
systemFrequency = clkFrequency[SYSTEM_C0];
break;
default:
FILE_LOG(logERROR, ("Unknown timing source %d\n", value));

View File

@ -54,6 +54,7 @@
/* Firmware Definitions */
#define IP_HEADER_SIZE (20)
#define FIXED_PLL_FREQUENCY (20000000) // 20MHz
#define INT_SYSTEM_C0_FREQUENCY (144000000) //144 MHz
#define READOUT_PLL_VCO_FREQ_HZ (866666688) // 866 MHz
#define SYSTEM_PLL_VCO_FREQ_HZ (722222224) // 722 MHz

View File

@ -219,6 +219,8 @@
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
#define PLL_CNTRL_PLL_RST_OFST (3)
#define PLL_CNTRL_PLL_RST_MSK (0x00000001 << PLL_CNTRL_PLL_RST_OFST)
#define PLL_CNTRL_DBIT_WR_PRMTR_OFST (5)
#define PLL_CNTRL_DBIT_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_DBIT_WR_PRMTR_OFST)
#define PLL_CNTRL_ADDR_OFST (16)
#define PLL_CNTRL_ADDR_MSK (0x0000003F << PLL_CNTRL_ADDR_OFST)

View File

@ -1,7 +1,7 @@
#include "slsDetectorFunctionList.h"
#include "versionAPI.h"
#include "clogger.h"
#include <sys/select.h>
#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h
#include "LTC2620.h" // dacs
#include "MAX1932.h" // hv
@ -14,6 +14,7 @@
#include <string.h>
#include <unistd.h> // usleep
#include <sys/select.h>
#ifdef VIRTUAL
#include <pthread.h>
#include <time.h>
@ -37,7 +38,7 @@ int virtual_stop = 0;
enum detectorSettings thisSettings = UNINITIALIZED;
int highvoltage = 0;
int dacValues[NDAC] = {};
int adcPhase = 0;
int32_t clkPhase[NUM_CLOCKS] = {};
int detPos[4] = {};
int numUDPInterfaces = 1;
@ -365,7 +366,12 @@ void initStopServer() {
void setupDetector() {
FILE_LOG(logINFO, ("This Server is for 1 Jungfrau module (500k)\n"));
adcPhase = 0;
{
int i = 0;
for (i = 0; i < NUM_CLOCKS; ++i) {
clkPhase[i] = 0;
}
}
ALTERA_PLL_ResetPLL();
resetCore();
resetPeripheral();
@ -388,7 +394,7 @@ void setupDetector() {
setDefaultDacs();
// 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_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_CNTRL_DBIT_WR_PRMTR_MSK, DBIT_CLK_INDEX);
bus_w(DAQ_REG, 0x0); /* Only once at server startup */
@ -1317,6 +1323,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
uint32_t adcOfst = 0;
uint32_t sampleAdcSpeed = 0;
uint32_t adcPhase = 0;
uint32_t dbitPhase = 0;
uint32_t config = CONFIG_FULL_SPEED_40MHZ_VAL;
switch(val) {
@ -1330,6 +1337,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
adcOfst = ADC_OFST_FULL_SPEED_VAL;
sampleAdcSpeed = SAMPLE_ADC_FULL_SPEED;
adcPhase = ADC_PHASE_FULL_SPEED;
dbitPhase = DBIT_PHASE_FULL_SPEED;
config = CONFIG_FULL_SPEED_40MHZ_VAL;
break;
@ -1338,6 +1346,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
adcOfst = isHardwareVersion2() ? ADC_OFST_HALF_SPEED_BOARD2_VAL : ADC_OFST_HALF_SPEED_VAL;
sampleAdcSpeed = isHardwareVersion2() ? SAMPLE_ADC_HALF_SPEED_BOARD2 : SAMPLE_ADC_HALF_SPEED;
adcPhase = isHardwareVersion2() ? ADC_PHASE_HALF_SPEED_BOARD2 : ADC_PHASE_HALF_SPEED;
dbitPhase = isHardwareVersion2() ? DBIT_PHASE_HALF_SPEED_BOARD2 : DBIT_PHASE_HALF_SPEED;
config = CONFIG_HALF_SPEED_20MHZ_VAL;
break;
@ -1346,6 +1355,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
adcOfst = isHardwareVersion2() ? ADC_OFST_QUARTER_SPEED_BOARD2_VAL : ADC_OFST_QUARTER_SPEED_VAL;
sampleAdcSpeed = isHardwareVersion2() ? SAMPLE_ADC_QUARTER_SPEED_BOARD2 : SAMPLE_ADC_QUARTER_SPEED;
adcPhase = isHardwareVersion2() ? ADC_PHASE_QUARTER_SPEED_BOARD2 : ADC_PHASE_QUARTER_SPEED;
dbitPhase = isHardwareVersion2() ? DBIT_PHASE_QUARTER_SPEED_BOARD2 : DBIT_PHASE_QUARTER_SPEED;
config = CONFIG_QUARTER_SPEED_10MHZ_VAL;
break;
@ -1366,6 +1376,12 @@ int setClockDivider(enum CLKINDEX ind, int val) {
setPhase(ADC_CLK, adcPhase, 0);
FILE_LOG(logINFO, ("\tSet ADC Phase Reg to %d\n", adcPhase));
// only implemented in the new boards now
if (!isHardwareVersion2()) {
setPhase(DBIT_CLK, dbitPhase, 0);
FILE_LOG(logINFO, ("\tSet DBIT Phase Reg to %d\n", dbitPhase));
}
return OK;
}
@ -1389,12 +1405,13 @@ int getClockDivider(enum CLKINDEX ind) {
}
int setPhase(enum CLKINDEX ind, int val, int degrees){
if (ind != ADC_CLK) {
if (ind != ADC_CLK && ind != DBIT_CLK) {
FILE_LOG(logERROR, ("Unknown clock index %d to set phase\n", ind));
return FAIL;
}
char* clock_names[] = {CLK_NAMES};
FILE_LOG(logINFO, ("Setting %s clock (%d) phase to %d %s\n", clock_names[ind], ind, val, degrees == 0 ? "" : "degrees"));
int maxShift = MAX_PHASE_SHIFTS;
// validation
if (degrees && (val < 0 || val > 359)) {
FILE_LOG(logERROR, ("\tPhase provided outside limits (0 - 359°C)\n"));
@ -1405,7 +1422,6 @@ int setPhase(enum CLKINDEX ind, int val, int degrees){
return FAIL;
}
FILE_LOG(logINFO, ("Setting ADC Phase to %d (degree mode: %d)\n", val, degrees));
int valShift = val;
// convert to phase shift
if (degrees) {
@ -1413,14 +1429,15 @@ int setPhase(enum CLKINDEX ind, int val, int degrees){
}
FILE_LOG(logDEBUG1, ("phase shift: %d (degrees/shift: %d)\n", valShift, val));
int relativePhase = valShift - adcPhase;
FILE_LOG(logDEBUG1, ("relative phase shift: %d (Current phase: %d)\n", relativePhase, adcPhase));
int relativePhase = valShift - clkPhase[ind];
FILE_LOG(logDEBUG1, ("relative phase shift: %d (Current phase: %d)\n", relativePhase, clkPhase[ind]));
// same phase
if (!relativePhase) {
FILE_LOG(logINFO, ("Nothing to do in Phase Shift\n"));
return OK;
}
FILE_LOG(logINFOBLUE, ("Configuring Phase\n"));
int phase = 0;
if (relativePhase > 0) {
@ -1430,29 +1447,29 @@ int setPhase(enum CLKINDEX ind, int val, int degrees){
}
FILE_LOG(logDEBUG1, ("[Single Direction] Phase:%d (0x%x). Max Phase shifts:%d\n", phase, phase, maxShift));
ALTERA_PLL_SetPhaseShift(phase, 1, 0);
ALTERA_PLL_SetPhaseShift(phase, (ind == ADC_CLK ? ADC_CLK_INDEX : DBIT_CLK_INDEX), 0);
adcPhase = valShift;
clkPhase[ind] = valShift;
alignDeserializer();
return OK;
}
int getPhase(enum CLKINDEX ind, int degrees) {
if (ind != ADC_CLK) {
if (ind != ADC_CLK && ind != DBIT_CLK) {
FILE_LOG(logERROR, ("Unknown clock index %d to get phase\n", ind));
return -1;
}
if (!degrees)
return adcPhase;
return clkPhase[ind];
// convert back to degrees
int val = 0;
ConvertToDifferentRange(0, MAX_PHASE_SHIFTS - 1, 0, 359, adcPhase, &val);
ConvertToDifferentRange(0, MAX_PHASE_SHIFTS - 1, 0, 359, clkPhase[ind], &val);
return val;
}
int getMaxPhase(enum CLKINDEX ind) {
if (ind != ADC_CLK) {
if (ind != ADC_CLK && ind != DBIT_CLK) {
FILE_LOG(logERROR, ("Unknown clock index %d to get max phase\n", ind));
return -1;
}
@ -1460,7 +1477,7 @@ int getMaxPhase(enum CLKINDEX ind) {
}
int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval) {
if (ind != ADC_CLK) {
if (ind != ADC_CLK && ind != DBIT_CLK) {
FILE_LOG(logERROR, ("Unknown clock index %d to validate phase in degrees\n", ind));
return FAIL;
}

View File

@ -4,8 +4,8 @@
#define MIN_REQRD_VRSN_T_RD_API 0x171220
#define REQRD_FRMWRE_VRSN_BOARD2 0x190716
#define REQRD_FRMWRE_VRSN 0x190708
#define REQRD_FRMWRE_VRSN_BOARD2 0x190716 // old
#define REQRD_FRMWRE_VRSN 0x200305 // new
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
@ -50,8 +50,8 @@ enum DACINDEX {J_VB_COMP, J_VDD_PROT, J_VIN_COM, J_VREF_PRECH, J_VB_PIXBUF, J
420 /* J_VREF_COMP */ \
};
enum NETWORKINDEX { TXN_FRAME, FLOWCTRL_10G };
enum CLKINDEX {RUN_CLK, ADC_CLK, NUM_CLOCKS};
#define CLK_NAMES "run", "adc"
enum CLKINDEX {RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS};
#define CLK_NAMES "run", "adc", "dbit"
/* Hardware Definitions */
#define NCHAN (256 * 256)
@ -63,6 +63,8 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, NUM_CLOCKS};
#define DATA_BYTES (NCHIP * NCHAN * NUM_BYTES_PER_PIXEL)
#define CLK_RUN (40) /* MHz */
#define CLK_SYNC (20) /* MHz */
#define ADC_CLK_INDEX (1)
#define DBIT_CLK_INDEX (0)
/** Default Parameters */
#define DEFAULT_NUM_FRAMES (100*1000*1000)
@ -106,16 +108,21 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, NUM_CLOCKS};
#define ADC_PORT_INVERT_VAL (0x5A5A5A5A)
#define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c)
#define SAMPLE_ADC_FULL_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_DGTL_SAMPLE_3_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x300
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1610
#define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + SAMPLE_DGTL_SAMPLE_11_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2b30
#define SAMPLE_ADC_FULL_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_DGTL_SAMPLE_2_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x200
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_DGTL_SAMPLE_3_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1310
#define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2630
#define SAMPLE_ADC_HALF_SPEED_BOARD2 (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1600
#define SAMPLE_ADC_QUARTER_SPEED_BOARD2 (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_DGTL_SAMPLE_11_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2b10
#define ADC_PHASE_FULL_SPEED (0x1E) //30
#define ADC_PHASE_HALF_SPEED (0x1E) //30
#define ADC_PHASE_QUARTER_SPEED (0x1E) //30
#define ADC_PHASE_FULL_SPEED (28)
#define ADC_PHASE_HALF_SPEED (35)
#define ADC_PHASE_QUARTER_SPEED (35)
#define ADC_PHASE_HALF_SPEED_BOARD2 (0x1E) //30
#define ADC_PHASE_QUARTER_SPEED_BOARD2 (0x1E) //30
#define DBIT_PHASE_FULL_SPEED (37)
#define DBIT_PHASE_HALF_SPEED (37)
#define DBIT_PHASE_QUARTER_SPEED (37)
#define DBIT_PHASE_HALF_SPEED_BOARD2 (37)
#define DBIT_PHASE_QUARTER_SPEED_BOARD2 (37)

View File

@ -13,6 +13,7 @@ add_executable(moenchDetectorServer_virtual
../slsDetectorServer/src/LTC2620.c
../slsDetectorServer/src/MAX1932.c
../slsDetectorServer/src/programFpgaBlackfin.c
../slsDetectorServer/src/readDefaultPattern.c
)
include_directories(

View File

@ -0,0 +1,289 @@
patword 0x0000 0x0008599f0418503a
patword 0x0001 0x0008599f0418503a
patword 0x0002 0x000859960418503a
patword 0x0003 0x000859960418503a
patword 0x0004 0x000859960418503a
patword 0x0005 0x000859960418503a
patword 0x0006 0x000859960418503a
patword 0x0007 0x000859960418503a
patword 0x0008 0x000859960418503a
patword 0x0009 0x000859960418503a
patword 0x000a 0x000859960418503a
patword 0x000b 0x000859960418503a
patword 0x000c 0x000859960418503a
patword 0x000d 0x000859960418503a
patword 0x000e 0x000859960418503a
patword 0x000f 0x000859960418503a
patword 0x0010 0x000859960418503a
patword 0x0011 0x000859960418503a
patword 0x0012 0x000859960418503a
patword 0x0013 0x000859960418503a
patword 0x0014 0x000859960418503a
patword 0x0015 0x000859960418503a
patword 0x0016 0x000819960418501a
patword 0x0017 0x000819960418501a
patword 0x0018 0x000819960418501a
patword 0x0019 0x000819960418501a
patword 0x001a 0x000819960418501a
patword 0x001b 0x000819960418501a
patword 0x001c 0x000819960418501a
patword 0x001d 0x000819960418501a
patword 0x001e 0x000819960418501a
patword 0x001f 0x000819960418501a
patword 0x0020 0x000819960418501a
patword 0x0021 0x000819960418501a
patword 0x0022 0x000819960418501a
patword 0x0023 0x000819960418501a
patword 0x0024 0x000819960418501a
patword 0x0025 0x000819960418501a
patword 0x0026 0x000819960418501a
patword 0x0027 0x000819960418501a
patword 0x0028 0x000819960418501a
patword 0x0029 0x000819960418501a
patword 0x002a 0x000819960418501a
patword 0x002b 0x000819960418501a
patword 0x002c 0x000819960418501a
patword 0x002d 0x000819960418501a
patword 0x002e 0x000819960418501a
patword 0x002f 0x000819960418501a
patword 0x0030 0x000819960008501a
patword 0x0031 0x000819960008501a
patword 0x0032 0x000819960008501a
patword 0x0033 0x000819960008501a
patword 0x0034 0x000819960008501a
patword 0x0035 0x000819960008501a
patword 0x0036 0x000819960008501a
patword 0x0037 0x000819960008501a
patword 0x0038 0x000819960008501a
patword 0x0039 0x000819960008501a
patword 0x003a 0x000819960008501a
patword 0x003b 0x000819960008501a
patword 0x003c 0x000819960008501a
patword 0x003d 0x000819960008501a
patword 0x003e 0x000819960008501a
patword 0x003f 0x000819960008501a
patword 0x0040 0x000819960008501a
patword 0x0041 0x000819960008501a
patword 0x0042 0x000819960008501a
patword 0x0043 0x000819960008501a
patword 0x0044 0x0008199f0008501a
patword 0x0045 0x0008199f0008501a
patword 0x0046 0x0008199f0008501a
patword 0x0047 0x0008199f0008501a
patword 0x0048 0x0008199f0008501a
patword 0x0049 0x0008199f0008501a
patword 0x004a 0x0008199f0008501a
patword 0x004b 0x0008199f0008501a
patword 0x004c 0x0008199f0008501a
patword 0x004d 0x0008199f0008501a
patword 0x004e 0x0008199f0008501a
patword 0x004f 0x0008199f0008501a
patword 0x0050 0x0008199f0008501a
patword 0x0051 0x0008199f0008501a
patword 0x0052 0x0008199f0008501a
patword 0x0053 0x0008199f0008501a
patword 0x0054 0x0008199f0008501a
patword 0x0055 0x0008199f0008501a
patword 0x0056 0x0008199f0008501a
patword 0x0057 0x0008199f0008501a
patword 0x0058 0x0008599f0008503a
patword 0x0059 0x0008599f0008503a
patword 0x005a 0x000c599f000850ba
patword 0x005b 0x000c599f000850ba
patword 0x005c 0x000c599f000850ba
patword 0x005d 0x000c599f000850ba
patword 0x005e 0x000c599f000850ba
patword 0x005f 0x000c599f000850ba
patword 0x0060 0x000c599f000850ba
patword 0x0061 0x000c599f000850ba
patword 0x0062 0x000c599f000850ba
patword 0x0063 0x000c599f000850ba
patword 0x0064 0x000c599f000850ba
patword 0x0065 0x000c599f000850ba
patword 0x0066 0x000c599f000850ba
patword 0x0067 0x000c599f000850ba
patword 0x0068 0x000c599f000850ba
patword 0x0069 0x000c599f000850ba
patword 0x006a 0x000c599f000850ba
patword 0x006b 0x000c599f000850ba
patword 0x006c 0x000c599f000850ba
patword 0x006d 0x000c599f000850ba
patword 0x006e 0x000c799f010858ba
patword 0x006f 0x000c799f010858ba
patword 0x0070 0x000c599f000850ba
patword 0x0071 0x000c599f000850ba
patword 0x0072 0x000c599f000850ba
patword 0x0073 0x000c599f000850ba
patword 0x0074 0x000c599f000850ba
patword 0x0075 0x000c599f000850ba
patword 0x0076 0x000c599f000850ba
patword 0x0077 0x000c599f000850ba
patword 0x0078 0x000c599f000850ba
patword 0x0079 0x000c599f000850ba
patword 0x007a 0x000c599f000850ba
patword 0x007b 0x000c599f000850ba
patword 0x007c 0x000c599f000850ba
patword 0x007d 0x000c599f000850ba
patword 0x007e 0x000c599f000850ba
patword 0x007f 0x000c599f000850ba
patword 0x0080 0x000c599f000850ba
patword 0x0081 0x000c599f000850ba
patword 0x0082 0x000c599f000850ba
patword 0x0083 0x000c599f000850ba
patword 0x0084 0x000c599f000850ba
patword 0x0085 0x000c599f000850ba
patword 0x0086 0x000c599f400850ba
patword 0x0087 0x000c599f400850ba
patword 0x0088 0x000c599f600850ba
patword 0x0089 0x000c599f400850ba
patword 0x008a 0x000c599f400850ba
patword 0x008b 0x000c599f400850ba
patword 0x008c 0x840c599f682e50ba
patword 0x008d 0x840c599f482850ba
patword 0x008e 0x840c599f000e50ba
patword 0x008f 0x840c599f000850ba
patword 0x0090 0x840c599f000e50ba
patword 0x0091 0x840c599f000850ba
patword 0x0092 0x840c599f000e50ba
patword 0x0093 0x840c599f000850ba
patword 0x0094 0x840c599f000e50ba
patword 0x0095 0x840c599f000850ba
patword 0x0096 0x840c599f000e50ba
patword 0x0097 0x840c599f000850ba
patword 0x0098 0x840c599f000e50ba
patword 0x0099 0x840c599f000850ba
patword 0x009a 0x840c599f000e50ba
patword 0x009b 0x840c599f000850ba
patword 0x009c 0x840c599f000e50ba
patword 0x009d 0x840c599f000850ba
patword 0x009e 0x840c599f000e50ba
patword 0x009f 0x840c599f000850ba
patword 0x00a0 0x840c599f000e50ba
patword 0x00a1 0x840c599f000850ba
patword 0x00a2 0x840c599f000e50ba
patword 0x00a3 0x840c599f000850ba
patword 0x00a4 0x840c599f000e50ba
patword 0x00a5 0x840c599f000850ba
patword 0x00a6 0x840c599f200e50ba
patword 0x00a7 0x840c599f000850ba
patword 0x00a8 0x840c599f000e50ba
patword 0x00a9 0x840c599f000850ba
patword 0x00aa 0x840c599f000e50ba
patword 0x00ab 0x840c599f000850ba
patword 0x00ac 0x840c599f000e50ba
patword 0x00ad 0x840c599f000850ba
patword 0x00ae 0x840c599f000e50ba
patword 0x00af 0x840c599f000850ba
patword 0x00b0 0x840c599f000e50ba
patword 0x00b1 0x840c599f000850ba
patword 0x00b2 0x840c599f000e50ba
patword 0x00b3 0x840c599f000850ba
patword 0x00b4 0x840c599f000e50ba
patword 0x00b5 0x840c599f000850ba
patword 0x00b6 0x840c599f000e50ba
patword 0x00b7 0x840c599f000850ba
patword 0x00b8 0x840c599f000e50ba
patword 0x00b9 0x840c599f000850ba
patword 0x00ba 0x840c599f000e50ba
patword 0x00bb 0x840c599f000850ba
patword 0x00bc 0x840c599f000e50ba
patword 0x00bd 0x840c599f000850ba
patword 0x00be 0x840c599f282e50ba
patword 0x00bf 0x840c599f082850ba
patword 0x00c0 0x840c599f000e50ba
patword 0x00c1 0x840c599f000850ba
patword 0x00c2 0x840c599f000e50ba
patword 0x00c3 0x840c599f000850ba
patword 0x00c4 0x840c599f000e50ba
patword 0x00c5 0x840c599f000850ba
patword 0x00c6 0x840c599f000e50ba
patword 0x00c7 0x840c599f000850ba
patword 0x00c8 0x840c599f000e50ba
patword 0x00c9 0x840c599f000850ba
patword 0x00ca 0x840c599f000e50ba
patword 0x00cb 0x840c599f000850ba
patword 0x00cc 0x840c599f000e50ba
patword 0x00cd 0x840c599f000850ba
patword 0x00ce 0x840c599f000e50ba
patword 0x00cf 0x840c599f000850ba
patword 0x00d0 0x840c599f000e50ba
patword 0x00d1 0x840c599f000850ba
patword 0x00d2 0x840c599f000e50ba
patword 0x00d3 0x840c599f000850ba
patword 0x00d4 0x840c599f000e50ba
patword 0x00d5 0x840c599f000850ba
patword 0x00d6 0x840c599f000e50ba
patword 0x00d7 0x840c599f000850ba
patword 0x00d8 0x840c599f200e50ba
patword 0x00d9 0x840c599f000850ba
patword 0x00da 0x840c599f000e50ba
patword 0x00db 0x840c599f000850ba
patword 0x00dc 0x840c599f000e50ba
patword 0x00dd 0x840c599f000850ba
patword 0x00de 0x840c599f000e50ba
patword 0x00df 0x840c599f000850ba
patword 0x00e0 0x840c599f000e50ba
patword 0x00e1 0x840c599f000850ba
patword 0x00e2 0x840c599f000e50ba
patword 0x00e3 0x840c599f000850ba
patword 0x00e4 0x840c599f000e50ba
patword 0x00e5 0x840c599f000850ba
patword 0x00e6 0x840c599f000e50ba
patword 0x00e7 0x840c599f000850ba
patword 0x00e8 0x840c599f000e50ba
patword 0x00e9 0x840c599f000850ba
patword 0x00ea 0x840c599f000e50ba
patword 0x00eb 0x840c599f000850ba
patword 0x00ec 0x840c599f000e50ba
patword 0x00ed 0x840c599f000850ba
patword 0x00ee 0x840c599f000e50ba
patword 0x00ef 0x840c599f000850ba
patword 0x00f0 0x040c599f000850ba
patword 0x00f1 0x040c599f000850ba
patword 0x00f2 0x000c599f000850ba
patword 0x00f3 0x000c599f000850ba
patword 0x00f4 0x0008599f200e503a
patword 0x00f5 0x0008599f0008503a
patword 0x00f6 0x0008599f200e503a
patword 0x00f7 0x0008599f0008503a
patword 0x00f8 0x0008599f0008503a
patword 0x00f9 0x0008599f0008503a
patword 0x00fa 0x0008599f0008503a
patword 0x00fb 0x0008599f0008503a
patword 0x00fc 0x0008599f0008503a
patword 0x00fd 0x0008599f0008503a
patword 0x00fe 0x0008599f0008503a
patword 0x00ff 0x0008599f0008503a
patword 0x0100 0x0008599f0008503a
patword 0x0101 0x0008599f0008503a
patword 0x0102 0x0008599f0008503a
patword 0x0103 0x0008599f0008503a
patword 0x0104 0x0008599f0008503a
patword 0x0105 0x0008599f0008503a
patword 0x0106 0x0008599f0008503a
patword 0x0107 0x0008599f0008503a
patword 0x0108 0x0008599f0008503a
patword 0x0109 0x0008599f0008503a
patword 0x010a 0x0008599f0008503a
patword 0x010b 0x0008599f0008503a
patword 0x010c 0x0008599f0008503a
patword 0x010d 0x0008599f0008503a
patword 0x010e 0x0008599f0008503a
patword 0x010f 0x0008599f0008503a
patword 0x0110 0x0008599f0008503a
patword 0x0111 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patclkctrl 0x0000000000000000
patlimits 0x0000 0x0110
patloop0 0x00be 0x00ef
patnloop0 199
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x002e
patwaittime0 800
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0

View File

@ -12,7 +12,7 @@ DESTDIR ?= bin
INSTMODE = 0777
SRCS = slsDetectorFunctionList.c
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)blackfin.c $(main_src)common.c $(main_src)commonServerFunctions.c $(main_src)communication_funcs_UDP.c $(main_src)UDPPacketHeaderGenerator.c $(main_src)AD9257.c $(main_src)ALTERA_PLL.c $(main_src)LTC2620.c $(main_src)MAX1932.c $(main_src)programFpgaBlackfin.c
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)blackfin.c $(main_src)common.c $(main_src)commonServerFunctions.c $(main_src)communication_funcs_UDP.c $(main_src)UDPPacketHeaderGenerator.c $(main_src)AD9257.c $(main_src)ALTERA_PLL.c $(main_src)LTC2620.c $(main_src)MAX1932.c $(main_src)programFpgaBlackfin.c $(main_src)readDefaultPattern.c
OBJS = $(SRCS:.c=.o)
@ -34,6 +34,7 @@ $(PROGS): $(OBJS)
mv $(PROGS) $(DESTDIR)
rm *.gdb
rm $(main_src)*.o
rm *.o
clean:
rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o

View File

@ -16,7 +16,7 @@
/* Fix pattern RO register */
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
#define FIX_PATT_VAL (0xACDC2014)
#define FIX_PATT_VAL (0xACDC2016)
/* Status RO register */
#define STATUS_REG (0x02 << MEM_MAP_SHIFT)
@ -289,7 +289,7 @@
/* Configuration RW register */
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
#define CONFIG_LED_DSBL_OFST (0)
#define CONFIG_LED_DSBL_OFST (0) // Not used in firmware or software
#define CONFIG_LED_DSBL_MSK (0x00000001 << CONFIG_LED_DSBL_OFST)
#define CONFIG_DSBL_ANLG_OTPT_OFST (8)
#define CONFIG_DSBL_ANLG_OTPT_MSK (0x00000001 << CONFIG_DSBL_ANLG_OTPT_OFST)
@ -365,23 +365,23 @@
#define PATTERN_CNTRL_RD_OFST (1)
#define PATTERN_CNTRL_RD_MSK (0x00000001 << PATTERN_CNTRL_RD_OFST)
#define PATTERN_CNTRL_ADDR_OFST (16)
#define PATTERN_CNTRL_ADDR_MSK (0x0000FFFF << PATTERN_CNTRL_ADDR_OFST)
#define PATTERN_CNTRL_ADDR_MSK (0x00001FFF << PATTERN_CNTRL_ADDR_OFST)
/* Pattern Limit RW regiser */
#define PATTERN_LIMIT_REG (0x53 << MEM_MAP_SHIFT)
#define PATTERN_LIMIT_STRT_OFST (0)
#define PATTERN_LIMIT_STRT_MSK (0x0000FFFF << PATTERN_LIMIT_STRT_OFST)
#define PATTERN_LIMIT_STRT_MSK (0x00001FFF << PATTERN_LIMIT_STRT_OFST)
#define PATTERN_LIMIT_STP_OFST (16)
#define PATTERN_LIMIT_STP_MSK (0x0000FFFF << PATTERN_LIMIT_STP_OFST)
#define PATTERN_LIMIT_STP_MSK (0x00001FFF << PATTERN_LIMIT_STP_OFST)
/* Pattern Loop 0 Address RW regiser */
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_0_ADDR_STRT_MSK (0x0000FFFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
#define PATTERN_LOOP_0_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x0000FFFF << PATTERN_LOOP_0_ADDR_STP_OFST)
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
/* Pattern Loop 0 Iteration RW regiser */
#define PATTERN_LOOP_0_ITERATION_REG (0x55 << MEM_MAP_SHIFT)
@ -390,9 +390,9 @@
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_1_ADDR_STRT_MSK (0x0000FFFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
#define PATTERN_LOOP_1_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x0000FFFF << PATTERN_LOOP_1_ADDR_STP_OFST)
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
/* Pattern Loop 1 Iteration RW regiser */
#define PATTERN_LOOP_1_ITERATION_REG (0x57 << MEM_MAP_SHIFT)
@ -401,9 +401,9 @@
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_2_ADDR_STRT_MSK (0x0000FFFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
#define PATTERN_LOOP_2_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x0000FFFF << PATTERN_LOOP_2_ADDR_STP_OFST)
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
/* Pattern Loop 2 Iteration RW regiser */
#define PATTERN_LOOP_2_ITERATION_REG (0x59 << MEM_MAP_SHIFT)
@ -412,31 +412,36 @@
#define PATTERN_WAIT_0_ADDR_REG (0x5A << MEM_MAP_SHIFT)
#define PATTERN_WAIT_0_ADDR_OFST (0)
#define PATTERN_WAIT_0_ADDR_MSK (0x0000FFFF << PATTERN_WAIT_0_ADDR_OFST)
#define PATTERN_WAIT_0_ADDR_MSK (0x00001FFF << PATTERN_WAIT_0_ADDR_OFST)
//FIXME: is mask 3FF
/* Pattern Wait 1 RW regiser */
#define PATTERN_WAIT_1_ADDR_REG (0x5B << MEM_MAP_SHIFT)
#define PATTERN_WAIT_1_ADDR_OFST (0)
#define PATTERN_WAIT_1_ADDR_MSK (0x0000FFFF << PATTERN_WAIT_1_ADDR_OFST)
#define PATTERN_WAIT_1_ADDR_MSK (0x00001FFF << PATTERN_WAIT_1_ADDR_OFST)
/* Pattern Wait 2 RW regiser */
#define PATTERN_WAIT_2_ADDR_REG (0x5C << MEM_MAP_SHIFT)
#define PATTERN_WAIT_2_ADDR_OFST (0)
#define PATTERN_WAIT_2_ADDR_MSK (0x0000FFFF << PATTERN_WAIT_2_ADDR_OFST)
#define PATTERN_WAIT_2_ADDR_MSK (0x00001FFF << PATTERN_WAIT_2_ADDR_OFST)
/* Samples RW register */
#define SAMPLES_REG (0x5D << MEM_MAP_SHIFT)
#define SAMPLES_DIGITAL_OFST (0)
#define SAMPLES_DIGITAL_MSK (0x0000FFFF << SAMPLES_DIGITAL_OFST)
#define SAMPLES_ANALOG_OFST (16)
#define SAMPLES_ANALOG_MSK (0x0000FFFF << SAMPLES_ANALOG_OFST)
/** Power RW register */
#define POWER_REG (0x5E << MEM_MAP_SHIFT)
#define POWER_ENBL_VLTG_RGLTR_OFST (16)
#define POWER_ENBL_VLTG_RGLTR_MSK (0x0000001F << POWER_ENBL_VLTG_RGLTR_OFST)
#define POWER_HV_SLCT_OFST (31)
#define POWER_HV_SLCT_MSK (0x00000001 << POWER_HV_SLCT_OFST)
#define POWER_CHIP_OFST (16)
#define POWER_CHIP_MSK (0x00000001 << POWER_CHIP_OFST)
#define POWER_HV_INTERNAL_SLCT_OFST (31)
#define POWER_HV_INTERNAL_SLCT_MSK (0x00000001 << POWER_HV_INTERNAL_SLCT_OFST)
/* Number of Words RW register TODO */
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
@ -493,17 +498,16 @@
#define PATTERN_WAIT_TIMER_2_LSB_REG (0x76 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_2_MSB_REG (0x77 << MEM_MAP_SHIFT)
/* ADC Disable RW register TODO */
#define ADC_DISABLE_REG (0x78 << MEM_MAP_SHIFT)
/* Readout enable RW register */
#define READOUT_10G_ENABLE_REG (0x79 << MEM_MAP_SHIFT)
/* DAC Value RW register TODO */
//#define DAC_VALUE_REG (0x79 << MEM_MAP_SHIFT)
/* DAC Number RW register TODO */
//#define DAC_NUMBER_REG (0x7A << MEM_MAP_SHIFT)
#define READOUT_10G_ENABLE_ANLG_OFST (0)
#define READOUT_10G_ENABLE_ANLG_MSK (0x000000FF << READOUT_10G_ENABLE_ANLG_OFST)
#define READOUT_10G_ENABLE_DGTL_OFST (8)
#define READOUT_10G_ENABLE_DGTL_MSK (0x00000001 << READOUT_10G_ENABLE_DGTL_OFST)
/* Digital Bit External Trigger RW register */
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT)
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT) // Not used in firmware or software
#define DBIT_EXT_TRG_SRC_OFST (0)
#define DBIT_EXT_TRG_SRC_MSK (0x0000003F << DBIT_EXT_TRG_SRC_OFST)
@ -511,7 +515,8 @@
#define DBIT_EXT_TRG_OPRTN_MD_MSK (0x00000001 << DBIT_EXT_TRG_OPRTN_MD_OFST)
/* Pin Delay 0 RW register */
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT)
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT) // Not used in firmware or software
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST (0) //t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
#define OUTPUT_DELAY_0_OTPT_STTNG_MSK (0x0000001F << OUTPUT_DELAY_0_OTPT_STTNG_OFST)
@ -523,7 +528,7 @@
/* Pin Delay 1 RW register
* Each bit configured as enable for dynamic output delay configuration */
#define PIN_DELAY_1_REG (0x7D << MEM_MAP_SHIFT)
#define PIN_DELAY_1_REG (0x7D << MEM_MAP_SHIFT) // Not used in firmware or software
/** Pattern Mask 64 bit RW regiser */
#define PATTERN_MASK_LSB_REG (0x80 << MEM_MAP_SHIFT)
@ -533,7 +538,7 @@
#define PATTERN_SET_LSB_REG (0x82 << MEM_MAP_SHIFT)
#define PATTERN_SET_MSB_REG (0x83 << MEM_MAP_SHIFT)
/* Round Robin */
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT)

View File

@ -4,27 +4,52 @@
#define MIN_REQRD_VRSN_T_RD_API 0x180314
#define REQRD_FRMWR_VRSN 0x180314
#define REQRD_FRMWR_VRSN 0x200302
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
#define CTRL_SRVR_INIT_TIME_US (2 * 1000 * 1000)
/* Struct Definitions */
typedef struct ip_header_struct {
uint16_t ip_len;
uint8_t ip_tos;
uint8_t ip_ihl:4 ,ip_ver:4;
uint16_t ip_offset:13,ip_flag:3;
uint16_t ip_ident;
uint16_t ip_chksum;
uint8_t ip_protocol;
uint8_t ip_ttl;
uint32_t ip_sourceip;
uint32_t ip_destip;
} ip_header;
typedef struct udp_header_struct {
uint32_t udp_destmac_msb;
uint16_t udp_srcmac_msb;
uint16_t udp_destmac_lsb;
uint32_t udp_srcmac_lsb;
uint8_t ip_tos;
uint8_t ip_ihl: 4, ip_ver: 4;
uint16_t udp_ethertype;
uint16_t ip_identification;
uint16_t ip_totallength;
uint8_t ip_protocol;
uint8_t ip_ttl;
uint16_t ip_fragmentoffset: 13, ip_flags: 3;
uint16_t ip_srcip_msb;
uint16_t ip_checksum;
uint16_t ip_destip_msb;
uint16_t ip_srcip_lsb;
uint16_t udp_srcport;
uint16_t ip_destip_lsb;
uint16_t udp_checksum;
uint16_t udp_destport;
} udp_header;
#define IP_HEADER_SIZE (20)
#define UDP_IP_HEADER_LENGTH_BYTES (28)
/* Enums */
enum DACINDEX {MO_VBP_COLBUF, MO_VIPRE, MO_VIN_CM, MO_VB_SDA, MO_VCASC_SFP, MO_VOUT_CM, MO_VIPRE_CDS, MO_IBIAS_SFP};
#define DAC_NAMES "vbp_colbuf", "vipre", "vin_cm", "vb_sda", "vcasc_sfp", "vout_cm", "vipre_cds", "ibias_sfp"
#define DEFAULT_DAC_VALS { 1300, /* MO_VBP_COLBUF */ \
1000, /* MO_VIPRE */ \
1400, /* MO_VIN_CM */ \
680, /* MO_VB_SDA */ \
1428, /* MO_VCASC_SFP */ \
1200, /* MO_VOUT_CM */ \
800, /* MO_VIPRE_CDS */ \
900 /* MO_IBIAS_SFP */ \
};
enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7};
#define CLK_NAMES "run", "adc", "sync", "dbit"
/* Hardware Definitions */
#define NCHAN (32)
@ -33,12 +58,14 @@ enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7};
#define DYNAMIC_RANGE (16)
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
#define CLK_FREQ (156.25) /* MHz */
#define NSAMPLES_PER_ROW (25)
/** Default Parameters */
#define DEFAULT_PATTERN_FILE ("DefaultPattern.txt")
#define DEFAULT_DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
#define DEFAULT_NUM_SAMPLES (1)
#define DEFAULT_NUM_SAMPLES (5000)
#define DEFAULT_EXPTIME (0)
#define DEFAULT_NUM_FRAMES (100 * 1000 * 1000)
#define DEFAULT_NUM_FRAMES (1)
#define DEFAULT_NUM_CYCLES (1)
#define DEFAULT_PERIOD (1 * 1000 * 1000) //ns
#define DEFAULT_DELAY (0)
@ -46,35 +73,55 @@ enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7};
#define DEFAULT_VLIMIT (-100)
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
#define DEFAULT_TX_UDP_PORT (0x7e9a)
#define DEFAULT_RUN_CLK_AT_STARTUP (200) // 40
#define DEFAULT_ADC_CLK_AT_STARTUP (40) // 20
#define DEFAULT_SYNC_CLK_AT_STARTUP (40) // 20
#define DEFAULT_DBIT_CLK_AT_STARTUP (200)
#define DEFAULT_RUN_CLK (40)
#define DEFAULT_ADC_CLK (20)
#define DEFAULT_SYNC_CLK (20)
#define DEFAULT_DBIT_CLK (200)
#define DEFAULT_DBIT_CLK (40)
#define DEFAULT_ADC_PHASE_DEG (30)
#define DEFAULT_PIPELINE (15)
#define DEFAULT_SETTINGS (G4_HIGHGAIN)
// settings
#define DEFAULT_PATSETBIT (0x00000C800000800AULL)
#define G1_HIGHGAIN_PATMASK (0x00000C0000008008ULL)
#define G1_LOWGAIN_PATMASK (0x0000040000008000ULL)
#define G2_HIGHCAP_HIGHGAIN_PATMASK (0x0000080000000008ULL)
#define G2_HIGHCAP_LOWGAIN_PATMASK (0x0000000000000000ULL)
#define G2_LOWCAP_HIGHGAIN_PATMASK (0x00000C800000800AULL)
#define G2_LOWCAP_LOWGAIN_PATMASK (0x0000048000008002ULL)
#define G4_HIGHGAIN_PATMASK (0x000008800000000AULL)
#define G4_LOWGAIN_PATMASK (0x0000008000000002ULL)
#define HIGHVOLTAGE_MIN (60)
#define HIGHVOLTAGE_MAX (200)
#define HIGHVOLTAGE_MAX (200) // min dac val
#define DAC_MIN_MV (0)
#define DAC_MAX_MV (2500)
/* Defines in the Firmware */
#define MAX_PATTERN_LENGTH (0x7FFF)
#define MAX_PATTERN_LENGTH (0x2000)
#define DIGITAL_IO_DELAY_MAXIMUM_PS ((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
#define MAX_PHASE_SHIFTS_STEPS (8)
#define WAIT_TME_US_FR_ACQDONE_REG (100) // wait time in us after acquisition done to ensure there is no data in fifo
#define WAIT_TIME_US_PLL (10 * 1000)
#define WAIT_TIME_US_STP_ACQ (100)
#define WAIT_TIME_CONFIGURE_MAC (500 * 1000)
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
#define WAIT_TIME_PATTERN_READ (10)
#define WAIT_TIME_FIFO_RD_STROBE (10)
#define WAIT_TIME_1US_FOR_LOOP_CNT (50) // around 30 is 1 us in blackfin
/* MSB & LSB DEFINES */
#define MSB_OF_64_BIT_REG_OFST (32)
#define LSB_OF_64_BIT_REG_OFST (0)
#define BIT_32_MSK (0xFFFFFFFF)
#define BIT32_MSK (0xFFFFFFFF)
#define BIT16_MASK (0xFFFF)
#define IP_PACKETSIZE (0x2032)
#define ADC_PORT_INVERT_VAL (0x453b2593) //FIXME: a default value?
#define MAXIMUM_ADC_CLK (40)
#define ADC_PORT_INVERT_VAL (0x4a342593)
#define MAXIMUM_ADC_CLK (20)
#define PLL_VCO_FREQ_MHZ (800)

View File

@ -2,6 +2,21 @@
#include <inttypes.h>
#ifdef JUNGFRAUD
/**
* Set Defines
* @param creg control register
* @param preg parameter register
* @param rprmsk reconfig parameter reset mask
* @param wpmsk write parameter mask
* @param prmsk pll reset mask
* @param amsk address mask
* @param aofst address offset
* @param wd2msk write parameter mask for pll for dbit clock (Jungfrau only)
* @param clk2Index clkIndex of second pll (Jungfrau only)
*/
void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, uint32_t wpmsk, uint32_t prmsk, uint32_t amsk, int aofst, uint32_t wd2msk, int clk2Index);
#else
/**
* Set Defines
* @param creg control register
@ -13,6 +28,7 @@
* @param aofst address offset
*/
void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, uint32_t wpmsk, uint32_t prmsk, uint32_t amsk, int aofst);
#endif
/**
* Reset only PLL
@ -28,8 +44,9 @@ void ALTERA_PLL_ResetPLLAndReconfiguration ();
* Set PLL Reconfig register
* @param reg register
* @param val value
* @param useDefaultWRMask only jungfrau for dbit clk (clkindex1, use second WR mask)
*/
void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val);
void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val, int useSecondWRMask);
/**
* Write Phase Shift

View File

@ -0,0 +1,22 @@
#pragma once
#include <sys/types.h>
#include <inttypes.h>
int loadDefaultPattern(char* fname);
int default_writePatternWord(char* line, uint32_t addr, uint64_t word);
int default_writePatternIOControl(char* line, uint64_t arg);
int default_writePatternClkControl(char* line, uint64_t arg);
int default_setPatternLoopLimits(char* line, uint32_t startAddr, uint32_t stopAddr);
int default_setPatternLoopAddresses(char* line, int level, uint32_t startAddr, uint32_t stopAddr);
int default_setPatternLoopCycles(char* line, int level, int numLoops);
int default_setPatternWaitAddresses(char* line, int level, uint32_t addr);
int default_setPatternWaitTime(char* line, int level, uint64_t waittime);

View File

@ -3,6 +3,14 @@
#ifdef GOTTHARDD
#include "clogger.h" // runState(enum TLogLevel)
#endif
#ifndef VIRTUAL
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
#include "programFpgaNios.h"
#elif defined(CHIPTESTBOARDD) || defined(JUNGFRAUD) || defined(MOENCHD)
#include "programFpgaBlackfin.h"
#endif
#endif
#include <stdlib.h>
#include <stdio.h> // FILE
#include <sys/types.h>
@ -84,7 +92,7 @@ int updateDatabytesandAllocateRAM();
void updateDataBytes();
#endif
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MYTHEN3D)
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(MYTHEN3D) || defined(MOENCHD)
int setDefaultDacs();
#endif
#ifdef GOTTHARD2D
@ -141,6 +149,8 @@ void setADCEnableMask_10G(uint32_t mask);
uint32_t getADCEnableMask_10G();
void setADCInvertRegister(uint32_t val);
uint32_t getADCInvertRegister();
#endif
#if defined(CHIPTESTBOARDD)
int setExternalSamplingSource(int val);
int setExternalSampling(int val);
#endif
@ -213,6 +223,8 @@ int64_t getStorageCellDelay();
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
int setNumAnalogSamples(int val);
int getNumAnalogSamples();
#endif
#ifdef CHIPTESTBOARDD
int setNumDigitalSamples(int val);
int getNumDigitalSamples();
#endif
@ -245,7 +257,7 @@ int64_t getMeasurementTime();
int setModule(sls_detector_module myMod, char* mess);
int getModule(sls_detector_module *myMod);
#endif
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(MYTHEN3D))
#if (!defined(CHIPTESTBOARDD)) && (!defined(MYTHEN3D))
enum detectorSettings setSettings(enum detectorSettings sett);
#endif
#if !defined(MYTHEN3D)
@ -298,11 +310,9 @@ void setPower(enum DACINDEX ind, int val);
void powerOff();
#endif
#ifndef MOENCHD
#if !defined(MYTHEN3D) && !defined(GOTTHARD2D)
#if !defined(MOENCHD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D)
int getADC(enum ADCINDEX ind);
#endif
#endif
int setHighVoltage(int val);
@ -358,6 +368,7 @@ int enableTenGigabitEthernet(int val);
// moench specific - powerchip
#ifdef MOENCHD
int powerChip (int on);
int setAnalogOnlyReadout();
#endif
// chip test board or moench specific - configure frequency, phase, pll, flashing firmware
@ -383,13 +394,18 @@ uint64_t writePatternWord(int addr, uint64_t word);
int setPatternWaitAddress(int level, int addr);
uint64_t setPatternWaitTime(int level, uint64_t t);
void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop);
#ifdef CHIPTESTBOARDD
int setLEDEnable(int enable);
void setDigitalIODelay(uint64_t pinMask, int delay);
#endif
void setPatternMask(uint64_t mask);
uint64_t getPatternMask();
void setPatternBitMask(uint64_t mask);
uint64_t getPatternBitMask();
#endif
#ifdef MOENCHD
extern int loadDefaultPattern(char* fname); // readDefaultPattern.h
#endif
// jungfrau specific - powerchip, autocompdisable, clockdiv, asictimer, clock, pll, flashing firmware
#ifdef JUNGFRAUD

View File

@ -79,11 +79,28 @@ uint32_t ALTERA_PLL_Cntrl_Reg = 0x0;
uint32_t ALTERA_PLL_Param_Reg = 0x0;
uint32_t ALTERA_PLL_Cntrl_RcnfgPrmtrRstMask = 0x0;
uint32_t ALTERA_PLL_Cntrl_WrPrmtrMask = 0x0;
#ifdef JUNGFRAUD
uint32_t ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask = 0x0;
int ALTERA_PLL_Cntrl_DBIT_ClkIndex = 0;
#endif
uint32_t ALTERA_PLL_Cntrl_PLLRstMask = 0x0;
uint32_t ALTERA_PLL_Cntrl_AddrMask = 0x0;
int ALTERA_PLL_Cntrl_AddrOfst = 0;
#ifdef JUNGFRAUD
void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, uint32_t wpmsk, uint32_t prmsk, uint32_t amsk, int aofst, uint32_t wd2msk, int clk2Index) {
ALTERA_PLL_Cntrl_Reg = creg;
ALTERA_PLL_Param_Reg = preg;
ALTERA_PLL_Cntrl_RcnfgPrmtrRstMask = rprmsk;
ALTERA_PLL_Cntrl_WrPrmtrMask = wpmsk;
ALTERA_PLL_Cntrl_PLLRstMask = prmsk;
ALTERA_PLL_Cntrl_AddrMask = amsk;
ALTERA_PLL_Cntrl_AddrOfst = aofst;
ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask = wd2msk;
ALTERA_PLL_Cntrl_DBIT_ClkIndex = clk2Index;
}
#else
void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, uint32_t wpmsk, uint32_t prmsk, uint32_t amsk, int aofst) {
ALTERA_PLL_Cntrl_Reg = creg;
ALTERA_PLL_Param_Reg = preg;
@ -93,6 +110,7 @@ void ALTERA_PLL_SetDefines(uint32_t creg, uint32_t preg, uint32_t rprmsk, uint32
ALTERA_PLL_Cntrl_AddrMask = amsk;
ALTERA_PLL_Cntrl_AddrOfst = aofst;
}
#endif
void ALTERA_PLL_ResetPLL () {
FILE_LOG(logINFO, ("Resetting only PLL\n"));
@ -117,11 +135,18 @@ void ALTERA_PLL_ResetPLLAndReconfiguration () {
bus_w(ALTERA_PLL_Cntrl_Reg, bus_r(ALTERA_PLL_Cntrl_Reg) & ~ALTERA_PLL_Cntrl_RcnfgPrmtrRstMask & ~ALTERA_PLL_Cntrl_PLLRstMask);
}
void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val) {
FILE_LOG(logDEBUG1, ("Setting PLL Reconfig Reg, reg:0x%x, val:0x%x)\n", reg, val));
void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val, int useSecondWRMask) {
FILE_LOG(logDEBUG1, ("Setting PLL Reconfig Reg, reg:0x%x, val:0x%x, useSecondWRMask:%d)\n", reg, val, useSecondWRMask));
uint32_t wrmask = ALTERA_PLL_Cntrl_WrPrmtrMask;
#ifdef JUNGFRAUD
if (useSecondWRMask) {
wrmask = ALTERA_PLL_Cntrl_DBIT_PLL_WrPrmtrMask;
}
#endif
FILE_LOG(logDEBUG2, ("pllparamreg:0x%x pllcontrolreg:0x%x addrofst:%d addrmsk:0x%x wrmask:0x%x\n",
ALTERA_PLL_Param_Reg, ALTERA_PLL_Cntrl_Reg, ALTERA_PLL_Cntrl_AddrOfst, ALTERA_PLL_Cntrl_AddrMask, ALTERA_PLL_Cntrl_WrPrmtrMask));
ALTERA_PLL_Param_Reg, ALTERA_PLL_Cntrl_Reg, ALTERA_PLL_Cntrl_AddrOfst, ALTERA_PLL_Cntrl_AddrMask, wrmask));
// set parameter
bus_w(ALTERA_PLL_Param_Reg, val);
@ -134,12 +159,12 @@ void ALTERA_PLL_SetPllReconfigReg(uint32_t reg, uint32_t val) {
usleep(ALTERA_PLL_WAIT_TIME_US);
//write parameter
bus_w(ALTERA_PLL_Cntrl_Reg, bus_r(ALTERA_PLL_Cntrl_Reg) | ALTERA_PLL_Cntrl_WrPrmtrMask);
bus_w(ALTERA_PLL_Cntrl_Reg, bus_r(ALTERA_PLL_Cntrl_Reg) | wrmask);
FILE_LOG(logDEBUG2, ("Set WR bit: ALTERA_PLL_Cntrl_Reg:0x%x\n", bus_r(ALTERA_PLL_Cntrl_Reg)));
usleep(ALTERA_PLL_WAIT_TIME_US);
bus_w(ALTERA_PLL_Cntrl_Reg, bus_r(ALTERA_PLL_Cntrl_Reg) & ~ALTERA_PLL_Cntrl_WrPrmtrMask);
bus_w(ALTERA_PLL_Cntrl_Reg, bus_r(ALTERA_PLL_Cntrl_Reg) & ~wrmask);
FILE_LOG(logDEBUG2, ("Unset WR bit: ALTERA_PLL_Cntrl_Reg:0x%x\n", bus_r(ALTERA_PLL_Cntrl_Reg)));
usleep(ALTERA_PLL_WAIT_TIME_US);
@ -153,13 +178,20 @@ void ALTERA_PLL_SetPhaseShift(int32_t phase, int clkIndex, int pos) {
FILE_LOG(logDEBUG1, ("C%d phase word:0x%08x\n", clkIndex, value));
int useSecondWR = 0;
#ifdef JUNGFRAUD
if (clkIndex == ALTERA_PLL_Cntrl_DBIT_ClkIndex) {
useSecondWR = 1;
}
#endif
// write phase shift
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_PHASE_SHIFT_REG, value);
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_PHASE_SHIFT_REG, value, useSecondWR);
}
void ALTERA_PLL_SetModePolling() {
FILE_LOG(logINFO, ("\tSetting Polling Mode\n"));
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_MODE_REG, ALTERA_PLL_MODE_PLLNG_MD_VAL);
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_MODE_REG, ALTERA_PLL_MODE_PLLNG_MD_VAL, 0);
}
int ALTERA_PLL_SetOuputFrequency (int clkIndex, int pllVCOFreqMhz, int value) {
@ -188,7 +220,7 @@ int ALTERA_PLL_SetOuputFrequency (int clkIndex, int pllVCOFreqMhz, int value) {
FILE_LOG(logDEBUG1, ("C%d word:0x%08x\n", clkIndex, val));
// write frequency (post-scale output counter C)
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_C_COUNTER_REG, val);
ALTERA_PLL_SetPllReconfigReg(ALTERA_PLL_C_COUNTER_REG, val, 0);
// reset required to keep the phase (must reconfigure adcs again after this as adc clock is stopped temporarily when resetting pll)
ALTERA_PLL_ResetPLL ();

View File

@ -0,0 +1,414 @@
#include "readDefaultPattern.h"
#include "sls_detector_defs.h"
#include "slsDetectorServer_defs.h"
#include "ansi.h"
#include "clogger.h"
#include <string.h>
extern char initErrorMessage[MAX_STR_LENGTH];
extern int initError;
extern uint64_t writePatternIOControl(uint64_t word);
extern uint64_t writePatternClkControl(uint64_t word);
extern uint64_t writePatternWord(int addr, uint64_t word);
extern int setPatternWaitAddress(int level, int addr);
extern uint64_t setPatternWaitTime(int level, uint64_t t);
extern void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop);
int loadDefaultPattern(char* fname) {
if (initError == FAIL) {
return initError;
}
FILE* fd = fopen(fname, "r");
if(fd == NULL) {
sprintf(initErrorMessage, "Could not open pattern file [%s].\n", fname);
initError = FAIL;
FILE_LOG(logERROR, ("%s\n\n", initErrorMessage));
return FAIL;
}
FILE_LOG(logINFOBLUE, ("Reading default pattern file %s\n", fname));
// Initialization
const size_t LZ = 256;
char line[LZ];
memset(line, 0, LZ);
char command[LZ];
// keep reading a line
while (fgets(line, LZ, fd)) {
// ignore comments
if (line[0] == '#') {
FILE_LOG(logDEBUG1, ("Ignoring Comment\n"));
continue;
}
// ignore empty lines
if (strlen(line) <= 1) {
FILE_LOG(logDEBUG1, ("Ignoring Empty line\n"));
continue;
}
FILE_LOG(logDEBUG1, ("Command to process: (size:%d) %.*s\n",
strlen(line), strlen(line) -1, line));
memset(command, 0, LZ);
// patword
if (!strncmp(line, "patword", strlen("patword"))) {
uint32_t addr = 0;
uint64_t word = 0;
// cannot scan values
if (sscanf(line, "%s 0x%x 0x%llx", command, &addr, &word) != 3) {
sprintf(initErrorMessage, "Could not scan patword arguments from default "
"pattern file. Line:[%s].\n", line);
break;
}
if (default_writePatternWord(line, addr, word) == FAIL) {
break;
}
}
// patioctrl
if (!strncmp(line, "patioctrl", strlen("patioctrl"))) {
uint64_t arg = 0;
// cannot scan values
if (sscanf(line, "%s 0x%llx", command, &arg) != 2) {
sprintf(initErrorMessage, "Could not scan patioctrl arguments from default "
"pattern file. Line:[%s].\n", line);
break;
}
if (default_writePatternIOControl(line, arg) == FAIL) {
break;
}
}
// patclkctrl
if (!strncmp(line, "patclkctrl", strlen("patclkctrl"))) {
uint64_t arg = 0;
// cannot scan values
if (sscanf(line, "%s 0x%llx", command, &arg) != 2) {
sprintf(initErrorMessage, "Could not scan patclkctrl arguments from default "
"pattern file. Line:[%s].\n", line);
break;
}
if (default_writePatternClkControl(line, arg) == FAIL) {
break;
}
}
// patlimits
if (!strncmp(line, "patlimits", strlen("patlimits"))) {
uint32_t startAddr = 0;
uint32_t stopAddr = 0;
// cannot scan values
if (sscanf(line, "%s 0x%x 0x%x", command, &startAddr, &stopAddr) != 3) {
sprintf(initErrorMessage, "Could not scan patlimits arguments from default "
"pattern file. Line:[%s].\n", line);
break;
}
if (default_setPatternLoopLimits(line, startAddr, stopAddr) == FAIL) {
break;
}
}
// patloop
if ((!strncmp(line, "patloop0", strlen("patloop0"))) ||
(!strncmp(line, "patloop1", strlen("patloop1"))) ||
(!strncmp(line, "patloop2", strlen("patloop2")))) {
// level
int level = -1;
if (!strncmp(line, "patloop0", strlen("patloop0"))) {
level = 0;
} else if (!strncmp(line, "patloop1", strlen("patloop1"))) {
level = 1;
} else {
level = 2;
}
uint32_t startAddr = 0;
uint32_t stopAddr = 0;
// cannot scan values
if (sscanf(line, "%s 0x%x 0x%x", command, &startAddr, &stopAddr) != 3) {
sprintf(initErrorMessage, "Could not scan patloop%d arguments from default "
"pattern file. Line:[%s].\n", level, line);
break;
}
if (default_setPatternLoopAddresses(line, level, startAddr, stopAddr) == FAIL) {
break;
}
}
// patnloop
if ((!strncmp(line, "patnloop0", strlen("patnloop0"))) ||
(!strncmp(line, "patnloop1", strlen("patnloop1"))) ||
(!strncmp(line, "patnloop2", strlen("patnloop2")))) {
// level
int level = -1;
if (!strncmp(line, "patnloop0", strlen("patnloop0"))) {
level = 0;
} else if (!strncmp(line, "patnloop1", strlen("patnloop1"))) {
level = 1;
} else {
level = 2;
}
int numLoops = -1;
// cannot scan values
if (sscanf(line, "%s %d", command, &numLoops) != 2) {
sprintf(initErrorMessage, "Could not scan patnloop%d arguments from default "
"pattern file. Line:[%s].\n", level, line);
break;
}
if (default_setPatternLoopCycles(line, level, numLoops) == FAIL) {
break;
}
}
// patwait
if ((!strncmp(line, "patwait0", strlen("patwait0"))) ||
(!strncmp(line, "patwait1", strlen("patwait1"))) ||
(!strncmp(line, "patwait2", strlen("patwait2")))) {
// level
int level = -1;
if (!strncmp(line, "patwait0", strlen("patwait0"))) {
level = 0;
} else if (!strncmp(line, "patwait1", strlen("patwait1"))) {
level = 1;
} else {
level = 2;
}
uint32_t addr = 0;
// cannot scan values
if (sscanf(line, "%s 0x%x", command, &addr) != 2) {
sprintf(initErrorMessage, "Could not scan patwait%d arguments from default "
"pattern file. Line:[%s].\n", level, line);
break;
}
if (default_setPatternWaitAddresses(line, level, addr) == FAIL) {
break;
}
}
// patwaittime
if ((!strncmp(line, "patwaittime0", strlen("patwaittime0"))) ||
(!strncmp(line, "patwaittime1", strlen("patwaittime1"))) ||
(!strncmp(line, "patwaittime2", strlen("patwaittime2")))) {
// level
int level = -1;
if (!strncmp(line, "patwaittime0", strlen("patwaittime0"))) {
level = 0;
} else if (!strncmp(line, "patwaittime1", strlen("patwaittime1"))) {
level = 1;
} else {
level = 2;
}
uint64_t waittime = 0;
// cannot scan values
if (sscanf(line, "%s %lld", command, &waittime) != 2) {
sprintf(initErrorMessage, "Could not scan patwaittime%d arguments from default "
"pattern file. Line:[%s].\n", level, line);
break;
}
if (default_setPatternWaitTime(line, level, waittime) == FAIL) {
break;
}
}
memset(line, 0, LZ);
}
fclose(fd);
if (strlen(initErrorMessage)) {
initError = FAIL;
FILE_LOG(logERROR, ("%s\n\n", initErrorMessage));
} else {
FILE_LOG(logINFOBLUE, ("Successfully read default pattern file\n"));
}
return initError;
}
int default_writePatternWord(char* line, uint32_t addr, uint64_t word) {
//validations
if (addr < 0 || addr >= MAX_PATTERN_LENGTH) {
sprintf(initErrorMessage, "Cannot set pattern word from default "
"pattern file. Addr must be between 0 and 0x%x. Line:[%s]\n",
MAX_PATTERN_LENGTH, line);
return FAIL;
}
writePatternWord(addr, word);
// cannot validate for moench, ctb ( same as executing pattern word)
return OK;
}
int default_writePatternIOControl(char* line, uint64_t arg) {
uint64_t retval = writePatternIOControl(arg);
if (retval != arg) {
sprintf(initErrorMessage, "Could not set patioctrl from default pattern "
"file. Set 0x%llx, read 0x%llx. Line:[%s]\n", arg, retval, line);
return FAIL;
}
return OK;
}
int default_writePatternClkControl(char* line, uint64_t arg) {
uint64_t retval = writePatternClkControl(arg);
if (retval != arg) {
sprintf(initErrorMessage, "Could not set patclkctrl from default pattern "
"file. Set 0x%llx, read 0x%llx. Line:[%s]\n", arg, retval, line);
return FAIL;
}
return OK;
}
int default_setPatternLoopLimits(char* line, uint32_t startAddr, uint32_t stopAddr) {
//validations
if (startAddr < 0 || startAddr >= MAX_PATTERN_LENGTH ||
stopAddr < 0 || stopAddr >= MAX_PATTERN_LENGTH) {
sprintf(initErrorMessage, "Cannot set patlimits from default "
"pattern file. Addr must be between 0 and 0x%x. Line:[%s]\n",
MAX_PATTERN_LENGTH, line);
return FAIL;
}
int numLoops = -1;
int r_startAddr = startAddr, r_stopAddr = stopAddr;
setPatternLoop(-1, &r_startAddr, &r_stopAddr, &numLoops);
// validate
if (r_startAddr != startAddr || r_stopAddr != stopAddr) {
sprintf(initErrorMessage, "Could not set patlimits from default pattern "
"file. Read start addr:0x%x, stop addr: 0x%x. Line:[%s]\n",
r_startAddr, r_stopAddr, line);
return FAIL;
}
return OK;
}
int default_setPatternLoopAddresses(char* line, int level, uint32_t startAddr, uint32_t stopAddr) {
//validations
if (level < 0 || level > 2) {
sprintf(initErrorMessage, "Cannot set patloop from default "
"pattern file. Level must be between 0 and 2. Line:[%s]\n",
line);
return FAIL;
}
if (startAddr < 0 || startAddr >= MAX_PATTERN_LENGTH ||
stopAddr < 0 || stopAddr >= MAX_PATTERN_LENGTH) {
sprintf(initErrorMessage, "Cannot set patloop (level: %d) from default "
"pattern file. Addr must be between 0 and 0x%x. Line:[%s]\n",
level, MAX_PATTERN_LENGTH, line);
return FAIL;
}
int numLoops = -1;
int r_startAddr = startAddr, r_stopAddr = stopAddr;
setPatternLoop(level, &r_startAddr, &r_stopAddr, &numLoops);
// validate
if (r_startAddr != startAddr || r_stopAddr != stopAddr) {
sprintf(initErrorMessage, "Could not set patloop (level: %d) from default "
"pattern file. Read start addr:0x%x, stop addr: 0x%x. Line:[%s]\n",
level, r_startAddr, r_stopAddr, line);
return FAIL;
}
return OK;
}
int default_setPatternLoopCycles(char* line, int level, int numLoops) {
//validations
if (level < 0 || level > 2) {
sprintf(initErrorMessage, "Cannot set patnloop from default "
"pattern file. Level must be between 0 and 2. Line:[%s]\n",
line);
return FAIL;
}
if (numLoops < 0) {
sprintf(initErrorMessage, "Cannot set patnloop from default "
"pattern file. Iterations must be between > 0. Line:[%s]\n",
line);
return FAIL;
}
int startAddr = -1;
int stopAddr = -1;
int r_numLoops = numLoops;
setPatternLoop(level, &startAddr, &stopAddr, &r_numLoops);
// validate
if (r_numLoops != numLoops) {
sprintf(initErrorMessage, "Could not set patnloop (level: %d) from default "
"pattern file. Read %d loops. Line:[%s]\n",
level, r_numLoops, line);
return FAIL;
}
return OK;
}
int default_setPatternWaitAddresses(char* line, int level, uint32_t addr) {
//validations
if (level < 0 || level > 2) {
sprintf(initErrorMessage, "Cannot set patwait address from default "
"pattern file. Level must be between 0 and 2. Line:[%s]\n",
line);
return FAIL;
}
if (addr < 0 || addr >= MAX_PATTERN_LENGTH) {
sprintf(initErrorMessage, "Cannot set patwait address (level: %d) from default "
"pattern file. Addr must be between 0 and 0x%x. Line:[%s]\n",
level, MAX_PATTERN_LENGTH, line);
return FAIL;
}
int retval = setPatternWaitAddress(level, addr);
// validate
if (retval != addr) {
sprintf(initErrorMessage, "Could not set patwait address (level: %d) from default "
"pattern file. Read addr: 0x%x. Line:[%s]\n",
level, retval, line);
return FAIL;
}
return OK;
}
int default_setPatternWaitTime(char* line, int level, uint64_t waittime) {
//validations
if (level < 0 || level > 2) {
sprintf(initErrorMessage, "Cannot set patwaittime from default "
"pattern file. Level must be between 0 and 2. Line:[%s]\n",
line);
return FAIL;
}
uint64_t retval = setPatternWaitTime(level, waittime);
// validate
if (retval != waittime) {
sprintf(initErrorMessage, "Could not set patwaittime (level: %d) from default "
"pattern file. Read %lld wait time. Line:[%s]\n",
level, retval, line);
return FAIL;
}
return OK;
}

View File

@ -2,13 +2,6 @@
#include "slsDetectorFunctionList.h"
#include "communication_funcs.h"
#include "clogger.h"
#ifndef VIRTUAL
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
#include "programFpgaNios.h"
#elif defined(CHIPTESTBOARDD) || defined(JUNGFRAUD) || defined(MOENCHD)
#include "programFpgaBlackfin.h"
#endif
#endif
#include <string.h>
#include <arpa/inet.h>
@ -928,10 +921,35 @@ int set_dac(int file_des) {
case V_LIMIT:
break;
#elif MOENCHD
case VBP_COLBUF:
serverDacIndex = MO_VBP_COLBUF;
break;
case VIPRE:
serverDacIndex = MO_VIPRE;
break;
case VIN_CM:
serverDacIndex = MO_VIN_CM;
break;
case VB_SDA:
serverDacIndex = MO_VB_SDA;
break;
case VCASC_SFP:
serverDacIndex = MO_VCASC_SFP;
break;
case VOUT_CM:
serverDacIndex = MO_VOUT_CM;
break;
case VIPRE_CDS:
serverDacIndex = MO_VIPRE_CDS;
break;
case IBIAS_SFP:
serverDacIndex = MO_IBIAS_SFP;
break;
case ADC_VPP:
case HIGH_VOLTAGE:
case V_LIMIT:
break;
#elif MYTHEN3D
case HIGH_VOLTAGE:
break;
@ -1056,17 +1074,13 @@ int set_dac(int file_des) {
serverDacIndex = J_VREF_COMP;
break;
#endif
default:
#ifdef CHIPTESTBOARDD
if (ind < NDAC_ONLY) {
serverDacIndex = ind;
break;
}
#elif MOENCHD
if (ind < NDAC) {
serverDacIndex = ind;
break;
}
#endif
modeNotImplemented("Dac Index", (int)ind);
break;
@ -1656,7 +1670,7 @@ int set_settings(int file_des) {
if (receiveData(file_des, &isett, sizeof(isett), INT32) < 0)
return printSocketReadError();
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
#if defined(CHIPTESTBOARDD) || defined(MYTHEN3D)
functionNotImplemented();
#else
FILE_LOG(logDEBUG1, ("Setting settings %d\n", isett));
@ -1684,6 +1698,15 @@ int set_settings(int file_des) {
case DYNAMICGAIN:
case FIXGAIN1:
case FIXGAIN2:
#elif MOENCHD
case G1_HIGHGAIN:
case G1_LOWGAIN:
case G2_HIGHCAP_HIGHGAIN:
case G2_HIGHCAP_LOWGAIN:
case G2_LOWCAP_HIGHGAIN:
case G2_LOWCAP_LOWGAIN:
case G4_HIGHGAIN:
case G4_LOWGAIN:
#endif
break;
default:
@ -1750,18 +1773,23 @@ int start_acquisition(int file_des) {
FILE_LOG(logDEBUG1, ("Starting Acquisition\n"));
// only set
if (Server_VerifyLock() == OK) {
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
int mode = getReadoutMode();
int asamples = getNumAnalogSamples();
int dsamples = getNumDigitalSamples();
if ((mode == ANALOG_AND_DIGITAL || mode == ANALOG_ONLY) && (asamples <= 0)) {
#if defined(MOENCHD)
if (getNumAnalogSamples() <= 0) {
ret = FAIL;
sprintf(mess, "Could not start acquisition. Invalid number of analog samples: %d.\n", asamples);
sprintf(mess, "Could not start acquisition. Invalid number of analog samples: %d.\n", getNumAnalogSamples());
FILE_LOG(logERROR,(mess));
}
else if ((mode == ANALOG_AND_DIGITAL || mode == DIGITAL_ONLY) && (dsamples <= 0)) {
else
#endif
#if defined(CHIPTESTBOARDD)
if ((getReadoutMode() == ANALOG_AND_DIGITAL || getReadoutMode() == ANALOG_ONLY) && (getNumAnalogSamples() <= 0)) {
ret = FAIL;
sprintf(mess, "Could not start acquisition. Invalid number of digital samples: %d.\n", dsamples);
sprintf(mess, "Could not start acquisition. Invalid number of analog samples: %d.\n", getNumAnalogSamples());
FILE_LOG(logERROR,(mess));
}
else if ((getReadoutMode() == ANALOG_AND_DIGITAL || getReadoutMode() == DIGITAL_ONLY) && (getNumDigitalSamples() <= 0)) {
ret = FAIL;
sprintf(mess, "Could not start acquisition. Invalid number of digital samples: %d.\n", getNumDigitalSamples());
FILE_LOG(logERROR,(mess));
}
else
@ -1880,18 +1908,23 @@ int start_and_read_all(int file_des) {
FILE_LOG(logDEBUG1, ("Starting Acquisition\n"));
// only set
if (Server_VerifyLock() == OK) {
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
int mode = getReadoutMode();
int asamples = getNumAnalogSamples();
int dsamples = getNumDigitalSamples();
if ((mode == ANALOG_AND_DIGITAL || mode == ANALOG_ONLY) && (asamples <= 0)) {
#if defined(MOENCHD)
if (getNumAnalogSamples() <= 0) {
ret = FAIL;
sprintf(mess, "Could not start acquisition. Invalid number of analog samples: %d.\n", asamples);
sprintf(mess, "Could not start acquisition. Invalid number of analog samples: %d.\n", getNumAnalogSamples());
FILE_LOG(logERROR,(mess));
}
else if ((mode == ANALOG_AND_DIGITAL || mode == DIGITAL_ONLY) && (dsamples <= 0)) {
else
#endif
#if defined(CHIPTESTBOARDD)
if ((getReadoutMode() == ANALOG_AND_DIGITAL || getReadoutMode() == ANALOG_ONLY) && (getNumAnalogSamples() <= 0)) {
ret = FAIL;
sprintf(mess, "Could not start acquisition. Invalid number of digital samples: %d.\n", dsamples);
sprintf(mess, "Could not start acquisition. Invalid number of analog samples: %d.\n", getNumAnalogSamples());
FILE_LOG(logERROR,(mess));
}
else if ((getReadoutMode() == ANALOG_AND_DIGITAL || getReadoutMode() == DIGITAL_ONLY) && (getNumDigitalSamples() <= 0)) {
ret = FAIL;
sprintf(mess, "Could not start acquisition. Invalid number of digital samples: %d.\n", getNumDigitalSamples());
FILE_LOG(logERROR,(mess));
}
else
@ -2102,14 +2135,23 @@ int set_num_analog_samples(int file_des) {
#else
// only set
if (Server_VerifyLock() == OK) {
ret = setNumAnalogSamples(arg);
if (ret == FAIL) {
sprintf(mess, "Could not set number of analog samples to %d. Could not allocate RAM\n", arg);
#ifdef MOENCHD
if (arg % NSAMPLES_PER_ROW != 0) {
ret = FAIL;
sprintf(mess, "Could not set number of analog samples to %d. Must be divisible by %d\n", arg, NSAMPLES_PER_ROW);
FILE_LOG(logERROR,(mess));
} else {
int retval = getNumAnalogSamples();
FILE_LOG(logDEBUG1, ("retval num analog samples %d\n", retval));
validate(arg, retval, "set number of analog samples", DEC);
}
#endif
if (ret == OK) {
ret = setNumAnalogSamples(arg);
if (ret == FAIL) {
sprintf(mess, "Could not set number of analog samples to %d. Could not allocate RAM\n", arg);
FILE_LOG(logERROR,(mess));
} else {
int retval = getNumAnalogSamples();
FILE_LOG(logDEBUG1, ("retval num analog samples %d\n", retval));
validate(arg, retval, "set number of analog samples", DEC);
}
}
}
#endif
@ -2121,7 +2163,7 @@ int get_num_digital_samples(int file_des) {
memset(mess, 0, sizeof(mess));
int retval = -1;
#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD)
#if !defined(CHIPTESTBOARDD)
functionNotImplemented();
#else
// get only
@ -2140,7 +2182,7 @@ int set_num_digital_samples(int file_des) {
return printSocketReadError();
FILE_LOG(logDEBUG1, ("Setting number of digital samples %d\n", arg));
#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD)
#if !defined(CHIPTESTBOARDD)
functionNotImplemented();
#else
// only set
@ -2785,7 +2827,7 @@ int send_update(int file_des) {
if (n < 0) return printSocketReadError();
// settings
#if defined(EIGERD) || defined(JUNGFRAUD) || defined(GOTTHARDD)
#if defined(EIGERD) || defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(GOTTHARD2D)|| defined(MOENCHD)
i32 = (int)getSettings();
n = sendData(file_des,&i32,sizeof(i32),INT32);
if (n < 0) return printSocketReadError();
@ -2856,10 +2898,16 @@ int send_update(int file_des) {
#endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
// analog samples
i32 = getNumAnalogSamples();
n = sendData(file_des,&i32,sizeof(i32),INT32);
if (n < 0) return printSocketReadError();
// 1g adcmask
i32 = getADCEnableMask();
n = sendData(file_des,&i32,sizeof(i32),INT32);
if (n < 0) return printSocketReadError();
// 10g adc mask
i32 = getADCEnableMask_10G();
n = sendData(file_des,&i32,sizeof(i32),INT32);
@ -4237,7 +4285,7 @@ int led(int file_des) {
return printSocketReadError();
FILE_LOG(logDEBUG1, ("Setting led enable to %d\n", arg));
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
#if (!defined(CHIPTESTBOARDD))
functionNotImplemented();
#else
// set & get
@ -4262,7 +4310,7 @@ int digital_io_delay(int file_des) {
return printSocketReadError();
FILE_LOG(logDEBUG1, ("Digital IO Delay, pinMask: 0x%llx, delay:%d ps\n", args[0], (int)args[1]));
#if (!defined(MOENCHD)) && (!defined(CHIPTESTBOARDD))
#if (!defined(CHIPTESTBOARDD))
functionNotImplemented();
#else
// only set
@ -5854,7 +5902,7 @@ int set_clock_phase(int file_des) {
c = ADC_CLK;
break;
#endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(JUNGFRAUD)
case DBIT_CLOCK:
c = DBIT_CLK;
break;
@ -5947,8 +5995,6 @@ int get_clock_phase(int file_des) {
case ADC_CLOCK:
c = ADC_CLK;
break;
#endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
case DBIT_CLOCK:
c = DBIT_CLK;
break;
@ -5993,8 +6039,6 @@ int get_max_clock_phase_shift(int file_des) {
case ADC_CLOCK:
c = ADC_CLK;
break;
#endif
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
case DBIT_CLOCK:
c = DBIT_CLK;
break;
@ -6169,9 +6213,11 @@ int set_pipeline(int file_des) {
case ADC_CLOCK:
c = ADC_CLK;
break;
#ifdef CHIPTESTBOARDD
case DBIT_CLOCK:
c = DBIT_CLK;
break;
#endif
default:
modeNotImplemented("clock index (pipeline set)", ind);
break;

View File

@ -101,6 +101,8 @@ class Detector {
/** [Jungfrau] Options:DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2
* [Gotthard] Options: DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN
* [Gotthard2] Options: DYNAMICGAIN, FIXGAIN1, FIXGAIN2
* [Moench] Options: G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN,
* G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN
*/
void setSettings(defs::detectorSettings value, Positions pos = {});
@ -155,32 +157,32 @@ class Detector {
void setPeriod(ns t, Positions pos = {});
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */
Result<ns> getDelayAfterTrigger(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */
void setDelayAfterTrigger(ns value, Positions pos = {});
/** [Gotthard][Jungfrau][CTB][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
Result<int64_t> getNumberOfFramesLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
Result<int64_t> getNumberOfTriggersLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
Result<ns> getPeriodLeft(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
/**
* [Gotthard][Jungfrau][CTB] Options: AUTO_TIMING, TRIGGER_EXPOSURE
* [Gotthard][Jungfrau][CTB][Moench] Options: AUTO_TIMING, TRIGGER_EXPOSURE
* [Eiger] Options: AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
*/
void setTimingMode(defs::timingMode value, Positions pos = {});
@ -192,21 +194,36 @@ class Detector {
* Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED */
void setSpeed(defs::speedLevel value, Positions pos = {});
/** [Gotthard][Jungfrau][CTB] */
/** [Gotthard][Jungfrau][CTB][Moench] */
Result<int> getADCPhase(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] */
/** [Gotthard][Jungfrau][CTB][Moench] */
void setADCPhase(int value, Positions pos = {});
/** [Jungfrau][CTB] */
/** [Jungfrau][CTB][Moench] */
Result<int> getMaxADCPhaseShift(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] */
/** [Gotthard][Jungfrau][CTB][Moench] */
Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] */
/** [Gotthard][Jungfrau][CTB][Moench] */
void setADCPhaseInDegrees(int value, Positions pos = {});
/** [CTB][Jungfrau] */
Result<int> getDBITPhase(Positions pos = {}) const;
/** [CTB][Jungfrau] */
void setDBITPhase(int value, Positions pos = {});
/** [CTB][Jungfrau] */
Result<int> getMaxDBITPhaseShift(Positions pos = {}) const;
/** [CTB][Jungfrau] */
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
/** [CTB][Jungfrau] */
void setDBITPhaseInDegrees(int value, Positions pos = {});
/** [Mythen3][Gotthard2] Hz */
Result<int> getClockFrequency(int clkIndex, Positions pos = {});
@ -236,15 +253,15 @@ class Detector {
Result<int> getHighVoltage(Positions pos = {}) const;
/** [Jungfrau][Mythen3][Gotthard2] */
/** [Jungfrau][Mythen3][Gotthard2][Moench] */
Result<bool> getPowerChip(Positions pos = {}) const;
/** [Jungfrau][Mythen3][Gotthard2] */
/** [Jungfrau][Mythen3][Gotthard2][Moench] */
void setPowerChip(bool on, Positions pos = {});
/**
* [Gotthard] Options: 0, 90, 110, 120, 150, 180, 200
* [Jungfrau], CTB Options: 0, 60 - 200
* [Jungfrau][CTB][Moench] Options: 0, 60 - 200
* [Eiger][Mythen3][Gotthard2] Options: 0 - 200
*/
void setHighVoltage(int value, Positions pos = {});
@ -415,10 +432,10 @@ class Detector {
Result<std::string> printRxConfiguration(Positions pos = {}) const;
/** [Eiger][CTB] */
/** [Eiger][CTB][Moench] */
Result<bool> getTenGiga(Positions pos = {}) const;
/** [Eiger][CTB] */
/** [Eiger][CTB][Moench] */
void setTenGiga(bool value, Positions pos = {});
/** [Eiger, Jungfrau] */
@ -954,18 +971,67 @@ class Detector {
/** [Mythen3] countermask bit set for each counter enabled */
void setCounterMask(uint32_t countermask, Positions pos = {});
/**************************************************
* *
* CTB / Moench Specific *
* *
* ************************************************/
/** [CTB][Moench] */
Result<int> getNumberOfAnalogSamples(Positions pos = {}) const;
/** [CTB][Moench] */
void setNumberOfAnalogSamples(int value, Positions pos = {});
/** [CTB][Moench] */
Result<int> getADCClock(Positions pos = {}) const;
/** [CTB][Moench] */
void setADCClock(int value_in_MHz, Positions pos = {});
/** [CTB][Moench] */
Result<int> getRUNClock(Positions pos = {}) const;
/** [CTB][Moench] */
void setRUNClock(int value_in_MHz, Positions pos = {});
/** [CTB][Moench] */
Result<int> getSYNCClock(Positions pos = {}) const;
/** [CTB][Moench] */
Result<int> getADCPipeline(Positions pos = {}) const;
/** [CTB][Moench] */
void setADCPipeline(int value, Positions pos = {});
/** [CTB][Moench] */
Result<int> getVoltage(defs::dacIndex index, Positions pos = {}) const;
/**
* [CTB][Moench] mV
* [Ctb] Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
* V_POWER_D, V_POWER_IO, V_POWER_CHIP
* [Moench] Options: V_LIMIT
*/
void setVoltage(defs::dacIndex index, int value, Positions pos = {});
/** [CTB][Moench] */
Result<uint32_t> getADCEnableMask(Positions pos = {}) const;
/** [CTB][Moench] */
void setADCEnableMask(uint32_t mask, Positions pos = {});
/** [CTB][Moench] */
Result<uint32_t> getTenGigaADCEnableMask(Positions pos = {}) const;
/** [CTB][Moench] */
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
/**************************************************
* *
* CTB Specific *
* *
* ************************************************/
/** [CTB] */
Result<int> getNumberOfAnalogSamples(Positions pos = {}) const;
/** [CTB] */
void setNumberOfAnalogSamples(int value, Positions pos = {});
/** [CTB] */
Result<int> getNumberOfDigitalSamples(Positions pos = {}) const;
@ -978,64 +1044,18 @@ class Detector {
/** [CTB] Options: ANALOG_ONLY = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL */
void setReadoutMode(defs::readoutMode value, Positions pos = {});
/** [CTB] */
Result<int> getDBITPhase(Positions pos = {}) const;
/** [CTB] */
void setDBITPhase(int value, Positions pos = {});
/** [CTB] */
Result<int> getMaxDBITPhaseShift(Positions pos = {}) const;
/** [CTB] */
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
/** [CTB] */
void setDBITPhaseInDegrees(int value, Positions pos = {});
/** [CTB] */
Result<int> getADCClock(Positions pos = {}) const;
/** [CTB] */
void setADCClock(int value_in_MHz, Positions pos = {});
/** [CTB] */
Result<int> getDBITClock(Positions pos = {}) const;
/** [CTB] */
void setDBITClock(int value_in_MHz, Positions pos = {});
/** [CTB] */
Result<int> getRUNClock(Positions pos = {}) const;
/** [CTB] */
void setRUNClock(int value_in_MHz, Positions pos = {});
/** [CTB] */
Result<int> getSYNCClock(Positions pos = {}) const;
/** [CTB] */
Result<int> getADCPipeline(Positions pos = {}) const;
/** [CTB] */
void setADCPipeline(int value, Positions pos = {});
/** [CTB] */
Result<int> getDBITPipeline(Positions pos = {}) const;
/** [CTB] */
void setDBITPipeline(int value, Positions pos = {});
/** [CTB] */
Result<int> getVoltage(defs::dacIndex index, Positions pos = {}) const;
/**
* [CTB] mV
* Options: V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
* V_POWER_D, V_POWER_IO, V_POWER_CHIP
*/
void setVoltage(defs::dacIndex index, int value, Positions pos = {});
/**
* [CTB] mV
* Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */
@ -1051,24 +1071,6 @@ class Detector {
/** [CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
/** [CTB]*/
Result<uint32_t> getADCEnableMask(Positions pos = {}) const;
/** [CTB]*/
void setADCEnableMask(uint32_t mask, Positions pos = {});
/** [CTB]*/
Result<uint32_t> getTenGigaADCEnableMask(Positions pos = {}) const;
/** [CTB]*/
void setTenGigaADCEnableMask(uint32_t mask, Positions pos = {});
/** [CTB] */
Result<uint32_t> getADCInvert(Positions pos = {}) const;
/** [CTB]*/
void setADCInvert(uint32_t value, Positions pos = {});
/** [CTB] */
Result<int> getExternalSamplingSource(Positions pos = {}) const;
@ -1113,72 +1115,71 @@ class Detector {
* *
* ************************************************/
/** [CTB] */
/** [CTB][Moench][Mythen3] */
void setPattern(const std::string &fname, Positions pos = {});
/** [CTB] */
/** [CTB][Moench][Mythen3] */
void savePattern(const std::string &fname);
/** [CTB] */
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternIOControl(Positions pos = {}) const;
/** [CTB] */
/** [CTB][Moench][Mythen3] */
void setPatternIOControl(uint64_t word, Positions pos = {});
/** [CTB] */
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternClockControl(Positions pos = {}) const;
/** [CTB] */
/** [CTB][Moench][Mythen3] */
void setPatternClockControl(uint64_t word, Positions pos = {});
/** [CTB] same as executing
* [Mythen3] */
/** [CTB][Moench][Mythen3] same as executing for ctb and moench */
Result<uint64_t> getPatternWord(int addr, Positions pos = {});
/** [CTB] Caution: If word is -1 reads the addr (same as
* executing the pattern)
* [Mythen3] */
* [Mythen3][Moench] */
void setPatternWord(int addr, uint64_t word, Positions pos = {});
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels
/**[CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels
* @returns array of start address and stop address
*/
Result<std::array<int, 2>> getPatternLoopAddresses(int level,
Positions pos = {}) const;
/** [CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels */
/** [CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels */
void setPatternLoopAddresses(int level, int start, int stop, Positions pos = {});
/**[CTB][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels
/**[CTB][Moench][Mythen3] Options: level: -1 (complete pattern) and 0-2 levels
* @returns number of loops
*/
Result<int> getPatternLoopCycles(int level, Positions pos = {}) const;
/** [CTB][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2 levels */
/** [CTB][Moench][Mythen3] n: 0-2, level: -1 (complete pattern) and 0-2 levels */
void setPatternLoopCycles(int level, int n, Positions pos = {});
/* [CTB][Mythen3] */
/* [CTB][Moench][Mythen3] */
Result<int> getPatternWaitAddr(int level, Positions pos = {}) const;
/** [CTB][Mythen3] Options: level 0-2 */
/** [CTB][Moench][Mythen3] Options: level 0-2 */
void setPatternWaitAddr(int level, int addr, Positions pos = {});
/** [CTB][Mythen3] */
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternWaitTime(int level, Positions pos = {}) const;
/** [CTB][Mythen3] Options: level 0-2 */
/** [CTB][Moench][Mythen3] Options: level 0-2 */
void setPatternWaitTime(int level, uint64_t t, Positions pos = {});
/** [CTB][Mythen3] */
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternMask(Positions pos = {});
/** [CTB][Mythen3] Sets the mask applied to every pattern to the selected bit mask */
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the selected bit mask */
void setPatternMask(uint64_t mask, Positions pos = {});
/** [CTB][Mythen3] */
/** [CTB][Moench][Mythen3] */
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
/** [CTB][Mythen3] Sets the bitmask that the mask will be applied to for every
/** [CTB][Moench][Mythen3] Sets the bitmask that the mask will be applied to for every
* pattern
*/
void setPatternBitMask(uint64_t mask, Positions pos = {});
@ -1238,26 +1239,26 @@ class Detector {
* *
* ************************************************/
/** [Jungfrau][CTB] fname is a pof file
/** [Jungfrau][CTB][Moench] fname is a pof file
* [Mythen3][Gotthard2] fname is an rbf file
*/
void programFPGA(const std::string &fname, Positions pos = {});
/** [Jungfrau][CTB] */
/** [Jungfrau][CTB][Moench] */
void resetFPGA(Positions pos = {});
/** [Jungfrau][Gotthard][CTB]
/** [Jungfrau][Gotthard][CTB][Moench]
* Copy detector server fname from tftp folder of hostname to detector
* Also changes respawn server, which is effective after a reboot.
*/
void copyDetectorServer(const std::string &fname,
const std::string &hostname, Positions pos = {});
/** [Jungfrau][Gotthard][CTB][Mythen3][Gotthard2] */
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] */
void rebootController(Positions pos = {});
/**
* [Jungfrau][Gotthard][CTB]
* [Jungfrau][Gotthard][CTB][Moench]
* Updates the firmware, detector server and then reboots detector
* controller blackfin.
* @param sname name of detector server binary found on tftp folder of host
@ -1278,13 +1279,13 @@ class Detector {
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] */
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] */
void executeFirmwareTest(Positions pos = {});
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] */
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] */
void executeBusTest(Positions pos = {});
/** [Gotthard][Jungfrau][CTB] not possible to read back*/
/** [Gotthard][Jungfrau][CTB][Moench] not possible to read back*/
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
bool getInitialChecks() const;
@ -1293,6 +1294,12 @@ class Detector {
* default enabled */
void setInitialChecks(const bool value);
/** [CTB][Moench][Jungfrau] */
Result<uint32_t> getADCInvert(Positions pos = {}) const;
/** [CTB][Moench][Jungfrau] */
void setADCInvert(uint32_t value, Positions pos = {});
/**************************************************
* *
* Insignificant *
@ -1321,15 +1328,15 @@ class Detector {
/** Execute a command on the detector server console */
void executeCommand(const std::string &value, Positions pos = {});
/** [Jungfrau][Mythen3][CTB]
/** [Jungfrau][Mythen3][CTB][Moench]
* [Gotthard2] only in continuous mode */
Result<int64_t> getNumberOfFramesFromStart(Positions pos = {}) const;
/** [Jungfrau][Mythen3][CTB] Get time from detector start
/** [Jungfrau][Mythen3][CTB][Moench] Get time from detector start
* [Gotthard2] only in continuous mode */
Result<ns> getActualTime(Positions pos = {}) const;
/** [Jungfrau][Mythen3][CTB] Get timestamp at a frame start
/** [Jungfrau][Mythen3][CTB][Moench] Get timestamp at a frame start
* [Gotthard2] only in continuous mode */
Result<ns> getMeasurementTime(Positions pos = {}) const;

View File

@ -395,10 +395,10 @@ std::string CmdProxy::Adcphase(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Jungfrau][Ctb][Gotthard] Phase "
os << "[n_value] [(optional)deg]\n\t[Jungfrau][Ctb][Moench][Moench][Gotthard] Phase "
"shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. If deg "
"used, then shift in degrees. Changing Speed also resets "
"adcphase to recommended defaults.\n\t[Ctb] Absolute phase "
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute phase "
"shift. If deg used, then shift in degrees. Changing adcclk also "
"resets adcphase and sets it to previous values.\n\t[Gotthard] "
"Relative phase shift"
@ -438,6 +438,50 @@ std::string CmdProxy::Adcphase(int action) {
return os.str();
}
std::string CmdProxy::Dbitphase(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of clock to "
"latch digital bits. Absolute phase shift. If deg used, then "
"shift in degrees. \n\t[Ctb]Changing dbitclk also resets dbitphase and "
"sets to previous values."
<< '\n';
} else if (action == defs::GET_ACTION) {
Result<int> t;
if (args.empty()) {
t = det->getDBITPhase({det_id});
os << OutString(t) << '\n';
} else if (args.size() == 1) {
if (args[0] != "deg") {
throw sls::RuntimeError("Unknown dbitphase argument " +
args[0] + ". Did you mean deg?");
}
t = det->getDBITPhaseInDegrees({det_id});
os << OutString(t) << " deg\n";
} else {
WrongNumberOfParameters(0);
}
} else if (action == defs::PUT_ACTION) {
if (args.size() == 1) {
det->setDBITPhase(std::stoi(args[0]), {det_id});
os << args.front() << '\n';
} else if (args.size() == 2) {
if (args[1] != "deg") {
throw sls::RuntimeError("Unknown dbitphase 2nd argument " +
args[1] + ". Did you mean deg?");
}
det->setDBITPhaseInDegrees(std::stoi(args[0]), {det_id});
os << args[0] << args[1] << '\n';
} else {
WrongNumberOfParameters(1);
}
} else {
throw sls::RuntimeError("Unknown action");
}
return os.str();
}
std::string CmdProxy::ClockFrequency(int action) {
std::ostringstream os;
os << cmd << ' ';
@ -448,7 +492,7 @@ std::string CmdProxy::ClockFrequency(int action) {
} else {
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
throw sls::RuntimeError("Not implemented for this detector.");
throw sls::RuntimeError("clkfreq not implemented for this detector.");
}
if (action == defs::GET_ACTION) {
if (args.size() != 1) {
@ -482,7 +526,7 @@ std::string CmdProxy::ClockPhase(int action) {
} else {
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
throw sls::RuntimeError("Not implemented for this detector.");
throw sls::RuntimeError("clkphase not implemented for this detector.");
}
if (action == defs::GET_ACTION) {
if (args.size() == 1) {
@ -532,7 +576,7 @@ std::string CmdProxy::MaxClockPhaseShift(int action) {
} else {
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
throw sls::RuntimeError("Not implemented for this detector.");
throw sls::RuntimeError("maxclkphaseshift not implemented for this detector.");
}
if (action == defs::GET_ACTION) {
if (args.size() != 1) {
@ -559,7 +603,7 @@ std::string CmdProxy::ClockDivider(int action) {
} else {
defs::detectorType type = det->getDetectorType().squash(defs::GENERIC);
if (type != defs::GOTTHARD2 && type != defs::MYTHEN3) {
throw sls::RuntimeError("Not implemented for this detector.");
throw sls::RuntimeError("clkdiv not implemented for this detector.");
}
if (action == defs::GET_ACTION) {
if (args.size() != 1) {
@ -588,8 +632,10 @@ std::string CmdProxy::Dac(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[dac index] [dac or mv value] [(optional unit) mv] "
"\n\t[Ctb][Jungfrau] Dac."
"\n\t[Ctb] Dac."
<< '\n';
} else if (det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD) {
throw sls::RuntimeError("Dac command can only be used for chip test board. Use daclist to get list of dac commands for current detector.");
} else if (action == defs::GET_ACTION) {
bool mv = false;
if (args.size() == 2) {
@ -707,6 +753,11 @@ std::vector<std::string> CmdProxy::DacCommands() {
"vth1", "vicin", "vcas", "vpreamp", "vpl", "vipre",
"viinsh", "vph", "vtrim", "vdcsh"};
break;
case defs::MOENCH:
return std::vector<std::string>{"vbp_colbuf", "vipre", "vin_cm",
"vb_sda", "vcasc_sfp", "vout_cm",
"vipre_cds", "ibias_sfp"};
break;
case defs::CHIPTESTBOARD:
return std::vector<std::string>{
"dac 0", "dac 1", "dac 2", "dac 3", "dac 4", "dac 5",
@ -1316,26 +1367,29 @@ std::string CmdProxy::Counters(int action) {
return os.str();
}
/* CTB Specific */
/* CTB / Moench Specific */
std::string CmdProxy::Samples(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_samples]\n\t[CTB] Number of samples (both analog and "
"digitial) expected."
"digitial) expected.\n\t[Moench] Number of samples (analog only)"
<< '\n';
} else if (action == defs::GET_ACTION) {
if (!args.empty()) {
WrongNumberOfParameters(0);
}
auto a = det->getNumberOfAnalogSamples({det_id});
auto d = det->getNumberOfDigitalSamples({det_id});
int as = a.squash(-1);
int ds = d.squash(-1);
if (as == -1 || ds == -1 || as != ds) { // check if a == d?
throw sls::RuntimeError(
// get also digital samples for ctb and compare with analog
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
auto d = det->getNumberOfDigitalSamples({det_id});
int as = a.squash(-1);
int ds = d.squash(-1);
if (as == -1 || ds == -1 || as != ds) { // check if a == d?
throw sls::RuntimeError(
"Different samples. Use asamples or dsamples.");
}
}
os << OutString(a) << '\n';
} else if (action == defs::PUT_ACTION) {
@ -1343,7 +1397,10 @@ std::string CmdProxy::Samples(int action) {
WrongNumberOfParameters(1);
}
det->setNumberOfAnalogSamples(std::stoi(args[0]), {det_id});
det->setNumberOfDigitalSamples(std::stoi(args[0]), {det_id});
// set also digital samples for ctb
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
det->setNumberOfDigitalSamples(std::stoi(args[0]), {det_id});
}
os << args.front() << '\n';
} else {
throw sls::RuntimeError("Unknown action");
@ -1351,49 +1408,7 @@ std::string CmdProxy::Samples(int action) {
return os.str();
}
std::string CmdProxy::Dbitphase(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Ctb] Phase shift of clock to "
"latch digital bits. Absolute phase shift. If deg used, then "
"shift in degrees. Changing dbitclk also resets dbitphase and "
"sets to previous values."
<< '\n';
} else if (action == defs::GET_ACTION) {
Result<int> t;
if (args.empty()) {
t = det->getDBITPhase({det_id});
os << OutString(t) << '\n';
} else if (args.size() == 1) {
if (args[0] != "deg") {
throw sls::RuntimeError("Unknown dbitphase argument " +
args[0] + ". Did you mean deg?");
}
t = det->getDBITPhaseInDegrees({det_id});
os << OutString(t) << " deg\n";
} else {
WrongNumberOfParameters(0);
}
} else if (action == defs::PUT_ACTION) {
if (args.size() == 1) {
det->setDBITPhase(std::stoi(args[0]), {det_id});
os << args.front() << '\n';
} else if (args.size() == 2) {
if (args[1] != "deg") {
throw sls::RuntimeError("Unknown dbitphase 2nd argument " +
args[1] + ". Did you mean deg?");
}
det->setDBITPhaseInDegrees(std::stoi(args[0]), {det_id});
os << args[0] << args[1] << '\n';
} else {
WrongNumberOfParameters(1);
}
} else {
throw sls::RuntimeError("Unknown action");
}
return os.str();
}
/* CTB Specific */
std::string CmdProxy::SlowAdc(int action) {
std::ostringstream os;
@ -1499,7 +1514,7 @@ std::string CmdProxy::Pattern(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[fname]\n\t[Mythen3][Ctb] Loads binary pattern file with only pattern "
os << "[fname]\n\t[Mythen3][Moench][Ctb][Moench] Loads binary pattern file with only pattern "
"words"
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -1520,7 +1535,7 @@ std::string CmdProxy::PatternWord(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at "
os << "[step or address] [64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit pattern at "
"address of pattern memory."
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -1546,17 +1561,17 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patlimits") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete "
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of complete "
"pattern."
<< '\n';
} else if (cmd == "patloop0") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 0."
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of loop 0."
<< '\n';
} else if (cmd == "patloop1") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 1."
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of loop 1."
<< '\n';
} else if (cmd == "patloop2") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 2."
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of loop 2."
<< '\n';
} else {
throw sls::RuntimeError(
@ -1601,11 +1616,11 @@ std::string CmdProxy::PatternLoopCycles(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patnloop0") {
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 0." << '\n';
os << "[n_cycles] \n\t[Ctb][Moench][Mythen3] Number of cycles of loop 0." << '\n';
} else if (cmd == "patnloop1") {
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 1." << '\n';
os << "[n_cycles] \n\t[Ctb][Moench][Mythen3] Number of cycles of loop 1." << '\n';
} else if (cmd == "patnloop2") {
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 2." << '\n';
os << "[n_cycles] \n\t[Ctb][Moench][Mythen3] Number of cycles of loop 2." << '\n';
} else {
throw sls::RuntimeError(
"Unknown command, use list to list all commands");
@ -1646,11 +1661,11 @@ std::string CmdProxy::PatternWaitAddress(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patwait0") {
os << "[addr] \n\t[Ctb][Mythen3] Wait 0 address." << '\n';
os << "[addr] \n\t[Ctb][Moench][Mythen3] Wait 0 address." << '\n';
} else if (cmd == "patwait1") {
os << "[addr] \n\t[Ctb][Mythen3] Wait 1 address." << '\n';
os << "[addr] \n\t[Ctb][Moench][Mythen3] Wait 1 address." << '\n';
} else if (cmd == "patwait2") {
os << "[addr] \n\t[Ctb][Mythen3] Wait 2 address." << '\n';
os << "[addr] \n\t[Ctb][Moench][Mythen3] Wait 2 address." << '\n';
} else {
throw sls::RuntimeError(
"Unknown command, use list to list all commands");
@ -1691,11 +1706,11 @@ std::string CmdProxy::PatternWaitTime(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patwaittime0") {
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 0 time in clock cycles." << '\n';
os << "[n_clk] \n\t[Ctb][Moench][Mythen3] Wait 0 time in clock cycles." << '\n';
} else if (cmd == "patwaittime1") {
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 1 time in clock cycles." << '\n';
os << "[n_clk] \n\t[Ctb][Moench][Mythen3] Wait 1 time in clock cycles." << '\n';
} else if (cmd == "patwaittime2") {
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 2 time in clock cycles." << '\n';
os << "[n_clk] \n\t[Ctb][Moench][Mythen3] Wait 2 time in clock cycles." << '\n';
} else {
throw sls::RuntimeError(
"Unknown command, use list to list all commands");
@ -1811,7 +1826,7 @@ std::string CmdProxy::ProgramFpga(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[fname.pof | fname.rbf]\n\t[Jungfrau][Ctb] Programs FPGA from pof file."
os << "[fname.pof | fname.rbf]\n\t[Jungfrau][Ctb][Moench] Programs FPGA from pof file."
<< "\n\t[Mythen3][Gotthard2] Programs FPGA from rbf file."
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -1832,7 +1847,7 @@ std::string CmdProxy::CopyDetectorServer(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[server_name] [pc_host_name]\n\t[Jungfrau][Ctb] Copies detector "
os << "[server_name] [pc_host_name]\n\t[Jungfrau][Ctb][Moench] Copies detector "
"server via tftp from pc and changes respawn server name in "
"/etc/inittab of detector."
<< '\n';
@ -1854,7 +1869,7 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[server_name] [pc_host_name] [fname.pof]\n\t[Jungfrau][Ctb] "
os << "[server_name] [pc_host_name] [fname.pof]\n\t[Jungfrau][Ctb][Moench] "
"Updates detector server via tftp from pc, updates firmware to "
"pof file and then reboots controller (blackfin)."
<< '\n';
@ -1904,7 +1919,7 @@ std::string CmdProxy::AdcRegister(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[address] [value]\n\t[Jungfrau][Ctb][Gotthard] Writes to an adc "
os << "[address] [value]\n\t[Jungfrau][Ctb][Moench][Gotthard] Writes to an adc "
"register in hex."
<< '\n';
} else if (action == defs::GET_ACTION) {

View File

@ -585,6 +585,8 @@ class CmdProxy {
{"speed", &CmdProxy::Speed},
{"adcphase", &CmdProxy::Adcphase},
{"maxadcphaseshift", &CmdProxy::maxadcphaseshift},
{"dbitphase", &CmdProxy::Dbitphase},
{"maxdbitphaseshift", &CmdProxy::maxdbitphaseshift},
{"clkfreq", &CmdProxy::ClockFrequency},
{"clkphase", &CmdProxy::ClockPhase},
{"maxclkphaseshift", &CmdProxy::MaxClockPhaseShift},
@ -666,6 +668,12 @@ class CmdProxy {
{"vb_pixbuf", &CmdProxy::vb_pixbuf},
{"vin_com", &CmdProxy::vin_com},
{"vdd_prot", &CmdProxy::vdd_prot},
{"vbp_colbuf", &CmdProxy::vbp_colbuf},
{"vb_sda", &CmdProxy::vb_sda},
{"vcasc_sfp", &CmdProxy::vcasc_sfp},
{"vipre_cds", &CmdProxy::vipre_cds},
{"ibias_sfp", &CmdProxy::ibias_sfp},
{"dac", &CmdProxy::Dac},
{"daclist", &CmdProxy::DacList},
@ -796,20 +804,22 @@ class CmdProxy {
/* Mythen3 Specific */
{"counters", &CmdProxy::Counters},
/* CTB Specific */
/* CTB/ Moench Specific */
{"samples", &CmdProxy::Samples},
{"asamples", &CmdProxy::asamples},
{"dsamples", &CmdProxy::dsamples},
{"romode", &CmdProxy::romode},
{"dbitphase", &CmdProxy::Dbitphase},
{"maxdbitphaseshift", &CmdProxy::maxdbitphaseshift},
{"adcclk", &CmdProxy::adcclk},
{"dbitclk", &CmdProxy::dbitclk},
{"runclk", &CmdProxy::runclk},
{"syncclk", &CmdProxy::syncclk},
{"adcpipeline", &CmdProxy::adcpipeline},
{"dbitpipeline", &CmdProxy::dbitpipeline},
{"v_limit", &CmdProxy::v_limit},
{"adcenable", &CmdProxy::adcenable},
{"adcenable10g", &CmdProxy::adcenable10g},
/* CTB Specific */
{"dsamples", &CmdProxy::dsamples},
{"romode", &CmdProxy::romode},
{"dbitclk", &CmdProxy::dbitclk},
{"dbitpipeline", &CmdProxy::dbitpipeline},
{"v_a", &CmdProxy::v_a},
{"v_b", &CmdProxy::v_b},
{"v_c", &CmdProxy::v_c},
@ -827,9 +837,6 @@ class CmdProxy {
{"im_d", &CmdProxy::im_d},
{"im_io", &CmdProxy::im_io},
{"adc", &CmdProxy::SlowAdc},
{"adcenable", &CmdProxy::adcenable},
{"adcenable10g", &CmdProxy::adcenable10g},
{"adcinvert", &CmdProxy::adcinvert},
{"extsampling", &CmdProxy::extsampling},
{"extsamplingsrc", &CmdProxy::extsamplingsrc},
{"rx_dbitlist", &CmdProxy::ReceiverDbitList},
@ -881,6 +888,7 @@ class CmdProxy {
{"firmwaretest", &CmdProxy::firmwaretest},
{"bustest", &CmdProxy::bustest},
{"initialchecks", &CmdProxy::InitialChecks},
{"adcinvert", &CmdProxy::adcinvert},
/* Insignificant */
{"port", &CmdProxy::port},
@ -915,6 +923,7 @@ class CmdProxy {
std::string acquire(int action);
std::string Speed(int action);
std::string Adcphase(int action);
std::string Dbitphase(int action);
std::string ClockFrequency(int action);
std::string ClockPhase(int action);
std::string MaxClockPhaseShift(int action);
@ -955,9 +964,9 @@ class CmdProxy {
std::string BurstMode(int action);
/* Mythen3 Specific */
std::string Counters(int action);
/* CTB Specific */
/* CTB/ Moench Specific */
std::string Samples(int action);
std::string Dbitphase(int action);
/* CTB Specific */
std::string SlowAdc(int action);
std::string ReceiverDbitList(int action);
std::string DigitalIODelay(int action);
@ -1004,10 +1013,14 @@ class CmdProxy {
"\n\tSerial number or MAC of detector (hex).");
INTEGER_COMMAND(settings, getSettings, setSettings, sls::StringTo<slsDetectorDefs::detectorSettings>,
"[standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, dynamichg0, fixgain1, fixgain2, forceswitchg1, forceswitchg2, verylowgain]"
"\n\t[Jungfrau] - Detector Settings [dynamicgain | dynamichg0 | fixgain1 | fixgain2 | forceswitchg1 | forceswitchg2]"
"\n\t[Gotthard] - Detector Settings [dynamicgain | highgain | lowgain | mediumgain | veryhighgain]"
"\n\t[Gotthard2] - Detector Settings [dynamicgain | fixgain1 | fixgain2]"
"[standard, fast, highgain, dynamicgain, lowgain, mediumgain, veryhighgain, dynamichg0, "
"fixgain1, fixgain2, forceswitchg1, forceswitchg2, verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, "
"g2_lc_hg, g2_lc_lg, g4_hg, g4_lg]"
"\n\t Detector Settings"
"\n\t[Jungfrau] - [dynamicgain | dynamichg0 | fixgain1 | fixgain2 | forceswitchg1 | forceswitchg2]"
"\n\t[Gotthard] - [dynamicgain | highgain | lowgain | mediumgain | veryhighgain]"
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"
"\n\t[Moench] - [g1_hg | g1_lg | g2_hc_hg | g2_hc_lg | g2_lc_hg | g2_lc_lg | g4_hg | g4_lg]"
"\n\t[Eiger] Use threshold or thresholdnotb.");
/* acquisition parameters */
@ -1034,41 +1047,44 @@ class CmdProxy {
"\n\t[Gotthard2] Uploaded to detector just before acquisition starts");
TIME_COMMAND(delay, getDelayAfterTrigger, setDelayAfterTrigger,
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] Delay after trigger");
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Delay after trigger");
TIME_COMMAND(burstperiod, getBurstPeriod, setBurstPeriod,
"[duration] [(optional unit) ns|us|ms|s]\n\t[Gotthard2] Burst period. Only in burst mode and auto timing mode.");
GET_COMMAND(framesl, getNumberOfFramesLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] Number of frames left in acquisition."
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Number of frames left in acquisition."
"\n\t[Gotthard2] only in continuous mode.");
GET_COMMAND(triggersl, getNumberOfTriggersLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] Number of triggers left in acquisition."
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Number of triggers left in acquisition."
"\n\t[Gotthard2] only in continuous mode.");
TIME_GET_COMMAND(delayl, getDelayAfterTriggerLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] DelayLeft Delay Left in Acquisition."
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] DelayLeft Delay Left in Acquisition."
"\n\t[Gotthard2] only in continuous mode.");
TIME_GET_COMMAND(periodl, getPeriodLeft,
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB] Period left for current frame."
"\n\t[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Period left for current frame."
"\n\t[Gotthard2] only in continuous mode.");
INTEGER_COMMAND(timing, getTimingMode, setTimingMode, sls::StringTo<slsDetectorDefs::timingMode>,
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] [auto|trigger]\n\t[Eiger] [auto|trigger|gating|burst_trigger]");
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of detector.\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] [auto|trigger]\n\t[Eiger] [auto|trigger|gating|burst_trigger]");
GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift,
"\n\t[Jungfrau][CTB] Absolute maximum Phase shift of ADC clock.");
"\n\t[Jungfrau][CTB][Moench] Absolute maximum Phase shift of ADC clock.");
GET_COMMAND(maxdbitphaseshift, getMaxDBITPhaseShift,
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the clock to latch digital bits.");
INTEGER_COMMAND(vhighvoltage, getHighVoltage, setHighVoltage, std::stoi,
"[n_value]\n\tHigh voltage to the sensor in Voltage."
"\n\t[Gotthard] [0|90|110|120|150|180|200]"
"\n\t[Eiger][Mythen3][Gotthard2] 0-200"
"\n\t[Jungfrau][Ctb] [0|60-200]");
"\n\t[Jungfrau][Ctb][Moench] [0|60-200]");
INTEGER_COMMAND(powerchip, getPowerChip, setPowerChip, std::stoi,
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2] Power the chip. Default 0."
"[0, 1]\n\t[Jungfrau][Mythen3][Gotthard2][Moench] Power the chip. Default 0."
"\n\t[Jungfrau] Get will return power status."
"Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled."
"\n\t[Mythen3] If module not connected or wrong module, 1 will fail. By default, not powered on"
@ -1169,13 +1185,13 @@ class CmdProxy {
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for ?? "); //TODO
DAC_COMMAND(vout_cm, getDAC, setDAC, defs::VOUT_CM,
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for ?? "); //TODO
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for ?? \n\t[Moench] Dac for 5"); //TODO
DAC_COMMAND(vcasc_out, getDAC, setDAC, defs::VCASC_OUT,
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for ?? "); //TODO
DAC_COMMAND(vin_cm, getDAC, setDAC, defs::VIN_CM,
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for ?? "); //TODO
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for ?? \n\t[Moench] Dac for 2"); //TODO
DAC_COMMAND(vref_comp, getDAC, setDAC, defs::VREF_COMP,
"[dac or mv value][(optional unit) mv] \n\t[Gotthard][Jungfrau] Dac for ?? "); //TODO
@ -1193,7 +1209,7 @@ class CmdProxy {
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] voltage to define feedback resistance of the second shaper.");
DAC_COMMAND(vipre, getDAC, setDAC, defs::VIPRE,
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for the preamplifier's input transistor current.");
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for the preamplifier's input transistor current.\n\t[Moench] Dac for 1");
DAC_COMMAND(viinsh, getDAC, setDAC, defs::VIINSH,
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for the bias current for the shaper.");
@ -1274,7 +1290,7 @@ class CmdProxy {
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for common mode voltage of ADC DAC bank 2.");
DAC_COMMAND(adcvpp, getDAC, setDAC, defs::ADC_VPP,
"[dac or mv value][(optional unit) mv] \n\t[Ctb] Vpp of ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V.");
"[dac or mv value][(optional unit) mv] \n\t[Ctb][Moench] Vpp of ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V.");
DAC_COMMAND(vb_ds, getDAC, setDAC, defs::VB_DS,
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for ??"); //TODO
@ -1291,6 +1307,21 @@ class CmdProxy {
DAC_COMMAND(vdd_prot, getDAC, setDAC, defs::VDD_PROT,
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for ??"); //TODO
DAC_COMMAND(vbp_colbuf, getDAC, setDAC, defs::VBP_COLBUF,
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 0");
DAC_COMMAND(vb_sda, getDAC, setDAC, defs::VB_SDA,
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 3");
DAC_COMMAND(vcasc_sfp, getDAC, setDAC, defs::VCASC_SFP,
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 4");
DAC_COMMAND(vipre_cds, getDAC, setDAC, defs::VIPRE_CDS,
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 6");
DAC_COMMAND(ibias_sfp, getDAC, setDAC, defs::IBIAS_SFP,
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 7");
/* on chip dacs */
INTEGER_USER_IND_COMMAND(vchip_comp_fe, getOnChipDAC, setOnChipDAC, stoiHex, defs::VB_COMP_FE,
@ -1391,7 +1422,7 @@ class CmdProxy {
"\n\tPrints the receiver configuration.");
INTEGER_COMMAND(tengiga, getTenGiga, setTenGiga, std::stoi,
"[0, 1]\n\t[Eiger][Ctb] 10GbE Enable.");
"[0, 1]\n\t[Eiger][Ctb][Moench] 10GbE Enable.");
INTEGER_COMMAND(flowcontrol10g, getTenGigaFlowControl, setTenGigaFlowControl, std::stoi,
"[0, 1]\n\t[Eiger][Jungfrau] 10GbE Flow Control.");
@ -1574,10 +1605,34 @@ class CmdProxy {
/* Mythen3 Specific */
/* CTB Specific */
/* CTB/ Moench Specific */
INTEGER_COMMAND(asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples, std::stoi,
"[0, 1]\n\t[CTB] Number of analog samples expected.");
"[0, 1]\n\t[CTB][Moench] Number of analog samples expected.");
INTEGER_COMMAND(adcclk, getADCClock, setADCClock, std::stoi,
"[n_clk in MHz]\n\t[Ctb][Moench] ADC clock frequency in MHz.");
INTEGER_COMMAND(runclk, getRUNClock, setRUNClock, std::stoi,
"[n_clk in MHz]\n\t[Ctb][Moench] Run clock in MHz.");
GET_COMMAND(syncclk, getSYNCClock,
"[n_clk in MHz]\n\t[Ctb][Moench] Sync clock in MHz.");
INTEGER_COMMAND(adcpipeline, getADCPipeline, setADCPipeline, std::stoi,
"[n_value]\n\t[Ctb][Moench] Pipeline for ADC clock.");
INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, std::stoi, defs::V_LIMIT,
"[n_value]\n\t[Ctb][Moench] Soft limit for power supplies(ctb only) and DACS in mV.");
INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask, stoiHex,
"[bitmask]\n\t[Ctb][Moench] ADC Enable Mask for 1Gb Mode for each 32 ADC channel.");
INTEGER_COMMAND_HEX(adcenable10g, getTenGigaADCEnableMask, setTenGigaADCEnableMask, stoiHex,
"[bitmask]\n\t[Ctb][Moench] ADC Enable Mask for 10Gb mode for each 32 ADC channel. However, if any of consecutive 4 bits are enabled, the complete 4 bits are enabled.");
/* CTB Specific */
INTEGER_COMMAND(dsamples, getNumberOfDigitalSamples, setNumberOfDigitalSamples, std::stoi,
"[0, 1]\n\t[CTB] Number of digital samples expected.");
@ -1585,30 +1640,12 @@ class CmdProxy {
INTEGER_COMMAND(romode, getReadoutMode, setReadoutMode, sls::StringTo<slsDetectorDefs::readoutMode>,
"[analog|digital|analog_digital]\n\t[CTB] Readout mode. Default is analog.");
GET_COMMAND(maxdbitphaseshift, getMaxDBITPhaseShift,
"\n\t[CTB] Absolute maximum Phase shift of of the clock to latch digital bits.");
INTEGER_COMMAND(adcclk, getADCClock, setADCClock, std::stoi,
"[n_clk in MHz]\n\t[Ctb] ADC clock frequency in MHz.");
INTEGER_COMMAND(dbitclk, getDBITClock, setDBITClock, std::stoi,
"[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz.");
INTEGER_COMMAND(runclk, getRUNClock, setRUNClock, std::stoi,
"[n_clk in MHz]\n\t[Ctb] Run clock in MHz.");
GET_COMMAND(syncclk, getSYNCClock,
"[n_clk in MHz]\n\t[Ctb] Synch clock in MHz.");
INTEGER_COMMAND(adcpipeline, getADCPipeline, setADCPipeline, std::stoi,
"[n_value]\n\t[Ctb] Pipeline for ADC clock.");
INTEGER_COMMAND(dbitpipeline, getDBITPipeline, setDBITPipeline, std::stoi,
"[n_value]\n\t[Ctb] Pipeline of the clock for latching digital bits.");
INTEGER_IND_COMMAND(v_limit, getVoltage, setVoltage, std::stoi, defs::V_LIMIT,
"[n_value]\n\t[Ctb] Soft limit for power supplies and DACS in mV.");
INTEGER_IND_COMMAND(v_a, getVoltage, setVoltage, std::stoi, defs::V_POWER_A,
"[n_value]\n\t[Ctb] Voltage supply a in mV.");
@ -1657,15 +1694,6 @@ class CmdProxy {
GET_IND_COMMAND(im_io, getMeasuredCurrent, defs::I_POWER_IO, "",
"\n\t[Ctb] Measured current of power supply io in mA.");
INTEGER_COMMAND_HEX(adcenable, getADCEnableMask, setADCEnableMask, stoiHex,
"[bitmask]\n\t[Ctb] ADC Enable Mask for 1Gb Mode for each 32 ADC channel.");
INTEGER_COMMAND_HEX(adcenable10g, getTenGigaADCEnableMask, setTenGigaADCEnableMask, stoiHex,
"[bitmask]\n\t[Ctb] ADC Enable Mask for 10Gb mode for each 32 ADC channel. However, if any of consecutive 4 bits are enabled, the complete 4 bits are enabled.");
INTEGER_COMMAND_HEX(adcinvert, getADCInvert, setADCInvert, stoiHex,
"[bitmask]\n\t[Ctb][Jungfrau] ADC Inversion Mask.\n\t[Jungfrau] Inversions on top of the default mask.");
INTEGER_COMMAND(extsampling, getExternalSampling, setExternalSampling, std::stoi,
"[0, 1]\n\t[Ctb] Enable for external sampling signal to extsamplingsrc signal for digital data. For advanced users only.");
@ -1682,19 +1710,19 @@ class CmdProxy {
/* Pattern */
EXECUTE_SET_COMMAND_NOID_1ARG(savepattern, savePattern,
"[fname]\n\t[Ctb] Saves pattern to file (ascii). Also executes pattern.");
"[fname]\n\t[Ctb][Moench][Mythen3] Saves pattern to file (ascii). Also executes pattern.");
INTEGER_COMMAND_HEX(patioctrl, getPatternIOControl, setPatternIOControl, stoulHex,
"[64 bit mask]\n\t[Ctb] 64 bit mask defining input (0) and output (1) signals.");
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit mask defining input (0) and output (1) signals.");
INTEGER_COMMAND_HEX(patclkctrl, getPatternClockControl, setPatternClockControl, stoulHex,
"[64 bit mask]\n\t[Ctb] 64 bit mask defining output clock enable.");
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit mask defining output clock enable.");
INTEGER_COMMAND_HEX(patmask, getPatternMask, setPatternMask, stoulHex,
"[64 bit mask]\n\t[Ctb][Mythen3] 64 bit mask applied to every pattern. Only these bits for each pattern will be masked against.");
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit mask applied to every pattern. Only these bits for each pattern will be masked against.");
INTEGER_COMMAND_HEX(patsetbit, getPatternBitMask, setPatternBitMask, stoulHex,
"[64 bit mask]\n\t[Ctb][Mythen3] 64 bit values applied to the selected patmask for every pattern.");
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit values applied to the selected patmask for every pattern.");
/* Moench */
@ -1711,17 +1739,19 @@ class CmdProxy {
/* Advanced */
EXECUTE_SET_COMMAND(resetfpga, resetFPGA,
"\n\t[Jungfrau][Ctb] Reset FPGA.");
"\n\t[Jungfrau][Ctb][Moench] Reset FPGA.");
EXECUTE_SET_COMMAND(rebootcontroller, rebootController,
"\n\t[Jungfrau][Ctb][Gotthard][Mythen3][Gotthard2] Reboot controler (blackfin) of detector.");
"\n\t[Jungfrau][Ctb][Moench][Gotthard][Mythen3][Gotthard2] Reboot controler (blackfin) of detector.");
EXECUTE_SET_COMMAND(firmwaretest, executeFirmwareTest,
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] Firmware test, ie. reads a read fixed pattern from a register.");
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Firmware test, ie. reads a read fixed pattern from a register.");
EXECUTE_SET_COMMAND(bustest, executeBusTest,
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb] Bus test, ie. keeps writing and reading back different values in R/W register.");
"\n\t[Jungfrau][Gotthard][Mythen3][Gotthard2][Ctb][Moench] Bus test, ie. keeps writing and reading back different values in R/W register.");
INTEGER_COMMAND_HEX(adcinvert, getADCInvert, setADCInvert, stoiHex,
"[bitmask]\n\t[Ctb][Moench][Jungfrau][Moench] ADC Inversion Mask.\n\t[Jungfrau][Moench] Inversions on top of the default mask.");
/* Insignificant */
@ -1738,7 +1768,7 @@ class CmdProxy {
"\n\tClient IP Address that last communicated with the detector.");
GET_COMMAND(nframes, getNumberOfFramesFromStart,
"\n\t[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control."
"\n\t[Jungfrau][Mythen3][Gotthard2][Moench][CTB][Moench] Number of frames from start run control."
"\n\t[Gotthard2] only in continuous mode.");
TIME_GET_COMMAND(now, getActualTime,

View File

@ -273,6 +273,31 @@ void Detector::setADCPhaseInDegrees(int value, Positions pos) {
true);
}
Result<int> Detector::getDBITPhase(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::DBIT_CLOCK,
false);
}
void Detector::setDBITPhase(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::DBIT_CLOCK, value,
false);
}
Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const {
return pimpl->Parallel(&slsDetector::getMaxClockPhaseShift, pos,
defs::DBIT_CLOCK);
}
Result<int> Detector::getDBITPhaseInDegrees(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::DBIT_CLOCK,
true);
}
void Detector::setDBITPhaseInDegrees(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::DBIT_CLOCK, value,
true);
}
Result<int> Detector::getClockFrequency(int clkIndex, Positions pos) {
return pimpl->Parallel(&slsDetector::getClockFrequency, pos, clkIndex);
}
@ -1230,7 +1255,7 @@ void Detector::setCounterMask(uint32_t countermask, Positions pos) {
pimpl->Parallel(&slsDetector::setCounterMask, pos, countermask);
}
// CTB Specific
// CTB/ Moench Specific
Result<int> Detector::getNumberOfAnalogSamples(Positions pos) const {
return pimpl->Parallel(&slsDetector::getNumberOfAnalogSamples, pos);
@ -1240,46 +1265,6 @@ void Detector::setNumberOfAnalogSamples(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setNumberOfAnalogSamples, pos, value);
}
Result<int> Detector::getNumberOfDigitalSamples(Positions pos) const {
return pimpl->Parallel(&slsDetector::getNumberOfDigitalSamples, pos);
}
void Detector::setNumberOfDigitalSamples(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setNumberOfDigitalSamples, pos, value);
}
Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReadoutMode, pos);
}
void Detector::setReadoutMode(defs::readoutMode value, Positions pos) {
pimpl->Parallel(&slsDetector::setReadoutMode, pos, value);
}
Result<int> Detector::getDBITPhase(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::DBIT_CLOCK,
false);
}
void Detector::setDBITPhase(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::DBIT_CLOCK, value,
false);
}
Result<int> Detector::getMaxDBITPhaseShift(Positions pos) const {
return pimpl->Parallel(&slsDetector::getMaxClockPhaseShift, pos,
defs::DBIT_CLOCK);
}
Result<int> Detector::getDBITPhaseInDegrees(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockPhase, pos, defs::DBIT_CLOCK,
true);
}
void Detector::setDBITPhaseInDegrees(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setClockPhase, pos, defs::DBIT_CLOCK, value,
true);
}
Result<int> Detector::getADCClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockFrequency, pos,
@ -1291,16 +1276,6 @@ void Detector::setADCClock(int value_in_MHz, Positions pos) {
value_in_MHz);
}
Result<int> Detector::getDBITClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockFrequency, pos,
defs::DBIT_CLOCK);
}
void Detector::setDBITClock(int value_in_MHz, Positions pos) {
pimpl->Parallel(&slsDetector::setClockFrequency, pos, defs::DBIT_CLOCK,
value_in_MHz);
}
Result<int> Detector::getRUNClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockFrequency, pos,
defs::RUN_CLOCK);
@ -1328,10 +1303,6 @@ Result<int> Detector::getDBITPipeline(Positions pos) const {
return pimpl->Parallel(&slsDetector::getPipeline, pos, defs::DBIT_CLOCK);
}
void Detector::setDBITPipeline(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setPipeline, pos, defs::DBIT_CLOCK, value);
}
Result<int> Detector::getVoltage(defs::dacIndex index, Positions pos) const {
switch (index) {
case defs::V_LIMIT:
@ -1364,6 +1335,55 @@ void Detector::setVoltage(defs::dacIndex index, int value, Positions pos) {
pimpl->Parallel(&slsDetector::setDAC, pos, value, index, 1);
}
Result<uint32_t> Detector::getADCEnableMask(Positions pos) const {
return pimpl->Parallel(&slsDetector::getADCEnableMask, pos);
}
void Detector::setADCEnableMask(uint32_t mask, Positions pos) {
pimpl->Parallel(&slsDetector::setADCEnableMask, pos, mask);
}
Result<uint32_t> Detector::getTenGigaADCEnableMask(Positions pos) const {
return pimpl->Parallel(&slsDetector::getTenGigaADCEnableMask, pos);
}
void Detector::setTenGigaADCEnableMask(uint32_t mask, Positions pos) {
pimpl->Parallel(&slsDetector::setTenGigaADCEnableMask, pos, mask);
}
// CTB Specific
Result<int> Detector::getNumberOfDigitalSamples(Positions pos) const {
return pimpl->Parallel(&slsDetector::getNumberOfDigitalSamples, pos);
}
void Detector::setNumberOfDigitalSamples(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setNumberOfDigitalSamples, pos, value);
}
Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReadoutMode, pos);
}
void Detector::setReadoutMode(defs::readoutMode value, Positions pos) {
pimpl->Parallel(&slsDetector::setReadoutMode, pos, value);
}
Result<int> Detector::getDBITClock(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClockFrequency, pos,
defs::DBIT_CLOCK);
}
void Detector::setDBITClock(int value_in_MHz, Positions pos) {
pimpl->Parallel(&slsDetector::setClockFrequency, pos, defs::DBIT_CLOCK,
value_in_MHz);
}
void Detector::setDBITPipeline(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setPipeline, pos, defs::DBIT_CLOCK, value);
}
Result<int> Detector::getMeasuredVoltage(defs::dacIndex index,
Positions pos) const {
switch (index) {
@ -1402,30 +1422,6 @@ Result<int> Detector::getSlowADC(defs::dacIndex index, Positions pos) const {
return pimpl->Parallel(&slsDetector::getADC, pos, index);
}
Result<uint32_t> Detector::getADCEnableMask(Positions pos) const {
return pimpl->Parallel(&slsDetector::getADCEnableMask, pos);
}
void Detector::setADCEnableMask(uint32_t mask, Positions pos) {
pimpl->Parallel(&slsDetector::setADCEnableMask, pos, mask);
}
Result<uint32_t> Detector::getTenGigaADCEnableMask(Positions pos) const {
return pimpl->Parallel(&slsDetector::getTenGigaADCEnableMask, pos);
}
void Detector::setTenGigaADCEnableMask(uint32_t mask, Positions pos) {
pimpl->Parallel(&slsDetector::setTenGigaADCEnableMask, pos, mask);
}
Result<uint32_t> Detector::getADCInvert(Positions pos) const {
return pimpl->Parallel(&slsDetector::getADCInvert, pos);
}
void Detector::setADCInvert(uint32_t value, Positions pos) {
pimpl->Parallel(&slsDetector::setADCInvert, pos, value);
}
Result<int> Detector::getExternalSamplingSource(Positions pos) const {
return pimpl->Parallel(&slsDetector::getExternalSamplingSource, pos);
}
@ -1747,6 +1743,14 @@ void Detector::setInitialChecks(const bool value) {
pimpl->setInitialChecks(value);
}
Result<uint32_t> Detector::getADCInvert(Positions pos) const {
return pimpl->Parallel(&slsDetector::getADCInvert, pos);
}
void Detector::setADCInvert(uint32_t value, Positions pos) {
pimpl->Parallel(&slsDetector::setADCInvert, pos, value);
}
// Insignificant
Result<int> Detector::getControlPort(Positions pos) const {

View File

@ -365,7 +365,9 @@ int DetectorImpl::createReceivingDataSockets(const bool destroy) {
FILE_LOG(logINFO) << "Destroyed Receiving Data Socket(s)";
return OK;
}
if (client_downstream) {
return OK;
}
FILE_LOG(logINFO) << "Going to create data sockets";
size_t numSockets = detectors.size();
@ -557,11 +559,9 @@ void DetectorImpl::readFrameFromReceiver() {
uint32_t yoffset = coordY * nPixelsY;
uint32_t singledetrowoffset = nPixelsX * bytesPerPixel;
uint32_t rowoffset = nX * singledetrowoffset;
if (multi_shm()->multiDetectorType == CHIPTESTBOARD) {
if (multi_shm()->multiDetectorType == CHIPTESTBOARD) {
singledetrowoffset = size;
nPixelsY = 1; // TODO: nDetPixelsY is not updated.
}
FILE_LOG(logDEBUG1)
<< "Multi Image Info:"
"\n\txoffset: "
@ -1070,6 +1070,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
switch (multi_shm()->multiDetectorType) {
case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH:
if (fname.find(".pof") == std::string::npos) {
throw RuntimeError("Programming file must be a pof file.");
}
@ -1082,7 +1083,7 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
}
break;
default:
throw RuntimeError("Not implemented for this detector");
throw RuntimeError("programfpga not implemented for this detector");
}
FILE_LOG(logINFO)

View File

@ -336,6 +336,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
shm()->roMode = ANALOG_ONLY;
shm()->currentSettings = UNINITIALIZED;
shm()->currentThresholdEV = -1;
shm()->nASamples = 1;
shm()->nFrames = 1;
shm()->nTriggers = 1;
shm()->nBursts = 1;
@ -557,8 +558,8 @@ slsDetectorDefs::detectorType slsDetector::getDetectorType() const {
}
void slsDetector::updateNumberOfChannels() {
if (shm()->myDetectorType == CHIPTESTBOARD ||
shm()->myDetectorType == MOENCH) {
if (shm()->myDetectorType == CHIPTESTBOARD) {
int nachans = 0, ndchans = 0;
// analog channels (normal, analog/digital readout)
@ -577,15 +578,29 @@ void slsDetector::updateNumberOfChannels() {
}
// digital channels (ctb only, digital, analog/digital readout)
if (shm()->myDetectorType == CHIPTESTBOARD &&
(shm()->roMode == DIGITAL_ONLY ||
shm()->roMode == ANALOG_AND_DIGITAL)) {
if (shm()->roMode == DIGITAL_ONLY ||
shm()->roMode == ANALOG_AND_DIGITAL) {
ndchans = 64;
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans;
}
shm()->nChan.x = nachans + ndchans;
FILE_LOG(logDEBUG1) << "# Total #Channels:" << shm()->nChan.x;
}
else if (shm()->myDetectorType == MOENCH) {
uint32_t mask = shm()->tenGigaEnable ? shm()->adcEnableMaskTenGiga : shm()->adcEnableMaskOneGiga;
// count number of channels in x, each adc has 25 channels each
int nchanTop = __builtin_popcount(mask & 0xF0F0F0F0) * 25;
int nchanBot = __builtin_popcount(mask & 0x0F0F0F0F) * 25;
shm()->nChan.x = nchanTop > 0 ? nchanTop : nchanBot;
// if both top and bottom adcs enabled, rows = 2
int nrows = 1;
if (nchanTop > 0 && nchanBot > 0) {
nrows = 2;
}
shm()->nChan.y = shm()->nASamples / 25 * nrows;
}
}
slsDetectorDefs::xy slsDetector::getNumberOfChannels() const {
@ -743,8 +758,9 @@ void slsDetector::updateCachedDetectorVariables() {
shm()->dynamicRange = i32;
// settings
if (shm()->myDetectorType == EIGER ||
shm()->myDetectorType == JUNGFRAU || shm()->myDetectorType == GOTTHARD) {
if (shm()->myDetectorType == EIGER || shm()->myDetectorType == JUNGFRAU ||
shm()->myDetectorType == GOTTHARD || shm()->myDetectorType == GOTTHARD2 ||
shm()->myDetectorType == MOENCH) {
n += client.Receive(&i32, sizeof(i32));
shm()->currentSettings = static_cast<detectorSettings>(i32);
}
@ -807,11 +823,18 @@ void slsDetector::updateCachedDetectorVariables() {
shm()->tenGigaEnable = static_cast<bool>(i32);
}
// analog samples and adc enable masks
if (shm()->myDetectorType == CHIPTESTBOARD ||
shm()->myDetectorType == MOENCH) {
// 1gb adcmask
// analog samples
uint32_t u32 = 0;
n += client.Receive(&u32, sizeof(u32));
shm()->nASamples = u32;
// 1gb adcmask
u32 = 0;
n += client.Receive(&u32, sizeof(u32));
shm()->adcEnableMaskOneGiga = u32;
// 10gb adcmask
@ -1321,6 +1344,7 @@ int slsDetector::getNumberOfAnalogSamples() {
void slsDetector::setNumberOfAnalogSamples(int value) {
FILE_LOG(logDEBUG1) << "Setting number of analog samples to " << value;
sendToDetector(F_SET_NUM_ANALOG_SAMPLES, value, nullptr);
shm()->nASamples = value;
// update #nchan, as it depends on #samples, adcmask
updateNumberOfChannels();
if (shm()->useReceiverFlag) {
@ -1836,7 +1860,6 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
case MOENCH:
setNumberOfAnalogSamples(getNumberOfAnalogSamples());
setNumberOfDigitalSamples(getNumberOfDigitalSamples());
enableTenGigabitEthernet(static_cast<int>(shm()->tenGigaEnable));
setADCEnableMask(shm()->adcEnableMaskOneGiga);
setTenGigaADCEnableMask(shm()->adcEnableMaskTenGiga);
@ -2897,7 +2920,7 @@ int slsDetector::enableGapPixels(int val) {
int slsDetector::setTrimEn(const std::vector<int>& energies) {
if (shm()->myDetectorType != EIGER) {
throw RuntimeError("Not implemented for this detector.");
throw RuntimeError("setTrimEn not implemented for this detector.");
}
if (energies.size() > MAX_TRIMEN) {
std::ostringstream os;
@ -2912,7 +2935,7 @@ int slsDetector::setTrimEn(const std::vector<int>& energies) {
std::vector<int> slsDetector::getTrimEn() {
if (shm()->myDetectorType != EIGER) {
throw RuntimeError("Not implemented for this detector.");
throw RuntimeError("getTrimEn not implemented for this detector.");
}
return std::vector<int>(shm()->trimEnergies.begin(),
shm()->trimEnergies.end());
@ -2974,6 +2997,7 @@ void slsDetector::programFPGA(std::vector<char> buffer) {
switch (shm()->myDetectorType) {
case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH:
programFPGAviaBlackfin(buffer);
break;
case MYTHEN3:

View File

@ -13,7 +13,7 @@
class ServerInterface;
#define SLS_SHMAPIVERSION 0x190726
#define SLS_SHMVERSION 0x200225
#define SLS_SHMVERSION 0x200302
/**
* @short structure allocated in shared memory to store detector settings for
@ -80,6 +80,9 @@ struct sharedSlsDetector {
/** detector threshold (eV) */
int currentThresholdEV;
/** number of analog samples */
int nASamples;
/** number of frames */
int64_t nFrames;
@ -295,7 +298,7 @@ class slsDetector : public virtual slsDetectorDefs {
/**
* Update total number of channels (chiptestboard or moench)
* depending on the number of samples, adenablemask, readout flags(ctb)
* depending on the number of samples, adcenablemask, readout flags(ctb)
*/
void updateNumberOfChannels();
@ -404,6 +407,8 @@ class slsDetector : public virtual slsDetectorDefs {
/** [Jungfrau] Options:DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, FORCESWITCHG1, FORCESWITCHG2
* [Gotthard] Options: DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN
* [Gotthard2] Options: DYNAMICGAIN, FIXGAIN1, FIXGAIN2
* [Moench] Options: G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN,
* G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN
* [Eiger] Only stores them locally in shm Options: STANDARD, HIGHGAIN, LOWGAIN, VERYHIGHGAIN, VERYLOWGAIN
*/
detectorSettings setSettings(detectorSettings isettings);
@ -554,10 +559,10 @@ class slsDetector : public virtual slsDetectorDefs {
/** [Jungfrau] Advanced */
void setNumberOfAdditionalStorageCells(int value);
/** [CTB] */
/** [CTB][Moench] */
int getNumberOfAnalogSamples();
/** [CTB] */
/** [CTB][Moench] */
void setNumberOfAnalogSamples(int value);
/** [CTB] */
@ -574,10 +579,10 @@ class slsDetector : public virtual slsDetectorDefs {
void setPeriod(int64_t value);
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */
int64_t getDelayAfterTrigger();
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */
void setDelayAfterTrigger(int64_t value);
/** [Gotthard2] only in burst mode and in auto timing mode */
@ -605,22 +610,22 @@ class slsDetector : public virtual slsDetectorDefs {
* Options: (0-1638375 ns (resolution of 25ns) */
void setStorageCellDelay(int64_t value);
/** [Gotthard][Jungfrau][CTB][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
int64_t getNumberOfFramesLeft() const;
/** [Gotthard][Jungfrau][CTB][Mythen3]
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
int64_t getNumberOfTriggersLeft() const;
/** [Gotthard][Jungfrau][CTB]
/** [Gotthard][Jungfrau][CTB][Moench]
* [Gotthard2] only in continuous mode */
int64_t getDelayAfterTriggerLeft() const;
/** [Gotthard] */
int64_t getExptimeLeft() const;
/** [Gotthard][Jungfrau][CTB][Mythen3][Gotthard2] */
/** [Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] */
int64_t getPeriodLeft() const;
/** [Eiger] minimum two frames */
@ -629,15 +634,15 @@ class slsDetector : public virtual slsDetectorDefs {
/** [Eiger] */
int64_t getMeasuredSubFramePeriod() const;
/** [Jungfrau][CTB][Mythen3]
/** [Jungfrau][CTB][Moench][Mythen3]
* [Gotthard2] only in continuous mode */
int64_t getNumberOfFramesFromStart() const;
/** [Jungfrau][CTB][Mythen3] Get time from detector start
/** [Jungfrau][CTB][Moench][Mythen3] Get time from detector start
* [Gotthard2] only in continuous mode */
int64_t getActualTime() const;
/** [Jungfrau][CTB][Mythen3] Get timestamp at a frame start
/** [Jungfrau][CTB][Moench][Mythen3] Get timestamp at a frame start
* [Gotthard2] only in continuous mode */
int64_t getMeasurementTime() const;
@ -727,13 +732,13 @@ class slsDetector : public virtual slsDetectorDefs {
bool getStoreInRamMode();
/**
* Set readout mode (Only for CTB and Moench)
* [Ctb]
* @param mode readout mode Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL
*/
void setReadoutMode(const readoutMode mode);
/**
* Get readout mode(Only for CTB and Moench)
* [Ctb]
* @returns readout mode
*/
readoutMode getReadoutMode();
@ -1117,10 +1122,10 @@ class slsDetector : public virtual slsDetectorDefs {
*/
int64_t getReceiverRealUDPSocketBufferSize() const;
/** [Gotthard][Jungfrau][CTB] */
/** [Gotthard][Jungfrau][CTB][Moench] */
void executeFirmwareTest();
/** [Gotthard][Jungfrau][CTB] */
/** [Gotthard][Jungfrau][CTB][Moench] */
void executeBusTest();
/** [Gotthard] */
@ -1222,14 +1227,14 @@ class slsDetector : public virtual slsDetectorDefs {
uint32_t getTenGigaADCEnableMask();
/**
* Set ADC invert register (CTB, Moench)
* Set ADC invert register (CTB, Moench, Jungfrau)
* @param value ADC invert value
* @param detPos -1 for all detectors in list or specific detector position
*/
void setADCInvert(uint32_t value);
/**
* Get ADC invert register (CTB, Moench)
* Get ADC invert register (CTB, Moench, Jungfrau)
* @param detPos -1 for all detectors in list or specific detector position
* @returns ADC invert value
*/

View File

@ -9,6 +9,7 @@ target_sources(tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/test-CmdProxy-gotthard2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-CmdProxy-gotthard.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-CmdProxy-chiptestboard.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-CmdProxy-moench.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-CmdProxy-global.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-Result.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test-CmdParser.cpp

View File

@ -0,0 +1,103 @@
#include "CmdProxy.h"
#include "Detector.h"
#include "catch.hpp"
#include "sls_detector_defs.h"
#include <sstream>
#include "Result.h"
#include "ToString.h"
#include "test-CmdProxy-global.h"
#include "tests/globals.h"
#include "versionAPI.h"
using sls::CmdProxy;
using sls::Detector;
using test::GET;
using test::PUT;
TEST_CASE("Setting and reading back MOENCH dacs", "[.cmd][.dacs]") {
// vbp_colbuf, vipre, vin_cm", vb_sda, vcasc_sfp, vout_cm, vipre_cds, ibias_sfp
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::MOENCH) {
SECTION("vbp_colbuf") { test_dac(defs::VBP_COLBUF, "vbp_colbuf", 1300); }
SECTION("vipre") { test_dac(defs::VIPRE, "vipre", 1000); }
SECTION("vin_cm") { test_dac(defs::VIN_CM, "vin_cm", 1400); }
SECTION("vb_sda") { test_dac(defs::VB_SDA, "vb_sda", 680); }
SECTION("vcasc_sfp") { test_dac(defs::VCASC_SFP, "vcasc_sfp", 1428); }
SECTION("vout_cm") { test_dac(defs::VOUT_CM, "vout_cm", 1200); }
SECTION("vipre_cds") { test_dac(defs::VIPRE_CDS, "vipre_cds", 800); }
SECTION("ibias_sfp") { test_dac(defs::IBIAS_SFP, "ibias_sfp", 900); }
// eiger
REQUIRE_THROWS(proxy.Call("vthreshold", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vsvp", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vsvn", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vtr", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vrf", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vrs", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vtgstv", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcmp_ll", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcmp_lr", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcal", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcmp_rl", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcmp_rr", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("rxb_rb", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("rxb_lb", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcp", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcn", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vis", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("iodelay", {}, -1, GET));
// jungfrau
REQUIRE_THROWS(proxy.Call("vb_comp", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vdd_prot", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vin_com", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_prech", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_pixbuf", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_ds", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_ds", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_comp", {}, -1, GET));
// gotthard
REQUIRE_THROWS(proxy.Call("vref_ds", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcascn_pb", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcascp_pb", {}, -1, GET));
//REQUIRE_THROWS(proxy.Call("vout_cm", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcasc_out", {}, -1, GET));
//REQUIRE_THROWS(proxy.Call("vin_cm", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_comp", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("ib_test_c", {}, -1, GET));
// mythen3
REQUIRE_THROWS(proxy.Call("vpreamp", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vshaper", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vshaperneg", {}, -1, GET));
//REQUIRE_THROWS(proxy.Call("vipre", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("viinsh", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vdcsh", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vth1", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vth2", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vth3", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vpl", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vph", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vtrim", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcassh", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcas", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vicin", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vipre_out", {}, -1, GET));
// gotthard2
REQUIRE_THROWS(proxy.Call("vref_h_adc", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_comp_fe", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_comp_adc", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcom_cds", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_rstore", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_opa_1st", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_comp_fe", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcom_adc1", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_l_adc", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vref_cds", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_cs", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vb_opa_fd", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vcom_adc2", {}, -1, GET));
}
}

View File

@ -529,7 +529,7 @@ int ClientInterface::set_num_analog_samples(Interface &socket) {
int ClientInterface::set_num_digital_samples(Interface &socket) {
auto value = socket.Receive<int>();
FILE_LOG(logDEBUG1) << "Setting num digital samples to " << value;
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
if (myDetectorType != CHIPTESTBOARD) {
functionNotImplemented();
}
try {

View File

@ -447,6 +447,7 @@ void DataProcessor::PadMissingPackets(char* buf) {
memset(buf + fifohsize + (pnum * dsize), 0xFF, dsize+2);
break;
case CHIPTESTBOARD:
case MOENCH:
if (pnum == (pperFrame-1))
memset(buf + fifohsize + (pnum * dsize), 0xFF, corrected_dsize);
else

View File

@ -629,13 +629,6 @@ private:
/** Number of bytes per analog channel */
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
struct ctb_10g_packet_header {
unsigned char emptyHeader[6];
unsigned char reserved[4];
uint32_t packetFrameNumber;
uint64_t bunchid;
} __attribute__((packed));
public:
@ -660,7 +653,7 @@ public:
};
/**
* Set databytes (ctb, moench)
* Set databytes
* @param a adc enable mask
* @param as analog number of samples
* @param ds digital number of samples
@ -700,50 +693,21 @@ public:
nPixelsX = nachans + ndchans;
nPixelsY = 1;
// 10G
if (t) {
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
dataSize = 8144;
packetSize = headerSizeinPacket + dataSize;
imageSize = adatabytes + ddatabytes;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
standardheader = true;
/*
headerSizeinPacket = 22;
dataSize = 8192;
packetSize = headerSizeinPacket + dataSize;
imageSize = adatabytes + ddatabytes;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
standardheader = false;
*/
}
// 1g udp (via fifo readout)
else {
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
dataSize = UDP_PACKET_DATA_BYTES;
packetSize = headerSizeinPacket + dataSize;
imageSize = adatabytes + ddatabytes;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
standardheader = true;
}
return adatabytes;
}
/**
* Get Header Infomation (frame number, packet number)
* @param index thread index for debugging purposes
* @param packetData pointer to data
* @param oddStartingPacket odd starting packet (gotthard)
* @param frameNumber frame number
* @param packetNumber packet number
*/
void GetHeaderInfo(int index, char* packetData, bool oddStartingPacket,
uint64_t& frameNumber, uint32_t& packetNumber) const
{
auto header = reinterpret_cast<ctb_10g_packet_header*>(packetData);
frameNumber = (header->packetFrameNumber >> frameIndexOffset) & frameIndexMask;
packetNumber = header->packetFrameNumber & packetIndexMask;
packetSize = headerSizeinPacket + dataSize;
imageSize = adatabytes + ddatabytes;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
return adatabytes;
}
};
@ -769,14 +733,14 @@ public:
imageSize = nPixelsX * nPixelsY * 2;
packetsPerFrame = ceil((double)imageSize / (double)UDP_PACKET_DATA_BYTES);
frameIndexMask = 0xFFFFFF;
maxFramesPerFile = CTB_MAX_FRAMES_PER_FILE;
maxFramesPerFile = MOENCH_MAX_FRAMES_PER_FILE;
fifoBufferHeaderSize = FIFO_HEADER_NUMBYTES + sizeof(slsDetectorDefs::sls_receiver_header);
defaultFifoDepth = 2500;
standardheader = true;
};
/**
* Set databytes (ctb, moench)
* Set databytes
* @param a adc enable mask
* @param as analog number of samples
* @param ds digital number of samples
@ -785,41 +749,37 @@ public:
* @returns analog data bytes
*/
int setImageSize(uint32_t a, uint32_t as, uint32_t ds, bool t, slsDetectorDefs::readoutMode) {
int nachans = 0;
int adatabytes = 0;
// analog channels (normal, analog/digital readout)
if (a == BIT32_MASK) {
nachans = 32;
} else {
for (int ich = 0; ich < 32; ++ich) {
if (a & (1 << ich))
++nachans;
}
}
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans
<< " Databytes: " << adatabytes;
// count number of channels in x, each adc has 25 channels each
int nchanTop = __builtin_popcount(a & 0xF0F0F0F0) * 25;
int nchanBot = __builtin_popcount(a & 0x0F0F0F0F) * 25;
nPixelsX = nchanTop > 0 ? nchanTop : nchanBot;
// if both top and bottom adcs enabled, rows = 2
int nrows = 1;
if (nchanTop > 0 && nchanBot > 0) {
nrows = 2;
}
nPixelsY = as / 25 * nrows;
FILE_LOG(logINFO) << "Number of Pixels: [" << nPixelsX << ", " << nPixelsY << "]";
nPixelsX = nachans;
nPixelsY = 1;
// 10G
if (t) {
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
dataSize = UDP_PACKET_DATA_BYTES;
packetSize = headerSizeinPacket + dataSize;
imageSize = adatabytes;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
dataSize = 8144;
}
// 1g udp (via fifo readout)
else {
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
dataSize = UDP_PACKET_DATA_BYTES;
packetSize = headerSizeinPacket + dataSize;
imageSize = adatabytes;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
dataSize = UDP_PACKET_DATA_BYTES;
}
return adatabytes;
imageSize = nPixelsX * nPixelsY * NUM_BYTES_PER_ANALOG_CHANNEL;
packetSize = headerSizeinPacket + dataSize;
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
FILE_LOG(logDEBUG) << "Databytes: " << imageSize;
return imageSize;
}
};

View File

@ -1,38 +1,14 @@
/**
\file mainReceiver.cpp
This file is an example of how to implement the Receiver class
You can compile it linking it to the slsReceiver library
g++ mainReceiver.cpp -L lib -lSlsReceiver -L/usr/lib64/ -L lib2 -lzmq -pthread -lrt -lm -lstdc++
where,
lib is the location of lSlsReceiver.so
lib2 is the location of the libzmq.a.
[ libzmq.a is required only when using data call backs and enabling data streaming from receiver to client.
It is linked in manual/manual-api from slsReceiverSoftware/include ]
*/
/* Creates the slsMultiReceiver for running multiple receivers form a single binary */
#include "sls_detector_defs.h"
#include "Receiver.h"
#include "container_utils.h"
#include <csignal> //SIGINT
#include <cstdlib> //system
#include <cstring>
#include <iostream>
#include <cerrno>
#include <string>
#include <sys/types.h> //wait
#include <sys/wait.h> //wait
#include <syscall.h> //tid
#include <unistd.h> //usleep
#include <semaphore.h>
using namespace std;
/** Define Colors to print data call back in different colors for different recievers */
#define PRINT_IN_COLOR(c,f, ...) printf ("\033[%dm" f RESET, 30 + c+1, ##__VA_ARGS__)
@ -258,7 +234,7 @@ int main(int argc, char *argv[]) {
/** - Print Ready and Instructions how to exit */
cout << "Ready ... " << endl;
std::cout << "Ready ... \n";
cprintf(RESET, "\n[ Press \'Ctrl+c\' to exit ]\n");
/** - Parent process waits for all child processes to exit */
@ -280,7 +256,7 @@ int main(int argc, char *argv[]) {
cprintf(BLUE,"Exiting Child Process [ Tid: %ld ]\n", (long int) childPid);
}
cout << "Goodbye!" << endl;
std::cout << "Goodbye!\n";
return 0;
}

View File

@ -1,20 +1,11 @@
/* A simple server in the internet domain using TCP
The port number is passed as an argument */
/* slsReceiver */
#include "logger.h"
#include "Receiver.h"
#include "sls_detector_defs.h"
#include "container_utils.h"
#include <csignal> //SIGINT
#include <cstdlib> //system
#include <cstring>
#include <iostream>
#include <sys/types.h> //wait
#include <sys/wait.h> //wait
#include <csignal> //SIGINT
#include <syscall.h>
#include <unistd.h> //usleep
#include <memory>
#include <semaphore.h>
sem_t semaphore;
@ -23,47 +14,6 @@ void sigInterruptHandler(int p){
sem_post(&semaphore);
}
/** Define Colors to print data call back in different colors for different recievers */
/*
#define PRINT_IN_COLOR(c,f, ...) printf ("\033[%dm" f RESET, 30 + c+1, ##__VA_ARGS__)
int StartAcq(std::string filepath, std::string filename, uint64_t fileindex, uint32_t datasize, void*p){
FILE_LOG(logINFO) << "#### StartAcq: "
"filepath: " << filepath << "filename: " << filename <<
"fileindex: " << fileindex << "datasize: " << datasize << " ####";
FILE_LOG(logINFO) << "--StartAcq: returning 0";
return 0;
}
void AcquisitionFinished(uint64_t frames, void*p){
FILE_LOG(logINFO) << "#### AcquisitionFinished: frames:" << frames << " ####";
}
void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
slsDetectorDefs::sls_receiver_header* header = (slsDetectorDefs::sls_receiver_header*)metadata;
slsDetectorDefs::sls_detector_header detectorHeader = header->detHeader;
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.row,
"#### %d GetData: ####\n"
"frameNumber: %lu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %lu"
"\t\ttimestamp: %lu\t\tmodId: %u\t\t"
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
//"\t\tpacketsMask:%s"
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
detectorHeader.row, (long unsigned int)detectorHeader.frameNumber,
detectorHeader.expLength, detectorHeader.packetNumber, (long unsigned int)detectorHeader.bunchId,
(long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
detectorHeader.row, detectorHeader.column, detectorHeader.reserved,
detectorHeader.debug, detectorHeader.roundRNumber,
detectorHeader.detType, detectorHeader.version,
//header->packetsMask.to_string().c_str(),
((uint8_t)(*((uint8_t*)(datapointer)))), datasize);
}
*/
int main(int argc, char *argv[]) {
@ -99,45 +49,6 @@ int main(int argc, char *argv[]) {
throw;
}
//register callbacks
/**
callback arguments are
filepath
filename
fileindex
datasize
return value is
0 raw data ready callback takes care of open,close,write file
1 callback writes file, we have to open, close it
2 we open, close, write file, callback does not do anything
registerCallBackStartAcquisition(int (*func)(std::string, std::string, int, int, void*),void *arg);
*/
//receiver->registerCallBackStartAcquisition(startAcquisitionCallBack,NULL);
/**
callback argument is
total farmes caught
registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg);
*/
//receiver->registerCallBackAcquisitionFinished(acquisitionFinishedCallBack,NULL);
/**
args to raw data ready callback are
sls_receiver_header frame metadata
datapointer
file descriptor
guidatapointer (NULL, no data required)
NEVER DELETE THE DATA POINTER
REMEMBER THAT THE CALLBACK IS BLOCKING
registerCallBackRawDataReady(void (*func)(char*, char*, uint32_t, void*),void *arg);
*/
//receiver->registerCallBackRawDataReady(rawDataReadyCallBack,NULL);
FILE_LOG(logINFO) << "[ Press \'Ctrl+c\' to exit ]";
sem_wait(&semaphore);
sem_destroy(&semaphore);

View File

@ -91,6 +91,22 @@ inline std::string ToString(const defs::detectorSettings s) {
return std::string("forceswitchg2");
case defs::VERYLOWGAIN:
return std::string("verylowgain");
case defs::G1_HIGHGAIN:
return std::string("g1_hg");
case defs::G1_LOWGAIN:
return std::string("g1_lg");
case defs::G2_HIGHCAP_HIGHGAIN:
return std::string("g2_hc_hg");
case defs::G2_HIGHCAP_LOWGAIN:
return std::string("g2_hc_lg");
case defs::G2_LOWCAP_HIGHGAIN:
return std::string("g2_lc_hg");
case defs::G2_LOWCAP_LOWGAIN:
return std::string("g2_lc_lg");
case defs::G4_HIGHGAIN:
return std::string("g4_hg");
case defs::G4_LOWGAIN:
return std::string("g4_lg");
case defs::UNDEFINED:
return std::string("undefined");
case defs::UNINITIALIZED:
@ -459,6 +475,22 @@ inline defs::detectorSettings StringTo(const std::string& s) {
return defs::FORCESWITCHG2;
if (s == "verylowgain")
return defs::VERYLOWGAIN;
if (s == "g1_hg")
return defs::G1_HIGHGAIN;
if (s == "g1_lg")
return defs::G1_LOWGAIN;
if (s == "g2_hc_hg")
return defs::G2_HIGHCAP_HIGHGAIN;
if (s == "g2_hc_lg")
return defs::G2_HIGHCAP_LOWGAIN;
if (s == "g2_lc_hg")
return defs::G2_LOWCAP_HIGHGAIN;
if (s == "g2_lc_lg")
return defs::G2_LOWCAP_LOWGAIN;
if (s == "g4_hg")
return defs::G4_HIGHGAIN;
if (s == "g4_lg")
return defs::G4_LOWGAIN;
throw sls::RuntimeError("Unknown setting " + s);
}

View File

@ -332,6 +332,11 @@ class slsDetectorDefs {
VB_PIXBUF,
VIN_COM,
VDD_PROT,
VBP_COLBUF,
VB_SDA,
VCASC_SFP,
VIPRE_CDS,
IBIAS_SFP,
V_POWER_A = 100,
V_POWER_B = 101,
V_POWER_C = 102,
@ -359,20 +364,28 @@ class slsDetectorDefs {
detector settings indexes
*/
enum detectorSettings {
GET_SETTINGS = -1, /**< return current detector settings */
STANDARD, /**< standard settings */
FAST, /**< fast settings */
HIGHGAIN, /**< highgain settings */
DYNAMICGAIN, /**< dynamic gain settings */
LOWGAIN, /**< low gain settings */
MEDIUMGAIN, /**< medium gain settings */
VERYHIGHGAIN, /**< very high gain settings */
DYNAMICHG0, /**< dynamic high gain 0 */
FIXGAIN1, /**< fix gain 1 */
FIXGAIN2, /**< fix gain 2 */
FORCESWITCHG1, /**< force switch gain 1 */
FORCESWITCHG2, /**< force switch gain 2 */
VERYLOWGAIN, /**< very low gain settings */
GET_SETTINGS = -1,
STANDARD,
FAST,
HIGHGAIN,
DYNAMICGAIN,
LOWGAIN,
MEDIUMGAIN,
VERYHIGHGAIN,
DYNAMICHG0,
FIXGAIN1,
FIXGAIN2,
FORCESWITCHG1,
FORCESWITCHG2,
VERYLOWGAIN,
G1_HIGHGAIN,
G1_LOWGAIN,
G2_HIGHCAP_HIGHGAIN,
G2_HIGHCAP_LOWGAIN,
G2_LOWCAP_HIGHGAIN,
G2_LOWCAP_LOWGAIN,
G4_HIGHGAIN,
G4_LOWGAIN,
UNDEFINED = 200, /**< undefined or custom settings */
UNINITIALIZED /**< uninitialiazed (status at startup) */
};

View File

@ -1,12 +1,12 @@
/** API versions */
#define GITBRANCH "developer"
#define APIMOENCH 0x200131
#define APIMYTHEN3 0x200226
#define APIJUNGFRAU 0x200226
#define APIEIGER 0x200226
#define APIGOTTHARD 0x200226
#define APILIB 0x200227
#define APIRECEIVER 0x200227
#define APIGUI 0x200227
#define APICTB 0x200227
#define APIGOTTHARD2 0x200228
#define APICTB 0x200305
#define APIGOTTHARD 0x200305
#define APIMYTHEN3 0x200305
#define APIEIGER 0x200305
#define APIGOTTHARD2 0x200305
#define APIMOENCH 0x200306
#define APIJUNGFRAU 0x200306