00001 /* 00002 * $RCSfile: CounterSubsystem.hpp,v $ 00003 * $Revision: 1.8 $ 00004 * $Date: 2010/01/29 23:49:53 $ 00005 * jEdit:tabSize=4:collapseFolds=1: 00006 * 00007 * class CounterSubsystem declarations 00008 */ 00009 00010 00011 #if ! defined( CounterSubsystem_hpp ) 00012 #define CounterSubsystem_hpp 00013 00014 // {{{ includes 00015 #include <DeviceSubsystem.hpp> 00016 #include <Counter.hpp> 00017 // }}} 00018 00019 namespace AIOUSB { 00020 00027 class CounterSubsystem : public DeviceSubsystem { 00028 friend class Counter; 00029 friend class USB_AI16_Family; 00030 friend class USB_CTR_15_Family; 00031 friend class USB_DIO_32_Family; 00032 00033 // {{{ protected members 00034 protected: 00035 static const int COUNTERS_PER_BLOCK = 3; 00036 00037 int numCounterBlocks; // number of counter blocks 00038 int numCounters; // number of individual counters 00039 CounterList counters; // list of counters 00040 // }}} 00041 00042 // {{{ protected methods 00043 protected: 00044 CounterSubsystem( USBDevice &parent ); 00045 virtual ~CounterSubsystem(); 00046 // }}} 00047 00048 // {{{ public methods 00049 public: 00050 00051 /* 00052 * properties 00053 */ 00054 00055 virtual std::ostream &print( std::ostream &out ); 00056 00062 int getNumCounterBlocks() const { 00063 return numCounterBlocks; 00064 } // getNumCounterBlocks() 00065 00071 int getNumCounters() const { 00072 return numCounters; 00073 } // getNumCounters() 00074 00075 /* 00076 * operations 00077 */ 00078 00079 Counter &getCounter( int counter ); 00080 UShortArray readCounts( bool oldData ); 00081 CounterSubsystem &selectGate( int counter ); 00082 double startClock( int counterBlock, double clockHz ); 00083 00090 CounterSubsystem &stopClock( int counterBlock ) { 00091 startClock( counterBlock, 0 ); 00092 return *this; 00093 } // stopClock() 00094 00095 // }}} 00096 00097 }; // class CounterSubsystem 00098 00099 } // namespace AIOUSB 00100 00101 #endif 00102 00103 /* end of file */