Commit | Autor | Alter
|
0a10d5
|
1 |
/* G4SrcCfgIncl.h*/ |
JS |
2 |
|
|
3 |
#ifndef G4SRCCFGINCL_H_ |
|
4 |
#define G4SRCCFGINCL_H_ |
|
5 |
|
|
6 |
#define MAX_SOURCES 8 |
|
7 |
#define ATTR_LEN 64 |
|
8 |
|
|
9 |
#define G4_SRC_CFG_EULER_DEGREE 0 |
|
10 |
#define G4_SRC_CFG_EULER_RADIAN 1 |
|
11 |
#define G4_SRC_CFG_QUATERNION 2 |
|
12 |
#define G4_SRC_CFG_INCH 3 |
|
13 |
#define G4_SRC_CFG_FOOT 4 |
|
14 |
#define G4_SRC_CFG_CM 5 |
|
15 |
#define G4_SRC_CFG_METER 6 |
|
16 |
|
|
17 |
#define G4_SRC_CFG_FILE_OPEN_ERR -200 |
|
18 |
#define G4_SRC_CFG_FILE_ERR -199 |
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
typedef struct _G4_SRC_DATA_STRUCT { |
|
23 |
|
|
24 |
int sourceMap; // 4 |
|
25 |
char id[MAX_SOURCES][16]; // 128 |
|
26 |
float pos_ori[MAX_SOURCES][7]; // 224 |
|
27 |
unsigned char freq[MAX_SOURCES]; // 8 |
|
28 |
unsigned char start_hem[MAX_SOURCES]; // 8 |
|
29 |
unsigned char attr[MAX_SOURCES][ATTR_LEN]; // 512 |
|
30 |
|
|
31 |
}*LPG4_SRC_DATA_STRUCT,G4_SRC_DATA_STRUCT; // 884 bytes |
|
32 |
|
|
33 |
|
|
34 |
#ifdef __cplusplus |
|
35 |
extern "C" { |
|
36 |
#endif |
|
37 |
|
|
38 |
/* Function Prototypes */ |
|
39 |
|
|
40 |
// Function name : g4_read_source_cfg_file |
|
41 |
// Description : Read a source cfg file and place data into a G4_SRC_DATA_STRUCT |
|
42 |
// Return type : int - 0 for success, non-zero for failure |
|
43 |
// Argument : int pos_units - the desired units for source position data. Use |
|
44 |
// G4_SRC_CFG_INCH,G4_SRC_CFG_FOOT,G4_SRC_CFG_CM, or G4_SRC_CFG_METER |
|
45 |
// Argument : int orientation units - the desired units for orienation. Use |
|
46 |
// G4_SRC_CFG_EULER_DEGREE,G4_SRC_CFG_EULER_RADIAN, or G4_SRC_CFG_QUATERNION |
|
47 |
// Argument : LPG4_SRC_DATA_STRUCT - Pointer to struct to receive file data. |
|
48 |
// Argument : filename - File to read. |
|
49 |
int g4_read_source_cfg_file(int pos_units,int orientation_units,LPG4_SRC_DATA_STRUCT pds,const char* filename); |
|
50 |
|
|
51 |
// Function name : g4_create_source_cfg_file |
|
52 |
// Description : Create a source cfg file from data in a G4_SRC_DATA_STRUCT |
|
53 |
// Return type : int - 0 for success, non-zero for failure |
|
54 |
// Argument : int pos_units - the units for source position data. Use |
|
55 |
// G4_SRC_CFG_INCH,G4_SRC_CFG_FOOT,G4_SRC_CFG_CM, or G4_SRC_CFG_METER |
|
56 |
// Argument : int orientation units - the units for orienation. Use |
|
57 |
// G4_SRC_CFG_EULER_DEGREE,G4_SRC_CFG_EULER_RADIAN, or G4_SRC_CFG_QUATERNION |
|
58 |
// Argument : LPG4_SRC_DATA_STRUCT - Pointer to struct that contains data. |
|
59 |
// Argument : filename - File to create. |
|
60 |
int g4_create_source_cfg_file(int pos_unis,int orientation_units,LPG4_SRC_DATA_STRUCT pds,const char* filename); |
|
61 |
|
|
62 |
// Function name : g4_get_freq_sn_from_attr |
|
63 |
// Description : Extracts the source frequency and id from the attribute data |
|
64 |
// Return type : int - the frequency of the source |
|
65 |
// Argument : unsigned char* - The attribute string as read from the *.gs4 file. |
|
66 |
// Argument : char* - a string to receive the serial number of the source. May be NULL |
|
67 |
int g4_get_freq_sn_from_attr(unsigned char* attr,char* id); |
|
68 |
|
|
69 |
#ifdef __cplusplus |
|
70 |
} |
|
71 |
#endif |
|
72 |
|
|
73 |
#endif |