Rewrite of python wrappers based on swig
This commit is contained in:
parent
598fa693a6
commit
90b41e5960
13 changed files with 8581 additions and 881 deletions
17
python/Makefile.am
Normal file
17
python/Makefile.am
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
pyexec_LTLIBRARIES = pycomedi.la
|
||||
|
||||
pycomedi_la_SOURCES = comedi_wrap.c
|
||||
pycomedi_la_CFLAGS = $(COMEDILIB_CFLAGS) -I/usr/include/python2.2
|
||||
pycomedi_la_LDFLAGS = -module -avoid-version $(COMEDILIB_LIBS)
|
||||
|
||||
pyexec_SCRIPTS = comedi.py
|
||||
|
||||
EXTRA_DIST = comedi.i
|
||||
|
||||
install-exec-local:
|
||||
|
||||
|
||||
#$(INSTALL) build/lib.linux-i686-2.2/_comedi.so $(pythondir)/
|
||||
#$(INSTALL) comedi.py $(pythondir)/
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
# Universal Unix Makefile for Python extensions
|
||||
# =============================================
|
||||
|
||||
# Short Instructions
|
||||
# ------------------
|
||||
|
||||
# 1. Build and install Python (1.5 or newer).
|
||||
# 2. "make -f Makefile.pre.in boot"
|
||||
# 3. "make"
|
||||
# You should now have a shared library.
|
||||
|
||||
# Long Instructions
|
||||
# -----------------
|
||||
|
||||
# Build *and install* the basic Python 1.5 distribution. See the
|
||||
# Python README for instructions. (This version of Makefile.pre.in
|
||||
# only withs with Python 1.5, alpha 3 or newer.)
|
||||
|
||||
# Create a file Setup.in for your extension. This file follows the
|
||||
# format of the Modules/Setup.in file; see the instructions there.
|
||||
# For a simple module called "spam" on file "spammodule.c", it can
|
||||
# contain a single line:
|
||||
# spam spammodule.c
|
||||
# You can build as many modules as you want in the same directory --
|
||||
# just have a separate line for each of them in the Setup.in file.
|
||||
|
||||
# If you want to build your extension as a shared library, insert a
|
||||
# line containing just the string
|
||||
# *shared*
|
||||
# at the top of your Setup.in file.
|
||||
|
||||
# Note that the build process copies Setup.in to Setup, and then works
|
||||
# with Setup. It doesn't overwrite Setup when Setup.in is changed, so
|
||||
# while you're in the process of debugging your Setup.in file, you may
|
||||
# want to edit Setup instead, and copy it back to Setup.in later.
|
||||
# (All this is done so you can distribute your extension easily and
|
||||
# someone else can select the modules they actually want to build by
|
||||
# commenting out lines in the Setup file, without editing the
|
||||
# original. Editing Setup is also used to specify nonstandard
|
||||
# locations for include or library files.)
|
||||
|
||||
# Copy this file (Misc/Makefile.pre.in) to the directory containing
|
||||
# your extension.
|
||||
|
||||
# Run "make -f Makefile.pre.in boot". This creates Makefile
|
||||
# (producing Makefile.pre and sedscript as intermediate files) and
|
||||
# config.c, incorporating the values for sys.prefix, sys.exec_prefix
|
||||
# and sys.version from the installed Python binary. For this to work,
|
||||
# the python binary must be on your path. If this fails, try
|
||||
# make -f Makefile.pre.in Makefile VERSION=1.5 installdir=<prefix>
|
||||
# where <prefix> is the prefix used to install Python for installdir
|
||||
# (and possibly similar for exec_installdir=<exec_prefix>).
|
||||
|
||||
# Note: "make boot" implies "make clobber" -- it assumes that when you
|
||||
# bootstrap you may have changed platforms so it removes all previous
|
||||
# output files.
|
||||
|
||||
# If you are building your extension as a shared library (your
|
||||
# Setup.in file starts with *shared*), run "make" or "make sharedmods"
|
||||
# to build the shared library files. If you are building a statically
|
||||
# linked Python binary (the only solution of your platform doesn't
|
||||
# support shared libraries, and sometimes handy if you want to
|
||||
# distribute or install the resulting Python binary), run "make
|
||||
# python".
|
||||
|
||||
# Note: Each time you edit Makefile.pre.in or Setup, you must run
|
||||
# "make Makefile" before running "make".
|
||||
|
||||
# Hint: if you want to use VPATH, you can start in an empty
|
||||
# subdirectory and say (e.g.):
|
||||
# make -f ../Makefile.pre.in boot srcdir=.. VPATH=..
|
||||
|
||||
|
||||
# === Bootstrap variables (edited through "make boot") ===
|
||||
|
||||
# The prefix used by "make inclinstall libainstall" of core python
|
||||
installdir= /usr/local
|
||||
|
||||
# The exec_prefix used by the same
|
||||
exec_installdir=$(installdir)
|
||||
|
||||
# Source directory and VPATH in case you want to use VPATH.
|
||||
# (You will have to edit these two lines yourself -- there is no
|
||||
# automatic support as the Makefile is not generated by
|
||||
# config.status.)
|
||||
srcdir= .
|
||||
VPATH= .
|
||||
|
||||
# === Variables that you may want to customize (rarely) ===
|
||||
|
||||
# (Static) build target
|
||||
TARGET= python
|
||||
|
||||
# Installed python binary (used only by boot target)
|
||||
PYTHON= python
|
||||
|
||||
# Add more -I and -D options here
|
||||
CFLAGS= $(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY) $(DEFS)
|
||||
|
||||
# These two variables can be set in Setup to merge extensions.
|
||||
# See example[23].
|
||||
BASELIB=
|
||||
BASESETUP=
|
||||
|
||||
# === Variables set by makesetup ===
|
||||
|
||||
MODOBJS= _MODOBJS_
|
||||
MODLIBS= _MODLIBS_
|
||||
|
||||
# === Definitions added by makesetup ===
|
||||
|
||||
# === Variables from configure (through sedscript) ===
|
||||
|
||||
VERSION= @VERSION@
|
||||
CC= @CC@
|
||||
LINKCC= @LINKCC@
|
||||
SGI_ABI= @SGI_ABI@
|
||||
OPT= @OPT@
|
||||
LDFLAGS= @LDFLAGS@
|
||||
LDLAST= @LDLAST@
|
||||
DEFS= @DEFS@
|
||||
LIBS= @LIBS@
|
||||
LIBM= @LIBM@
|
||||
LIBC= @LIBC@
|
||||
RANLIB= @RANLIB@
|
||||
MACHDEP= @MACHDEP@
|
||||
SO= @SO@
|
||||
LDSHARED= @LDSHARED@
|
||||
CCSHARED= @CCSHARED@
|
||||
LINKFORSHARED= @LINKFORSHARED@
|
||||
#@SET_CCC@
|
||||
|
||||
# Install prefix for architecture-independent files
|
||||
prefix= /usr/local
|
||||
|
||||
# Install prefix for architecture-dependent files
|
||||
exec_prefix= $(prefix)
|
||||
|
||||
# Uncomment the following two lines for AIX
|
||||
#LINKCC= $(LIBPL)/makexp_aix $(LIBPL)/python.exp "" $(LIBRARY); $(PURIFY) $(CC)
|
||||
#LDSHARED= $(LIBPL)/ld_so_aix $(CC) -bI:$(LIBPL)/python.exp
|
||||
|
||||
# === Fixed definitions ===
|
||||
|
||||
# Shell used by make (some versions default to the login shell, which is bad)
|
||||
SHELL= /bin/sh
|
||||
|
||||
# Expanded directories
|
||||
BINDIR= $(exec_installdir)/bin
|
||||
LIBDIR= $(exec_prefix)/lib
|
||||
MANDIR= $(installdir)/man
|
||||
INCLUDEDIR= $(installdir)/include
|
||||
SCRIPTDIR= $(prefix)/lib
|
||||
|
||||
# Detailed destination directories
|
||||
BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
||||
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
||||
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
|
||||
EXECINCLUDEPY= $(exec_installdir)/include/python$(VERSION)
|
||||
LIBP= $(exec_installdir)/lib/python$(VERSION)
|
||||
DESTSHARED= $(BINLIBDEST)/site-packages
|
||||
|
||||
LIBPL= $(LIBP)/config
|
||||
|
||||
PYTHONLIBS= $(LIBPL)/libpython$(VERSION).a
|
||||
|
||||
MAKESETUP= $(LIBPL)/makesetup
|
||||
MAKEFILE= $(LIBPL)/Makefile
|
||||
CONFIGC= $(LIBPL)/config.c
|
||||
CONFIGCIN= $(LIBPL)/config.c.in
|
||||
SETUP= $(LIBPL)/Setup.thread $(LIBPL)/Setup.local $(LIBPL)/Setup
|
||||
|
||||
SYSLIBS= $(LIBM) $(LIBC) -lcomedi
|
||||
|
||||
ADDOBJS= $(LIBPL)/python.o config.o
|
||||
|
||||
# Portable install script (configure doesn't always guess right)
|
||||
INSTALL= $(LIBPL)/install-sh -c
|
||||
# Shared libraries must be installed with executable mode on some systems;
|
||||
# rather than figuring out exactly which, we always give them executable mode.
|
||||
# Also, making them read-only seems to be a good idea...
|
||||
INSTALL_SHARED= ${INSTALL} -m 555
|
||||
|
||||
# === Fixed rules ===
|
||||
|
||||
# Default target. This builds shared libraries only
|
||||
default: sharedmods
|
||||
|
||||
# Build everything
|
||||
all: static sharedmods
|
||||
|
||||
# Build shared libraries from our extension modules
|
||||
sharedmods: $(SHAREDMODS)
|
||||
|
||||
# Build a static Python binary containing our extension modules
|
||||
static: $(TARGET)
|
||||
$(TARGET): $(ADDOBJS) lib.a $(PYTHONLIBS) Makefile $(BASELIB)
|
||||
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) \
|
||||
$(ADDOBJS) lib.a $(PYTHONLIBS) \
|
||||
$(LINKPATH) $(BASELIB) $(MODLIBS) $(LIBS) $(SYSLIBS) \
|
||||
-o $(TARGET) $(LDLAST)
|
||||
|
||||
install: sharedmods
|
||||
if test ! -d $(DESTSHARED) ; then \
|
||||
mkdir $(DESTSHARED) ; else true ; fi
|
||||
-for i in X $(SHAREDMODS); do \
|
||||
if test $$i != X; \
|
||||
then $(INSTALL_SHARED) $$i $(DESTSHARED)/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Build the library containing our extension modules
|
||||
lib.a: $(MODOBJS)
|
||||
-rm -f lib.a
|
||||
ar cr lib.a $(MODOBJS)
|
||||
-$(RANLIB) lib.a
|
||||
|
||||
# This runs makesetup *twice* to use the BASESETUP definition from Setup
|
||||
config.c Makefile: Makefile.pre Setup $(BASESETUP) $(MAKESETUP)
|
||||
$(MAKESETUP) \
|
||||
-m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
|
||||
$(MAKE) -f Makefile do-it-again
|
||||
|
||||
# Internal target to run makesetup for the second time
|
||||
do-it-again:
|
||||
$(MAKESETUP) \
|
||||
-m Makefile.pre -c $(CONFIGCIN) Setup -n $(BASESETUP) $(SETUP)
|
||||
|
||||
# Make config.o from the config.c created by makesetup
|
||||
config.o: config.c
|
||||
$(CC) $(CFLAGS) -c config.c
|
||||
|
||||
# Setup is copied from Setup.in *only* if it doesn't yet exist
|
||||
Setup:
|
||||
cp $(srcdir)/Setup.in Setup
|
||||
|
||||
# Make the intermediate Makefile.pre from Makefile.pre.in
|
||||
Makefile.pre: Makefile.pre.in sedscript
|
||||
sed -f sedscript $(srcdir)/Makefile.pre.in >Makefile.pre
|
||||
|
||||
# Shortcuts to make the sed arguments on one line
|
||||
P=prefix
|
||||
E=exec_prefix
|
||||
H=Generated automatically from Makefile.pre.in by sedscript.
|
||||
L=LINKFORSHARED
|
||||
|
||||
# Make the sed script used to create Makefile.pre from Makefile.pre.in
|
||||
sedscript: $(MAKEFILE)
|
||||
sed -n \
|
||||
-e '1s/.*/1i\\/p' \
|
||||
-e '2s%.*%# $H%p' \
|
||||
-e '/^VERSION=/s/^VERSION=[ ]*\(.*\)/s%@VERSION[@]%\1%/p' \
|
||||
-e '/^CC=/s/^CC=[ ]*\(.*\)/s%@CC[@]%\1%/p' \
|
||||
-e '/^CCC=/s/^CCC=[ ]*\(.*\)/s%#@SET_CCC[@]%CCC=\1%/p' \
|
||||
-e '/^LINKCC=/s/^LINKCC=[ ]*\(.*\)/s%@LINKCC[@]%\1%/p' \
|
||||
-e '/^OPT=/s/^OPT=[ ]*\(.*\)/s%@OPT[@]%\1%/p' \
|
||||
-e '/^LDFLAGS=/s/^LDFLAGS=[ ]*\(.*\)/s%@LDFLAGS[@]%\1%/p' \
|
||||
-e '/^LDLAST=/s/^LDLAST=[ ]*\(.*\)/s%@LDLAST[@]%\1%/p' \
|
||||
-e '/^DEFS=/s/^DEFS=[ ]*\(.*\)/s%@DEFS[@]%\1%/p' \
|
||||
-e '/^LIBS=/s/^LIBS=[ ]*\(.*\)/s%@LIBS[@]%\1%/p' \
|
||||
-e '/^LIBM=/s/^LIBM=[ ]*\(.*\)/s%@LIBM[@]%\1%/p' \
|
||||
-e '/^LIBC=/s/^LIBC=[ ]*\(.*\)/s%@LIBC[@]%\1%/p' \
|
||||
-e '/^RANLIB=/s/^RANLIB=[ ]*\(.*\)/s%@RANLIB[@]%\1%/p' \
|
||||
-e '/^MACHDEP=/s/^MACHDEP=[ ]*\(.*\)/s%@MACHDEP[@]%\1%/p' \
|
||||
-e '/^SO=/s/^SO=[ ]*\(.*\)/s%@SO[@]%\1%/p' \
|
||||
-e '/^LDSHARED=/s/^LDSHARED=[ ]*\(.*\)/s%@LDSHARED[@]%\1%/p' \
|
||||
-e '/^CCSHARED=/s/^CCSHARED=[ ]*\(.*\)/s%@CCSHARED[@]%\1%/p' \
|
||||
-e '/^SGI_ABI=/s/^SGI_ABI=[ ]*\(.*\)/s%@SGI_ABI[@]%\1%/p' \
|
||||
-e '/^$L=/s/^$L=[ ]*\(.*\)/s%@$L[@]%\1%/p' \
|
||||
-e '/^$P=/s/^$P=\(.*\)/s%^$P=.*%$P=\1%/p' \
|
||||
-e '/^$E=/s/^$E=\(.*\)/s%^$E=.*%$E=\1%/p' \
|
||||
$(MAKEFILE) >sedscript
|
||||
echo "/^#@SET_CCC@/d" >>sedscript
|
||||
echo "/^installdir=/s%=.*%= $(installdir)%" >>sedscript
|
||||
echo "/^exec_installdir=/s%=.*%=$(exec_installdir)%" >>sedscript
|
||||
echo "/^srcdir=/s%=.*%= $(srcdir)%" >>sedscript
|
||||
echo "/^VPATH=/s%=.*%= $(VPATH)%" >>sedscript
|
||||
echo "/^LINKPATH=/s%=.*%= $(LINKPATH)%" >>sedscript
|
||||
echo "/^BASELIB=/s%=.*%= $(BASELIB)%" >>sedscript
|
||||
echo "/^BASESETUP=/s%=.*%= $(BASESETUP)%" >>sedscript
|
||||
|
||||
# Bootstrap target
|
||||
boot: clobber
|
||||
VERSION=`$(PYTHON) -c "import sys; print sys.version[:3]"`; \
|
||||
installdir=`$(PYTHON) -c "import sys; print sys.prefix"`; \
|
||||
exec_installdir=`$(PYTHON) -c "import sys; print sys.exec_prefix"`; \
|
||||
$(MAKE) -f $(srcdir)/Makefile.pre.in VPATH=$(VPATH) srcdir=$(srcdir) \
|
||||
VERSION=$$VERSION \
|
||||
installdir=$$installdir \
|
||||
exec_installdir=$$exec_installdir \
|
||||
Makefile
|
||||
|
||||
# Handy target to remove intermediate files and backups
|
||||
clean:
|
||||
-rm -f *.o *~
|
||||
|
||||
# Handy target to remove everything that is easily regenerated
|
||||
clobber: clean
|
||||
-rm -f *.a tags TAGS config.c Makefile.pre $(TARGET) sedscript
|
||||
-rm -f *.so *.sl so_locations
|
||||
|
||||
|
||||
# Handy target to remove everything you don't want to distribute
|
||||
distclean: clobber
|
||||
-rm -f Makefile Setup
|
40
python/README.txt
Normal file
40
python/README.txt
Normal file
|
@ -0,0 +1,40 @@
|
|||
** General info on the swig-generated wrappers for Comedilib **
|
||||
|
||||
1) Regenerating the wrappers
|
||||
The wrapper were made using swig-1.3.19. Any of the swig-1.3.x seris should work
|
||||
N.B. the default swig on redhat systems is version 1.1. Upgrade to v-1.3.19. It's better!
|
||||
|
||||
run $> swig -python comedi.i
|
||||
|
||||
2) Building the module
|
||||
i) edit the setup.py file so that the include and lib paths are correct for your system
|
||||
ii) run $> python setup.py build
|
||||
|
||||
3) Installing the module
|
||||
i) Manual installation I'm afraid. Copy comedi.py and _comedi.pyd files to somewhere in your PYTHONPATH
|
||||
|
||||
4) Using the module
|
||||
All the comedilib functions are translated directly to python function. The various comedi structs
|
||||
are now available as python classes (e.g. comedi_cmd_struct). The members of each struct are now
|
||||
attributes of the class and can be set and retrieved in the usual way. Comedilib Functions which
|
||||
take a pointer to a comedilib struct as an argument (in C) now, in python, accept the appropriate
|
||||
struct python object.
|
||||
|
||||
For a multichannel acquisition, a C-array containing the channel list, gains and referencing is
|
||||
required. This can be created using a swig-generated helper class: chanlist(n). This creates a C-array
|
||||
of length n and type Unsigned Int. Individual members of the array can be accessed/set using
|
||||
pythons indexing syntax:
|
||||
mylist = chanlist(3) #creates a chanlist array of length 3
|
||||
mylist[0] = 100 #set some values
|
||||
mylist[1] = 200
|
||||
mylist[2] = 300
|
||||
|
||||
The chanlist object can then be passed to a comedi_cmd_struct object, for example. N.B. The
|
||||
chanlist object contains *no* length-checking or other error protection so use with care! Don't
|
||||
try to get/set indexes outside the array bounds.
|
||||
|
||||
All the comedilib macros (e.g. CR_PACK) are now available as python functions.
|
||||
|
||||
check out the example test_comedi.py to clarify the above.
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
*shared*
|
||||
comedi compy.c -lcomedi
|
40
python/comedi.i
Normal file
40
python/comedi.i
Normal file
|
@ -0,0 +1,40 @@
|
|||
/***********************************************************
|
||||
* Interface file for wrapping Comedilib
|
||||
* author: Bryan Cole email: bryan.cole@teraview.co.uk
|
||||
*
|
||||
* This file was created with Python wrappers in mind but wil
|
||||
* probably work for other swig-supported script languages
|
||||
*
|
||||
* to regenerate the wrappers run:
|
||||
* swig -python comedi.i
|
||||
*
|
||||
***********************************************************/
|
||||
%module comedi
|
||||
%{
|
||||
#include "../comedilib-0.7.19/include/comedi.h"
|
||||
#include "../comedilib-0.7.19/include/comedilib.h"
|
||||
%}
|
||||
%include "carrays.i"
|
||||
|
||||
%inline %{
|
||||
static unsigned int cr_pack(unsigned int chan, unsigned int rng, unsigned int aref){
|
||||
return CR_PACK(chan,rng,aref);
|
||||
}
|
||||
static unsigned int cr_pack_flags(unsigned int chan, unsigned int rng, unsigned int aref, unsigned int flags){
|
||||
return CR_PACK_FLAGS(chan,rng,aref, flags);
|
||||
}
|
||||
static unsigned int cr_chan(unsigned int a){
|
||||
return CR_CHAN(a);
|
||||
}
|
||||
static unsigned int cr_range(unsigned int a){
|
||||
return CR_RANGE(a);
|
||||
}
|
||||
static unsigned int cr_aref(unsigned int a){
|
||||
return CR_AREF(a);
|
||||
}
|
||||
%}
|
||||
|
||||
%array_class(unsigned int, chanlist);
|
||||
|
||||
%include "../comedilib-0.7.19/include/comedi.h"
|
||||
%include "../comedilib-0.7.19/include/comedilib.h"
|
880
python/comedi.py
Normal file
880
python/comedi.py
Normal file
|
@ -0,0 +1,880 @@
|
|||
# This file was created automatically by SWIG.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
# This file is compatible with both classic and new-style classes.
|
||||
import _comedi
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
if (name == "this"):
|
||||
if isinstance(value, class_type):
|
||||
self.__dict__[name] = value.this
|
||||
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
|
||||
del value.thisown
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
self.__dict__[name] = value
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
|
||||
|
||||
cr_pack = _comedi.cr_pack
|
||||
|
||||
cr_pack_flags = _comedi.cr_pack_flags
|
||||
|
||||
cr_chan = _comedi.cr_chan
|
||||
|
||||
cr_range = _comedi.cr_range
|
||||
|
||||
cr_aref = _comedi.cr_aref
|
||||
|
||||
class chanlist(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, chanlist, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, chanlist, name)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, chanlist, 'this', apply(_comedi.new_chanlist,args))
|
||||
_swig_setattr(self, chanlist, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_chanlist):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __getitem__(*args): return apply(_comedi.chanlist___getitem__,args)
|
||||
def __setitem__(*args): return apply(_comedi.chanlist___setitem__,args)
|
||||
def cast(*args): return apply(_comedi.chanlist_cast,args)
|
||||
__swig_getmethods__["frompointer"] = lambda x: _comedi.chanlist_frompointer
|
||||
if _newclass:frompointer = staticmethod(_comedi.chanlist_frompointer)
|
||||
def __repr__(self):
|
||||
return "<C chanlist instance at %s>" % (self.this,)
|
||||
|
||||
class chanlistPtr(chanlist):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, chanlist, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, chanlist, 'thisown', 0)
|
||||
_swig_setattr(self, chanlist,self.__class__,chanlist)
|
||||
_comedi.chanlist_swigregister(chanlistPtr)
|
||||
chanlist_frompointer = _comedi.chanlist_frompointer
|
||||
|
||||
|
||||
COMEDI_MAJOR = _comedi.COMEDI_MAJOR
|
||||
COMEDI_NDEVICES = _comedi.COMEDI_NDEVICES
|
||||
COMEDI_NDEVCONFOPTS = _comedi.COMEDI_NDEVCONFOPTS
|
||||
COMEDI_NAMELEN = _comedi.COMEDI_NAMELEN
|
||||
CR_FLAGS_MASK = _comedi.CR_FLAGS_MASK
|
||||
CR_ALT_FILTER = _comedi.CR_ALT_FILTER
|
||||
CR_DITHER = _comedi.CR_DITHER
|
||||
CR_DEGLITCH = _comedi.CR_DEGLITCH
|
||||
CR_ALT_SOURCE = _comedi.CR_ALT_SOURCE
|
||||
CR_EDGE = _comedi.CR_EDGE
|
||||
CR_INVERT = _comedi.CR_INVERT
|
||||
AREF_GROUND = _comedi.AREF_GROUND
|
||||
AREF_COMMON = _comedi.AREF_COMMON
|
||||
AREF_DIFF = _comedi.AREF_DIFF
|
||||
AREF_OTHER = _comedi.AREF_OTHER
|
||||
GPCT_RESET = _comedi.GPCT_RESET
|
||||
GPCT_SET_SOURCE = _comedi.GPCT_SET_SOURCE
|
||||
GPCT_SET_GATE = _comedi.GPCT_SET_GATE
|
||||
GPCT_SET_DIRECTION = _comedi.GPCT_SET_DIRECTION
|
||||
GPCT_SET_OPERATION = _comedi.GPCT_SET_OPERATION
|
||||
GPCT_ARM = _comedi.GPCT_ARM
|
||||
GPCT_DISARM = _comedi.GPCT_DISARM
|
||||
GPCT_GET_INT_CLK_FRQ = _comedi.GPCT_GET_INT_CLK_FRQ
|
||||
GPCT_INT_CLOCK = _comedi.GPCT_INT_CLOCK
|
||||
GPCT_EXT_PIN = _comedi.GPCT_EXT_PIN
|
||||
GPCT_NO_GATE = _comedi.GPCT_NO_GATE
|
||||
GPCT_UP = _comedi.GPCT_UP
|
||||
GPCT_DOWN = _comedi.GPCT_DOWN
|
||||
GPCT_HWUD = _comedi.GPCT_HWUD
|
||||
GPCT_SIMPLE_EVENT = _comedi.GPCT_SIMPLE_EVENT
|
||||
GPCT_SINGLE_PERIOD = _comedi.GPCT_SINGLE_PERIOD
|
||||
GPCT_SINGLE_PW = _comedi.GPCT_SINGLE_PW
|
||||
GPCT_CONT_PULSE_OUT = _comedi.GPCT_CONT_PULSE_OUT
|
||||
GPCT_SINGLE_PULSE_OUT = _comedi.GPCT_SINGLE_PULSE_OUT
|
||||
INSN_MASK_WRITE = _comedi.INSN_MASK_WRITE
|
||||
INSN_MASK_READ = _comedi.INSN_MASK_READ
|
||||
INSN_MASK_SPECIAL = _comedi.INSN_MASK_SPECIAL
|
||||
INSN_READ = _comedi.INSN_READ
|
||||
INSN_WRITE = _comedi.INSN_WRITE
|
||||
INSN_BITS = _comedi.INSN_BITS
|
||||
INSN_CONFIG = _comedi.INSN_CONFIG
|
||||
INSN_GTOD = _comedi.INSN_GTOD
|
||||
INSN_WAIT = _comedi.INSN_WAIT
|
||||
INSN_INTTRIG = _comedi.INSN_INTTRIG
|
||||
TRIG_BOGUS = _comedi.TRIG_BOGUS
|
||||
TRIG_DITHER = _comedi.TRIG_DITHER
|
||||
TRIG_DEGLITCH = _comedi.TRIG_DEGLITCH
|
||||
TRIG_CONFIG = _comedi.TRIG_CONFIG
|
||||
CMDF_PRIORITY = _comedi.CMDF_PRIORITY
|
||||
TRIG_RT = _comedi.TRIG_RT
|
||||
TRIG_WAKE_EOS = _comedi.TRIG_WAKE_EOS
|
||||
CMDF_WRITE = _comedi.CMDF_WRITE
|
||||
TRIG_WRITE = _comedi.TRIG_WRITE
|
||||
CMDF_RAWDATA = _comedi.CMDF_RAWDATA
|
||||
COMEDI_EV_START = _comedi.COMEDI_EV_START
|
||||
COMEDI_EV_SCAN_BEGIN = _comedi.COMEDI_EV_SCAN_BEGIN
|
||||
COMEDI_EV_CONVERT = _comedi.COMEDI_EV_CONVERT
|
||||
COMEDI_EV_SCAN_END = _comedi.COMEDI_EV_SCAN_END
|
||||
COMEDI_EV_STOP = _comedi.COMEDI_EV_STOP
|
||||
TRIG_ROUND_MASK = _comedi.TRIG_ROUND_MASK
|
||||
TRIG_ROUND_NEAREST = _comedi.TRIG_ROUND_NEAREST
|
||||
TRIG_ROUND_DOWN = _comedi.TRIG_ROUND_DOWN
|
||||
TRIG_ROUND_UP = _comedi.TRIG_ROUND_UP
|
||||
TRIG_ROUND_UP_NEXT = _comedi.TRIG_ROUND_UP_NEXT
|
||||
TRIG_ANY = _comedi.TRIG_ANY
|
||||
TRIG_INVALID = _comedi.TRIG_INVALID
|
||||
TRIG_NONE = _comedi.TRIG_NONE
|
||||
TRIG_NOW = _comedi.TRIG_NOW
|
||||
TRIG_FOLLOW = _comedi.TRIG_FOLLOW
|
||||
TRIG_TIME = _comedi.TRIG_TIME
|
||||
TRIG_TIMER = _comedi.TRIG_TIMER
|
||||
TRIG_COUNT = _comedi.TRIG_COUNT
|
||||
TRIG_EXT = _comedi.TRIG_EXT
|
||||
TRIG_INT = _comedi.TRIG_INT
|
||||
TRIG_OTHER = _comedi.TRIG_OTHER
|
||||
SDF_BUSY = _comedi.SDF_BUSY
|
||||
SDF_BUSY_OWNER = _comedi.SDF_BUSY_OWNER
|
||||
SDF_LOCKED = _comedi.SDF_LOCKED
|
||||
SDF_LOCK_OWNER = _comedi.SDF_LOCK_OWNER
|
||||
SDF_MAXDATA = _comedi.SDF_MAXDATA
|
||||
SDF_FLAGS = _comedi.SDF_FLAGS
|
||||
SDF_RANGETYPE = _comedi.SDF_RANGETYPE
|
||||
SDF_MODE0 = _comedi.SDF_MODE0
|
||||
SDF_MODE1 = _comedi.SDF_MODE1
|
||||
SDF_MODE2 = _comedi.SDF_MODE2
|
||||
SDF_MODE3 = _comedi.SDF_MODE3
|
||||
SDF_MODE4 = _comedi.SDF_MODE4
|
||||
SDF_CMD = _comedi.SDF_CMD
|
||||
SDF_READABLE = _comedi.SDF_READABLE
|
||||
SDF_WRITABLE = _comedi.SDF_WRITABLE
|
||||
SDF_WRITEABLE = _comedi.SDF_WRITEABLE
|
||||
SDF_INTERNAL = _comedi.SDF_INTERNAL
|
||||
SDF_RT = _comedi.SDF_RT
|
||||
SDF_GROUND = _comedi.SDF_GROUND
|
||||
SDF_COMMON = _comedi.SDF_COMMON
|
||||
SDF_DIFF = _comedi.SDF_DIFF
|
||||
SDF_OTHER = _comedi.SDF_OTHER
|
||||
SDF_DITHER = _comedi.SDF_DITHER
|
||||
SDF_DEGLITCH = _comedi.SDF_DEGLITCH
|
||||
SDF_MMAP = _comedi.SDF_MMAP
|
||||
SDF_RUNNING = _comedi.SDF_RUNNING
|
||||
SDF_LSAMPL = _comedi.SDF_LSAMPL
|
||||
SDF_PACKED = _comedi.SDF_PACKED
|
||||
COMEDI_SUBD_UNUSED = _comedi.COMEDI_SUBD_UNUSED
|
||||
COMEDI_SUBD_AI = _comedi.COMEDI_SUBD_AI
|
||||
COMEDI_SUBD_AO = _comedi.COMEDI_SUBD_AO
|
||||
COMEDI_SUBD_DI = _comedi.COMEDI_SUBD_DI
|
||||
COMEDI_SUBD_DO = _comedi.COMEDI_SUBD_DO
|
||||
COMEDI_SUBD_DIO = _comedi.COMEDI_SUBD_DIO
|
||||
COMEDI_SUBD_COUNTER = _comedi.COMEDI_SUBD_COUNTER
|
||||
COMEDI_SUBD_TIMER = _comedi.COMEDI_SUBD_TIMER
|
||||
COMEDI_SUBD_MEMORY = _comedi.COMEDI_SUBD_MEMORY
|
||||
COMEDI_SUBD_CALIB = _comedi.COMEDI_SUBD_CALIB
|
||||
COMEDI_SUBD_PROC = _comedi.COMEDI_SUBD_PROC
|
||||
COMEDI_INPUT = _comedi.COMEDI_INPUT
|
||||
COMEDI_OUTPUT = _comedi.COMEDI_OUTPUT
|
||||
COMEDI_OPENDRAIN = _comedi.COMEDI_OPENDRAIN
|
||||
INSN_CONFIG_ANALOG_TRIG = _comedi.INSN_CONFIG_ANALOG_TRIG
|
||||
INSN_CONFIG_ALT_SOURCE = _comedi.INSN_CONFIG_ALT_SOURCE
|
||||
CIO = _comedi.CIO
|
||||
class comedi_trig_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_trig_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_trig_struct, name)
|
||||
__swig_setmethods__["subdev"] = _comedi.comedi_trig_struct_subdev_set
|
||||
__swig_getmethods__["subdev"] = _comedi.comedi_trig_struct_subdev_get
|
||||
if _newclass:subdev = property(_comedi.comedi_trig_struct_subdev_get,_comedi.comedi_trig_struct_subdev_set)
|
||||
__swig_setmethods__["mode"] = _comedi.comedi_trig_struct_mode_set
|
||||
__swig_getmethods__["mode"] = _comedi.comedi_trig_struct_mode_get
|
||||
if _newclass:mode = property(_comedi.comedi_trig_struct_mode_get,_comedi.comedi_trig_struct_mode_set)
|
||||
__swig_setmethods__["flags"] = _comedi.comedi_trig_struct_flags_set
|
||||
__swig_getmethods__["flags"] = _comedi.comedi_trig_struct_flags_get
|
||||
if _newclass:flags = property(_comedi.comedi_trig_struct_flags_get,_comedi.comedi_trig_struct_flags_set)
|
||||
__swig_setmethods__["n_chan"] = _comedi.comedi_trig_struct_n_chan_set
|
||||
__swig_getmethods__["n_chan"] = _comedi.comedi_trig_struct_n_chan_get
|
||||
if _newclass:n_chan = property(_comedi.comedi_trig_struct_n_chan_get,_comedi.comedi_trig_struct_n_chan_set)
|
||||
__swig_setmethods__["chanlist"] = _comedi.comedi_trig_struct_chanlist_set
|
||||
__swig_getmethods__["chanlist"] = _comedi.comedi_trig_struct_chanlist_get
|
||||
if _newclass:chanlist = property(_comedi.comedi_trig_struct_chanlist_get,_comedi.comedi_trig_struct_chanlist_set)
|
||||
__swig_setmethods__["data"] = _comedi.comedi_trig_struct_data_set
|
||||
__swig_getmethods__["data"] = _comedi.comedi_trig_struct_data_get
|
||||
if _newclass:data = property(_comedi.comedi_trig_struct_data_get,_comedi.comedi_trig_struct_data_set)
|
||||
__swig_setmethods__["n"] = _comedi.comedi_trig_struct_n_set
|
||||
__swig_getmethods__["n"] = _comedi.comedi_trig_struct_n_get
|
||||
if _newclass:n = property(_comedi.comedi_trig_struct_n_get,_comedi.comedi_trig_struct_n_set)
|
||||
__swig_setmethods__["trigsrc"] = _comedi.comedi_trig_struct_trigsrc_set
|
||||
__swig_getmethods__["trigsrc"] = _comedi.comedi_trig_struct_trigsrc_get
|
||||
if _newclass:trigsrc = property(_comedi.comedi_trig_struct_trigsrc_get,_comedi.comedi_trig_struct_trigsrc_set)
|
||||
__swig_setmethods__["trigvar"] = _comedi.comedi_trig_struct_trigvar_set
|
||||
__swig_getmethods__["trigvar"] = _comedi.comedi_trig_struct_trigvar_get
|
||||
if _newclass:trigvar = property(_comedi.comedi_trig_struct_trigvar_get,_comedi.comedi_trig_struct_trigvar_set)
|
||||
__swig_setmethods__["trigvar1"] = _comedi.comedi_trig_struct_trigvar1_set
|
||||
__swig_getmethods__["trigvar1"] = _comedi.comedi_trig_struct_trigvar1_get
|
||||
if _newclass:trigvar1 = property(_comedi.comedi_trig_struct_trigvar1_get,_comedi.comedi_trig_struct_trigvar1_set)
|
||||
__swig_setmethods__["data_len"] = _comedi.comedi_trig_struct_data_len_set
|
||||
__swig_getmethods__["data_len"] = _comedi.comedi_trig_struct_data_len_get
|
||||
if _newclass:data_len = property(_comedi.comedi_trig_struct_data_len_get,_comedi.comedi_trig_struct_data_len_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_trig_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_trig_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_trig_struct_unused_get,_comedi.comedi_trig_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_trig_struct, 'this', apply(_comedi.new_comedi_trig_struct,args))
|
||||
_swig_setattr(self, comedi_trig_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_trig_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_trig_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_trig_structPtr(comedi_trig_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_trig_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_trig_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_trig_struct,self.__class__,comedi_trig_struct)
|
||||
_comedi.comedi_trig_struct_swigregister(comedi_trig_structPtr)
|
||||
|
||||
class comedi_insn_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_insn_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_insn_struct, name)
|
||||
__swig_setmethods__["insn"] = _comedi.comedi_insn_struct_insn_set
|
||||
__swig_getmethods__["insn"] = _comedi.comedi_insn_struct_insn_get
|
||||
if _newclass:insn = property(_comedi.comedi_insn_struct_insn_get,_comedi.comedi_insn_struct_insn_set)
|
||||
__swig_setmethods__["n"] = _comedi.comedi_insn_struct_n_set
|
||||
__swig_getmethods__["n"] = _comedi.comedi_insn_struct_n_get
|
||||
if _newclass:n = property(_comedi.comedi_insn_struct_n_get,_comedi.comedi_insn_struct_n_set)
|
||||
__swig_setmethods__["data"] = _comedi.comedi_insn_struct_data_set
|
||||
__swig_getmethods__["data"] = _comedi.comedi_insn_struct_data_get
|
||||
if _newclass:data = property(_comedi.comedi_insn_struct_data_get,_comedi.comedi_insn_struct_data_set)
|
||||
__swig_setmethods__["subdev"] = _comedi.comedi_insn_struct_subdev_set
|
||||
__swig_getmethods__["subdev"] = _comedi.comedi_insn_struct_subdev_get
|
||||
if _newclass:subdev = property(_comedi.comedi_insn_struct_subdev_get,_comedi.comedi_insn_struct_subdev_set)
|
||||
__swig_setmethods__["chanspec"] = _comedi.comedi_insn_struct_chanspec_set
|
||||
__swig_getmethods__["chanspec"] = _comedi.comedi_insn_struct_chanspec_get
|
||||
if _newclass:chanspec = property(_comedi.comedi_insn_struct_chanspec_get,_comedi.comedi_insn_struct_chanspec_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_insn_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_insn_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_insn_struct_unused_get,_comedi.comedi_insn_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_insn_struct, 'this', apply(_comedi.new_comedi_insn_struct,args))
|
||||
_swig_setattr(self, comedi_insn_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_insn_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_insn_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_insn_structPtr(comedi_insn_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_insn_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_insn_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_insn_struct,self.__class__,comedi_insn_struct)
|
||||
_comedi.comedi_insn_struct_swigregister(comedi_insn_structPtr)
|
||||
|
||||
class comedi_insnlist_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_insnlist_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_insnlist_struct, name)
|
||||
__swig_setmethods__["n_insns"] = _comedi.comedi_insnlist_struct_n_insns_set
|
||||
__swig_getmethods__["n_insns"] = _comedi.comedi_insnlist_struct_n_insns_get
|
||||
if _newclass:n_insns = property(_comedi.comedi_insnlist_struct_n_insns_get,_comedi.comedi_insnlist_struct_n_insns_set)
|
||||
__swig_setmethods__["insns"] = _comedi.comedi_insnlist_struct_insns_set
|
||||
__swig_getmethods__["insns"] = _comedi.comedi_insnlist_struct_insns_get
|
||||
if _newclass:insns = property(_comedi.comedi_insnlist_struct_insns_get,_comedi.comedi_insnlist_struct_insns_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_insnlist_struct, 'this', apply(_comedi.new_comedi_insnlist_struct,args))
|
||||
_swig_setattr(self, comedi_insnlist_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_insnlist_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_insnlist_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_insnlist_structPtr(comedi_insnlist_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_insnlist_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_insnlist_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_insnlist_struct,self.__class__,comedi_insnlist_struct)
|
||||
_comedi.comedi_insnlist_struct_swigregister(comedi_insnlist_structPtr)
|
||||
|
||||
class comedi_cmd_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_cmd_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_cmd_struct, name)
|
||||
__swig_setmethods__["subdev"] = _comedi.comedi_cmd_struct_subdev_set
|
||||
__swig_getmethods__["subdev"] = _comedi.comedi_cmd_struct_subdev_get
|
||||
if _newclass:subdev = property(_comedi.comedi_cmd_struct_subdev_get,_comedi.comedi_cmd_struct_subdev_set)
|
||||
__swig_setmethods__["flags"] = _comedi.comedi_cmd_struct_flags_set
|
||||
__swig_getmethods__["flags"] = _comedi.comedi_cmd_struct_flags_get
|
||||
if _newclass:flags = property(_comedi.comedi_cmd_struct_flags_get,_comedi.comedi_cmd_struct_flags_set)
|
||||
__swig_setmethods__["start_src"] = _comedi.comedi_cmd_struct_start_src_set
|
||||
__swig_getmethods__["start_src"] = _comedi.comedi_cmd_struct_start_src_get
|
||||
if _newclass:start_src = property(_comedi.comedi_cmd_struct_start_src_get,_comedi.comedi_cmd_struct_start_src_set)
|
||||
__swig_setmethods__["start_arg"] = _comedi.comedi_cmd_struct_start_arg_set
|
||||
__swig_getmethods__["start_arg"] = _comedi.comedi_cmd_struct_start_arg_get
|
||||
if _newclass:start_arg = property(_comedi.comedi_cmd_struct_start_arg_get,_comedi.comedi_cmd_struct_start_arg_set)
|
||||
__swig_setmethods__["scan_begin_src"] = _comedi.comedi_cmd_struct_scan_begin_src_set
|
||||
__swig_getmethods__["scan_begin_src"] = _comedi.comedi_cmd_struct_scan_begin_src_get
|
||||
if _newclass:scan_begin_src = property(_comedi.comedi_cmd_struct_scan_begin_src_get,_comedi.comedi_cmd_struct_scan_begin_src_set)
|
||||
__swig_setmethods__["scan_begin_arg"] = _comedi.comedi_cmd_struct_scan_begin_arg_set
|
||||
__swig_getmethods__["scan_begin_arg"] = _comedi.comedi_cmd_struct_scan_begin_arg_get
|
||||
if _newclass:scan_begin_arg = property(_comedi.comedi_cmd_struct_scan_begin_arg_get,_comedi.comedi_cmd_struct_scan_begin_arg_set)
|
||||
__swig_setmethods__["convert_src"] = _comedi.comedi_cmd_struct_convert_src_set
|
||||
__swig_getmethods__["convert_src"] = _comedi.comedi_cmd_struct_convert_src_get
|
||||
if _newclass:convert_src = property(_comedi.comedi_cmd_struct_convert_src_get,_comedi.comedi_cmd_struct_convert_src_set)
|
||||
__swig_setmethods__["convert_arg"] = _comedi.comedi_cmd_struct_convert_arg_set
|
||||
__swig_getmethods__["convert_arg"] = _comedi.comedi_cmd_struct_convert_arg_get
|
||||
if _newclass:convert_arg = property(_comedi.comedi_cmd_struct_convert_arg_get,_comedi.comedi_cmd_struct_convert_arg_set)
|
||||
__swig_setmethods__["scan_end_src"] = _comedi.comedi_cmd_struct_scan_end_src_set
|
||||
__swig_getmethods__["scan_end_src"] = _comedi.comedi_cmd_struct_scan_end_src_get
|
||||
if _newclass:scan_end_src = property(_comedi.comedi_cmd_struct_scan_end_src_get,_comedi.comedi_cmd_struct_scan_end_src_set)
|
||||
__swig_setmethods__["scan_end_arg"] = _comedi.comedi_cmd_struct_scan_end_arg_set
|
||||
__swig_getmethods__["scan_end_arg"] = _comedi.comedi_cmd_struct_scan_end_arg_get
|
||||
if _newclass:scan_end_arg = property(_comedi.comedi_cmd_struct_scan_end_arg_get,_comedi.comedi_cmd_struct_scan_end_arg_set)
|
||||
__swig_setmethods__["stop_src"] = _comedi.comedi_cmd_struct_stop_src_set
|
||||
__swig_getmethods__["stop_src"] = _comedi.comedi_cmd_struct_stop_src_get
|
||||
if _newclass:stop_src = property(_comedi.comedi_cmd_struct_stop_src_get,_comedi.comedi_cmd_struct_stop_src_set)
|
||||
__swig_setmethods__["stop_arg"] = _comedi.comedi_cmd_struct_stop_arg_set
|
||||
__swig_getmethods__["stop_arg"] = _comedi.comedi_cmd_struct_stop_arg_get
|
||||
if _newclass:stop_arg = property(_comedi.comedi_cmd_struct_stop_arg_get,_comedi.comedi_cmd_struct_stop_arg_set)
|
||||
__swig_setmethods__["chanlist"] = _comedi.comedi_cmd_struct_chanlist_set
|
||||
__swig_getmethods__["chanlist"] = _comedi.comedi_cmd_struct_chanlist_get
|
||||
if _newclass:chanlist = property(_comedi.comedi_cmd_struct_chanlist_get,_comedi.comedi_cmd_struct_chanlist_set)
|
||||
__swig_setmethods__["chanlist_len"] = _comedi.comedi_cmd_struct_chanlist_len_set
|
||||
__swig_getmethods__["chanlist_len"] = _comedi.comedi_cmd_struct_chanlist_len_get
|
||||
if _newclass:chanlist_len = property(_comedi.comedi_cmd_struct_chanlist_len_get,_comedi.comedi_cmd_struct_chanlist_len_set)
|
||||
__swig_setmethods__["data"] = _comedi.comedi_cmd_struct_data_set
|
||||
__swig_getmethods__["data"] = _comedi.comedi_cmd_struct_data_get
|
||||
if _newclass:data = property(_comedi.comedi_cmd_struct_data_get,_comedi.comedi_cmd_struct_data_set)
|
||||
__swig_setmethods__["data_len"] = _comedi.comedi_cmd_struct_data_len_set
|
||||
__swig_getmethods__["data_len"] = _comedi.comedi_cmd_struct_data_len_get
|
||||
if _newclass:data_len = property(_comedi.comedi_cmd_struct_data_len_get,_comedi.comedi_cmd_struct_data_len_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_cmd_struct, 'this', apply(_comedi.new_comedi_cmd_struct,args))
|
||||
_swig_setattr(self, comedi_cmd_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_cmd_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_cmd_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_cmd_structPtr(comedi_cmd_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_cmd_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_cmd_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_cmd_struct,self.__class__,comedi_cmd_struct)
|
||||
_comedi.comedi_cmd_struct_swigregister(comedi_cmd_structPtr)
|
||||
|
||||
class comedi_chaninfo_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_chaninfo_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_chaninfo_struct, name)
|
||||
__swig_setmethods__["subdev"] = _comedi.comedi_chaninfo_struct_subdev_set
|
||||
__swig_getmethods__["subdev"] = _comedi.comedi_chaninfo_struct_subdev_get
|
||||
if _newclass:subdev = property(_comedi.comedi_chaninfo_struct_subdev_get,_comedi.comedi_chaninfo_struct_subdev_set)
|
||||
__swig_setmethods__["maxdata_list"] = _comedi.comedi_chaninfo_struct_maxdata_list_set
|
||||
__swig_getmethods__["maxdata_list"] = _comedi.comedi_chaninfo_struct_maxdata_list_get
|
||||
if _newclass:maxdata_list = property(_comedi.comedi_chaninfo_struct_maxdata_list_get,_comedi.comedi_chaninfo_struct_maxdata_list_set)
|
||||
__swig_setmethods__["flaglist"] = _comedi.comedi_chaninfo_struct_flaglist_set
|
||||
__swig_getmethods__["flaglist"] = _comedi.comedi_chaninfo_struct_flaglist_get
|
||||
if _newclass:flaglist = property(_comedi.comedi_chaninfo_struct_flaglist_get,_comedi.comedi_chaninfo_struct_flaglist_set)
|
||||
__swig_setmethods__["rangelist"] = _comedi.comedi_chaninfo_struct_rangelist_set
|
||||
__swig_getmethods__["rangelist"] = _comedi.comedi_chaninfo_struct_rangelist_get
|
||||
if _newclass:rangelist = property(_comedi.comedi_chaninfo_struct_rangelist_get,_comedi.comedi_chaninfo_struct_rangelist_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_chaninfo_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_chaninfo_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_chaninfo_struct_unused_get,_comedi.comedi_chaninfo_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_chaninfo_struct, 'this', apply(_comedi.new_comedi_chaninfo_struct,args))
|
||||
_swig_setattr(self, comedi_chaninfo_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_chaninfo_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_chaninfo_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_chaninfo_structPtr(comedi_chaninfo_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_chaninfo_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_chaninfo_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_chaninfo_struct,self.__class__,comedi_chaninfo_struct)
|
||||
_comedi.comedi_chaninfo_struct_swigregister(comedi_chaninfo_structPtr)
|
||||
|
||||
class comedi_rangeinfo_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_rangeinfo_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_rangeinfo_struct, name)
|
||||
__swig_setmethods__["range_type"] = _comedi.comedi_rangeinfo_struct_range_type_set
|
||||
__swig_getmethods__["range_type"] = _comedi.comedi_rangeinfo_struct_range_type_get
|
||||
if _newclass:range_type = property(_comedi.comedi_rangeinfo_struct_range_type_get,_comedi.comedi_rangeinfo_struct_range_type_set)
|
||||
__swig_setmethods__["range_ptr"] = _comedi.comedi_rangeinfo_struct_range_ptr_set
|
||||
__swig_getmethods__["range_ptr"] = _comedi.comedi_rangeinfo_struct_range_ptr_get
|
||||
if _newclass:range_ptr = property(_comedi.comedi_rangeinfo_struct_range_ptr_get,_comedi.comedi_rangeinfo_struct_range_ptr_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_rangeinfo_struct, 'this', apply(_comedi.new_comedi_rangeinfo_struct,args))
|
||||
_swig_setattr(self, comedi_rangeinfo_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_rangeinfo_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_rangeinfo_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_rangeinfo_structPtr(comedi_rangeinfo_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_rangeinfo_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_rangeinfo_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_rangeinfo_struct,self.__class__,comedi_rangeinfo_struct)
|
||||
_comedi.comedi_rangeinfo_struct_swigregister(comedi_rangeinfo_structPtr)
|
||||
|
||||
class comedi_krange_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_krange_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_krange_struct, name)
|
||||
__swig_setmethods__["min"] = _comedi.comedi_krange_struct_min_set
|
||||
__swig_getmethods__["min"] = _comedi.comedi_krange_struct_min_get
|
||||
if _newclass:min = property(_comedi.comedi_krange_struct_min_get,_comedi.comedi_krange_struct_min_set)
|
||||
__swig_setmethods__["max"] = _comedi.comedi_krange_struct_max_set
|
||||
__swig_getmethods__["max"] = _comedi.comedi_krange_struct_max_get
|
||||
if _newclass:max = property(_comedi.comedi_krange_struct_max_get,_comedi.comedi_krange_struct_max_set)
|
||||
__swig_setmethods__["flags"] = _comedi.comedi_krange_struct_flags_set
|
||||
__swig_getmethods__["flags"] = _comedi.comedi_krange_struct_flags_get
|
||||
if _newclass:flags = property(_comedi.comedi_krange_struct_flags_get,_comedi.comedi_krange_struct_flags_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_krange_struct, 'this', apply(_comedi.new_comedi_krange_struct,args))
|
||||
_swig_setattr(self, comedi_krange_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_krange_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_krange_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_krange_structPtr(comedi_krange_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_krange_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_krange_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_krange_struct,self.__class__,comedi_krange_struct)
|
||||
_comedi.comedi_krange_struct_swigregister(comedi_krange_structPtr)
|
||||
|
||||
class comedi_subdinfo_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_subdinfo_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_subdinfo_struct, name)
|
||||
__swig_setmethods__["type"] = _comedi.comedi_subdinfo_struct_type_set
|
||||
__swig_getmethods__["type"] = _comedi.comedi_subdinfo_struct_type_get
|
||||
if _newclass:type = property(_comedi.comedi_subdinfo_struct_type_get,_comedi.comedi_subdinfo_struct_type_set)
|
||||
__swig_setmethods__["n_chan"] = _comedi.comedi_subdinfo_struct_n_chan_set
|
||||
__swig_getmethods__["n_chan"] = _comedi.comedi_subdinfo_struct_n_chan_get
|
||||
if _newclass:n_chan = property(_comedi.comedi_subdinfo_struct_n_chan_get,_comedi.comedi_subdinfo_struct_n_chan_set)
|
||||
__swig_setmethods__["subd_flags"] = _comedi.comedi_subdinfo_struct_subd_flags_set
|
||||
__swig_getmethods__["subd_flags"] = _comedi.comedi_subdinfo_struct_subd_flags_get
|
||||
if _newclass:subd_flags = property(_comedi.comedi_subdinfo_struct_subd_flags_get,_comedi.comedi_subdinfo_struct_subd_flags_set)
|
||||
__swig_setmethods__["timer_type"] = _comedi.comedi_subdinfo_struct_timer_type_set
|
||||
__swig_getmethods__["timer_type"] = _comedi.comedi_subdinfo_struct_timer_type_get
|
||||
if _newclass:timer_type = property(_comedi.comedi_subdinfo_struct_timer_type_get,_comedi.comedi_subdinfo_struct_timer_type_set)
|
||||
__swig_setmethods__["len_chanlist"] = _comedi.comedi_subdinfo_struct_len_chanlist_set
|
||||
__swig_getmethods__["len_chanlist"] = _comedi.comedi_subdinfo_struct_len_chanlist_get
|
||||
if _newclass:len_chanlist = property(_comedi.comedi_subdinfo_struct_len_chanlist_get,_comedi.comedi_subdinfo_struct_len_chanlist_set)
|
||||
__swig_setmethods__["maxdata"] = _comedi.comedi_subdinfo_struct_maxdata_set
|
||||
__swig_getmethods__["maxdata"] = _comedi.comedi_subdinfo_struct_maxdata_get
|
||||
if _newclass:maxdata = property(_comedi.comedi_subdinfo_struct_maxdata_get,_comedi.comedi_subdinfo_struct_maxdata_set)
|
||||
__swig_setmethods__["flags"] = _comedi.comedi_subdinfo_struct_flags_set
|
||||
__swig_getmethods__["flags"] = _comedi.comedi_subdinfo_struct_flags_get
|
||||
if _newclass:flags = property(_comedi.comedi_subdinfo_struct_flags_get,_comedi.comedi_subdinfo_struct_flags_set)
|
||||
__swig_setmethods__["range_type"] = _comedi.comedi_subdinfo_struct_range_type_set
|
||||
__swig_getmethods__["range_type"] = _comedi.comedi_subdinfo_struct_range_type_get
|
||||
if _newclass:range_type = property(_comedi.comedi_subdinfo_struct_range_type_get,_comedi.comedi_subdinfo_struct_range_type_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_subdinfo_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_subdinfo_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_subdinfo_struct_unused_get,_comedi.comedi_subdinfo_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_subdinfo_struct, 'this', apply(_comedi.new_comedi_subdinfo_struct,args))
|
||||
_swig_setattr(self, comedi_subdinfo_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_subdinfo_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_subdinfo_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_subdinfo_structPtr(comedi_subdinfo_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_subdinfo_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_subdinfo_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_subdinfo_struct,self.__class__,comedi_subdinfo_struct)
|
||||
_comedi.comedi_subdinfo_struct_swigregister(comedi_subdinfo_structPtr)
|
||||
|
||||
class comedi_devinfo_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_devinfo_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_devinfo_struct, name)
|
||||
__swig_setmethods__["version_code"] = _comedi.comedi_devinfo_struct_version_code_set
|
||||
__swig_getmethods__["version_code"] = _comedi.comedi_devinfo_struct_version_code_get
|
||||
if _newclass:version_code = property(_comedi.comedi_devinfo_struct_version_code_get,_comedi.comedi_devinfo_struct_version_code_set)
|
||||
__swig_setmethods__["n_subdevs"] = _comedi.comedi_devinfo_struct_n_subdevs_set
|
||||
__swig_getmethods__["n_subdevs"] = _comedi.comedi_devinfo_struct_n_subdevs_get
|
||||
if _newclass:n_subdevs = property(_comedi.comedi_devinfo_struct_n_subdevs_get,_comedi.comedi_devinfo_struct_n_subdevs_set)
|
||||
__swig_setmethods__["driver_name"] = _comedi.comedi_devinfo_struct_driver_name_set
|
||||
__swig_getmethods__["driver_name"] = _comedi.comedi_devinfo_struct_driver_name_get
|
||||
if _newclass:driver_name = property(_comedi.comedi_devinfo_struct_driver_name_get,_comedi.comedi_devinfo_struct_driver_name_set)
|
||||
__swig_setmethods__["board_name"] = _comedi.comedi_devinfo_struct_board_name_set
|
||||
__swig_getmethods__["board_name"] = _comedi.comedi_devinfo_struct_board_name_get
|
||||
if _newclass:board_name = property(_comedi.comedi_devinfo_struct_board_name_get,_comedi.comedi_devinfo_struct_board_name_set)
|
||||
__swig_setmethods__["read_subdevice"] = _comedi.comedi_devinfo_struct_read_subdevice_set
|
||||
__swig_getmethods__["read_subdevice"] = _comedi.comedi_devinfo_struct_read_subdevice_get
|
||||
if _newclass:read_subdevice = property(_comedi.comedi_devinfo_struct_read_subdevice_get,_comedi.comedi_devinfo_struct_read_subdevice_set)
|
||||
__swig_setmethods__["write_subdevice"] = _comedi.comedi_devinfo_struct_write_subdevice_set
|
||||
__swig_getmethods__["write_subdevice"] = _comedi.comedi_devinfo_struct_write_subdevice_get
|
||||
if _newclass:write_subdevice = property(_comedi.comedi_devinfo_struct_write_subdevice_get,_comedi.comedi_devinfo_struct_write_subdevice_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_devinfo_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_devinfo_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_devinfo_struct_unused_get,_comedi.comedi_devinfo_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_devinfo_struct, 'this', apply(_comedi.new_comedi_devinfo_struct,args))
|
||||
_swig_setattr(self, comedi_devinfo_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_devinfo_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_devinfo_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_devinfo_structPtr(comedi_devinfo_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_devinfo_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_devinfo_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_devinfo_struct,self.__class__,comedi_devinfo_struct)
|
||||
_comedi.comedi_devinfo_struct_swigregister(comedi_devinfo_structPtr)
|
||||
|
||||
class comedi_devconfig_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_devconfig_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_devconfig_struct, name)
|
||||
__swig_setmethods__["board_name"] = _comedi.comedi_devconfig_struct_board_name_set
|
||||
__swig_getmethods__["board_name"] = _comedi.comedi_devconfig_struct_board_name_get
|
||||
if _newclass:board_name = property(_comedi.comedi_devconfig_struct_board_name_get,_comedi.comedi_devconfig_struct_board_name_set)
|
||||
__swig_setmethods__["options"] = _comedi.comedi_devconfig_struct_options_set
|
||||
__swig_getmethods__["options"] = _comedi.comedi_devconfig_struct_options_get
|
||||
if _newclass:options = property(_comedi.comedi_devconfig_struct_options_get,_comedi.comedi_devconfig_struct_options_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_devconfig_struct, 'this', apply(_comedi.new_comedi_devconfig_struct,args))
|
||||
_swig_setattr(self, comedi_devconfig_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_devconfig_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_devconfig_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_devconfig_structPtr(comedi_devconfig_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_devconfig_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_devconfig_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_devconfig_struct,self.__class__,comedi_devconfig_struct)
|
||||
_comedi.comedi_devconfig_struct_swigregister(comedi_devconfig_structPtr)
|
||||
|
||||
class comedi_bufconfig_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_bufconfig_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_bufconfig_struct, name)
|
||||
__swig_setmethods__["subdevice"] = _comedi.comedi_bufconfig_struct_subdevice_set
|
||||
__swig_getmethods__["subdevice"] = _comedi.comedi_bufconfig_struct_subdevice_get
|
||||
if _newclass:subdevice = property(_comedi.comedi_bufconfig_struct_subdevice_get,_comedi.comedi_bufconfig_struct_subdevice_set)
|
||||
__swig_setmethods__["flags"] = _comedi.comedi_bufconfig_struct_flags_set
|
||||
__swig_getmethods__["flags"] = _comedi.comedi_bufconfig_struct_flags_get
|
||||
if _newclass:flags = property(_comedi.comedi_bufconfig_struct_flags_get,_comedi.comedi_bufconfig_struct_flags_set)
|
||||
__swig_setmethods__["maximum_size"] = _comedi.comedi_bufconfig_struct_maximum_size_set
|
||||
__swig_getmethods__["maximum_size"] = _comedi.comedi_bufconfig_struct_maximum_size_get
|
||||
if _newclass:maximum_size = property(_comedi.comedi_bufconfig_struct_maximum_size_get,_comedi.comedi_bufconfig_struct_maximum_size_set)
|
||||
__swig_setmethods__["size"] = _comedi.comedi_bufconfig_struct_size_set
|
||||
__swig_getmethods__["size"] = _comedi.comedi_bufconfig_struct_size_get
|
||||
if _newclass:size = property(_comedi.comedi_bufconfig_struct_size_get,_comedi.comedi_bufconfig_struct_size_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_bufconfig_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_bufconfig_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_bufconfig_struct_unused_get,_comedi.comedi_bufconfig_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_bufconfig_struct, 'this', apply(_comedi.new_comedi_bufconfig_struct,args))
|
||||
_swig_setattr(self, comedi_bufconfig_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_bufconfig_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_bufconfig_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_bufconfig_structPtr(comedi_bufconfig_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_bufconfig_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_bufconfig_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_bufconfig_struct,self.__class__,comedi_bufconfig_struct)
|
||||
_comedi.comedi_bufconfig_struct_swigregister(comedi_bufconfig_structPtr)
|
||||
|
||||
class comedi_bufinfo_struct(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_bufinfo_struct, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_bufinfo_struct, name)
|
||||
__swig_setmethods__["subdevice"] = _comedi.comedi_bufinfo_struct_subdevice_set
|
||||
__swig_getmethods__["subdevice"] = _comedi.comedi_bufinfo_struct_subdevice_get
|
||||
if _newclass:subdevice = property(_comedi.comedi_bufinfo_struct_subdevice_get,_comedi.comedi_bufinfo_struct_subdevice_set)
|
||||
__swig_setmethods__["bytes_read"] = _comedi.comedi_bufinfo_struct_bytes_read_set
|
||||
__swig_getmethods__["bytes_read"] = _comedi.comedi_bufinfo_struct_bytes_read_get
|
||||
if _newclass:bytes_read = property(_comedi.comedi_bufinfo_struct_bytes_read_get,_comedi.comedi_bufinfo_struct_bytes_read_set)
|
||||
__swig_setmethods__["buf_int_ptr"] = _comedi.comedi_bufinfo_struct_buf_int_ptr_set
|
||||
__swig_getmethods__["buf_int_ptr"] = _comedi.comedi_bufinfo_struct_buf_int_ptr_get
|
||||
if _newclass:buf_int_ptr = property(_comedi.comedi_bufinfo_struct_buf_int_ptr_get,_comedi.comedi_bufinfo_struct_buf_int_ptr_set)
|
||||
__swig_setmethods__["buf_user_ptr"] = _comedi.comedi_bufinfo_struct_buf_user_ptr_set
|
||||
__swig_getmethods__["buf_user_ptr"] = _comedi.comedi_bufinfo_struct_buf_user_ptr_get
|
||||
if _newclass:buf_user_ptr = property(_comedi.comedi_bufinfo_struct_buf_user_ptr_get,_comedi.comedi_bufinfo_struct_buf_user_ptr_set)
|
||||
__swig_setmethods__["buf_int_count"] = _comedi.comedi_bufinfo_struct_buf_int_count_set
|
||||
__swig_getmethods__["buf_int_count"] = _comedi.comedi_bufinfo_struct_buf_int_count_get
|
||||
if _newclass:buf_int_count = property(_comedi.comedi_bufinfo_struct_buf_int_count_get,_comedi.comedi_bufinfo_struct_buf_int_count_set)
|
||||
__swig_setmethods__["buf_user_count"] = _comedi.comedi_bufinfo_struct_buf_user_count_set
|
||||
__swig_getmethods__["buf_user_count"] = _comedi.comedi_bufinfo_struct_buf_user_count_get
|
||||
if _newclass:buf_user_count = property(_comedi.comedi_bufinfo_struct_buf_user_count_get,_comedi.comedi_bufinfo_struct_buf_user_count_set)
|
||||
__swig_setmethods__["unused"] = _comedi.comedi_bufinfo_struct_unused_set
|
||||
__swig_getmethods__["unused"] = _comedi.comedi_bufinfo_struct_unused_get
|
||||
if _newclass:unused = property(_comedi.comedi_bufinfo_struct_unused_get,_comedi.comedi_bufinfo_struct_unused_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_bufinfo_struct, 'this', apply(_comedi.new_comedi_bufinfo_struct,args))
|
||||
_swig_setattr(self, comedi_bufinfo_struct, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_bufinfo_struct):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_bufinfo_struct instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_bufinfo_structPtr(comedi_bufinfo_struct):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_bufinfo_struct, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_bufinfo_struct, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_bufinfo_struct,self.__class__,comedi_bufinfo_struct)
|
||||
_comedi.comedi_bufinfo_struct_swigregister(comedi_bufinfo_structPtr)
|
||||
|
||||
RF_EXTERNAL = _comedi.RF_EXTERNAL
|
||||
UNIT_volt = _comedi.UNIT_volt
|
||||
UNIT_mA = _comedi.UNIT_mA
|
||||
UNIT_none = _comedi.UNIT_none
|
||||
COMEDI_CB_EOS = _comedi.COMEDI_CB_EOS
|
||||
COMEDI_CB_EOA = _comedi.COMEDI_CB_EOA
|
||||
COMEDI_CB_BLOCK = _comedi.COMEDI_CB_BLOCK
|
||||
COMEDI_CB_EOBUF = _comedi.COMEDI_CB_EOBUF
|
||||
COMEDI_CB_ERROR = _comedi.COMEDI_CB_ERROR
|
||||
class comedi_range(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_range, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_range, name)
|
||||
__swig_setmethods__["min"] = _comedi.comedi_range_min_set
|
||||
__swig_getmethods__["min"] = _comedi.comedi_range_min_get
|
||||
if _newclass:min = property(_comedi.comedi_range_min_get,_comedi.comedi_range_min_set)
|
||||
__swig_setmethods__["max"] = _comedi.comedi_range_max_set
|
||||
__swig_getmethods__["max"] = _comedi.comedi_range_max_get
|
||||
if _newclass:max = property(_comedi.comedi_range_max_get,_comedi.comedi_range_max_set)
|
||||
__swig_setmethods__["unit"] = _comedi.comedi_range_unit_set
|
||||
__swig_getmethods__["unit"] = _comedi.comedi_range_unit_get
|
||||
if _newclass:unit = property(_comedi.comedi_range_unit_get,_comedi.comedi_range_unit_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_range, 'this', apply(_comedi.new_comedi_range,args))
|
||||
_swig_setattr(self, comedi_range, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_range):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_range instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_rangePtr(comedi_range):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_range, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_range, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_range,self.__class__,comedi_range)
|
||||
_comedi.comedi_range_swigregister(comedi_rangePtr)
|
||||
|
||||
class comedi_sv_t(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, comedi_sv_t, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, comedi_sv_t, name)
|
||||
__swig_setmethods__["dev"] = _comedi.comedi_sv_t_dev_set
|
||||
__swig_getmethods__["dev"] = _comedi.comedi_sv_t_dev_get
|
||||
if _newclass:dev = property(_comedi.comedi_sv_t_dev_get,_comedi.comedi_sv_t_dev_set)
|
||||
__swig_setmethods__["subdevice"] = _comedi.comedi_sv_t_subdevice_set
|
||||
__swig_getmethods__["subdevice"] = _comedi.comedi_sv_t_subdevice_get
|
||||
if _newclass:subdevice = property(_comedi.comedi_sv_t_subdevice_get,_comedi.comedi_sv_t_subdevice_set)
|
||||
__swig_setmethods__["chan"] = _comedi.comedi_sv_t_chan_set
|
||||
__swig_getmethods__["chan"] = _comedi.comedi_sv_t_chan_get
|
||||
if _newclass:chan = property(_comedi.comedi_sv_t_chan_get,_comedi.comedi_sv_t_chan_set)
|
||||
__swig_setmethods__["range"] = _comedi.comedi_sv_t_range_set
|
||||
__swig_getmethods__["range"] = _comedi.comedi_sv_t_range_get
|
||||
if _newclass:range = property(_comedi.comedi_sv_t_range_get,_comedi.comedi_sv_t_range_set)
|
||||
__swig_setmethods__["aref"] = _comedi.comedi_sv_t_aref_set
|
||||
__swig_getmethods__["aref"] = _comedi.comedi_sv_t_aref_get
|
||||
if _newclass:aref = property(_comedi.comedi_sv_t_aref_get,_comedi.comedi_sv_t_aref_set)
|
||||
__swig_setmethods__["n"] = _comedi.comedi_sv_t_n_set
|
||||
__swig_getmethods__["n"] = _comedi.comedi_sv_t_n_get
|
||||
if _newclass:n = property(_comedi.comedi_sv_t_n_get,_comedi.comedi_sv_t_n_set)
|
||||
__swig_setmethods__["maxdata"] = _comedi.comedi_sv_t_maxdata_set
|
||||
__swig_getmethods__["maxdata"] = _comedi.comedi_sv_t_maxdata_get
|
||||
if _newclass:maxdata = property(_comedi.comedi_sv_t_maxdata_get,_comedi.comedi_sv_t_maxdata_set)
|
||||
def __init__(self,*args):
|
||||
_swig_setattr(self, comedi_sv_t, 'this', apply(_comedi.new_comedi_sv_t,args))
|
||||
_swig_setattr(self, comedi_sv_t, 'thisown', 1)
|
||||
def __del__(self, destroy= _comedi.delete_comedi_sv_t):
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
def __repr__(self):
|
||||
return "<C comedi_sv_t instance at %s>" % (self.this,)
|
||||
|
||||
class comedi_sv_tPtr(comedi_sv_t):
|
||||
def __init__(self,this):
|
||||
_swig_setattr(self, comedi_sv_t, 'this', this)
|
||||
if not hasattr(self,"thisown"): _swig_setattr(self, comedi_sv_t, 'thisown', 0)
|
||||
_swig_setattr(self, comedi_sv_t,self.__class__,comedi_sv_t)
|
||||
_comedi.comedi_sv_t_swigregister(comedi_sv_tPtr)
|
||||
|
||||
COMEDI_OOR_NUMBER = _comedi.COMEDI_OOR_NUMBER
|
||||
COMEDI_OOR_NAN = _comedi.COMEDI_OOR_NAN
|
||||
comedi_open = _comedi.comedi_open
|
||||
|
||||
comedi_close = _comedi.comedi_close
|
||||
|
||||
comedi_loglevel = _comedi.comedi_loglevel
|
||||
|
||||
comedi_perror = _comedi.comedi_perror
|
||||
|
||||
comedi_strerror = _comedi.comedi_strerror
|
||||
|
||||
comedi_errno = _comedi.comedi_errno
|
||||
|
||||
comedi_fileno = _comedi.comedi_fileno
|
||||
|
||||
comedi_set_global_oor_behavior = _comedi.comedi_set_global_oor_behavior
|
||||
|
||||
comedi_get_n_subdevices = _comedi.comedi_get_n_subdevices
|
||||
|
||||
comedi_get_version_code = _comedi.comedi_get_version_code
|
||||
|
||||
comedi_get_driver_name = _comedi.comedi_get_driver_name
|
||||
|
||||
comedi_get_board_name = _comedi.comedi_get_board_name
|
||||
|
||||
comedi_get_read_subdevice = _comedi.comedi_get_read_subdevice
|
||||
|
||||
comedi_get_write_subdevice = _comedi.comedi_get_write_subdevice
|
||||
|
||||
comedi_get_subdevice_type = _comedi.comedi_get_subdevice_type
|
||||
|
||||
comedi_find_subdevice_by_type = _comedi.comedi_find_subdevice_by_type
|
||||
|
||||
comedi_get_subdevice_flags = _comedi.comedi_get_subdevice_flags
|
||||
|
||||
comedi_get_n_channels = _comedi.comedi_get_n_channels
|
||||
|
||||
comedi_range_is_chan_specific = _comedi.comedi_range_is_chan_specific
|
||||
|
||||
comedi_maxdata_is_chan_specific = _comedi.comedi_maxdata_is_chan_specific
|
||||
|
||||
comedi_get_maxdata = _comedi.comedi_get_maxdata
|
||||
|
||||
comedi_get_n_ranges = _comedi.comedi_get_n_ranges
|
||||
|
||||
comedi_get_range = _comedi.comedi_get_range
|
||||
|
||||
comedi_find_range = _comedi.comedi_find_range
|
||||
|
||||
comedi_get_buffer_size = _comedi.comedi_get_buffer_size
|
||||
|
||||
comedi_get_max_buffer_size = _comedi.comedi_get_max_buffer_size
|
||||
|
||||
comedi_set_buffer_size = _comedi.comedi_set_buffer_size
|
||||
|
||||
comedi_do_insnlist = _comedi.comedi_do_insnlist
|
||||
|
||||
comedi_do_insn = _comedi.comedi_do_insn
|
||||
|
||||
comedi_lock = _comedi.comedi_lock
|
||||
|
||||
comedi_unlock = _comedi.comedi_unlock
|
||||
|
||||
comedi_to_phys = _comedi.comedi_to_phys
|
||||
|
||||
comedi_from_phys = _comedi.comedi_from_phys
|
||||
|
||||
comedi_sampl_to_phys = _comedi.comedi_sampl_to_phys
|
||||
|
||||
comedi_sampl_from_phys = _comedi.comedi_sampl_from_phys
|
||||
|
||||
comedi_data_read = _comedi.comedi_data_read
|
||||
|
||||
comedi_data_read_n = _comedi.comedi_data_read_n
|
||||
|
||||
comedi_data_read_hint = _comedi.comedi_data_read_hint
|
||||
|
||||
comedi_data_read_delayed = _comedi.comedi_data_read_delayed
|
||||
|
||||
comedi_data_write = _comedi.comedi_data_write
|
||||
|
||||
comedi_dio_config = _comedi.comedi_dio_config
|
||||
|
||||
comedi_dio_read = _comedi.comedi_dio_read
|
||||
|
||||
comedi_dio_write = _comedi.comedi_dio_write
|
||||
|
||||
comedi_dio_bitfield = _comedi.comedi_dio_bitfield
|
||||
|
||||
comedi_sv_init = _comedi.comedi_sv_init
|
||||
|
||||
comedi_sv_update = _comedi.comedi_sv_update
|
||||
|
||||
comedi_sv_measure = _comedi.comedi_sv_measure
|
||||
|
||||
comedi_get_cmd_src_mask = _comedi.comedi_get_cmd_src_mask
|
||||
|
||||
comedi_get_cmd_generic_timed = _comedi.comedi_get_cmd_generic_timed
|
||||
|
||||
comedi_cancel = _comedi.comedi_cancel
|
||||
|
||||
comedi_command = _comedi.comedi_command
|
||||
|
||||
comedi_command_test = _comedi.comedi_command_test
|
||||
|
||||
comedi_poll = _comedi.comedi_poll
|
||||
|
||||
comedi_set_max_buffer_size = _comedi.comedi_set_max_buffer_size
|
||||
|
||||
comedi_get_buffer_contents = _comedi.comedi_get_buffer_contents
|
||||
|
||||
comedi_mark_buffer_read = _comedi.comedi_mark_buffer_read
|
||||
|
||||
comedi_get_buffer_offset = _comedi.comedi_get_buffer_offset
|
||||
|
||||
|
6442
python/comedi_wrap.c
Normal file
6442
python/comedi_wrap.c
Normal file
File diff suppressed because it is too large
Load diff
1065
python/comedi_wrap.doc
Normal file
1065
python/comedi_wrap.doc
Normal file
File diff suppressed because it is too large
Load diff
469
python/compy.c
469
python/compy.c
|
@ -1,469 +0,0 @@
|
|||
/* Compy: COMedi PYthon interface
|
||||
* A simple hack sharded object for importing into Python
|
||||
* to start using Comedi drivers for Digital I/O
|
||||
*
|
||||
* Extensively referenced xxmodule.c and others from python distribution
|
||||
* misc comedi examples.
|
||||
*
|
||||
* Blaine Lee Copyright 11/2000 Licence LGPL 2.0
|
||||
*
|
||||
* V 0.4 Major additions to add support for more of the comedilib
|
||||
* functions. So far we have support for the comedi_ commands
|
||||
* open, close, get_n_subdevices, get_driver_name, get_board_name
|
||||
* get_n_channels, get_maxdata, get_n_ranges, get_range,
|
||||
* to_phys, from_phys, data_read. Changed the way the debug
|
||||
* and printstatus code works.
|
||||
* V 0.3 changed to tuple parsing & added version number __version__()
|
||||
* V 0.21 Resynced with sorce that had printstats debugging code in it
|
||||
* V 0.2 Added card number, so that multiple cards are supported
|
||||
* V 0.1 First release, only 'trig' type transfers are supported
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Python.h>
|
||||
#include <stdio.h> /* for printf() */
|
||||
#include <comedilib.h>
|
||||
|
||||
#define Version 4
|
||||
|
||||
#define maxcards 4
|
||||
|
||||
static comedi_t *compy_it[maxcards];
|
||||
#ifdef _COMEDILIB_DEPRECATED
|
||||
static comedi_trig trig;
|
||||
static int trigchan[2];
|
||||
static short trigdata;
|
||||
#endif
|
||||
/******************************
|
||||
* Debug flags - set with the
|
||||
* open call. Output is sent
|
||||
* to stderr.
|
||||
*****************************/
|
||||
static int printstats=0; // if 1 prints mostly the received calling parms
|
||||
static int debug = 0; // if 1 print details of function calls
|
||||
|
||||
/******************************
|
||||
* compy_open()
|
||||
* opens the requested comedi device
|
||||
* args - a tuple containing
|
||||
* int - board number (0 to maxcards)
|
||||
* string - the comedi device to open
|
||||
* int - printstats 0-no, 1-yes, 2-also debug
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_open( PyObject *self, PyObject *args )
|
||||
{
|
||||
const char *filen;
|
||||
int card;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "isi", &card, &filen, &printstats))
|
||||
return NULL;
|
||||
if (printstats > 1)
|
||||
debug = 1;
|
||||
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy open '%s'\n",filen);
|
||||
|
||||
compy_it[card]=comedi_open(filen);
|
||||
|
||||
if(debug)
|
||||
fprintf(stderr,"open returned %p\n",compy_it[card]);
|
||||
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_close()
|
||||
* close the requested comedi device
|
||||
* args - a tuple containing
|
||||
* int - board number (0 to maxcards)
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_close( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i", &card))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy close %d\n",card);
|
||||
comedi_close(compy_it[card]);
|
||||
|
||||
return Py_BuildValue("i", 1);
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_n_subdevices()
|
||||
* get the number of subdevices
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* returns the number of subdevices on card
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_n_subdevices( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:get_n_subdevices", &card))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_n_subdevices %d\n",card);
|
||||
|
||||
return Py_BuildValue("i", comedi_get_n_subdevices(compy_it[card]));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_driver_name()
|
||||
* get the number of subdevices
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* returns the name of the driver for the board
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_driver_name( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:get_driver_name", &card))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_driver_name (%d)\n",card);
|
||||
|
||||
return Py_BuildValue("s", comedi_get_driver_name(compy_it[card]));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_board_name()
|
||||
* get the number of subdevices
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* returns the name of the driver for the board
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_board_name( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:get_board_name", &card))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_board_name (%d)\n",card);
|
||||
|
||||
return Py_BuildValue("s", comedi_get_board_name(compy_it[card]));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_subdevice_type()
|
||||
* get the number of subdevices
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* returns the name of the driver for the board
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_subdevice_type( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
int sub_dev;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii:get_subdevice_type", &card,&sub_dev))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_subdevice_type (%d)\n",card);
|
||||
|
||||
return Py_BuildValue("i", comedi_get_subdevice_type(compy_it[card],sub_dev));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_n_channels()
|
||||
* get the number of channels on subdevice
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* int - subdevice
|
||||
* returns number of channels on subdevice
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_n_channels( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
int sub_dev;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "ii", &card, &sub_dev))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_n_channels ( %d, %d)\n",card,sub_dev);
|
||||
|
||||
return Py_BuildValue("i", comedi_get_n_channels(compy_it[card],sub_dev));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_maxdata()
|
||||
* get the maxdata value for a channel
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* int - subdevice number
|
||||
* int - channel number
|
||||
* returns maximum sample value for channel (0 on error)
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_maxdata( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
int sub_dev;
|
||||
int channel;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iii:maxdata", &card,&sub_dev,&channel))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_maxdata ( %d, %d, %d)\n",card,sub_dev,channel);
|
||||
|
||||
return Py_BuildValue("i", comedi_get_maxdata(compy_it[card],sub_dev,channel));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_n_ranges()
|
||||
* get the number of ranges a channel
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* int - subdevice number
|
||||
* int - channel number
|
||||
* returns number of ranges for channel (-1 on error)
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_n_ranges( PyObject *self, PyObject *args )
|
||||
{
|
||||
int card;
|
||||
int sub_dev;
|
||||
int channel;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iii:get_n_ranges", &card,&sub_dev,&channel))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_n_ranges ( %d, %d, %d)\n",card,sub_dev,channel);
|
||||
|
||||
return Py_BuildValue("i", comedi_get_n_ranges(compy_it[card],sub_dev,channel));
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_get_range()
|
||||
* get the number of ranges a channel
|
||||
* args -
|
||||
* int - board number (0 to maxcards)
|
||||
* int - subdevice number
|
||||
* int - channel number
|
||||
* returns range information on channel
|
||||
* tuple containing
|
||||
* min value
|
||||
* max value
|
||||
* units ( 0-volts, 1-mAmps, 2-none)
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_get_range( PyObject *self, PyObject *args )
|
||||
{
|
||||
comedi_range *rng_p;
|
||||
int card;
|
||||
int sub_dev;
|
||||
int channel;
|
||||
int range;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iiii:get_range", &card,&sub_dev,&channel,&range))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_n_ranges ( %d, %d, %d, %d)\n",card,sub_dev,channel,range);
|
||||
|
||||
if ((rng_p = comedi_get_range(compy_it[card],sub_dev,channel,range))==NULL)
|
||||
return NULL;
|
||||
else
|
||||
return Py_BuildValue("ddi", rng_p->min, rng_p->max, rng_p->unit);
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_to_phys()
|
||||
* convert sample to physical units
|
||||
* args -
|
||||
* int - data
|
||||
* tuple containing range information
|
||||
* min value
|
||||
* max value
|
||||
* units ( 0-volts, 1-mAmps, 2-none)
|
||||
* int - maxdata value for channel
|
||||
* returns physical value (volts) for input
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_to_phys( PyObject *self, PyObject *args )
|
||||
{
|
||||
comedi_range rng;
|
||||
lsampl_t data;
|
||||
lsampl_t maxdata;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i(ddi)i:to_phys",
|
||||
&data,&rng.min,&rng.max,&rng.unit,&maxdata))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_to_phys ( %d, %8.3f, %8.3f, %d, %d)\n",
|
||||
data,rng.min,rng.max,rng.unit,maxdata);
|
||||
|
||||
return Py_BuildValue("d",comedi_to_phys(data,&rng, maxdata) );
|
||||
}
|
||||
|
||||
/******************************
|
||||
* compy_from_phys()
|
||||
* convert physical units to sample
|
||||
* args -
|
||||
* int - data
|
||||
* tuple containing range information
|
||||
* min value
|
||||
* max value
|
||||
* units ( 0-volts, 1-mAmps, 2-none)
|
||||
* int - maxdata value for channel
|
||||
* returns the sample value (0-maxdata)
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_from_phys( PyObject *self, PyObject *args )
|
||||
{
|
||||
comedi_range rng;
|
||||
double data;
|
||||
lsampl_t maxdata;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "d(ddi)i:from_phys",
|
||||
&data,&rng.min,&rng.max,&rng.unit,&maxdata))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy get_from_phys ( %8.3f, %8.3f, %8.3f, %d, %d)\n",
|
||||
data,rng.min,rng.max,rng.unit,maxdata);
|
||||
|
||||
return Py_BuildValue("i",comedi_from_phys(data,&rng, maxdata) );
|
||||
}
|
||||
/******************************
|
||||
* compy_data_read()
|
||||
* read the requested comedi device
|
||||
* args -
|
||||
* tuple containing
|
||||
* int - board number (0 to maxcards)
|
||||
* int - subdevice number
|
||||
* int - channel number
|
||||
* int - range
|
||||
* int - aref
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_data_read(PyObject *self, PyObject *args)
|
||||
{
|
||||
int card;
|
||||
int subd, chan;
|
||||
unsigned int range = 0;
|
||||
unsigned int aref = 0;
|
||||
lsampl_t data;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "(ii)i|ii:data_read", &card, &subd, &chan,&range,&aref))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(debug)
|
||||
fprintf(stderr,"compy_data_read dev %d subd %d chan %d range %d aref %d\n",card,subd,chan,range,aref);
|
||||
|
||||
comedi_data_read(compy_it[card],subd,chan,range,aref,&data);
|
||||
|
||||
if(debug)
|
||||
fprintf(stderr,"comedi_data_read value %d\n",data);
|
||||
|
||||
return Py_BuildValue("l", data);
|
||||
}
|
||||
|
||||
#ifdef _COMEDILIB_DEPRECATED
|
||||
/******************************
|
||||
* compy_trig()
|
||||
* read the requested comedi device
|
||||
* args - a tuple containing
|
||||
* int - board number (0 to maxcards)
|
||||
* int - subdevice number
|
||||
* int - channel number
|
||||
******************************/
|
||||
static PyObject *
|
||||
compy_trig( PyObject *self, PyObject *args )
|
||||
{
|
||||
int dev, chan, data;
|
||||
int card;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "(iii)i", &card, &dev, &chan, &data))
|
||||
return NULL;
|
||||
if ((card < 0) || (card >= maxcards))
|
||||
return NULL;
|
||||
if(printstats)
|
||||
fprintf(stderr,"compy trig card %d dev %d chanel %d val %d\n",card,dev,chan,data);
|
||||
|
||||
trig.subdev=dev;
|
||||
trig.chanlist[0]=chan;
|
||||
trig.data[0]=data;
|
||||
|
||||
comedi_trigger(compy_it[card],&trig);
|
||||
|
||||
return Py_BuildValue("i", trig.data[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static PyObject *
|
||||
compy_version( PyObject *self, PyObject *args )
|
||||
{
|
||||
if(printstats)
|
||||
fprintf(stderr,"Compy version %d\n",Version);
|
||||
|
||||
return Py_BuildValue("i", Version);
|
||||
}
|
||||
|
||||
|
||||
/* List of functions defined in the module */
|
||||
|
||||
static PyMethodDef comedi_methods[] = {
|
||||
{"open", compy_open, METH_VARARGS},
|
||||
{"close", compy_close, METH_VARARGS},
|
||||
{"get_n_subdevices",compy_get_n_subdevices, METH_VARARGS},
|
||||
{"get_driver_name", compy_get_driver_name, METH_VARARGS},
|
||||
{"get_board_name", compy_get_board_name, METH_VARARGS},
|
||||
{"get_subdevice_type",compy_get_subdevice_type, METH_VARARGS},
|
||||
{"get_n_channels", compy_get_n_channels, METH_VARARGS},
|
||||
{"get_maxdata", compy_get_maxdata, METH_VARARGS},
|
||||
{"get_n_ranges", compy_get_n_ranges, METH_VARARGS},
|
||||
{"get_range", compy_get_range, METH_VARARGS},
|
||||
#ifdef _COMEDILIB_DEPRECATED
|
||||
{"trig", compy_trig, METH_VARARGS},
|
||||
#endif
|
||||
{"to_phys", compy_to_phys, METH_VARARGS},
|
||||
{"from_phys", compy_from_phys, METH_VARARGS},
|
||||
{"data_read", compy_data_read, METH_VARARGS},
|
||||
{"__version__", compy_version, METH_VARARGS},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
static char comedi_doc[] = "Module to interface comedi library to Python\n";
|
||||
|
||||
/* Initialization function for the module (*must* be called initxx) */
|
||||
|
||||
DL_EXPORT(void)
|
||||
initcomedi(void)
|
||||
{
|
||||
/* Create the module and add the functions */
|
||||
(void) Py_InitModule3("comedi", comedi_methods, comedi_doc);
|
||||
}
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#! /usr/bin/env python
|
||||
|
||||
# Sample.py sample code to use python with comedi via the compy interface.
|
||||
# Compy: COMedi PYthon interface
|
||||
#
|
||||
# Blaine Lee Copyright 11/2000 Licence GPL 2.0
|
||||
#
|
||||
# V0 hacked out of working code for others to look at.
|
||||
|
||||
############# imports
|
||||
import os
|
||||
import stat
|
||||
import time
|
||||
import comedi # important if you want to use compy
|
||||
from string import *
|
||||
|
||||
comedi.open(0,"/dev/comedi0",1)
|
||||
|
||||
val = comedi.data_read((0,0,0));
|
||||
print val
|
||||
|
||||
comedi.close(0)
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
#! /usr/bin/env python
|
||||
#
|
||||
# Sample1.py sample code to use python with comedi via the compy interface.
|
||||
# Compy: COMedi PYthon interface
|
||||
#
|
||||
# Blaine Lee Copyright 11/2000 Licence GPL 2.0
|
||||
#
|
||||
# V1 reworkd sample.py to test a number of the new functions added to
|
||||
# compy.c. Seems to work with the das16 driver. John Conner - 20020304
|
||||
# V0 hacked out of working code for others to look at.
|
||||
|
||||
############# imports
|
||||
import os
|
||||
import stat
|
||||
import time
|
||||
import comedi # important if you want to use compy
|
||||
from string import *
|
||||
|
||||
board = 0
|
||||
sub_dev = 0
|
||||
brd_dev = (board,sub_dev)
|
||||
channel = 0
|
||||
|
||||
debug_level = 0
|
||||
|
||||
comedi.open(board,"/dev/comedi0",debug_level)
|
||||
print 'The compy versions is ', comedi.__version__()
|
||||
|
||||
driver_name = comedi.get_driver_name(board)
|
||||
board_name = comedi.get_board_name(board)
|
||||
num_subdevices = comedi.get_n_subdevices(board)
|
||||
print 'The board uses driver %s, is named %s and has %d subdevices'%(
|
||||
driver_name,board_name,num_subdevices)
|
||||
for subdevice in range(0,num_subdevices):
|
||||
print '\tsubdevice %d is type %d'%(
|
||||
subdevice,comedi.get_subdevice_type(board,subdevice))
|
||||
print 'Subdevice %d has %d channels'%(
|
||||
sub_dev,comedi.get_n_channels(board,sub_dev))
|
||||
|
||||
maxdata = comedi.get_maxdata(board,sub_dev,channel)
|
||||
print 'The maximum input count for channel %d is %d'%(channel,maxdata)
|
||||
num_ranges = comedi.get_n_ranges(board,sub_dev,channel)
|
||||
print 'Channel %d has %d ranges'%(channel,num_ranges)
|
||||
for rng in range(0,num_ranges):
|
||||
(min,max,unit) = comedi.get_range(board,sub_dev,channel,rng)
|
||||
if unit == 0: unit = 'volts'
|
||||
if unit == 1: unit = 'mAmps'
|
||||
if unit == 2: unit = ''
|
||||
print '\trange %d %8.3f -- %8.3f %s'%(rng,min,max,unit)
|
||||
|
||||
rng = 0
|
||||
(min,max,unit) = comedi.get_range(board,sub_dev,channel,rng)
|
||||
val = comedi.data_read(brd_dev,channel,rng,0);
|
||||
volt = comedi.to_phys(val,(min,max,unit),maxdata);
|
||||
print 'range = %d input = %6d (%6d) or %8.4f volts'%(rng, val, val-32768, volt)
|
||||
|
||||
rng = 1
|
||||
(min,max,unit) = comedi.get_range(board,sub_dev,channel,rng)
|
||||
val = comedi.data_read(brd_dev,channel,rng,0);
|
||||
volt = comedi.to_phys(val,(min,max,unit),maxdata);
|
||||
print 'range = %d input = %6d (%6d) or %8.4f volts'%(rng, val, val-32768, volt)
|
||||
|
||||
rng = 2
|
||||
(min,max,unit) = comedi.get_range(board,sub_dev,channel,rng)
|
||||
val = comedi.data_read(brd_dev,channel,rng,0);
|
||||
volt = comedi.to_phys(val,(min,max,unit),maxdata);
|
||||
print 'range = %d input = %6d (%6d) or %8.4f volts'%(rng, val, val-32768, volt)
|
||||
|
||||
rng = 3
|
||||
(min,max,unit) = comedi.get_range(board,sub_dev,channel,rng)
|
||||
val = comedi.data_read(brd_dev,channel,rng,0);
|
||||
volt = comedi.to_phys(val,(min,max,unit),maxdata);
|
||||
print 'range = %d input = %6d (%6d) or %8.4f volts'%(rng, val, val-32768, volt)
|
||||
|
||||
rng = 1
|
||||
(min,max,unit) = comedi.get_range(board,sub_dev,channel,rng)
|
||||
volt = 1.5
|
||||
val = comedi.from_phys(volt,(min,max,unit),maxdata)
|
||||
print 'range = %d an input of %8.4f volts should give %6d from A/D' % (rng, volt, val)
|
||||
|
||||
comedi.close(0)
|
||||
|
17
python/setup.py
Normal file
17
python/setup.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from distutils.core import setup, Extension
|
||||
|
||||
module1 = Extension('_comedi',
|
||||
define_macros = [('MAJOR_VERSION','0'),
|
||||
('MINOR_VERSION','1')],
|
||||
include_dirs = ['../comedilib-0.7.19/include'],
|
||||
library_dirs = ['../comedilib-0.7.19/lib'],
|
||||
libraries = ['comedi'],
|
||||
sources = ['comedi_wrap.c'])
|
||||
|
||||
setup (name='_comedi',
|
||||
version = '0.1',
|
||||
description = 'Python wrapper module for the Comedi data-acquisition drivers',
|
||||
author = 'Bryan E. Cole',
|
||||
author_email = 'bryan.cole@teraview.co.uk',
|
||||
long_description = ''' Wrapper for the Comedi data-acquisition library ''',
|
||||
ext_modules = [module1])
|
80
python/test_comedi.py
Normal file
80
python/test_comedi.py
Normal file
|
@ -0,0 +1,80 @@
|
|||
#A test-application to demonstrate using the Comedilib API
|
||||
# and streaming acquisition in particular, from Python.
|
||||
#This script is completely untested!
|
||||
# author bryan.cole@teraview.co.uk
|
||||
|
||||
#set the paths so python can find the comedi module
|
||||
import sys, os, string
|
||||
sys.path.append('./build/lib.linux-i686-2.2')
|
||||
|
||||
import comedi as c
|
||||
|
||||
#open a comedi device
|
||||
dev=c.comedi_open('/dev/comedi0')
|
||||
if not dev: raise "Error openning Comedi device"
|
||||
|
||||
#get a file-descriptor for use later
|
||||
fd = c.comedi_fileno(dev)
|
||||
|
||||
nscans=1000 #specify total number of scans
|
||||
|
||||
#three lists containing the chans, gains and referencing
|
||||
#the lists must all have the same length
|
||||
chans=[0,2,3]
|
||||
gains=[1,1,1]
|
||||
aref =[c.AREF_GROUND, c.AREF_GROUND, c.AREF_GROUND]
|
||||
|
||||
nchans = len(chans) #number of channels
|
||||
|
||||
#wrappers include a "chanlist" object (just an Unsigned Int array) for holding the chanlist information
|
||||
mylist = c.chanlist(nchans) #create a chanlist of length nchans
|
||||
|
||||
#now pack the channel, gain and reference information into the chanlist object
|
||||
#N.B. the CR_PACK and other comedi macros are now python functions
|
||||
for index in range(nchans):
|
||||
mylist[index]=c.cr_pack(chans[index], gains[index], aref[index])
|
||||
|
||||
#construct a comedi command manually
|
||||
cmd = c.comedi_cmd_struct()
|
||||
cmd.subdev = 0
|
||||
cmd.flags = 0
|
||||
cmd.start_src = c.TRIG_NOW
|
||||
cmd.sart_arg = 0
|
||||
cmd.scan_begin_src = c.TRIG_TIMER
|
||||
cmd.scan_begin_arg = int(1.0e9/100000)
|
||||
cmd.convert_src = c.TRIG_TIMER
|
||||
cmd.convert_arg = 1
|
||||
cmd.scan_end_src = c.TRIG_COUNT
|
||||
cmd.scan_end_arg = nchans
|
||||
cmd.stop_src = c.TRIG_COUNT
|
||||
cmd.stop_arg = nscans
|
||||
cmd.chanlist = mylist
|
||||
cmd.chanlist_len = nchans
|
||||
|
||||
#test our comedi command a few times.
|
||||
ret = c.comedi_command_test(dev,cmd)
|
||||
print "first cmd test returns ", ret
|
||||
ret = c.comedi_command_test(dev,cmd)
|
||||
print "second test returns ", ret
|
||||
ret = c.comedi_command_test(dev,cmd)
|
||||
if not ret: raise "Error testing comedi command"
|
||||
|
||||
#execute the command!
|
||||
ret = c.comedi_command(dev,cmd)
|
||||
|
||||
#I think this will work but it's completely untested!
|
||||
datalist=[]
|
||||
data=os.read(fd)
|
||||
while len(data)>0:
|
||||
datalist.append(data)
|
||||
data=os.read(fd)
|
||||
|
||||
ret = c.comedi_close(dev)
|
||||
|
||||
datastr = string.join(datalist,'')
|
||||
|
||||
print datastr #heres your data, as a single string!
|
||||
|
||||
#if you've got Numeric installed you can convert data into a flat Numpy array
|
||||
# with:
|
||||
# dataarray = Numeric.fromstring(data, Int16)
|
Loading…
Add table
Reference in a new issue