RS4Leuze_laser.h
00001
00008 #ifndef RS4Leuze_laser_h
00009 #define RS4Leuze_laser_h
00010
00011 #include <termios.h>
00012 #include <sys/types.h>
00013 #include <sys/stat.h>
00014 #include <fcntl.h>
00015 #include <time.h>
00016 #include <sys/time.h>
00017 #include <stdlib.h>
00018
00019 using namespace std;
00020
00021 #define MAX_SCAN_POINTS 529
00022
00023
00024 typedef struct RS4Leuze_laser_readings {
00025 double Reading[MAX_SCAN_POINTS];
00026 } RS4Leuze_laser_readings_t;
00027
00028
00032 class Claser
00033 {
00034 private:
00035 char *portName;
00036 int serialFD;
00037 termios ttyset;
00038 fd_set rfds;
00039 int selectResult;
00040 unsigned char byte;
00041 unsigned char checksum;
00042 unsigned char option1;
00043 long unsigned int scan_number;
00044 unsigned int output_start;
00045 unsigned int output_stop;
00046 unsigned int scanedPoint;
00047 unsigned char controlByte;
00048 unsigned int points_to_scan;
00049 struct timeval tv;
00050 timeval timeStamp;
00052 public:
00053
00054
00055 Claser(int scan_points);
00056 ~Claser();
00057 void closeLaser();
00058 unsigned char readByte();
00059 void sync();
00060
00061 void writeConfig();
00062 int scanRead();
00063 void runLaser();
00064 void closeSerial();
00065 void openSerial(bool *laser_ON,int Baud_rate, const char * Port);
00066 RS4Leuze_laser_readings_t scanData;
00067
00068 };
00069
00070 #endif
00071
00072