V172X_Params.hh

Go to the documentation of this file.
00001 
00008 #ifndef V172X_PARAMS_h
00009 #define V172X_PARAMS_h
00010 #ifndef N_V172X_BOARDS
00011 #define N_V172X_BOARDS 5
00012 #endif
00013 
00014 #include "ParameterList.hh"
00015 #include <string>
00016 #include <iostream>
00017 #include <fstream>
00018 #include "stdint.h"
00019 
00027 enum SIGNAL_LOGIC { NIM=0, TTL=1 };
00031 enum ZERO_SUPPRESSION_TYPE {NONE=0, ZS_INT = 1, ZLE = 2, ZS_AMP = 3};
00035 enum TRIGGER_POLARITY {TP_RISING = 0, TP_FALLING = 1};
00039 enum BOARD_TYPE { V1724 = 0, V1721 = 1, V1720 = 3 , V1751 = 5, OTHER = 256};
00040 
00041 //need iostream operators for all enums
00043 std::ostream& operator<<(std::ostream& out, const SIGNAL_LOGIC& logic);
00045 std::istream& operator>>(std::istream& in, SIGNAL_LOGIC &logic);
00046 
00048 std::ostream& operator<<(std::ostream& out, const ZERO_SUPPRESSION_TYPE& zs);
00050 std::istream& operator>>(std::istream& in, ZERO_SUPPRESSION_TYPE &zs);
00051 
00053 std::ostream& operator<<(std::ostream& out, const TRIGGER_POLARITY& pol);
00055 std::istream& operator>>(std::istream& in, TRIGGER_POLARITY &pol);
00056 
00058 std::ostream& operator<<(std::ostream& out, const BOARD_TYPE& type);
00060 std::istream& operator>>(std::istream& in, BOARD_TYPE &type);
00061 
00062 
00066 class V172X_ChannelParams : public ParameterList {
00067 public:
00069   V172X_ChannelParams();
00071   ~V172X_ChannelParams(){}
00072   //bool SetDefaults();
00073   bool enabled;                  
00074   bool enable_trigger_source;    
00075   bool enable_trigger_out;       
00076   uint16_t threshold;            
00077   double thresh_time_us;         
00078   uint16_t dc_offset;            
00079   TRIGGER_POLARITY zs_polarity;  
00080   uint32_t zs_threshold;         
00081   double zs_thresh_time_us;      
00082   uint32_t zs_pre_samps;         
00083   uint32_t zs_post_samps;        
00084   std::string label;             
00085 };
00086 
00090 class V172X_BoardParams : public ParameterList
00091 {
00092 public:
00094   V172X_BoardParams();
00096   ~V172X_BoardParams(){}
00098   int UpdateBoardSpecificVariables();
00099   //bool SetDefaults();
00100   //Data members
00101 
00102   bool enabled;                        
00103   int id;                              
00104   uint32_t address;                    
00105   int link;                            
00106   bool usb;                            
00107   int chainindex;                      
00108   BOARD_TYPE board_type;               
00109   double v_full_scale;                 
00110   int stupid_size_factor;              
00111   int sample_bits;                     
00112   double max_sample_rate;              
00113   long mem_size;                       
00114   int bytes_per_sample;                
00115   uint32_t event_size_bytes;           
00116   uint64_t ns_per_clocktick;           
00117   bool enable_software_trigger;        
00118   bool enable_software_trigger_out;    
00119   bool enable_external_trigger;        
00120   bool enable_external_trigger_out;    
00121   uint16_t local_trigger_coincidence;  
00122   double pre_trigger_time_us;          
00123   double post_trigger_time_us;         
00124   uint32_t downsample_factor;          
00125   TRIGGER_POLARITY trigger_polarity;   
00126   bool count_all_triggers;             
00127   ZERO_SUPPRESSION_TYPE zs_type;       
00128   bool enable_trigger_overlap;         
00129   //  uint32_t interrupt_on_event;     ///< wait n events before interrupt  
00130   SIGNAL_LOGIC signal_logic;           
00131   bool enable_test_pattern;            
00132   uint32_t acq_control_val;            
00133   static const int MAXCHANS = 8;       
00134   int nchans;                          
00135   static const int Nth_factor = 4;     
00136   V172X_ChannelParams channel[MAXCHANS]; 
00137 
00138   //utility functions
00140   double GetSampleRate() const; 
00142   uint32_t GetPreNSamps() const;
00144   uint32_t GetPostNSamps() const;
00146   uint32_t GetTotalNSamps() const;
00148   int GetTriggerIndex() const;
00150   uint32_t GetBufferCode() const; 
00152   uint32_t GetCustomSizeSetting() const;
00154   uint32_t GetPostTriggerSetting() const;
00156   uint64_t GetTimestampRange() const;
00157   
00158 };
00159 
00163 class V172X_Params : public ParameterList
00164 {
00165 public:
00166   //Access functions
00168   V172X_Params();
00170   ~V172X_Params(){}
00171   
00172   //public data members
00173   
00174   bool align64;                   
00175   int trigger_timeout_ms;         
00176   long max_mem_size;              
00177   bool no_low_mem_warn;           
00178   bool send_start_pulse;          
00179   bool auto_trigger;              
00180   //caluclated values
00181   int event_size_bytes;           
00182   int enabled_boards;             
00183   int enabled_channels;           
00184   int vme_bridge_link;            
00185   static const int nboards = N_V172X_BOARDS; 
00186   V172X_BoardParams board[nboards];          
00187   //utility functions
00189   int GetEventSize(); 
00191   int GetEnabledBoards();
00193   int GetEnabledChannels();
00194   
00195 };
00196 
00197 
00199 #endif
00200   
00201   
00202   
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 20 Jun 2014 for daqman by  doxygen 1.6.1