mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
jungfrau: new default to asic reg for chipv1.1, filtercells name change, wrongnumberof parameters message change
This commit is contained in:
parent
f7a6160e67
commit
9b321d2ee1
@ -2292,7 +2292,7 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
@element
|
||||
def filtercell(self):
|
||||
def filtercells(self):
|
||||
"""
|
||||
[Jungfrau] Set filter capacitor.
|
||||
Note
|
||||
@ -2301,8 +2301,8 @@ class Detector(CppDetectorApi):
|
||||
"""
|
||||
return self.getFilterCell()
|
||||
|
||||
@filtercell.setter
|
||||
def filtercell(self, value):
|
||||
@filtercells.setter
|
||||
def filtercells(self, value):
|
||||
ut.set_using_dict(self.setFilterCell, value)
|
||||
|
||||
@property
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
@ -2213,7 +2217,8 @@ 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));
|
||||
}
|
||||
@ -2336,13 +2341,12 @@ int getFixCurrentSource() {
|
||||
|
||||
int getNormalCurrentSource() {
|
||||
if (getChipVersion() == 11) {
|
||||
//TODO FIRMWARE FIX TOGGLING
|
||||
// TODO FIRMWARE FIX TOGGLING
|
||||
int regval = bus_r(CONFIG_V11_STATUS_REG);
|
||||
#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);
|
||||
}
|
||||
|
@ -82,8 +82,13 @@ std::map<std::string, std::string> CmdProxy::GetDepreciatedCommands() {
|
||||
}
|
||||
|
||||
void CmdProxy::WrongNumberOfParameters(size_t expected) {
|
||||
if (expected == 0) {
|
||||
throw RuntimeError("Command " + cmd +
|
||||
" expected no parameter/s but got " +
|
||||
std::to_string(args.size()) + "\n");
|
||||
}
|
||||
throw RuntimeError(
|
||||
"Command " + cmd + " expected <=" + std::to_string(expected) +
|
||||
"Command " + cmd + " expected >=" + std::to_string(expected) +
|
||||
" parameter/s but got " + std::to_string(args.size()) + "\n");
|
||||
}
|
||||
|
||||
|
@ -948,7 +948,7 @@ class CmdProxy {
|
||||
{"storagecell_start", &CmdProxy::storagecell_start},
|
||||
{"storagecell_delay", &CmdProxy::storagecell_delay},
|
||||
{"gainmode", &CmdProxy::gainmode},
|
||||
{"filtercell", &CmdProxy::filtercell},
|
||||
{"filtercells", &CmdProxy::filtercells},
|
||||
|
||||
/* Gotthard Specific */
|
||||
{"roi", &CmdProxy::ROI},
|
||||
@ -1951,7 +1951,7 @@ 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,
|
||||
INTEGER_COMMAND_VEC_ID(filtercells, getFilterCell, setFilterCell,
|
||||
sls::StringTo<int>,
|
||||
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for "
|
||||
"chipv1.1. Advanced user Command");
|
||||
|
Loading…
x
Reference in New Issue
Block a user