small cleanups and doc update

Fri, 22 Aug 2008 08:59:03 +0200

author
David Douard <david.douard@logilab.fr>
date
Fri, 22 Aug 2008 08:59:03 +0200
changeset 73
2645ef311424
parent 72
a81d0fd26332
child 74
62d7957b3aa8

small cleanups and doc update

doc/developer_manual.rst file | annotate | diff | comparison | revisions
doc/introduction.rst file | annotate | diff | comparison | revisions
pygpibtoolkit/HP3562A/HP356X.py file | annotate | diff | comparison | revisions
pygpibtoolkit/HP3562A/dump_datablock.py file | annotate | diff | comparison | revisions
pygpibtoolkit/qt4/__init__.py file | annotate | diff | comparison | revisions
--- a/doc/developer_manual.rst	Fri Aug 22 07:06:41 2008 +0200
+++ b/doc/developer_manual.rst	Fri Aug 22 08:59:03 2008 +0200
@@ -4,12 +4,34 @@
  Description
 =============
 
-The code is organized as follow:
+The code is organized in 2 layers; a low-level communication layer,
+and a highter level which allows to describe precisely a GPIB device,
+communicate asynchronously with it, etc.
+
+Low level
+=========
+
+The low level communication process is managed by the module
+``pygpibtoolkit.prologix``, in which there is a class names ``GPIB``
+that knows how to initialize the GPIB device, send commands and
+receive data from the bus, perform GPIB polls, etc.
+
+Example::
 
-``pygpibtoolkit`` is the main python package directory, holding
-generic GPIB stuffs. A GPIB controller is a class responsible for
-managing the communication with the GPIB device plugged in the
-computer. For now, the only GPIB controller is the Prologix one,
-defined in the ``pygpibtoolkit.prologix`` module.
+  from pygpibtoolkit.prologix import GPIB
+  cnx = GPIB() # by default, it is the controller in charge
+  idn = cnx.send_command("*IDN?", 12) # sends the idn command to device at GPIBaddress 12
+  print idn
+
+  cnx.set_address(12) # we will talk to this device 12 for a while
+  datablock = cnx.send_command('DDBN')
+
+  if cnx.check_srq():
+      print "A Service Request has been sent"
+
+Hight level
+===========
 
 
+
+
--- a/doc/introduction.rst	Fri Aug 22 07:06:41 2008 +0200
+++ b/doc/introduction.rst	Fri Aug 22 08:59:03 2008 +0200
@@ -1,7 +1,7 @@
 .. -*- coding: utf-8 -*-
 
 ==============
- Presentation
+ Introduction
 ==============
 
 pygpibtoolkit_ is a Python_ toolkit for talking with GPIB devices. It
@@ -47,8 +47,9 @@
  Tools
 =======
 
-Every tool presented in this section can display a *help* message
-using the ``-h`` or ``--help`` option.
+Every tool presented in this section can be found in the `bin`
+directory, and can display a *help* message using the ``-h`` or
+``--help`` option.
 
 For the sake of testing these tools, some example files are proposed
 in the `example` directory.
@@ -111,9 +112,11 @@
 
 Simple GPIB device detector. The computer GPIB device is configured so
 it is the Controller In Charge on the GPIB bus. It takes a while
-(several seconds) to run the retection procedure. When complete, it
-will simply display the list of devices found on the bus, with a
-decription of the device (if available).   
+(several seconds) to run the retection procedure.
+
+Once complete, it will simply display the list of devices found on the
+bus, with a decription of the device (if available, ie. if it replies
+to the IDN? command, which is not the case of older devices).
 
 dump_datablock
 --------------
--- a/pygpibtoolkit/HP3562A/HP356X.py	Fri Aug 22 07:06:41 2008 +0200
+++ b/pygpibtoolkit/HP3562A/HP356X.py	Fri Aug 22 08:59:03 2008 +0200
@@ -11,7 +11,7 @@
 # this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 """ Copyright (c) 2007-2008 David Douard (Paris, FRANCE).
-http://www.logilab.org/project/pygpibtoolkit -- mailto:python@logilab.fr
+http://www.logilab.org/project/pygpibtoolkit -- mailto:david.douard@logilab.fr
 
 """
 
--- a/pygpibtoolkit/HP3562A/dump_datablock.py	Fri Aug 22 07:06:41 2008 +0200
+++ b/pygpibtoolkit/HP3562A/dump_datablock.py	Fri Aug 22 08:59:03 2008 +0200
@@ -53,6 +53,7 @@
 
         res = ""
         print "command = ", cmd
+        # warning, this use direct low level serial communications...
         self._cnx.write('%s\r'%cmd)
         i = 0
         while i<self._retries:
--- a/pygpibtoolkit/qt4/__init__.py	Fri Aug 22 07:06:41 2008 +0200
+++ b/pygpibtoolkit/qt4/__init__.py	Fri Aug 22 08:59:03 2008 +0200
@@ -0,0 +1,15 @@
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+""" Copyright (c) 2007-2008 David Douard (Paris, FRANCE).
+http://www.logilab.org/project/pygpibtoolkit -- mailto:david.douard@logilab.fr
+"""

mercurial