- Timestamp:
- 06/09/11 16:23:48 (13 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10950 r10953 1841 1841 cout << "Select: " << idx << endl; 1842 1842 1843 fPixelIdx->setValue(idx); 1843 1844 ChoosePixel(*cam, idx); 1844 1845 1845 fPixelIdx->setValue(idx);1846 1846 } 1847 1847 return; -
trunk/FACT++/gui/MainWindow.cc
r10936 r10953 247 247 void MainWindow::on_fPixelEnable_stateChanged(int b) 248 248 { 249 cout << "PIXEL: " << fPixelIdx->value() << " " << b << endl;250 249 if (!fInHandler) 251 250 Dim::SendCommand(b==Qt::Unchecked ? 252 251 "FTM_CONTROL/DISABLE_PIXEL" : "FTM_CONTROL/ENABLE_PIXEL", 253 252 uint16_t(fPixelIdx->value())); 253 } 254 255 void MainWindow::on_fPixelDisableOthers_clicked() 256 { 257 Dim::SendCommand("FTM_CONTROL/DISABLE_ALL_PIXELS_EXCEPT", 258 uint16_t(fPixelIdx->value())); 259 } 260 261 void MainWindow::on_fThresholdDisableOthers_clicked() 262 { 263 Dim::SendCommand("FTM_CONTROL/DISABLE_ALL_PATCHES_EXCEPT", 264 uint16_t(fThresholdIdx->value())); 254 265 } 255 266 -
trunk/FACT++/gui/MainWindow.h
r10948 r10953 93 93 virtual void on_fPixelIdx_valueChanged(int) { } 94 94 95 void on_fPixelDisableOthers_clicked(); 96 virtual void on_fThresholdDisableOthers_clicked(); 97 95 98 virtual void on_fRatePatch1_valueChanged(int) { } 96 99 virtual void on_fRatePatch2_valueChanged(int) { } -
trunk/FACT++/gui/design.ui
r10948 r10953 2491 2491 </item> 2492 2492 <item> 2493 <layout class="QHBoxLayout" name="horizontalLayout_22"> 2494 <property name="topMargin"> 2495 <number>0</number> 2496 </property> 2497 <item> 2498 <spacer name="horizontalSpacer_29"> 2499 <property name="orientation"> 2500 <enum>Qt::Horizontal</enum> 2501 </property> 2502 <property name="sizeType"> 2503 <enum>QSizePolicy::Minimum</enum> 2504 </property> 2505 <property name="sizeHint" stdset="0"> 2506 <size> 2507 <width>40</width> 2508 <height>20</height> 2509 </size> 2510 </property> 2511 </spacer> 2512 </item> 2513 <item> 2514 <widget class="QPushButton" name="fPixelDisableOthers"> 2515 <property name="text"> 2516 <string>Disable others</string> 2517 </property> 2518 </widget> 2519 </item> 2520 </layout> 2521 </item> 2522 <item> 2493 2523 <spacer name="verticalSpacer_16"> 2494 2524 <property name="orientation"> … … 2534 2564 </property> 2535 2565 </widget> 2566 </item> 2567 <item> 2568 <layout class="QHBoxLayout" name="horizontalLayout_23"> 2569 <property name="topMargin"> 2570 <number>0</number> 2571 </property> 2572 <item> 2573 <spacer name="horizontalSpacer_31"> 2574 <property name="orientation"> 2575 <enum>Qt::Horizontal</enum> 2576 </property> 2577 <property name="sizeType"> 2578 <enum>QSizePolicy::Minimum</enum> 2579 </property> 2580 <property name="sizeHint" stdset="0"> 2581 <size> 2582 <width>40</width> 2583 <height>20</height> 2584 </size> 2585 </property> 2586 </spacer> 2587 </item> 2588 <item> 2589 <widget class="QPushButton" name="fThresholdDisableOthers"> 2590 <property name="text"> 2591 <string>Disable others</string> 2592 </property> 2593 </widget> 2594 </item> 2595 </layout> 2536 2596 </item> 2537 2597 <item> … … 2589 2649 <widget class="QLabel" name="label_130"> 2590 2650 <property name="text"> 2591 <string>Patch ID</string> 2651 <string>Patch</string> 2652 </property> 2653 </widget> 2654 </item> 2655 <item row="0" column="0"> 2656 <widget class="QLabel" name="label_132"> 2657 <property name="text"> 2658 <string>Crate</string> 2592 2659 </property> 2593 2660 </widget> … … 2596 2663 <widget class="QLabel" name="label_131"> 2597 2664 <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> 2665 <string>Board</string> 2606 2666 </property> 2607 2667 </widget> -
trunk/FACT++/src/ftmctrl.cc
r10880 r10953 898 898 } 899 899 900 bool EnablePixel(uint16_t idx, bool enable) 900 bool EnablePixel(int16_t idx, bool enable) 901 { 902 if (idx<-1 || idx>FTM::StaticData::kMaxPixelIdx) 903 return false; 904 905 if (idx==-1) 906 for (int i=0; i<FTM::StaticData::kMaxPixelIdx; i++) 907 fStaticData.EnablePixel(idx, enable); 908 else 909 fStaticData.EnablePixel(idx, enable); 910 911 CmdSendStatDat(); 912 913 return true; 914 } 915 916 bool DisableAllPixelsExcept(uint16_t idx) 901 917 { 902 918 if (idx>FTM::StaticData::kMaxPixelIdx) 903 919 return false; 904 920 905 cout << "ENABLE " << idx << " " << enable << endl;906 fStaticData.EnablePixel(idx, enable);921 for (int i=0; i<FTM::StaticData::kMaxPixelIdx; i++) 922 fStaticData.EnablePixel(i, i==idx); 907 923 908 924 CmdSendStatDat(); … … 911 927 } 912 928 929 bool DisableAllPatchesExcept(uint16_t idx) 930 { 931 if (idx>159) 932 return false; 933 934 for (int i=0; i<FTM::StaticData::kMaxPixelIdx; i++) 935 fStaticData.EnablePixel(i, i/9==idx); 936 937 CmdSendStatDat(); 938 939 return true; 940 } 941 913 942 bool TogglePixel(uint16_t idx) 914 943 { 915 944 if (idx>FTM::StaticData::kMaxPixelIdx) 916 945 return false; 917 918 cout << "TOGGLE " << idx << endl;919 946 920 947 fStaticData.EnablePixel(idx, !fStaticData.Enabled(idx)); … … 1379 1406 return T::kSM_FatalError; 1380 1407 1381 fFTM.EnablePixel(evt.GetUShort(), b); 1408 if (!fFTM.EnablePixel(evt.GetUShort(), b)) 1409 T::Warn("EnablePixel - Value out of range."); 1410 1411 return T::GetCurrentState(); 1412 } 1413 1414 int DisableAllPixelsExcept(const EventImp &evt) 1415 { 1416 if (!CheckEventSize(evt.GetSize(), "DisableAllPixelsExcept", 2)) 1417 return T::kSM_FatalError; 1418 1419 if (!fFTM.DisableAllPixelsExcept(evt.GetUShort())) 1420 T::Warn("DisableAllPixelsExcept - Value out of range."); 1421 1422 return T::GetCurrentState(); 1423 } 1424 1425 int DisableAllPatchesExcept(const EventImp &evt) 1426 { 1427 if (!CheckEventSize(evt.GetSize(), "DisableAllPatchesExcept", 2)) 1428 return T::kSM_FatalError; 1429 1430 if (!fFTM.DisableAllPatchesExcept(evt.GetUShort())) 1431 T::Warn("DisableAllPatchesExcept - Value out of range."); 1382 1432 1383 1433 return T::GetCurrentState(); … … 1389 1439 return T::kSM_FatalError; 1390 1440 1391 fFTM.TogglePixel(evt.GetUShort()); 1441 if (!fFTM.TogglePixel(evt.GetUShort())) 1442 T::Warn("TogglePixel - Value out of range."); 1392 1443 1393 1444 return T::GetCurrentState(); … … 1549 1600 AddEvent("DISABLE_PIXEL", "S:1", kStateIdle) 1550 1601 (boost::bind(&StateMachineFTM::EnablePixel, this, _1, false)) 1551 (" ");1602 ("(-1 or all)"); 1552 1603 1553 1604 AddEvent("ENABLE_PIXEL", "S:1", kStateIdle) 1554 1605 (boost::bind(&StateMachineFTM::EnablePixel, this, _1, true)) 1606 ("(-1 or all)"); 1607 1608 AddEvent("DISABLE_ALL_PIXELS_EXCEPT", "S:1", kStateIdle) 1609 (boost::bind(&StateMachineFTM::DisableAllPixelsExcept, this, _1)) 1610 (""); 1611 1612 AddEvent("DISABLE_ALL_PATCHES_EXCEPT", "S:1", kStateIdle) 1613 (boost::bind(&StateMachineFTM::DisableAllPatchesExcept, this, _1)) 1555 1614 (""); 1556 1615
Note:
See TracChangeset
for help on using the changeset viewer.