Merge branch 'developer' into jf_singlemodule

This commit is contained in:
hinger_v 2024-07-26 15:56:23 +02:00
commit 9d2d4f49d4
8 changed files with 29 additions and 26 deletions

View File

@ -316,7 +316,8 @@ struct GenericStringRef {
GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {}
GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } // Removed to fix failing build in GCC 14
// GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
//! implicit conversion to plain CharType pointer //! implicit conversion to plain CharType pointer
operator const Ch *() const { return s; } operator const Ch *() const { return s; }

View File

@ -70,7 +70,7 @@
#define ADC_PHASE_DEG_QUARTER_SPEED (0) #define ADC_PHASE_DEG_QUARTER_SPEED (0)
#define ADC_PHASE_DEG_HALF_SPEED (0) #define ADC_PHASE_DEG_HALF_SPEED (0)
#define ADC_PHASE_DEG_FULL_SPEED (300) #define ADC_PHASE_DEG_FULL_SPEED (150)
#define ADC_OFST_QUARTER_SPEED (0x12) #define ADC_OFST_QUARTER_SPEED (0x12)
#define ADC_OFST_HALF_SPEED (0x12) #define ADC_OFST_HALF_SPEED (0x12)
@ -133,7 +133,7 @@ enum DACINDEX {
680, /* MO_VB_SDA */ \ 680, /* MO_VB_SDA */ \
1428, /* MO_VCASC_SFP */ \ 1428, /* MO_VCASC_SFP */ \
1200, /* MO_VOUT_CM */ \ 1200, /* MO_VOUT_CM */ \
800, /* MO_VIPRE_CDS */ \ 1280, /* MO_VIPRE_CDS */ \
900 /* MO_IBIAS_SFP */ \ 900 /* MO_IBIAS_SFP */ \
}; };

View File

@ -480,6 +480,11 @@ void setupDetector() {
READOUT_PLL_VCO_FREQ_HZ, SYSTEM_PLL_VCO_FREQ_HZ); READOUT_PLL_VCO_FREQ_HZ, SYSTEM_PLL_VCO_FREQ_HZ);
ALTERA_PLL_C10_ResetPLL(READOUT_PLL); ALTERA_PLL_C10_ResetPLL(READOUT_PLL);
ALTERA_PLL_C10_ResetPLL(SYSTEM_PLL); ALTERA_PLL_C10_ResetPLL(SYSTEM_PLL);
// change startup clock divider in software
// because firmware only sets max clock divider
setClockDividerWithTimeUpdateOption(READOUT_C0, DEFAULT_READOUT_C0_STARTUP,
0);
// hv // hv
DAC6571_SetDefines(HV_HARD_MAX_VOLTAGE, HV_DRIVER_FILE_NAME); DAC6571_SetDefines(HV_HARD_MAX_VOLTAGE, HV_DRIVER_FILE_NAME);
// dac // dac
@ -2333,6 +2338,7 @@ int setClockDividerWithTimeUpdateOption(enum CLKINDEX ind, int val,
return FAIL; return FAIL;
} }
if (val < 2 || val > getMaxClockDivider()) { if (val < 2 || val > getMaxClockDivider()) {
LOG(logERROR, ("Invalid clock divider %d\n", val));
return FAIL; return FAIL;
} }
char *clock_names[] = {CLK_NAMES}; char *clock_names[] = {CLK_NAMES};

View File

@ -65,6 +65,8 @@
#define DEFAULT_SYSTEM_C2 (5) //(200000000) // smp_clk, 200 MHz const #define DEFAULT_SYSTEM_C2 (5) //(200000000) // smp_clk, 200 MHz const
#define DEFAULT_TRIMMING_RUN_CLKDIV (40) // (25000000) // 25 MHz #define DEFAULT_TRIMMING_RUN_CLKDIV (40) // (25000000) // 25 MHz
#define DEFAULT_READOUT_C0_STARTUP (20) //(50000000) // rdo_clk, 50 MHz
#define DEFAULT_ASIC_LATCHING_NUM_PULSES (10) #define DEFAULT_ASIC_LATCHING_NUM_PULSES (10)
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20) #define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
#define DEFAULT_ADIF_PIPELINE_VAL (8) #define DEFAULT_ADIF_PIPELINE_VAL (8)

View File

