diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 97ad8662f..a31712d3c 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -122,7 +122,7 @@ void qDrawPlot::SetupWidgetWindow(){ nPixelsX = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::X); nPixelsY = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::Y); if (detType == slsDetectorDefs::CHIPTESTBOARD) { - npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::SAMPLES_JCTB, -1) * 2)/25;// for moench 03 + npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::SAMPLES, -1) * 2)/25;// for moench 03 nPixelsX = npixelsx_jctb; nPixelsY = npixelsy_jctb; } @@ -586,7 +586,7 @@ void qDrawPlot::SetScanArgument(int scanArg){ nPixelsX = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::X); nPixelsY = myDet->getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::Y); if (detType == slsDetectorDefs::CHIPTESTBOARD) { - npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::SAMPLES_JCTB, -1) * 2)/25; // for moench 03 + npixelsy_jctb = (myDet->setTimer(slsDetectorDefs::SAMPLES, -1) * 2)/25; // for moench 03 nPixelsX = npixelsx_jctb; nPixelsY = npixelsy_jctb; } diff --git a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h index 8450763be..ae2717972 100644 --- a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h @@ -1,11 +1,7 @@ #pragma once /* Definitions for FPGA */ -#ifdef JCTB -#define MEM_MAP_SHIFT 11 -#else #define MEM_MAP_SHIFT 1 -#endif /* FPGA Version RO register */ #define FPGA_VERSION_REG (0x00 << MEM_MAP_SHIFT) @@ -14,7 +10,6 @@ #define FPGA_VERSION_BRD_RVSN_MSK (0x00FFFFFF << FPGA_VERSION_BRD_RVSN_OFST) #define FPGA_VERSION_DTCTR_TYP_OFST (24) #define FPGA_VERSION_DTCTR_TYP_MSK (0x000000FF << FPGA_VERSION_DTCTR_TYP_OFST) -#define FPGA_VERSION_DTCTR_TYP_JCTB_VAL ((0x2 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK) #define FPGA_VERSION_DTCTR_TYP_CTB_VAL ((0x3 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK) /* Fix pattern RO register */ diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 31be1eb1a..3c1f5361a 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -64,7 +64,7 @@ void basictests() { firmware_check_done = 0; memset(firmware_message, 0, MAX_STR_LENGTH); #ifdef VIRTUAL - FILE_LOG(logINFOBLUE, ("******** %s Virtual Server *****************\n", DETNAME)); + FILE_LOG(logINFOBLUE, ("******** Chip Test Board Virtual Server *****************\n")); if (mapCSP0() == FAIL) { strcpy(firmware_message, "Could not map to memory. Dangerous to continue.\n"); @@ -110,7 +110,7 @@ void basictests() { if (fwversion >= MIN_REQRD_VRSN_T_RD_API) sw_fw_apiversion = getDetectorId(SOFTWARE_FIRMWARE_API_VERSION); - FILE_LOG(logINFOBLUE, ("************ %s Server *********************\n" + FILE_LOG(logINFOBLUE, ("************ Chip Test Board Server *********************\n" "Hardware Version:\t\t 0x%x\n" "Hardware Serial Nr:\t\t 0x%x\n" @@ -123,7 +123,6 @@ void basictests() { "Required Firmware Version:\t 0x%x\n" "Client-Software API Version:\t 0x%llx\n" "********************************************************\n", - DETNAME, hversion, hsnumber, ipadd, (long long unsigned int)macadd, @@ -189,13 +188,10 @@ int checkType() { uint32_t type = ((bus_r(FPGA_VERSION_REG) & FPGA_VERSION_DTCTR_TYP_MSK) >> FPGA_VERSION_DTCTR_TYP_OFST); uint32_t expectedType = FPGA_VERSION_DTCTR_TYP_CTB_VAL; -#ifdef JCTB - expectedType = FPGA_VERSION_DTCTR_TYP_JCTB_VAL; -#endif if (type != expectedType) { - FILE_LOG(logERROR, ("This is not a %s Server (read %d, expected %d)\n", - DETNAME, type, expectedType)); + FILE_LOG(logERROR, ("This is not a Chip Test Board Server (read %d, expected %d)\n", + type, expectedType)); return FAIL; } return OK; @@ -529,7 +525,7 @@ void setupDetector() { resetCore(); //Initialization of acquistion parameters - setTimer(SAMPLES_JCTB, DEFAULT_NUM_SAMPLES); // update databytes and allocate ram + setTimer(SAMPLES, DEFAULT_NUM_SAMPLES); // update databytes and allocate ram setTimer(FRAME_NUMBER, DEFAULT_NUM_FRAMES); setTimer(CYCLES_NUMBER, DEFAULT_NUM_CYCLES); setTimer(FRAME_PERIOD, DEFAULT_PERIOD); @@ -937,7 +933,7 @@ int64_t setTimer(enum timerIndex ind, int64_t val) { FILE_LOG(logDEBUG1, ("Getting #cycles: %lld\n", (long long int)retval)); break; - case SAMPLES_JCTB: + case SAMPLES: if(val >= 0) { FILE_LOG(logINFO, ("Setting #samples: %lld\n", (long long int)val)); nSamples = val; diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h index fcb117be5..a9e8f1232 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h @@ -10,12 +10,6 @@ #define PROGRAMMING_MODE (0x2) #define CTRL_SRVR_INIT_TIME_US (300 * 1000) -#ifdef JCTB -#define DETNAME = "Jungfrau Chip Test Board"; -#else -#define DETNAME = "Chip Test Board"; -#endif - /* Struct Definitions */ typedef struct ip_header_struct { uint16_t ip_len; @@ -86,11 +80,7 @@ enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, #define VCHIP_POWER_INCRMNT (200) #define IP_PACKETSIZE (0x2032) -#ifndef JCTB -#define ADC_PORT_INVERT_VAL (0x453b2593) -#else #define ADC_PORT_INVERT_VAL (0x453b2593) -#endif #define MAXIMUM_ADC_CLK (40) #define PLL_VCO_FREQ_MHZ (400) diff --git a/slsDetectorServers/slsDetectorServer/LTC2620.h b/slsDetectorServers/slsDetectorServer/LTC2620.h index 6e78a9703..7a5d2e28d 100755 --- a/slsDetectorServers/slsDetectorServer/LTC2620.h +++ b/slsDetectorServers/slsDetectorServer/LTC2620.h @@ -123,7 +123,7 @@ int LTC2620_VoltageToDac(int voltage, int* dacval) { * @returns FAIL when voltage outside limits, OK if conversion successful */ int LTC2620_DacToVoltage(int dacval, int* voltage) { - return Common_VoltageToDac(dacval, voltage, LTC2620_MIN_MV, LTC2620_MaxMV, LTC2620_MAX_STEPS); + return Common_DacToVoltage(dacval, voltage, LTC2620_MIN_MV, LTC2620_MaxMV, LTC2620_MAX_STEPS); } /** @@ -147,11 +147,11 @@ void LTC2620_Configure(){ /** - * Set Dac value (obtains dacaddr, command and ichip and calls LTC2620_Set) + * Set Dac (obtains dacaddr, command and ichip and calls LTC2620_Set) * @param dacnum dac number * @param data dac value to set */ -void LTC2620_SetDACValue (int dacnum, int data) { +void LTC2620_SetDAC (int dacnum, int data) { FILE_LOG(logDEBUG1, ("\tSetting dac %d to %d\n", dacnum, data)); // LTC2620 index int ichip = dacnum / LTC2620_NUMCHANNELS; diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c index f4dc671a4..024f3f7b9 100755 --- a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c @@ -16,6 +16,8 @@ const enum detectorType myDetectorType = EIGER; const enum detectorType myDetectorType = JUNGFRAU; #elif CHIPTESTBOARDD const enum detectorType myDetectorType = CHIPTESTBOARD; +#elif MOENCHD +const enum detectorType myDetectorType = MOENCH; #else const enum detectorType myDetectorType = GENERIC; #endif @@ -33,7 +35,7 @@ extern char mess[MAX_STR_LENGTH]; // Variables that will be exported int sockfd = 0; int debugflag = 0; -#ifdef CHIPTESTBOARDD +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) int dataBytes = 0; uint16_t *ramValues = 0; int nframes = 0; @@ -131,7 +133,7 @@ const char* getTimerName(enum timerIndex ind) { case MEASUREMENTS_NUMBER: return "measurements_number"; case FRAMES_FROM_START: return "frames_from_start"; case FRAMES_FROM_START_PG: return "frames_from_start_pg"; - case SAMPLES_JCTB: return "samples_jctb"; + case SAMPLES: return "samples"; case SUBFRAME_ACQUISITION_TIME: return "subframe_acquisition_time"; case SUBFRAME_DEADTIME: return "subframe_deadtime"; case STORAGE_CELL_NUMBER: return "storage_cell_number"; @@ -1509,7 +1511,7 @@ int set_timer(int file_des) { #endif case FRAME_PERIOD: case CYCLES_NUMBER: - case SAMPLES_JCTB: + case SAMPLES: #if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) case DELAY_AFTER_TRIGGER: #endif @@ -1568,7 +1570,7 @@ int set_timer(int file_des) { case STORAGE_CELL_NUMBER: validate64(tns, retval, vtimerName, DEC); // no conversion, so all good break; - case SAMPLES_JCTB: + case SAMPLES: if (retval == -1) { ret = FAIL; retval = setTimer(ind, -1); diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 9327af05a..dc0dbc5ff 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -1176,7 +1176,7 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int detPos) { auto r = parallelCall(&slsDetector::setTimer, index, t); int64_t ret = sls::minusOneIfDifferent(r); - if (index == SAMPLES_JCTB) + if (index == SAMPLES) setDynamicRange(); // set progress diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 47361cecd..8f0f41db6 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -413,7 +413,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) { thisDetector->timerValue[MEASUREMENTS_NUMBER] = 1; thisDetector->timerValue[FRAMES_FROM_START] = 0; thisDetector->timerValue[FRAMES_FROM_START_PG] = 0; - thisDetector->timerValue[SAMPLES_JCTB] = 1; + thisDetector->timerValue[SAMPLES] = 1; thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME] = 0; thisDetector->timerValue[STORAGE_CELL_NUMBER] = 0; thisDetector->timerValue[SUBFRAME_DEADTIME] = 0; @@ -903,7 +903,7 @@ int slsDetector::getTotalNumberOfChannels() { } thisDetector->nChans = thisDetector->nChan[X]; thisDetector->dataBytes = thisDetector->nChans * thisDetector->nChips * 2 - * thisDetector->timerValue[SAMPLES_JCTB]; + * thisDetector->timerValue[SAMPLES]; } FILE_LOG(logDEBUG1) << "Total number of channels: " << @@ -1408,7 +1408,7 @@ int slsDetector::updateDetectorNoWait() { if (thisDetector->myDetectorType == CHIPTESTBOARD) { n += controlSocket->ReceiveDataOnly(&i64, sizeof(i64)); if (i64 >= 0) - thisDetector->timerValue[SAMPLES_JCTB] = i64; + thisDetector->timerValue[SAMPLES] = i64; n += controlSocket->ReceiveDataOnly(&i32, sizeof(i32)); thisDetector->roFlags = (readOutFlags)i32; @@ -2253,7 +2253,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) { if (oldtimer != thisDetector->timerValue[index]) { // jctb: change samples, change databytes if (thisDetector->myDetectorType == CHIPTESTBOARD) { - if (index == SAMPLES_JCTB) { + if (index == SAMPLES) { setDynamicRange(); FILE_LOG(logINFO) << "Changing samples: data size = " << thisDetector->dataBytes; } @@ -2279,7 +2279,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) { case ACQUISITION_TIME: case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_DEADTIME: - case SAMPLES_JCTB: + case SAMPLES: case STORAGE_CELL_NUMBER: // send fnum = F_SET_RECEIVER_TIMER; @@ -2318,7 +2318,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) { break; case SUBFRAME_ACQUISITION_TIME: case SUBFRAME_DEADTIME: - case SAMPLES_JCTB: + case SAMPLES: setErrorMask((getErrorMask())|(RECEIVER_TIMER_NOT_SET)); break; case FRAME_NUMBER: @@ -2950,7 +2950,7 @@ std::string slsDetector::setReceiver(std::string receiverIP) { "\nframe number:" << (thisDetector->timerValue[FRAME_NUMBER]) << "\nsub exp time:" << (thisDetector->timerValue[SUBFRAME_ACQUISITION_TIME]) << "\nsub dead time:" << (thisDetector->timerValue[SUBFRAME_DEADTIME]) << - "\nsamples:" << (thisDetector->timerValue[SAMPLES_JCTB]) << + "\nsamples:" << (thisDetector->timerValue[SAMPLES]) << "\ndynamic range:" << thisDetector->dynamicRange << "\nflippeddatax:" << (thisDetector->flippedData[X]) << "\nactivated: " << thisDetector->activated << @@ -2987,7 +2987,7 @@ std::string slsDetector::setReceiver(std::string receiverIP) { setTimer(SUBFRAME_DEADTIME,thisDetector->timerValue[SUBFRAME_DEADTIME]); } if (thisDetector->myDetectorType == CHIPTESTBOARD) - setTimer(SAMPLES_JCTB,thisDetector->timerValue[SAMPLES_JCTB]); + setTimer(SAMPLES,thisDetector->timerValue[SAMPLES]); setDynamicRange(thisDetector->dynamicRange); if (thisDetector->myDetectorType == EIGER) { setFlippedData(X,-1); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index 9b311d70b..1f2451146 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -4253,7 +4253,7 @@ std::string slsDetectorCommand::cmdTimer(int narg, char *args[], int action, int else if (cmd == "measurements") index = MEASUREMENTS_NUMBER; else if (cmd == "samples") - index = SAMPLES_JCTB; + index = SAMPLES; else if (cmd == "storagecells") index = STORAGE_CELL_NUMBER; else if (cmd == "storagecell_start") { diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index ab4f92894..34ec324b1 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -803,7 +803,7 @@ int slsReceiverTCPIPInterface::set_timer() { case SUBFRAME_DEADTIME: receiver->setSubPeriod(index[1] + receiver->getSubExpTime()); break; - case SAMPLES_JCTB: + case SAMPLES: if (myDetectorType != CHIPTESTBOARD) { modeNotImplemented("(Samples) Timer index", (int)index[0]); break; @@ -835,7 +835,7 @@ int slsReceiverTCPIPInterface::set_timer() { case SUBFRAME_DEADTIME: retval=(receiver->getSubPeriod() - receiver->getSubExpTime()); break; - case SAMPLES_JCTB: + case SAMPLES: if (myDetectorType != CHIPTESTBOARD) { ret = FAIL; sprintf(mess,"This timer mode (%lld) does not exist for this receiver type\n", (long long int)index[0]); diff --git a/slsSupportLib/include/sls_detector_defs.h b/slsSupportLib/include/sls_detector_defs.h index 2d5b86ecd..c20a209a8 100755 --- a/slsSupportLib/include/sls_detector_defs.h +++ b/slsSupportLib/include/sls_detector_defs.h @@ -86,7 +86,8 @@ public: EIGER, /**< eiger */ GOTTHARD, /**< gotthard */ JUNGFRAU, /**< jungfrau */ - CHIPTESTBOARD /**< CTB */ + CHIPTESTBOARD, /**< CTB */ + MOENCH /**< moench */ }; @@ -117,7 +118,7 @@ public: MEASUREMENTS_NUMBER, FRAMES_FROM_START, FRAMES_FROM_START_PG, - SAMPLES_JCTB, + SAMPLES, SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */ STORAGE_CELL_NUMBER, /**