Changeset 10733
- Timestamp:
- 05/17/11 20:22:02 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10728 r10733 866 866 fFtmTime->setText(QString::number(sdata.fTimeStamp)); 867 867 fTriggerCounter->setText(QString::number(sdata.fTriggerCounter)); 868 869 870 // ---------------------------------------------- 871 #ifdef HAVE_ROOT 872 873 if (fTriggerCounter0<0) 874 { 875 fTriggerCounter0 = sdata.fTriggerCounter; 876 return; 877 } 878 879 TCanvas *c = fFtmRateCanv->GetCanvas(); 880 881 TH1 *h = (TH1*)c->FindObject("TimeFrame"); 882 883 const double rate = sdata.fTriggerCounter-fTriggerCounter0; 884 fTriggerCounter0 = sdata.fTriggerCounter; 885 886 if (rate<0) 887 { 888 fGraphFtmRate.Set(0); 889 890 const double tm = Time().RootTime(); 891 892 h->SetBins(1, tm, tm+60); 893 h->GetXaxis()->SetTimeFormat("%M'%S\""); 894 h->GetXaxis()->SetTitle("Time"); 895 896 c->Modified(); 897 c->Update(); 898 return; 899 } 900 901 const double avgrate = sdata.fTimeStamp>0 ? double(sdata.fTriggerCounter)/sdata.fTimeStamp : 1; 902 903 const double t1 = h->GetXaxis()->GetXmax(); 904 const double t0 = h->GetXaxis()->GetXmin(); 905 906 h->SetBins(h->GetNbinsX()+1, t0, t0+sdata.fTriggerCounter+1); 907 fGraphFtmRate.SetPoint(fGraphFtmRate.GetN(), 908 t0+sdata.fTriggerCounter, rate); 909 910 if (t1-t0>60) 911 { 912 h->GetXaxis()->SetTimeFormat("%Hh%M'"); 913 h->GetXaxis()->SetTitle("Time"); 914 } 915 916 h->SetMinimum(0); 917 h->SetMaximum(2*avgrate); 918 919 c->Modified(); 920 c->Update(); 921 #endif 922 // ---------------------------------------------- 868 923 } 869 924 … … 889 944 } 890 945 946 int64_t fTriggerCounter0; 947 891 948 void handleFtmDynamicData(const DimData &d) 892 949 { … … 911 968 912 969 970 #ifdef HAVE_ROOT 971 913 972 // ---------------------------------------------- 914 #ifdef HAVE_ROOT 973 /* 915 974 TCanvas *c = fFtmTempCanv->GetCanvas(); 916 975 … … 920 979 double tm = d.time.RootTime(); 921 980 922 TH1 *h = (TH1*)c->FindObject(" MyFrame");981 TH1 *h = (TH1*)c->FindObject("TimeFrame"); 923 982 h->FindBin(tm); 924 983 … … 930 989 c->Modified(); 931 990 c->Update(); 932 991 */ 933 992 // ---------------------------------------------- 934 993 … … 938 997 dat[i] = sdata.fRatePatch[fPatch[i]]; 939 998 940 c = fRatesCanv->GetCanvas();999 TCanvas *c = fRatesCanv->GetCanvas(); 941 1000 Camera *cam = (Camera*)c->FindObject("Camera"); 942 1001 … … 1057 1116 cam->SetEnable(i, sdata.IsEnabled(i)); 1058 1117 #endif 1118 1119 fPixelEnable->setChecked(sdata.IsEnabled(fPixelIdx->value())); 1059 1120 1060 1121 const int patch1 = fThresholdIdx->value(); … … 1527 1588 cam.SetWhite(idx); 1528 1589 ChoosePatch(cam, fPatch[idx]); 1590 1591 fPixelEnable->setChecked(fFtmStaticData.IsEnabled(idx)); 1529 1592 } 1530 1593 … … 1555 1618 1556 1619 ChoosePixel(*cam, idx); 1620 1621 fPixelIdx->setValue(idx); 1557 1622 } 1558 1623 return; … … 1624 1689 ChoosePatch(*cam, idx); 1625 1690 } 1691 1692 void on_fPixelIdx_valueChanged(int idx) 1693 { 1694 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 1695 ChoosePixel(*cam, idx); 1696 } 1626 1697 #endif 1627 1698 1628 1699 TGraph fGraphFtmTemp[4]; 1700 TGraph fGraphFtmRate; 1629 1701 1630 1702 map<int, int> fPatch; 1703 1704 #ifdef HAVE_ROOT 1705 void DrawTimeFrame(const char *ytitle) 1706 { 1707 const double tm = Time().RootTime(); 1708 1709 TH1F h("TimeFrame", "", 1, tm, tm+60);//Time().RootTime()-1./24/60/60, Time().RootTime()); 1710 h.SetDirectory(0); 1711 // h.SetBit(TH1::kCanRebin); 1712 h.SetStats(kFALSE); 1713 // h.SetMinimum(0); 1714 // h.SetMaximum(1); 1715 h.SetXTitle("Time"); 1716 h.SetYTitle(ytitle); 1717 h.GetXaxis()->CenterTitle(); 1718 h.GetYaxis()->CenterTitle(); 1719 h.GetXaxis()->SetTimeDisplay(true); 1720 h.GetXaxis()->SetTimeFormat("%Mh%S'"); 1721 h.GetXaxis()->SetLabelSize(0.025); 1722 h.GetYaxis()->SetLabelSize(0.025); 1723 h.GetYaxis()->SetTitleOffset(1.2); 1724 // h.GetYaxis()->SetTitleSize(1.2); 1725 h.DrawCopy(); 1726 } 1727 #endif 1631 1728 1632 1729 public: … … 1685 1782 // -------------------------------------------------------------------------- 1686 1783 #ifdef HAVE_ROOT 1784 /* 1687 1785 TCanvas *c = fFtmTempCanv->GetCanvas(); 1688 1786 c->SetBit(TCanvas::kNoContextMenu); … … 1693 1791 c->SetTopMargin(0.03); 1694 1792 c->cd(); 1695 1696 TH1F h("MyFrame", "", 1000, 0, 1);//Time().RootTime()-1./24/60/60, Time().RootTime()); 1697 h.SetDirectory(0); 1698 h.SetBit(TH1::kCanRebin); 1699 h.SetStats(kFALSE); 1700 h.SetMinimum(-20); 1701 h.SetMaximum(100); 1702 h.SetXTitle("Time"); 1703 h.SetYTitle("Temperature / °C"); 1704 h.GetXaxis()->CenterTitle(); 1705 h.GetYaxis()->CenterTitle(); 1706 h.GetXaxis()->SetTimeDisplay(true); 1707 h.GetXaxis()->SetTimeFormat("%H:%M"); 1708 h.GetXaxis()->SetLabelSize(0.025); 1709 // h.GetYaxis()->SetTitleSize(1.2); 1710 h.DrawCopy(); 1793 */ 1794 //CreateTimeFrame("Temperature / °C"); 1711 1795 1712 1796 fGraphFtmTemp[0].SetMarkerStyle(kFullDotSmall); … … 1723 1807 fGraphFtmTemp[3].SetMarkerColor(kGreen); 1724 1808 1725 fGraphFtmTemp[0].Draw("LP"); 1726 fGraphFtmTemp[1].Draw("LP"); 1727 fGraphFtmTemp[2].Draw("LP"); 1728 fGraphFtmTemp[3].Draw("LP"); 1809 //fGraphFtmTemp[0].Draw("LP"); 1810 //fGraphFtmTemp[1].Draw("LP"); 1811 //fGraphFtmTemp[2].Draw("LP"); 1812 //fGraphFtmTemp[3].Draw("LP"); 1813 1814 // -------------------------------------------------------------------------- 1815 1816 TCanvas *c = fFtmRateCanv->GetCanvas(); 1817 c->SetBit(TCanvas::kNoContextMenu); 1818 c->SetBorderMode(0); 1819 c->SetFrameBorderMode(0); 1820 c->SetFillColor(kWhite); 1821 c->SetRightMargin(0.03); 1822 c->SetTopMargin(0.03); 1823 c->SetGrid(); 1824 c->cd(); 1825 1826 DrawTimeFrame("Trigger rate [Hz]"); 1827 1828 fTriggerCounter0 = -1; 1829 1830 fGraphFtmRate.SetMarkerStyle(kFullDotSmall); 1831 fGraphFtmRate.Draw("LP"); 1729 1832 1730 1833 // -------------------------------------------------------------------------- … … 1748 1851 //widget->EnableSignalEvents(kMouseMoveEvent); 1749 1852 1750 fFtm TempCanv->setMouseTracking(true);1751 fFtm TempCanv->EnableSignalEvents(kMouseMoveEvent);1853 fFtmRateCanv->setMouseTracking(true); 1854 fFtmRateCanv->EnableSignalEvents(kMouseMoveEvent); 1752 1855 1753 1856 fRatesCanv->setMouseTracking(true); … … 1756 1859 connect(fRatesCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 1757 1860 this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); 1758 connect(fFtm TempCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)),1861 connect(fFtmRateCanv, SIGNAL( RootEventProcessed(TObject*, unsigned int, TCanvas*)), 1759 1862 this, SLOT (slot_RootEventProcessed(TObject*, unsigned int, TCanvas*))); 1760 1863 #endif -
trunk/FACT++/gui/MainWindow.h
r10678 r10733 81 81 void on_fThresholdVal_valueChanged(int v); 82 82 virtual void on_fThresholdIdx_valueChanged(int) { } 83 virtual void on_fPixelIdx_valueChanged(int) { } 83 84 84 85 // Tab: Chat -
trunk/FACT++/gui/design.ui
r10723 r10733 52 52 </property> 53 53 <property name="currentIndex"> 54 <number> 0</number>54 <number>2</number> 55 55 </property> 56 56 <property name="documentMode"> … … 494 494 </widget> 495 495 </item> 496 <item row="3" column="3"> 496 <item row="3" column="5"> 497 <widget class="QLabel" name="label_33"> 498 <property name="text"> 499 <string>:</string> 500 </property> 501 <property name="alignment"> 502 <set>Qt::AlignCenter</set> 503 </property> 504 </widget> 505 </item> 506 <item row="3" column="6"> 497 507 <widget class="QSpinBox" name="fTriggerSeqLPint"> 498 508 <property name="enabled"> … … 513 523 </widget> 514 524 </item> 515 <item row="3" column=" 5">525 <item row="3" column="4"> 516 526 <widget class="QSpinBox" name="fTriggerSeqLPext"> 517 527 <property name="enabled"> … … 532 542 </widget> 533 543 </item> 534 <item row=" 3" column="4">535 <widget class="QLabel" name="label_3 3">544 <item row="2" column="6"> 545 <widget class="QLabel" name="label_36"> 536 546 <property name="text"> 537 <string> :</string>547 <string>LPint</string> 538 548 </property> 539 549 <property name="alignment"> 540 <set>Qt::Align Center</set>550 <set>Qt::AlignBottom|Qt::AlignHCenter</set> 541 551 </property> 542 552 </widget> 543 553 </item> 544 <item row="2" column=" 5">554 <item row="2" column="4"> 545 555 <widget class="QLabel" name="label_38"> 546 556 <property name="text"> 547 557 <string>LPext</string> 548 </property>549 <property name="alignment">550 <set>Qt::AlignBottom|Qt::AlignHCenter</set>551 </property>552 </widget>553 </item>554 <item row="2" column="3">555 <widget class="QLabel" name="label_36">556 <property name="text">557 <string>LPint</string>558 558 </property> 559 559 <property name="alignment"> … … 998 998 <widget class="QLabel" name="label_13"> 999 999 <property name="text"> 1000 <string> Calibration</string>1000 <string>LPext</string> 1001 1001 </property> 1002 1002 </widget> … … 1803 1803 </property> 1804 1804 <item row="0" column="0"> 1805 <widget class="RootWidget" name="fFtm TempCanv" native="true">1805 <widget class="RootWidget" name="fFtmRateCanv" native="true"> 1806 1806 <property name="sizePolicy"> 1807 1807 <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> … … 2304 2304 <number>0</number> 2305 2305 </property> 2306 <item> 2307 <widget class="QLabel" name="label_68"> 2308 <property name="text"> 2309 <string>Pixel</string> 2310 </property> 2311 </widget> 2312 </item> 2313 <item> 2314 <layout class="QHBoxLayout" name="horizontalLayout_12"> 2315 <property name="topMargin"> 2316 <number>0</number> 2317 </property> 2318 <item> 2319 <widget class="QSpinBox" name="fPixelIdx"> 2320 <property name="alignment"> 2321 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 2322 </property> 2323 <property name="maximum"> 2324 <number>1439</number> 2325 </property> 2326 </widget> 2327 </item> 2328 <item> 2329 <widget class="QCheckBox" name="fPixelEnable"> 2330 <property name="maximumSize"> 2331 <size> 2332 <width>20</width> 2333 <height>16777215</height> 2334 </size> 2335 </property> 2336 <property name="text"> 2337 <string/> 2338 </property> 2339 </widget> 2340 </item> 2341 </layout> 2342 </item> 2343 <item> 2344 <spacer name="verticalSpacer_16"> 2345 <property name="orientation"> 2346 <enum>Qt::Vertical</enum> 2347 </property> 2348 <property name="sizeType"> 2349 <enum>QSizePolicy::Fixed</enum> 2350 </property> 2351 <property name="sizeHint" stdset="0"> 2352 <size> 2353 <width>20</width> 2354 <height>20</height> 2355 </size> 2356 </property> 2357 </spacer> 2358 </item> 2306 2359 <item> 2307 2360 <widget class="QLabel" name="label_25">
Note:
See TracChangeset
for help on using the changeset viewer.