/* * structures.h * * Authors: * Liu Jieqing * * 2009-1-15 File created. * * This file is the structures commonly used throughout the * whole system. Need to increase and improve gradually. * * * Modification history: * 2013-01-21 modified, add some 1500P used structures * and others * 2013-02-28 modified, add Correction struct */ #ifndef __STRUCTURES_H__ #define __STRUCTURES_H__ #define STRLEN 256 #define DOSELENGTH 8192 /* * Structures used to save the detector information * * rawImageWidth ! The original image width of the detector * rawImageHeight ! The original image height of the detector * maxPixelValue ! The max value of each pixel * bitsPerPixel ! Number of bits per pixel * hardWareVersion[STRLEN] ! The version of hardware * softWareVersion[STRLEN] ! The version of software * serialNumber[STRLEN] ! The serial number of the detector * DetectorDescription[STRLEN] ! A string that describes the detector, STRLEN is a macro definition, 256 */ struct DetectorInfo { int rawImageWidth; int rawImageHeight; int maxPixelValue; int bitsPerPixel; char hardWareVersion[STRLEN]; char softWareVersion[STRLEN]; char serialNumber[STRLEN]; char detectorDescription[STRLEN]; }; /* * Structure used to save current detector temperature information * maxTemperature ! Max detector temperature of temperature sensors currently * aveTemperature ! Average detector temperature of temperature sensors currently * overhot_flag ! Detector over hot flag */ struct Temperature { float reserved[5]; float maxTemperature; float aveTemperature; int overhot_flag; //Status infor, see enum TempStatus }; //窮学佚連(Used for 1500P) struct BatteryInfo { int manu_access; int alarm_capa; //unit: mAh int alarm_time; //unit: min int mode; //range: 0x0000~0xffff int atrate; //-32768mA~32768mA int atrate_tofull; //unit: min int atrate_toempty; //unit: min int atrate_ok; //unit: min float temperature; //unit: C float voltage; //unit: V float current; //unit: A float ave_current; //unit: A float max_error; float relative_state_of_charge; float absolute_state_of_charge; int rest_capacity; //unit mAh int full_capacity; //unit mAh int run_time_to_empty; int ave_time_to_empty; float charging_current; //unit: A float charging_voltage; //unit: V int battery_status; int cycle_count; int design_capacity; //mAh float design_voltage; //V float cell4_voltage; //V float cell3_voltage; //V float cell2_voltage; //V float cell1_voltage; //V }; struct WirelessInfo { char essid[32]; char mode[16]; char freq[16]; char channel[16]; char bit_rate[16]; char encypt_key[64]; char security_mode[16]; char link_quality[16]; char signal_level[16]; //signal level char noise_level[16]; char sensitivity[16]; char reserved1[16]; //the first 256 bytes unsigned long long tx_packets; unsigned long long rx_packets; unsigned long long tx_bytes; unsigned long long rx_bytes; int reserved[64]; //the second 256 bytes }; struct WirelessStationConf { char wireless_station_SSID[STRLEN]; char wireless_mode[STRLEN]; char wireless_channel[STRLEN]; }; struct TrainHead { float temperature; int integTime; long generatedTime; int reserved[5]; }; /* * Structure used to save the current detector status information * * currentMode ! Current mode of the detector * detectorState ! Current detector state * frameRate ! Current frame rate * temperature ! Detector temperature of temperature sensors currently */ struct StatusInfo { int checkMode; int detectorState; float frameRate; Temperature temperature; BatteryInfo batInfo; WirelessInfo wireless_info; }; /* * Structure to save the current mode infomation. * * modeId ! The mode id for the information retrieved. * acqType ! Acquisition type. Variable is set to 0 for radiograph modes or 1 for fluoroscopy modes. * imageWidth ! The number of column of an image in current mode. * imageHeight ! The number of line of an image in current mode. * linesPerPixel ! The number of lines per pixel, >1 when binning is used. * colsPerPixel ! The number of column per pixel, >1 when binning is used. * imageSize ! The size of image in byte. * maxFrameRate ! The maximum allowed frame rate for the mode. * modeDescription ! A string that describes the mode. */ struct ModeInfo { int modeId; int acqType; int imageWidth; int imageHeight; int linesPerPixel; int colsPerPixel; int imageSize; float maxFrameRate; char modeDescription[STRLEN]; }; /* * Structure used to save the correction option. * fixedCorr ! TRUE enable fixed method correction;FALSE disable * non_fixedCorr ! TRUE enable portable method correction for fixed detector; FALSE disable. * portableCorr ! TRUE enable portable method correction for mobile detector; FALSE disable. */ struct UserCorrection { BOOL fixedCorr; BOOL non_fixedCorr; BOOL portableCorr; }; /* * Structure used to get rad mode exposure parameters. * * expStatus ! see ExposureStatus * inside_offs_corrflag ! * realtime_offset ! if contain offset image int the first image * frame_number ! The number of frames acquired. * fetchable ! The acquisition or calibration process is complete or not. FALSE: completed, TRUE: complete. * calComplete ! TRUE: calibration complete, FALSE: calibration in progress or not in progress. * errorCode ! Non zero means an error occured. * expose_flag ! expose flag used in auto or manual sync */ struct ExpProgress { int expStatus; BOOL inside_offs_corrflag; BOOL realtime_offset; int frame_number; BOOL fetchable; int errorCode; BOOL calComplete; //before is scan_phase BOOL expose_flag; }; struct FrameAttr { int image_width; //!