mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
some changes for jctb
This commit is contained in:
@ -137,7 +137,7 @@ int acceptConnection(int socketDescriptor) {
|
||||
|
||||
|
||||
//socklen_t address_length;
|
||||
size_t address_length=sizeof(struct sockaddr_in);
|
||||
socklen_t address_length=sizeof(struct sockaddr_in);
|
||||
|
||||
if (socketDescriptor<0)
|
||||
return -1;
|
||||
|
@ -10,16 +10,22 @@
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
using namespace std;
|
||||
|
||||
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
/** Error flags */
|
||||
/*Assumption: Only upto 63 detectors */
|
||||
#define CRITICAL_ERROR_MASK 0xFFFFFFFF
|
||||
|
||||
#define MULTI_DETECTORS_NOT_ADDED 0x8000000000000000ULL
|
||||
|
||||
|
||||
#define CANNOT_CONNECT_TO_DETECTOR 0x8000000000000000ULL
|
||||
#define CANNOT_CONNECT_TO_RECEIVER 0x4000000000000000ULL
|
||||
#define COULDNOT_SET_CONTROL_PORT 0x2000000000000000ULL
|
||||
@ -59,9 +65,13 @@ using namespace std;
|
||||
#define COULD_NOT_PULSE_CHIP 0x0000000000100000ULL
|
||||
#define COULD_NOT_SET_RATE_CORRECTION 0x0000000000200000ULL
|
||||
#define DETECTOR_NETWORK_PARAMETER 0x0000000000400000ULL
|
||||
#define RATE_CORRECTION_NOT_32BIT 0x0000000000800000ULL
|
||||
#define RATE_CORRECTION_NOT_32or16BIT 0x0000000000800000ULL
|
||||
#define RATE_CORRECTION_NO_TAU_PROVIDED 0x0000000001000000ULL
|
||||
|
||||
#define PROGRAMMING_ERROR 0x0000000002000000ULL
|
||||
#define RECEIVER_ACTIVATE 0x0000000004000000ULL
|
||||
#define DATA_STREAMING 0x0000000008000000ULL
|
||||
#define RESET_ERROR 0x0000000010000000ULL
|
||||
#define POWER_CHIP 0x0000000020000000ULL
|
||||
// 0x00000000FFFFFFFFULL
|
||||
/** @short class returning all error messages for error mask */
|
||||
class errorDefs {
|
||||
@ -70,7 +80,9 @@ class errorDefs {
|
||||
public:
|
||||
|
||||
/** Constructor */
|
||||
errorDefs():errorMask(0){};
|
||||
errorDefs():errorMask(0){
|
||||
strcpy(notAddedList,"");
|
||||
};
|
||||
|
||||
/** Gets the error message
|
||||
* param errorMask error mask
|
||||
@ -192,15 +204,26 @@ public:
|
||||
if(slsErrorMask&DETECTOR_NETWORK_PARAMETER)
|
||||
retval.append("Could not set/get detector network parameter\n");
|
||||
|
||||
if(slsErrorMask&RATE_CORRECTION_NOT_32BIT)
|
||||
retval.append("Rate correction Deactivated, must be in 32 bit mode\n");
|
||||
if(slsErrorMask&RATE_CORRECTION_NOT_32or16BIT)
|
||||
retval.append("Rate correction Deactivated, must be in 32 or 16 bit mode\n");
|
||||
|
||||
if(slsErrorMask&RATE_CORRECTION_NO_TAU_PROVIDED)
|
||||
retval.append("Rate correction Deactivated. No default tau provided in file\n");
|
||||
|
||||
if(slsErrorMask&PROGRAMMING_ERROR)
|
||||
retval.append("Could not program FPGA\n");
|
||||
|
||||
if(slsErrorMask&RECEIVER_ACTIVATE)
|
||||
retval.append("Could not activate/deactivate receiver\n");
|
||||
|
||||
if(slsErrorMask&DATA_STREAMING)
|
||||
retval.append("Could not set/reset Data Streaming\n");
|
||||
|
||||
if(slsErrorMask&RESET_ERROR)
|
||||
retval.append("Could not reset the FPGA\n");
|
||||
|
||||
if(slsErrorMask&POWER_CHIP)
|
||||
retval.append("Could not power on/off/get the chip\n");
|
||||
|
||||
//------------------------------------------------------ length of message
|
||||
|
||||
@ -224,12 +247,31 @@ public:
|
||||
*/
|
||||
int64_t clearErrorMask(){errorMask=0;return errorMask;};
|
||||
|
||||
/** Gets the not added detector list
|
||||
/returns list
|
||||
*/
|
||||
char* getNotAddedList(){return notAddedList;};
|
||||
|
||||
/** Append the detector to not added detector list
|
||||
* @param name append to the list
|
||||
/returns list
|
||||
*/
|
||||
void appendNotAddedList(const char* name){strcat(notAddedList,name);strcat(notAddedList,"+");};
|
||||
|
||||
/** Clears not added detector list
|
||||
/returns error mask
|
||||
*/
|
||||
void clearNotAddedList(){strcpy(notAddedList,"");};
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
/** Error Mask */
|
||||
int64_t errorMask;
|
||||
|
||||
/** Detectors Not added List */
|
||||
char notAddedList[MAX_STR_LENGTH];
|
||||
|
||||
};
|
||||
|
||||
#endif /* ERROR_DEFS_H_ */
|
||||
|
@ -25,6 +25,9 @@
|
||||
/** maximum rois */
|
||||
#define MAX_ROIS 100
|
||||
|
||||
/** maximum unit size of program sent to detector */
|
||||
#define MAX_FPGAPROGRAMSIZE (2 * 1024 *1024)
|
||||
|
||||
|
||||
typedef char mystring[MAX_STR_LENGTH];
|
||||
typedef double mysteps[MAX_SCAN_STEPS];
|
||||
@ -362,6 +365,8 @@ enum dacIndex {
|
||||
TEMPERATURE_DCDC, /**< temperature sensor (close to DCDC) */
|
||||
TEMPERATURE_SODL, /**< temperature sensor (close to SODL) */
|
||||
TEMPERATURE_SODR, /**< temperature sensor (close to SODR) */
|
||||
TEMPERATURE_FPGA2, /**< temperature sensor (fpga2 (eiger:febl) */
|
||||
TEMPERATURE_FPGA3, /**< temperature sensor (fpga3 (eiger:febr) */
|
||||
V_POWER_A = 100, /**new chiptest board */
|
||||
V_POWER_B = 101, /**new chiptest board */
|
||||
V_POWER_C = 102, /**new chiptest board */
|
||||
@ -434,7 +439,10 @@ enum speedVariable {
|
||||
OVERSAMPLING, /**< oversampling for analog detectors */
|
||||
ADC_CLOCK, /**< adc clock divider */
|
||||
ADC_PHASE, /**< adc clock phase */
|
||||
ADC_PIPELINE /**< adc pipeline */
|
||||
ADC_PIPELINE, /**< adc pipeline */
|
||||
DBIT_CLOCK, /**< adc clock divider */
|
||||
DBIT_PHASE, /**< adc clock phase */
|
||||
DBIT_PIPELINE /**< adc pipeline */
|
||||
};
|
||||
|
||||
|
||||
|
@ -103,9 +103,12 @@ enum {
|
||||
F_SET_RATE_CORRECT, /** < set/reset rate correction tau */
|
||||
F_GET_RATE_CORRECT, /** < get rate correction tau */
|
||||
|
||||
F_ACTIVATE, /** < activate/deactivate readout */
|
||||
|
||||
F_SET_NETWORK_PARAMETER, /**< set network parameters such as transmission delay, flow control */
|
||||
|
||||
F_PROGRAM_FPGA, /**< program FPGA */
|
||||
F_RESET_FPGA, /**< reset FPGA */
|
||||
F_POWER_CHIP, /**< power chip */
|
||||
/* Always append functions hereafter!!! */
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user