11 #ifndef CARMA_TIPPER_TIPPERCONTROL_H
12 #define CARMA_TIPPER_TIPPERCONTROL_H
20 #include "carma/util/Program.h"
22 #include "carma/util/ExceptionUtils.h"
25 #include "carma/util/Logger.h"
27 #include "carma/util/ScopedPthreadMutexLock.h"
30 #include "carma/monitor/OpacityMonitorSubsystem.h"
36 class TipperControlThread
40 TipperControlThread( ::std::string device, ::std::string dataDir,
41 double autoWriterDelayInS,
bool emulate );
67 static const int _numAirmasses = 12;
68 static const TipperAngles _tipAngles[_numAirmasses];
71 void openPort( ::std::string device );
72 void setDirection( TipperDirection dir );
74 void doStep(
int numsteps );
75 void readAllChannels( TipData &tipData );
76 void convertAndScaleChannels( TipData &tipData );
79 void sendTipperCommand();
80 void sendTipperPrefix();
81 void doMeasurement( TipData *tipData );
82 void getCurrentFileName( ::std::string &theName );
83 void writeToFile( TipData *tipData );
84 void readOneChannel(
char channel,
float &chanData );
85 void doAvgSignalRef( TipData &tipData );
87 TipperStatus getStatus() {
return _status; };
88 void setStatus( TipperStatus status );
91 void setPortTimeout(
int seconds );
92 void clearReadBuffer();
100 void setParity(
enum Parity );
101 void write(
const char * buff,
size_t count );
105 ::std::string _portDevName;
106 ::std::string _dataDir;
108 double _autoWriterDelayInS;
109 ::std::auto_ptr< ::carma::monitor::OpacityMonitorSubsystem > _monitor;
111 log4cpp::Category &_logger;
113 char _loDataByte, _command[4];
115 struct termios _tios;
116 struct termios _oldtios;
118 TipperStatus _status;
126 ::std::ostream&
operator<<( ::std::ostream& os,
127 ::carma::tipper::TipperControlThread& tControl );
129 #endif // CARMA_TIPPER_TIPPERCONTROL_H
std::ostream & operator<<(::std::ostream &os, const carma::dbms::Table &table)
Exception class for errors.
Interface file for the carma::util::Trace class and related macros.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
This is the interface file for extra APIs for program logging.