- Timestamp:
- 08/09/11 20:07:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11856 r11866 368 368 int patch() const { return (cbpx/10)%10; } 369 369 int pixel() const { return cbpx%10; } 370 int hw() const { return pixel()+patch()*9+board()*36+crate()*360; } 370 371 int group() const { return pixel()>4; } 371 372 int hv() const { return hv_channel+hv_board*32; } … … 441 442 PixelMap fPixelMap; 442 443 443 vector<int> fPixelMapHW; // Software -> Hardware444 vector<int> 444 //vector<int> fPixelMapHW; // Software -> Hardware 445 vector<int> fPatchMapHW; // Software -> Hardware 445 446 vector<int> fPatchHW; // Maps the software(!) pixel id to the hardware(!) patch id 446 447 … … 1584 1585 return; 1585 1586 1586 // static int cnt=0;1587 // if (cnt++%10>0)1588 // return;1589 1590 1587 const float *ptr = d.ptr<float>(); 1591 1592 // TCanvas *c = fEventCanv->GetCanvas();1593 Camera *cam1 = fEventCanv1;//(Camera*)c->GetPad(1)->FindObject("Camera");1594 Camera *cam2 = fEventCanv2;//(Camera*)c->GetPad(2)->FindObject("Camera");1595 Camera *cam3 = fEventCanv3;//(Camera*)c->GetPad(3)->FindObject("Camera");1596 Camera *cam4 = fEventCanv4;//(Camera*)c->GetPad(4)->FindObject("Camera");1597 1588 1598 1589 valarray<double> arr1(1440); … … 1601 1592 valarray<double> arr4(1440); 1602 1593 1603 for (int i=0; i<1440; i++) 1604 { 1605 arr1[i] = ptr[0*1440+fPixelMapHW[i]]; 1606 arr2[i] = ptr[1*1440+fPixelMapHW[i]]; 1607 arr3[i] = ptr[2*1440+fPixelMapHW[i]]; 1608 arr4[i] = ptr[3*1440+fPixelMapHW[i]]; 1609 } 1610 1611 cam1->SetData(arr1); 1612 cam2->SetData(arr2); 1613 cam3->SetData(arr3); 1614 cam4->SetData(arr4); 1615 1616 // c->GetPad(1)->Modified(); 1617 // c->GetPad(2)->Modified(); 1618 // c->GetPad(3)->Modified(); 1619 // c->GetPad(4)->Modified(); 1620 1621 // c->Update(); 1594 for (vector<PixelMapEntry>::const_iterator it=fPixelMap.begin(); it!=fPixelMap.end(); it++) 1595 { 1596 arr1[it->index] = ptr[0*1440+it->hw()]; 1597 arr2[it->index] = ptr[1*1440+it->hw()]; 1598 arr3[it->index] = ptr[2*1440+it->hw()]; 1599 arr4[it->index] = ptr[3*1440+it->hw()]; 1600 } 1601 1602 fEventCanv1->SetData(arr1); 1603 fEventCanv2->SetData(arr2); 1604 fEventCanv3->SetData(arr3); 1605 fEventCanv4->SetData(arr4); 1622 1606 } 1623 1607 … … 2302 2286 SetFtuStatusLed(d.time); 2303 2287 2304 2305 2306 for (int isw=0; isw<1440; isw++) 2307 { 2308 const int ihw = fPixelMapHW[isw]; 2309 fRatesCanv->SetEnable(isw, sdata.IsEnabled(ihw)); 2310 } 2311 2312 { 2313 const int isw = fPixelIdx->value(); 2314 const int ihw = fPixelMapHW[isw]; 2315 const bool on = sdata.IsEnabled(ihw); 2316 fPixelEnable->setChecked(on); 2317 } 2288 for (vector<PixelMapEntry>::const_iterator it=fPixelMap.begin(); it!=fPixelMap.end(); it++) 2289 fRatesCanv->SetEnable(it->index, sdata.IsEnabled(it->hw())); 2290 2291 const PixelMapEntry &entry = fPixelMap.index(fPixelIdx->value()); 2292 fPixelEnable->setChecked(sdata.IsEnabled(entry.index)); 2318 2293 2319 2294 if (fThresholdIdx->value()>=0) … … 3209 3184 { 3210 3185 fPixelIdx->setValue(isw); 3211 const uint16_t ihw = fPixelMapHW[isw]; 3212 const bool on = fFtmStaticData.IsEnabled(ihw);3213 fPixelEnable->setChecked( on);3186 3187 const PixelMapEntry &entry = fPixelMap.index(isw); 3188 fPixelEnable->setChecked(fFtmStaticData.IsEnabled(entry.hw())); 3214 3189 } 3215 3190 … … 3217 3192 { 3218 3193 fPixelIdx->setValue(isw); 3219 const uint16_t ihw = fPixelMapHW[isw]; 3220 Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", ihw); 3194 3195 const PixelMapEntry &entry = fPixelMap.index(isw); 3196 Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", uint16_t(entry.hw())); 3221 3197 } 3222 3198 3223 3199 void slot_CameraMouseMove(int isw) 3224 3200 { 3225 const int ihw = fPixelMapHW[isw]; 3201 const PixelMapEntry &entry = fPixelMap.index(isw); 3202 3203 const int ihw = entry.hw(); 3204 3226 3205 const int idx = fPatchHW[isw]; 3227 3206 int ii = 0; … … 3269 3248 void on_fPixelIdx_valueChanged(int isw) 3270 3249 { 3271 const int ihw = fPixelMapHW[isw];3272 3273 3250 int ii = 0; 3274 3251 for (; ii<160; ii++) … … 3279 3256 ChoosePatchThreshold(*fRatesCanv, ii); 3280 3257 3281 const bool on = fFtmStaticData.IsEnabled(ihw);3282 fPixelEnable->setChecked( on);3258 const PixelMapEntry &entry = fPixelMap.index(isw); 3259 fPixelEnable->setChecked(fFtmStaticData.IsEnabled(entry.hw())); 3283 3260 } 3284 3261 … … 3378 3355 return; 3379 3356 3380 const uint16_t isw = fPixelIdx->value(); 3381 const uint16_t ihw = fPixelMapHW[isw]; 3357 const PixelMapEntry &entry = fPixelMap.index(fPixelIdx->value()); 3382 3358 3383 3359 Dim::SendCommand(b==Qt::Unchecked ? 3384 3360 "FTM_CONTROL/DISABLE_PIXEL" : "FTM_CONTROL/ENABLE_PIXEL", 3385 ihw);3361 uint16_t(entry.hw())); 3386 3362 } 3387 3363 3388 3364 void on_fPixelDisableOthers_clicked() 3389 3365 { 3390 const uint16_t isw = fPixelIdx->value(); 3391 const uint16_t ihw = fPixelMapHW[isw]; 3392 3393 Dim::SendCommand("FTM_CONTROL/DISABLE_ALL_PIXELS_EXCEPT", ihw); 3366 const PixelMapEntry &entry = fPixelMap.index(fPixelIdx->value()); 3367 3368 Dim::SendCommand("FTM_CONTROL/DISABLE_ALL_PIXELS_EXCEPT", uint16_t(entry.hw())); 3394 3369 } 3395 3370 … … 3459 3434 FactGui(Configuration &conf) : 3460 3435 fFtuStatus(40), 3461 fPixelMapHW(1440),fPatchMapHW(160), fPatchHW(1440),3436 /*fPixelMapHW(1440),*/ fPatchMapHW(160), fPatchHW(1440), 3462 3437 fInChoosePatchTH(false), 3463 3438 fInChooseBiasHv(false), fInChooseBiasCam(false), … … 3634 3609 // -------------------------------------------------------------------------- 3635 3610 3611 /* 3636 3612 ifstream fin2("MasterList-v3.txt"); 3637 3613 … … 3662 3638 if (l!=1440) 3663 3639 cerr << "WARNING - Problems reading MasterList-v3.txt" << endl; 3664 3640 */ 3665 3641 // -------------------------------------------------------------------------- 3666 3642
Note:
See TracChangeset
for help on using the changeset viewer.