The ispy
package is a Python interface to the Information Service (IS).
It allows easy access from a scripting language to all the information in IS.
To use the package, simply start the tdaq_python
interpreter:
% tdaq_python Python 2.5 (r25:51908, Oct 18 2007, 16:26:11) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from ispy import *
The following classes from IS are available in Python:
The following minimal script shows how to use them in a simple way:
#!/usr/bin/env tdaq_python part_name = 'rhauser_test' import sys from ispy import * p = IPCPartition(part_name) if not p.isValid(): print "Partition:",p.name(),"is not valid" sys.exit(1) x = ISObject(p, 'DF.L2SV-1', 'L2SV') print "Exists: ",x.isExist() x.checkout() print x sum = ISObject(p,'DF.L2SV-Summary', 'L2SV') sum.LVL2_events = x.LVL2_events sum.checkin(False)
Several utility classes are provide to make it easier to read
arbitrary information from IS. See the examples
directory
for how to use them.
The ispygui.py
is a simple application using Tcl/Tk to
give an overview of the dataflow part of a running partition.
The callback routines can now be used in separate python threads, the actual code is protected and deals nicely with the interpreter.