areaDetector  3-5-0
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_ */
Definition: pxrd2_interface_misc.h:160
Definition: pxrd2_interface_misc.h:49
Definition: pxrd2_interface_misc.h:90
int entries
Definition: pxrd2_interface_misc.h:172
unsigned short port
Definition: pxrd2_interface_misc.h:153
ROSCHEMA_t
Definition: pxrd2_interface_misc.h:81
void * data
Definition: pxrd2_interface_misc.h:135
Definition: pxrd2_interface_misc.h:162
Definition: pxrd2_interface_misc.h:160
Definition: pxrd2_interface_misc.h:65
int crop_ymin
Definition: pxrd2_interface_misc.h:128
Definition: pxrd2_interface_misc.h:162
Definition: pxrd2_interface_misc.h:151
Definition: pxrd2_interface_misc.h:53
float pause_ms
Definition: pxrd2_interface_misc.h:72
Definition: pxrd2_interface_misc.h:84
FileSaveType
Definition: pxrd2_interface_misc.h:162
HVType HVMode
Definition: pxrd2_interface_misc.h:74
Definition: pxrd2_interface_misc.h:49
RUNMODE Mode
Definition: pxrd2_interface_misc.h:73
Definition: pxrd2_interface_misc.h:64
Definition: pxrd2_interface_misc.h:65
CROP_t Crop
Definition: pxrd2_interface_misc.h:147
Definition: pxrd2_interface_misc.h:159
npi_mode_t npi_mode
Definition: pxrd2_interface_misc.h:95
Definition: pxrd2_interface_misc.h:53
int remaining_frames
Definition: pxrd2_interface_misc.h:118
int bit_parity
Definition: pxrd2_interface_misc.h:108
Definition: pxrd2_interface_misc.h:53
int dout
Definition: pxrd2_interface_misc.h:101
int modules
Definition: pxrd2_interface_misc.h:97
RUNMODE
Definition: pxrd2_interface_misc.h:65
Definition: pxrd2_interface_misc.h:81
npi_mode_t
Definition: pxrd2_interface_misc.h:64
int crop_xmin
Definition: pxrd2_interface_misc.h:126
PIXEL_ARRANGEMENT pixel_arr
Definition: pxrd2_interface_misc.h:109
int cols
Definition: pxrd2_interface_misc.h:137
Definition: pxrd2_interface_misc.h:85
Definition: pxrd2_interface_misc.h:65
int regmaplen
Definition: pxrd2_interface_misc.h:176
Definition: pxrd2_interface_misc.h:66
float * reg0buff
Definition: pxrd2_interface_misc.h:177
Definition: pxrd2_interface_misc.h:195
ASIC_TYPE
Definition: pxrd2_interface_misc.h:82
RunState
Definition: pxrd2_interface_misc.h:159
Definition: pxrd2_interface_misc.h:80
Definition: pxrd2_interface_misc.h:81
int autocal_regs
Definition: pxrd2_interface_misc.h:104
int is_autocal
Definition: pxrd2_interface_misc.h:117
Definition: pxrd2_interface_misc.h:163
Definition: pxrd2_interface_misc.h:82
HYBRID_TYPE Hybrid
Definition: pxrd2_interface_misc.h:93
HVType
Definition: pxrd2_interface_misc.h:66
Definition: pxrd2_interface_misc.h:161
int size
Definition: pxrd2_interface_misc.h:187
int crop_xmax
Definition: pxrd2_interface_misc.h:127
Definition: pxrd2_interface_misc.h:161
Definition: pxrd2_interface_misc.h:175
Definition: pxrd2_interface_misc.h:82
Definition: pxrd2_interface_misc.h:66
Definition: pxrd2_interface_misc.h:50
Definition: pxrd2_interface_misc.h:81
Definition: pxrd2_interface_misc.h:162
Definition: pxrd2_interface_misc.h:195
Definition: pxrd2_interface_misc.h:133
Definition: pxrd2_interface_misc.h:159
RUNMODE Mode
Definition: pxrd2_interface_misc.h:144
ASIC_TYPE Asic
Definition: pxrd2_interface_misc.h:92
Definition: pxrd2_interface_misc.h:65
HYBRID_TYPE
Definition: pxrd2_interface_misc.h:83
ImageType
Definition: pxrd2_interface_misc.h:53
int rows
Definition: pxrd2_interface_misc.h:136
Definition: pxrd2_interface_misc.h:65
Definition: pxrd2_interface_misc.h:81
DataTransferType
Definition: pxrd2_interface_misc.h:161
Definition: pxrd2_interface_misc.h:68
void * data_ptr
Definition: pxrd2_interface_misc.h:141
unsigned int * buff
Definition: pxrd2_interface_misc.h:173
Processing_t
Definition: pxrd2_interface_misc.h:163
int matrix_size_pxls
Definition: pxrd2_interface_misc.h:96
Definition: pxrd2_interface_misc.h:159
void StrRunState(RunState State, char *deststr, int maxlen)
Definition: pxrd2_interface_misc.cpp:33
INTERPOL_t Interpoldata
Definition: pxrd2_interface_misc.h:148
Definition: pxrd2_interface_misc.h:80
Definition: pxrd2_interface_misc.h:50
Definition: pxrd2_interface_misc.h:83
int cols
Definition: pxrd2_interface_misc.h:99
Definition: pxrd2_interface_misc.h:81
float frames
Definition: pxrd2_interface_misc.h:70
Definition: pxrd2_interface_misc.h:113
#define FILE_LIST_LEN
Definition: pxrd2_interface_misc.h:181
PIXEL_ARRANGEMENT
Definition: pxrd2_interface_misc.h:84
int verbose
Definition: PIXIE_data_utilities.cpp:16
Definition: pxrd2_interface_misc.h:159
Definition: pxrd2_interface_misc.h:64
int reg
Definition: pxrd2_interface_misc.h:115
int rows
Definition: pxrd2_interface_misc.h:98
RegType
Definition: pxrd2_interface_misc.h:195
Definition: pxrd2_interface_misc.h:81
Definition: pxrd2_interface_misc.h:80
unsigned short * buff
Definition: pxrd2_interface_misc.h:169
Definition: pxrd2_interface_misc.h:163
Definition: pxrd2_interface_misc.h:159
Definition: pxrd2_interface_misc.h:161
float * reg1buff
Definition: pxrd2_interface_misc.h:178
DETECTOR_BUILD
Definition: pxrd2_interface_misc.h:80
int bit_per_cnt_short
Definition: pxrd2_interface_misc.h:107
int recordlen
Definition: pxrd2_interface_misc.h:186
int bit_per_cnt_std
Definition: pxrd2_interface_misc.h:106
Definition: pxrd2_interface_misc.h:50
float energy
Definition: pxrd2_interface_misc.h:114
int entries
Definition: pxrd2_interface_misc.h:168
Definition: pxrd2_interface_misc.h:171
Definition: pxrd2_interface_misc.h:53
Definition: pxrd2_interface_misc.h:83
Definition: pxrd2_interface_misc.h:65
int depth
Definition: pxrd2_interface_misc.h:87
int autocal_bit_cnt
Definition: pxrd2_interface_misc.h:103
RunType
Definition: pxrd2_interface_misc.h:160
Definition: pxrd2_interface_misc.h:84
int Height
Definition: pxrd2_interface_misc.h:143
int decode
Definition: pxrd2_interface_misc.h:120
EnState
Definition: pxrd2_interface_misc.h:49
int Width
Definition: pxrd2_interface_misc.h:142
int cnt_regs
Definition: pxrd2_interface_misc.h:105
unsigned short * ptr
Definition: pxrd2_interface_misc.h:86
DETECTOR_BUILD Build
Definition: pxrd2_interface_misc.h:91
int separation_columns
Definition: pxrd2_interface_misc.h:100
Definition: pxrd2_interface_misc.h:160
int bytes_per_pixel
Definition: pxrd2_interface_misc.h:146
Definition: pxrd2_interface_misc.h:163
Definition: pxrd2_interface_misc.h:80
Definition: pxrd2_interface_misc.h:160
ConnectionState
Definition: pxrd2_interface_misc.h:50
float pitch
Definition: pxrd2_interface_misc.h:134
Definition: pxrd2_interface_misc.h:195
Definition: pxrd2_interface_misc.h:183
Definition: pxrd2_interface_misc.h:160
Definition: pxrd2_interface_misc.h:125
Definition: pxrd2_interface_misc.h:162
Definition: pxrd2_interface_misc.h:140
Definition: pxrd2_interface_misc.h:81
Definition: pxrd2_interface_misc.h:167
RUNMODE getRunModeFromStr(const char *)
Definition: pxrd2_interface_misc.cpp:39
int crop_ymax
Definition: pxrd2_interface_misc.h:129
Definition: pxrd2_interface_misc.h:81
int entries
Definition: pxrd2_interface_misc.h:185
int align_err
Definition: pxrd2_interface_misc.h:116
float shutter_len_ms
Definition: pxrd2_interface_misc.h:71
ImageType Image
Definition: pxrd2_interface_misc.h:145
Definition: pxrd2_interface_misc.h:163
CONV_TABLE conv_table
Definition: pxrd2_interface_misc.h:110
Definition: pxrd2_interface_misc.h:81
Definition: pxrd2_interface_misc.h:64
int cols_per_dout
Definition: pxrd2_interface_misc.h:102
ROSCHEMA_t ReadoutSchema
Definition: pxrd2_interface_misc.h:94
int slot_id
Definition: pxrd2_interface_misc.h:119