Changeset 11779 for trunk/FACT++
- Timestamp:
- 08/05/11 10:47:44 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11778 r11779 32 32 #include "TColor.h" 33 33 34 #include "QCameraWidget.h" 35 34 36 using namespace std; 35 37 36 38 // ######################################################################### 37 39 40 /* 38 41 class Camera : public TObject 39 42 { … … 45 48 void CreatePalette() 46 49 { 47 /* 48 double ss[5] = {0., 0.10, 0.45, 0.75, 1.00}; 49 double rr[5] = {0., 0.35, 0.85, 1.00, 1.00}; 50 double gg[5] = {0., 0.10, 0.20, 0.73, 1.00}; 51 double bb[5] = {0., 0.03, 0.06, 0.00, 1.00}; 52 */ 50 53 51 double ss[5] = {0.00, 0.25, 0.50, 0.75, 1.00}; 54 52 double rr[5] = {0.15, 0.00, 0.00, 1.00, 0.85}; … … 353 351 } 354 352 }; 355 353 */ 356 354 // ######################################################################### 357 355 … … 1867 1865 } 1868 1866 1869 TCanvas *c = fRatesCanv->GetCanvas();1870 Camera *cam = (Camera*)c->FindObject("Camera");1871 1872 cam->SetData(dat);1873 1874 c->Modified();1875 c->Update();1867 // TCanvas *c = fRatesCanv->GetCanvas(); 1868 // Camera *cam = (Camera*)c->FindObject("Camera"); 1869 1870 fRatesCanv->SetData(dat); 1871 1872 // c->Modified(); 1873 // c->Update(); 1876 1874 #endif 1877 1875 } … … 2167 2165 2168 2166 #ifdef HAVE_ROOT 2169 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera");2167 // Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 2170 2168 for (int isw=0; isw<1440; isw++) 2171 2169 { 2172 2170 const int ihw = fPixelMapHW[isw]; 2173 cam->SetEnable(isw, sdata.IsEnabled(ihw));2174 } 2175 2176 fRatesCanv->GetCanvas()->Modified();2177 fRatesCanv->GetCanvas()->Update();2171 fRatesCanv->SetEnable(isw, sdata.IsEnabled(ihw)); 2172 } 2173 2174 // fRatesCanv->GetCanvas()->Modified(); 2175 // fRatesCanv->GetCanvas()->Update(); 2178 2176 #endif 2179 2177 … … 2763 2761 // kEnterEvent // TCanvas processed QEvent enterEvent 2764 2762 // kLeaveEvent // TCanvas processed QEvent leaveEvent 2763 2765 2764 if (dynamic_cast<TCanvas*>(obj)) 2766 2765 return; … … 2774 2773 const float xx = canv->AbsPixeltoX(tipped->GetEventX()); 2775 2774 const float yy = canv->AbsPixeltoY(tipped->GetEventY()); 2776 2777 Camera *cam = static_cast<Camera*>(obj);2778 const int isw = cam->GetIdx(xx, yy);2779 2780 fPixelIdx->setValue(isw);2781 ChoosePixel(*cam, isw);2775 //ETIENNE MESS HERE 2776 // Camera *cam = static_cast<Camera*>(obj); 2777 // const int isw = cam->GetIdx(xx, yy); 2778 2779 // fPixelIdx->setValue(isw); 2780 // ChoosePixel(*cam, isw); 2782 2781 } 2783 2782 return; … … 2790 2789 const float xx = canv->AbsPixeltoX(tipped->GetEventX()); 2791 2790 const float yy = canv->AbsPixeltoY(tipped->GetEventY()); 2792 2793 Camera *cam = static_cast<Camera*>(obj);2794 const int isw = cam->GetIdx(xx, yy);2795 2796 ChoosePixel(*cam, isw);2797 2798 fPixelIdx->setValue(isw);2799 2800 const uint16_t ihw = fPixelMapHW[isw];2801 2802 Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", ihw);2791 //ETIENNE MESS HERE 2792 // Camera *cam = static_cast<Camera*>(obj); 2793 // const int isw = cam->GetIdx(xx, yy); 2794 2795 // ChoosePixel(*cam, isw); 2796 2797 // fPixelIdx->setValue(isw); 2798 2799 // const uint16_t ihw = fPixelMapHW[isw]; 2800 2801 // Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", ihw); 2803 2802 } 2804 2805 2803 if (dynamic_cast<TAxis*>(obj)) 2806 2804 static_cast<TAxis*>(obj)->UnZoom(); … … 2837 2835 const float yy = canv->AbsPixeltoY(tipped->GetEventY()); 2838 2836 2839 Camera *cam = static_cast<Camera*>(obj); 2840 2841 const int isw = cam->GetIdx(xx, yy); 2842 const int ihw = fPixelMapHW[isw]; 2843 2844 const int idx = fPatchHW[isw]; 2845 2846 int ii = 0; 2847 for (; ii<160; ii++) 2848 if (idx==fPatchMapHW[ii]) 2849 break; 2850 2851 2852 const int patch = ihw%4; 2853 const int board = (ihw/4)%10; 2854 const int crate = (ihw/4)/10; 2855 2856 ostringstream str; 2857 str << " (hw=" << ihw << ") Patch=" << ii << " (hw=" << fPatchMapHW[idx] << "; Crate=" << crate << " Board=" << board << " Patch=" << patch << ")"; 2858 2859 tipText += str.str().c_str(); 2837 //ETIENNE MESS HERE 2838 // Camera *cam = static_cast<Camera*>(obj); 2839 2840 // const int isw = cam->GetIdx(xx, yy); 2841 // const int ihw = fPixelMapHW[isw]; 2842 2843 // const int idx = fPatchHW[isw]; 2844 2845 // int ii = 0; 2846 // for (; ii<160; ii++) 2847 // if (idx==fPatchMapHW[ii]) 2848 // break; 2849 2850 2851 // const int patch = ihw%4; 2852 // const int board = (ihw/4)%10; 2853 // const int crate = (ihw/4)/10; 2854 2855 // ostringstream str; 2856 // str << " (hw=" << ihw << ") Patch=" << ii << " (hw=" << fPatchMapHW[idx] << "; Crate=" << crate << " Board=" << board << " Patch=" << patch << ")"; 2857 2858 // tipText += str.str().c_str(); 2860 2859 } 2861 2860 fStatusBar->showMessage(tipText, 3000); … … 2926 2925 fPixelEnable->setChecked(on); 2927 2926 } 2928 2927 void slot_ChoosePixel(int isw) 2928 { 2929 fPixelIdx->setValue(isw); 2930 const uint16_t ihw = fPixelMapHW[isw]; 2931 const bool on = fFtmStaticData.IsEnabled(ihw); 2932 fPixelEnable->setChecked(on); 2933 } 2934 void slot_CameraDoubleClick(int isw) 2935 { 2936 fPixelIdx->setValue(isw); 2937 const uint16_t ihw = fPixelMapHW[isw]; 2938 Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", ihw); 2939 } 2940 void slot_CameraMouseMove(int isw) 2941 { 2942 const int ihw = fPixelMapHW[isw]; 2943 const int idx = fPatchHW[isw]; 2944 int ii = 0; 2945 for (; ii<160;ii++) 2946 if (idx ==fPatchMapHW[ii]) 2947 break; 2948 2949 const int patch = ihw%4; 2950 const int board = (ihw/4)%10; 2951 const int crate = (ihw/4)/10; 2952 QString tipText; 2953 tipText += fRatesCanv->GetName(); 2954 tipText += " ["; 2955 tipText += "QCameraWidget"; 2956 tipText += "]: "; 2957 ostringstream str; 2958 str << " (hw=" << ihw << ") Patch=" << ii << " (hw=" << fPatchMapHW[idx] << "; Crate=" << crate << " Board=" << board << " Patch=" << patch << ")"; 2959 tipText += str.str().c_str(); 2960 fStatusBar->showMessage(tipText, 3000); 2961 } 2929 2962 void UpdatePatch(int isw) 2930 2963 { 2931 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 2932 ChoosePatch(*cam, isw); 2964 //ETIENNE MESS HERE 2965 // Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 2966 // ChoosePatch(*cam, isw); 2933 2967 } 2934 2968 … … 2937 2971 UpdatePatch(isw); 2938 2972 2939 fRatesCanv->GetCanvas()->Modified();2940 fRatesCanv->GetCanvas()->Update();2973 // fRatesCanv->GetCanvas()->Modified(); 2974 // fRatesCanv->GetCanvas()->Update(); 2941 2975 } 2942 2976 … … 2975 3009 void on_fPixelIdx_valueChanged(int isw) 2976 3010 { 2977 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 2978 ChoosePixel(*cam, isw); 2979 2980 fRatesCanv->GetCanvas()->Modified(); 2981 fRatesCanv->GetCanvas()->Update(); 3011 //ETIENNE MESS HERE 3012 // Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 3013 // ChoosePixel(*cam, isw); 3014 ChoosePixel(*fRatesCanv, isw); 3015 3016 // fRatesCanv->GetCanvas()->Modified(); 3017 // fRatesCanv->GetCanvas()->Update(); 2982 3018 } 2983 3019 2984 3020 void on_fRatesMin_valueChanged(int min) 2985 3021 { 2986 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 2987 cam->SetMin(min); 2988 2989 fRatesCanv->GetCanvas()->Modified(); 2990 fRatesCanv->GetCanvas()->Update(); 3022 //ETIENNE MESS HERE 3023 // Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 3024 // cam->SetMin(min); 3025 fRatesCanv->SetMin(min); 3026 3027 // fRatesCanv->GetCanvas()->Modified(); 3028 // fRatesCanv->GetCanvas()->Update(); 2991 3029 } 2992 3030 2993 3031 void on_fRatesMax_valueChanged(int max) 2994 3032 { 2995 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 2996 cam->SetMax(max); 2997 2998 fRatesCanv->GetCanvas()->Modified(); 2999 fRatesCanv->GetCanvas()->Update(); 3033 //ETIENNE MESS HERE 3034 // Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 3035 // cam->SetMax(max); 3036 fRatesCanv->SetMax(max); 3037 3038 // fRatesCanv->GetCanvas()->Modified(); 3039 // fRatesCanv->GetCanvas()->Update(); 3000 3040 } 3001 3041 … … 3286 3326 c->cd(); 3287 3327 */ 3288 //CreateTimeFrame("Temperature / °C");3328 //CreateTimeFrame("Temperature / �C"); 3289 3329 3290 3330 fGraphFtmTemp[0].SetMarkerStyle(kFullDotSmall); … … 3326 3366 // -------------------------------------------------------------------------- 3327 3367 3328 c = fRatesCanv->GetCanvas(); 3368 //ETIENNE MESS HERE 3369 // c = fRatesCanv->GetCanvas(); 3329 3370 //c->SetBit(TCanvas::kNoContextMenu); 3330 c->SetBorderMode(0);3331 c->SetFrameBorderMode(0);3332 c->SetFillColor(kWhite);3333 c->cd();3334 3335 Camera *cam = new Camera;3336 cam->SetBit(kCanDelete);3371 // c->SetBorderMode(0); 3372 // c->SetFrameBorderMode(0); 3373 // c->SetFillColor(kWhite); 3374 // c->cd(); 3375 3376 Camera *cam = fRatesCanv;//new Camera; 3377 // cam->SetBit(kCanDelete); 3337 3378 cam->SetMin(fRatesMin->value()); 3338 3379 cam->SetMax(fRatesMax->value()); 3339 cam->Draw(); 3380 // cam->Draw(); 3381 cam->updateGL(); 3340 3382 3341 3383 ChoosePixel(*cam, 0); … … 3364 3406 gPad->SetFrameBorderMode(0); 3365 3407 gPad->SetFillColor(kWhite); 3366 Camera *cam1 = new Camera; 3367 cam1->SetBit(kCanDelete); 3368 cam1->Draw(); 3408 //ETIENNE MESS HERE 3409 // Camera *cam1 = new Camera; 3410 // cam1->SetBit(kCanDelete); 3411 // cam1->Draw(); 3369 3412 c->cd(2); 3370 3413 gPad->SetBorderMode(0); 3371 3414 gPad->SetFrameBorderMode(0); 3372 3415 gPad->SetFillColor(kWhite); 3373 Camera *cam2 = new Camera;3374 cam2->SetBit(kCanDelete);3375 cam2->Draw();3416 // Camera *cam2 = new Camera; 3417 // cam2->SetBit(kCanDelete); 3418 // cam2->Draw(); 3376 3419 c->cd(3); 3377 3420 gPad->SetBorderMode(0); 3378 3421 gPad->SetFrameBorderMode(0); 3379 3422 gPad->SetFillColor(kWhite); 3380 Camera *cam3 = new Camera;3381 cam3->SetBit(kCanDelete);3382 cam3->Draw();3423 // Camera *cam3 = new Camera; 3424 // cam3->SetBit(kCanDelete); 3425 // cam3->Draw(); 3383 3426 c->cd(4); 3384 3427 gPad->SetBorderMode(0); 3385 3428 gPad->SetFrameBorderMode(0); 3386 3429 gPad->SetFillColor(kWhite); 3387 Camera *cam4 = new Camera;3388 cam4->SetBit(kCanDelete);3389 cam4->Draw();3430 // Camera *cam4 = new Camera; 3431 // cam4->SetBit(kCanDelete); 3432 // cam4->Draw(); 3390 3433 3391 3434 … … 3407 3450 3408 3451 fRatesCanv->setMouseTracking(true); 3409 fRatesCanv->EnableSignalEvents(kMouseMoveEvent|kMouseReleaseEvent|kMouseDoubleClickEvent); 3410 3411 connect(fRatesCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 3412 this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); 3452 //ETIENNE MESS HERE 3453 // fRatesCanv->EnableSignalEvents(kMouseMoveEvent|kMouseReleaseEvent|kMouseDoubleClickEvent); 3454 // connect(fRatesCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 3455 // this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); 3456 connect(fRatesCanv, SIGNAL(signalPixelMoveOver(int)), 3457 this, SLOT(slot_CameraMouseMove(int))); 3458 connect(fRatesCanv, SIGNAL(signalPixelDoubleClick(int)), 3459 this, SLOT(slot_CameraDoubleClick(int))); 3460 connect(fRatesCanv, SIGNAL(signalCurrentPixel(int)), 3461 this, SLOT(slot_ChoosePixel(int))); 3413 3462 connect(fFtmRateCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 3414 3463 this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); -
trunk/FACT++/gui/MainWindow.h
r11707 r11779 188 188 virtual void slot_RootEventProcessed(TObject *, unsigned int, TCanvas *) = 0; 189 189 virtual void slot_RootUpdate() = 0; 190 virtual void slot_ChoosePixel(int) = 0; 191 virtual void slot_CameraDoubleClick(int) = 0; 192 virtual void slot_CameraMouseMove(int) = 0; 190 193 191 194 void slot_TimeUpdate(); -
trunk/FACT++/gui/design.ui
r11776 r11779 2805 2805 </property> 2806 2806 <item row="0" column="0"> 2807 <widget class=" RootWidget" name="fRatesCanv" native="true"/>2807 <widget class="QCameraWidget" name="fRatesCanv" native="true"/> 2808 2808 </item> 2809 2809 </layout> … … 9873 9873 <header>RootWidget.h</header> 9874 9874 <container>1</container> 9875 </customwidget> 9876 <customwidget> 9877 <class>QGLWidget</class> 9878 <extends>QWidget</extends> 9879 <header>QtOpenGL/QGLWidget</header> 9880 </customwidget> 9881 <customwidget> 9882 <class>BasicGlCamera</class> 9883 <extends>QGLWidget</extends> 9884 <header>BasicGlCamera.h</header> 9885 </customwidget> 9886 <customwidget> 9887 <class>QCameraWidget</class> 9888 <extends>BasicGlCamera</extends> 9889 <header>QCameraWidget.h</header> 9875 9890 </customwidget> 9876 9891 <customwidget>
Note:
See TracChangeset
for help on using the changeset viewer.