mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
commit
2f7a0898d6
@ -46,6 +46,8 @@ This document describes the differences between v6.0.0 and v5.1.0.
|
||||
Additional number of storage cells not applicable for chipv1.1.
|
||||
Storage cell start is only allowed from 0 - 3 for chipv1.1
|
||||
(0 - 15 for chipv1.0).
|
||||
Command line: extrastoragecells, Previous Command line: storagecells
|
||||
API: remains the same.
|
||||
|
||||
6. [Gotthard2][Jungfrau] Filter Resistor
|
||||
Command line: filterresistor, API: getFilterResistor/ setFilterResistor
|
||||
@ -55,7 +57,7 @@ This document describes the differences between v6.0.0 and v5.1.0.
|
||||
[Gotthard2] Options: [0|1|2|3]. Default is 0.
|
||||
|
||||
7. [Jungfrau] Filter cell (only chipv1.1)
|
||||
Command line: filtercell, API: getFilterCell/ setFilterCell
|
||||
Command line: filtercells, API: getNumberOfFilterCells/ setNumberOfFilterCells
|
||||
Set filter cell. Options: [0-12]. Advanced user command.
|
||||
|
||||
8. [Jungfrau] Comparator disable time (only chipv1.1)
|
||||
|
@ -2292,18 +2292,18 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
@element
|
||||
def filtercell(self):
|
||||
def filtercells(self):
|
||||
"""
|
||||
[Jungfrau] Set filter capacitor.
|
||||
Note
|
||||
----
|
||||
[Jungfrau] Options: 0-12. Default: 0. Advanced user command. Only for chipv1.1.
|
||||
"""
|
||||
return self.getFilterCell()
|
||||
return self.getNumberOfFilterCells()
|
||||
|
||||
@filtercell.setter
|
||||
def filtercell(self, value):
|
||||
ut.set_using_dict(self.setFilterCell, value)
|
||||
@filtercells.setter
|
||||
def filtercells(self, value):
|
||||
ut.set_using_dict(self.setNumberOfFilterCells, value)
|
||||
|
||||
@property
|
||||
def maxclkphaseshift(self):
|
||||
|
@ -1072,13 +1072,13 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const defs::gainMode, sls::Positions)) &
|
||||
Detector::setGainMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getFilterCell",
|
||||
.def("getNumberOfFilterCells",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getFilterCell,
|
||||
Detector::getNumberOfFilterCells,
|
||||
py::arg() = Positions{})
|
||||
.def("setFilterCell",
|
||||
.def("setNumberOfFilterCells",
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setFilterCell,
|
||||
Detector::setNumberOfFilterCells,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getROI",
|
||||
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
|
||||
|
@ -1201,7 +1201,7 @@ Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p>#<span style=" font-family:'Droid Sans Mono,monospace,monospace,Droid Sans Fallback'; font-size:14px; color:#ce9178;">extrastoragecells#</span></p><p><br/></p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Number of Storage cells:</string>
|
||||
@ -1402,7 +1402,7 @@ Default value is 0. A value less than the required minimum is ignored.
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p>#<span style=" font-family:'Droid Sans Mono,monospace,monospace,Droid Sans Fallback'; font-size:14px; color:#ce9178;">extrastoragecells</span>#</p><p><br/></p></body></html></string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
|
@ -452,6 +452,7 @@ Time before end of exposure when comparator is disabled */
|
||||
#define ASIC_CTRL_DS_TMR_OFST (8)
|
||||
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
|
||||
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
||||
#define ASIC_CTRL_DS_TMR_CHIP1_1_VAL ((0xFF << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
||||
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage
|
||||
// cells)
|
||||
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
|
||||
|
Binary file not shown.
@ -498,7 +498,7 @@ void setupDetector() {
|
||||
setFlipRows(DEFAULT_FLIP_ROWS);
|
||||
if (getChipVersion() == 11) {
|
||||
setFilterResistor(DEFAULT_FILTER_RESISTOR);
|
||||
setFilterCell(DEFAULT_FILTER_CELL);
|
||||
setNumberOfFilterCells(DEFAULT_FILTER_CELL);
|
||||
}
|
||||
setReadNRows(MAX_ROWS_PER_READOUT);
|
||||
}
|
||||
@ -1829,11 +1829,15 @@ int64_t getComparatorDisableTime() {
|
||||
}
|
||||
|
||||
void configureASICTimer() {
|
||||
LOG(logINFO, ("Configuring ASIC Timer\n"));
|
||||
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_PRCHRG_TMR_MSK) |
|
||||
ASIC_CTRL_PRCHRG_TMR_VAL);
|
||||
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) |
|
||||
ASIC_CTRL_DS_TMR_VAL);
|
||||
|
||||
uint32_t val = ASIC_CTRL_DS_TMR_VAL;
|
||||
if (getChipVersion() == 11) {
|
||||
val = ASIC_CTRL_DS_TMR_CHIP1_1_VAL;
|
||||
}
|
||||
bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) | val);
|
||||
LOG(logINFO, ("Configured ASIC Timer [0x%x]\n", bus_r(ASIC_CTRL_REG)));
|
||||
}
|
||||
|
||||
int setReadoutSpeed(int val) {
|
||||
@ -2202,7 +2206,7 @@ int setFilterResistor(int value) {
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
int getFilterCell() {
|
||||
int getNumberOfFilterCells() {
|
||||
#ifdef VIRTUAL
|
||||
uint32_t addr = CONFIG_V11_REG;
|
||||
#else
|
||||
@ -2213,12 +2217,13 @@ int getFilterCell() {
|
||||
// flip all contents of register //TODO FIRMWARE FIX
|
||||
regval ^= BIT32_MASK;
|
||||
#endif
|
||||
uint32_t retval = (regval & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST;
|
||||
uint32_t retval =
|
||||
(regval & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST;
|
||||
// count number of bits = which icell
|
||||
return (__builtin_popcount(retval));
|
||||
}
|
||||
|
||||
void setFilterCell(int iCell) {
|
||||
void setNumberOfFilterCells(int iCell) {
|
||||
if (iCell > MAX_FILTER_CELL_VAL) {
|
||||
return;
|
||||
}
|
||||
@ -2235,8 +2240,8 @@ void setFilterCell(int iCell) {
|
||||
bus_w(addr, bus_r(addr) | ((value << CONFIG_V11_FLTR_CLL_OFST) &
|
||||
CONFIG_V11_FLTR_CLL_MSK));
|
||||
}
|
||||
LOG(logINFO,
|
||||
("Setting Filter Cell to %d [Reg:0x%x]\n", iCell, bus_r(addr)));
|
||||
LOG(logINFO, ("Setting Number of Filter Cells to %d [Reg:0x%x]\n", iCell,
|
||||
bus_r(addr)));
|
||||
}
|
||||
|
||||
void disableCurrentSource() {
|
||||
@ -2341,8 +2346,7 @@ int getNormalCurrentSource() {
|
||||
#ifndef VIRTUAL
|
||||
regval ^= BIT32_MASK;
|
||||
#endif
|
||||
int low = ((regval &
|
||||
CONFIG_V11_STATUS_CRRNT_SRC_LOW_MSK) >>
|
||||
int low = ((regval & CONFIG_V11_STATUS_CRRNT_SRC_LOW_MSK) >>
|
||||
CONFIG_V11_STATUS_CRRNT_SRC_LOW_OFST);
|
||||
return (low == 0 ? 1 : 0);
|
||||
}
|
||||
|
@ -486,8 +486,8 @@ int getFlipRows();
|
||||
void setFlipRows(int arg);
|
||||
int setFilterResistor(int value);
|
||||
int getFilterResistor();
|
||||
int getFilterCell();
|
||||
void setFilterCell(int iCell);
|
||||
int getNumberOfFilterCells();
|
||||
void setNumberOfFilterCells(int iCell);
|
||||
void disableCurrentSource();
|
||||
void enableCurrentSource(int fix, uint64_t select, int normal);
|
||||
int getCurrentSource();
|
||||
|
@ -262,8 +262,8 @@ int get_comp_disable_time(int);
|
||||
int set_comp_disable_time(int);
|
||||
int get_flip_rows(int);
|
||||
int set_flip_rows(int);
|
||||
int get_filter_cell(int);
|
||||
int set_filter_cell(int);
|
||||
int get_num_filter_cells(int);
|
||||
int set_num_filter_cells(int);
|
||||
int set_adc_pipeline(int);
|
||||
int get_adc_pipeline(int);
|
||||
int set_dbit_pipeline(int);
|
||||
|
@ -399,8 +399,8 @@ void function_table() {
|
||||
flist[F_SET_COMP_DISABLE_TIME] = &set_comp_disable_time;
|
||||
flist[F_GET_FLIP_ROWS] = &get_flip_rows;
|
||||
flist[F_SET_FLIP_ROWS] = &set_flip_rows;
|
||||
flist[F_GET_FILTER_CELL] = &get_filter_cell;
|
||||
flist[F_SET_FILTER_CELL] = &set_filter_cell;
|
||||
flist[F_GET_NUM_FILTER_CELLS] = &get_num_filter_cells;
|
||||
flist[F_SET_NUM_FILTER_CELLS] = &set_num_filter_cells;
|
||||
flist[F_SET_ADC_PIPELINE] = &set_adc_pipeline;
|
||||
flist[F_GET_ADC_PIPELINE] = &get_adc_pipeline;
|
||||
flist[F_SET_DBIT_PIPELINE] = &set_dbit_pipeline;
|
||||
@ -8886,31 +8886,31 @@ int set_flip_rows(int file_des) {
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
||||
int get_filter_cell(int file_des) {
|
||||
int get_num_filter_cells(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int retval = -1;
|
||||
|
||||
LOG(logDEBUG1, ("Getting filter cell\n"));
|
||||
LOG(logDEBUG1, ("Getting number of filter cellsn"));
|
||||
|
||||
#ifndef JUNGFRAUD
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
retval = getFilterCell();
|
||||
LOG(logDEBUG1, ("filter cell retval: %u\n", retval));
|
||||
retval = getNumberOfFilterCells();
|
||||
LOG(logDEBUG1, ("num filter cells retval: %u\n", retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int set_filter_cell(int file_des) {
|
||||
int set_num_filter_cells(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int arg = -1;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
LOG(logDEBUG1, ("Setting filter cell: %u\n", (int)arg));
|
||||
LOG(logDEBUG1, ("Setting number of filter cells: %u\n", (int)arg));
|
||||
|
||||
#ifndef JUNGFRAUD
|
||||
functionNotImplemented();
|
||||
@ -8921,7 +8921,8 @@ int set_filter_cell(int file_des) {
|
||||
if (arg < 0 || arg > MAX_FILTER_CELL_VAL) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,
|
||||
"Could not set filter cell. Invalid argument %d. Options: "
|
||||
"Could not set number of filter cells. Invalid argument "
|
||||
"%d. Options: "
|
||||
"0 - %d\n",
|
||||
arg, MAX_FILTER_CELL_VAL);
|
||||
LOG(logERROR, (mess));
|
||||
@ -8929,11 +8930,12 @@ int set_filter_cell(int file_des) {
|
||||
// only for chipv1.1
|
||||
else if (getChipVersion() == 10) {
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not set filter cell. Only available for "
|
||||
strcpy(mess,
|
||||
"Could not set number of filter cells. Only available for "
|
||||
"chip version 1.1\n");
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
setFilterCell(arg);
|
||||
setNumberOfFilterCells(arg);
|
||||
// no validation as it might take time to update status register if
|
||||
// acquiring
|
||||
}
|
||||
|
@ -1240,11 +1240,11 @@ class Detector {
|
||||
void setGainMode(const defs::gainMode mode, Positions pos = {});
|
||||
|
||||
/** [Jungfrau] Advanced */
|
||||
Result<int> getFilterCell(Positions pos = {}) const;
|
||||
Result<int> getNumberOfFilterCells(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] Advanced Options[0-12], only for chip v1.1
|
||||
*/
|
||||
void setFilterCell(int cell, Positions pos = {});
|
||||
void setNumberOfFilterCells(int cell, Positions pos = {});
|
||||
|
||||
///@{
|
||||
|
||||
|
@ -82,9 +82,14 @@ std::map<std::string, std::string> CmdProxy::GetDepreciatedCommands() {
|
||||
}
|
||||
|
||||
void CmdProxy::WrongNumberOfParameters(size_t expected) {
|
||||
throw RuntimeError(
|
||||
"Command " + cmd + " expected <=" + std::to_string(expected) +
|
||||
" parameter/s but got " + std::to_string(args.size()) + "\n");
|
||||
if (expected == 0) {
|
||||
throw RuntimeError("Command " + cmd +
|
||||
" expected no parameter/s but got " +
|
||||
std::to_string(args.size()) + "\n");
|
||||
}
|
||||
throw RuntimeError("Command " + cmd + " expected (or >=) " +
|
||||
std::to_string(expected) + " parameter/s but got " +
|
||||
std::to_string(args.size()) + "\n");
|
||||
}
|
||||
|
||||
/************************************************
|
||||
|
@ -725,6 +725,8 @@ class CmdProxy {
|
||||
{"resmat", "partialreset"},
|
||||
|
||||
/* Jungfrau Specific */
|
||||
{"storagecells", "extrastoragecells"},
|
||||
|
||||
/* Gotthard Specific */
|
||||
/* Gotthard2 Specific */
|
||||
/* Mythen3 Specific */
|
||||
@ -944,11 +946,11 @@ class CmdProxy {
|
||||
{"temp_event", &CmdProxy::TemperatureEvent},
|
||||
{"auto_comp_disable", &CmdProxy::auto_comp_disable},
|
||||
{"comp_disable_time", &CmdProxy::comp_disable_time},
|
||||
{"storagecells", &CmdProxy::storagecells},
|
||||
{"extrastoragecells", &CmdProxy::extrastoragecells},
|
||||
{"storagecell_start", &CmdProxy::storagecell_start},
|
||||
{"storagecell_delay", &CmdProxy::storagecell_delay},
|
||||
{"gainmode", &CmdProxy::gainmode},
|
||||
{"filtercell", &CmdProxy::filtercell},
|
||||
{"filtercells", &CmdProxy::filtercells},
|
||||
|
||||
/* Gotthard Specific */
|
||||
{"roi", &CmdProxy::ROI},
|
||||
@ -1923,12 +1925,12 @@ class CmdProxy {
|
||||
"only possible for chipv1.1.");
|
||||
|
||||
INTEGER_COMMAND_SET_NOID_GET_ID(
|
||||
storagecells, getNumberOfAdditionalStorageCells,
|
||||
extrastoragecells, getNumberOfAdditionalStorageCells,
|
||||
setNumberOfAdditionalStorageCells, StringTo<int>,
|
||||
"[0-15]\n\t[Jungfrau] Only for chipv1.0. Number of additional storage "
|
||||
"cells. Default is "
|
||||
"0. For advanced users only. \n\tThe #images = #frames x #triggers x "
|
||||
"(#storagecells + 1).");
|
||||
"(#extrastoragecells + 1).");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
storagecell_start, getStorageCellStart, setStorageCellStart,
|
||||
@ -1951,8 +1953,8 @@ class CmdProxy {
|
||||
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
|
||||
"you can damage the detector!!!");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(filtercell, getFilterCell, setFilterCell,
|
||||
sls::StringTo<int>,
|
||||
INTEGER_COMMAND_VEC_ID(filtercells, getNumberOfFilterCells,
|
||||
setNumberOfFilterCells, sls::StringTo<int>,
|
||||
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for "
|
||||
"chipv1.1. Advanced user Command");
|
||||
|
||||
|
@ -1562,12 +1562,12 @@ void Detector::setGainMode(const defs::gainMode mode, Positions pos) {
|
||||
pimpl->Parallel(&Module::setGainMode, pos, mode);
|
||||
}
|
||||
|
||||
Result<int> Detector::getFilterCell(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getFilterCell, pos);
|
||||
Result<int> Detector::getNumberOfFilterCells(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getNumberOfFilterCells, pos);
|
||||
}
|
||||
|
||||
void Detector::setFilterCell(int cell, Positions pos) {
|
||||
pimpl->Parallel(&Module::setFilterCell, pos, cell);
|
||||
void Detector::setNumberOfFilterCells(int cell, Positions pos) {
|
||||
pimpl->Parallel(&Module::setNumberOfFilterCells, pos, cell);
|
||||
}
|
||||
|
||||
// Gotthard Specific
|
||||
|
@ -1692,12 +1692,12 @@ void Module::setGainMode(const slsDetectorDefs::gainMode mode) {
|
||||
sendToDetector(F_SET_GAIN_MODE, mode, nullptr);
|
||||
}
|
||||
|
||||
int Module::getFilterCell() const {
|
||||
return sendToDetector<int>(F_GET_FILTER_CELL);
|
||||
int Module::getNumberOfFilterCells() const {
|
||||
return sendToDetector<int>(F_GET_NUM_FILTER_CELLS);
|
||||
}
|
||||
|
||||
void Module::setFilterCell(int value) {
|
||||
sendToDetector(F_SET_FILTER_CELL, value, nullptr);
|
||||
void Module::setNumberOfFilterCells(int value) {
|
||||
sendToDetector(F_SET_NUM_FILTER_CELLS, value, nullptr);
|
||||
}
|
||||
|
||||
// Gotthard Specific
|
||||
|
@ -387,8 +387,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setStorageCellDelay(int64_t value);
|
||||
gainMode getGainMode() const;
|
||||
void setGainMode(const gainMode mode);
|
||||
int getFilterCell() const;
|
||||
void setFilterCell(int value);
|
||||
int getNumberOfFilterCells() const;
|
||||
void setNumberOfFilterCells(int value);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
|
@ -316,7 +316,7 @@ TEST_CASE("comp_disable_time", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("storagecells", "[.cmd]") {
|
||||
TEST_CASE("extrastoragecells", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@ -327,35 +327,35 @@ TEST_CASE("storagecells", "[.cmd]") {
|
||||
"inconsistent #additional storage cells to test");
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("storagecells", {"1"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "storagecells 1\n");
|
||||
proxy.Call("extrastoragecells", {"1"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "extrastoragecells 1\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("storagecells", {"15"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "storagecells 15\n");
|
||||
proxy.Call("extrastoragecells", {"15"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "extrastoragecells 15\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("storagecells", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "storagecells 0\n");
|
||||
proxy.Call("extrastoragecells", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "extrastoragecells 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("storagecells", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "storagecells 0\n");
|
||||
proxy.Call("extrastoragecells", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "extrastoragecells 0\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("storagecells", {"16"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("extrastoragecells", {"16"}, -1, PUT));
|
||||
det.setNumberOfAdditionalStorageCells(prev_val);
|
||||
}
|
||||
// chip version 1.1
|
||||
else {
|
||||
// cannot set number of addl. storage cells
|
||||
REQUIRE_THROWS(proxy.Call("storagecells", {"1"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("extrastoragecells", {"1"}, -1, PUT));
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("storagecells", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("storagecells", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("extrastoragecells", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("extrastoragecells", {"0"}, -1, PUT));
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,47 +494,47 @@ TEST_CASE("gainmode", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("filtercell", "[.cmd]") {
|
||||
TEST_CASE("filtercells", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU) {
|
||||
// chip version 1.1
|
||||
if (det.getChipVersion().squash() * 10 == 11) {
|
||||
auto prev_val = det.getFilterCell();
|
||||
auto prev_val = det.getNumberOfFilterCells();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("filtercell", {"1"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "filtercell 1\n");
|
||||
proxy.Call("filtercells", {"1"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "filtercells 1\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("filtercell", {"12"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "filtercell 12\n");
|
||||
proxy.Call("filtercells", {"12"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "filtercells 12\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("filtercell", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "filtercell 0\n");
|
||||
proxy.Call("filtercells", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "filtercells 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("filtercell", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "filtercell 0\n");
|
||||
proxy.Call("filtercells", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "filtercells 0\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("filtercell", {"13"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("filtercells", {"13"}, -1, PUT));
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setFilterCell(prev_val[i], {i});
|
||||
det.setNumberOfFilterCells(prev_val[i], {i});
|
||||
}
|
||||
}
|
||||
// chip version 1.0
|
||||
else {
|
||||
// cannot set/get filter cell
|
||||
REQUIRE_THROWS(proxy.Call("filtercell", {"1"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("filtercell", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("filtercells", {"1"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("filtercells", {}, -1, GET));
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("filtercell", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("filtercell", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("filtercells", {}, -1, GET));
|
||||
REQUIRE_THROWS(proxy.Call("filtercells", {"0"}, -1, PUT));
|
||||
}
|
||||
}
|
||||
|
@ -238,8 +238,8 @@ enum detFuncs {
|
||||
F_SET_COMP_DISABLE_TIME,
|
||||
F_GET_FLIP_ROWS,
|
||||
F_SET_FLIP_ROWS,
|
||||
F_GET_FILTER_CELL,
|
||||
F_SET_FILTER_CELL,
|
||||
F_GET_NUM_FILTER_CELLS,
|
||||
F_SET_NUM_FILTER_CELLS,
|
||||
F_SET_ADC_PIPELINE,
|
||||
F_GET_ADC_PIPELINE,
|
||||
F_SET_DBIT_PIPELINE,
|
||||
@ -593,8 +593,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_SET_COMP_DISABLE_TIME: return "F_SET_COMP_DISABLE_TIME";
|
||||
case F_GET_FLIP_ROWS: return "F_GET_FLIP_ROWS";
|
||||
case F_SET_FLIP_ROWS: return "F_SET_FLIP_ROWS";
|
||||
case F_GET_FILTER_CELL: return "F_GET_FILTER_CELL";
|
||||
case F_SET_FILTER_CELL: return "F_SET_FILTER_CELL";
|
||||
case F_GET_NUM_FILTER_CELLS: return "F_GET_NUM_FILTER_CELLS";
|
||||
case F_SET_NUM_FILTER_CELLS: return "F_SET_NUM_FILTER_CELLS";
|
||||
case F_SET_ADC_PIPELINE: return "F_SET_ADC_PIPELINE";
|
||||
case F_GET_ADC_PIPELINE: return "F_GET_ADC_PIPELINE";
|
||||
case F_SET_DBIT_PIPELINE: return "F_SET_DBIT_PIPELINE";
|
||||
|
@ -12,4 +12,4 @@
|
||||
#define APIMYTHEN3 0x211019
|
||||
#define APIMOENCH 0x211019
|
||||
#define APIEIGER 0x211019
|
||||
#define APIJUNGFRAU 0x211020
|
||||
#define APIJUNGFRAU 0x211021
|
||||
|
Loading…
x
Reference in New Issue
Block a user