66 emit
message(
"Shutting laserscanner SICK S300 down");
89 emit
message(
"<font color=\"#FF0000\">Serial port not set! (SickS300::openComPortd)</font>");
114 const unsigned char releaseTokenCommand[]={0x00,0x00,0x41,0x44,0x19,0x00,0x00,0x05,0xFF,0x07,0x19,0x00,0x00,0x05,0xFF,0x07,0x00,0x00,0xE7,0xB8};
118 emit
message(
"Shutting down Sick S300:");
121 emit
message(
"Sending 'release token'...");
122 for (i=0; i<
sizeof(releaseTokenCommand); i++)
124 if (
sendChar(releaseTokenCommand[i]) ==
false)
126 emit
message( QString(
"ERROR sending byte no. %1.").arg(i) );
132 unsigned char answer = 255;
144 emit
message(
"ERROR getting answer from laser S300.");
166 emit
message(
"<font color=\"#FF0000\">ERROR writing serial port (sendChar, SickS300)!<font>");
181 emit
message(
"<font color=\"#FF0000\">ERROR reading serial port (receiveChar, SickS300)!<font>");
192 const unsigned char getTokenCommand[]={0x00,0x00,0x41,0x44,0x19,0x00,0x00,0x05,0xFF,0x07,0x19,0x00,0x00,0x05,0xFF,0x07,0x07,0x0F,0x9F,0xD0};
193 unsigned char answer = 255;
197 emit
message(
"Initialising Sick S300:");
200 emit
message(
"Sending 'get token'...");
201 for (i=0; i<
sizeof(getTokenCommand); i++)
203 if (
sendChar(getTokenCommand[i]) ==
false)
205 emit
message( QString(
"<font color=\"#FF0000\">ERROR sending byte no. %1 (SickS300::setup).</font>").arg(i+1) );
212 emit
message(
"Receiving answer...");
219 emit
message(QString(
"<font color=\"#FF0000\">ERROR: answer byte no. %1 was 0x%2 instead 0x00 (SickS300::readRequestTelegram).</font>").arg(i+1).arg(answer, 2, 16, QLatin1Char(
'0')));
226 emit
message(
"<font color=\"#FF0000\">ERROR getting answer from laser.</font>");
232 emit
message(
"Sick laser S300 setup OKAY");
250 const unsigned char readScandataCommand[]={0x00,0x00,0x45,0x44,0x0C,0x00,0x02,0x22,0xFF,0x07};
251 unsigned char answer = 255;
265 emit
message(QString(
"<font color=\"#FF0000\">ERROR %1 flushing serial port (SickS300::readRequestTelegram).</font>").arg(result));
271 for (i=0; i<
sizeof(readScandataCommand); i++)
273 if (
sendChar(readScandataCommand[i]) ==
false)
275 emit
message( QString(
"<font color=\"#FF0000\">ERROR sending byte no. %1 (SickS300::readRequestTelegram).</font>").arg(i+1) );
291 emit
message(QString(
"<font color=\"#FF0000\">ERROR: answer byte no. %1 was 0x%2 instead 0x00 (SickS300::readRequestTelegram).</font>").arg(i+1).arg(answer, 2, 16, QLatin1Char(
'0')));
298 emit
message(QString(
"<font color=\"#FF0000\">ERROR receiving 00 00 00 00 answer at byte no. %1 (SickS300::readRequestTelegram).</font>").arg(i+1));
312 emit
message(QString(
"ERROR: answer byte no.1 was 0x%1 instead of 0x0C.").arg( answer, 2, 16, QLatin1Char(
'0') ));
319 emit
message(
"<font color=\"#FF0000\">ERROR receiving repeated header at byte no. 1 (SickS300::readRequestTelegram).</font>");
328 emit
message(QString(
"ERROR: answer byte no.2 was 0x%1 instead of 0x00.").arg( answer, 2, 16, QLatin1Char(
'0') ));
335 emit
message(
"<font color=\"#FF0000\">ERROR receiving repeated header at byte no. 2 (SickS300::readRequestTelegram).</font>");
344 emit
message(QString(
"ERROR: answer byte no.3 was 0x%1 instead of 0x02.").arg( answer, 2, 16, QLatin1Char(
'0') ));
351 emit
message(
"<font color=\"#FF0000\">ERROR receiving repeated header at byte no. 3 (SickS300::readRequestTelegram).</font>");
360 emit
message(QString(
"ERROR: answer byte no.4 was 0x%1 instead of 0x22.").arg( answer, 2, 16, QLatin1Char(
'0') ));
367 emit
message(
"<font color=\"#FF0000\">ERROR receiving repeated header at byte no. 4 (SickS300::readRequestTelegram).</font>");
376 emit
message(QString(
"ERROR: answer byte no.5 was 0x%1 instead of 0xFF.").arg( answer, 2, 16, QLatin1Char(
'0') ));
383 emit
message(
"<font color=\"#FF0000\">ERROR receiving repeated header at byte no. 5 (SickS300::readRequestTelegram).</font>");
392 emit
message(QString(
"ERROR: answer byte no.6 was 0x%1 instead of 0x07.").arg( answer, 2, 16, QLatin1Char(
'0') ));
399 emit
message(
"<font color=\"#FF0000\">ERROR receiving repeated header at byte no. 6 (SickS300::readRequestTelegram).</font>");
412 emit
message(QString(
"ERROR: 1st answer byte was 0x%1 instead of 0x00.").arg( answer, 2, 16, QLatin1Char(
'0') ));
419 emit
message(
"<font color=\"#FF0000\">ERROR receiving 1st 'unknown byte' (SickS300::readRequestTelegram).</font>");
428 emit
message(QString(
"ERROR: 2nd answer byte was 0x%1 instead of 0x08.").arg( answer, 2, 16, QLatin1Char(
'0') ));
435 emit
message(
"<font color=\"#FF0000\">ERROR receiving 2nd 'unknown byte' (SickS300::readRequestTelegram).</font>");
454 emit
message(QString(
"<font color=\"#FF0000\">ERROR receiving scan data at byte no. %1 from %2 (SickS300::readRequestTelegram).</font>").arg(i+1).arg(LASERSAMPLES+1));
481 emit
message(QString(
"<font color=\"#FF0000\">ERROR receiving CRC at byte no. %1 (SickS300::readRequestTelegram).</font>").arg(i+1));
529 const unsigned char unknownCommand[]={0x00,0x00,0x45,0x44,0x0B,0x00,0x00,0x7B,0xFF,0x07};
530 unsigned char answer = 255;
543 emit
message(
"<font color=\"#FF0000\">ERROR flushing serial port (SickS300::readRequestTelegram).</font>");
548 emit
message(
"Sending 'read block 0B'...");
549 for (i=0; i<
sizeof(unknownCommand); i++)
551 if (
sendChar(unknownCommand[i]) ==
false)
553 emit
message( QString(
"ERROR sending byte no. %1.").arg(i+1) );
560 emit
message(
"Receiving answer...");
569 emit
message(QString(
"ERROR: answer byte no. %1 was 0x%2 instead 0x00").arg(i+1).arg(answer, 2, 16, QLatin1Char(
'0')));
576 emit
message(QString(
"ERROR receiving 00 00 00 00 answer at byte no. %1").arg(i+1));
583 emit
message(
"Reading repeated header...");
601 emit
message(QString(
"ERROR receiving repeated header at byte no. %1").arg(i+1));
608 emit
message(
"Now reading resulting unknown data...");
609 for (i=0; i<236; i++)
620 emit
message(QString(
"ERROR receiving scan data at byte no. %1").arg(i+1));
628 emit
message(
"Reading CRC...");
647 emit
message(QString(
"ERROR receiving CRC at byte no. %1").arg(i+1));
675 if ( (angleIndex<0) || (angleIndex>(270*2)) )
677 emit
message(QString(
"ERROR: angle index with %1 out of range (0 - 549) (SickS300::getDistance)").arg(angleIndex));