Changeset 11102
- Timestamp:
- 06/22/11 13:20:05 (13 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11086 r11102 1331 1331 fClockCondR14->setValue(sdata.fClockConditioner[6]); 1332 1332 fClockCondR15->setValue(sdata.fClockConditioner[7]); 1333 1334 //fClockCondFreq->setEditText(""); 1335 fClockCondFreq->setCurrentIndex(0); 1333 1336 1334 1337 fTriggerSeqPed->setValue(sdata.fTriggerSeqPed); … … 2182 2185 fDimFadConnections ("FAD_CONTROL/CONNECTIONS", (void*)NULL, 0, this) 2183 2186 { 2187 fClockCondFreq->addItem("-/-", QVariant(-1)); 2188 fClockCondFreq->addItem("700 MHz", QVariant(700)); 2189 fClockCondFreq->addItem("1 GHz", QVariant(1000)); 2190 fClockCondFreq->addItem("2 GHz", QVariant(2000)); 2191 fClockCondFreq->addItem("3 GHz", QVariant(3000)); 2192 fClockCondFreq->addItem("4 GHz", QVariant(4000)); 2193 fClockCondFreq->addItem("5 GHz", QVariant(5000)); 2194 2184 2195 fTriggerWidget->setEnabled(false); 2185 2196 fFtuWidget->setEnabled(false); -
trunk/FACT++/gui/MainWindow.cc
r11078 r11102 275 275 } 276 276 277 void MainWindow::on_fClockCondFreq_activated(int idx) 278 { 279 if (!fInHandler) 280 Dim::SendCommand("FTM_CONTROL/SET_CLOCK_FREQUENCY", fClockCondFreq->itemData(idx).toInt()); 281 } 282 277 283 void MainWindow::slot_fFtuLED_clicked() 278 284 { -
trunk/FACT++/gui/MainWindow.h
r10962 r11102 66 66 void on_fTimeMarkerDelay_valueChanged(int); 67 67 void on_fDeadTime_valueChanged(int); 68 68 /* 69 69 void on_fClockCondR0_valueChanged(int) { } 70 70 void on_fClockCondR1_valueChanged(int) { } … … 75 75 void on_fClockCondR14_valueChanged(int) { } 76 76 void on_fClockCondR15_valueChanged(int) { } 77 */ 78 void on_fPrescalingVal_valueChanged(int); 77 79 78 void on_f PrescalingVal_valueChanged(int);80 void on_fClockCondFreq_activated(int); 79 81 80 82 // Tab: FTUs -
trunk/FACT++/gui/design.ui
r11065 r11102 52 52 </property> 53 53 <property name="currentIndex"> 54 <number> 3</number>54 <number>0</number> 55 55 </property> 56 56 <property name="documentMode"> … … 1341 1341 </property> 1342 1342 <layout class="QGridLayout" name="gridLayout_18"> 1343 <item row=" 3" column="1">1343 <item row="6" column="1"> 1344 1344 <widget class="SpinBoxHex" name="fClockCondR0"> 1345 1345 <property name="enabled"> … … 1360 1360 </widget> 1361 1361 </item> 1362 <item row=" 3" column="2">1362 <item row="6" column="2"> 1363 1363 <widget class="SpinBoxHex" name="fClockCondR1"> 1364 1364 <property name="enabled"> … … 1379 1379 </widget> 1380 1380 </item> 1381 <item row=" 3" column="3">1381 <item row="6" column="3"> 1382 1382 <widget class="SpinBoxHex" name="fClockCondR8"> 1383 1383 <property name="enabled"> … … 1398 1398 </widget> 1399 1399 </item> 1400 <item row=" 3" column="4">1400 <item row="6" column="4"> 1401 1401 <widget class="SpinBoxHex" name="fClockCondR9"> 1402 1402 <property name="enabled"> … … 1417 1417 </widget> 1418 1418 </item> 1419 <item row=" 4" column="1">1419 <item row="7" column="1"> 1420 1420 <widget class="SpinBoxHex" name="fClockCondR11"> 1421 1421 <property name="enabled"> … … 1436 1436 </widget> 1437 1437 </item> 1438 <item row=" 4" column="2">1438 <item row="7" column="2"> 1439 1439 <widget class="SpinBoxHex" name="fClockCondR13"> 1440 1440 <property name="enabled"> … … 1455 1455 </widget> 1456 1456 </item> 1457 <item row=" 4" column="3">1457 <item row="7" column="3"> 1458 1458 <widget class="SpinBoxHex" name="fClockCondR14"> 1459 1459 <property name="enabled"> … … 1474 1474 </widget> 1475 1475 </item> 1476 <item row=" 4" column="4">1476 <item row="7" column="4"> 1477 1477 <widget class="SpinBoxHex" name="fClockCondR15"> 1478 1478 <property name="enabled"> … … 1493 1493 </widget> 1494 1494 </item> 1495 <item row=" 2" column="2">1495 <item row="5" column="2"> 1496 1496 <widget class="QLabel" name="label_11"> 1497 1497 <property name="text"> … … 1503 1503 </widget> 1504 1504 </item> 1505 <item row=" 2" column="1">1505 <item row="5" column="1"> 1506 1506 <widget class="QLabel" name="label_16"> 1507 1507 <property name="text"> … … 1513 1513 </widget> 1514 1514 </item> 1515 <item row=" 2" column="3">1515 <item row="5" column="3"> 1516 1516 <widget class="QLabel" name="label_17"> 1517 1517 <property name="text"> … … 1523 1523 </widget> 1524 1524 </item> 1525 <item row=" 2" column="4">1525 <item row="5" column="4"> 1526 1526 <widget class="QLabel" name="label_18"> 1527 1527 <property name="text"> … … 1533 1533 </widget> 1534 1534 </item> 1535 <item row=" 5" column="1">1535 <item row="8" column="1"> 1536 1536 <widget class="QLabel" name="label_19"> 1537 1537 <property name="text"> … … 1543 1543 </widget> 1544 1544 </item> 1545 <item row=" 5" column="2">1545 <item row="8" column="2"> 1546 1546 <widget class="QLabel" name="label_20"> 1547 1547 <property name="text"> … … 1553 1553 </widget> 1554 1554 </item> 1555 <item row=" 5" column="3">1555 <item row="8" column="3"> 1556 1556 <widget class="QLabel" name="label_21"> 1557 1557 <property name="text"> … … 1563 1563 </widget> 1564 1564 </item> 1565 <item row=" 5" column="4">1565 <item row="8" column="4"> 1566 1566 <widget class="QLabel" name="label_22"> 1567 1567 <property name="text"> … … 1586 1586 </widget> 1587 1587 </item> 1588 <item row=" 6" column="2">1588 <item row="9" column="2"> 1589 1589 <spacer name="verticalSpacer_12"> 1590 1590 <property name="orientation"> … … 1612 1612 </spacer> 1613 1613 </item> 1614 <item row=" 3" column="0">1614 <item row="6" column="0"> 1615 1615 <spacer name="horizontalSpacer_25"> 1616 1616 <property name="orientation"> … … 1625 1625 </spacer> 1626 1626 </item> 1627 <item row=" 3" column="5">1627 <item row="6" column="5"> 1628 1628 <spacer name="horizontalSpacer_26"> 1629 1629 <property name="orientation"> … … 1634 1634 <width>40</width> 1635 1635 <height>20</height> 1636 </size> 1637 </property> 1638 </spacer> 1639 </item> 1640 <item row="3" column="2" colspan="2"> 1641 <widget class="QComboBox" name="fClockCondFreq"> 1642 <property name="frame"> 1643 <bool>true</bool> 1644 </property> 1645 </widget> 1646 </item> 1647 <item row="2" column="2" colspan="3"> 1648 <widget class="QLabel" name="label_133"> 1649 <property name="text"> 1650 <string>DRS sampling frequency (def=2GHz)</string> 1651 </property> 1652 </widget> 1653 </item> 1654 <item row="4" column="2"> 1655 <spacer name="verticalSpacer_28"> 1656 <property name="orientation"> 1657 <enum>Qt::Vertical</enum> 1658 </property> 1659 <property name="sizeHint" stdset="0"> 1660 <size> 1661 <width>20</width> 1662 <height>0</height> 1636 1663 </size> 1637 1664 </property> -
trunk/FACT++/src/ftmctrl.cc
r11058 r11102 898 898 } 899 899 900 bool SetClockRegister(const uint64_t reg[]) 901 { 902 for (int i=0; i<8; i++) 903 { 904 if (reg[i]>0xffffffff) 905 return false; 906 907 fStaticData.fClockConditioner[i] = reg[i]; 908 } 909 910 CmdSendStatDat(); 911 912 return true; 913 } 914 900 915 bool EnablePixel(int16_t idx, bool enable) 901 916 { … … 1390 1405 } 1391 1406 1407 int SetClockRegister(const EventImp &evt) 1408 { 1409 if (!CheckEventSize(evt.GetSize(), "SetClockRegister", 8*16)) 1410 return T::kSM_FatalError; 1411 1412 const uint64_t *reg = evt.Ptr<uint64_t>(); 1413 1414 if (!fFTM.SetClockRegister(reg)) 1415 T::Warn("SetClockRegister - Value out of range."); 1416 1417 return T::GetCurrentState(); 1418 } 1419 1420 //map<uint32_t, uint32_t> fClockConditionerMap; 1421 1422 int SetClockFrequency(const EventImp &evt) 1423 { 1424 if (!CheckEventSize(evt.GetSize(), "SetClockFrequency", 4)) 1425 return T::kSM_FatalError; 1426 1427 const uint32_t freq = evt.GetUInt(); 1428 1429 //map<uint32_t,uint32_t>::const_iterator = fClockConditionerMap.find(freq); 1430 1431 static const uint64_t R1 = 0x00010101; 1432 static const uint64_t R8 = 0x10000908; 1433 static const uint64_t R9 = 0xa0032a09; 1434 static const uint64_t R11 = 0x0082000b; 1435 static const uint64_t R13 = 0x020a000d; 1436 1437 static const uint64_t freq0700[8] = { 0x0003e000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400f50f }; 1438 static const uint64_t freq1000[8] = { 0x0003a000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f }; 1439 static const uint64_t freq2000[8] = { 0x00035000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f }; 1440 static const uint64_t freq3000[8] = { 0x00037200, R1, R8, R9, R11, R13, 0x0830400e, 0x1420a30f }; 1441 static const uint64_t freq4000[8] = { 0x00032800, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f }; 1442 static const uint64_t freq5000[8] = { 0x00032000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f }; 1443 1444 const uint64_t *reg = 0; 1445 1446 switch (freq) 1447 { 1448 case 700: reg = freq0700; break; 1449 case 1000: reg = freq1000; break; 1450 case 2000: reg = freq2000; break; 1451 case 3000: reg = freq3000; break; 1452 case 4000: reg = freq4000; break; 1453 case 5000: reg = freq5000; break; 1454 default: 1455 T::Warn("SetClockFrequency - Frequency not supported."); 1456 return T::GetCurrentState(); 1457 } 1458 1459 if (!fFTM.SetClockRegister(reg)) 1460 T::Warn("SetClockFrequency - Register values out of range."); 1461 1462 return T::GetCurrentState(); 1463 } 1392 1464 1393 1465 int Enable(const EventImp &evt, FTM::StaticData::GeneralSettings type) … … 1694 1766 (boost::bind(&StateMachineFTM::SetCalibWindow, this, _1)) 1695 1767 (""); 1768 1769 AddEvent("SET_CLOCK_FREQUENCY", "I:1", kStateIdle) 1770 (boost::bind(&StateMachineFTM::SetClockFrequency, this, _1)) 1771 (""); 1772 1773 AddEvent("SET_CLOCK_REGISTER", "X:8", kStateIdle) 1774 (boost::bind(&StateMachineFTM::SetClockRegister, this, _1)) 1775 (""); 1776 1777 1696 1778 1697 1779 AddEvent("RESET_CRATE", "S:1", kStateIdle)
Note:
See TracChangeset
for help on using the changeset viewer.