exposing receiver thread ids to client (#102)

* exposing receiver thread ids to client

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
This commit is contained in:
Dhanya Thattil
2020-06-09 16:18:37 +02:00
committed by GitHub
parent 2a2bb5f63a
commit f5160b0978
48 changed files with 1151 additions and 580 deletions

View File

@ -852,7 +852,7 @@ void updateGatePeriod() {
uint32_t countermask = getCounterMask();
for (int i = 0; i != 3; ++i) {
// only if counter enabled
if ((1 << i) & countermask) {
if (countermask & (1 << i)) {
uint64_t sum = getExpTime(i) + getGateDelay(i);
if (sum > max) {
max = sum;
@ -1082,6 +1082,15 @@ void setDAC(enum DACINDEX ind, int val, int mV) {
return;
}
if (ind == M_VTHRESHOLD) {
LOG(logINFO,
("Setting Threshold voltages to %d %s\n", val, (mV ? "mv" : "")));
setDAC(M_VTH1, val, mV);
setDAC(M_VTH2, val, mV);
setDAC(M_VTH3, val, mV);
return;
}
char *dac_names[] = {DAC_NAMES};
LOG(logDEBUG1, ("Setting dac[%d - %s]: %d %s \n", (int)ind, dac_names[ind],
val, (mV ? "mV" : "dac units")));
@ -1106,6 +1115,23 @@ void setDAC(enum DACINDEX ind, int val, int mV) {
}
int getDAC(enum DACINDEX ind, int mV) {
if (ind == M_VTHRESHOLD) {
int ret[3] = {0};
ret[0] = getDAC(M_VTH1, mV);
ret[1] = getDAC(M_VTH2, mV);
ret[2] = getDAC(M_VTH3, mV);
if ((ret[0] == ret[1]) && (ret[1] == ret[2])) {
LOG(logINFO, ("\tvthreshold match\n"));
return ret[0];
} else {
LOG(logERROR, ("\tvthreshold mismatch vth1:%d vth2:%d "
"vth3:%d\n",
ret[0], ret[1], ret[2]));
return -1;
}
}
if (!mV) {
LOG(logDEBUG1, ("Getting DAC %d : %d dac\n", ind, detectorDacs[ind]));
return detectorDacs[ind];

View File

@ -56,43 +56,44 @@
/* Enums */
enum DACINDEX {
M_CASSH,
M_VCASSH,
M_VTH2,
M_VRFSH,
M_VRFSHNPOL,
M_VRSHAPER,
M_VRSHAPER_N,
M_VIPRE_OUT,
M_VTH3,
M_VTH1,
M_VICIN,
M_CAS,
M_VRF,
M_VPL,
M_VCAS,
M_VRPREAMP,
M_VCAL_N,
M_VIPRE,
M_VIINSH,
M_VPH,
M_VISHAPER,
M_VCAL_P,
M_VTRIM,
M_VDCSH
M_VDCSH,
M_VTHRESHOLD
};
#define DAC_NAMES \
"vcassh", "vth2", "vshaper", "vshaperneg", "vipre_out", "vth3", "vth1", \
"vicin", "vcas", "vpreamp", "vpl", "vipre", "viinsh", "vph", "vtrim", \
"vdcsh"
"vcassh", "vth2", "vrshaper", "vrshaper_n", "vipre_out", "vth3", "vth1", \
"vicin", "vcas", "vrpreamp", "vcal_n", "vipre", "vishaper", "vcal_p", \
"vtrim", "vdcsh"
#define DEFAULT_DAC_VALS \
{ \
1200, /* casSh */ \
2800, /* Vth2 */ \
1280, /* VrfSh */ \
2800, /* VrfShNpol */ \
1280, /* Vrshaper */ \
2800, /* Vrshaper_n */ \
1220, /* vIpreOut */ \
2800, /* Vth3 */ \
2800, /* Vth1 */ \
1708, /* vIcin */ \
1800, /* cas */ \
1100, /* Vrf */ \
1100, /* VPL */ \
1100, /* Vrpreamp */ \
1100, /* Vcal_n */ \
2624, /* vIpre */ \
1708, /* vIinSh */ \
1712, /* VPH */ \
1708, /* vishaper */ \
1712, /* Vcal_p */ \
2800, /* vTrim */ \
800 /* VdcSh */ \
};