1 #ifndef CARMA_PHASEMONITORDEVICE_H
2 #define CARMA_PHASEMONITORDEVICE_H
16 namespace phasemonitor
18 class PhaseMonitorDevice
21 PhaseMonitorDevice( const ::std::string & device,
23 const ::std::string & record,
24 bool testBadVolts =
false,
25 const ::std::string replay =
"" );
27 ::std::string getDeviceFileName();
29 void devopen( const ::std::string & device );
31 void command( const ::std::string & command );
32 ::std::string inquire(
const std::string & question );
34 bool testBadVolts() {
return _testBadVolts; };
35 void setTestBadVolts(
bool t ) { _testBadVolts = t; };
37 void queryVoltages(
float *voltages );
38 float queryTemperatureC();
40 bool isReplay() {
return _replay; };
44 void testSleepSomeNanos();
45 bool testBadStartOfReply();
47 float convertStringToFloat( const ::std::string & value,
48 const ::std::string & context );
49 ::std::string getRecordName() {
return _recordName; };
52 ::std::string replay();
53 std::string::size_type startOfReply( const ::std::string & reply );
55 log4cpp::Category & _log;
56 const bool _logQuestionsAndReplies;
58 ::std::string _devFileName;
59 ::std::string _replayFileName;
63 ::std::ifstream _replayFile;
65 ::std::string _recordName;
66 ::std::ofstream _rstream;
68 int _masterPTfd, _slavePTfd;
73 ::std::ostream&
operator<<( ::std::ostream& os,
74 ::carma::phasemonitor::PhaseMonitorDevice &dev );
76 #endif // CARMA_PHASEMONITORDEVICE_H
std::ostream & operator<<(::std::ostream &os, const carma::dbms::Table &table)