Generic hardware access library
/home/cschwick/hal/generic/classtester/src/common/PollItemCommandTester.cc
Go to the documentation of this file.
00001 #include "PollItemCommandTester.hh"
00002 
00003 std::string HAL::PollItemCommandTester::getDescription() const {
00004   std::string result = "Tests if a sequence can be constructed and run";
00005   return result;
00006 }
00007 
00008 bool HAL::PollItemCommandTester::execute() {
00009   bool result = true;
00010   try {
00011     HAL::VMEDummyBusAdapter busAdapter(HAL::VMEDummyBusAdapter::VERBOSE_OFF,
00012                                   HAL::VMEDummyBusAdapter::MEMORY_MAP_ON);
00013     HAL::VMEAddressTableASCIIReader addressTableReader ( ADDRESSTABLE );
00014     HAL::VMEAddressTable addressTable( "Test Table", addressTableReader );
00015     HAL::VMEDevice device(addressTable, busAdapter, 0 );
00016     
00017     HAL::CommandSequenceASCIIReader sequenceReader( SEQUENCE );
00018     HAL::CommandSequence sequence( "testSequence", sequenceReader, addressTable );
00019     
00020     sequence.run( device );
00021     std::cout << "seq has run" << std::endl;
00022   } catch( HAL::HardwareAccessException &e ) {
00023     std::cout << e.what() << std::endl;
00024     result = false;
00025   }
00026   return result;
00027 }