From c7c52c63cd103daabd54e8a007a98414442b34ce Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 27 Mar 2019 12:25:38 +0100 Subject: [PATCH] ctb & moench: phase fix for absolute within limits, option to set as degrees and get max phase shift, bug fix for eiger with implementation of 2 udp interface --- .../ctbDetectorServer/gitInfo.txt | 10 +- .../ctbDetectorServer/gitInfoCtb.h | 8 +- .../slsDetectorFunctionList.c | 119 +++- slsDetectorServers/eigerDetectorServer/Beb.c | 17 +- .../eigerDetectorServer/gitInfo.txt | 10 +- .../eigerDetectorServer/gitInfoEiger.h | 8 +- .../slsDetectorFunctionList.c | 15 + .../moenchDetectorServer/RegisterDefs.h | 11 - .../slsDetectorFunctionList.c | 178 ++++-- .../slsDetectorServer/ALTERA_PLL.h | 2 +- .../slsDetectorFunctionList.h | 11 +- .../slsDetectorServer_funcs.c | 88 ++- .../include/multiSlsDetector.h | 6 +- slsDetectorSoftware/include/slsDetector.h | 5 +- slsDetectorSoftware/src/multiSlsDetector.cpp | 6 +- slsDetectorSoftware/src/slsDetector.cpp | 6 +- .../src/slsDetectorCommand.cpp | 600 +++++++++--------- .../src/slsReceiverImplementation.cpp | 4 +- .../src/slsReceiverTCPIPInterface.cpp | 11 +- slsSupportLib/include/sls_detector_defs.h | 6 +- 20 files changed, 667 insertions(+), 454 deletions(-) diff --git a/slsDetectorServers/ctbDetectorServer/gitInfo.txt b/slsDetectorServers/ctbDetectorServer/gitInfo.txt index cf7869e3c..814393a1e 100644 --- a/slsDetectorServers/ctbDetectorServer/gitInfo.txt +++ b/slsDetectorServers/ctbDetectorServer/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorPackage/slsDetectorServers/ctbDetectorServer URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -Repsitory UUID: 7cd5bc8b2db6e89fbec4c06c65e683cf788338c0 -Revision: 46 -Branch: jungfrau +Repsitory UUID: c7ad548e4c2026a826b9f269f32d9970ce0a44e8 +Revision: 48 +Branch: refactor Last Changed Author: Dhanya_Thattil -Last Changed Rev: 4474 -Last Changed Date: 2019-03-26 15:01:04.000000002 +0100 ./slsDetectorServer_defs.h +Last Changed Rev: 4478 +Last Changed Date: 2019-03-27 11:13:21.000000002 +0100 ../slsDetectorServer/slsDetectorServer_funcs.c diff --git a/slsDetectorServers/ctbDetectorServer/gitInfoCtb.h b/slsDetectorServers/ctbDetectorServer/gitInfoCtb.h index d54dbb3d4..d215e992d 100644 --- a/slsDetectorServers/ctbDetectorServer/gitInfoCtb.h +++ b/slsDetectorServers/ctbDetectorServer/gitInfoCtb.h @@ -1,6 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" -#define GITREPUUID "7cd5bc8b2db6e89fbec4c06c65e683cf788338c0" +#define GITREPUUID "c7ad548e4c2026a826b9f269f32d9970ce0a44e8" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x4474 -#define GITDATE 0x20190326 -#define GITBRANCH "jungfrau" +#define GITREV 0x4478 +#define GITDATE 0x20190327 +#define GITBRANCH "refactor" diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 6b1a5ab0e..c865bbdf8 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -781,16 +781,15 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret) { /* parameters - speed, readout */ -void setSpeed(enum speedVariable ind, int val) { +void setSpeed(enum speedVariable ind, int val, int mode) { switch(ind) { case ADC_PHASE: - case PHASE_SHIFT: FILE_LOG(logINFOBLUE, ("Configuring ADC Phase\n")); - configurePhase(ADC_CLK, val); + configurePhase(ADC_CLK, val, mode); break; case DBIT_PHASE: FILE_LOG(logINFOBLUE, ("Configuring Dbit Phase\n")); - configurePhase(DBIT_CLK, val); + configurePhase(DBIT_CLK, val, mode); break; case ADC_CLOCK: FILE_LOG(logINFOBLUE, ("Configuring ADC Clock\n")); @@ -818,23 +817,26 @@ void setSpeed(enum speedVariable ind, int val) { } } -int getSpeed(enum speedVariable ind) { +int getSpeed(enum speedVariable ind, int mode) { switch(ind) { case ADC_PHASE: - case PHASE_SHIFT: - return getPhase(ADC_CLK); + return getPhase(ADC_CLK, mode); case DBIT_PHASE: - return getPhase(DBIT_CLK); + return getPhase(DBIT_CLK, mode); + case MAX_ADC_PHASE_SHIFT: + return getMaxPhase(ADC_CLK); + case MAX_DBIT_PHASE_SHIFT: + return getMaxPhase(DBIT_CLK); case ADC_CLOCK: return getFrequency(ADC_CLK); case DBIT_CLOCK: return getFrequency(DBIT_CLK); + case CLOCK_DIVIDER: + return getFrequency(RUN_CLK); case ADC_PIPELINE: return getAdcOffsetRegister(1); case DBIT_PIPELINE: return getAdcOffsetRegister(0); - case CLOCK_DIVIDER: - return getFrequency(RUN_CLK); default: return -1; } @@ -1633,41 +1635,100 @@ int enableTenGigabitEthernet(int val) { // ind can only be ADC_CLK or DBIT_CLK -void configurePhase(enum CLKINDEX ind, int val) { - char clock_names[4][10]={"run_clk","adc_clk", "sync_clk", "dbit_clk"}; - if (val > 65535 || val < -65535) { - FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits\n", ind, clock_names[ind])); - return; - } - int relativePhase = clkPhase[ind] - val; +void configurePhase(enum CLKINDEX ind, int val, int degrees) { + char clock_names[4][10]={"run_clk","adc_clk", "sync_clk", "dbit_clk"}; + int maxShift = getMaxPhase(ind); + + // validation + if (degrees && (val < 0 || val > 359)) { + FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits (0 - 359°C)\n", ind, clock_names[ind])); + return; + } + if (!degrees && (val < 0 || val > maxShift - 1)) { + FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits (0 - %d phase shifts)\n", ind, clock_names[ind], maxShift - 1)); + return; + } + + FILE_LOG(logINFO, ("Configuring Phase of C%d(%s) to %d (degree mode: %d)\n", ind, clock_names[ind], val, degrees)); + int valShift = val; + // convert to phase shift + if (degrees) { + double temp = val * ((double)maxShift / 360.00); + if ((temp - (int)temp) > 0.0001) { + temp += 0.5; + } + valShift = temp; + FILE_LOG(logDEBUG1, ("phase shift: %d\n", valShift)); + } + FILE_LOG(logDEBUG1, ("phase shift: %d (degrees/shift: %d)\n", valShift, val)); + + int relativePhase = clkPhase[ind] - valShift; + FILE_LOG(logDEBUG1, ("relative phase shift: %d (Current phase: %d)\n", relativePhase, clkPhase[ind])); // same phase if (!relativePhase) { + FILE_LOG(logDEBUG1, ("Nothing to do\n")); return; } - FILE_LOG(logINFO, ("Configuring Phase of C%d(%s) to %d\n", ind, clock_names[ind], val)); - int phase = 0; - int maxShifts = (PLL_VCO_FREQ_MHZ / clkDivider[ind]) * MAX_PHASE_SHIFTS_STEPS; - FILE_LOG(logDEBUG1, ("Clock: %d MHz, VCO:%d MHz, Max Phase shifts:%d\n", - clkDivider[ind], PLL_VCO_FREQ_MHZ, maxShifts)); - - // delay clk if (relativePhase > 0) { - phase = (maxShifts - relativePhase); + phase = (maxShift - relativePhase); } else { phase = (-1) * relativePhase; } - FILE_LOG(logINFO, ("\tphase out %d (0x%08x)\n", phase, phase)); + FILE_LOG(logDEBUG1, ("[Single Direction] Phase:%d (0x%x). Max Phase shifts:%d\n", phase, phase, maxShift)); ALTERA_PLL_SetPhaseShift(phase, (int)ind, 0); - clkPhase[ind] = val; + clkPhase[ind] = valShift; } -int getPhase(enum CLKINDEX ind) { - return clkPhase[ind]; +int getPhase(enum CLKINDEX ind, int degrees) { + if (!degrees) + return clkPhase[ind]; + return (clkPhase[ind] * (360.00 / (double)getMaxPhase(ind))); +} + +int getMaxPhase(enum CLKINDEX ind) { + int ret = ((double)PLL_VCO_FREQ_MHZ / (double)clkDivider[ind]) * MAX_PHASE_SHIFTS_STEPS; + + char clock_names[4][10]={"run_clk","adc_clk", "sync_clk", "dbit_clk"}; + FILE_LOG(logDEBUG1, ("Max Phase Shift (%s): %d (Clock: %d MHz, VCO:%d MHz)\n", + clock_names[ind], ret, clkDivider[ind], PLL_VCO_FREQ_MHZ)); + + return ret; +} + +int validatePhaseinDegrees(enum speedVariable ind, int val, int retval) { + if (val == -1) + return OK; + enum CLKINDEX clkIndex; + switch(ind) { + case ADC_PHASE: + clkIndex = ADC_CLK; + break; + case DBIT_PHASE: + clkIndex = DBIT_CLK; + break; + default: + FILE_LOG(logERROR, ("Unknown speed enum %d for validating phase in degrees\n", (int)ind)); + } + FILE_LOG(logDEBUG1, ("validating phase in degrees for clk %d\n", clkIndex)); + int maxShift = getMaxPhase(clkIndex); + // convert degrees to shift + double temp = val; + temp *= ((double)maxShift / 360.00); + if ((temp - (int)temp) > 0.0001) { + temp += 0.5; + } + val = (int)temp; + // convert back to degrees + val *= (360.00 / (double)maxShift); + + if (val == retval) + return OK; + return FAIL; } void configureFrequency(enum CLKINDEX ind, int val) { diff --git a/slsDetectorServers/eigerDetectorServer/Beb.c b/slsDetectorServers/eigerDetectorServer/Beb.c index a97483810..69cfdec51 100644 --- a/slsDetectorServers/eigerDetectorServer/Beb.c +++ b/slsDetectorServers/eigerDetectorServer/Beb.c @@ -1209,16 +1209,19 @@ int Beb_SetDetectorPosition(int pos[]) { value &= UDP_HEADER_ID_MSK; // to keep previous id value Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK)); value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST); - if ((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK)) + if ((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK)) { + FILE_LOG(logERROR, ("Could not set row position for left port\n")); ret = FAIL; - + } // x right value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST); value &= UDP_HEADER_ID_MSK; // to keep previous id value Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST, value | ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK)); value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST); - if ((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK)) + if ((value & UDP_HEADER_X_MSK) != ((pos[0] << UDP_HEADER_X_OFST) & UDP_HEADER_X_MSK)) { + FILE_LOG(logERROR, ("Could not set row position for right port\n")); ret = FAIL; + } @@ -1228,8 +1231,10 @@ int Beb_SetDetectorPosition(int pos[]) { value &= UDP_HEADER_Z_MSK; // to keep previous z value Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST, value | ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)); value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST); - if ((value & UDP_HEADER_Z_MSK) != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) + if ((value & UDP_HEADER_Y_MSK) != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) { + FILE_LOG(logERROR, ("Could not set column position for left port\n")); ret = FAIL; + } // y right value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST); @@ -1237,8 +1242,10 @@ int Beb_SetDetectorPosition(int pos[]) { posval = Beb_swap_uint16(Beb_top ? (pos[1]+1) : pos[1]); Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST, value | ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)); value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST); - if ((value & UDP_HEADER_Z_MSK) != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) + if ((value & UDP_HEADER_Y_MSK) != ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) { + FILE_LOG(logERROR, ("Could not set column position for right port\n")); ret = FAIL; + } //close file pointer diff --git a/slsDetectorServers/eigerDetectorServer/gitInfo.txt b/slsDetectorServers/eigerDetectorServer/gitInfo.txt index 5b9a3350e..dc8fa658b 100644 --- a/slsDetectorServers/eigerDetectorServer/gitInfo.txt +++ b/slsDetectorServers/eigerDetectorServer/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorPackage/slsDetectorServers/eigerDetectorServer URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -Repsitory UUID: cd5aea895b07b7af25e3fb74a341a861f9aa291c -Revision: 30 -Branch: jungfrau +Repsitory UUID: c7ad548e4c2026a826b9f269f32d9970ce0a44e8 +Revision: 31 +Branch: refactor Last Changed Author: Dhanya_Thattil -Last Changed Rev: 4473 -Last Changed Date: 2019-03-22 17:13:44.000000002 +0100 ../slsDetectorServer/slsDetectorServer_funcs.c +Last Changed Rev: 4478 +Last Changed Date: 2019-03-27 08:46:12.000000002 +0100 ./Beb.c diff --git a/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h b/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h index 540b4d733..d215e992d 100644 --- a/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h +++ b/slsDetectorServers/eigerDetectorServer/gitInfoEiger.h @@ -1,6 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" -#define GITREPUUID "cd5aea895b07b7af25e3fb74a341a861f9aa291c" +#define GITREPUUID "c7ad548e4c2026a826b9f269f32d9970ce0a44e8" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x4473 -#define GITDATE 0x20190322 -#define GITBRANCH "jungfrau" +#define GITREV 0x4478 +#define GITDATE 0x20190327 +#define GITBRANCH "refactor" diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index ae8dcf1b3..4409ef5ec 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -820,6 +820,21 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret) { return rois; } +// parameters - readout +void setSpeed(enum speedVariable ind, int val) { + switch(ind) { + case ADC_PHASE: + setPhaseShift(val); + break; + default: + return; + } +} + +int getSpeed(enum speedVariable ind) { + // cannot get phase shift + return -1; +} /* parameters - timer */ diff --git a/slsDetectorServers/moenchDetectorServer/RegisterDefs.h b/slsDetectorServers/moenchDetectorServer/RegisterDefs.h index f28f00f43..a946a0a47 100644 --- a/slsDetectorServers/moenchDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/moenchDetectorServer/RegisterDefs.h @@ -533,17 +533,6 @@ #define PATTERN_SET_LSB_REG (0x82 << MEM_MAP_SHIFT) #define PATTERN_SET_MSB_REG (0x83 << MEM_MAP_SHIFT) -/** I2C Control register */ -//#define I2C_TRANSFER_COMMAND_FIFO_REG (0x100 << MEM_MAP_SHIFT) // in FW, but not used anywhere -//#define I2C_CONTROL_REG (0x102 << MEM_MAP_SHIFT) // in FW, but not used anywhere -//#define I2C_RX_DATA_FIFO_LEVEL_REG (0x107 << MEM_MAP_SHIFT) // in FW, but not used anywhere -//#define I2C_SCL_LOW_COUNT_REG (0x108 << MEM_MAP_SHIFT) // in FW, but not used anywhere -//#define I2C_SCL_HIGH_COUNT_REG (0x109 << MEM_MAP_SHIFT) // in FW, but not used anywhere -//#define I2C_SDA_HOLD_REG (0x10A << MEM_MAP_SHIFT) // in FW, but not used anywhere - - - - diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index e049418ea..a213d9360 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -757,16 +757,15 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret) { /* parameters - speed, readout */ -void setSpeed(enum speedVariable ind, int val) { +void setSpeed(enum speedVariable ind, int val, int mode) { switch(ind) { case ADC_PHASE: - case PHASE_SHIFT: FILE_LOG(logINFOBLUE, ("Configuring ADC Phase\n")); - configurePhase(ADC_CLK, val); + configurePhase(ADC_CLK, val, mode); break; case DBIT_PHASE: FILE_LOG(logINFOBLUE, ("Configuring Dbit Phase\n")); - configurePhase(DBIT_CLK, val); + configurePhase(DBIT_CLK, val, mode); break; case ADC_CLOCK: FILE_LOG(logINFOBLUE, ("Configuring ADC Clock\n")); @@ -794,23 +793,26 @@ void setSpeed(enum speedVariable ind, int val) { } } -int getSpeed(enum speedVariable ind) { +int getSpeed(enum speedVariable ind, int mode) { switch(ind) { case ADC_PHASE: - case PHASE_SHIFT: - return getPhase(ADC_CLK); + return getPhase(ADC_CLK, mode); case DBIT_PHASE: - return getPhase(DBIT_CLK); + return getPhase(DBIT_CLK, mode); + case MAX_ADC_PHASE_SHIFT: + return getMaxPhase(ADC_CLK); + case MAX_DBIT_PHASE_SHIFT: + return getMaxPhase(DBIT_CLK); case ADC_CLOCK: return getFrequency(ADC_CLK); case DBIT_CLOCK: return getFrequency(DBIT_CLK); + case CLOCK_DIVIDER: + return getFrequency(RUN_CLK); case ADC_PIPELINE: return getAdcOffsetRegister(1); case DBIT_PIPELINE: return getAdcOffsetRegister(0); - case CLOCK_DIVIDER: - return getFrequency(RUN_CLK); default: return -1; } @@ -1269,48 +1271,100 @@ int powerChip(int on) { } // ind can only be ADC_CLK or DBIT_CLK -void configurePhase(enum CLKINDEX ind, int val) { - char clock_names[4][10]={"run_clk","adc_clk", "sync_clk", "dbit_clk"}; - if (val > 65535 || val < -65535) { - FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits\n", ind, clock_names[ind])); - return; - } - int relativePhase = clkPhase[ind] - val; +void configurePhase(enum CLKINDEX ind, int val, int degrees) { + char clock_names[4][10]={"run_clk","adc_clk", "sync_clk", "dbit_clk"}; + int maxShift = getMaxPhase(ind); + + // validation + if (degrees && (val < 0 || val > 359)) { + FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits (0 - 359°C)\n", ind, clock_names[ind])); + return; + } + if (!degrees && (val < 0 || val > maxShift - 1)) { + FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits (0 - %d phase shifts)\n", ind, clock_names[ind], maxShift - 1)); + return; + } + + FILE_LOG(logINFO, ("Configuring Phase of C%d(%s) to %d (degree mode: %d)\n", ind, clock_names[ind], val, degrees)); + int valShift = val; + // convert to phase shift + if (degrees) { + double temp = val * ((double)maxShift / 360.00); + if ((temp - (int)temp) > 0.0001) { + temp += 0.5; + } + valShift = temp; + FILE_LOG(logDEBUG1, ("phase shift: %d\n", valShift)); + } + FILE_LOG(logDEBUG1, ("phase shift: %d (degrees/shift: %d)\n", valShift, val)); + + int relativePhase = clkPhase[ind] - valShift; + FILE_LOG(logDEBUG1, ("relative phase shift: %d (Current phase: %d)\n", relativePhase, clkPhase[ind])); // same phase if (!relativePhase) { + FILE_LOG(logDEBUG1, ("Nothing to do\n")); return; } - FILE_LOG(logINFO, ("Configuring Phase of C%d(%s) to %d\n", ind, clock_names[ind], val)); - - // reset only pll - ALTERA_PLL_ResetPLL(); - - // set mode register to polling mode - ALTERA_PLL_SetModePolling(); - - int phase = 0; - int maxShifts = (PLL_VCO_FREQ_MHZ / clkDivider[ind]) * MAX_PHASE_SHIFTS_STEPS; - FILE_LOG(logDEBUG1, ("Clock: %d MHz, VCO:%d MHz, Max Phase shifts:%d\n", - clkDivider[ind], PLL_VCO_FREQ_MHZ, maxShifts)); - - // delay clk if (relativePhase > 0) { - phase = (maxShifts - relativePhase); + phase = (maxShift - relativePhase); } else { phase = (-1) * relativePhase; } - FILE_LOG(logINFO, ("\tphase out %d (0x%08x)\n", phase, phase)); + FILE_LOG(logDEBUG1, ("[Single Direction] Phase:%d (0x%x). Max Phase shifts:%d\n", phase, phase, maxShift)); ALTERA_PLL_SetPhaseShift(phase, (int)ind, 0); - clkPhase[ind] = val; + clkPhase[ind] = valShift; } -int getPhase(enum CLKINDEX ind) { - return clkPhase[ind]; +int getPhase(enum CLKINDEX ind, int degrees) { + if (!degrees) + return clkPhase[ind]; + return (clkPhase[ind] * (360.00 / (double)getMaxPhase(ind))); +} + +int getMaxPhase(enum CLKINDEX ind) { + int ret = ((double)PLL_VCO_FREQ_MHZ / (double)clkDivider[ind]) * MAX_PHASE_SHIFTS_STEPS; + + char clock_names[4][10]={"run_clk","adc_clk", "sync_clk", "dbit_clk"}; + FILE_LOG(logDEBUG1, ("Max Phase Shift (%s): %d (Clock: %d MHz, VCO:%d MHz)\n", + clock_names[ind], ret, clkDivider[ind], PLL_VCO_FREQ_MHZ)); + + return ret; +} + +int validatePhaseinDegrees(enum speedVariable ind, int val, int retval) { + if (val == -1) + return OK; + enum CLKINDEX clkIndex; + switch(ind) { + case ADC_PHASE: + clkIndex = ADC_CLK; + break; + case DBIT_PHASE: + clkIndex = DBIT_CLK; + break; + default: + FILE_LOG(logERROR, ("Unknown speed enum %d for validating phase in degrees\n", (int)ind)); + } + FILE_LOG(logDEBUG1, ("validating phase in degrees for clk %d\n", clkIndex)); + int maxShift = getMaxPhase(clkIndex); + // convert degrees to shift + double temp = val; + temp *= ((double)maxShift / 360.00); + if ((temp - (int)temp) > 0.0001) { + temp += 0.5; + } + val = (int)temp; + // convert back to degrees + val *= (360.00 / (double)maxShift); + + if (val == retval) + return OK; + return FAIL; } void configureFrequency(enum CLKINDEX ind, int val) { @@ -1929,23 +1983,45 @@ void unsetFifoReadStrobes() { void readSample(int ns) { uint32_t addr = DUMMY_REG; + // read analog data + uint32_t fifoAddr = FIFO_DATA_REG; - // read digital output - // read strobe to digital fifo - bus_w(addr, bus_r(addr) | DUMMY_DGTL_FIFO_RD_STRBE_MSK); - bus_w(addr, bus_r(addr) & (~DUMMY_DGTL_FIFO_RD_STRBE_MSK)); - // wait as it is connected directly to fifo running on a different clock - if (!(ns%1000)) { - FILE_LOG(logDEBUG1, ("Reading sample ns:%d of %d DEmtpy:%d DFull:%d Status:0x%x\n", - ns, nSamples, - ((bus_r(FIFO_DIN_STATUS_REG) & FIFO_DIN_STATUS_FIFO_EMPTY_MSK) >> FIFO_DIN_STATUS_FIFO_EMPTY_OFST), - ((bus_r(FIFO_DIN_STATUS_REG) & FIFO_DIN_STATUS_FIFO_FULL_MSK) >> FIFO_DIN_STATUS_FIFO_FULL_OFST), - bus_r(STATUS_REG))); - } + // read strobe to all analog fifos + bus_w(addr, bus_r(addr) | DUMMY_ANLG_FIFO_RD_STRBE_MSK); + bus_w(addr, bus_r(addr) & (~DUMMY_ANLG_FIFO_RD_STRBE_MSK)); + // wait as it is connected directly to fifo running on a different clock + //usleep(WAIT_TIME_FIFO_RD_STROBE); + if (!(ns%1000)) { + FILE_LOG(logDEBUG1, ("Reading sample ns:%d of %d AEmtpy:0x%x AFull:0x%x Status:0x%x\n", + ns, nSamples, bus_r(FIFO_EMPTY_REG), bus_r(FIFO_FULL_REG), bus_r(STATUS_REG))); + } - // read fifo and write it to current position of data pointer - *((uint64_t*)now_ptr) = get64BitReg(FIFO_DIN_LSB_REG, FIFO_DIN_MSB_REG); - now_ptr += 8; + // loop through all channels + int ich = 0; + for (ich = 0; ich < NCHAN_ANALOG; ++ich) { + + // if channel is in ROI + if ((1 << ich) & ~(adcDisableMask)) { + + // unselect channel + bus_w(addr, bus_r(addr) & ~(DUMMY_FIFO_CHNNL_SLCT_MSK)); + + // select channel + bus_w(addr, bus_r(addr) | ((ich << DUMMY_FIFO_CHNNL_SLCT_OFST) & DUMMY_FIFO_CHNNL_SLCT_MSK)); + + // read fifo and write it to current position of data pointer + *((uint16_t*)now_ptr) = bus_r16(fifoAddr); + + // keep reading till the value is the same + /* while (*((uint16_t*)now_ptr) != bus_r16(fifoAddr)) { + FILE_LOG(logDEBUG1, ("%d ", ich)); + *((uint16_t*)now_ptr) = bus_r16(fifoAddr); + }*/ + + // increment pointer to data out destination + now_ptr += 2; + } + } } diff --git a/slsDetectorServers/slsDetectorServer/ALTERA_PLL.h b/slsDetectorServers/slsDetectorServer/ALTERA_PLL.h index e8d24815f..a4ab55891 100755 --- a/slsDetectorServers/slsDetectorServer/ALTERA_PLL.h +++ b/slsDetectorServers/slsDetectorServer/ALTERA_PLL.h @@ -207,7 +207,7 @@ int ALTERA_PLL_SetOuputFrequency (int clkIndex, int pllVCOFreqMhz, int value) { uint32_t low_count = total_div / 2; uint32_t high_count = low_count; uint32_t odd_division = 0; - cprintf(RED, "toatldiv:%f\n", total_div); + // odd division if (total_div > (float)(2 * low_count)) { ++high_count; diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h index 3cdfe9236..610d907da 100644 --- a/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h @@ -115,7 +115,10 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret); #endif // parameters - readout -#ifndef GOTTHARDD +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) +void setSpeed(enum speedVariable ind, int val, int mode); +int getSpeed(enum speedVariable ind, int mode); +#else void setSpeed(enum speedVariable ind, int val); int getSpeed(enum speedVariable ind); #endif @@ -238,8 +241,10 @@ int powerChip (int on); // chip test board or moench specific - configure frequency, phase, pll, flashing firmware #if defined(CHIPTESTBOARDD) || defined(MOENCHD) -void configurePhase(enum CLKINDEX ind, int val); -int getPhase(enum CLKINDEX ind); +void configurePhase(enum CLKINDEX ind, int val, int degrees); +int getPhase(enum CLKINDEX ind, int degrees); +int getMaxPhase(enum CLKINDEX ind); +int validatePhaseinDegrees(enum speedVariable ind, int val, int retval); void configureFrequency(enum CLKINDEX ind, int val); int getFrequency(enum CLKINDEX ind); void configureSyncFrequency(enum CLKINDEX ind); diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c index c7946c4f4..765d03199 100755 --- a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c @@ -140,14 +140,14 @@ const char* getTimerName(enum timerIndex ind) { const char* getSpeedName(enum speedVariable ind) { switch (ind) { case CLOCK_DIVIDER: return "clock_divider"; - case PHASE_SHIFT: return "phase_shift"; - case OVERSAMPLING: return "oversampling"; case ADC_CLOCK: return "adc_clock"; case ADC_PHASE: return "adc_phase"; case ADC_PIPELINE: return "adc_pipeline"; case DBIT_CLOCK: return "dbit_clock"; case DBIT_PHASE: return "dbit_phase"; case DBIT_PIPELINE: return "dbit_pipeline"; + case MAX_ADC_PHASE_SHIFT: return "max_adc_phase_shift"; + case MAX_DBIT_PHASE_SHIFT: return "max_dbit_phase_shift"; default: return "unknown_speed"; } } @@ -1938,74 +1938,98 @@ int set_roi(int file_des) { int set_speed(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); - int args[2] = {-1,-1}; + int args[3] = {-1, -1, -1}; int retval = -1; if (receiveData(file_des, args, sizeof(args), INT32) < 0) return printSocketReadError(); -#ifdef GOTTHARDD - functionNotImplemented(); -#else enum speedVariable ind = args[0]; int val = args[1]; - int GET_VAL = -1; - if ((ind == PHASE_SHIFT) || (ind == ADC_PHASE) || (ind == DBIT_PHASE)) - GET_VAL = 100000; + int mode = args[2]; char speedName[20] = {0}; strcpy(speedName, getSpeedName(ind)); - FILE_LOG(logDEBUG1, ("Setting speed index %s (%d) to %d\n", speedName, ind, val)); + FILE_LOG(logDEBUG1, ("Setting speed index %s (speedVariable %d) to %d (mode: %d)\n", speedName, ind, val, mode)); // check index switch(ind) { #ifdef JUNGFRAUD case ADC_PHASE: + case CLOCK_DIVIDER: #elif CHIPTESTBOARDD case ADC_PHASE: - case PHASE_SHIFT: case DBIT_PHASE: + case MAX_ADC_PHASE_SHIFT: + case MAX_DBIT_PHASE_SHIFT: case ADC_CLOCK: case DBIT_CLOCK: + case CLOCK_DIVIDER: case ADC_PIPELINE: case DBIT_PIPELINE: #elif MOENCHD case ADC_PHASE: - case PHASE_SHIFT: case DBIT_PHASE: + case MAX_ADC_PHASE_SHIFT: + case MAX_DBIT_PHASE_SHIFT: case ADC_CLOCK: case DBIT_CLOCK: + case CLOCK_DIVIDER: case ADC_PIPELINE: case DBIT_PIPELINE: -#endif +#elif GOTTHARDD + case ADC_PHASE: +#elif EIGERD case CLOCK_DIVIDER: +#endif break; default: modeNotImplemented(speedName, (int)ind); break; } - - if (ret == OK) { - // set - if ((val != GET_VAL) && (Server_VerifyLock() == OK)) { - setSpeed(ind, val); - } - // get - retval = getSpeed(ind); - FILE_LOG(logDEBUG1, ("%s: %d\n", speedName, retval)); - // validate - if (GET_VAL == -1) { - char validateName[20] = {0}; - sprintf(validateName, "set %s", speedName); - validate(val, retval, validateName, DEC); - } else if (ret == OK && val != GET_VAL && retval != val ) { - ret = FAIL; - sprintf(mess, "Could not set %s. Set %d, but read %d\n", speedName, val, retval); - FILE_LOG(logERROR,(mess)); - } +#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) + if (ret == OK && mode == 1) { + ret = FAIL; + strcpy(mess, "deg is not defined for this detector.\n"); + FILE_LOG(logERROR,(mess)); } #endif + if (ret == OK) { + // set + if ((val != -1) && (Server_VerifyLock() == OK)) { +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) + setSpeed(ind, val, mode); +#else + setSpeed(ind, val); +#endif + } + // get +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) + retval = getSpeed(ind, mode); +#else + retval = getSpeed(ind); +#endif + FILE_LOG(logDEBUG1, ("%s: %d (mode:%d)\n", speedName, retval, mode)); + // validate + char validateName[20] = {0}; + sprintf(validateName, "set %s", speedName); +#ifndef GOTTHARDD +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) + if (ind == ADC_PHASE || ind == DBIT_PHASE && mode == 1) { + ret = validatePhaseinDegrees(ind, val, retval); + if (ret == FAIL) { + sprintf(mess, "Could not set %s. Set %s, got %s\n", validateName); + FILE_LOG(logERROR,(mess)); + } + } else + validate(val, retval, validateName, DEC); +#else + validate(val, retval, validateName, DEC); +#endif +#endif + } + return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval)); } diff --git a/slsDetectorSoftware/include/multiSlsDetector.h b/slsDetectorSoftware/include/multiSlsDetector.h index 0edce98da..13e2ae1e2 100644 --- a/slsDetectorSoftware/include/multiSlsDetector.h +++ b/slsDetectorSoftware/include/multiSlsDetector.h @@ -734,14 +734,14 @@ class multiSlsDetector : public virtual slsDetectorDefs { /** * Set speed - * @param sp speed type (clkdivider option for Jungfrau and Eiger, others - * for Mythen/Gotthard) + * @param sp speed type (clkdivider option for Jungfrau and Eiger, + * adcphase for Gotthard, others for CTB & Moench) * @param value (clkdivider 0,1,2 for full, half and quarter speed). Other * values check manual * @param detPos -1 for all detectors in list or specific detector position * @returns value of speed set */ - int setSpeed(speedVariable index, int value = -1, int detPos = -1); + int setSpeed(speedVariable index, int value = -1, int mode = 0, int detPos = -1); /** * Set/get dynamic range and updates the number of dataBytes diff --git a/slsDetectorSoftware/include/slsDetector.h b/slsDetectorSoftware/include/slsDetector.h index 9026c6b97..055454c41 100644 --- a/slsDetectorSoftware/include/slsDetector.h +++ b/slsDetectorSoftware/include/slsDetector.h @@ -697,11 +697,12 @@ class slsDetector : public virtual slsDetectorDefs{ /** * Set speed - * @param sp speed type (clkdivider option for Jungfrau and Eiger, others for Mythen/Gotthard) + * @param sp speed type (clkdivider option for Jungfrau and Eiger, + * adcphase for Gotthard, others for CTB & Moench) * @param value (clkdivider 0,1,2 for full, half and quarter speed). Other values check manual * @returns value of speed set */ - int setSpeed(speedVariable sp, int value = -1); + int setSpeed(speedVariable sp, int value = -1, int mode = 0); /** * Set/get dynamic range and updates the number of dataBytes diff --git a/slsDetectorSoftware/src/multiSlsDetector.cpp b/slsDetectorSoftware/src/multiSlsDetector.cpp index 4393659e2..11bc0c456 100644 --- a/slsDetectorSoftware/src/multiSlsDetector.cpp +++ b/slsDetectorSoftware/src/multiSlsDetector.cpp @@ -1199,14 +1199,14 @@ int64_t multiSlsDetector::getTimeLeft(timerIndex index, int detPos) { return sls::minusOneIfDifferent(r); } -int multiSlsDetector::setSpeed(speedVariable index, int value, int detPos) { +int multiSlsDetector::setSpeed(speedVariable index, int value, int mode, int detPos) { // single if (detPos >= 0) { - return detectors[detPos]->setSpeed(index, value); + return detectors[detPos]->setSpeed(index, value, mode); } // multi - auto r = parallelCall(&slsDetector::setSpeed, index, value); + auto r = parallelCall(&slsDetector::setSpeed, index, value, mode); return sls::minusOneIfDifferent(r); } diff --git a/slsDetectorSoftware/src/slsDetector.cpp b/slsDetectorSoftware/src/slsDetector.cpp index a1847d903..01399d053 100644 --- a/slsDetectorSoftware/src/slsDetector.cpp +++ b/slsDetectorSoftware/src/slsDetector.cpp @@ -1840,12 +1840,12 @@ int64_t slsDetector::getTimeLeft(timerIndex index) { return retval; } -int slsDetector::setSpeed(speedVariable sp, int value) { +int slsDetector::setSpeed(speedVariable sp, int value, int mode) { int fnum = F_SET_SPEED; int ret = FAIL; - int args[2] = {(int)sp, value}; + int args[3] = {(int)sp, value, mode}; int retval = -1; - FILE_LOG(logDEBUG1) << "Setting speed index " << sp << " to " << value; + FILE_LOG(logDEBUG1) << "Setting speed index " << sp << " to " << value << " mode: " << mode; if (detector_shm()->onlineFlag == ONLINE_FLAG) { auto client = DetectorSocket(detector_shm()->hostname, detector_shm()->controlPort); diff --git a/slsDetectorSoftware/src/slsDetectorCommand.cpp b/slsDetectorSoftware/src/slsDetectorCommand.cpp index 520a3f7dd..4bd407f26 100644 --- a/slsDetectorSoftware/src/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/src/slsDetectorCommand.cpp @@ -81,49 +81,49 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { - \b test returns an error */ - descrToFuncMap[i].m_pFuncName = "test"; // + descrToFuncMap[i].m_pFuncName = "test"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdUnderDevelopment; ++i; /*! \page test - help Returns a list of possible commands. */ - descrToFuncMap[i].m_pFuncName = "help"; //OK + descrToFuncMap[i].m_pFuncName = "help"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHelp; ++i; /*! \page test - exitserver Shuts down all the detector servers. Don't use it!!!! */ - descrToFuncMap[i].m_pFuncName = "exitserver"; //OK + descrToFuncMap[i].m_pFuncName = "exitserver"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdExitServer; ++i; /*! \page test - exitreceiver Shuts down all the receivers. Don't use it!!!! */ - descrToFuncMap[i].m_pFuncName = "exitreceiver"; //OK + descrToFuncMap[i].m_pFuncName = "exitreceiver"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdExitServer; ++i; /*! \page test - execcommand Executes a command on the detector server. Don't use it!!!! */ - descrToFuncMap[i].m_pFuncName = "execcommand"; //OK + descrToFuncMap[i].m_pFuncName = "execcommand"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdExitServer; ++i; /*! \page test - rx_execcommand Executes a command on the receiver server. Don't use it!!!! */ - descrToFuncMap[i].m_pFuncName = "rx_execcommand"; //OK + descrToFuncMap[i].m_pFuncName = "rx_execcommand"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdExitServer; ++i; /*! \page test - flippeddatay [i] enables/disables data being flipped across y axis. 1 enables, 0 disables. Not implemented. */ - descrToFuncMap[i].m_pFuncName = "flippeddatay"; // + descrToFuncMap[i].m_pFuncName = "flippeddatay"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize; ++i; @@ -132,56 +132,56 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page test - digibittest:[i] performs digital test of the module i. Returns 0 if succeeded, otherwise error mask. Gotthard only. Only put! */ - descrToFuncMap[i].m_pFuncName = "digibittest"; // + descrToFuncMap[i].m_pFuncName = "digibittest"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDigiTest; ++i; /*! \page test - bustest performs test of the bus interface between FPGA and embedded Linux system. Can last up to a few minutes. Cannot set! Jungfrau only. Only get! */ - descrToFuncMap[i].m_pFuncName = "bustest"; // + descrToFuncMap[i].m_pFuncName = "bustest"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDigiTest; ++i; /*! \page test - firmwaretest performs the firmware test. Cannot set! Jungfrau only. Only get! */ - descrToFuncMap[i].m_pFuncName = "firmwaretest"; // + descrToFuncMap[i].m_pFuncName = "firmwaretest"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDigiTest; ++i; /*! \page test - reg [addr] [val] ??? writes to an register \c addr with \c value in hexadecimal format. */ - descrToFuncMap[i].m_pFuncName = "reg"; // + descrToFuncMap[i].m_pFuncName = "reg"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdRegister; ++i; /*! \page test - adcreg [addr] [val] ??? writes to an adc register \c addr with \c value in hexadecimal format. Only put! */ - descrToFuncMap[i].m_pFuncName = "adcreg"; // + descrToFuncMap[i].m_pFuncName = "adcreg"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdRegister; ++i; /*! \page test - setbit ??? Only put! */ - descrToFuncMap[i].m_pFuncName = "setbit"; // + descrToFuncMap[i].m_pFuncName = "setbit"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdRegister; ++i; /*! \page test - clearbit ??? Only put! */ - descrToFuncMap[i].m_pFuncName = "clearbit"; // + descrToFuncMap[i].m_pFuncName = "clearbit"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdRegister; ++i; /*! \page test - getbit ??? Only get! */ - descrToFuncMap[i].m_pFuncName = "getbit"; // + descrToFuncMap[i].m_pFuncName = "getbit"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdRegister; ++i; @@ -193,49 +193,49 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { - \b acquire blocking acquisition (like calling sls_detector_acquire). Starts receiver and detector, writes and processes the data, stops detector. Only get! \c Returns (string)\c "acquire failed" if fails, else \c "Acquired (int)", where int is number of frames caught. */ - descrToFuncMap[i].m_pFuncName = "acquire"; // + descrToFuncMap[i].m_pFuncName = "acquire"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAcquire; ++i; /*! \page acquisition - busy i sets/gets acquiring flag. \c 1 the acquisition is active, \c 0 otherwise. Acquire command will set this flag to 1 at the beginning and to 0 at the end. Use this to clear flag if acquisition terminated unexpectedly. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "busy"; // + descrToFuncMap[i].m_pFuncName = "busy"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdStatus; ++i; /*! \page acquisition - status [s] starts or stops acquisition in detector in non blocking mode. When using stop acquisition and if acquisition is done, it will restream the stop packet from receiver (if data streaming in receiver is on). Eiger can also provide an internal software trigger. \c s: [\c start, \c stop, \c trigger(EIGER only)]. \c Returns the detector status: [\c running, \c error, \c transmitting, \c finished, \c waiting, \c idle]. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "status"; // + descrToFuncMap[i].m_pFuncName = "status"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdStatus; ++i; /*! \page acquisition - \b data gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup (Eigerr store in ram only). Only get! */ - descrToFuncMap[i].m_pFuncName = "data"; // + descrToFuncMap[i].m_pFuncName = "data"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdData; ++i; /*! \page acquisition - readctr Reads the counters from the detector memory (analog detector returning values translated into number of photons - only GOTTHARD). Cannot put. */ - descrToFuncMap[i].m_pFuncName = "readctr"; // + descrToFuncMap[i].m_pFuncName = "readctr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdCounter; ++i; /*! \page acquisition - resetctr i Resets counter in detector, restarts acquisition if i=1(analog detector returning values translated into number of photons - only GOTTHARD). Cannot put. */ - descrToFuncMap[i].m_pFuncName = "resetctr"; // + descrToFuncMap[i].m_pFuncName = "resetctr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdCounter; ++i; /*! \page acquisition - resmat i sets/resets counter bit in detector.gets the counter bit in detector ???? */ - descrToFuncMap[i].m_pFuncName = "resmat"; // + descrToFuncMap[i].m_pFuncName = "resmat"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdCounter; ++i; @@ -262,35 +262,35 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page config - \b free Free shared memory on the control PC */ - descrToFuncMap[i].m_pFuncName = "free"; //OK + descrToFuncMap[i].m_pFuncName = "free"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdFree; ++i; /*! \page config - hostname \c put frees shared memory and sets the hostname (or IP adress). Only allowed at multi detector level. \c Returns the list of the hostnames of the multi-detector structure. \c (string) */ - descrToFuncMap[i].m_pFuncName = "hostname"; //OK + descrToFuncMap[i].m_pFuncName = "hostname"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHostname; ++i; /*! \page config - \b add appends a hostname (or IP address) at the end of the multi-detector structure. Only allowed at multi detector level. Cannot get. \c Returns the current list of detector hostnames. \c (string) */ - descrToFuncMap[i].m_pFuncName = "add"; //OK + descrToFuncMap[i].m_pFuncName = "add"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHostname; ++i; /*! \page config - replace \c Sets the hostname (or IP adress) for a single detector. Only allowed at single detector level. Cannot get. \c Returns the hostnames for that detector \c (string) */ - descrToFuncMap[i].m_pFuncName = "replace"; //OK + descrToFuncMap[i].m_pFuncName = "replace"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdHostname; ++i; /*! \page config - user \c Returns user details from shared memory. Only allowed at multi detector level. Cannot put. \c (string) */ - descrToFuncMap[i].m_pFuncName = "user"; //OK + descrToFuncMap[i].m_pFuncName = "user"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdUser; ++i; @@ -302,20 +302,20 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page config - online [i] sets the detector in online (1) or offline (0) mode. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "online"; // + descrToFuncMap[i].m_pFuncName = "online"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOnline; ++i; /*! \page config - checkonline returns the hostnames of all detectors without connecting to them. \c Returns (string) "All online" or "[list of offline hostnames] : Not online". */ - descrToFuncMap[i].m_pFuncName = "checkonline"; // + descrToFuncMap[i].m_pFuncName = "checkonline"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOnline; ++i; /*! \page config - activate [b] [p] Activates/Deactivates the detector. \c b is 1 for activate, 0 for deactivate. Deactivated detector does not send data. \c p is optional and can be padding (default) or nonpadding for receivers for deactivated detectors. Used for EIGER only. \c Returns \c (int) (string) */ - descrToFuncMap[i].m_pFuncName = "activate"; // + descrToFuncMap[i].m_pFuncName = "activate"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOnline; ++i; @@ -328,42 +328,42 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page config - dr [i] sets/gets the dynamic range of detector. Eiger [4,8,16,32]. Others cannot put! \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "dr"; // + descrToFuncMap[i].m_pFuncName = "dr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize; ++i; /*! \page config - roi [i] [xmin] [xmax] [ymin] [ymax] sets region of interest of the detector, where i is number of rois;i=0 to clear rois. Used for GOTTHARD only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "roi"; // + descrToFuncMap[i].m_pFuncName = "roi"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize; ++i; /*! \page config - detsizechan [xmax] [ymax] sets the maximum number of channels in each dimension for complete detector set; -1 is no limit. Use for multi-detector system as first command in config file. \c Returns \c ("int int") */ - descrToFuncMap[i].m_pFuncName = "detsizechan"; // + descrToFuncMap[i].m_pFuncName = "detsizechan"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize; ++i; /*! \page config - flippeddatax [i] enables/disables data being flipped across x axis. 1 enables, 0 disables. Used for EIGER only. 1 for bottom half-module, 0 for top-half module. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "flippeddatax"; // + descrToFuncMap[i].m_pFuncName = "flippeddatax"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize; ++i; /*! \page config - tengiga [i] enables/disables 10GbE in system (detector & receiver). 1 enabled 10GbE, 0 enables 1GbE. Used in EIGER, Moench and ChipTestBoard only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "tengiga"; // + descrToFuncMap[i].m_pFuncName = "tengiga"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page config - gappixels [i] enables/disables gap pixels in system (detector & receiver). 1 sets, 0 unsets. Used in EIGER only and only in multi detector level command. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "gappixels"; // + descrToFuncMap[i].m_pFuncName = "gappixels"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDetectorSize; ++i; @@ -435,28 +435,28 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page config - auto_comp_disable i Currently not implemented. this mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us). 1 enables mode, 0 disables mode. By default, mode is disabled (comparator is enabled throughout). (JUNGFRAU only). \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "auto_comp_disable"; // + descrToFuncMap[i].m_pFuncName = "auto_comp_disable"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced; ++i; /*! \page config - pulse [n] [x] [y] pulses pixel at coordinates (x,y) n number of times. Used in EIGER only. Only put! \c Returns \c ("successful", "failed") */ - descrToFuncMap[i].m_pFuncName = "pulse"; // + descrToFuncMap[i].m_pFuncName = "pulse"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPulse; ++i; /*! \page config - pulsenmove [n] [x] [y] pulses pixel n number of times and moves relatively by x value (x axis) and y value(y axis). Used in EIGER only. Only put! \c Returns \c ("successful", "failed") */ - descrToFuncMap[i].m_pFuncName = "pulsenmove"; // + descrToFuncMap[i].m_pFuncName = "pulsenmove"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPulse; ++i; /*! \page config - pulsechip [n]pulses chip n number of times, while n=-1 will reset it to normal mode. Used in EIGER only. Only put! \c Returns \c ("successful", "failed") */ - descrToFuncMap[i].m_pFuncName = "pulsechip"; // + descrToFuncMap[i].m_pFuncName = "pulsechip"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPulse; ++i; @@ -469,49 +469,49 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page config - checkdetversion Checks the version compatibility with detector server (if hostname is in shared memory). Only get! Only for Eiger, Jungfrau & Gotthard. \c Returns \c ("compatible", "incompatible") */ - descrToFuncMap[i].m_pFuncName = "checkdetversion"; // + descrToFuncMap[i].m_pFuncName = "checkdetversion"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; /*! \page config - checkrecversion Checks the version compatibility with receiver server (if rx_hostname is in shared memory). Only get! Only for Eiger, Jungfrau & Gotthard. \c Returns \c ("compatible", "incompatible") */ - descrToFuncMap[i].m_pFuncName = "checkrecversion"; // + descrToFuncMap[i].m_pFuncName = "checkrecversion"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; /*! \page config - detectornumber Gets the serial number or MAC of detector. Only get! \c Returns \c (long int) in hexadecimal */ - descrToFuncMap[i].m_pFuncName = "detectornumber"; // + descrToFuncMap[i].m_pFuncName = "detectornumber"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; /*! \page config - detectorversion Gets the firmware version of detector. Only get! \c Returns \c (long int) in hexadecimal */ - descrToFuncMap[i].m_pFuncName = "detectorversion"; // + descrToFuncMap[i].m_pFuncName = "detectorversion"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; /*! \page config - softwareversion Gets the software version of detector server. Only get! \c Returns \c (long int) in hexadecimal */ - descrToFuncMap[i].m_pFuncName = "softwareversion"; // + descrToFuncMap[i].m_pFuncName = "softwareversion"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; /*! \page config - thisversion Gets the software version of this client software. Only get! \c Returns \c (long int) in hexadecimal */ - descrToFuncMap[i].m_pFuncName = "thisversion"; // + descrToFuncMap[i].m_pFuncName = "thisversion"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; /*! \page config - receiverversion Gets the software version of receiver. Only get! \c Returns \c (long int) in hexadecimal */ - descrToFuncMap[i].m_pFuncName = "receiverversion"; // + descrToFuncMap[i].m_pFuncName = "receiverversion"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSN; ++i; @@ -520,105 +520,105 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page timing - timing [mode] sets/gets synchronization mode of the detector. Mode: auto, trigger, ro_trigger, gating, triggered_gating (string) */ - descrToFuncMap[i].m_pFuncName = "timing"; // + descrToFuncMap[i].m_pFuncName = "timing"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTiming; ++i; /*! \page timing - exptime [i] sets/gets exposure time in s. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "exptime"; // + descrToFuncMap[i].m_pFuncName = "exptime"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - subexptime [i] sets/gets sub exposure time in s. Used in EIGER only in 32 bit mode. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "subexptime"; // + descrToFuncMap[i].m_pFuncName = "subexptime"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - period [i] sets/gets frame period in s. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "period"; // + descrToFuncMap[i].m_pFuncName = "period"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - subdeadtime [i] sets/gets sub frame dead time in s. Subperiod is set in the detector = subexptime + subdeadtime. This value is normally a constant in the config file. Used in EIGER only in 32 bit mode. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "subdeadtime"; // + descrToFuncMap[i].m_pFuncName = "subdeadtime"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - delay [i] sets/gets delay in s. Used in GOTTHARD only. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "delay"; // + descrToFuncMap[i].m_pFuncName = "delay"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - gates [i] sets/gets number of gates. Used in GOTTHARD only. \c Returns \c (long long int) */ - descrToFuncMap[i].m_pFuncName = "gates"; // + descrToFuncMap[i].m_pFuncName = "gates"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - frames [i] sets/gets number of frames. If \c timing is not \c auto, then it is the number of frames per cycle/trigger. \c Returns \c (long long int) */ - descrToFuncMap[i].m_pFuncName = "frames"; // + descrToFuncMap[i].m_pFuncName = "frames"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - cycles [i] sets/gets number of triggers. Timing mode should be set appropriately. \c Returns \c (long long int) */ - descrToFuncMap[i].m_pFuncName = "cycles"; // + descrToFuncMap[i].m_pFuncName = "cycles"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - measurements [i] sets/gets number of measurements. \c Returns \c (long long int) */ - descrToFuncMap[i].m_pFuncName = "measurements"; // + descrToFuncMap[i].m_pFuncName = "measurements"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - samples [i] sets/gets number of samples expected from the jctb. Used in CHIP TEST BOARD only. \c Returns \c (long long int) */ - descrToFuncMap[i].m_pFuncName = "samples"; // + descrToFuncMap[i].m_pFuncName = "samples"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - storagecells [i] sets/gets number of additional storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells +1). \c Returns \c (long long int) */ - descrToFuncMap[i].m_pFuncName = "storagecells"; // + descrToFuncMap[i].m_pFuncName = "storagecells"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - storagecell_start [i] sets/gets the storage cell that stores the first acquisition of the series. Default is 15(0xf).. For very advanced users only! For JUNGFRAU only. Range: 0-15. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "storagecell_start"; // + descrToFuncMap[i].m_pFuncName = "storagecell_start"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - storagecell_start [i] sets/gets the storage cell that stores the first acquisition of the series. Default is 15(0xf).. For very advanced users only! For JUNGFRAU only. Range: 0-15. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "storagecell_start"; // + descrToFuncMap[i].m_pFuncName = "storagecell_start"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; /*! \page timing - storagecell_delay [i] sets/gets additional time between 2 storage cells. For very advanced users only! For JUNGFRAU only. Range: 0-1638375 ns (resolution of 25ns). \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "storagecell_delay"; // + descrToFuncMap[i].m_pFuncName = "storagecell_delay"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer; ++i; @@ -627,77 +627,77 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page timing - exptimel gets exposure time left. Used in GOTTHARD only. Only get! \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "exptimel"; // + descrToFuncMap[i].m_pFuncName = "exptimel"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - periodl gets frame period left. Used in GOTTHARD and Jungfrau only. Only get! \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "periodl"; // + descrToFuncMap[i].m_pFuncName = "periodl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - delayl gets delay left. Used in GOTTHARD only. Only get! \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "delayl"; // + descrToFuncMap[i].m_pFuncName = "delayl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - gatesl gets number of gates left. Used in GOTTHARD only. Only get! \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "gatesl"; // + descrToFuncMap[i].m_pFuncName = "gatesl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page config - framesl gets number of frames left. Used in GOTTHARD and Jungfrau only. Only get! \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "framesl"; // + descrToFuncMap[i].m_pFuncName = "framesl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - cyclesl gets number of cylces left. Used in GOTTHARD and Jungfrau only. Only get! \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "cyclesl"; // + descrToFuncMap[i].m_pFuncName = "cyclesl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - now Getting actual time of the detector from start. For Jungfrau only. Only get! */ - descrToFuncMap[i].m_pFuncName = "now"; // + descrToFuncMap[i].m_pFuncName = "now"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - timestamp Getting timestamp. For Jungfrau only. Only get! */ - descrToFuncMap[i].m_pFuncName = "timestamp"; // + descrToFuncMap[i].m_pFuncName = "timestamp"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - nframes Frames from start run control. Only Jungfrau. Only get! */ - descrToFuncMap[i].m_pFuncName = "nframes"; // + descrToFuncMap[i].m_pFuncName = "nframes"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - measuredperiod gets the measured frame period (time between last frame and the previous one) in s. For Eiger only. Makes sense only for acquisitions of more than 1 frame. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "measuredperiod"; // + descrToFuncMap[i].m_pFuncName = "measuredperiod"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; /*! \page timing - measuredsubperiod gets the measured subframe period (time between last subframe and the previous one) in s. For Eiger only and in 32 bit mode. \c Returns \c (double with 9 decimal digits) */ - descrToFuncMap[i].m_pFuncName = "measuredsubperiod"; // + descrToFuncMap[i].m_pFuncName = "measuredsubperiod"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft; ++i; @@ -708,65 +708,65 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { */ /*! \page config - - clkdivider [i] sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. \c Returns \c (int) + - clkdivider [i] sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. Not for Gotthard. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "clkdivider"; // + descrToFuncMap[i].m_pFuncName = "clkdivider"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - phasestep [i] Only put for gotthard. Moves the phase of the ADC clock.\c Returns \c (int) + - adcclk [i] sets/gets the ADC clock frequency in MHz. CTB & Moench only. It also resets adcphase. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "phasestep"; // + descrToFuncMap[i].m_pFuncName = "adcclk"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - oversampling [i] Sets/gets the number of adcsamples per clock. For the new chiptestboard.\c Returns \c (int) + - dbitclk [i] Sets/gets the clock frequency of the latching of the digital bits in MHz. CTB & Moench only. It also resets dbit phase. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "oversampling"; // + descrToFuncMap[i].m_pFuncName = "dbitclk"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - adcclk [i] sets/gets the ADC clock frequency in MHz. For the new chiptestboard!\c Returns \c (int) + - adcphase [i] [deg] Sets/gets phase of the ADC clock to i. i is the shift or in degrees if deg is used. deg is optional & only for CTB & Moench. For CTB & Moench, adcphase is reset if adcclk is changed. For Jungfrau, adcphase changed to defaults if clkdivider changed. Jungfrau, CTB & Moench, these are absolute values with limits. Gotthard, relative phase shift. Not for Eiger. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "adcclk"; // + descrToFuncMap[i].m_pFuncName = "adcphase"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - adcphase [i] Sets/gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. \c Returns \c (int) + - dbitphase [i] [deg] Sets/gets phase of the clock for latching of the digital bits to i. i is the shift or in degrees if deg is used. deg is optional. dbitphase is also reset if dbitclk is changed. These are absolute values with limits. for CTB & Moench only.\c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "adcphase"; // + descrToFuncMap[i].m_pFuncName = "dbitphase"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - adcpipeline [i] Sets/gets the pipeline of the ADC. For the new chiptestbaord!\c Returns \c (int) + - maxadcphaseshift Gets maximum phase shift of the ADC clock. CTB & Moench only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "adcpipeline"; // + descrToFuncMap[i].m_pFuncName = "maxadcphaseshift"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - dbitclk [i] Sets/gets the clock frequency of the latching of the digital bits in MHz. For the new chiptestboard!\c Returns \c (int) + - maxdbitphaseshift Gets the maximum phase shift of the clock for latching of the digital bits.\c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "dbitclk"; // + descrToFuncMap[i].m_pFuncName = "maxdbitphaseshift"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - dbitphase [i] Sets/gets the phase of the clock for latching of the digital bits. For the new chiptestboard!?\c Returns \c (int) + - adcpipeline [i] Sets/gets the pipeline of the ADC. For CTB & Moench only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "dbitphase"; // + descrToFuncMap[i].m_pFuncName = "adcpipeline"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; /*! \page config - - dbitpipeline [i] Sets/gets the pipeline of the latching of the digital bits. For the new chiptestbaord!\c Returns \c (int) + - dbitpipeline [i] Sets/gets the pipeline of the latching of the digital bits. For CTB & Moench only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "dbitpipeline"; // + descrToFuncMap[i].m_pFuncName = "dbitpipeline"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed; ++i; @@ -814,28 +814,28 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page data - ratecorr [ns] Returns the dead time used for rate correections in ns (int). \c put sets the deadtime correction constant in ns, -1 will set it to default tau of settings (0 unset). \c Returns \c (int). For Eiger only. */ - descrToFuncMap[i].m_pFuncName = "ratecorr"; // + descrToFuncMap[i].m_pFuncName = "ratecorr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdRateCorr; ++i; - // /*! \page data + /*! \page data // - threaded [i] Sets/gets the data processing threaded flag. 1 is threaded, 0 unthreaded. // */ - // descrToFuncMap[i].m_pFuncName="threaded"; // + // descrToFuncMap[i].m_pFuncName="threaded"; // descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdThreaded; // ++i; /*! \page data - darkimage fn Loads the dark image to the detector from file fn (pedestal image). Cannot get. For Gotthard only. */ - descrToFuncMap[i].m_pFuncName = "darkimage"; // + descrToFuncMap[i].m_pFuncName = "darkimage"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdImage; ++i; /*! \page data - gainimage fn Loads the gain image to the detector from file fn (gain map for translation into number of photons of an analog detector). Cannot get. For Gotthard only. */ - descrToFuncMap[i].m_pFuncName = "gainimage"; // + descrToFuncMap[i].m_pFuncName = "gainimage"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdImage; ++i; @@ -856,13 +856,13 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page settings - settingsdir [dir] Sets/gets the directory where the settings files are located. \c Returns \c (string) dir */ - descrToFuncMap[i].m_pFuncName = "settingsdir"; //OK + descrToFuncMap[i].m_pFuncName = "settingsdir"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettingsDir; ++i; /*! \page settings - trimdir [dir] obsolete \c settingsdir. \c Returns \c (string) dir */ - descrToFuncMap[i].m_pFuncName = "trimdir"; //OK + descrToFuncMap[i].m_pFuncName = "trimdir"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettingsDir; ++i; @@ -884,35 +884,35 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { \c lownoise, \c dynamichg0, \c fixgain1, \c fixgain2, \c forceswitchg1, \c forceswitchg2. \n In Eiger, only sets in client shared memory. Use \c threshold or \c thresholdnotb to pass to detector. Gets from detector. \c Returns \c (string) s */ - descrToFuncMap[i].m_pFuncName = "settings"; // + descrToFuncMap[i].m_pFuncName = "settings"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettings; ++i; /*! \page settings - threshold [eV] [sett] sets/gets the detector threshold in eV. sett is optional and if provided also sets the settings. Use this for Eiger instead of \c settings. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "threshold"; // + descrToFuncMap[i].m_pFuncName = "threshold"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettings; ++i; /*! \page settings - thresholdnotb [eV] [sett] sets/gets the detector threshold in eV without loading trimbits. sett is optional and if provided also sets the settings. Use this for Eiger instead of \c settings. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "thresholdnotb"; // + descrToFuncMap[i].m_pFuncName = "thresholdnotb"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettings; ++i; /*! \page settings - trimbits [fname] loads/stores the trimbits to/from the detector. If no extension is specified, the serial number of each module will be attached. \c Returns \c (string) fname */ - descrToFuncMap[i].m_pFuncName = "trimbits"; // + descrToFuncMap[i].m_pFuncName = "trimbits"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettings; ++i; /*! \page settings - trimval [i] sets all trimbits to i. Used in EIGER only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "trimval"; // + descrToFuncMap[i].m_pFuncName = "trimval"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSettings; ++i; @@ -925,383 +925,383 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page settings - vthreshold [i] [mv] Sets/gets detector threshold voltage for single photon counters. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vthreshold"; // + descrToFuncMap[i].m_pFuncName = "vthreshold"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcalibration [i] [mv] Sets/gets the voltage of the calibration pulses. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcalibration"; // + descrToFuncMap[i].m_pFuncName = "vcalibration"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vtrimbit [i] [mv] Sets/gets the voltage to set the width of the trimbits. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vtrimbit"; // + descrToFuncMap[i].m_pFuncName = "vtrimbit"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vpreamp [i] [mv] Sets/gets the voltage to define the preamplifier feedback resistance. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vpreamp"; // + descrToFuncMap[i].m_pFuncName = "vpreamp"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vhaper1 [i] [mv] Sets/gets the voltage to define the feedback resistance of the first shaper. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vshaper1"; // + descrToFuncMap[i].m_pFuncName = "vshaper1"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vshaper2 [i] [mv] Sets/gets the voltage to define the feedback resistance of the second shaper. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vshaper2"; // + descrToFuncMap[i].m_pFuncName = "vshaper2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vhighvoltage [i] Sets/gets the high voltage to the sensor in V. \c Returns \c (int ["mV"]). */ - descrToFuncMap[i].m_pFuncName = "vhighvoltage"; // + descrToFuncMap[i].m_pFuncName = "vhighvoltage"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vapower [i] Sets/gets the analog power supply for the old chiptest board in DAC units. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vapower"; // + descrToFuncMap[i].m_pFuncName = "vapower"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vddpower [i] Sets/gets the digital power supply for the old chiptest board in DAC units. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vddpower"; // + descrToFuncMap[i].m_pFuncName = "vddpower"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vshpower [i] Sets/gets the comparator power supply for the old chiptest board in DAC units. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vshpower"; // + descrToFuncMap[i].m_pFuncName = "vshpower"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - viopower [i] Sets/gets the power supply of the FPGA I/Os for the old chiptest board in DAC units. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "viopower"; // + descrToFuncMap[i].m_pFuncName = "viopower"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vrefds [i] [mv] Sets/gets vrefds. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vref_ds"; // + descrToFuncMap[i].m_pFuncName = "vref_ds"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcascn_pb [i] [mv] Sets/gets vcascn_pb. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcascn_pb"; // + descrToFuncMap[i].m_pFuncName = "vcascn_pb"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcasc_pb [i] [mv] Sets/gets vcasc_pb. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcascp_pb"; // + descrToFuncMap[i].m_pFuncName = "vcascp_pb"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vout_cm [i] [mv] Sets/gets vout_cm. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vout_cm"; // + descrToFuncMap[i].m_pFuncName = "vout_cm"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcasc_out [i] [mv] Sets/gets vcasc_out. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcasc_out"; // + descrToFuncMap[i].m_pFuncName = "vcasc_out"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vin_com [i] [mv] Sets/gets vin_com. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vin_cm"; // + descrToFuncMap[i].m_pFuncName = "vin_cm"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vref_comp [i] [mv] Sets/gets vref_comp. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vref_comp"; // + descrToFuncMap[i].m_pFuncName = "vref_comp"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - ib_test_c [i] [mv] Sets/gets ib_test_c. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "ib_test_c"; // + descrToFuncMap[i].m_pFuncName = "ib_test_c"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vsvp [i] [mv] Sets/gets vsvp. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vsvp"; // + descrToFuncMap[i].m_pFuncName = "vsvp"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vsvn [i] [mv] Sets/gets vsvn. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vsvn"; // + descrToFuncMap[i].m_pFuncName = "vsvn"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vtr [i] [mv] Sets/gets vtr. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vtr"; // + descrToFuncMap[i].m_pFuncName = "vtr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vrf [i] [mv] Sets/gets vrf. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vrf"; // + descrToFuncMap[i].m_pFuncName = "vrf"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vrs [i] [mv] Sets/gets vrs. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vrs"; // + descrToFuncMap[i].m_pFuncName = "vrs"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vtgstv [i] [mv] Sets/gets vtgstv. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vtgstv"; // + descrToFuncMap[i].m_pFuncName = "vtgstv"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcmp_ll [i] [mv] Sets/gets vcmp_ll. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcmp_ll"; // + descrToFuncMap[i].m_pFuncName = "vcmp_ll"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcmp_lr [i] [mv] Sets/gets vcmp_lr. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcmp_lr"; // + descrToFuncMap[i].m_pFuncName = "vcmp_lr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcal_l [i] [mv] Sets/gets vcal_l. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcall"; // + descrToFuncMap[i].m_pFuncName = "vcall"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcomp_rl [i] [mv] Sets/gets vcomp_rl. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcmp_rl"; // + descrToFuncMap[i].m_pFuncName = "vcmp_rl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcomp_rr [i] [mv] Sets/gets vcomp_rr. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcmp_rr"; // + descrToFuncMap[i].m_pFuncName = "vcmp_rr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - rxb_rb [i] [mv] Sets/gets rxb_rb. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "rxb_rb"; // + descrToFuncMap[i].m_pFuncName = "rxb_rb"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - rxb_lb [i] [mv] Sets/gets rxb_lb. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "rxb_lb"; // + descrToFuncMap[i].m_pFuncName = "rxb_lb"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcp [i] [mv] Sets/gets vcp. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcp"; // + descrToFuncMap[i].m_pFuncName = "vcp"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vcn [i] [mv] Sets/gets vcn. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vcn"; // + descrToFuncMap[i].m_pFuncName = "vcn"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - vis [i] [mv] Sets/gets vis. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "vis"; // + descrToFuncMap[i].m_pFuncName = "vis"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - iodelay [i] [mv] Sets/gets iodelay. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "iodelay"; // + descrToFuncMap[i].m_pFuncName = "iodelay"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - dac:j [i] [mv] Sets/gets value for DAC number j for the new chiptestboard. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "dac"; // + descrToFuncMap[i].m_pFuncName = "dac"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - adcvpp [i] Sets/gets the Vpp of the ADC 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V . \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "adcvpp"; // + descrToFuncMap[i].m_pFuncName = "adcvpp"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_a [i] mv Sets/gets value for Va on the new chiptest board. Must be in mV. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "v_a"; // + descrToFuncMap[i].m_pFuncName = "v_a"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_b [i] mv Sets/gets value for Vb on the new chiptest board. Must be in mV. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "v_b"; // + descrToFuncMap[i].m_pFuncName = "v_b"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_c [i] mv Sets/gets value for Vc on the new chiptest board. Must be in mV. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "v_c"; // + descrToFuncMap[i].m_pFuncName = "v_c"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_d [i] mv Sets/gets value for Vd on the new chiptest board. Must be in mV. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "v_d"; // + descrToFuncMap[i].m_pFuncName = "v_d"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_io [i] mv Sets/gets value for Vio on the new chiptest board. Must be in mV. It should be minimum 1200 mV and must be the first power regulator to be set after server start up (fpga reset). To change again, reset fpga first. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "v_io"; // + descrToFuncMap[i].m_pFuncName = "v_io"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_chip [i] mv Sets/gets value for Vchip on the new chiptest board. Must be in mV. \c Returns \c (int ["mV"]). Do NOT use it, unless you are completely sure you won't fry the board! */ - descrToFuncMap[i].m_pFuncName = "v_chip"; // + descrToFuncMap[i].m_pFuncName = "v_chip"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - v_limit [i] mv Sets/gets a soft limit for the power supplies and the DACs on the new chiptest board. Must be in mV. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "v_limit"; // + descrToFuncMap[i].m_pFuncName = "v_limit"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /* MYTHEN 3.01 all values are in DACu */ - descrToFuncMap[i].m_pFuncName = "vIpre"; // + descrToFuncMap[i].m_pFuncName = "vIpre"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "VcdSh"; // + descrToFuncMap[i].m_pFuncName = "VcdSh"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - Vth1 Sets/gets first detector threshold voltage for Mythen 3.01. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "Vth1"; // + descrToFuncMap[i].m_pFuncName = "Vth1"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - Vth1 Sets/gets second detector threshold voltage for Mythen 3.01. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "Vth2"; // + descrToFuncMap[i].m_pFuncName = "Vth2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; /*! \page settings - Vth1 Sets/gets third detector threshold voltage for Mythen 3.01. Normally in DAC units unless \c mv is specified at the end of the command line. \c Returns \c (int ["mV"]) */ - descrToFuncMap[i].m_pFuncName = "Vth3"; // + descrToFuncMap[i].m_pFuncName = "Vth3"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "VPL"; // baseline for analog pulsing + descrToFuncMap[i].m_pFuncName = "VPL"; //baseline for analog pulsing descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "Vtrim"; // + descrToFuncMap[i].m_pFuncName = "Vtrim"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "vIbias"; // + descrToFuncMap[i].m_pFuncName = "vIbias"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "vIinSh"; // + descrToFuncMap[i].m_pFuncName = "vIinSh"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "cas"; // + descrToFuncMap[i].m_pFuncName = "cas"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "casSh"; // + descrToFuncMap[i].m_pFuncName = "casSh"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "vIbiasSh"; // + descrToFuncMap[i].m_pFuncName = "vIbiasSh"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "vIcin"; // + descrToFuncMap[i].m_pFuncName = "vIcin"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; - descrToFuncMap[i].m_pFuncName = "vIpreOut"; // + descrToFuncMap[i].m_pFuncName = "vIpreOut"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDAC; ++i; @@ -1314,140 +1314,140 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page settings - temp_adc Gets the ADC temperature. \c Returns \c EIGER,JUNGFRAU(double"°C") Others \c (int"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_adc"; // + descrToFuncMap[i].m_pFuncName = "temp_adc"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_fpga Gets the FPGA temperature. \c Returns \c EIGER,JUNGFRAU(double"°C") Others \c (int"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_fpga"; // + descrToFuncMap[i].m_pFuncName = "temp_fpga"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_fpgaext Gets the external FPGA temperature. Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_fpgaext"; // + descrToFuncMap[i].m_pFuncName = "temp_fpgaext"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_10ge Gets the 10Gbe temperature. Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_10ge"; // + descrToFuncMap[i].m_pFuncName = "temp_10ge"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_dcdc Gets the temperature of the DC/DC converter. Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_dcdc"; // + descrToFuncMap[i].m_pFuncName = "temp_dcdc"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_sodl Gets the temperature of the left so-dimm memory . Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_sodl"; // + descrToFuncMap[i].m_pFuncName = "temp_sodl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_sodr Gets the temperature of the right so-dimm memory. Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_sodr"; // + descrToFuncMap[i].m_pFuncName = "temp_sodr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - adc:j Gets the values of the slow ADC number j for the new chiptest board. \c Returns \c (int"°C") */ - descrToFuncMap[i].m_pFuncName = "adc"; // + descrToFuncMap[i].m_pFuncName = "adc"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_fpgal Gets the temperature of the left frontend FPGA. Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_fpgafl"; // + descrToFuncMap[i].m_pFuncName = "temp_fpgafl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - temp_fpgar Gets the temperature of the right frontend FPGA. Used in EIGER only. \c Returns \c EIGER(double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_fpgafr"; // + descrToFuncMap[i].m_pFuncName = "temp_fpgafr"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - i_a Gets the current of the power supply a on the new chiptest board. \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "i_a"; // + descrToFuncMap[i].m_pFuncName = "i_a"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - i_b Gets the current of the power supply b on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "i_b"; // + descrToFuncMap[i].m_pFuncName = "i_b"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - i_c Gets the current of the power supply c on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "i_c"; // + descrToFuncMap[i].m_pFuncName = "i_c"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - i_d Gets the current of the power supply d on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "i_d"; // + descrToFuncMap[i].m_pFuncName = "i_d"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - i_io Gets the current of the power supply io on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "i_io"; // + descrToFuncMap[i].m_pFuncName = "i_io"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - vm_a Gets the measured voltage of the power supply a on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "vm_a"; // + descrToFuncMap[i].m_pFuncName = "vm_a"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - vm_b Gets the measured voltage of the power supply b on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "vm_b"; // + descrToFuncMap[i].m_pFuncName = "vm_b"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - vm_c Gets the measured voltage of the power supply c on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "vm_c"; // + descrToFuncMap[i].m_pFuncName = "vm_c"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - vm_d Gets the measured voltage of the power supply d on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "vm_d"; // + descrToFuncMap[i].m_pFuncName = "vm_d"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; /*! \page settings - vm_io Gets the measured voltage of the power supply io on the new chiptest board \c Returns \c (int"mV") */ - descrToFuncMap[i].m_pFuncName = "vm_io"; // + descrToFuncMap[i].m_pFuncName = "vm_io"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdADC; ++i; @@ -1460,21 +1460,21 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page settings - temp_threshold Sets/gets the threshold temperature. JUNGFRAU ONLY. \c Returns \c (double"°C") */ - descrToFuncMap[i].m_pFuncName = "temp_threshold"; // + descrToFuncMap[i].m_pFuncName = "temp_threshold"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTempControl; ++i; /*! \page settings - temp_control Enables/Disables the temperature control. 1 enables, 0 disables. JUNGFRAU ONLY. \c Returns \c int */ - descrToFuncMap[i].m_pFuncName = "temp_control"; // + descrToFuncMap[i].m_pFuncName = "temp_control"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTempControl; ++i; /*! \page settings - temp_event Resets/gets over-temperative event. Put only with option 0 to clear event. Gets 1 if temperature went over threshold and control is enabled, else 0. /Disables the temperature control. JUNGFRAU ONLY. \c Returns \c int */ - descrToFuncMap[i].m_pFuncName = "temp_event"; // + descrToFuncMap[i].m_pFuncName = "temp_event"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTempControl; ++i; @@ -1487,42 +1487,42 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page output - outdir [dir] Sets/gets the file output directory. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "outdir"; //OK + descrToFuncMap[i].m_pFuncName = "outdir"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOutDir; ++i; /*! \page output - fname [fn] Sets/gets the root of the output file name \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "fname"; //OK + descrToFuncMap[i].m_pFuncName = "fname"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdFileName; ++i; /*! \page output - index [i] Sets/gets the current file index. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "index"; //OK + descrToFuncMap[i].m_pFuncName = "index"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdFileIndex; ++i; /*! \page output - enablefwrite [i] Enables/disables file writing. 1 enables, 0 disables. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "enablefwrite"; // + descrToFuncMap[i].m_pFuncName = "enablefwrite"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdEnablefwrite; ++i; /*! \page output - overwrite [i] enables(1) /disables(0) file overwriting. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "overwrite"; // + descrToFuncMap[i].m_pFuncName = "overwrite"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdOverwrite; ++i; /*! \page output - fileformat sets/gets the file format for data in receiver. Options: [ascii, binary, hdf5]. Ascii is not implemented in Receiver. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "fileformat"; //OK + descrToFuncMap[i].m_pFuncName = "fileformat"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdFileName; ++i; @@ -1532,210 +1532,210 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { Commands to setup the network between client, detector and receiver - rx_hostname [s] sets/gets the receiver hostname or IP address, configures detector mac with all network parameters and updates receiver with acquisition parameters. Normally used for single detectors (Can be multi-detector). \c none disables. If used, use as last network command in configuring detector MAC. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_hostname"; // + descrToFuncMap[i].m_pFuncName = "rx_hostname"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpip [ip] sets/gets the ip address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-detector). Used if different from eth0. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_udpip"; // + descrToFuncMap[i].m_pFuncName = "rx_udpip"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpip2 [ip] sets/gets the ip address of the second receiver UDP interface where the data from the bottom half module of the detector will be streamed to. Normally used for single detectors (Can be multi-detector). Used if different from eth0. JUNGFRAU only. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_udpip2"; // + descrToFuncMap[i].m_pFuncName = "rx_udpip2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpmac [mac] sets/gets the mac address of the receiver UDP interface where the data from the detector will be streamed to. Normally used for single detectors (Can be multi-detector). \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_udpmac"; // + descrToFuncMap[i].m_pFuncName = "rx_udpmac"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpmac2 [mac] sets/gets the mac address of the second receiver UDP interface where the data from the bottom half module of the detector will be streamed to. Normally used for single detectors (Can be multi-detector). JUNGFRAU only.\c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_udpmac2"; // + descrToFuncMap[i].m_pFuncName = "rx_udpmac2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpport [port] sets/gets the port of the receiver UDP interface where the data from the detector will be streamed to. Use single-detector command. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_udpport"; // + descrToFuncMap[i].m_pFuncName = "rx_udpport"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpport2 [port] sets/gets the second port of the receiver UDP interface where the data from the second half of the detector will be streamed to. Use single-detector command. Used for EIGERand JUNGFRAU only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_udpport2"; // + descrToFuncMap[i].m_pFuncName = "rx_udpport2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_udpsocksize [size] sets/gets the UDP socket buffer size. Already trying to set by default to 100mb, 2gb for Jungfrau. Does not remember in client shared memory, so must be initialized each time after setting receiver hostname in config file.\c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_udpsocksize"; // + descrToFuncMap[i].m_pFuncName = "rx_udpsocksize"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_realudpsocksize [size] gets the actual UDP socket buffer size. Usually double the set udp socket buffer size due to kernel bookkeeping. Get only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_realudpsocksize"; // + descrToFuncMap[i].m_pFuncName = "rx_realudpsocksize"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - detectormac [mac] sets/gets the mac address of the detector UDP interface from where the detector will stream data. Use single-detector command. Normally unused. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "detectormac"; // + descrToFuncMap[i].m_pFuncName = "detectormac"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - detectormac2 [mac] sets/gets the mac address of the second half of the detector UDP interface from where the bottom half module of the detector will stream data. Use single-detector command. Normally unused. JUNGFRAU only. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "detectormac2"; // + descrToFuncMap[i].m_pFuncName = "detectormac2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - detectorip [ip] sets/gets the ip address of the detector UDP interface from where the bottom half of the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip (if rx_udpip specified). \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "detectorip"; // + descrToFuncMap[i].m_pFuncName = "detectorip"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - detectorip2 [ip] sets/gets the ip address of the second half of the detector UDP interface from where the bottom half of the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip2 (if rx_udpip2 specified). JUNGFRAU only. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "detectorip2"; // + descrToFuncMap[i].m_pFuncName = "detectorip2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - numinterfaces [n] sets/gets the number of interfaces used to stream out from the detector. Options: 1, 2. JUNGFRAU only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "numinterfaces"; // + descrToFuncMap[i].m_pFuncName = "numinterfaces"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - selinterface [n] sets/gets the 1st or the 2nd interface to use to stream data out of the detector. Options: 1, 2. Effective only when \c numinterfaces is 1. JUNGFRAU only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "selinterface"; // + descrToFuncMap[i].m_pFuncName = "selinterface"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - txndelay_left [delay] sets/gets the transmission delay of first packet in an image being streamed out from the detector's left UDP port. Use single-detector command. Used for EIGER only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "txndelay_left"; // + descrToFuncMap[i].m_pFuncName = "txndelay_left"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - txndelay_right [delay] sets/gets the transmission delay of first packet in an image being streamed out from the detector's right UDP port. Use single-detector command. Used for EIGER only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "txndelay_right"; // + descrToFuncMap[i].m_pFuncName = "txndelay_right"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - txndelay_frame [delay] sets/gets the transmission frame period of entire frame being streamed out from the detector for both ports. Use single-detector command. Used for EIGER and JUNGFRAU only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "txndelay_frame"; // + descrToFuncMap[i].m_pFuncName = "txndelay_frame"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - flowcontrol_10g [delay] Enables/disables 10 GbE flow control. 1 enables, 0 disables. Used for EIGER only. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "flowcontrol_10g"; // + descrToFuncMap[i].m_pFuncName = "flowcontrol_10g"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - zmqport [port] sets/gets the 0MQ (TCP) port of the client to where final data is streamed to (eg. for GUI). The default already connects with rx_zmqport for the GUI. Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. Must restart zmq client streaming in gui/external gui \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "zmqport"; // + descrToFuncMap[i].m_pFuncName = "zmqport"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_zmqport [port] sets/gets the 0MQ (TCP) port of the receiver from where data is streamed from (eg. to GUI or another process for further processing). Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. put restarts streaming in receiver with new port. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_zmqport"; // + descrToFuncMap[i].m_pFuncName = "rx_zmqport"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; ++i; /*! \page network - rx_datastream enables/disables data streaming from receiver. 1 enables 0MQ data stream from receiver (creates streamer threads), while 0 disables (destroys streamer threads). Switching to Gui enables data streaming in receiver and switching back to command line acquire will require disabling data streaming in receiver for fast applications \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_datastream"; // + descrToFuncMap[i].m_pFuncName = "rx_datastream"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdDataStream; ++i; /*! \page network - zmqip [ip] sets/gets the 0MQ (TCP) ip of the client to where final data is streamed to (eg. for GUI). For Experts only! Default is ip of rx_hostname and works for GUI. This command to change from default can be used from command line when sockets are not already open as the command line is not aware/create the 0mq sockets in the client side. This is usually used to stream in from an external process. . If no custom ip, empty until first time connect to receiver. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "zmqip"; // + descrToFuncMap[i].m_pFuncName = "zmqip"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; i++; /*! \page network - rx_zmqip [ip] sets/gets the 0MQ (TCP) ip of the receiver from where data is streamed from (eg. to GUI or another process for further processing). For Experts only! Default is ip of rx_hostname and works for GUI. This is usually used to stream out to an external process for further processing. . If no custom ip, empty until first time connect to receiver. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_zmqip"; // + descrToFuncMap[i].m_pFuncName = "rx_zmqip"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter; i++; /*! \page network - configuremac [i] configures the MAC of the detector with these parameters: detectorip, detectormac, rx_udpip, rx_udpmac, rx_udpport, rx_udpport2 (if applicable). This command is already included in \c rx_hsotname. Only put!. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "configuremac"; // + descrToFuncMap[i].m_pFuncName = "configuremac"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdConfigureMac; ++i; /*! \page network - rx_tcpport [port] sets/gets the port of the client-receiver TCP interface. Use single-detector command. Is different for each detector if same \c rx_hostname used. Must be first command to communicate with receiver. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_tcpport"; // + descrToFuncMap[i].m_pFuncName = "rx_tcpport"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPort; ++i; /*! \page network - port [port] sets/gets the port of the client-detector control server TCP interface. Use single-detector command. Default value is 1952 for all detectors. Normally not changed. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "port"; // + descrToFuncMap[i].m_pFuncName = "port"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPort; ++i; /*! \page network - stopport [port] sets/gets the port of the client-detector stop server TCP interface. Use single-detector command. Default value is 1953 for all detectors. Normally not changed. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "stopport"; // + descrToFuncMap[i].m_pFuncName = "stopport"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPort; ++i; /*! \page network - lock [i] Locks/Unlocks the detector to communicate with this client. 1 locks, 0 unlocks. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "lock"; // + descrToFuncMap[i].m_pFuncName = "lock"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdLock; ++i; /*! \page network - lastclient Gets the last client communicating with the detector. Cannot put!. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "lastclient"; // + descrToFuncMap[i].m_pFuncName = "lastclient"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdLastClient; ++i; @@ -1790,70 +1790,70 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page receiver - r_lock [i] locks/unlocks the receiver to communicate with only this client. 1 locks, 0 unlocks. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_lock"; // + descrToFuncMap[i].m_pFuncName = "r_lock"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdLock; ++i; /*! \page receiver - r_lastclient gets the last client communicating with the receiver. Only get! \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_lastclient"; // + descrToFuncMap[i].m_pFuncName = "r_lastclient"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdLastClient; ++i; /*! \page receiver - r_readfreq [i] sets/gets the stream frequency of data from receiver to client. i > 0 is the nth frame being streamed. 0 sets frequency to a default timer (200ms). \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_readfreq"; // + descrToFuncMap[i].m_pFuncName = "r_readfreq"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page receiver - rx_fifodepth [i] sets/gets receiver fifo (between Listener and Writer Threads) depth to i number of frames. Can improve listener packet loss (loss due to packet processing time in Listener threads), not if limited by writing. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "rx_fifodepth"; // + descrToFuncMap[i].m_pFuncName = "rx_fifodepth"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page receiver - r_silent [i] sets/gets receiver in silent mode, ie. it will not print anything during real time acquisition. 1 sets, 0 unsets. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_silent"; // + descrToFuncMap[i].m_pFuncName = "r_silent"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page receiver - r_framesperfile [i] sets/gets the frames per file in receiver to i. 0 means infinite or all frames in a single file. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_framesperfile"; //OK + descrToFuncMap[i].m_pFuncName = "r_framesperfile"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page receiver - r_discardpolicy sets/gets the frame discard policy in the receiver. nodiscard (default) - discards nothing, discardempty - discard only empty frames, discardpartial(fastest) - discards all partial frames. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_discardpolicy"; //OK + descrToFuncMap[i].m_pFuncName = "r_discardpolicy"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page receiver - r_padding sets/gets the frame padding in the receiver. 0 does not pad partial frames(fastest), 1 (default) pads partial frames. \c Returns \c (int) */ - descrToFuncMap[i].m_pFuncName = "r_padding"; //OK + descrToFuncMap[i].m_pFuncName = "r_padding"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; ++i; /*! \page receiver - rx_jsonaddheader [t] sets/gets additional json header to be streamed out with the zmq from receiver. Default is empty. \c t must be in the format "\"label1\":\"value1\",\"label2\":\"value2\"" etc. Use only if it needs to be processed by an intermediate process. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_jsonaddheader"; // + descrToFuncMap[i].m_pFuncName = "rx_jsonaddheader"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; i++; /*! \page receiver - rx_jsonpara [k] [v] sets/gets value v for additional json header parameter k to be streamed out with the zmq from receiver. If empty, then no parameter found Use only if it needs to be processed by an intermediate process. \c Returns \c (string) */ - descrToFuncMap[i].m_pFuncName = "rx_jsonpara"; // + descrToFuncMap[i].m_pFuncName = "rx_jsonpara"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdReceiver; i++; @@ -1867,182 +1867,182 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) { /*! \page prototype - emin [i] Sets/gets detector minimum energy threshold for Moench (soft setting in processor) */ - descrToFuncMap[i].m_pFuncName = "emin"; // + descrToFuncMap[i].m_pFuncName = "emin"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdProcessor; ++i; /*! \page prototype - emax [i] Sets/gets detector maximum energy threshold for Moench (soft setting in processor) */ - descrToFuncMap[i].m_pFuncName = "emax"; // + descrToFuncMap[i].m_pFuncName = "emax"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdProcessor; ++i; /*! \page prototype - framemode [i] Sets/gets frame mode for Moench (soft setting in processor). Options: pedestal, newpedestal, flatfield, newflatfield */ - descrToFuncMap[i].m_pFuncName = "framemode"; // + descrToFuncMap[i].m_pFuncName = "framemode"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdProcessor; ++i; /*! \page prototype - detectormode [i] Sets/gets detector mode for Moench (soft setting in processor). Options: counting, interpolating, analog */ - descrToFuncMap[i].m_pFuncName = "detectormode"; // + descrToFuncMap[i].m_pFuncName = "detectormode"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdProcessor; ++i; /*! \page prototype - adcinvert [mask] Sets/gets ADC inversion mask (8 digits hex format) */ - descrToFuncMap[i].m_pFuncName = "adcinvert"; // + descrToFuncMap[i].m_pFuncName = "adcinvert"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - adcdisable [mask] Sets/gets ADC disable mask (8 digits hex format) */ - descrToFuncMap[i].m_pFuncName = "adcdisable"; // + descrToFuncMap[i].m_pFuncName = "adcdisable"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - pattern fn loads binary pattern file fn */ - descrToFuncMap[i].m_pFuncName = "pattern"; // + descrToFuncMap[i].m_pFuncName = "pattern"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patword addr [word] sets/gets 64 bit word at address addr of pattern memory. Both address and word in hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patword"; // + descrToFuncMap[i].m_pFuncName = "patword"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patioctrl [word] sets/gets 64 bit mask defining input (0) and output (1) signals. hex format. */ - descrToFuncMap[i].m_pFuncName = "patioctrl"; // + descrToFuncMap[i].m_pFuncName = "patioctrl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patclkctrl [word] sets/gets 64 bit mask defining if output signal is a clock and runs. hex format. Unused at the moment. */ - descrToFuncMap[i].m_pFuncName = "patclkctrl"; // + descrToFuncMap[i].m_pFuncName = "patclkctrl"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patlimits [addr1 addr2] sets/gets the start and stop limits of the pattern to be executed. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patlimits"; // + descrToFuncMap[i].m_pFuncName = "patlimits"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patloop0 [addr1 addr2] sets/gets the start and stop limits of the level 0 loop. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patloop0"; // + descrToFuncMap[i].m_pFuncName = "patloop0"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patnloop0 [n] sets/gets the number of cyclesof the level 0 loop (int). */ - descrToFuncMap[i].m_pFuncName = "patnloop0"; // + descrToFuncMap[i].m_pFuncName = "patnloop0"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patwait0 [addr] sets/gets the address of the level 0 wait point. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patwait0"; // + descrToFuncMap[i].m_pFuncName = "patwait0"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patwaittime0 [n] sets/gets the duration of the witing of the 0 waiting point in clock cycles (int). */ - descrToFuncMap[i].m_pFuncName = "patwaittime0"; // + descrToFuncMap[i].m_pFuncName = "patwaittime0"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patloop1 [addr1 addr2] sets/gets the start and stop limits of the level 1 loop. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patloop1"; // + descrToFuncMap[i].m_pFuncName = "patloop1"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patnloop1 [n] sets/gets the number of cyclesof the level 1 loop (int). */ - descrToFuncMap[i].m_pFuncName = "patnloop1"; // + descrToFuncMap[i].m_pFuncName = "patnloop1"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patwait1 [addr] sets/gets the address of the level 1 wait point. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patwait1"; // + descrToFuncMap[i].m_pFuncName = "patwait1"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patwaittime1 [n] sets/gets the duration of the witing of the 1 waiting point in clock cycles (int). */ - descrToFuncMap[i].m_pFuncName = "patwaittime1"; // + descrToFuncMap[i].m_pFuncName = "patwaittime1"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patloop2 [addr1 addr2] sets/gets the start and stop limits of the level 2 loop. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patloop2"; // + descrToFuncMap[i].m_pFuncName = "patloop2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patnloop2 [n] sets/gets the number of cyclesof the level 2 loop (int). */ - descrToFuncMap[i].m_pFuncName = "patnloop2"; // + descrToFuncMap[i].m_pFuncName = "patnloop2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patwait2 [addr] sets/gets the address of the level 2 wait point. hex format. Advanced! */ - descrToFuncMap[i].m_pFuncName = "patwait2"; // + descrToFuncMap[i].m_pFuncName = "patwait2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patwaittime2 [n] sets/gets the duration of the waiting of the 2 waiting point in clock cycles (int). */ - descrToFuncMap[i].m_pFuncName = "patwaittime2"; // + descrToFuncMap[i].m_pFuncName = "patwaittime2"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patmask [m] sets/gets the 64 bit mask (hex) applied to every pattern. Only the bits from \c patsetbit are selected to mask for the corresponding bit value from \c m mask. Returns \c (uint64_t). */ - descrToFuncMap[i].m_pFuncName = "patmask"; // + descrToFuncMap[i].m_pFuncName = "patmask"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - patsetbit [m] selects/gets the 64 bits (hex) that the patmask will be applied to every pattern. Only the bits from \c m mask are selected to mask for the corresponding bit value from \c patmask. Returns \c (uint64_t). */ - descrToFuncMap[i].m_pFuncName = "patsetbit"; // + descrToFuncMap[i].m_pFuncName = "patsetbit"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; /*! \page prototype - dut_clk [i] sets/gets the signal to be used as a clock for the digital data coming from the device under test. Advanced! */ - descrToFuncMap[i].m_pFuncName = "dut_clk"; // + descrToFuncMap[i].m_pFuncName = "dut_clk"; descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern; ++i; @@ -4563,34 +4563,54 @@ std::string slsDetectorCommand::helpTimeLeft(int action) { std::string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action, int detPos) { speedVariable index; - int t = -1, ret; + int t = -1, ret = 0, mode = 0; char answer[1000]; if (action == HELP_ACTION) - return helpSpeed(action); + return helpSpeed(action); - if (cmd == "clkdivider") - index = CLOCK_DIVIDER; - else if (cmd == "phasestep") { - index = PHASE_SHIFT; - t = 100000; - } else if (cmd == "oversampling") - index = OVERSAMPLING; - else if (cmd == "adcclk") - index = ADC_CLOCK; + if (cmd == "clkdivider") { + index = CLOCK_DIVIDER; + } + else if (cmd == "adcclk") { + index = ADC_CLOCK; + } + else if (cmd == "dbitclk") { + index = DBIT_CLOCK; + } else if (cmd == "adcphase") { - index = ADC_PHASE; - t = 100000; - } else if (cmd == "adcpipeline") - index = ADC_PIPELINE; - else if (cmd == "dbitclk") - index = DBIT_CLOCK; + index = ADC_PHASE; + if ((action == PUT_ACTION && narg > 2 && std::string(args[2]) == "deg") || + (action == GET_ACTION && narg > 1 && std::string(args[1]) == "deg")) { + mode = 1; + } + } else if (cmd == "dbitphase") { - index = DBIT_PHASE; - t = 100000; - } else if (cmd == "dbitpipeline") - index = DBIT_PIPELINE; + index = DBIT_PHASE; + if ((action == PUT_ACTION && narg > 2 && std::string(args[2]) == "deg") || + (action == GET_ACTION && narg > 1 && std::string(args[1]) == "deg")) { + mode = 1; + } + } + else if (cmd == "maxadcphaseshift") { + index = MAX_ADC_PHASE_SHIFT; + if (action == PUT_ACTION) { + return std::string("cannot put"); + } + } + else if (cmd == "maxdbitphaseshift") { + index = MAX_DBIT_PHASE_SHIFT; + if (action == PUT_ACTION) { + return std::string("cannot put"); + } + } + else if (cmd == "adcpipeline") { + index = ADC_PIPELINE; + } + else if (cmd == "dbitpipeline") { + index = DBIT_PIPELINE; + } else return std::string("could not decode speed variable ") + cmd; @@ -4603,7 +4623,7 @@ std::string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action, int myDet->setOnline(ONLINE_FLAG, detPos); - ret = myDet->setSpeed(index, t, detPos); + ret = myDet->setSpeed(index, t, mode, detPos); sprintf(answer, "%d", ret); return std::string(answer); @@ -4613,15 +4633,25 @@ std::string slsDetectorCommand::helpSpeed(int action) { std::ostringstream os; if (action == PUT_ACTION || action == HELP_ACTION) { - - os << "clkdivider c \t sets readout clock divider. For Jungfrau, it also overwrites adcphase to recommended default" << std::endl; - os << "adcphase c\t Sets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER)" << std::endl; + os << "clkdivider c \t sets readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. Not for Gotthard." << std::endl; + os << "adcclk c \tSets ADC clock frequency in MHz. CTB & Moench only. It also resets adcphase." << std::endl; + os << "dbitclk c \tSets the clock frequency of the latching of the digital bits in MHz. CTB & Moench only. It also resets dbit phase." << std::endl; + os << "adcphase c [deg]\t Sets phase of the ADC clock to i. i is the shift or in degrees if deg is used. deg is optional & only for CTB & Moench. For CTB & Moench, adcphase is reset if adcclk is changed. For Jungfrau, adcphase changed to defaults if clkdivider changed. Jungfrau, CTB & Moench, these are absolute values with limits. Gotthard, relative phase shift. Not for Eiger." << std::endl; + os << "dbitphase c [deg]\t Sets the phase of the clock for latching of the digital bits to i. i is the shift or in degrees if deg is used. deg is optional. dbitphase is also reset if dbitclk is changed. These are absolute values with limits. for CTB & Moench only." << std::endl; + os << "adcpipeline c \t Sets the pipeline of the ADC. For CTB & Moench only." << std::endl; + os << "dbitpipeline c \t Sets the pipeline of the latching of the digital bits. For CTB & Moench only." << std::endl; os << std::endl; } if (action == GET_ACTION || action == HELP_ACTION) { - - os << "clkdivider \t gets readout clock divider. For Jungfrau, it also overwrites adcphase to recommended default" << std::endl; - os << "adcphase \t gets phase of the sampling clock. For JUNGFRAU, setting speed (clkdivider) overwrites adcphase to its default recommended value. (Not for EIGER)" << std::endl; + os << "clkdivider \t Gets readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. Not for Gotthard." << std::endl; + os << "adcclk \tGets ADC clock frequency in MHz. CTB & Moench only. It also resets adcphase." << std::endl; + os << "dbitclk \tGets the clock frequency of the latching of the digital bits in MHz. CTB & Moench only. It also resets dbit phase." << std::endl; + os << "adcphase [deg]\t Gets phase of the ADC clock. unit is number of shifts or in degrees if deg is used. deg is optional & only for CTB & Moench. For CTB & Moench, adcphase is reset if adcclk is changed. For Jungfrau, adcphase changed to defaults if clkdivider changed. Jungfrau, CTB & Moench, these are absolute values with limits. Gotthard, relative phase shift. Not for Eiger." << std::endl; + os << "dbitphase [deg]\t Gets the phase of the clock for latching of the digital bits. unit is number of shifts or in degrees if deg is used. deg is optional. dbitphase is also reset if dbitclk is changed. These are absolute values with limits. for CTB & Moench only." << std::endl; + os << "adcpipeline \t Gets the pipeline of the ADC. For CTB & Moench only." << std::endl; + os << "dbitpipeline \t Gets the pipeline of the latching of the digital bits. For CTB & Moench only." << std::endl; + os << "maxadcphaseshift \t Gets maximum phase shift of the ADC clock. CTB & Moench only." << std::endl; + os << "maxdbitphaseshift \t Gets maximum phase shift of the clock for latching of the digital bits. CTB & Moench only." << std::endl; os << std::endl; } return os.str(); diff --git a/slsReceiverSoftware/src/slsReceiverImplementation.cpp b/slsReceiverSoftware/src/slsReceiverImplementation.cpp index 3535ea293..77dae85c8 100644 --- a/slsReceiverSoftware/src/slsReceiverImplementation.cpp +++ b/slsReceiverSoftware/src/slsReceiverImplementation.cpp @@ -722,8 +722,10 @@ int slsReceiverImplementation::setUDPSocketBufferSize(const int64_t s) { int64_t size = (s == 0) ? udpSocketBufferSize : s; size_t listSize = listener.size(); - if ((int)listSize != numUDPInterfaces) + if (myDetectorType == JUNGFRAU && (int)listSize != numUDPInterfaces) { + FILE_LOG(logERROR) << "Number of Interfaces " << numUDPInterfaces << " do not match listener size " << listSize; return FAIL; + } for (unsigned int i = 0; i < listSize; ++i) { if (listener[i]->CreateDummySocketForUDPSocketBufferSize(size) == FAIL) diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index e1d219f11..3dd1efffc 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -733,13 +733,16 @@ int slsReceiverTCPIPInterface::setup_udp(){ uint32_t port2 = atoi(args[5]); // using the 2nd interface only - if (numInterfaces == 1 && selInterface == 2) { + if (myDetectorType == JUNGFRAU && numInterfaces == 1 && selInterface == 2) { ip1 = ip2; port1 = port2; } // 1st interface receiver->setUDPPortNumber(port1); + if (myDetectorType == EIGER) { + receiver->setUDPPortNumber2(port2); + } FILE_LOG(logINFO) << "Receiver UDP IP: " << ip1; // get eth std::string temp = genericSocket::ipToName(ip1); @@ -769,7 +772,7 @@ int slsReceiverTCPIPInterface::setup_udp(){ FILE_LOG(logERROR) << mess; } else { // using the 2nd interface only - if (numInterfaces == 1 && selInterface == 2) { + if (myDetectorType == JUNGFRAU && numInterfaces == 1 && selInterface == 2) { strcpy(retvals[1],temp.c_str()); FILE_LOG(logINFO) << "Receiver MAC Address: " << retvals[1]; } @@ -782,7 +785,7 @@ int slsReceiverTCPIPInterface::setup_udp(){ } // 2nd interface - if (numInterfaces == 2) { + if (myDetectorType == JUNGFRAU && numInterfaces == 2) { receiver->setUDPPortNumber2(port2); FILE_LOG(logINFO) << "Receiver UDP IP 2: " << ip2; // get eth @@ -820,7 +823,7 @@ int slsReceiverTCPIPInterface::setup_udp(){ } // set the number of udp interfaces (changes number of threads and many others) - if (receiver->setNumberofUDPInterfaces(numInterfaces) == FAIL) { + if (myDetectorType == JUNGFRAU && receiver->setNumberofUDPInterfaces(numInterfaces) == FAIL) { ret = FAIL; sprintf(mess, "Failed to set number of interfaces\n"); FILE_LOG(logERROR) << mess; diff --git a/slsSupportLib/include/sls_detector_defs.h b/slsSupportLib/include/sls_detector_defs.h index 0d98a46cf..9f7f4a3c7 100755 --- a/slsSupportLib/include/sls_detector_defs.h +++ b/slsSupportLib/include/sls_detector_defs.h @@ -502,14 +502,14 @@ public: */ enum speedVariable { CLOCK_DIVIDER, /**< readout clock divider */ - PHASE_SHIFT, /**< adds phase shift */ - OVERSAMPLING, /**< oversampling for analog detectors */ ADC_CLOCK, /**< adc clock divider */ ADC_PHASE, /**< adc clock phase */ ADC_PIPELINE, /**< adc pipeline */ DBIT_CLOCK, /**< adc clock divider */ DBIT_PHASE, /**< adc clock phase */ - DBIT_PIPELINE /**< adc pipeline */ + DBIT_PIPELINE, /**< adc pipeline */ + MAX_ADC_PHASE_SHIFT, /** max adc phase shift */ + MAX_DBIT_PHASE_SHIFT, /** max adc phase shift */ };