00001 00002 00003 00004 00005 00006 00007 #ifndef DEFINES_H 00008 #define DEFINES_H 00009 00010 #include <cadef.h> 00011 #include <iostream> 00012 00013 00014 #define EV EPICSVERSION(HAVE_EPICS) 00015 00016 #if (EPICS_MAJOR==3) && (EPICS_MINOR==14) && (EPICS_PATCH>=11) 00017 #define MASK_CTRL DBE_VALUE | DBE_LOG | DBE_ALARM | DBE_PROPERTY 00018 #elif (EPICS_MAJOR==3) && (EPICS_MINOR>14) 00019 #define MASK_CTRL DBE_VALUE | DBE_LOG | DBE_ALARM | DBE_PROPERTY 00020 #else 00021 #define MASK_CTRL DBE_VALUE | DBE_LOG | DBE_ALARM 00022 #endif 00023 00024 //To match alarmString.h in EPICS 00025 const unsigned short ALARM_SEVERITY_STRING_LENGTH = 4; // "NO_ALARM","MINOR","MAJOR", "INVALID" 00026 const unsigned short ALARM_STATUS_STRING_LENGTH = 22; // "NO_ALARM","READ","WRITE", 00027 //"HIHI","HIGH","LOLO","LOW","STATE","COS","COMM","TIMEOUT","HWLIMIT","CALC","SCAN","LINK", 00028 //"SOFT","BAD_SUB","UDF","DISABLE","SIMM","READ_ACCESS","WRITE_ACCESS" 00029 00030 struct etsDate{ int year; int mon; int day; 00031 int hour; int min; int sec; unsigned long nsec;}; 00032 struct etsNorm{ unsigned int secPastEpoch; unsigned int nsec;}; 00036 typedef void (*pCallback) (struct event_handler_args ARGS); 00037 typedef void (*pCallbackConnection) (struct connection_handler_args ARGS); 00038 00039 00040 const bool ADD_EXCEPTION_EVENT=false; //set to false for use with MATLAB 00041 // Standard exception event is good enough 00045 const short PVNAME_SIZE=MAX_STRING_SIZE +20; //from epicsTypes.h 40; 00046 const short PVGROUP_PSEUDO_SIZE=1024; //determines max size of groupNameEntry for Pseudo groups 00047 00048 //List all possible deliminators; code will separate dev/attriby when first of this list is found; 00049 const std::string DEFAULT_DEVICE_ATTRIBUTE_DELIMINATOR=":"; //Only one deliminator 00050 00051 typedef char pv_string_t[PVNAME_SIZE]; 00052 00057 const bool DEFAULT_SELF_GOVERNING_TIMEOUT = true; 00058 00059 00060 const double DEFAULT_TIMEOUT_PEND_IO_WF = 5.0; 00061 const double TIMEOUT_PEND_IO_MIN = 0.0001; 00062 const double TIMEOUT_PEND_IO_MAX = 20.0; // max timeout for first attempt (ntries=1) 00063 const unsigned short DEFAULT_PEND_IO_NO_TRIES = 2; 00064 const unsigned short PEND_IO_MAX_TRIES = 10; // safety net 00065 const double DEFAULT_PEND_IO_INCREMENT_TIME = 2.0; 00066 const double PEND_IO_INCREMENT_TIME_MIN= 0.05; 00067 const double PEND_IO_INCREMENT_TIME_MAX= 10.0; 00068 const double DEFAULT_TIMEOUT_PEND_EVENT = 0.4; 00069 const double DEFAULT_TIMEOUT_PEND_IO = 0.4; // previously 3.0 00070 const double DEFAULT_TIMEOUT_SG_PEND_EVENT = 0.5; // plus nMember/NMEMBER_PER_SEC_SG_PEND_EVENT 00071 const double NMEMBER_PER_SEC_SG_PEND_EVENT = 400; // 00072 const double DEFAULT_TIMEOUT_SG_PEND_IO = 5.0; 00073 00074 // Otherwise too many large databuffers are created 00075 const unsigned int MAX_NELEM_FOR_CTRL_BUFFER = 8192; 00076 // Keep at 1, else becomes problematic when wf is made a syn. group member (ch disconnect occurs for STSACK cb) 00077 const unsigned int MAX_NELEM_FOR_STSACK_BUFFER = 1; 00078 const unsigned int DEFAULT_NELEM_FOR_CTRL_BUFFER = 256; // if nelem exceeds above 00079 const unsigned int DEFAULT_NELEM_FOR_STSACK_BUFFER = 1; // if nelem exceeds above 00080 00081 const unsigned short MAX_NO_MONITORS_PER_CHANNEL = 4; // Can't start more than 4; 1 is more usual. 00082 00083 00084 //For BSREAD 00085 const double BSREAD_MAX_CONNECT_TIME = 20; //20 seconds; typically 10 seconds is required 00086 const unsigned short BSREAD_ZEROMQ_HIGH_WATER_MARK = 1; 00087 const short BSREAD_ZEROMQ_TIMEOUT_MS = 2000; //Can handle 10 Hz // -1 wait for ever 00088 00089 const unsigned short BSREAD_PREBLOB_BYTES = 12; //No of bytes pre-pending the binary blob with metadata 00090 00091 const std::string SF_PULSE_ID_PV = "SIN-TIMAST-EVG0:TX-PULSEID"; 00092 const unsigned short SF_PULSE_ID_BUFFER_SIZE = 10; //Size of map to store history of pulseIDs; 00093 00094 00095 #endif // DEFINES_H