bii_scripts

Contents

Remarks

This is a collection of useful scripts and libraries for the Bessy control system.

bii_scripts is avaliable under the terms of the GNU General Public License v.3.

If you are interested in getting the scripts or libraries you can download them as tar.gz or zip
file from the repository page (click on "bz2", "zip" or "gz").

However, the preferred way is to clone the main darcs repository:

darcs get http://www-csr.bessy.de/control/bii_scripts/repo/bii_scripts

or to clone the mercurial mirror repository:

hg clone http://www-csr.bessy.de/cgi-bin/hgweb.cgi/bii_scripts

For any questions feel free to contact one of the script authors:

or the maintainer of this page:

Scripts

accLaunch
launch panels for the BESSY II control system. All panels are read-only, so you can not interfere with the control system.
addPVtoArchiver
script to add a PV to the channel access archiver.
adl_cvs_diff.pl
show differences between the working and the repository version of an dm2k panel (*.adl) file. Supports CVS and subversion as version control systems.
adlsort.pl
Print dm2k panel (*.adl) files sorted to standard out. This can be used to compare two dm2k panel files.
archiver2camonitor.py
This tool converts data from the Channel access archiver (retrieved via CGI, "plot" command, then clicking on "plot") to a sorted list of values compatible with the format of the camonitor tool.
bdns_import.pl
import BESSY device names into the oracle database.
bdns_lookup.pl
lookup BESSY device names in the oracle database.
bdns_sort.pl
sort BESSY device names according to their member,index,subindex,family,counter,subdomain, subdomainnumber,domain and facility.
bdnsParse.pl
Parse and print BESSY device names according to their member,index,subindex,family,counter,subdomain, subdomainnumber,domain and facility.
USAGE: bdnsParse.pl DEVNAME1 ...
browsedb.pl
a perl-script with a graphical user interface to browse the oracle database. The program can be used to view and change data in the database as well as show relations between the tables.
buildall.pl
Find EPICS support modules and build them in the correct dependency order.
buds_lookup.pl
lookup BESSY units in the oracle database.
camon
simple channel access monitor with output as table of PVs.
camonitor2table.py
convert files created by the EPICS camonitor command to tables. This command can also filter by timestamp and by PV. It can create csv output and it can differentiate values.
camon
simple channel access monitor with output as table of PVs.
camonitor_sort.pl
sort and filter files created by the EPICS camonitor command. The filtering can be specified with regular expressions. This tool is especially useful when many different PV's are monitored at a time.
canlink.pl
encode and decode the lowCAL hardware link as it is used in the BESSY MultiCAN device support for EPICS.
console.py
Open a console on an IOC by contacting the console server without requesting a password.
console-get
download and concatenate console server files.
CreatePanel.pl
Create Panels for 'dm2k' or 'edm' from EPICS-Database '.substitution' files and widgets for each item of the '.substitution' file.
csv2alh
Create alarm handler config file from .CSV file
For details see alh part of csv2EpicsDb
csv2epicsDb
Create EPICS data from a spreadsheet: EPICS.db, Panels, Alarm handler,
Archiver files documentation
csv2plot
Combine and convert numerical data from .csv files for gnuplot use.
ctl-dist-info
A wrapper script for rsync-dist-info.py that is used to get information on installed software versions of the BII and MLS controlsystem.
ctl-restore
A small wrapper script that calls darcs-restore to restore the source directory along with it's darcs repository for a given version of the BII-Controls applucation.
cvs-recover.py
A backup and recovery tool for CVS.
Instead of saving the complete repository this script only saves differences relative to a central CVS repository. By this, much disk space is saved, the backup file has usually only about 100kBytes or less. This can be used to distribute a small recovery file together with the application. If it is needed, it is possible to restore the state of the original CVS working copy from which the application was built.
cvs_diff.pl
compare versions of a file in a CVS repository. This tool can remove emtpy
lines and c-comments before comparing.
cvsGuru
CVS wrapper script - for ctlguru only
cvs_log_diff.pl
compares the all log-messages between two revisions or tags in a CVS repository.
hg-compare-repos
compares the logs of two mercurial repositories with tkdiff.
darcs-compare-repos
compares the logs of two darcs repositories with tkdiff.
darcs-kompare
start KDE kompare to compare the working copy with the repository copy of a file.
darcs-meld
start KDE meld to compare the working copy with the repository copy of a file.
darcs-notify
Send email notification when patches are applied to a repository. Intended as a light-weight replacement for darcs-monitor.
darcs-restore
see darcs-save
darcs-save
darcs-save and darcs-restore can be used to save and later restore a source tree that is under darcs control. The idea is to call darcs-save immediately before (binary) distribution. The generated directory named '.darcs-restore' should then be distributed, too.
In order to restore the sources for such a distribution, call darcs-restore with the distribution directory (which may be a remote path, darcs-restore uses scp) as first, and the name of the directory to be created as second argument. Special feature: it is not necessary to record pending changes prior to distribution. Not-recorded changes and not-yet-added files and directories are restored just fine.
darcs-sig
create a textual representation of the state of a darcs repository (a list of log messages and some extra information).
dbcount
count the number of records in a file
dbdiff
display the difference between two *.db files using tkdiff
dbfilter.pl
A tool to filter db files or to find information in db files. Regular expression matches can be done on record names, record types or values of record-fields. Connections between records can be shown, lowCAL and SDO CAN links can be decoded.
The script needs the following perl modules:
Here is the documentation and the source of the script itself:
db_request.py
a tool to perform SQL requests on the oracle database.
dbscan.pl
This script is from Rolf Keitel <rolf@triumf.ca>. It scans db and sch files and has lots of options, the most interesting being '-d' which searches for 'dangling links'. I.e. it lists all records which have links that point somewhere outside the given db file (along with the target record). Unfortunately does not tell which link field and which target field. Note that dbfilter.pl can do the same with it's "--unresolved_links" option.
dbsort
print an EPICS database sorted. Note that dbfilter.pl does exactly the same when called with a database file and no options at all.
dbutil.p
A tool that can export oracle database-tables to ASCII files and re-import these files. Useful if you want to change many parts of a database-table with your favorite text-editor...
dumpdb
dump a database (*.db) file, one record-name combined with one field name in a single line.
expander.pl
macro expander for text-files. Since this tool allows the execution of arbitrary perl-expressions, it is quite powerful and (if you want this) a programming language of its own. It features if-statements, complex expressions and for-loops among others. This script needs the expander.pm module. See the expander documentation for a more comprehensive description of the expander file format.
filter_can_links.pl
extract CAN links from a .db file (for the BESSY lowCAL protocol). Note that dbfilter.pl can do the same with it's "--lowcal" option.
flatdb
expands and vdctdb db-file into a "flat" db file.
gadgetbrowser
database browser for the new gadget database.
git-meld
compares all files of two git versions with meld.
grab_xkeys.pl
a little X11 utility that displays scan codes of pressed keys.
grepDb.pl
A tool to search in EPICS-db files. It allows to define regular expressions as triggers in its commandline options for record-name, record-type, field-name and field value if a record or a field matches the trigger, it causes a print of the record. To control the printed output there are options to define the record names, record types or field types that have to be printed. This script needs the parse_db.pm module.
hg2darcs.py
A program that converts mercurial revisions to darcs revisions.
The changes, log messages and "author information remain intact, only the record date is set to today. Note that a darcs repository must already be present.
hg2git.py
A program that converts mercurial revisions to git revisions.
The changes, log messages and "author information remain intact, only the record date is set to today. Note that a git repository must already be present.
hg-kompare.py
A program that calls kompare to do comparisions of the working copy with a mercurial repository or compare files of different versions in the mercurial repository.
hg-recover.py
A backup and recovery tool for mercurial.
Instead of saving the complete repository this script only saves differences relative to a central mercurial repository. By this, much disk space is saved, the backup file has usually only about 100kBytes or less. This can be used together with rsync-dist.pl to distribute a small recovery file together with the application. If it is needed, it is possible to restore the state of the original working copy and mercurial repository from which the application was built.
idcp-dist-info
A small wrapper script that calls rsync-dist-info.py for IDCP (undulator control) IOCs
idcp-restore
A small wrapper script that calls hg-recover.py to restore the source directory along with it's mercurial repository for a given version of IDCP as it is installed on one of the BESSY undulators.
idcp-mls-restore
A small wrapper script that calls hg-recover.py to restore the source directory along with it's mercurial repository for a given version of IDCP as it is installed on the MLS undulator.
ioc-reboot.py
Reboots one or several IOCs via telnet and "reboot" command.
latin1toutf8.sh
convert latin-1 texts to utf-8 (calls the iconv utility).
lockGuru
Check and/or create the mutex file lock, probably used together with cvsGuru.
makeDocCommonIndex.pl
create an html index for documentation generated with makeDoc.
makeDocPerl.pl
create html documentation for perl scripts that contain embedded documentation according to "makeDoc" rules.
makeDocTxt.pl
create html documentation for ascii files that contain documentation according to "makeDoc" rules.
makeRegistrar
create EPICS 3.14 registrar code (generates c-code).
mlsLaunch
launches the operator main panel for the MLS storage ring
multi-commit.pl
perform multiple commits (cvs, svn, darcs or mercurial) with a prepared command-file.
oracle_request
command line tool to make database queries on the oracle database.
paths2.pl
like paths.pl but uses the global installation directories of the bii_scripts project.
paths.pl
prints commands to set your perl-environment in order to use the perl-modules and scripts of bii_scripts
pcomp.pl
recursivly compare two directories. Shows which files or directories have different dates, different sizes or are missing. The files or directories can be filtered. The kind comparisons can also be filtered. Can remove CVS tags or <CR> characters before comparing.
pfind.pl
a perl-script for powerful recursive file pattern search, like a recursive grep, but better. Features among other things text-file search, c-file search, regular expressions that match across line-ends.
psh
a perl-shell. Useful for testing small functions or expressions in an interactive shell.
pyone.py
python One-liner helper.
python-modules.py
Show what python modules a python script uses, complete with file path.
repo-loginfo.py
print log summaries for darcs or mercurial repositories.
rsync-deploy
tool for management for distribution of binary files with. The successor of this script is rsync-dist.pl.
rsync-dist.pl
A Perl script for managing distributions of binary files.
This script can be used to copy files (usually binary distributions of programs) to a remote server while preserving all the old versions of these distributions. It can also create and change symbolic links that point to certain distributions.
rsync-dist-info.py
this program prints summaries and statistics of rsync-dist link-log files.
The script needs the following perl modules:
Here is the documentation and the source of the script itself:
Sch2db.pl
a perl sch to db converter. Converts capfast(*.sch) files to the db file format as it is used in EPICS. This is faster and more flexible that the combination of sch2edif and e2db. This script needs the capfast_defaults.pm module.
sch_repo_diff.pl
shows the difference between a modified capfast (*.sch) file and it's version on the top-trunk in the repository. The difference of the resulting *.db files is shown, which is much clearer when you want to find out what was really changed. Supports cvs, subversion and mercurial.
set_ioc_tsrv.pl
set terminal_server and optionally port to connect to console of an ioc. Probably no longer needed since the conserver is now used for all IOCs.
stepy
Stepy is a configurable measurement program that preforms loops that set EPICS process variables (PV) and reads a set of process variables after each step.
sqlutil.py
this program copies data between a database, a dbitabletext file, the screen.
stripUnresolvedDb.pl
remove all unresolved fields from a database. Means all fields that contain some variables $(VARIABLE).
subst2exp.pl
convert substitution-files to expander format for usage with the expander.pl script. This can be used on the fly as an alternative to EPICS msi, or to convert substitution files to expander format in order to use the much more powerful commands of the expander format when replacing values in EPICS template files.
substdiff
compares two substitution files.
substprint.pl
pretty-print a substitution file.
tableutil.py
A tool to manipulate and print tables of numbers. New columns can be calculated by applying calculation expression. Command scripts can be used to do more complex operations on tables.
toASCII
toASCII STDIN: Print hex-numbers from STDIN as characters, convert control signals to mnemonics
tkSQL
query the oracle database by directly entering SQL requests.
txt2html.pl
trivial html encoding of normal text
txtcleanup.py
a cleanup tool for text files. Removes tabs and trailing spaces in files. Can also be used as a filter.
uniserv-restore
A small wrapper script that calls hg-recover.py to restore the source directory along with it's mercurial repository for a given version of uniserv as it is installed on one of the BESSY undulators.
unlockGuru
Remove the mutex file lock, probably used together with cvsGuru.
vdb_repo_diff.pl
graphical compare of vdb files with or within a repository. Supports cvs, subversion and mercurial.
vdct
starts the VisualDCT database editor.
xls2csv.pl
A small wrapper around the xls2csv utility that provides better error handling.

