summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
W. Trevor King [Wed, 17 Oct 2012 18:30:02 +0000 (14:30 -0400)]
cmd: flush stream in write_data().
W. Trevor King [Wed, 17 Oct 2012 17:12:31 +0000 (13:12 -0400)]
calibration: fix Python-to-caldac cast in CalibrationSetting._caldacs_set.
Pointed out by Éric Piel using Cython 0.15.1:
Error compiling Cython file:
------------------------------------------------------------
...
raise MemoryError()
self.setting.num_caldacs = length
for i,x in enumerate(value):
if i >= length:
raise ValueError((i, length))
self.setting.caldacs[i] = x
^
------------------------------------------------------------
pycomedi/calibration.pyx:505:39: Cannot convert Python object to
'comedi_caldac_t'
W. Trevor King [Wed, 17 Oct 2012 17:07:23 +0000 (13:07 -0400)]
calibration: set .num_arefs in CalibrationSetting._arefs_set.
W. Trevor King [Wed, 17 Oct 2012 17:04:35 +0000 (13:04 -0400)]
calibration: add CalibrationSetting attribute-setting doctests.
W. Trevor King [Wed, 17 Oct 2012 17:00:22 +0000 (13:00 -0400)]
calibration: shift settings[0] doctest spacing.
W. Trevor King [Wed, 17 Oct 2012 16:56:41 +0000 (12:56 -0400)]
calibration: add Caldac.allocate() for stand-alone caldac instances.
W. Trevor King [Wed, 17 Oct 2012 15:46:27 +0000 (11:46 -0400)]
README: warn about channel output during testing.
W. Trevor King [Wed, 17 Oct 2012 15:33:36 +0000 (11:33 -0400)]
Merge calibaration branch into master.
This feature branch adds support for loading and applying calibration
files, as well as for loading soft calibration converters.
W. Trevor King [Wed, 17 Oct 2012 15:31:43 +0000 (11:31 -0400)]
channel: standardize indentation in AnalogChannel._get_converter().
W. Trevor King [Wed, 17 Oct 2012 15:30:41 +0000 (11:30 -0400)]
channel: add AnalogChannel.apply_calibration.
W. Trevor King [Tue, 16 Oct 2012 19:11:37 +0000 (15:11 -0400)]
calibration: add Caldac, CalibrationSetting, and Calibration.
Add Python wrappers around comedi_calibration_t and its
sub-structures. This allows you to load calibration files (soft and
hard) and manipulate their contents in Python.
W. Trevor King [Tue, 16 Oct 2012 19:45:28 +0000 (15:45 -0400)]
test.sh: use Python-3-compatible print().
W. Trevor King [Tue, 16 Oct 2012 18:16:45 +0000 (14:16 -0400)]
device: remove trailing whitespace from Éric's patch.
Éric Piel [Tue, 16 Oct 2012 10:44:30 +0000 (12:44 +0200)]
add support for soft calibration
W. Trevor King [Tue, 16 Oct 2012 18:06:34 +0000 (14:06 -0400)]
Strip trailing whitespace.
W. Trevor King [Sun, 22 Jul 2012 16:19:24 +0000 (12:19 -0400)]
Bump to version 0.5.
W. Trevor King [Sun, 22 Jul 2012 16:19:10 +0000 (12:19 -0400)]
Add MANIFEST to .gitignore.
W. Trevor King [Fri, 11 May 2012 18:06:14 +0000 (14:06 -0400)]
Ran update-copyright.py.
W. Trevor King [Fri, 11 May 2012 18:05:46 +0000 (14:05 -0400)]
AUTHORS should not be version controlled (generated by update-copyright.py).
W. Trevor King [Fri, 11 May 2012 18:04:08 +0000 (14:04 -0400)]
.update-copyright.conf should not be executable.
W. Trevor King [Thu, 26 Apr 2012 18:27:27 +0000 (14:27 -0400)]
Oops, convert period from seconds to nanoseconds in cmd.py demo.
W. Trevor King [Thu, 26 Apr 2012 17:21:42 +0000 (13:21 -0400)]
Add --callback option to cmd.py demo to use CallbackReader.
W. Trevor King [Thu, 26 Apr 2012 17:17:02 +0000 (13:17 -0400)]
The --verbose argument to the demo scripts doesn't take arguments.
W. Trevor King [Thu, 26 Apr 2012 17:06:36 +0000 (13:06 -0400)]
Fix conversion to physical in cmd.py demo ('float32' is not defined).
W. Trevor King [Thu, 26 Apr 2012 16:56:43 +0000 (12:56 -0400)]
Add pycomedi.utility.CallbackReader for handling read data as it comes in.
W. Trevor King [Wed, 18 Apr 2012 17:22:07 +0000 (13:22 -0400)]
Change my email address from drexel.edu to tremily.us.
W. Trevor King [Tue, 17 Apr 2012 16:37:15 +0000 (12:37 -0400)]
Ran update-copyright.py.
W. Trevor King [Tue, 17 Apr 2012 16:30:27 +0000 (12:30 -0400)]
Add doc/demo/aout.py example of repeated analog output.
This script contains the condensed wisdom of mailing list
discussions between Richard Höchenberger and myself.
Cc: Richard Höchenberger
W. Trevor King [Tue, 17 Apr 2012 16:29:54 +0000 (12:29 -0400)]
Wrap long lines in doc/demo/info.py.
W. Trevor King [Tue, 17 Apr 2012 16:29:34 +0000 (12:29 -0400)]
'channels' default should be a list in pycomedi_demo_args.py.
W. Trevor King [Tue, 17 Apr 2012 16:29:00 +0000 (12:29 -0400)]
Wrap long help lines in pycomedi_demo_args.py.
W. Trevor King [Tue, 17 Apr 2012 16:22:22 +0000 (12:22 -0400)]
Add `block_while_running` option to `_ReadWriteThread`.
This way users don't need to understand the following distinctions:
* written to driver vs. output from card.
* `SDF_BUSY` vs. `SDF_RUNNING`.
The `subdevice.cancel` call in `_ReadWriteThread.block` is because the
`RUNNING` flag is cleared after output completes, but the `BUSY` flag
is not. This may be a bug in Comedi. I've asked on the mailing list,
but haven't heard back yet.
W. Trevor King [Thu, 12 Apr 2012 14:43:19 +0000 (10:43 -0400)]
Add positional arguments to format strings for Python 2.6 compatibility.
For 2.7 and later, the positional arguments can be omitted, but
Richard Höchenberger (and others?) wants to run pycomedi on 2.6.
W. Trevor King [Wed, 21 Mar 2012 16:48:59 +0000 (12:48 -0400)]
Add trailing slash to Gentoo overlay link in README.
W. Trevor King [Tue, 20 Mar 2012 11:51:26 +0000 (07:51 -0400)]
Rework demos so that test.sh covers their critical parts.
W. Trevor King [Tue, 20 Mar 2012 01:16:06 +0000 (21:16 -0400)]
Add --mmap argument to cmd.py demo and fix some pycomedi_demo_args.py bugs.
W. Trevor King [Tue, 20 Mar 2012 01:07:00 +0000 (21:07 -0400)]
Fix subdevice._device -> subdevice.device in _MMapReadWriteThread._fileno().
When I was writing the Cython implementation, I initially tried to
keep more things private, before realizing that that wasn't a good
idea. This snippit missed the initial transition.
W. Trevor King [Mon, 19 Mar 2012 18:51:40 +0000 (14:51 -0400)]
Consolidate demo argument parsing in pycomedi_demo_args.py to reduce duplication.
W. Trevor King [Mon, 19 Mar 2012 17:47:29 +0000 (13:47 -0400)]
Add cmd.py demo.
W. Trevor King [Mon, 19 Mar 2012 17:34:25 +0000 (13:34 -0400)]
Allow AnalogChannel.__init__ to take integers for `range`.
If you know the index of your desired range, you can now use that
index directly and skip the usual call to `find_range`.
W. Trevor King [Mon, 19 Mar 2012 16:41:29 +0000 (12:41 -0400)]
Actually listen to the --subdevice option in the insn.py demo.
W. Trevor King [Mon, 19 Mar 2012 16:21:53 +0000 (12:21 -0400)]
Add insn.py demo.
W. Trevor King [Mon, 19 Mar 2012 16:17:40 +0000 (12:17 -0400)]
Don't set log levels for pycomedi.LOG handlers.
That's too much granularity for the default situation, where there is
only one handler and we can use the logger's level to control
verbosity.
W. Trevor King [Mon, 19 Mar 2012 16:10:18 +0000 (12:10 -0400)]
Fix error condition `ret < 0` -> `ret < len(insnlist)` for Device.do_insnlist.
The previous implemenation would apparently succeed if there was an
error executing an instruction. It would only raise an exception if a
failure occured before the first instruction could be executed.
W. Trevor King [Mon, 19 Mar 2012 15:43:34 +0000 (11:43 -0400)]
Add 'external' unit for RF_EXTERNAL (see previous commit for reasoning).
W. Trevor King [Mon, 19 Mar 2012 15:26:43 +0000 (11:26 -0400)]
Revert "Mask range.unit with 0xff when determining the unit."
This reverts commit
d721a0c05450c793a5e0e562d286a689565cf81b.
From the National Instruments E Series User Manual [1], page 3-2:
Reference Selection
(NI 6020E, NI PXI-6040E, NI 6052E, NI 6062E, NI 6070E/6071E, and
PCI-MIO-16E-4 Devices Only) You can connect each DAC to the device
internal reference of 10 V or to the external reference signal
connected to the external reference (AO EXT REF) pin on the I/O
connector. This signal applied to EXT REF should be within
±11 V. You do not need to configure both channels for the same mode.
So RF_EXTERNAL is a valid unit (i.e. in units of the AO EXT REF
signal). The next commit will add this unit.
[1]: http://digital.ni.com/manuals.nsf/websearch/
06115536722DAA558625728E007E6BA4
Edition Date: February 2007
Part Number: 370503K-01
p
W. Trevor King [Mon, 19 Mar 2012 15:10:30 +0000 (11:10 -0400)]
Add info.py demo.
W. Trevor King [Mon, 19 Mar 2012 14:48:36 +0000 (10:48 -0400)]
Mask range.unit with 0xff when determining the unit.
This avoids crashes like:
Traceback (most recent call last):
...
File "range.pyx", line 62, in pycomedi.range.Range.__str__
File "range.pyx", line 70, in pycomedi.range.Range._unit_get
File "constant.pyx", line 269, in pycomedi.constant._Enum.index_by_value
KeyError: 256L
when RF_EXTERNAL is set.
W. Trevor King [Mon, 19 Mar 2012 13:31:28 +0000 (09:31 -0400)]
Add attributes to PyComediError to make intelligent error handling easier.
W. Trevor King [Mon, 19 Mar 2012 13:09:30 +0000 (09:09 -0400)]
Add .ranges() method to Channel class.
W. Trevor King [Mon, 19 Mar 2012 13:04:42 +0000 (09:04 -0400)]
Add .channels() method to Subdevice class.
W. Trevor King [Thu, 15 Mar 2012 13:54:41 +0000 (09:54 -0400)]
Allow keywords for Channel.get_range().
W. Trevor King [Thu, 15 Mar 2012 13:45:57 +0000 (09:45 -0400)]
Add docstring to Channel.get_range.
W. Trevor King [Thu, 15 Mar 2012 03:06:55 +0000 (23:06 -0400)]
Bump to verssion 0.4.
W. Trevor King [Thu, 15 Mar 2012 02:55:45 +0000 (22:55 -0400)]
Add __reduce__() method to BitwiseOperator and _NamedInt.
This makes it possible to successfully pickle and deepcopy instances
of these types [1,2]. This gets the
TRIG_SRC.now == copy.deepcopy(TRIG_SRC.now)
doctest working, which I needed to successfully dump h5config
ChoiceConfig objects that use _Enum choices [3].
For example, the newly fixed pypiezo.config.ChannelConfig [4] uses the
AREF enum values as possible choices for it's `analog-reference`
setting. h5config makes deepcopies of mutable objects to avoid
confusion if the mutable is changed externally. It then compares the
deepcopies with uncopied values. Now that deepcopying works for
_NamedInts, the h5config behavior will work.
[1] http://docs.python.org/library/pickle.html#pickling-and-unpickling-extension-types
[2] http://docs.python.org/library/copy.html
[3] http://pypi.python.org/pypi/h5config/
[4] http://pypi.python.org/pypi/pypiezo/
W. Trevor King [Thu, 15 Mar 2012 02:36:21 +0000 (22:36 -0400)]
Use utility.lsample instead of numpy.uint in calibration._convert().
Don't repeat yourself! Also, numpy.uint is a uint64 on my amd64, and
that does not match with lsampl_t.
W. Trevor King [Thu, 15 Mar 2012 02:19:22 +0000 (22:19 -0400)]
Yes, 2 < 3. (fix constant comparison doctest).
W. Trevor King [Thu, 15 Mar 2012 01:46:00 +0000 (21:46 -0400)]
Fix rich comparison doctest prompts and add comparisons to None.
The None comparison logic avoids:
TypeError: long() argument must be a string or a number, not 'NoneType'
W. Trevor King [Thu, 15 Mar 2012 01:37:59 +0000 (21:37 -0400)]
Oops, Cython uses __richcmp__() instead of __eq__(), etc.
http://docs.cython.org/src/userguide/special_methods.html#rich-comparisons
W. Trevor King [Thu, 15 Mar 2012 01:33:06 +0000 (21:33 -0400)]
Add rich comparisons to BitwiseOperator (compare by .value).
W. Trevor King [Wed, 14 Mar 2012 22:21:28 +0000 (18:21 -0400)]
Fix get_version_code parsing and split it off into a new Device.get_version method.
W. Trevor King [Tue, 13 Mar 2012 13:01:26 +0000 (09:01 -0400)]
Fix wrtier -> writer typo in `pycomedi.utility._MMapReadWriteThread` docstring.
W. Trevor King [Thu, 8 Mar 2012 19:51:24 +0000 (14:51 -0500)]
Move function_name extraction up in pycomedi/_error.pyx's comedi_get.
This avoids:
pycomedi/_error.pyx:43:29:
local variable 'function_name' referenced before assignment
W. Trevor King [Wed, 22 Feb 2012 18:33:22 +0000 (13:33 -0500)]
Update URLs from einstein to tremily.
W. Trevor King [Thu, 16 Feb 2012 23:01:12 +0000 (18:01 -0500)]
Ran update-copyright.py.
W. Trevor King [Thu, 16 Feb 2012 22:58:57 +0000 (17:58 -0500)]
Transition to my external update-copyright package.
http://pypi.python.org/pypi/update-copyright/
W. Trevor King [Wed, 25 Jan 2012 15:08:24 +0000 (10:08 -0500)]
Change to GPLv2+ licensing.
Previously COPYING and the README had claimed GPLv3+, but the headers
generated by update_copyright had used GPLv2+. GPLv2+ is more
inclusive and closer to the standard Comedi library's LGPLv2.1+.
W. Trevor King [Tue, 24 Jan 2012 18:57:57 +0000 (13:57 -0500)]
Add AUTHORS (generated by update_copyright.py) to version control.
W. Trevor King [Tue, 24 Jan 2012 18:56:24 +0000 (13:56 -0500)]
Remove separate copyright dates from README.
They wouldn't get updated by update_copyright.py, so they would
inevitably fall out of date.
W. Trevor King [Tue, 24 Jan 2012 18:55:37 +0000 (13:55 -0500)]
Run update_copyright.py.
W. Trevor King [Tue, 24 Jan 2012 18:55:09 +0000 (13:55 -0500)]
Add update_copyright.py.
W. Trevor King [Tue, 19 Apr 2011 13:17:37 +0000 (09:17 -0400)]
Mostly-complete Cython implementation.
I need some work on Cython upstream to entirely remove the requirement
on the SWIG-wrapped comedi module.
W. Trevor King [Wed, 9 Feb 2011 14:22:32 +0000 (09:22 -0500)]
Convert to more generic Pythonic wrapper. Not everything works yet.
W. Trevor King [Tue, 14 Dec 2010 19:53:13 +0000 (14:53 -0500)]
Fix == -> = in __version__ definition.
W. Trevor King [Tue, 14 Dec 2010 19:31:34 +0000 (14:31 -0500)]
Rename simAioError -> SimAioError and use ValueError in common._expand_tuple().
W. Trevor King [Tue, 14 Dec 2010 19:27:44 +0000 (14:27 -0500)]
Also rename sngAioError -> SngAioError and dioError -> SngDioError.
W. Trevor King [Tue, 14 Dec 2010 19:04:09 +0000 (14:04 -0500)]
Rename pycomediError to PEP-8-compliant PycomediError.
W. Trevor King [Tue, 14 Dec 2010 19:01:43 +0000 (14:01 -0500)]
Move pycomedi.common.VERSION to pycomedi.__version__ and cleanup setup.py.
W. Trevor King [Wed, 17 Jun 2009 13:36:01 +0000 (09:36 -0400)]
Bumped version to 0.2
W. Trevor King [Thu, 7 May 2009 19:35:37 +0000 (15:35 -0400)]
Added bugtracking with Bugs Everywhere.
The bug I added it for turned out to be due to the calling software,
not PyComedi itself. I also removed an old debugging printout from
simult_aio.py.
W. Trevor King [Mon, 8 Dec 2008 20:21:16 +0000 (15:21 -0500)]
Allow two passes through test_cmd in simult_aio.
Fixed failing commands when the exact ns sample period was not available.
e.g:
Testing command:
Command on <pycomedi.common.PyComediIO object at 0x8e9184c> (output):
subdevice: 1
flags: 0x40
start: ext| 18
scan_begin: timer| 324675
convert: now| 0
scan_end: count| 1
stop: count| 16010
test pass 0, argument conflict
Failing command (4):
Command on <pycomedi.common.PyComediIO object at 0x8e9184c> (output):
subdevice: 1
flags: 0x40
start: ext| 18
scan_begin: timer| 324700
convert: now| 0
scan_end: count| 1
stop: count| 16010
W. Trevor King [Mon, 8 Dec 2008 19:29:58 +0000 (14:29 -0500)]
Explicit cast to int to avoid lsampl type problem.
See commit
5b69b33d46529be30bbdf15b392f0b96986bdcdd for another example.
W. Trevor King [Mon, 8 Dec 2008 19:06:53 +0000 (14:06 -0500)]
Added labels to verbose plot in single_aio.py.
W. Trevor King [Mon, 8 Dec 2008 17:24:09 +0000 (12:24 -0500)]
Cast data to int in PyComediSingleIO.write_chan_index.
Without the cast, I got this traceback when data was a numpy.uint16:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/wking/.python/unfold.py", line 101, in __init__
self.zp.jumpToPos(self.zp.pos_nm2out(0))
File "/home/wking/.python/z_piezo.py", line 161, in jumpToPos
self.curIn = self._jump.jumpToPos(self.curOut)
File "/home/wking/.python/z_piezo.py", line 248, in jumpToPos
self.AO.write(out)
File
"/home/wking/lib/python2.5/site-packages/pycomedi-0.1-py2.5.egg/pycomedi/single_aio.py",
line 90, in write
self.write_chan_index(i, data[i])
File
"/home/wking/lib/python2.5/site-packages/pycomedi-0.1-py2.5.egg/pycomedi/common.py",
line 411, in write_chan_index
rc = c.comedi_data_write(self.dev, self.subdev,
self.chan[chan_index], self._range[chan_index], self._aref[chan_index],
data);
TypeError: in method 'comedi_data_write', argument 6 of type 'lsampl_t'
W. Trevor King [Tue, 11 Nov 2008 15:42:31 +0000 (10:42 -0500)]
Fixed license reference in setup.py and added license headers to source.
W. Trevor King [Tue, 11 Nov 2008 15:34:04 +0000 (10:34 -0500)]
Added a .gitignore file.
W. Trevor King [Tue, 11 Nov 2008 15:31:30 +0000 (10:31 -0500)]
Added ez_setup installation framework.
W. Trevor King [Tue, 11 Nov 2008 15:26:35 +0000 (10:26 -0500)]
Added subdevice flag checking ability and reworked some tests.
I was hoping SDF_BUSY would let me know when the output job was
complete, but for some reason it doesn't seem to.
See simult_aio.AIO.reset().
W. Trevor King [Thu, 23 Oct 2008 12:49:39 +0000 (08:49 -0400)]
Fairly large rewrite for more object-oriented pycomedi.
test.py should never have been versioned; it was simply an example
of the test logic for simult_aio._repeat_aio_test().
W. Trevor King [Sun, 5 Oct 2008 04:07:02 +0000 (00:07 -0400)]
Broke out common functionality into common.py
Still need to go through and clean up the simultaneous code.
W. Trevor King [Sat, 4 Oct 2008 22:35:29 +0000 (18:35 -0400)]
No changes?
W. Trevor King [Sat, 4 Oct 2008 22:34:58 +0000 (18:34 -0400)]
Cleaned up single_dio.py
W. Trevor King [Sat, 4 Oct 2008 15:00:11 +0000 (11:00 -0400)]
Renamed modules without the now-redundant `comedi_' prefix
W. Trevor King [Sat, 4 Oct 2008 14:55:29 +0000 (10:55 -0400)]
Versioning started.
Time to compile this heap-o-stuff into a real package.