RS4Leuze_laser.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef RS4Leuze_laser_h
00029 #define RS4Leuze_laser_h
00030
00031 #include <termios.h>
00032 #include <sys/types.h>
00033 #include <sys/stat.h>
00034 #include <fcntl.h>
00035 #include <time.h>
00036 #include <sys/time.h>
00037 #include <stdlib.h>
00038
00039 using namespace std;
00040
00041 #define MAX_SCAN_POINTS 529
00042
00043
00044 typedef struct RS4Leuze_laser_readings {
00045 double Reading[MAX_SCAN_POINTS];
00046 } RS4Leuze_laser_readings_t;
00047
00048
00052 class Claser
00053 {
00054 private:
00055 char *portName;
00056 int serialFD;
00057 termios ttyset;
00058 fd_set rfds;
00059 int selectResult;
00060 unsigned char byte;
00061 unsigned char checksum;
00062 unsigned char option1;
00063 long unsigned int scan_number;
00064 unsigned int output_start;
00065 unsigned int output_stop;
00066 unsigned int scanedPoint;
00067 unsigned char controlByte;
00068 unsigned int points_to_scan;
00069 struct timeval tv;
00070 timeval timeStamp;
00072 public:
00073
00074
00075 Claser(int scan_points);
00076 ~Claser();
00077 void closeLaser();
00078 unsigned char readByte();
00079 void sync();
00080
00081 void writeConfig();
00082 int scanRead();
00083 void runLaser();
00084 void closeSerial();
00085 void openSerial(bool *laser_ON,int Baud_rate, const char * Port);
00086 RS4Leuze_laser_readings_t scanData;
00087
00088 };
00089
00090 #endif
00091
00092