mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-22 02:52:19 +01:00
finally all tests pass
This commit is contained in:
Binary file not shown.
@@ -1332,8 +1332,8 @@ void setVchip(int val) {
|
|||||||
int getVChipToSet(enum DACINDEX ind, int val) {
|
int getVChipToSet(enum DACINDEX ind, int val) {
|
||||||
LOG(logDEBUG1, ("Calculating vchip to set\n"));
|
LOG(logDEBUG1, ("Calculating vchip to set\n"));
|
||||||
// validate index & get adc index
|
// validate index & get adc index
|
||||||
int adcIndex = getADCIndexFromDACIndex(ind);
|
int pwrIndex = getADCIndexFromDACIndex(ind);
|
||||||
if (adcIndex == -1) {
|
if (pwrIndex == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1346,14 +1346,14 @@ int getVChipToSet(enum DACINDEX ind, int val) {
|
|||||||
// get the dac values for each adc
|
// get the dac values for each adc
|
||||||
char emsg[MAX_STR_LENGTH];
|
char emsg[MAX_STR_LENGTH];
|
||||||
int dacmV = -1;
|
int dacmV = -1;
|
||||||
if (getPower(ipwr, &dacmV, emsg) == FAIL) {
|
if (getPower(ind, &dacmV, emsg) == FAIL) {
|
||||||
LOG(logERROR, ("Could not get power %d to calculate vchip. %s\n",
|
LOG(logERROR, ("Could not get power %d to calculate vchip. %s\n",
|
||||||
ipwr, emsg));
|
ipwr, emsg));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if current index, replace with value to be set
|
// if current index, replace with value to be set
|
||||||
if (ipwr == adcIndex) {
|
if (ipwr == pwrIndex) {
|
||||||
dacmV = val;
|
dacmV = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1470,19 +1470,8 @@ int getPowerEnable(int pwrIndex) {
|
|||||||
return (bus_r(POWER_REG) & mask);
|
return (bus_r(POWER_REG) & mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
int isPowerValid(enum DACINDEX ind, int val, char *mess) {
|
int isPowerValid(int pwrIndex, int val, char *mess) {
|
||||||
char *powerNames[] = {PWR_NAMES};
|
char *powerNames[] = {PWR_NAMES};
|
||||||
|
|
||||||
// validate & get power index
|
|
||||||
int pwrIndex = getADCIndexFromDACIndex(ind);
|
|
||||||
if (pwrIndex == -1) {
|
|
||||||
snprintf(mess, MAX_STR_LENGTH,
|
|
||||||
"Could not validate power. Invalid DAC index: %d for Power\n",
|
|
||||||
ind);
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check vlimit
|
// check vlimit
|
||||||
if (checkVLimitCompliant(val) == FAIL) {
|
if (checkVLimitCompliant(val) == FAIL) {
|
||||||
snprintf(mess, MAX_STR_LENGTH,
|
snprintf(mess, MAX_STR_LENGTH,
|
||||||
@@ -1581,7 +1570,7 @@ int setPower(enum DACINDEX ind, int val, char *mess) {
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPowerValid(ind, val, mess) == FAIL) {
|
if (isPowerValid(pwrIndex, val, mess) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -387,7 +387,7 @@ int voltageToDac_PowerRegulators(int pwrIndex, int voltage, int *retval,
|
|||||||
char *mess);
|
char *mess);
|
||||||
void powerEnable(int on, int pwrIndex);
|
void powerEnable(int on, int pwrIndex);
|
||||||
int getPowerEnable(int pwrIndex);
|
int getPowerEnable(int pwrIndex);
|
||||||
int isPowerValid(enum DACINDEX ind, int val, char *mess);
|
int isPowerValid(int pwrIndex, int val, char *mess);
|
||||||
int getPower(enum DACINDEX ind, int *retval, char *mess);
|
int getPower(enum DACINDEX ind, int *retval, char *mess);
|
||||||
int setPower(enum DACINDEX ind, int val, char *mess);
|
int setPower(enum DACINDEX ind, int val, char *mess);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1323,19 +1323,9 @@ int getPowerEnable(int pwrIndex) {
|
|||||||
return (bus_r(CTRL_REG) & mask);
|
return (bus_r(CTRL_REG) & mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
int isPowerValid(enum DACINDEX ind, int val, char *mess) {
|
int isPowerValid(int pwrIndex, int val, char *mess) {
|
||||||
char *powerNames[] = {PWR_NAMES};
|
char *powerNames[] = {PWR_NAMES};
|
||||||
|
|
||||||
// validate & get power index
|
|
||||||
int pwrIndex = getPwrIndex(ind);
|
|
||||||
if (pwrIndex == -1) {
|
|
||||||
snprintf(mess, MAX_STR_LENGTH,
|
|
||||||
"Could not validate power. Invalid DAC index: %d for Power\n",
|
|
||||||
ind);
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check vlimit
|
// check vlimit
|
||||||
if (checkVLimitCompliant(val) == FAIL) {
|
if (checkVLimitCompliant(val) == FAIL) {
|
||||||
snprintf(mess, MAX_STR_LENGTH,
|
snprintf(mess, MAX_STR_LENGTH,
|
||||||
@@ -1410,7 +1400,7 @@ int setPower(enum DACINDEX ind, int val, char *mess) {
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPowerValid(ind, val, mess) == FAIL) {
|
if (isPowerValid(pwrIndex, val, mess) == FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1070,7 +1070,6 @@ TEST_CASE("v_abcd", "[.cmdcall]") {
|
|||||||
if (det_type == defs::XILINX_CHIPTESTBOARD &&
|
if (det_type == defs::XILINX_CHIPTESTBOARD &&
|
||||||
prev_val[i] == -100) {
|
prev_val[i] == -100) {
|
||||||
prev_val[i] = 0;
|
prev_val[i] = 0;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
det.setPower(indices[i], prev_val[i], {i});
|
det.setPower(indices[i], prev_val[i], {i});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
/** API versions */
|
/** API versions */
|
||||||
#define APILIB "0.0.0 0x250909"
|
#define APILIB "0.0.0 0x250909"
|
||||||
#define APIRECEIVER "0.0.0 0x250822"
|
#define APIRECEIVER "0.0.0 0x250822"
|
||||||
#define APICTB "0.0.0 0x260115"
|
#define APICTB "0.0.0 0x260116"
|
||||||
#define APIGOTTHARD2 "0.0.0 0x260114"
|
#define APIGOTTHARD2 "0.0.0 0x260114"
|
||||||
#define APIMOENCH "0.0.0 0x250909"
|
#define APIMOENCH "0.0.0 0x260107"
|
||||||
#define APIEIGER "0.0.0 0x250909"
|
#define APIEIGER "0.0.0 0x260107"
|
||||||
#define APIXILINXCTB "0.0.0 0x260115"
|
#define APIXILINXCTB "0.0.0 0x260116"
|
||||||
#define APIJUNGFRAU "0.0.0 0x250909"
|
#define APIJUNGFRAU "0.0.0 0x260107"
|
||||||
#define APIMYTHEN3 "0.0.0 0x260114"
|
#define APIMYTHEN3 "0.0.0 0x260114"
|
||||||
|
|||||||
Reference in New Issue
Block a user