Changeset 12108
- Timestamp:
- 09/15/11 22:53:50 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/HeadersBIAS.h
r11939 r12108 38 38 kRamping, 39 39 kOverCurrent, 40 kAtReference, 40 kVoltageOff, 41 kNotReferenced, 42 kVoltageOn, 41 43 kExpertMode // 'forward' declaration to be used in StateMachineBias 42 44 }; -
trunk/FACT++/src/biasctrl.cc
r12090 r12108 1361 1361 1362 1362 for (int ch=0; ch<kNumChannels; ch++) 1363 if (fPresent[ch/kNumChannelsPerBoard] && fVolt[ch]==0) 1364 return BIAS::kVoltageOff; 1365 1366 for (int ch=0; ch<kNumChannels; ch++) 1363 1367 if (fPresent[ch/kNumChannelsPerBoard] && fVolt[ch]!=fVoltRef[ch]) 1364 return BIAS::k Connected;1365 1366 return BIAS::k AtReference;1368 return BIAS::kNotReferenced; 1369 1370 return BIAS::kVoltageOn; 1367 1371 } 1368 1372 }; … … 1724 1728 "USB connection to bias-power supply established."); 1725 1729 1726 T::AddStateName(kAtReference, "Referenced", 1727 "Internal reference voltage matches last sent voltage."); 1730 T::AddStateName(kNotReferenced, "NotReferenced", 1731 "Internal reference voltage does not match last sent voltage."); 1732 1733 T::AddStateName(kVoltageOff, "VoltageOff", 1734 "All voltages are supposed to be switched off."); 1735 1736 T::AddStateName(kVoltageOn, "VoltageOn", 1737 "At least one voltage is switched on and all are at reference."); 1728 1738 1729 1739 T::AddStateName(kOverCurrent, "OverCurrent", … … 1743 1753 1744 1754 // Conenction commands 1745 T::AddEvent("DISCONNECT", kConnected, k AtReference)1755 T::AddEvent("DISCONNECT", kConnected, kVoltageOff) 1746 1756 (bind(&StateMachineBias::Disconnect, this)) 1747 1757 ("disconnect from USB"); 1748 1758 1749 T::AddEvent("RECONNECT", "O", kDisconnected, kConnected, k AtReference)1759 T::AddEvent("RECONNECT", "O", kDisconnected, kConnected, kVoltageOff) 1750 1760 (bind(&StateMachineBias::Reconnect, this, placeholders::_1)) 1751 1761 ("(Re)connect USB connection to Bias power supply, a new address can be given" … … 1754 1764 1755 1765 1756 T::AddEvent("REQUEST_STATUS", kConnected, k AtReference, kOverCurrent)1766 T::AddEvent("REQUEST_STATUS", kConnected, kVoltageOn, kVoltageOff, kNotReferenced, kOverCurrent) 1757 1767 (Wrapper(bind(&ConnectionBias::ReadAllChannels, &fBias, false))) 1758 1768 ("Asynchronously request the status (current) of all channels."); … … 1764 1774 1765 1775 1766 T::AddEvent("SET_GLOBAL_VOLTAGE", "F:1", kConnected, k AtReference, kOverCurrent)1776 T::AddEvent("SET_GLOBAL_VOLTAGE", "F:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1767 1777 (bind(&StateMachineBias::SetGlobalVolt, this, placeholders::_1)) 1768 1778 ("Set all channels to a new reference voltage. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)" 1769 1779 "|voltage[V]:Global target voltage in volts (will be converted to DAC units)"); 1770 1780 1771 T::AddEvent("SET_GLOBAL_DAC", "S:1", kConnected, k AtReference, kOverCurrent)1781 T::AddEvent("SET_GLOBAL_DAC", "S:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1772 1782 (bind(&StateMachineBias::SetGlobalDac, this, placeholders::_1)) 1773 1783 ("Set all channels to a new DAC reference. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)" 1774 1784 "|voltage[dac]:Global target voltage as DAC counts."); 1775 1785 1776 T::AddEvent("INCREASE_GLOBAL_VOLTAGE", "F:1", kConnected, k AtReference, kOverCurrent)1786 T::AddEvent("INCREASE_GLOBAL_VOLTAGE", "F:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1777 1787 (bind(&StateMachineBias::IncGlobalVolt, this, placeholders::_1)) 1778 1788 ("Set all channels to a new reference voltage. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)" 1779 1789 "|offset[V]:Offset to be added to all channels (will be converted to DAC counts)"); 1780 1790 1781 T::AddEvent("INCREASE_GLOBAL_DAC", "S:1", kConnected, k AtReference, kOverCurrent)1791 T::AddEvent("INCREASE_GLOBAL_DAC", "S:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1782 1792 (bind(&StateMachineBias::IncGlobalDac, this, placeholders::_1)) 1783 1793 ("Set all channels to a new DAC reference. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)" 1784 1794 "|offset[dac]:Offset to be added to all channels as DAC counts"); 1785 1795 1786 T::AddEvent("DECREASE_GLOBAL_VOLTAGE", "F:1", kConnected, k AtReference, kOverCurrent)1796 T::AddEvent("DECREASE_GLOBAL_VOLTAGE", "F:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1787 1797 (bind(&StateMachineBias::DecGlobalVolt, this, placeholders::_1)) 1788 1798 ("Set all channels to a new reference voltage. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)" 1789 1799 "|offset[V]:Offset to be subtracted from all channels (will be converted to DAC counts)"); 1790 1800 1791 T::AddEvent("DECREASE_GLOBAL_DAC", "S:1", kConnected, k AtReference, kOverCurrent)1801 T::AddEvent("DECREASE_GLOBAL_DAC", "S:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1792 1802 (bind(&StateMachineBias::DecGlobalDac, this, placeholders::_1)) 1793 1803 ("Set all channels to a new DAC reference. Starts ramping if necessary. (This command is not realized with the GLOBAL SET command.)" 1794 1804 "|offset[dac]:Offset to be subtracted from all channels as DAC counts"); 1795 1805 1796 T::AddEvent("SET_CHANNEL_VOLTAGE", "S:1;F:1", kConnected, k AtReference, kOverCurrent)1806 T::AddEvent("SET_CHANNEL_VOLTAGE", "S:1;F:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1797 1807 (bind(&StateMachineBias::SetChannelVolt, this, placeholders::_1)) 1798 1808 ("Set a single channel to a new reference voltage. Starts ramping if necessary." … … 1800 1810 "|voltage[V]:Target voltage in volts for the given channel (will be converted to DAC units)"); 1801 1811 1802 T::AddEvent("SET_CHANNEL_DAC", "S:1;S:1", kConnected, k AtReference, kOverCurrent)1812 T::AddEvent("SET_CHANNEL_DAC", "S:1;S:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1803 1813 (bind(&StateMachineBias::SetChannelDac, this, placeholders::_1)) 1804 1814 ("Set a single channel to a new DAC reference value. Starts ramping if necessary." … … 1806 1816 "|voltage[dac]:Target voltage in DAC units for the given channel"); 1807 1817 1808 T::AddEvent("SET_GLOBAL_GAPD_REFERENCE_VOLTAGE", kConnected, k AtReference, kOverCurrent)1818 T::AddEvent("SET_GLOBAL_GAPD_REFERENCE_VOLTAGE", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1809 1819 (Wrapper(bind(&ConnectionBias::SetGapdVoltage, &fBias, 0.))) 1810 1820 ("Set all channels to their G-APD reference voltage. Starts ramping if necessary."); 1811 1821 1812 T::AddEvent("SET_CHANNEL_GAPD_REFERENCE_VOLTAGE", "S:1", kConnected, k AtReference, kOverCurrent)1822 T::AddEvent("SET_CHANNEL_GAPD_REFERENCE_VOLTAGE", "S:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1813 1823 (bind(&StateMachineBias::SetGapdReferenceCh, this, placeholders::_1)) 1814 1824 ("Set a single channel channels to its G-APD reference voltage. Starts ramping if necessary." 1815 1825 "|channel[short]:Channel for which to set the target voltage [0-416]"); 1816 1826 1817 T::AddEvent("SET_GAPD_REFERENCE_OFFSET", "F:1", kConnected, k AtReference, kOverCurrent)1827 T::AddEvent("SET_GAPD_REFERENCE_OFFSET", "F:1", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1818 1828 (bind(&StateMachineBias::SetGapdVoltage, this, placeholders::_1)) 1819 1829 ("Set all channels to their G-APD reference voltage plus the given offset. Starts ramping if necessary." 1820 1830 "|offset[V]:Offset to be added to teh G-APD reference voltage globally"); 1821 1831 1822 T::AddEvent("SET_ZERO_VOLTAGE", kConnected, k AtReference, kOverCurrent)1832 T::AddEvent("SET_ZERO_VOLTAGE", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1823 1833 (Wrapper(bind(&ConnectionBias::SetZero, &fBias))) 1824 1834 ("Set all channels to a zero reference voltage. Starts ramping if necessary."); 1825 1835 1826 T::AddEvent("SET_REFERENCE_VOLTAGES", "F:416", kConnected, k AtReference, kOverCurrent)1836 T::AddEvent("SET_REFERENCE_VOLTAGES", "F:416", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1827 1837 (bind(&StateMachineBias::SetReferenceVolt, this, placeholders::_1)) 1828 1838 ("Set all channels to the given new reference voltage. Starts ramping if necessary." 1829 1839 "voltage[V]:New reference voltage for all channels"); 1830 1840 1831 T::AddEvent("SET_REFERENCE_DACS", "S:416", kConnected, k AtReference, kOverCurrent)1841 T::AddEvent("SET_REFERENCE_DACS", "S:416", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1832 1842 (bind(&StateMachineBias::SetReferenceDac, this, placeholders::_1)) 1833 1843 ("Set all channels to the given new reference voltage. Starts ramping if necessary." 1834 1844 "voltage[dac]:New reference voltage for all channels in DAC units"); 1835 1845 1836 T::AddEvent("ADD_REFERENCE_VOLTAGES", "F:416", kConnected, k AtReference, kOverCurrent)1846 T::AddEvent("ADD_REFERENCE_VOLTAGES", "F:416", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1837 1847 (bind(&StateMachineBias::AddReferenceVolt, this, placeholders::_1)) 1838 1848 ("Add the given voltages to the current reference voltages. Starts ramping if necessary." 1839 1849 "offset[V]:Offsets to be added to the reference voltage of all channels in volts"); 1840 1850 1841 T::AddEvent("ADD_REFERENCE_DACS", "S:416", kConnected, k AtReference, kOverCurrent)1851 T::AddEvent("ADD_REFERENCE_DACS", "S:416", kConnected, kVoltageOff, kVoltageOn, kNotReferenced, kOverCurrent) 1842 1852 (bind(&StateMachineBias::AddReferenceDac, this, placeholders::_1)) 1843 1853 ("Add the given voltages to the current reference voltages. Starts ramping if necessary." … … 1847 1857 1848 1858 1849 T::AddEvent("STOP", kConnected, kRamping , kAtReference, kOverCurrent)1859 T::AddEvent("STOP", kConnected, kRamping) 1850 1860 (Wrapper(bind(&ConnectionBias::RampStop, &fBias))) 1851 1861 ("Stop an on-going ramping"); 1852 1862 1853 T::AddEvent("START", kConnected, k OverCurrent)1863 T::AddEvent("START", kConnected, kNotReferenced) 1854 1864 (Wrapper(bind(&ConnectionBias::RampStart, &fBias))) 1855 1865 ("Start a ramping if no ramping is in progress and if reference values differ from current voltages");
Note:
See TracChangeset
for help on using the changeset viewer.