README.md 2.17 KB
Newer Older
1 2 3
A bash (and soon other) completion for LIGO channel names.

This provides a bash completion script along with a channel completion program.
4 5
A set of channel databases are required.  Each database is a simple flat text file where
every line is a single channel name.  The file must be sorted.
6

7 8
The path to the files is set via the 'EPICS_CHAN_LIST' and 'NDS_CHAN_LIST' environment variables.

9
As the names imply the database are for EPICS channels or DAQ/NDS channels.  This split is needed
10 11 12 13 14 15 16
as in the LIGO control room there are > 500k channels, with roughly half are available only as EPICS channels.
By specifically supporting EPICS channels then non-daq channels like string records can be completed against
for caget/caput/...

If you have a list of channels you can have the application sort it for you.  Please note that
it is the bash scripts that use the EPICS_CHAN_LIST/NDS_CHAN_LIST variables, the completion engine
directly takes the database on the command line.
17 18 19

<pre>
# assuming that the channel database is
20
# located at db.txt.
21
ligo_channel_completion -d db.txt -r > tmpfile
22
mv tmpfile db.txt
23 24 25 26 27
</pre>

Requirements:
 * A C++11 compliant compiler.
 * CMake 3+
28
 * Boost iterator library
29
 * pstreams library
30 31 32 33

Debian requirements:
 * build-essential
 * bash-completion
34 35
 * libboost-dev
 * libpstreams-dev
36 37 38 39 40 41 42 43 44 45 46 47 48 49
 
Tested on:
 * Debian 8 & 9
 
Building:
 * create a build area
 * run cmake
 * install
 
Example (starting from the source directory)

<pre>
mkdir build
cd build
50
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
51 52 53 54
make
make install
</pre>

55 56
Components installed (Assuming a install prefix of /usr):
 * a binary ligo_channel_completion to /usr/lib
57
 * a set shell script to the base completion libraries at /usr/share/bash-completion/completions
58

59 60 61
After the install is successful, start a new bash shell and use the channel completion and make
sure that the EPICS_CHAN_LIST and NDS_CHAN_LIST environment variables are exported and refer
to proper databases.
62 63 64 65 66 67 68 69

<pre>
$ ndscope H&lt;tab&gt;
H0:FMC  H1:AOS  H1:CDS  H1:HPI  H1:ISI  H1:OMC  H1:SQZ  H1:VID  
H0:SAF  H1:ASC  H1:DAQ  H1:IMC  H1:LSC  H1:PEM  H1:SUS  
H0:VAC  H1:AWC  H1:FEC  H1:IOP  H1:OAF  H1:PSL  H1:SYS  
H1:ALS  H1:CAL  H1:GRD  H1:ISC  H1:ODC  H1:SEI  H1:TCS
</pre>