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.

For downloading the project see https://sourceforge.net/p/bii-scripts/code/ci/master/tree/.

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.
console-watch
display growth rate of 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
csv2json.py
Convert CSV files to JSON and vice versa.
This can be used to convert csv files as they are used in BII-Controls and MLS-Controls to JSON and back again to CSV. This can be useful if you want to edit csv files or run a diff to see what was changed. CSV files have very long lines that are hard to edit and are hard to use with 'diff'.
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-Controls, MLS-Controls, ERL-Controls, BL-Controls or HoBiCaT-Controls application.
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, MLS-Controls, ERL-Controls, BL-Controls or HoBiCaT-Controls application.
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.
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.
git2hg.py
A program that converts git revisions to mercurial revisions.
The changes, log messages and "author information remain intact, only the record date is set to today. Note that a mercurial repository must already be present.
git-meld
compares all files of two git versions with meld.
git-repo-merge.sh
Combines patches of two git repositories by creating a new git branch.
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-compare-repos
compares the logs of two mercurial repositories with tkdiff.
hg-kompare
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-meld
Show mercurual patches with meld..
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-drive-info
Displays information about drives of IDCP controled undulators.
This script can also show the software version of the uniserv program for each undulator.
idcp-get-source
Get and and optionally build the source of installed versions of IDCP.
You can provide the undulator name or the version string. You can also retrieve the latest IDCP version. This script works for the BESSY and MLS facility. It can also show a list of installed insertion devices and an give an overview of currently used IDCP versions.
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.
iddb
A script that queries the Insertion Device StructuredData database server on gwc2c to display a table with names and properties of insertion devices or to do arbitrary queries on that database.
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.
pg_request.py
a tool to perform SQL requests on the PostgreSQL database.
psh
a perl-shell. Useful for testing small functions or expressions in an interactive shell.
pyone.py
python One-liner helper.
repo-hash.sh
Create a short hash or hash file for a repository.
repo-loginfo.py
print log summaries for darcs or mercurial repositories.
repo-mirror.py
Mirror a repository in another one with a different version control system.
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).
subst-dump.py
Parse and dump EPICS substitution files as JSON or python data. Can also be used to verify, if a substitution is valid.
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.
csv2epicsFuncs.py
Functions for csv2epicsDb.html.
dateutils.py
utilities for string <-> datetime conversions.
epicsUtils.py
utilities used by csv2epicsDb.
p_enum.py
enumeration types for python.
parse_subst.py
Parse EPICS substitution files.
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.