Home | Trees | Indices | Help |
|
---|
|
1 # The Vision Egg: Daq 2 # 3 # Copyright (C) 2001-2003 Andrew Straw. 4 # Author: Andrew Straw <astraw@users.sourceforge.net> 5 # URL: <http://www.visionegg.org/> 6 # 7 # Distributed under the terms of the GNU Lesser General Public License 8 # (LGPL). See LICENSE.TXT that came with this file. 9 10 """ 11 Definition of data acquisition and triggering interfaces. 12 13 This module provides an interface to abstract data acquisition 14 devices. To interface with real data acquisition devices, use a 15 module that subclasses the classes defined here. 16 17 *WARNING* This module has not been extensively tested or used, and should be 18 considered unstable. 19 20 """ 21 22 import VisionEgg 23 import VisionEgg.ParameterTypes as ve_types 24 25 __version__ = VisionEgg.release_name 26 29 3234 constant_parameters_and_defaults = { 35 'units':('Unknown units', 36 ve_types.String), 37 }4339 if self.__class__ == SignalType: 40 raise RuntimeError("Trying to instantiate abstract base class.") 41 else: 42 ChannelParameters.__init__(self,**kw)45 constant_parameters_and_defaults = { 46 'gain':(1.0, 47 ve_types.Real), 48 'offset':(0.0, 49 ve_types.Real)}50 536056 if self.__class__ == DaqMode: 57 raise RuntimeError("Trying to instantiate abstract base class.") 58 else: 59 ChannelParameters.__init__(self,**kw)62 parameters_and_defaults = { 63 'sample_rate_hz':(5000.0, 64 ve_types.Real), 65 'duration_sec':(5.0, 66 ve_types.Real), 67 'trigger':(None, 68 ve_types.Instance(Trigger)), 69 }70 7380 84 8876 if self.__class__ == Functionality: 77 raise RuntimeError("Trying to instantiate abstract base class.") 78 else: 79 ChannelParameters.__init__(self,**kw)90 constant_parameters_and_defaults = { 91 'signal_type' : (None, 92 ve_types.Instance(SignalType)), 93 'daq_mode' : (None, 94 ve_types.Instance(DaqMode)), 95 'functionality' : (None, 96 ve_types.Instance(Functionality)), 97 }10799 VisionEgg.ClassWithParameters.__init__(self,**kw) 100 self.constant_parameters.signal_type.channel = self 101 self.constant_parameters.daq_mode.channel = self 102 self.constant_parameters.functionality.channel = self 103 self.device = None # Not set yet104124110 self.channels = [] 111 if channels is not None: 112 if type(channels) is not types.ListType: 113 raise ValueError("channels must be a list of channels") 114 for channel in channels: 115 self.add_channel( channel )116118 # override this method if you need to do error checking 119 if isinstance(channel,Channel): 120 self.channels.append(channel) 121 else: 122 raise ValueError("%s not instance of VisionEgg.Daq.Channel"%channel) 123 channel.device = self
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Sat Jun 7 09:06:48 2008 | http://epydoc.sourceforge.net |