25 # error "Cannot use Lase EDL driver without libpcan" 28 #ifndef __PLUGINS_LASER_LASE_EDL_AQT_H_ 29 #define __PLUGINS_LASER_LASE_EDL_AQT_H_ 31 #include "acquisition_thread.h" 49 static const WORD RESETLEVEL_RESET;
50 static const WORD RESETLEVEL_RESTART;
51 static const WORD RESETLEVEL_HALT_IDLE;
52 static const WORD RESETLEVEL_RELOAD_VOLTSET;
53 static const WORD CONFIGITEM_ARCNET_HISTORIC;
54 static const WORD CONFIGITEM_RS232_RS422;
55 static const WORD CONFIGITEM_CAN;
56 static const WORD CONFIGITEM_SPI;
57 static const WORD CONFIGITEM_ARCNET;
58 static const WORD CONFIGITEM_GLOBAL;
59 static const WORD CONFIGDATA_LENGTH_RS232_RS422;
60 static const WORD CONFIGDATA_LENGTH_CAN;
61 static const WORD CONFIGDATA_LENGTH_ARCNET;
62 static const WORD CONFIGDATA_LENGTH_GLOBAL;
63 static const WORD SECTOR_0;
64 static const WORD SECTOR_1;
65 static const WORD SECTOR_2;
66 static const WORD SECTOR_3;
67 static const WORD SECTOR_4;
68 static const WORD SECTOR_5;
69 static const WORD SECTOR_6;
70 static const WORD SECTOR_7;
71 static const WORD SECTORFUNC_NOT_INITIALIZED;
72 static const WORD SECTORFUNC_NO_MEASUREMENT;
73 static const WORD SECTORFUNC_DUMMY_MEASUREMENT;
74 static const WORD SECTORFUNC_NORMAL_MEASUREMENT;
75 static const WORD SECTORFUNC_REFERENCE_TARGET;
76 static const WORD FLASH_YES;
77 static const WORD FLASH_NO;
78 static const WORD PROFILENUM_CONTINUOUS;
79 static const WORD PROFILEFORMAT_NUMBER;
80 static const WORD PROFILEFORMAT_COUNTER;
81 static const WORD PROFILEFORMAT_LAYER;
82 static const WORD PROFILEFORMAT_SECTOR;
83 static const WORD PROFILEFORMAT_ANGLE_STEP;
84 static const WORD PROFILEFORMAT_NUM_SECT_POINTS;
85 static const WORD PROFILEFORMAT_TIMESTAMP_START;
86 static const WORD PROFILEFORMAT_START_DIRECTION;
87 static const WORD PROFILEFORMAT_DISTANCE;
88 static const WORD PROFILEFORMAT_DIRECTION;
89 static const WORD PROFILEFORMAT_ECHO_AMPLITUDE;
90 static const WORD PROFILEFORMAT_TIMESTAMP_END;
91 static const WORD PROFILEFORMAT_END_DIRECTION;
92 static const WORD PROFILEFORMAT_SENSOR_MODE;
93 static const WORD SERVICEGROUP_STATUS;
94 static const WORD CMD_GET_IDENTIFICATION;
95 static const WORD CMD_GET_STATUS;
96 static const WORD CMD_GET_ERROR;
97 static const WORD CMD_GET_SIGNAL;
98 static const WORD CMD_SET_SIGNAL;
99 static const WORD CMD_REGISTER_APPLICATION;
100 static const WORD SERVICEGROUP_CONFIG;
101 static const WORD CMD_SET_CONFIG;
102 static const WORD CMD_GET_CONFIG;
103 static const WORD CMD_SET_SYNC_ABS;
104 static const WORD CMD_SET_SYNC_REL;
105 static const WORD CMD_SET_SYNC_CLOCK;
106 static const WORD CMD_SET_ZONE;
107 static const WORD CMD_GET_ZONE;
108 static const WORD CMD_RELEASE_ZONE;
109 static const WORD CMD_SET_FILTER;
110 static const WORD CMD_SET_FUNCTION;
111 static const WORD CMD_GET_FUNCTION;
112 static const WORD SERVICEGROUP_MEASUREMENT;
113 static const WORD CMD_GET_PROFILE;
114 static const WORD CMD_CANCEL_PROFILE;
115 static const WORD SERVICEGROUP_WORKING;
116 static const WORD CMD_DO_RESET;
117 static const WORD CMD_TRANS_IDLE;
118 static const WORD CMD_TRANS_ROTATE;
119 static const WORD CMD_TRANS_MEASURE;
120 static const WORD SERVICEGROUP_MAINTENANCE;
121 static const WORD CMD_DO_ADJUST;
122 static const WORD CMD_DO_TEST;
123 static const WORD SERVICEGROUP_INTERFACE_ROUTING;
124 static const WORD CMD_COM_ATTACH;
125 static const WORD CMD_COM_DETACH;
126 static const WORD CMD_COM_INIT;
127 static const WORD CMD_COM_OUTPUT;
128 static const WORD CMD_COM_DATA;
129 static const WORD SERVICEGROUP_FILE;
130 static const WORD CMD_DIR;
131 static const WORD CMD_SAVE;
132 static const WORD CMD_LOAD;
133 static const WORD CMD_DELETE;
134 static const WORD SERVICEGROUP_MONITOR;
135 static const WORD CMD_MONITOR_ENABLE_LOG;
136 static const WORD CMD_MONITOR_DISABLE_LOG;
138 static const WORD SERVICEGROUP_ADJUST;
139 static const WORD SERVICEGROUP_SPECIAL;
140 static const WORD CMD_SERVICE_FAILURE;
141 static const WORD RESPONSE_BIT;
142 static const float DISTANCE_FACTOR;
145 unsigned int calc_angle_step(
unsigned int rotation_freq,
unsigned int max_pulse_freq);
146 inline WORD respcode(WORD cmd) {
return cmd | RESPONSE_BIT; }
148 void send(WORD *data,
int n);
149 int recv(WORD **data,
bool allocate =
true);
151 void send_and_check(WORD *command_data,
int command_length,
152 WORD *expected_response,
int n,
153 WORD **real_response = NULL,
int *response_size = NULL);
155 inline void append_to_msg(WORD word, TPCANMsg *msg);
156 inline void append_to_msg(BYTE byte, TPCANMsg *msg);
157 inline WORD get_word_from_msg(TPCANMsg *msg,
int *index);
158 WORD * make_word_array(
int count, ...);
159 int compare_word_arrays(
int count, WORD* a, WORD* b);
160 void print_word_array(
int count, WORD* a);
161 void print_message(TPCANMsg *m);
163 void process_profiles();
165 void SET_CONFIG(WORD config_item,
int k, ...);
166 void SET_FUNCTION(WORD sect_num, WORD sect_func, WORD sect_stop, WORD flash);
167 void GET_PROFILE(WORD prof_num, WORD prof_format);
168 void CANCEL_PROFILE();
169 void DO_RESET(WORD reset_level);
171 void TRANS_ROTATE(WORD frequency);
172 void TRANS_MEASURE();
178 bool __pre_init_done;
180 std::string __cfg_name;
181 std::string __cfg_prefix;
183 bool __cfg_use_default;
184 bool __cfg_set_default;
185 unsigned int __cfg_rotation_freq;
186 unsigned int __cfg_angle_step;
187 unsigned int __cfg_max_pulse_freq;
188 unsigned int __cfg_profile_format;
189 unsigned int __cfg_can_id;
190 unsigned int __cfg_can_id_resp;
191 unsigned int __cfg_sensor_id;
192 unsigned int __cfg_sensor_id_resp;
193 unsigned int __cfg_interface_type;
194 unsigned int __cfg_btr0btr1;
195 unsigned int __cfg_port;
196 unsigned int __cfg_irq;
197 unsigned int __cfg_num_init_tries;
198 float __cfg_mount_rotation;
200 unsigned int __min_angle_step;
201 unsigned int __number_of_values;
Laser acqusition thread for Lase EDL L A laser scanner.
LaseEdlAcquisitionThread(std::string &cfg_name, std::string &cfg_prefix)
Constructor.
Logger * logger
This is the Logger member used to access the logger.
virtual void loop()
Code to execute in the thread.
virtual void pre_init(fawkes::Configuration *config, fawkes::Logger *logger)
Pre initialization.
virtual void finalize()
Finalize the thread.
Configuration * config
This is the Configuration member used to access the configuration.
Interface for configuration handling.
virtual void init()
Initialize the thread.