@ -744,9 +744,8 @@ void DetectorImpl::readFrameFromReceiver() {
} }
} }
LOG(logDEBUG) << "Call Back Info:" LOG(logDEBUG) << "Call Back Info:" << "\n\t nDetPixelsX: "
<< "\n\t nDetPixelsX: " << nDetPixelsX << nDetPixelsX << "\n\t nDetPixelsY: " << nDetPixelsY
<< "\n\t nDetPixelsY: " << nDetPixelsY
<< "\n\t databytes: " << multisize << "\n\t databytes: " << multisize
<< "\n\t dynamicRange: " << dynamicRange; << "\n\t dynamicRange: " << dynamicRange;
@ -764,8 +763,8 @@ void DetectorImpl::readFrameFromReceiver() {
callbackImage = multigappixels; callbackImage = multigappixels;
imagesize = n; imagesize = n;
} }
LOG(logDEBUG) << "Image Info:" LOG(logDEBUG) << "Image Info:" << "\n\tnDetActualPixelsX: "
<< "\n\tnDetActualPixelsX: " << nDetActualPixelsX << nDetActualPixelsX
<< "\n\tnDetActualPixelsY: " << nDetActualPixelsY << "\n\tnDetActualPixelsY: " << nDetActualPixelsY
<< "\n\timagesize: " << imagesize << "\n\timagesize: " << imagesize
<< "\n\tdynamicRange: " << dynamicRange; << "\n\tdynamicRange: " << dynamicRange;
@ -800,8 +799,7 @@ void DetectorImpl::readFrameFromReceiver() {
int DetectorImpl::insertGapPixels(char *image, char *&gpImage, bool quadEnable, int DetectorImpl::insertGapPixels(char *image, char *&gpImage, bool quadEnable,
int dr, int &nPixelsx, int &nPixelsy) { int dr, int &nPixelsx, int &nPixelsy) {
LOG(logDEBUG) << "Insert Gap pixels:" LOG(logDEBUG) << "Insert Gap pixels:" << "\n\t nPixelsx: " << nPixelsx
<< "\n\t nPixelsx: " << nPixelsx
<< "\n\t nPixelsy: " << nPixelsy << "\n\t nPixelsy: " << nPixelsy
<< "\n\t quadEnable: " << quadEnable << "\n\t dr: " << dr; << "\n\t quadEnable: " << quadEnable << "\n\t dr: " << dr;
@ -886,12 +884,10 @@ int DetectorImpl::insertGapPixels(char *image, char *&gpImage, bool quadEnable,
<< "nMod1Pixelsy: " << nMod1Pixelsy << "\n\t" << "nMod1Pixelsy: " << nMod1Pixelsy << "\n\t"
<< "nMod1GapPixelsx: " << nMod1GapPixelsx << "\n\t" << "nMod1GapPixelsx: " << nMod1GapPixelsx << "\n\t"
<< "nMod1GapPixelsy: " << nMod1GapPixelsy << "\n\t" << "nMod1GapPixelsy: " << nMod1GapPixelsy << "\n\t"
<< "nChipy: " << nChipy << "\n\t" << "nChipy: " << nChipy << "\n\t" << "nChipx: " << nChipx
<< "nChipx: " << nChipx << "\n\t" << "\n\t" << "nModx: " << nModx << "\n\t"
<< "nModx: " << nModx << "\n\t" << "nMody: " << nMody << "\n\t" << "nTotx: " << nTotx
<< "nMody: " << nMody << "\n\t" << "\n\t" << "nToty: " << nToty << "\n\t"
<< "nTotx: " << nTotx << "\n\t"
<< "nToty: " << nToty << "\n\t"
<< "bytesPerPixel: " << bytesPerPixel << "\n\t" << "bytesPerPixel: " << bytesPerPixel << "\n\t"
<< "imagesize: " << imagesize << "\n\t" << "imagesize: " << imagesize << "\n\t"
<< "nChipBytesx: " << nChipBytesx << "\n\t" << "nChipBytesx: " << nChipBytesx << "\n\t"
@ -1323,6 +1319,11 @@ void DetectorImpl::startAcquisition(const bool blocking, Positions pos) {
// ensure all status normal (slaves not blocking) // ensure all status normal (slaves not blocking)
// to catch those slaves that are still 'waiting' // to catch those slaves that are still 'waiting'
auto status = Parallel(&Module::getRunStatus, pos); auto status = Parallel(&Module::getRunStatus, pos);
// if any slave still waiting, wait up to 1s
for (int i = 0; i != 20 && status.any(WAITING); ++i) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
status = Parallel(&Module::getRunStatus, pos);
}
if (!status.contains_only(IDLE, STOPPED, RUN_FINISHED)) { if (!status.contains_only(IDLE, STOPPED, RUN_FINISHED)) {
throw RuntimeError("Acquisition not successful. " throw RuntimeError("Acquisition not successful. "
"Unexpected detector status"); "Unexpected detector status");
@ -1981,7 +1982,7 @@ void DetectorImpl::setBadChannels(const std::vector<int> list, Positions pos) {
// update to multi values if multi modules // update to multi values if multi modules
if (isAllPositions(pos)) { if (isAllPositions(pos)) {
std::vector<std::vector<int>> badchannels; std::vector<std::vector<int>> badchannels(modules.size());
int nchan = modules[0]->getNumberOfChannels().x; int nchan = modules[0]->getNumberOfChannels().x;
if (shm()->detType == MYTHEN3) { if (shm()->detType == MYTHEN3) {
// assuming single counter // assuming single counter
@ -2000,16 +2001,9 @@ void DetectorImpl::setBadChannels(const std::vector<int> list, Positions pos) {
std::to_string(badchannel) + std::to_string(badchannel) +
" out of bounds."); " out of bounds.");
} }
if (badchannels.size() != imod + 1) {
badchannels.push_back(std::vector<int>{});
}
badchannels[imod].push_back(ch); badchannels[imod].push_back(ch);
} }
for (size_t imod = 0; imod != modules.size(); ++imod) { for (size_t imod = 0; imod != modules.size(); ++imod) {
// add empty vector if no bad channels in this module
if (badchannels.size() != imod + 1) {
badchannels.push_back(std::vector<int>{});
}
Parallel(&Module::setBadChannels, {static_cast<int>(imod)}, Parallel(&Module::setBadChannels, {static_cast<int>(imod)},
badchannels[imod]); badchannels[imod]);
} }

View File

@ -8,7 +8,7 @@
#define APIGOTTHARD "developer 0x240207" #define APIGOTTHARD "developer 0x240207"
#define APIGOTTHARD2 "developer 0x240207" #define APIGOTTHARD2 "developer 0x240207"
#define APIJUNGFRAU "developer 0x240207" #define APIJUNGFRAU "developer 0x240207"
#define APIMYTHEN3 "developer 0x240207"
#define APIMOENCH "developer 0x240207"
#define APIXILINXCTB "developer 0x240207" #define APIXILINXCTB "developer 0x240207"
#define APIEIGER "developer 0x240207" #define APIEIGER "developer 0x240207"
#define APIMOENCH "developer 0x240703"
#define APIMYTHEN3 "developer 0x240715"