/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Calibration/calibUtil/calibUtil-00-00-43/src/test/test_strips.cxx

Go to the documentation of this file.
00001 // $Header: /bes/bes/BossCvs/Calibration/calibUtil/src/test/test_strips.cxx,v 1.1.1.1 2005/10/17 06:12:26 maqm Exp $
00007 #include "calibUtil/StripSrv.h"
00008 #include "facilities/Util.h"
00009 
00010 #include <string>
00011 #include <iostream>
00012 #include <fstream>
00013 
00014 using calibUtil::StripCol;
00015 
00016 class MyObject : public calibUtil::ClientObject {
00017 
00018   virtual calibUtil::eVisitorRet badTower(unsigned int row, unsigned int col, 
00019                                           int badness);
00020   virtual calibUtil::eVisitorRet badPlane(unsigned int row, unsigned int col, 
00021                                           unsigned int tray, bool top,
00022                                           int badness, bool allBad,
00023                                           const StripCol& strips);
00024 };
00025 
00026 int main(int argc, char* argv[]) {
00027   using calibUtil::StripSrv;
00028 
00029   std::string name = "$(CALIBUTILROOT)/xml/test/testHot.xml";
00030   
00031   if (argc > 1) {
00032     name = std::string((argv[1]));
00033   }
00034   facilities::Util::expandEnvVar(&name);
00035 
00036   StripSrv ssObj(name);
00037 
00038   std::vector<StripSrv::towerRC> trc;
00039   ssObj.getBadTowers(trc);   
00040   for (unsigned int i = 0; i < trc.size(); i++ ) {
00041     std::cout << "Tower id is (" << trc[i].row << ", " << trc[i].col;
00042     std::cout << ")" << std::endl;
00043 
00044   }
00045   std::cout << std::endl;
00046 
00047   std::cout<< "Bad type is " << (int) ssObj.getBadType() << std::endl;
00048 
00049   std::cout << "calType name is " << ssObj.getCalType() << std::endl;
00050 
00051   MyObject cli;
00052   ssObj.traverseInfo(&cli);
00053 
00054   return(0);
00055 
00056 } /* end of main */
00057 
00058 
00059 calibUtil::eVisitorRet MyObject::badTower(unsigned int row, unsigned int col,
00060                                           int badness) {
00061   
00062   std::cout << "MyObject::badTower called back for tower (" << row
00063            << ", " << col << ") badness = " << badness << std::endl;
00064   return calibUtil::CONT;
00065 }
00066 
00067 calibUtil::eVisitorRet MyObject::badPlane(unsigned int row, unsigned int col, 
00068                                           unsigned int tray, bool top,
00069                                           int badness, bool allBad,
00070                                           const calibUtil::StripCol& strips) {
00071 
00072   std::cout << "MyObject::badPlane called back for tower (" << row
00073             << ", " << col << ") tray = " << tray << " top = " 
00074             << top <<std::endl;
00075   std::cout << "badness = " << badness << " allBad = " << allBad << std::endl;
00076   std::cout << "#strips in strip collection = " << strips.size() << std::endl;
00077 
00078   return calibUtil::CONT;
00079 }

Generated on Tue Nov 29 22:57:55 2016 for BOSS_7.0.2 by  doxygen 1.4.7