pinklib Code
Brought to you by:
markdevries
File | Date | Author | Commit |
---|---|---|---|
logs | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
pinklib | 2010-07-08 | markdevries | [r6] I streamlined the mutexes used in the sampler f... |
scripts | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
tst | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
COPYRIGHT | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
INSTALL | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
README | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
ipythonrc-pink | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
startpink.py | 2008-11-11 | markdevries | [r1] Submitted by Mark de Vries, 11/11/2008, Fife. |
This is the Python instrument control module (PINK). It allows scripted and real-time interactive command-line control of instruments over a GPIB interface or COM ports. Data read from the instruments is recorded automatically and can be plotted real-time. At the basic level there is an application programming interface consisting of three classes; instrument, Var (variables) and sampler. Variables of type "Var" read their data from instruments. The sampler controls the periodic or continuous measurements of the variables. The library is threaded. Several samplers can collect data simultaneously, and multiple variables (such as temperatures) can be stabilised simultaneously and scanned in a synchronous manner. While active, these processes can be controlled from the command line (if a process blocks the command line, press ^C to regain control). This is done using the thread classes of the pyQt library, which also means that the program is fully compatible with all GUI widgets of the PyQt4 and PyQwt5 libraries. Two GUI widgets are provided with the program, and should serve as examples for how to build specific applications. The first one is a log and message display providing two tabs with automatically updated textview windows. The second is a plotter class, with which data can be plotted on the screen in real time. Any number of plotters can be used simultaneously. In its present from the API allows users to write scripts to quickly and flexibly program specific measurement sequences. BUGS: There is no doubt that there will be bugs. Hopefully none too bad though. If you see any, you can mail me at markadevries@googlemail.com especially if you have made a fix for the bug :) I will put this into a repository such as sourceforge so that it can be accessed by everybody. TODO: There are a number of obvious ways in which the userfriendlyness of pink can be greatly improved, by customising example classes from the PyQt library. Using the indexes for all variables, instruments and scanners: Var.index instrument.index K2001.index scanner.index you can get an overview of which objects are defined. You can then use these indexes to populate a tree structure in which all properties of the instruments are visible, as exemplified by python-Qt4 examples->tools->SettingsEditor. Another useful example is examples->dialogs->simplewizard This example can be used to make a wizard to configure new instruments, for example. You can make this as sophiticated as you like, including defining new dimensions etc. Then there are the PyQwt widgets which can be used to create actual control panels inculding buttons, dials, compasses etc.