Changeset 10985 for trunk/FACT++/gui
- Timestamp:
- 06/10/11 15:28:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10982 r10985 334 334 vector<int> fPixelMapHW; // Software -> Hardware 335 335 vector<int> fPatchMapHW; // Software -> Hardware 336 vector<int> fPatchHW; // Maps the software(!) pixel id to the hardware(!) patch id 336 337 337 338 bool fInChoosePatch; // FIXME. Find a better solution … … 1167 1168 for (int i=0; i<1440; i++) 1168 1169 { 1169 const int isw = fPatch[i]; 1170 const int ihw = fPatchMapHW[isw]; 1170 const int ihw = fPatchHW[i]; 1171 // const int isw = fPatch[i]; 1172 // const int ihw = fPatchMapHW[isw]; 1171 1173 dat[i] = sdata.fRatePatch[ihw]; 1172 1174 } … … 1926 1928 const int ihw = fPixelMapHW[isw]; 1927 1929 1928 const int idx = fPatch[isw]; 1930 const int idx = fPatchHW[isw]; 1931 1932 int ii = 0; 1933 for (; ii<160; ii++) 1934 if (idx==fPatchMapHW[ii]) 1935 break; 1936 1929 1937 1930 1938 const int patch = ihw%4; … … 1933 1941 1934 1942 ostringstream str; 1935 str << " (hw=" << ihw << ") Patch=" << i dx<< " (hw=" << fPatchMapHW[idx] << "; Crate=" << crate << " Board=" << board << " Patch=" << patch << ")";1943 str << " (hw=" << ihw << ") Patch=" << ii << " (hw=" << fPatchMapHW[idx] << "; Crate=" << crate << " Board=" << board << " Patch=" << patch << ")"; 1936 1944 1937 1945 tipText += str.str().c_str(); … … 1983 1991 1984 1992 // Loop over the software idx of all pixels 1985 for (unsigned int i=0; i< fPatch.size(); i++)1986 if (fPatch [i]==isw)1993 for (unsigned int i=0; i<1440; i++) 1994 if (fPatchHW[i]==ihw) 1987 1995 cam.SetBold(i); 1988 1996 } … … 1990 1998 void ChoosePixel(Camera &cam, int isw) 1991 1999 { 2000 const int ihw = fPixelMapHW[isw]; 2001 2002 int ii = 0; 2003 for (; ii<160; ii++) 2004 if (fPatchHW[isw]==fPatchMapHW[ii]) 2005 break; 2006 1992 2007 cam.SetWhite(isw); 1993 ChoosePatch(cam, fPatch[isw]); 1994 1995 const int ihw = fPixelMapHW[isw]; 2008 ChoosePatch(cam, ii); 2009 1996 2010 const bool on = fFtmStaticData.IsEnabled(ihw); 1997 2011 fPixelEnable->setChecked(on); … … 2100 2114 TGraph fGraphPatchRate[160]; 2101 2115 TGraph fGraphBoardRate[40]; 2102 2103 map<int, int> fPatch;2104 2116 2105 2117 #ifdef HAVE_ROOT … … 2130 2142 public: 2131 2143 FactGui() : 2132 fFtuStatus(40), fPixelMapHW(1440), fPatchMapHW(160), 2133 fInChoosePatch(false), 2144 fFtuStatus(40), 2145 fPixelMapHW(1440), fPatchMapHW(160), fPatchHW(1440), 2146 fInChoosePatch(false), 2134 2147 fDimDNS("DIS_DNS/VERSION_NUMBER", 1, int(0), this), 2135 2148 … … 2166 2179 // -------------------------------------------------------------------------- 2167 2180 2168 ifstream fin1(" fact-trigger-all.txt");2181 ifstream fin1("Trigger-Patches.txt"); 2169 2182 2170 2183 int l = 0; … … 2180 2193 for (int i=0; i<9; i++) 2181 2194 { 2182 int n;2195 unsigned int n; 2183 2196 str >> n; 2184 2197 2185 fPatch[n] = l; 2198 if (n>=fPatchHW.size()) 2199 continue; 2200 2201 fPatchHW[n] = l; 2186 2202 } 2187 2203 l++; … … 2200 2216 continue; 2201 2217 2202 int softid, hardid, dummy;2218 unsigned int softid, hardid, dummy; 2203 2219 2204 2220 stringstream str(buf); … … 2208 2224 str >> hardid; 2209 2225 2226 if (softid>=fPixelMapHW.size()) 2227 continue; 2228 2210 2229 fPixelMapHW[softid] = hardid; 2211 2230 … … 2225 2244 continue; 2226 2245 2227 int softid, hardid;2246 unsigned int softid, hardid; 2228 2247 2229 2248 stringstream str(buf); … … 2231 2250 str >> softid; 2232 2251 str >> hardid; 2252 2253 if (softid>=fPatchMapHW.size()) 2254 continue; 2233 2255 2234 2256 fPatchMapHW[softid] = hardid-1;
Note:
See TracChangeset
for help on using the changeset viewer.