Generic hardware access library
/home/cschwick/hal/generic/classtester/src/common/VME64xMixedCrateTester.cc
Go to the documentation of this file.
00001 #include "VME64xMixedCrateTester.hh"
00002 
00003 HAL::VME64xMixedCrateTester::VME64xMixedCrateTester( string configSpaceDefinitionFile,
00004                                                 string moduleMapperFile,
00005                                                 string addressTableContainerFile,
00006                                                 string staticConfigurationFile)
00007   throw( HAL::IllegalValueException,
00008          HAL::NoSuchFileException,
00009          HAL::XMLProcessingException )
00010   : busAdapter_( configSpaceDefinitionFile, 
00011                  HAL::VME64xDummyBusAdapter::VERBOSE_OFF, 
00012                  HAL::VME64xDummyBusAdapter::MEMORY_MAP_ON ),
00013     moduleMapper_(moduleMapperFile),
00014     addressTableContainer_(moduleMapper_,
00015                            addressTableContainerFile),
00016     staticConfigurationFilerReader_(staticConfigurationFile),
00017     staticVMEConfiguration_(staticConfigurationFilerReader_) {
00018 }
00019 
00020 bool HAL::VME64xMixedCrateTester::execute() {
00021   bool result = true;
00022   try {
00023     HAL::VME64xCrate vmeCrate( busAdapter_,
00024                           addressTableContainer_,
00025                           moduleMapper_,
00026                           staticVMEConfiguration_);
00027     vmeCrate.printAddressMap( cout );
00028     // try again: the crate should not be reconfigured but the
00029     // configuration should just be read out of the modules.
00030     HAL::VME64xCrate vmeCrate2( busAdapter_,
00031                            addressTableContainer_,
00032                            moduleMapper_,
00033                            staticVMEConfiguration_);
00034     vmeCrate2.printAddressMap( std::cout );
00035   } catch( HAL::HardwareAccessException& e) {
00036     std::cout << "unexpected exception: test failed:" << std::endl;
00037     std::cout << e.what();
00038     result = false;
00039   }
00040   return result;
00041 }
00042 
00043 string HAL::VME64xMixedCrateTester::getName() const {
00044   return "VME64xMixedCrateTester";
00045 }
00046 
00047 string HAL::VME64xMixedCrateTester::getDescription() const {
00048   return "Performs a test of the HAL::VME64xCrate with a fixed standard VME configuration";
00049 }