Perl Libraries

analyse_db.pm
a Perl module to analyse databases parsed with parse_db.
BDNS.pm
BESSY device name parser.
bessy_module.pm
This performs a "module <command> <args...>" in the z-shell environment and re-imports the environment-variables to the perl-process, so they are available in the %ENV-hash
BrowseDB/TkUtils.pm
Tk-utilities for browsedb.pl
browsedb_conf.PL
this file is only needed for "make install" in order to patch browsedb.pl. It hat no use, once bii_scripts is installed
capfast_defaults.pm
a Perl module that contains capfast defaults for record-fields.
cfgfile.pm
simple module to read or write a configuration file. Probably unfinished and in alpha-release state.
CreateX.pm
Routines that help to write CreateX.pl scripts. Not quite sure what this does. Connects to the oracle database.
dbdrv_lite.pm
low level routines for sqlite. Used by dbdrv.
dbdrv_oci.pm
low level routines for the ORACLE database. Needed by dbdrv.
dbdrv_pg.pm
low level routines for a PostgreSQL database. Needed by dbdrv.
dbdrv.pm
low level utilities for SQL database access, needed by dbitable.
dbdrv_test.pl
test-script for dbdrv. This shouldn't be in the repository!
dbitable.pm
an object-oriented Perl module for handling single tables from an SQL database
expander.pm
a module to perform macro-replacements in text files. Features if-statements, complex expressions and for-loops among others
makeDocStyle.pm
module for the makeDoc* scripts.
ODB.pm
a Perl module for accessing database via DBI. Means easier handling of the DBI routines via this layer.
Options.pm
a Perl module for handling programm arguments, command line in and output inclusive login requests.
parse_db.pm
a perl-module for parsing EPICS db-files.
parse_subst.pm
a perl-module for parsing EPICS substitution-files.
printData.pm
some console print utilities.
scan_makefile.pm
This module scans one or more than one makefile and returns a hash reference containing all variables that are set within the makefile together with all environment variables.
tokParse.pm
token parser utilities (for makeDocTxt).

