Changeset 10948 for trunk/FACT++/gui
- Timestamp:
- 06/09/11 14:25:47 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10937 r10948 1808 1808 } 1809 1809 } 1810 void ChoosePatch(Camera &cam, int idx)1811 {1812 cam.Reset();1813 1814 fThresholdIdx->setValue(idx);1815 1816 //fThresholdVal->setEnabled(idx>=0);1817 //fThresholdVolt->setEnabled(idx>=0);1818 fPatchRate->setEnabled(idx>=0);1819 if (idx<0)1820 return;1821 1822 fThresholdVal->setValue(fFtmStaticData.fThreshold[idx]);1823 fPatchRate->setValue(cam.GetData(idx));1824 1825 for (unsigned int i=0; i<fPatch.size(); i++)1826 if (fPatch[i]==idx)1827 cam.SetBold(i);1828 }1829 1830 void ChoosePixel(Camera &cam, int idx)1831 {1832 cam.SetWhite(idx);1833 ChoosePatch(cam, fPatch[idx]);1834 1835 fPixelEnable->setChecked(fFtmStaticData.IsEnabled(idx));1836 }1837 1810 1838 1811 #ifdef HAVE_ROOT … … 1861 1834 const int idx = cam->GetIdx(xx, yy); 1862 1835 1836 cout << "Select: " << idx << endl; 1837 1863 1838 ChoosePixel(*cam, idx); 1864 1839 … … 1878 1853 const int idx = cam->GetIdx(xx, yy); 1879 1854 1880 //cam->Toggle(idx);1855 cout << "Toggle: " << idx << endl; 1881 1856 1882 1857 Dim::SendCommand("FTM_CONTROL/TOGGLE_PIXEL", uint16_t(idx)); … … 1934 1909 } 1935 1910 1936 void on_fThresholdIdx_valueChanged(int idx) 1911 void ChoosePatch(Camera &cam, int idx) 1912 { 1913 cam.Reset(); 1914 1915 fThresholdIdx->setValue(idx); 1916 1917 const int patch = idx%4; 1918 const int board = (idx/4)%10; 1919 const int crate = (idx/4)/10; 1920 1921 fThresholdCrate->setValue(crate); 1922 fThresholdBoard->setValue(board); 1923 fThresholdPatch->setValue(patch); 1924 1925 //fThresholdVal->setEnabled(idx>=0); 1926 //fThresholdVolt->setEnabled(idx>=0); 1927 fPatchRate->setEnabled(idx>=0); 1928 if (idx<0) 1929 return; 1930 1931 fThresholdVal->setValue(fFtmStaticData.fThreshold[idx]); 1932 fPatchRate->setValue(cam.GetData(idx)); 1933 1934 for (unsigned int i=0; i<fPatch.size(); i++) 1935 if (fPatch[i]==idx) 1936 cam.SetBold(i); 1937 } 1938 1939 void ChoosePixel(Camera &cam, int idx) 1940 { 1941 cam.SetWhite(idx); 1942 ChoosePatch(cam, fPatch[idx]); 1943 1944 fPixelEnable->setChecked(fFtmStaticData.IsEnabled(idx)); 1945 } 1946 1947 void UpdatePatch(int idx) 1937 1948 { 1938 1949 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); … … 1940 1951 } 1941 1952 1953 void on_fThresholdIdx_valueChanged(int idx) 1954 { 1955 UpdatePatch(idx); 1956 } 1957 1958 void UpdateThresholdIdx() 1959 { 1960 const int crate = fThresholdCrate->value(); 1961 const int board = fThresholdBoard->value(); 1962 const int patch = fThresholdPatch->value(); 1963 1964 const int id = patch + board*4 + crate*40; 1965 1966 UpdatePatch(id); 1967 } 1968 1969 void on_fThresholdPatch_valueChanged(int) 1970 { 1971 UpdateThresholdIdx(); 1972 } 1973 void on_fThresholdBoard_valueChanged(int) 1974 { 1975 UpdateThresholdIdx(); 1976 } 1977 void on_fThresholdCrate_valueChanged(int) 1978 { 1979 UpdateThresholdIdx(); 1980 } 1981 1942 1982 void on_fPixelIdx_valueChanged(int idx) 1943 1983 { 1944 1984 Camera *cam = (Camera*)fRatesCanv->GetCanvas()->FindObject("Camera"); 1945 1985 ChoosePixel(*cam, idx); 1986 1987 fRatesCanv->GetCanvas()->Modified(); 1988 fRatesCanv->GetCanvas()->Update(); 1946 1989 } 1947 1990 #endif -
trunk/FACT++/gui/MainWindow.h
r10917 r10948 88 88 void on_fThresholdVal_valueChanged(int); 89 89 virtual void on_fThresholdIdx_valueChanged(int) { } 90 virtual void on_fThresholdCrate_valueChanged(int) { } 91 virtual void on_fThresholdBoard_valueChanged(int) { } 92 virtual void on_fThresholdPatch_valueChanged(int) { } 90 93 virtual void on_fPixelIdx_valueChanged(int) { } 91 94 -
trunk/FACT++/gui/design.ui
r10935 r10948 52 52 </property> 53 53 <property name="currentIndex"> 54 <number> 3</number>54 <number>2</number> 55 55 </property> 56 56 <property name="documentMode"> … … 2547 2547 <width>20</width> 2548 2548 <height>5</height> 2549 </size> 2550 </property> 2551 </spacer> 2552 </item> 2553 <item> 2554 <layout class="QGridLayout" name="gridLayout_40"> 2555 <property name="topMargin"> 2556 <number>0</number> 2557 </property> 2558 <item row="1" column="0"> 2559 <widget class="QSpinBox" name="fThresholdCrate"> 2560 <property name="alignment"> 2561 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 2562 </property> 2563 <property name="maximum"> 2564 <number>3</number> 2565 </property> 2566 </widget> 2567 </item> 2568 <item row="1" column="1"> 2569 <widget class="QSpinBox" name="fThresholdBoard"> 2570 <property name="alignment"> 2571 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 2572 </property> 2573 <property name="maximum"> 2574 <number>9</number> 2575 </property> 2576 </widget> 2577 </item> 2578 <item row="1" column="3"> 2579 <widget class="QSpinBox" name="fThresholdPatch"> 2580 <property name="alignment"> 2581 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 2582 </property> 2583 <property name="maximum"> 2584 <number>4</number> 2585 </property> 2586 </widget> 2587 </item> 2588 <item row="0" column="3"> 2589 <widget class="QLabel" name="label_130"> 2590 <property name="text"> 2591 <string>Patch ID</string> 2592 </property> 2593 </widget> 2594 </item> 2595 <item row="0" column="1"> 2596 <widget class="QLabel" name="label_131"> 2597 <property name="text"> 2598 <string>Board ID</string> 2599 </property> 2600 </widget> 2601 </item> 2602 <item row="0" column="0"> 2603 <widget class="QLabel" name="label_132"> 2604 <property name="text"> 2605 <string>Crate ID</string> 2606 </property> 2607 </widget> 2608 </item> 2609 </layout> 2610 </item> 2611 <item> 2612 <spacer name="verticalSpacer_27"> 2613 <property name="orientation"> 2614 <enum>Qt::Vertical</enum> 2615 </property> 2616 <property name="sizeType"> 2617 <enum>QSizePolicy::Fixed</enum> 2618 </property> 2619 <property name="sizeHint" stdset="0"> 2620 <size> 2621 <width>20</width> 2622 <height>40</height> 2549 2623 </size> 2550 2624 </property>
Note:
See TracChangeset
for help on using the changeset viewer.