areaDetector  3-14
EPICS areaDetector framework
pxrd2_interface_misc.h
Go to the documentation of this file.
1 /*
2  * pxrd2_interface_misc.h
3  *
4  * Created on: Jul 31, 2014
5  * Author: massimo
6  */
7 
8 #ifndef PXRD2_INTERFACE_MISC_H_
9 #define PXRD2_INTERFACE_MISC_H_
10 #define NOVERBOSE 0
11 #define VERBOSITY_LOW 1
12 #define VERBOSITY_MEDIUM 2
13 #define VERBOSITY_HIGH 3
14 #define VERBOSITY_VERYHIGH 4
15 #define VERBOSITY_ULTRAHIGH 5
16 
17 extern int verbose;
18 #define MACHINE_SHORT_DELAY_MS 10
19 #define MACHINE_LONG_DELAY_MS 500
20 #define HUMAN_SHORT_DELAY_MS 1000
21 
22 /**************************************************************/
23 #define MAX_FILENAME_STR_LENGTH 1000
24 #define MAX_MSG_STR_LENGTH 10000
25 #define MAX_SHORT_MSG_STR_LEN 50
26 #define MAX_INPUT_STRING_LENGTH MAX_MSG_STR_LENGTH
27 #define MAX_CMD_PARAMETERS 15
28 #define CMD_STR_ELEMENT_MAX_LENGTH 50
29 /**************************************************************/
30 #define CONN_RX_BUFF_LEN 8192
31 #define CONN_TX_BUFF_LEN 8192
32 /**************************************************************/
33 #define SRV_TAG_STR "SRV"
34 #define DAQ_TAG_STR "DAQ"
35 #define SYS_TAG_STR "SYS"
36 /**************************************************************/
37 
38 //#include <windows.h>
39 //#include <Windef.h>
40 //#include <winsock2.h>
41 //#include "pthread.h"
42 //#include "BoxUtilities_v2.h"
43 //#include "interface_command_utilities.h"
44 //#include "raw_image_correction_module.h"
45 //#include <stdio.h>
46 //#include "build_ver.h"
47 
48 /**************************************************************/
51 /**************************************************************/
52 
54 
55 
56 //typedef struct{
57 // ImageType ImageMode;
58 // int Width;
59 // int Heigth;
60 // void * data_ptr;
61 //}IMAGE;
62 
63 /**************************************************************/
67 
68 typedef struct{
69 
70  float frames;
72  float pause_ms;
75 
77 
78 
79 /**************************************************************/
85 typedef struct{
86  unsigned short *ptr;
87  int depth;
88 }CONV_TABLE;
89 
90 typedef struct{
97  int modules;
98  int rows;
99  int cols;
101  int dout;
105  int cnt_regs;
111 }SENSOR;
112 
113 typedef struct{
114  float energy;
115  int reg;
119  int slot_id;
120  int decode;
121 }ACQ_PROP;
122 
123 
124 //cropped image vertexes
125 typedef struct{
130 }CROP_t;
131 
132 //interpolated image dimensions depends on interpolation pitch
133 typedef struct{
134  float pitch;
135  void* data;
136  int rows;
137  int cols;
138 }INTERPOL_t;
139 
140 typedef struct{
141  void* data_ptr;
142  int Width;
143  int Height;
149 }FRAME_PROP;
150 
151 typedef struct{
152  char ip_str[15];
153  unsigned short port;
154 }HOST;
155 
156 
157 
158 /**************************************************************/
160 enum RunType{DATA,SUMMED_DATA,COLLECT_FLAT,SUMMED_COLLECT_FLAT,AUTOCAL}; //The "SUMMED" prefix applyes only as a display options, not raw data saving
164 
165 
166 /**************************************************************/
167 typedef struct{
168  int entries;
169  unsigned short* buff;
171 typedef struct{
172  int entries;
173  unsigned int* buff;
175 typedef struct{
177  float* reg0buff;
178  float* reg1buff;
179 }FFMap;
180 /**************************************************************/
181 #define FILE_LIST_LEN 200
182 
183 typedef struct{
184  char *names[FILE_LIST_LEN];
185  int entries;
187  int size;
188 }FileList;
189 
190 /**************************************************************/
191 
192 
193 #define FF_MAP_LIST_LEN 500
194 
196 
197 
198 /**************************************************************/
199 void StrRunState(RunState State,char* deststr,int maxlen);
200 
201 /**************************************************************/
202 RUNMODE getRunModeFromStr(const char*);
203 /**************************************************************/
204 
205 #endif /* PXRD2_INTERFACE_MISC_H_ */
DETECTOR_BUILD
Definition: pxrd2_interface_misc.h:80
@ PX1
Definition: pxrd2_interface_misc.h:80
@ PX4
Definition: pxrd2_interface_misc.h:80
@ PX8
Definition: pxrd2_interface_misc.h:80
@ PX2
Definition: pxrd2_interface_misc.h:80
int verbose
Definition: PIXIE_data_utilities.cpp:16
HYBRID_TYPE
Definition: pxrd2_interface_misc.h:83
@ CDTE
Definition: pxrd2_interface_misc.h:83
@ GAAS
Definition: pxrd2_interface_misc.h:83
RunType
Definition: pxrd2_interface_misc.h:160
@ SUMMED_COLLECT_FLAT
Definition: pxrd2_interface_misc.h:160
@ SUMMED_DATA
Definition: pxrd2_interface_misc.h:160
@ DATA
Definition: pxrd2_interface_misc.h:160
@ COLLECT_FLAT
Definition: pxrd2_interface_misc.h:160
@ AUTOCAL
Definition: pxrd2_interface_misc.h:160
HVType
Definition: pxrd2_interface_misc.h:66
@ AUTOHV
Definition: pxrd2_interface_misc.h:66
@ STDHV
Definition: pxrd2_interface_misc.h:66
PIXEL_ARRANGEMENT
Definition: pxrd2_interface_misc.h:84
@ EXAGON
Definition: pxrd2_interface_misc.h:84
@ SQUARE
Definition: pxrd2_interface_misc.h:84
ImageType
Definition: pxrd2_interface_misc.h:53
@ FULL_BMP
Definition: pxrd2_interface_misc.h:53
@ DOWNSAMPLED_RAW
Definition: pxrd2_interface_misc.h:53
@ DOWNSAMPLED_BMP
Definition: pxrd2_interface_misc.h:53
@ FULL_RAW
Definition: pxrd2_interface_misc.h:53
ASIC_TYPE
Definition: pxrd2_interface_misc.h:82
@ PIII
Definition: pxrd2_interface_misc.h:82
@ PII
Definition: pxrd2_interface_misc.h:82
FileSaveType
Definition: pxrd2_interface_misc.h:162
@ SAVE_GLORIA_PX1_OLD_STYLE
Definition: pxrd2_interface_misc.h:162
@ SAVE_OLD_STYLE
Definition: pxrd2_interface_misc.h:162
@ SAVE_NEW_STYLE
Definition: pxrd2_interface_misc.h:162
@ SAVE_OFF
Definition: pxrd2_interface_misc.h:162
RegType
Definition: pxrd2_interface_misc.h:195
@ REG1
Definition: pxrd2_interface_misc.h:195
@ REG01
Definition: pxrd2_interface_misc.h:195
@ REG0
Definition: pxrd2_interface_misc.h:195
RUNMODE
Definition: pxrd2_interface_misc.h:65
@ ONE_COL0
Definition: pxrd2_interface_misc.h:65
@ UNDEFINED
Definition: pxrd2_interface_misc.h:65
@ TWO_COLS
Definition: pxrd2_interface_misc.h:65
@ TWO_COLS_DTF
Definition: pxrd2_interface_misc.h:65
@ ONE_COL_DTF
Definition: pxrd2_interface_misc.h:65
@ ONE_COL1
Definition: pxrd2_interface_misc.h:65
RunState
Definition: pxrd2_interface_misc.h:159
@ RUNNING
Definition: pxrd2_interface_misc.h:159
@ CLOSEDRUN
Definition: pxrd2_interface_misc.h:159
@ CLOSINGRUN
Definition: pxrd2_interface_misc.h:159
@ BREAKINGRUN
Definition: pxrd2_interface_misc.h:159
@ IDLERUN
Definition: pxrd2_interface_misc.h:159
#define FILE_LIST_LEN
Definition: pxrd2_interface_misc.h:181
RUNMODE getRunModeFromStr(const char *)
Definition: pxrd2_interface_misc.cpp:39
Processing_t
Definition: pxrd2_interface_misc.h:163
@ EX_TO_SQ_MAP_SP
Definition: pxrd2_interface_misc.h:163
@ DEFAULT_PROCESSING
Definition: pxrd2_interface_misc.h:163
@ NO_PROCESSING
Definition: pxrd2_interface_misc.h:163
@ CORRECTIONS
Definition: pxrd2_interface_misc.h:163
DataTransferType
Definition: pxrd2_interface_misc.h:161
@ NEW_SAME_SOCKET
Definition: pxrd2_interface_misc.h:161
@ NEW_DIFFERENT_SOCKET
Definition: pxrd2_interface_misc.h:161
@ OLD_DIFFERENT_SOCKET
Definition: pxrd2_interface_misc.h:161
ConnectionState
Definition: pxrd2_interface_misc.h:50
@ ESTABILISHED
Definition: pxrd2_interface_misc.h:50
@ CLOSING
Definition: pxrd2_interface_misc.h:50
@ FREE
Definition: pxrd2_interface_misc.h:50
EnState
Definition: pxrd2_interface_misc.h:49
@ DISABLED
Definition: pxrd2_interface_misc.h:49
@ ENABLED
Definition: pxrd2_interface_misc.h:49
void StrRunState(RunState State, char *deststr, int maxlen)
Definition: pxrd2_interface_misc.cpp:33
npi_mode_t
Definition: pxrd2_interface_misc.h:64
@ NONPI
Definition: pxrd2_interface_misc.h:64
@ NPISUM
Definition: pxrd2_interface_misc.h:64
@ NPI
Definition: pxrd2_interface_misc.h:64
ROSCHEMA_t
Definition: pxrd2_interface_misc.h:81
@ MONO6
Definition: pxrd2_interface_misc.h:81
@ MONO5
Definition: pxrd2_interface_misc.h:81
@ MONO7
Definition: pxrd2_interface_misc.h:81
@ MONO3
Definition: pxrd2_interface_misc.h:81
@ DEFAULT
Definition: pxrd2_interface_misc.h:81
@ MONO2
Definition: pxrd2_interface_misc.h:81
@ MONO0
Definition: pxrd2_interface_misc.h:81
@ MONO1
Definition: pxrd2_interface_misc.h:81
@ MONO4
Definition: pxrd2_interface_misc.h:81
Definition: pxrd2_interface_misc.h:113
int slot_id
Definition: pxrd2_interface_misc.h:119
int is_autocal
Definition: pxrd2_interface_misc.h:117
int align_err
Definition: pxrd2_interface_misc.h:116
int reg
Definition: pxrd2_interface_misc.h:115
int remaining_frames
Definition: pxrd2_interface_misc.h:118
int decode
Definition: pxrd2_interface_misc.h:120
float energy
Definition: pxrd2_interface_misc.h:114
Definition: pxrd2_interface_misc.h:85
int depth
Definition: pxrd2_interface_misc.h:87
unsigned short * ptr
Definition: pxrd2_interface_misc.h:86
Definition: pxrd2_interface_misc.h:125
int crop_xmax
Definition: pxrd2_interface_misc.h:127
int crop_ymax
Definition: pxrd2_interface_misc.h:129
int crop_ymin
Definition: pxrd2_interface_misc.h:128
int crop_xmin
Definition: pxrd2_interface_misc.h:126
Definition: pxrd2_interface_misc.h:175
float * reg1buff
Definition: pxrd2_interface_misc.h:178
float * reg0buff
Definition: pxrd2_interface_misc.h:177
int regmaplen
Definition: pxrd2_interface_misc.h:176
Definition: pxrd2_interface_misc.h:140
int Width
Definition: pxrd2_interface_misc.h:142
void * data_ptr
Definition: pxrd2_interface_misc.h:141
int bytes_per_pixel
Definition: pxrd2_interface_misc.h:146
int Height
Definition: pxrd2_interface_misc.h:143
INTERPOL_t Interpoldata
Definition: pxrd2_interface_misc.h:148
ImageType Image
Definition: pxrd2_interface_misc.h:145
CROP_t Crop
Definition: pxrd2_interface_misc.h:147
RUNMODE Mode
Definition: pxrd2_interface_misc.h:144
Definition: pxrd2_interface_misc.h:183
int size
Definition: pxrd2_interface_misc.h:187
int recordlen
Definition: pxrd2_interface_misc.h:186
int entries
Definition: pxrd2_interface_misc.h:185
Definition: pxrd2_interface_misc.h:167
int entries
Definition: pxrd2_interface_misc.h:168
unsigned short * buff
Definition: pxrd2_interface_misc.h:169
Definition: pxrd2_interface_misc.h:171
int entries
Definition: pxrd2_interface_misc.h:172
unsigned int * buff
Definition: pxrd2_interface_misc.h:173
Definition: pxrd2_interface_misc.h:151
unsigned short port
Definition: pxrd2_interface_misc.h:153
Definition: pxrd2_interface_misc.h:133
int rows
Definition: pxrd2_interface_misc.h:136
void * data
Definition: pxrd2_interface_misc.h:135
float pitch
Definition: pxrd2_interface_misc.h:134
int cols
Definition: pxrd2_interface_misc.h:137
Definition: pxrd2_interface_misc.h:68
HVType HVMode
Definition: pxrd2_interface_misc.h:74
RUNMODE Mode
Definition: pxrd2_interface_misc.h:73
float frames
Definition: pxrd2_interface_misc.h:70
float shutter_len_ms
Definition: pxrd2_interface_misc.h:71
float pause_ms
Definition: pxrd2_interface_misc.h:72
Definition: pxrd2_interface_misc.h:90
CONV_TABLE conv_table
Definition: pxrd2_interface_misc.h:110
int autocal_regs
Definition: pxrd2_interface_misc.h:104
npi_mode_t npi_mode
Definition: pxrd2_interface_misc.h:95
int bit_parity
Definition: pxrd2_interface_misc.h:108
int dout
Definition: pxrd2_interface_misc.h:101
int autocal_bit_cnt
Definition: pxrd2_interface_misc.h:103
int matrix_size_pxls
Definition: pxrd2_interface_misc.h:96
int rows
Definition: pxrd2_interface_misc.h:98
PIXEL_ARRANGEMENT pixel_arr
Definition: pxrd2_interface_misc.h:109
int cols_per_dout
Definition: pxrd2_interface_misc.h:102
DETECTOR_BUILD Build
Definition: pxrd2_interface_misc.h:91
ROSCHEMA_t ReadoutSchema
Definition: pxrd2_interface_misc.h:94
int bit_per_cnt_short
Definition: pxrd2_interface_misc.h:107
int modules
Definition: pxrd2_interface_misc.h:97
ASIC_TYPE Asic
Definition: pxrd2_interface_misc.h:92
int separation_columns
Definition: pxrd2_interface_misc.h:100
int cnt_regs
Definition: pxrd2_interface_misc.h:105
int cols
Definition: pxrd2_interface_misc.h:99
int bit_per_cnt_std
Definition: pxrd2_interface_misc.h:106
HYBRID_TYPE Hybrid
Definition: pxrd2_interface_misc.h:93