Python Libraries

BDNS.py
BESSY device name parser.
boottime.py
get the boot time of an BESSY IOC by querying a certain pv.
canlink.py
A python version of the perl module canlink.pl. All functions implemented there are now also available in python. This module is used to encode and decode the CAN link as it is used in the LowCal device support that is part of the MultiCAN package developed here at HZB.
canLink.py
partial python implementation of canlink.pl: decode the lowCAL hardware link as it is used in the BESSY MultiCAN device support for EPICS.
dateutils.py
utilities for string <-> datetime conversions.
p_enum.py
enumeration types for python.
epicsUtils.py
Utility collection to parse and handle with EPICS data: Database files, Alarm Handler, Panels etc
FilterFile.py
a python module for scripts that read or write to files or read or write to standard-in or standard-out. Can also be used to modify a file in a safe way by creating a temporary file and renaming the original file and the temporary file upon close.
listOfDict.py
Functions to operate with the combined datatype list of dictionary items.
lslparser.py
a module to parse the output of "ls -l".
maillike.py
parse texts that have a mail-like format.
numpy_util.py
Utilities to numpy structured arrays. These arrays can be used to hold the data of number tables. This module is used by numpy_table.py and tableutil.py.
numpy_table.py
Implements a table class based on numpy structured arrays. This module is basically an object oriented wrapper for all functions in numpy_util.py. It is used by tableutil.py.
pdict.py
implements a dictionary for one-to-one relations.
pfunc.py
utilities for python functions and lambda statements.
ptestlib.py
a module providing routines for doctest testcode.
putil.py
This module provides functions for working with lists among other utilities.
rdump.py
a module for dumping of nested structures.
rsync_dist_lib.py
sync_dist_info classes for parsing rsync-dist log files.
sqlpotion.py
a module with utilities and support functions for sqlalchemy.
typecheck.py
a module with type-tests and type-assertions.