123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666 |
- #ifndef __CR_STRUCTURE_H__
- #define __CR_STRUCTURE_H__
- #ifdef __cplusplus
- extern "C" {
- #endif
- //*****************************************************************************************
- // enum starts here.
- //*****************************************************************************************
- namespace CareRay
- {
- enum CrModeId
- {
- CR_RAD_MODE_ID = 16,
- CR_DAEC_MODE_ID = 18,
- CR_DAEC_FLIP_MODE_ID = 19,
- };
- enum CrTrigType
- {
- CR_RAD_EXT_SYNC = 0x01,
- CR_RAD_SOFT_SYNC = 0x02,
- CR_RAD_AUTO_SYNC = 0x03,
- CR_RAD_MANUAL_SYNC = 0x04,
- CR_RAD_AED_SYNC = 0x05,
- CR_RAD_DAEC_SYNC = 0x06,
- CR_RAD_DAEC_FLIP_SYNC = 0x07,
- CR_FLUORO_EXT_SYNC = 0x08,
- CR_FLUORO_INT_SYNC = 0x09,
- };
- enum CrGainLevel
- {
- CR_G0 = 0,
- CR_G1 = 1,
- CR_G2 = 2,
- CR_G3 = 3,
- CR_G4 = 4,
- CR_G5 = 5,
- CR_G6 = 6,
- CR_G7 = 7,
- };
- enum CrPowerModeId
- {
- CR_PWR_STANDBY = 0, //set front-end into nap mode
- CR_PWR_FULL_RUNNING = 1, //set front-end into normal mode.
- CR_PWR_SMART_RUNNING = 2, //set front-end into nap mode at the integration phase.
- CR_PWR_DOWN_FE = 4, //set front-end into power-down mode.
- CR_PWR_SLEEPING = 5,
- CR_PWR_DEEP_SLEEPING = 6,
- CR_PWR_SUSPEND = 7, // power down
- };
- enum CrEventId
- {
- CR_EVT_SERVER_DISCONNECTED,
- CR_EVT_DETR_DISCONNECTED,
- CR_EVT_EXPOSURE_INFO,
- CR_EVT_TEMPERATURE_INFO,
- CR_EVT_BATTERY_INFO,
- CR_EVT_WIRELESS_INFO,
- CR_EVT_NEW_FRAME,
- CR_EVT_CALIBRATION_IN_PROGRESS,
- CR_EVT_CALIBRATION_FINISHED,
- CR_EVT_NEW_SPOT_FILM,
- CR_EVT_ACQ_STAT_INFO,
- CR_EVT_RAD_ACQ_IN_PROGRESS,
- CR_EVT_SERVER_RECONNECTED,
- CR_EVT_DETR_RECONNECTED,
- CR_EVT_IMAGE_QUEUE_BLOCKED,
- CR_EVT_DISCARD_FRAME,
- CR_EVE_USAGE_INFO,
- CR_EVT_POSITION
- };
- enum CrExpStatus
- {
- CR_EXP_ERROR = -1,
- CR_EXP_INIT,
- CR_EXP_READY,
- CR_EXP_WAIT_PERMISSION,
- CR_EXP_PERMITTED,
- CR_EXP_EXPOSE,
- CR_EXP_COMPLETE,
- };
- enum CrReturnCodeType
- {
- CR_INFOR = 1,
- CR_WARN,
- CR_ERROR,
- CR_FATALERROR
- };
- enum CrCalFileType
- {
- CR_OFFSET_FILE = 0,
- CR_GAIN_FILE = 1,
- CR_DEFECT_FILE = 2
- };
- enum CrRefStatus
- {
- CR_REF_NOT_FOUND,
- CR_REF_VALID,
- CR_REF_ABOUT_TO_EXPIRE,
- CR_REF_INVALID
- };
- enum CrCalibFilterMethod
- {
- CR_CALIB_FILTER_BASE,
- CR_CALIB_FILTER_MEAN,
- CR_CALIB_FILTER_BOUNDARY
- };
- /*****************************************************************************************
- *****************************************************************************************/
- enum CrProcChainOpt
- {
- CR_PROCCHAIN_SANITYCHECK = 0x01,
- CR_PROCCHAIN_DARKCORR = 0x02,
- CR_PROCCHAIN_GAINCORR = 0x04,
- CR_PROCCHAIN_DEFECTCORR = 0x08,
- CR_PROCCHAIN_LAGCORR = 0x10,
- CR_PROCCHAIN_IMGCROPPING = 0x20,
- CR_PROCCHAIN_RTPIXELCORR = 0x40,
- CR_PROCCHAIN_DENOISING = 0x80,
- CR_PROCCHAIN_STEPSUPPRESS = 0x100,
- CR_PROCCHAIN_ROTATE_IAMGE = 0x200,
- CR_PROCCHAIN_GAUSSFILTER = 0x80000000
- };
- enum CrProcChainId
- {
- CR_PROCCHAINID_FLUOROSCOPY = 1,
- CR_PROCCHAINID_RADIOGRAPHY = 2
- };
- enum CrConnectionDeviceType
- {
- CR_WIRELESS_DEVICE,
- CR_WIRED_DEVICE
- };
- enum CrConnectionMethodType
- {
- CR_WIRELESS_MANUAL_IP,
- CR_WIRELESS_DHCP,
- CR_WIRELESS_AP,
- CR_WIRED_MANUAL_IP,
- CR_WIRED_DHCP_SERVER,
- CR_WIRED_DHCP_CLIENT,
- CR_STANDALONE
- };
- //*****************************************************************************************
- // struct starts here.
- //*****************************************************************************************
- typedef struct CrSystemInfo
- {
- unsigned int raw_img_width;
- unsigned int raw_img_height;
- unsigned int frame_header_len;
- char hardware_version[64];
- char serial_number[64];
- char software_version[64];
- char firmware_version[64];
- char detr_machine_id[64];
- char detr_desc[128];
- char reserved[512];
- }CrSystemInfo;
- typedef struct CrDefectInfo
- {
- unsigned int bad_pixel_num;
- unsigned int bad_raw_num;
- unsigned int bad_col_num;
- unsigned short *bad_pixel;
- unsigned short *bad_row;
- unsigned short *bad_col;
- }CrDefectInfo;
- typedef struct CrConnectionStatus
- {
- int server_connection_status;
- int detr_connection_status;
- }CrConnectionStatus;
- typedef struct CrTemperature
- {
- float min;
- float cpu;
- float wired_network;
- float reserved;
- float current;
- float max;
- float avg;
- int overheat;
- }CrTemperature;
- typedef struct CrDetrStatus
- {
- CrTemperature detr_temperature;
- }CrDetrStatus;
- typedef struct CrDetrIdxAndIPAddr
- {
- int index;
- char ip_addr[64];
- int device_type;
- char reserved[124];
- }CrDetrIdxAndIPAddr;
- typedef struct CrRegAttrInfo
- {
- int is_writable;
- int is_float_type;
- unsigned int int_value;
- float float_value;
- char property_name[32];
- }CrRegAttrInfo;
- typedef struct CrModeInfo
- {
- int mode_id;
- int image_width; // ROI dimension along x direction after binning
- int image_height; // ROI dimension along y direction after binning
- int cutoff_x; // number of cut-off lines (along x direction) from left after binning
- int cutoff_y; // number of cut-off lines (along y direction) from top after binning
- int bin_x; // binning scheme along x direction
- int bin_y; // binning scheme along y direction
- float max_frame_rate; // in Hz
- float max_exposure_time; // in ms
- int pixel_depth; // bit depth of each pixel sending out from detector
- int trigger_types[16];
- int valid_trigger_type_num;
- int gain_levels[16];
- int valid_gain_num;
- int default_trigger_type;
- int default_gain_level;
- int roi_x; // x coordinate of top left point after binning
- int roi_y; // y coordinate of top left point after binning
- int mode_conf;
- char desc[256]; // description of this mode
- }CrModeInfo;
- typedef struct CrExtendModeInfo
- {
- float readout_time;
- int block_length;
- int bin_mode;
- int roi_type;
- int acquire_type;
- unsigned char cut_low_bits[16];
- unsigned char cut_high_bits[16];
- }CrExtendModeInfo;
- typedef struct CrCalibrationInfo
- {
- int total_frame_num;
- int current_frame_num;
- int current_frame_mean;
- char error_msg[256];
- int result;
- int exposure_status;
- int target_gray_value;
- }CrCalibrationInfo;
- typedef struct CrConfItemInfo
- {
- int id;
- char name[64];
- char module[32];
- char value[128];
- char default_value[128];
- char regex[256];
- int permission;
- char desc[256];
- char desc_zh[256];
- int need_reboot;
- }CrConfItemInfo;
- typedef struct CrProcessModule
- {
- int module_id;
- int order_id;
- char name[64];
- int is_enabled;
- int default_enabled;
- int is_auto_save;
- int update_policy;
- }CrProcessModule;
- typedef struct CrProcessChain
- {
- int chain_id;
- int valid_module_num;
- CrProcessModule modules[16];
- }CrProcessChain;
- typedef struct CrEvent
- {
- int event_id;
- int detr_index;
- int width;
- int height;
- int pixel_depth;
- int header_len;
- void* data;
- }CrEvent;
- typedef struct CrAcquisitionStatInfo
- {
- int total_frame_num;
- int lost_frame_num;
- float frame_rate;
- float transmission_speed;
- long long duration_milliseconds;
- float fpga_frame_rate;
- }CrAcquisitionStatInfo;
- // Image quality statistics
- typedef struct CrSQualityStatistics
- {
- // Passed type count
- int quality_passed_count;
- // Failed type count
- int quality_failed_count;
- }CrSQualityStatistics;
- typedef struct CrExpProgress
- {
- int exposure_status;
- int is_fetchable;
- int result;
- }CrExpProgress;
- typedef struct CrAedExpProgress
- {
- CrExpProgress progress;
- float aed_elapsed_time_since_last_readout;
- float aed_refresh_interval;
- }CrAedExpProgress;
- typedef struct CrCalibFileInfo
- {
- int calib_type;
- float frame_rate;
- int gain_id;
- float temperature;
- int status;
- int trigger_type;
- char mode_name[256];
- char datetime[64];
- char expire_time[64];
- int mode_id;
- float exposure_time;
- int term_of_valid_in_min;
- int app_mode_key;
- }CrCalibFileInfo;
- //Reference status and expiration duration (unit: minute) of special application mode
- typedef struct CrRefStatusInfo
- {
- int dark_status;
- int gain_status;
- int defect_status;
- int dark_left_minutes;
- int gain_left_minutes;
- int defect_left_minutes;
- }CrRefStatusInfo;
- typedef struct CrRadDetrFileHeader
- {
- char type_code[8];
- int image_size;
- int img_x_size;
- int img_y_size;
- int pixel_depth;
- int compress_type;
- int frame_num;
- int correct_way;
- int correct_para;
- int isolated_pixels;
- int isolated_pixels_pos;
- int hori_bad_lines;
- int hori_bad_lines_pos;
- int vert_bad_lines;
- int vert_bad_lines_pos;
- int cluster_pixels;
- int cluster_pixels_pos;
- }CrRadDetrFileHeader;
- typedef struct CrRadDetrInfoHeader
- {
- int start_flag;
- int endian_type;
- char dttver[32];
- int dtt_type;
- int dtt_num;
- int mode_id;
- int img_prop;
- char build_time[24];
- float vbias;// 4 bytes float
- float vcmp;// 4 bytes floatdynam_range
- float vtft_on;// 4 bytes float
- float vtft_off;// 4 bytes float
- float dynam_range;
- float pga_dac;
- float expos_time;
- float delay_time;
- float wait_time;
- float temp_lt;
- float temp_rt;
- float temp_lb;
- float temp_rb;
- float temp_m;
- float reserved11[3];
- char machine_id[32];
- float reserved12[49];
- int fpga_reg_version[4];
- int build_date;
- int res000;
- int int_reg_copy;
- int int_mask;
- int expos_control;
- int fpga_status;
- int cycle_count;
- int adc_rsl;
- int res024[15];
- float fpga_dynam_range;
- float fpga_pga_dac;
- float fpga_pga_dac_control;
- float fpga_vbias;
- float fpga_vcmp;
- float fpga_vtft_on;
- float fpga_vtft_off;
- float fpga_expos_time;
- int res084;
- float fpga_delay_time;
- int res08c;
- float fpga_wait_time;
- int res094;
- int pixel_num;
- int line_num;
- int readout_cntr;
- int scan_line;
- int res0a8[2];
- int x_start;
- int x_end;
- int y_start;
- int y_end;
- int res0c0[16];
- int fifo_max;
- int fifo_thrsh;
- int fifo_count;
- int end_flag;
- }CrRadDetrInfoHeader;
- typedef struct CrRegisterModeInfo
- {
- int app_mode_key;
- int mode_id;
- float frame_rate;
- float exposure_time;
- int trigger_type;
- int gain_level;
- int row_index;
- int mode_type; // 0 : fluoro, 1 : rad
- int frame_filter_len;
- char *frame_filter;
- unsigned char decode_strategy_type;
- int column_index;
- }CrRegModeInfo;
- typedef struct CrDaecAreaInfo
- {
- int x;
- int y;
- int width;
- int height;
- float weight;
- }CrDaecAreaInfo;
- typedef struct CrUsageInfo
- {
- // summary cpu part
- unsigned int total_processors_num;
- unsigned int enable_processors_num;
- unsigned int user_time;
- unsigned int system_time;
- unsigned int nice_time;
- unsigned int idle_time;
- unsigned int iowait_time;
- unsigned int irq_time;
- unsigned int softirq_time;
- // summary memory, unit:KB
- unsigned int total_ram;
- unsigned int free_ram;
- unsigned int buffer_ram;
- unsigned int cached_ram;
- unsigned int slab_reclaimable;
- unsigned int slab_unreclaim;
- unsigned int shared_ram;
- unsigned int avail_ram;
- unsigned int total_swap;
- unsigned int free_swap;
- // process title
- int pid;
- char name[64];
- int nice;
- unsigned int threads_num;
- // process cpu part
- unsigned int user_ticks;
- unsigned int system_ticks;
- unsigned int total_ticks;
- // process memory, unit:KB
- unsigned int virtual_size;
- unsigned int rss;
- // process disk, unit:MB
- unsigned int total_size;
- unsigned int free_size;
- unsigned int avail_size;
- }CrProcStat;
- typedef struct CrTemperatureTrainHeader
- {
- float temperature;
- int integration_time;
- long generated_time;
- int trigger_line;
- int data_num;
- int reserved[3];
- }CrTemperatureTrainHeader;
- typedef struct CrTemperatureTrainInfo
- {
- CrTemperatureTrainHeader train_header;
- float* train_data;
- }CrTemperatureTrainInfo;
- typedef struct CrTemperatureTrainSlotMsg
- {
- int detector_id;
- int slot_exp_time;
- float slot_temperature;
- }CrTemperatureTrainSlotMsg;
- typedef struct CrMagStat
- {
- int mag_index;
- float x;
- float y;
- float z;
- }CrMagStat;
- typedef struct CrGyroStat
- {
- float alpha;
- float beta;
- float gamma;
- float x;
- float y;
- float z;
- }CrGyroStat;
- typedef struct CrPositionInfo
- {
- long long timestamp;
- CrMagStat mag_sensors[4];
- CrGyroStat gyro;
- }CrPositionInfo;
- typedef struct CrDropInfo
- {
- long long seconds;
- float acceleration;
- }CrDropInfo;
- typedef struct CrCheckInfo
- {
- char id[128];
- char body_part_id[32];
- char series_time[32];
- }CrCheckInfo;
- typedef struct CrBodyPartInfo
- {
- char id[32];
- char part_name[32];
- }CrBodyPartInfo;
- typedef struct CrExamination
- {
- char id[16];
- char checklist_number[64];
- char patient_id[64];
- char patient_name[64];
- char patient_sex[8];
- char patient_age[4];
- int body_part_num;
- int check_info_num;
- CrBodyPartInfo body_parts[16];
- CrCheckInfo check_infos[32];
- }CrExamination;
- typedef struct CrBatteryInfo
- {
- unsigned char id; //battery id
- unsigned char accessible; //is battery accessible
- unsigned short remaining_capacity; //unit: mAh
- unsigned short full_capacity; //unit: mAh
- unsigned short voltage; //unit: mV
- short current; //unit: mA
- unsigned short charging_current; //unit: mA
- unsigned short run_time_to_empty; //unit: min
- unsigned short avg_time_to_empty; //unit: min
- unsigned short avg_time_to_full; //unit: min
- unsigned short cycle_count; //unit: cycles
- unsigned short temperature; //unit: 0.1K
- unsigned short relative_state_of_charge;//relative capacity, unit: %
- unsigned short absolute_state_of_charge;//relative capacity, unit: %
- unsigned short reserved[7];
- }CrBatteryInfo;
- typedef struct CrWirelessStatus
- {
- char essid[32];
- char passwd[32];
- char protocol[16];
- char desc[32];
- int mode;
- int channel;
- double frequency;
- int bit_rate;
- int status;
- int quality;
- int level;
- int noise;
- unsigned int ipv4;
- int factory_flag;
- }CrWirelessStatus;
- #define FLUORO_MODE_TYPE 0
- #define RAD_MODE_TYPE 1
- #define DTT_INFO_HEADER_OFFSET 16384
- #define PCI_IMG_HEAD_OFFSET 32768
- typedef void (* CrCallbackFunPtr)(int, CrEvent *);
- #ifdef __cplusplus
- }
- #endif
- }
- #endif
|