//simple test program to check the PixelMap class //Q. Weitzel, ETH Zurich, December 14, 2010 #include "../../pixelmap/PixelMap.h" #include using namespace std; int main(){ cout << endl; cout << "==============================" << endl; cout << "PixelMap Test Program" << endl; cout << "==============================" << endl; cout << endl; cout << "Return value when asking for a non-existing pixel: " << PixelMap::PM_ERROR_CODE << endl; cout << endl; //PixelMap* pm = new PixelMap("", true); PixelMap* pm = new PixelMap("0: 0 0 0 0 0 2 0 0 0; 1: 0 0 0 1 0 0 1 -1 -1; 237: 0 0 0 2 0 0 1 0 -1;", true); pm->Print(); unsigned int fpa; fpa = pm->FPA_to_Pixel(0,0,0,0,true); cout << "PixelID: " << fpa << endl; fpa = pm->FPA_to_Pixel(0,1,0,0,true); cout << "PixelID: " << fpa << endl; fpa = pm->FPA_to_Pixel(0,0,0,0,true); cout << "PixelID: " << fpa << endl; vector hv; hv = pm->HV_to_Pixel(6,1,8,true); cout << hv.size() << " PixelIDs found: "; for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} cout << endl; hv = pm->HV_to_Pixel(6,9,1,true); cout << hv.size() << " PixelIDs found: "; for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} cout << endl; hv = pm->HV_to_Pixel(0,0,1,true); cout << hv.size() << " PixelIDs found: "; for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} cout << endl; hv = pm->HV_to_Pixel(0,0,1,true); cout << hv.size() << " PixelIDs found: "; for (unsigned int i=0; i < hv.size(); i++){cout << hv[i] << " ";} cout << endl; unsigned int pos; pos = pm->POS_to_Pixel(-1,-1,true); cout << "PixelID: " << pos << endl; pos = pm->POS_to_Pixel(-10,1,true); cout << "PixelID: " << pos << endl; unsigned int fpab; fpab = pm->Pixel_to_FPAboard(0,true); cout << "Board: " << fpab << endl; fpab = pm->Pixel_to_FPAboard(5,true); cout << "Board: " << fpab << endl; unsigned int hvboard; hvboard = pm->Pixel_to_HVboard(0,true); cout << "Board: " << hvboard << endl; hvboard = pm->Pixel_to_HVboard(5,true); cout << "Board: " << hvboard << endl; int posy; posy = pm->Pixel_to_POSy(1,true); cout << "POSy: " << posy << endl; posy = pm->Pixel_to_POSy(15,true); cout << "POSy: " << posy << endl; delete pm; return 0; }