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);
149 return cmd | RESPONSE_BIT;
152 void send(WORD *data,
int n);
153 int recv(WORD **data,
bool allocate =
true);
155 void send_and_check(WORD * command_data,
157 WORD * expected_response,
159 WORD **real_response = NULL,
160 int * response_size = NULL);
162 inline void append_to_msg(WORD word, TPCANMsg *msg);
163 inline void append_to_msg(BYTE
byte, TPCANMsg *msg);
164 inline WORD get_word_from_msg(TPCANMsg *msg,
int *index);
165 WORD * make_word_array(
int count, ...);
166 int compare_word_arrays(
int count, WORD *a, WORD *b);
167 void print_word_array(
int count, WORD *a);
168 void print_message(TPCANMsg *m);
170 void process_profiles();
172 void SET_CONFIG(WORD config_item,
int k, ...);
173 void SET_FUNCTION(WORD sect_num, WORD sect_func, WORD sect_stop, WORD flash);
174 void GET_PROFILE(WORD prof_num, WORD prof_format);
175 void CANCEL_PROFILE();
176 void DO_RESET(WORD reset_level);
178 void TRANS_ROTATE(WORD frequency);
179 void TRANS_MEASURE();
185 std::string cfg_name_;
186 std::string cfg_prefix_;
188 bool cfg_use_default_;
189 bool cfg_set_default_;
190 unsigned int cfg_rotation_freq_;
191 unsigned int cfg_angle_step_;
192 unsigned int cfg_max_pulse_freq_;
193 unsigned int cfg_profile_format_;
194 unsigned int cfg_can_id_;
195 unsigned int cfg_can_id_resp_;
196 unsigned int cfg_sensor_id_;
197 unsigned int cfg_sensor_id_resp_;
198 unsigned int cfg_interface_type_;
199 unsigned int cfg_btr0btr1_;
200 unsigned int cfg_port_;
201 unsigned int cfg_irq_;
202 unsigned int cfg_num_init_tries_;
203 float cfg_mount_rotation_;
205 unsigned int min_angle_step_;
206 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.