The PinK Documentation Page


PinK (PinK is not Kuip ) is an interface between Tcl/Tk, BLT, ADAMO and DAD.
There is a windowless version of PinK available called Floyd.

What's new in Version 0.27.

There is now a mailing list ( pink-list@dxhra1.desy.de) available for PinK. All major announcements will be made on that list. There is also an archive available. To subscribe send a mail containing the line subscribe pink-list [your-address] to Majordomo@dxhra1.desy.de.


General chapters:


Reference chapters:


See Also and Miscellaneous:


Important:
This document is still under developement as well as the described software is, please send your comments (complaints about any typos, missing links, bad english, etc.) immediately to:
pink@hermes.desy.de

The PinK Developpers Team



PinK was designed, implemented and documented as a part of the HERMES Slowcontrol, Monitoring and Offline system by:
Klaus Ackerstaff
Email: ack@hermes.desy.de
Marc-André Funk
Email: maf@hermes.desy.de


How to retrieve and install PinK


Which platforms are supported?

Currently the following platforms are supported by the configuration script, but not all of them have not yet been tested:


Where to get the archive?

The latest version of the PinK archive can be downloaded directly from here.

But you may prefer to download the PinK documentation for local installation. This archive also contains the source code as well as the HV example that you should use as an introduction in PinK and Dad programming.


What do you need?

The installation procedure of PinK is currently fitted into the HERMES software scheme. This means, that you need a certain environment to succeed in compiling PinK. The HERMES software is arranged in an own directory tree, most of the programs expect the path of this directory in an environment variable called $HERMES_ROOT. If this variable is not set, the PinK installation script will try to find the hermes software in /hermes. However for installation as well as for later running you're free to set $HERMES_ROOT to /usr/local.
In the directory $HERMES_ROOT/include you should install the cfortran package and also a corrected version of the ADAMO header file adamo.h.
Also you must have installed DAD. How this is done you can find in the related DAD documentation page (Make sure to install an ADAMO version that works with Dad as pointed out there!).
The following standard software packages are needed to make PinK. The location may be explicitly defined by setting the mentioned environment variable. If this variable is not set, the path is searched for the package and the standard library directories are used.
CERNLIB ($CERN_LIB)
/cern:/cern/pro:/usr/cern:/user/cern/pro:/usr/local/cern:
/usr/local/cern/pro
ADAMO 3.3 ($ADAMO_ROOT)
/adamo:../adamo:/cern/adamo:$HERMES_ROOT/adamo:/usr/local/adamo:
/adamo/3.3:../adamo/3.3:/cern/adamo/3.3:$HERMES_ROOT/adamo/3.3:
$HERMES_ROOT/../adamo/3.3:/usr/local/adamo/3.3
tcl 7.3 ($TCL_LIB)
$HERMES_ROOT/lib:/usr/local/tcl/lib
Tk 3.6 plus patch level 1 ($TK_LIB)
$HERMES_ROOT/lib:/usr/local/tk/lib
BLT 1.7($BLT_LIB)
$HERMES_ROOT/lib:/usr/local/blt/lib
The include files will be searched in the standard directories and ./include:$HERMES_ROOT/include
If the TCL/TK headers are not in there, you may set the environment variables TCL_INC/TK_INC.

If you want to make use of the HBOOK analysis function of the pink browser, you'll need to install the following:

Hister
Manfred Ferstl's HBOOK interface.


Archives of the required tcl/Tk versions

When the HERMES software was designed and implemented, tcl 7.3, Tk 3.6 and BLT 1.7 were up to date. Since HERMES is a running experiment taking and analyzing physics data, we decided to freeze those library versions. Since it's not easy to find this versions on the servers nowadays (you most likely will find them on ftp.smli.com:/pub/tcl, we supply them here: The following patch should be applied to BLT: diff -c bltGrAxis.c.old bltGrAxis.c *** bltGrAxis.c.old Fri Apr 22 17:57:06 1994 --- bltGrAxis.c Sat Nov 16 09:32:03 1996 *************** *** 1713,1724 **** sgmts++, labels++; } value += axisPtr->step; } done: assert(sgmts <= arraySize); - assert(labels <= axisPtr->numLabels); if (axisPtr->segArr != NULL) { free((char *)axisPtr->segArr); --- 1713,1725 ---- sgmts++, labels++; } value += axisPtr->step; + if( labels >= axisPtr->numLabels ) + break; } done: assert(sgmts <= arraySize); if (axisPtr->segArr != NULL) { free((char *)axisPtr->segArr);


How to make it...

After you've build up your HERMES environment and installed DAD and all the other packages, you've good chances to manage PinK also. First make a directory $HERMES_ROOT/pink, change your working directory to this one and extract the archive by typing
  >gunzip pink.tar.gz
  >tar xvf pink.tar
After this you can try to configure the package and finally make it:
  >configure
  >make
If everything worked fine, you may want to have a look in this example.


If it does not work...

To write a configuartion script that fits all possible setups is probably not possible. So if it fails here are some hints for experienced users to solve the problems.

If you try to install PinK on a platform not mentioned above you're invited to extend the configuration script. The following paragraph will give you some hints for doing that.

If you try to install PinK on a supported platform and the configuration fails, you're not totally lost. In that case you should try to modify the configuration script for your environment.

The important file for both cases is called configure. In the upper part of this scripts you'll find sections like the following:

  Linux-*)
        echo this seems to be a Linus machine. Congrats.
        FORLIBS="-lf2c -lf77 -lc"
        CC=cc
        CFLAGS="-pipe -g -Wall"
        ACFLAGS="-pipe -Df2cFortran -g -O -W -Wuninitialized          \
                 -Wparentheses -Wmissing-prototypes -Wimplicit -Wcomment      \
                 -Wformat -Wchar-subscripts "

        LINKFLAGS=""
        F77FLAGS="-cpp"
        RANLIB="ranlib"
        INCLUDES="$PWD/include /usr/local/include /usr/include"
        EXTRAXLIBS=""
        ;;
The first line is a key for your setup. It's composed out of the following fields:
systype-release-hostname
Copy the section for your system type to the beginning of the case block and add your computer's name. If you're running one of those numerous LINUX PCs called gandalf, the key would look like:
  Linux-*-gandalf)
You can now try to make some changes in that configuration block. (An explanation of the configuration variables will be added as soon as I find some time...)
Good luck!


The true story about PinK


The evolution of PinK

The first ancestor of PinK was designed and coded by Marc-André Funk during the 4th Hermes Analysis Workshop taking place 22.-26. August '94 at DESY. This study was called adtk and included mainly the TCL frame for ADAMO GAF objects and some fundamental methods. Unfortunately MAF could not continue with this project since he had to prepare his diploma examination in early '95 (and for some other reasons).

During the HERMES Analysis/Software workshop in the beginning of September in Corvallis/Oregon Klaus Ackerstaff looked into the existing code and started to implement first DAD features. The strong need for a working prototype version to be used for the HERMES slow control system drove further developements. The first working version of the shell was coded along with the first slow control example which controls and monitors the HERMES target section. During that time the main focus was to implement as many features of ADAMO and DAD as needed to get the various applications running. Since DAD was also developed during that time, a daily change of the code was quite normal. Together with Wolfgang Wander especially the DAD interface constantly improved and several applications have been developed in parallel.

Beginning of '95 the search for a name started and on one of the inofficial HERMES "offsite" meetings the name PinK was born meaning PinK is not Kuip because it partially replaces the Kuip interface to the HERMES software.

In March '95 Wolfgang Wander and Klaus Ackerstaff have been invited to present DAD and PinK at the Programming Techniques Group at CERN. In several sessions it bacame clear that a complete DAD and ADAMO interface has to be included into PinK in a clean object oriented way.
The very positive resonance of the PT group made clear that further development of the two packages is worthwhile but also the "spare time" work of Klaus Ackerstaff would not be sufficient to achieve the final goals. Meanwhile a rapidly increasing number of PinK applications had been developed for HERMES and the need for a revision of the existing code was urgently needed. The documentation of this first PinK version is still available and may give you a guess how things (not only the logo) changed in the meanwhile.

After all MAF finally joined the HERMES software group in April '95 and his first project was to revise and restructure the PinK code in an (more) object oriented manner. This new PinK now has a huge number of commands and methods and a complete reference documentation.

PinK has been presented at the CHEP95 Conference in Rio de Janeiro. After W. Wander gave a talk on DAD, K. Ackerstaff presented PinK and some of the applications at HERMES (MAF again missed the opportunity to come to Barzil). A lot of the trends in Computing in High Energy Physics which emerged at this conference are realized in these two packages. The response to the talks was good, people from Fermilab, ANL and CERN are interested in the software and have partially installed it. An online demonstration of the HERMES monitoring system based on DAD and PinK was given in addition to the scheduled talks.
The slides from the talk at CHEP95 are available on the PinK publication and image page


Version history

Version 0.27

Version 0.27

Version 0.26

Version 0.25

Version 0.24

Version 0.23

Version 0.22

Version 0.21

Version 0.20

Version 0.19

Version 0.18

Version 0.17

Version 0.16

(pre)Version 0.15


Publications and Pictures concerning PinK


The following PinK Publications are available:


And here are some nice Pictures concerning PinK:


How to report PinK bugs

You may help us - the PinK developers - and them - the PinK users - a lot, if you report inconsistencies or even bugs of PinK to pink@hermes.desy.de.

Since there are different possible classes of bugs, the following list should give you some hints, how to report a bug in a way, that we have as much information as needed to fix the problem.


Command or method syntax

It could happen, that the actual command or method syntax of the PinK executable does not fit the documented one or that the implementation of a command or method is really buggy and reports a syntax error even if you call it with the right number and type of arguments.

In those cases please report simply the name of the command or method and a short discription of the problem.


Command or method semantics

If you should - after the consultation of the available documentation - come to the conclusion, that a command or method does not behave like it's supposed to do, this might also be a bug.

In those cases report a description of your problem including your understanding of the command semantics and your supposition of what's going wrong. A copy of your script may also be usefull to find out misunderstandings.


Crashes

If PinK should ever crash and produce a core dump, it is necessary for us to obtain both, the script you were executing and the core file itself. For the analysis of the latter it is necessary that the PinK executable was compiled and linked using the debug option.

If you're using PinK not on the hermes machine, please use a debugger of your choice to produce a stack backtrace and a listing of the local variables. Here is an example session how to do this using gdb:

maf@hermes:/export/home/maf 101>gdb /hermes/new/bin/pinky 
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (mips-sgi-irix5), Copyright 1994 Free Software Foundation, Inc...

(gdb) core ~kai/slow_control/tcl/pinkydump
Core was generated by `pinky'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/local/lib/libtcl.so...done.
Reading symbols from /usr/local/lib/libtk.so...done.
Reading symbols from /cern/pro/lib/libpawlib.so...done.
Reading symbols from /cern/pro/lib/libmathlib.so...done.
Reading symbols from /usr/local/lib/libX11.so.6.0...done.
Reading symbols from /usr/lib/libm.so...done.
Reading symbols from /lib/libc.so.1...done.
#0  0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0, 
    memstat=mem_keep) at server.c:598
server.c:598: No such file or directory.

(gdb) where
#0  0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0, 
    memstat=mem_keep) at server.c:598
#1  0x4854d0 in co_Close (elem=0x7fff493c) at ccommand.c:600
#2  0x47fba4 in dadDisconnect (Id=22, ok=0x7fff4960) at dadlib.c:216
#3  0x47fee4 in dadExit () at dadlib.c:270
#4  0x450384 in pink_dadexit (interp=0x10125018) at dadexit.c:57
#5  0x428f20 in pink_exit (dummy=0x0, interp=0x10125018, argc=1, 
    argv=0x7fff4a90) at exit.c:71
#6  0x5ffa7608 in Tcl_Eval ()
#7  0x5ffb3cc8 in Tcl_RecordAndEval ()
#8  0x41b050 in StdinProc (clientData=0x0, mask=1) at tkMain.c:387
#9  0x5d85b8 in Tk_DoOneEvent () at tkEvent.c:1358
#10 0x5d89c0 in Tk_MainLoop () at tkEvent.c:1535
#11 0x41ad90 in main (argc=1, argv=0x7fff5ebc) at tkMain.c:298

(gdb) info locals
cmdptr = (int *) 0x3
cmdlen = 0


Bugs of the Browser

Even if the browser pb is not officially supported, the same rules as for crashes apply to bug reports concerning this tool. Please include the following information in your report:
  1. Which data did you browse (File, Server, etc.)?
  2. Which command line flags did you use to start pb?
  3. (How) can the bug be reproduced (sequence of button pushes etc.)?
  4. If tcl/Tk reports a stack trace include it in you message.
The stack trace can usually be requested in a separte dialog box and looks like this example:
can't read "pritabinfo(dcBurstInfo,Column,iHits[1],Expr)": no such element in array
    while executing
"set expr    $pritabinfo($tabname,Column,$fname,Expr)..."
    (procedure "_pritab_getvalue" line 9)
    invoked from within
"_pritab_getvalue $name $fname"
    invoked from within
"set value   [_pritab_getvalue $name $fname]..."
    ("foreach" body line 3)
    invoked from within
"foreach fname $pritabinfo($name,Columns) {
      if $pritabinfo($name,Column,$fname,Hidden) continue
      set value   [_pritab_getvalue $name $fname] ..."
    ("for" body line 19)
    invoked from within
"for {set i 1; set y 0} {$i <= $rows} {incr i} {
    $adname fetch ID $i

#----------------------------------------------------------------------#
# Ch ..."
    (procedure "tab_update" line 44)
    invoked from within
"tab_update $name 1"
    invoked from within
"return [tab_update $name 1]..."
    (procedure "tab_print" line 122)
    invoked from within
"tab_print [lindex "dcBurstInfo dcScalInfo dcSyncInfo dscSCALERS" [.adbrowser.help.selector2.f.entries curselection]]"
    (command bound to event)


The PinK executables

The PinK executables are simple programms consisting of the Tcl command language, the Tk toolkit, the ADAMO and DAD library, and a short main program that reads commands from standard input or from a file. They create a main window and then process PinK/Tcl commands.
Since version 0.17 there is also a windowless version (not including the Tk toolkit) available. Click here for the documentation of the Floyd executables. If the PinK executables are invoked with no -f option then they read commands interactively from standard input. They will continue processing commands until all windows have been deleted or until EOF (End Of File) is reached.
If the -file option is provided to Tk, then the PinK executables read commands from the file named in the -file option. These commands will normally create an interactive interface consisting of one or more widgets. When the end of the command file is reached, the exxecutables will continue to respond to X events until all windows have been deleted.
If there exists a file .pinkrc in the home directory of the user, it will be evaluated as a PinK script just before reading the first command from standard input or from the script.
The PinK executables come in two flavors: pink and pinky.
While pink uses the full featured ADAMO tap library including the complete ZEBRA code, pinky uses only the smalltap library without the ZEBRA drivers which makes the executable much smaller.
A little backdraw of pinky is, that due to the lack of the ZEBRA drivers there are no GAF objects available; however - this makes pinky ideal as an interpreter for DAD client scripts.


Command line syntax

pink and pinky have the same command line syntax as wish, allowing the following options:
-display display
Defines the display (and screen) on which to display the main window.

-file fileName
Read commands from fileName rather than standard input. The last element in fileName will be used as the title for the application and name of its interpreter for send commands (unless overridden by the -name option).

-geometry geometry
Initial geometry to use for window. geometry is of the form
[widthxheight][+/-xoffset+/-yoffset], where all parameters are numbers measured in pixels. The width and height parts of the geometry specification sepecify the size of the initial window, while the xoffset and yoffset parts are used to specify the distance of the window from the left (+xoffset) or right (-xoffset) and top (+yoffset) and bottom (-yoffset) edges of the screen. Offsets must be given as pairs; in other words, in order to specify either xoffset or yoffset both must be present. The window can be placed in the four corners of the screen using the following specifications:

-help
Print a summary of the command-line options and exit.

-name name
Use name as the title to be displayed in the window, and as the name of the interpreter for send commands.

-sync
Execute all X server commands synchronously, so that errors are reported immediately. This will result in much slower execution, but it is useful for debugging.


The PinK library

On startup the PinK executables try to find an additional Tcl autoload library in one of the following directories:
./pinklib, $PINK_LIB, $HERMES_LIB/pinklib and $HERMES_ROOT/lib/pinklib.
The directories are checked in this order. The name of first existing directory will be reported and prepended to the list in auto_path.


The Startup Files

After searching for the oink library, the PinK executables try to exectute the file pinkrc (for pink and pinky) resp. floydrc (for floyd and floydy) in this directory. If the file is not found, the files ~/.pinkrc and ~/.floydrc are checked.
The *rc-files coming with the distribution try to execute the files $HERMES_ROOT/lib/*rc and ~/.*rc in that order.


PinK scripts

If you create a PinK script in a file whose first line is
#!/hermes/pro/bin/pink -f
or
#!/hermes/pro/bin/pinky -f
then you can invoke the script file directly from your shell if you mark it as executable. This assumes that PinK has been installed in the default location in /hermes/pro/bin; if it's installed somewhere else then you'll have to modify the above line to match.


How to report PinK bugs

You may help us - the PinK developers - and them - the PinK users - a lot, if you report inconsistencies or even bugs of PinK to pink@hermes.desy.de.

Since there are different possible classes of bugs, the following list should give you some hints, how to report a bug in a way, that we have as much information as needed to fix the problem.


Command or method syntax

It could happen, that the actual command or method syntax of the PinK executable does not fit the documented one or that the implementation of a command or method is really buggy and reports a syntax error even if you call it with the right number and type of arguments.

In those cases please report simply the name of the command or method and a short discription of the problem.


Command or method semantics

If you should - after the consultation of the available documentation - come to the conclusion, that a command or method does not behave like it's supposed to do, this might also be a bug.

In those cases report a description of your problem including your understanding of the command semantics and your supposition of what's going wrong. A copy of your script may also be usefull to find out misunderstandings.


Crashes

If PinK should ever crash and produce a core dump, it is necessary for us to obtain both, the script you were executing and the core file itself. For the analysis of the latter it is necessary that the PinK executable was compiled and linked using the debug option.

If you're using PinK not on the hermes machine, please use a debugger of your choice to produce a stack backtrace and a listing of the local variables. Here is an example session how to do this using gdb:

maf@hermes:/export/home/maf 101>gdb /hermes/new/bin/pinky 
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (mips-sgi-irix5), Copyright 1994 Free Software Foundation, Inc...

(gdb) core ~kai/slow_control/tcl/pinkydump
Core was generated by `pinky'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/local/lib/libtcl.so...done.
Reading symbols from /usr/local/lib/libtk.so...done.
Reading symbols from /cern/pro/lib/libpawlib.so...done.
Reading symbols from /cern/pro/lib/libmathlib.so...done.
Reading symbols from /usr/local/lib/libX11.so.6.0...done.
Reading symbols from /usr/lib/libm.so...done.
Reading symbols from /lib/libc.so.1...done.
#0  0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0, 
    memstat=mem_keep) at server.c:598
server.c:598: No such file or directory.

(gdb) where
#0  0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0, 
    memstat=mem_keep) at server.c:598
#1  0x4854d0 in co_Close (elem=0x7fff493c) at ccommand.c:600
#2  0x47fba4 in dadDisconnect (Id=22, ok=0x7fff4960) at dadlib.c:216
#3  0x47fee4 in dadExit () at dadlib.c:270
#4  0x450384 in pink_dadexit (interp=0x10125018) at dadexit.c:57
#5  0x428f20 in pink_exit (dummy=0x0, interp=0x10125018, argc=1, 
    argv=0x7fff4a90) at exit.c:71
#6  0x5ffa7608 in Tcl_Eval ()
#7  0x5ffb3cc8 in Tcl_RecordAndEval ()
#8  0x41b050 in StdinProc (clientData=0x0, mask=1) at tkMain.c:387
#9  0x5d85b8 in Tk_DoOneEvent () at tkEvent.c:1358
#10 0x5d89c0 in Tk_MainLoop () at tkEvent.c:1535
#11 0x41ad90 in main (argc=1, argv=0x7fff5ebc) at tkMain.c:298

(gdb) info locals
cmdptr = (int *) 0x3
cmdlen = 0


Bugs of the Browser

Even if the browser pb is not officially supported, the same rules as for crashes apply to bug reports concerning this tool. Please include the following information in your report:
  1. Which data did you browse (File, Server, etc.)?
  2. Which command line flags did you use to start pb?
  3. (How) can the bug be reproduced (sequence of button pushes etc.)?
  4. If tcl/Tk reports a stack trace include it in you message.
The stack trace can usually be requested in a separte dialog box and looks like this example:
can't read "pritabinfo(dcBurstInfo,Column,iHits[1],Expr)": no such element in array
    while executing
"set expr    $pritabinfo($tabname,Column,$fname,Expr)..."
    (procedure "_pritab_getvalue" line 9)
    invoked from within
"_pritab_getvalue $name $fname"
    invoked from within
"set value   [_pritab_getvalue $name $fname]..."
    ("foreach" body line 3)
    invoked from within
"foreach fname $pritabinfo($name,Columns) {
      if $pritabinfo($name,Column,$fname,Hidden) continue
      set value   [_pritab_getvalue $name $fname] ..."
    ("for" body line 19)
    invoked from within
"for {set i 1; set y 0} {$i <= $rows} {incr i} {
    $adname fetch ID $i

#----------------------------------------------------------------------#
# Ch ..."
    (procedure "tab_update" line 44)
    invoked from within
"tab_update $name 1"
    invoked from within
"return [tab_update $name 1]..."
    (procedure "tab_print" line 122)
    invoked from within
"tab_print [lindex "dcBurstInfo dcScalInfo dcSyncInfo dscSCALERS" [.adbrowser.help.selector2.f.entries curselection]]"
    (command bound to event)


The PinK Basics

PinK is a TCL/TK extension providing an interface to the ADAMO and DAD packages. ADAMO implements the Entity Relationship Database Model and DAD extends it towards a distributed multiprocess database with fast and flexible IO. PinK is designed to serve as an easy to use interface incorporating both the DAD- and ADAMO features. The tk tollkit and other graphical extensions (like BLT) provide graphics widgets enabeling the PinK programmer to make GUI's to the database in an easy way.
The implementation of the ADAMO- and DAD-features is object oriented and hence a very intuitive approach to the database. Nevertheless to be able to understand PinK, basic knowledge of the ADAMO and DAD concepts is a prerequisit. PinK tries to stay as close as possible to ADAMO and DAD, making it easy to design applications for users being familiar with these conceps.


There are two basic objects to comunicate with a database in PinK:
GAF
The Generic Adamo File which is a file using different access modes and drivers and can beaccessed directly from the PinK shell, and

DAD-Connection
A connection to the database via a DAD-server or DAD-pipe.

In PinK these objects each have a set of methods to access, manipulate and insert information stored in the database. The substructure of the database is organized in dataflows and tables which are objects themselfs having methods being independent of whether the dataflow or table comes from a GAF or a DAD-connection. Selectors and Indices are subojects to for customizing the acces to the information in a table.

In general PinK is independent of the structure of a database and it's data definition. Opening a database via the above mentioned objects the entire structure of the data can be transferred to the PinK application thus being independent of a specific implementation of a datamodel.

Another way to use PinK is to indepenindently biuld a database defining it's own structure entirely inside PinK.


The GAF object in PinK

A GAF is a Generic Adamo File storing data in one or more records where each contains a set of dataflows and tables sharing the same data definition but being different instances. In high energy physics for example a record could be an event holding raw data in tables belonging to one dataflow and reconstruction data in tables and dataflows belonging to a second dataflow. A GAF would contain the events from one run in this example.

A GAF can for example be either a random access, a sequential binary or a sequential ASCII file which can be accessed using the appropriate IO-driver (ZEBRA drivers RZ, FZ or IE). It usually contains a so called Key Table holding information specific to the records contained in the GAF, e.g. the run number, the event number and the trigger type in the above mentioned example. A record could also hold a data sample with a certain validity period in which case this period for the specific record is an entry of the Key Table.


The Floyd executables

There is a windowless variation of the PinK executables called Floyd. This are simple programms consisting of the Tcl command language, the ADAMO and DAD library, and a short main program that reads commands from standard input or from a file.
If invoked with no arguments then Floyd runs interactively, reading PinK/Tcl commands from standard input and printing command results and error messages to standard output. It runs until the exit command is invoked or until it reaches end-of-file on its standard input.
If there exists a file .floydrc in the home directory of the user, it will be evaluated as a PinK script just before reading the first command from standard input or from the script.
The Floyd executables come in two flavors: floyd and floydy.
While floyd uses the full featured ADAMO tap library including the complete ZEBRA code, floydy uses only the smalltap library without the ZEBRA drivers which makes the executable much smaller.
A little backdraw of floydy is, that due to the lack of the ZEBRA drivers there are no GAF objects available; however - this makes floydy ideal as an interpreter for DAD client scripts.


Command line syntax

floyd and fludyy have the same command line syntax as tclsh:
floyd [fileName [arg ...]]
If Floyd is invoked with arguments then the first argument is the name of a script file and any additional arguments are made available to the script as variables (see below). Instead of reading commands from standard input Floyd will read PinK commands from the named file and exit when it reaches the end of the file.

The following variables are available in the Floyd script:

argc
Contains a count of the number of arguments (0 if none), not including the name of the script file.
argv
Contains a list whose elements are the arguments, in order, or an empty string if there are no arg arguments.
argv0
Contains fileName if it was specified. Otherwise, contains the name by which Floyd was invoked.
tcl_interactive
Contains 1 if Floyd is running interactively (no fileName was specified and standard input is a terminal-like device), 0 otherwise.


The PinK library

On startup the Floyd executables try to find an additional Tcl autoload library in one of the following directories:
./pinklib, $PINK_LIB, $HERMES_LIB/pinklib and $HERMES_ROOT/lib/pinklib.
The directories are checked in this order. The name of first existing directory will be reported and prepended to the list in auto_path.


Floyd Scripts and the Idle Function

There are two features of the PinK executables that are introduced by the Tk library one wants not easily top give up in the windowless version. This two commands are the after command and the CreateFH method on Dad objects. Hence this two features are implemented in Floyd making it necessary to set Floyd in an idle mode where it reacts on timer and connection events. This idle mode is entered using the floydl function.


Special Floyd commands

This is a list of commands that are only available in Floyd or were reimplemented to substitute the Tk commands.

Special Floyd commands:


Command: after

Execute a command after a time delay.


       after delay_ms [arg ...]
  

See also:


Command: floydl

Enter the idle mode. In this mode Flyd will process all after and CreateFH events until there are no more open connections and no after command requests - in that case floydl returns.


       floydl

See also:


The ADAMO GAF objects in PinK

This is a list of PinK commands and methods to handle ADAMO GAF objects. For an introduction to ADAMO see the Users guide, for a description of the Fortran interface have a look into the Reference Manual.

PinK commands related to ADAMO GAFs:


PinK currently supports the following methods on ADAMO GAF objects:


Command: cregaf

Creates an ADAMO GAF and an associated PinK GAF object. You may open an existing GAF with the opengaf command.


 cregaf objectname keytable options

See also:


Command: listgaf

Lists all open GAFs to stdout. Therefore this function only usefull for debugging purposses.


 listgaf

See also:


Command: opengaf

Open an existing ADAMO GAF and create an associated PinK GAF object. You may create a new GAF with the cregaf command.


 opengaf objectname options

See also:


GAF method: askkey

Get a description of the key used for a GAF. You may then create a keytable using the cretab command.


 <gafobj> "askkey" 

See also:


GAF method: close

Close an open GAF and destroy the attached PinK object.


 <gafobj> "close" 

See also:


GAF method: delete

Deletes the record specified in the window common block of a keytable from a GAF.


 <gafobj> "delete" keytab 

See also:


GAF method: DRIVER

Get the driver used for a GAF object.


 <gafobj> "DRIVER" 

See also:


GAF method: drop

Drop an open GAF, i.e. remove it from disk and destroy the attached PinK object.


 <gafobj> "drop" 

See also:


GAF method: fetch

Fetch a table or dataflow out of a GAF database record specified in the window common block of a keytable.


 <gafobj> "fetch" keytab tdf

See also:


GAF method: FILFOR

Get the file format used for a GAF object.


 <gafobj> "FILFOR" 

See also:


GAF method: FILSIZ

Get the file size of a GAF in words.


 <gafobj> "FILSIZ" 

See also:


GAF method: INDE

Get index IO mode used for a GAF object.


 <gafobj> "INDE" 

See also:


GAF method: insert

Inserts the record specified in the window common block of a keytable into a GAF.


 <gafobj> "insert" keytab 

See also:


GAF method: LUN

Get the number of the logical unit used for a GAF object.


 <gafobj> "LUN" 

See also:


GAF method: MEDIUM

Get the medium the file of a GAF object is stored on.


 <gafobj> "MEDIUM" 

See also:


GAF method: meta

Read the meta information of a table or a dataflow from a GAF. The missing ADAMO objects will be created, you can then build PinK objects using the grabobj command.


 <gafobj> "meta" adamotdf

See also:


GAF method: NAME

Get the name of the file used to store the data of a GAF object.


 <gafobj> "NAME" 

See also:


GAF method: next

Write the key of the next record of a GAF database into the window common block of a keytable. After the opening of a GAF next will give you the key of the first record.
Note: The GAF has to be in read only mode to use this method.


 <gafobj> "next" keytab 

See also:


GAF method: print

Print information about a GAF to stdout. Therefore this function only usefull for debugging purposses.


 <gafobj> "print" 

See also:


GAF method: RECFOR

Get the record format of a GAF object.


 <gafobj> "RECFOR" 

See also:


GAF method: RECSIZ

Get the record size in words used for a GAF object.


 <gafobj> "RECSIZ" 

See also:


GAF method: replace

Replaces the record specified in the window common block of a keytable in a GAF database.


 <gafobj> "replace" keytab 

See also:


GAF method: rewind

Rewind a GAF database. To get the key of the first record you may use the next method afterwards.
Note: The GAF has to be in read only mode to use this method.


 <gafobj> "rewind"  

See also:


GAF method: RWMODE

Get general IO mode for a GAF object.


 <gafobj> "RWMODE" 

See also:


GAF method: SELE

Get selector IO mode for a GAF object.


 <gafobj> "SELE" 

See also:


GAF method: set

Set the transfer option of a table or all tables contained in a dataflow with respect to a GAF. With this option you can define whether indices, selectors and projectors are transfered with a table or not.


 <gafobj> "set" tdf option

See also:


GAF method: snapshot

Writes all record keys of a GAF matching a filter condition into a keytable. The table is not cleared, i.e. the information is added. You may use the table object method clear to empty the keytable before the use of snapshot.
Note: This method for drivers supportin direct access operations.


 <gafobj> "snapshot" keytab [filter]

See also:


GAF method: WARN

Get status of the WARN flag for a GAF object. This flag enables/disables warning messages when the meta tables are read back and do not agree with tables in memory.


 <gafobj> "WARN" 

See also:


The DAD objects in PinK

This is a list of PinK commands and methods to handle DAD objects. For an introduction to DAD and a description of it's C and Fortran interface, see the DAD manual.

PinK commands related to DAD functions:


PinK currently supports the following methods on DAD objects:


Command: dadConnect

Opens a DAD connection as specified in the connection database. This database is build up using dadInit and/or dadHost,


 dadConnect dad_name dataflow

See also:


Command: dadDoConnect

Opens a DAD connection.


 dadDoConnect name servername type port 
              [dataflow [keytable] [-urbwgkmz]

See also:


Command: dadErrtoStr

Translates a Dad error code into a human readable form.


 dadErrtoStr errorcode

See also:


Command: FtoTime

Translates a fortran style date/time pair into the time_t format used on UNIX.


 FtoTime YYMMDD hhmmss

See also:


Command: dadGetNackErrno

Get current error code of Dad's nack library.
 dadGetNackErrno

See also:


Command: dadGetNackErrString

Get string desribing the last server error..
 dadGetNackErrString

See also:


Command: dadinit

Reads in the connection definitions stored in dadinit.cnf.


 dadInit


See also:


Command: dadHost

Defines a host to connect to. Overwrites entries defined in dadinit.cnf read in with
  • dadInit. .


     dadHost servername type port dataflow [-urbwgkmz]
    
    Since Version 0.16 empty strings may be supplied for the servername, type and port argument to save the current settings.


    See also:


    Command: dadOpenDB

    Opens a DAD server connection.


     dadOpenDB name servername port dataflow [-urbwgk]
    

    See also:


    Command: dadOpenFile

    Opens a DAD file.


     dadOpenFile name filename dataflow [keytable] [-rwbgkcmz]
    

    See also:


    Command: dadOpenPipe

    Opens a DAD pipe connection.


     dadOpenPipe name pipename split dataflow [keytable] [-rwgkn]
    

    See also:


    Command: dadOpenSHM

    Opens a DAD shared memory connection.


     dadOpenSHM name memname dataflow [keytable] [-rwgkm]
    

    See also:


    Command: dadParse

    Evaluates a DAD parser expression.
    Note that the indexing of array elements is ADAMO-like in this case (this is not the default behaviour of the DAD parser which is to use C-style indexing, i.e. all indices start with 0).


     dadParse expression [table]
    

    See also:


    Command: dadSetAuthFun

    Sets a procedure to be called for user authentication.


     dadSetAuthFun [authproc]
    

    See also:


    Command: dadSetPipeHandle

    Set the pipe to be read from, if a process was started via dadOpenPipe.
     dadSetPipeHandle pipename
    

    See also:


    Command: FtoTime

    Translates a fortran style date/time pair into the time_t format used on UNIX.


     FtoTime YYMMDD hhmmss
    

    See also:


    Dad method: Accept

    Load current database record from server.


     <dadobj> "Accept"
    

    See also:


    Dad method: AcceptClr

    Clear condition list for a connection.
     <dadobj> "AcceptClr"
    

    See also:


    Dad method: AcceptDo

    Load current database record from server considering conditions established using the AcceptIf or AcceptOr methods.


     <dadobj> "AcceptDo"
    

    See also:


    Dad method: AcceptIf

    Add a condition into the list for a connection. This condition will be ANDed with prevoius ones. You may insert a logical OR using AcceptOr.
     <dadobj> "AcceptIf" table condition
    

    See also:


    Dad method: AcceptOr

    Insert an OR into the condition list for a connection.
     <dadobj> "AcceptOr"
    

    See also:


    Dad method: AcceptSelect

    Set a selector on the keytable of a connection, i.e. if the Dad methods Rewind, Last, Prev and Next will consider the condition list for this connection.
     <dadobj> "AcceptSelect" flag
    

    See also:


    Dad method: AcceptTest

    Tests if the condition list for the connection is true or false for the current record.
     <dadobj> "AcceptTest"
    

    See also:


    Dad method: Book

    Activates booking for the complete dataflow served by a connection. First clears the booking condition list.
     <dadobj> "Book"
    

    See also:


    Dad method: BookClr

    Deactivates booking and clears the booking condition list for a connection.
     <dadobj> "BookClr"
    

    See also:


    Dad method: BookDo

    Activates booking for the complete dataflow served by a connection considering the current status. Only records fulfilling the booking condition list will be sent.
     <dadobj> "BookDo"
    

    See also:


    Dad method: BookDoNow

    Activates booking for the complete dataflow served by a connection. Only new records fulfilling the booking condition list will be sent.
     <dadobj> "BookDoNow"
    

    See also:


    Dad method: BookIf

    Appends a condition to the booking condition list. All those conditions are ORed.
     <dadobj> "BookIf" table condition
    

    See also:


    Dad method: CreateFH

    Binds a PinK procedure to a connection to be called whenever a message is pending.
     <dadobj> "CreateFH" [procedure]
    

    See also:


    Dad method: Disconnect

    Close a connection of any type (there are no methods corresponding to dadCloseFile or dadClosePipe).
     <dadobj> "Disconnect"
    

    See also:


    Dad method: FillRecordKey

    Transfers the window common block of an PinK table object to the internal one used by Dad. The key is the used with the next Write operation.


     <dadobj> "FillRecordKey" table
    

    See also:


    Dad method: Flush

    Remove all pending messages from the queue of a booked connection.


     <dadobj> "Flush"
    

    See also:


    Dad method: GetDataflow

    Get the ADAMO name of the dataflow served by a dad object.


     <dadobj> "GetDataflow"
    

    See also:


    Dad method: GetKeyTable

    Get the ADAMO name of the keytable used by a Dad connection used with the keytable flag (-k). You may get the name of an associated PinK object with getobj or create a new one using grabobj.


     <dadobj> "GetKeyTable"
    

    See also:


    Dad method: GetRecordId

    Get the ID of the current record of a connection. Keep in mind that this ID's do not correspond to the timeordering of the records.


     <dadobj> "GetRecordId"
    

    See also:


    Dad method: GetRecordKey

    Transfers the internal keytable window common block used by Dad to the one owned by an PinK table objecct. The internal Dad keytable is set on Accept, AcceptDo and Read calls.


     <dadobj> "GetRecordKey" table
    

    See also:


    Dad method: GetTabIf

    Loads a complete table or a defined subset of its rows from the server.


     <dadobj> "GetTabIf" table [expression]
    

    See also:


    Dad method: Handle

    Get the file descriptor handle of a connection.


     <dadobj> "Handle"
    

    See also:


    Dad method: Last

    Go to the last record of a database. The accept condition list may be considered in dependence of the AcceptSelect flag.
     <dadobj> "Last"
    

    See also:


    Dad method: Message

    Waits for booking messages from the server. If there are incoming messages within the specified timeout period these are automaticly applied to the adamo tables.
     <dadobj> "Message" wtime [*table [*rowid]]
    

    See also:


    Dad method: Multimode

    Sets or clears a selector on the keytable of the server for further record movement (Last, Next, Prev and Rewind). All clients in multimode on a certain dataflow will operate synchronously concerning the mentioned record moving operations.


     <dadobj> "Multimode" flag
    

    See also:


    Dad method: MRead

    Read the next record from input opend in multi mode. The difference to read is, that the record type might change within the input source. This way the ADAMO NEXT/FETCH scheme can be simulated by writing the key and data in subsequent records.


     <dadobj> "MRead" [readflag]
    

    See also:


    Dad method: MWrite

    Write an output record in multi mode. The difference to write is, that the record type might be differnt for each record written. This way the ADAMO NEXT/FETCH scheme can be simulated by writing the key and data in subsequent records.


     <dadobj> "MWrite" table/dataflow
    

    See also:


    Dad method: New

    Generates a new empty record on the server and appends it to the end of the keytable.


     <dadobj> "New"
    

    See also:


    Dad method: Next

    Go to the following record of a database. The accept condition list may be considered in dependence of the AcceptSelect flag.
     <dadobj> "Next"
    

    See also:


    Dad method: NextUpdate

    Get the time when the current records validity period ends. You may then use the Update method.
     <dadobj> "NextUpdate"
    

    See also:


    Dad method: Param

    Get some parameters of this connection.
     <dadobj> "Param"
    

    See also:


    Dad method: Prev

    Go to the previous record of a database. The accept condition list may be considered in dependence of the AcceptSelect flag.
     <dadobj> "Prev"
    

    See also:


    Dad method: PrevUpdate

    Get the time when the current records validity period begins.
     <dadobj> "PrevUpdate"
    

    See also:


    Dad method: Read

    Load the next database record from the database. For server connections this is equivaltent to a Next method followed up by the Accept method. The accept condition list may be considered in dependence of the AcceptSelect flag.


     <dadobj> "Read"
    

    See also:


    Dad method: RepUpdate

    Replaces time dependend information on the server. To use the RepUpdate method the referred table has to contain update information in two columns named iTimeStart and iTimeEnd.


     <dadobj> "RepUpdate" table [selector]
    

    See also:


    Dad method: Rewind

    Go back to the first record of a database. The accept condition list may be considered in dependence of the AcceptSelect flag.
     <dadobj> "Rewind"
    

    See also:


    Dad method: Semophore

    Requests/releases a semaphore from the server. Semaphores are currently only used to prevent write accesses to the server while the semaphore holder is updating some database contents.


     <dadobj> "Semaphore" valtime [flags]
    

    See also:


    Dad method: SetRecordId

    Set the ID of the next record to be read with Accept. Keep in mind that the (physical) ordering by ID's does not correspond to the timeordering of the records.


     <dadobj> "SetRecordId" id
    

    See also:


    Dad method: Shutdown

    Shutdown the server of this connection and close the connection.
     <dadobj> "Shutdown"
    

    See also:


    Dad method: TimeDaf

    Set the cursor to the database record which is valid for a given time. The database has to be opened in update mode for this operation. The record may then be read using the Accept method.


     <dadobj> "TimeDaf" reqtime
    

    See also:


    Command: TimetoF

    Translates a UNIX time_t time into a date/time pair used with Fortran.


     TimetoF time
    

    See also:


    Dad method: Update

    Get the database record which is valid for a given time. The database has to be opened in update mode for this operation.


     <dadobj> "Update" reqtime [newrowflag]
    

    See also:


    Dad method: Write

    The method Write writes the whole dataflow to the database and replaces the database representation of the current record. This call should be embraced by calls to Semaphore if you're altering data on a server to which more than one clients may be connected.


     <dadobj> "Write"
    

    See also:


    Dad method: WriteTab

    The method WriteTab writes a table or parts of it to the database and replaces the database representation. This call should be embraced by calls to Semaphore if you're altering data on a server to which more than one clients may be connected.


     <dadobj> "WriteTab" table [selector [flags]]
    

    See also:


    Dad method: WUpdate

    Writes the rows of a table contained in a selector to the database. If the referred table contains update information in the two columns named iTimeStart and iTimeEnd, only the iTimeStart value will be used, the iTimeEnd fields will be set to TILLEVER giving the rows an infinite period of validity. In contrast to the RepUpdate method the table does not need to contain the update information columns for the usage of WUpdate - if there is none the rows are simply appended to the servers tables.


     <dadobj> "WUpdate" table [selector]
    

    See also:


    The ADAMO table objects in PinK

    This is a list of PinK commands and methods to handle ADAMO table objects. For an introduction to ADAMO see the Users guide, for a description of the Fortran interface, see Reference Manual.

    PinK commands related to ADAMO tables:


    PinK currently supports the following methods on ADAMO table objects:


    Command: cretab

    Creates an ADAMO table and an associated PinK table object.


     cretab objectname tablename collist [inirow [maxrow]]
    

    See also:


    Table method: clear

    Clear the table.


     <tabobj> "clear"
    

    See also:


    Table method: clearnext

    Clears the counter containing the row ID that will be obtained on the next insert operation setting the ID field to "NEXT".


     <tabobj> "clearnext"
    

    See also:


    Table method: columns

    Gets a list of column descriptors for this table.


     <tabobj> "columns"
    

    See also:


    Table method: delent

    Deletes an entity from the table. This is equivalent to delrow.


     <tabobj> "delent" [rowid]
    

    See also:


    Table method: delmany

    Deletes a subset of rows from a table.


     <tabobj> "delmany" access [cursor1 [cursor2]]
    

    See also:


    Table method: delrow

    Deletes a row from the table. This is equivalent to delent.


     <tabobj> "delrow" [rowid]
    

    See also:


    Table method: describe

    Prints a description of this table to stdout. Therefore it's only usefull for debugging purposses.


     <tabobj> "describe" 
    

    See also:


    Table method: drop

    Destroys a table and removes it's PinK object. All depending indices and selectors will disappear also.
    Important Note: It is not allowed to drop a table that is used by an open Dad connection.


     <tabobj> "drop" 
    

    See also:


    Table method: fetch

    Copy a row from a table into its window common block. The row is specified by it's ID in a selector or index.


     <tabobj> "fetch" access cursor
    

    See also:


    Table method: fetcol

    Get a column out of a table. The data is formated as with getfield. Note that only one dimensional arrays are supported by PinK.


     <tabobj> "fetcol" colname [access [cursor1 [cursor2 [format]]]]
    

    See also:


    Table method: getfield

    Get the contents of a field of the table's window common block.


     <tabobj> "getfield" field [format]
    

    See also:


    Table method: getrelation

    Get the target table and index of a relation initiated by the contents of the table's window common block.


     <tabobj> "getrelation" relation
    

    See also:


    Table method: getrow

    Copy a table row into the window common block.


     <tabobj> "getrow" [rowid]
    

    See also:


    Table method: id

    Gets the ADAMO ID of a PinK table object.


     <tabobj> "id"
    

    See also:


    Table method: indices

    Get a list of all PinK index objects defined for a table.


     <tabobj> "indices"
    

    See also:


    Table method: inirow

    Gets the value of the inirow parameter used on definition of a table which defines the number of initially allocated rows.


     <tabobj> "inirow"
    

    See also:


    Table method: inscol

    Insert a column into a table. If the table is empty the first inscol operation has to fill the ID column and will define the table length. If the table is not empty the inserted column elements have to match the table size. The data is parsed as in setfield.
    Note that only one dimensional arrays are supported by PinK.

    Note:This function is not yet enabled since the TAP function inscol seems to be buggy in the current ADAMO version.


     <tabobj> "inscol" colname vallist
    

    See also:


    Table method: insent

    Writes an entity from the window common block into the table. This is not equivalent to insrow since relationships will not be transfered.


     <tabobj> "insent" [rowid]
    

    See also:


    Table method: insrow

    Writes the entire window common block into a row of the table.


     <tabobj> "insrow" [rowid]
    

    See also:


    Table method: iselement

    Test if a row is contained in a table.


     <tabobj> "iselement" [rowid]
    

    See also:


    Table method: list

    Prints a short description of this table to stdout. Therefore it's only usefull for debugging purposses.


     <tabobj> "list" 
    

    See also:


    Table method: lock

    Lock this table, i.e. modifications are no longer allowed.


     <tabobj> "lock"
    

    See also:


    Table method: maxrow

    Get the maximum allowed number of rows in a table.


     <tabobj> "maxrow"
    

    See also:


    Table method: name

    Gets the ADAMO name of a PinK table object.


     <tabobj> "name"
    

    See also:


    Table method: nullwin

    Sets all fields of a window common block to null except for the ID.


     <tabobj> "nullwin" [rowid]
    

    See also:


    Table method: numcol

    Gets the number of columns building up a table.


     <tabobj> "numcol"
    

    See also:


    Table method: print

    Prints the contents of a table to stdout. Therefore it's only usefull for debugging purposses.


     <tabobj> "print" [access [cursor1 [cursor2 [projector]]]]
    

    See also:


    Table method: printrow

    Prints one row of a table to stdout. Therefore it's only usefull for debugging purposses.


     <tabobj> "printrow" access cursor
    

    See also:


    Table method: realtions

    Gets a list of relations starting from this table.


     <tabobj> "relations"
    

    See also:


    Table method: repcol

    Replace a column in a table. Note that only one dimensional arrays are supported by PinK.
    The data is parsed as in setfield.


     <tabobj> "repcol" colname vallist [access [cursor1 [cursor2]]]
    

    See also:


    Table method: repent

    Replaces an entity in a table with the one stored in the window common block. This is not equivalent to reprow since relationships will not be transfered.


     <tabobj> "repent" [rowid]
    

    See also:


    Table method: reprow

    Replaces an row in a table with the one stored in the window common block.


     <tabobj> "reprow" [rowid]
    

    See also:


    Table method: rows

    Gets the number rows currtently contained in a table.


     <tabobj> "rows"
    

    See also:


    Table method: select

    Get the range of an index for which the table rows match the current window common block. The field may be set to "ANY" for jokers.


     <tabobj> "select" [index]
    

    See also:


    Table method: selectors

    Get a list of all PinK selector objects defined for a table.


     <tabobj> "selectors"
    

    See also:


    Table method: setfield

    Modify the contents of a field of the table's window common block.


     <tabobj> "setfield" field value
    

    See also:


    Table method: setformat

    Sets the default format of a table column.


     <tabobj> "setformat" column format
    

    See also:


    Table method: setpropt

    Set the printing options for a table to be used by print and printrow.


     <tabobj> "setpropt" options
    

    See also:


    Table method: unlock

    Unlock a table, i.e. allow modifications.


     <tabobj> "unlock"
    

    See also:


    Table method: wcbsize

    Gets the size of the ADAMO Window Common Block (WCB) of a PinK table object.
    This size is equivalent to the memory one row of this table consumes.


     <tabobj> "wcbsize"
    

    Table method: what

    Report the type of this object.


     <tabobj> "what"
    

    See also:


    The ADAMO dataflow objects in PinK

    This is a list of PinK commands and methods to handle ADAMO dataflow objects. For an introduction to ADAMO see the Users guide, for a description of the Fortran interface, see Reference Manual.

    PinK commands related to ADAMO dataflows:


    PinK currently supports the following methods on ADAMO dataflow objects:


    Command: credfl

    Creates an ADAMO dataflow and an associated PinK dataflow object.


     credfl objectname [dflname]
    

    See also:


    Command: topdfl

    Gets the contents of the root ADAMO dataflow, i.e. a ADAMO name list of all tables and dataflows. You may get the name of an associated PinK object with getobj or create a new one using grabobj.


     topdfl
    

    See also:


    Dataflow method: add

    Add a dataflow to a dataflow. In contrast to insert the dataflow is not expanded into tables but inserted as one object.


     <dflobj> "add" dataflow
    

    See also:


    Dataflow method: ask

    Get the ADAMO member names of a dataflow.


     <dflobj> "ask"
    

    See also:


    Dataflow method: clear

    Clear a dataflow, i.e. remove all tables and dataflows from it.


     <dflobj> "clear"
    

    See also:


    Dataflow method: delete

    Delete a table or dataflow from a dataflow. In contrast to remove dataflows are first expanded into tables which then are removed.


     <dflobj> "delete" tdf
    

    See also:


    Dataflow method: drop

    Drop a dataflow and destroy the attached PinK object.


     <dflobj> "drop"
    

    See also:


    Dataflow method: id

    Gets the ADAMO ID of a PinK dataflow object.


     <dflobj> "id"
    

    See also:


    Dataflow method: insert

    Insert a table or dataflow into a dataflow. In contrast to add dataflows are first expanded into tables which then are inserted.


     <dflobj> "insert" tdf
    

    See also:


    Dataflow method: name

    Gets the ADAMO name of a PinK dataflow object.


     <dflobj> "name"
    

    See also:


    Dataflow method: print

    Prints the ADAMO member names of a dataflow to stdout. Therefore it's only usefull for debugging purposses. You may use the ask method to get the members as a TCL list.


     <dflobj> "print"
    

    See also:


    Dataflow method: remove

    Remove a dataflow from a dataflow. In contrast to delete dataflows are not expanded into tables but removed as one object.


     <dflobj> "remove" dataflow
    

    See also:


    Dataflow method: what

    Report the type of this object.


     <dflobj> "what"
    

    See also:


    The ADAMO index objects in PinK

    This is a list of PinK commands and methods to handle ADAMO index objects. For an introduction to ADAMO see the Users guide, for a description of the Fortran interface, see Reference Manual.

    PinK commands related to ADAMO indices:


    PinK currently supports the following methods on ADAMO index objects:


    Command: creind

    Creates an ADAMO index for a table and an associated PinK object. You may also use getind to create an ascending index over one column.


     creind table indname collist [objectname]
    

    See also:


    Command: getind

    Creates a PinK object for an ADAMO index of a table. If the ADAMO index does not exist and its name corresponds to a column name, a new one is build up over this column in ascending order. You may use creind to create more complex indices.


     getind table indname [objectname]
    

    See also:


    Index method: close

    Closes an index, i.e. it will be not updated on table replacement operations (e.g. reprow, repent, ...). This may save some execution time. However, the index will be updated automatically when it's used the next time (so there is no open method for index objects).


     <indobj> "close"
    

    See also:


    Index method: drop

    Drop an index and destroy the attached PinK object.


     <indobj> "drop"
    

    See also:


    Index method: print

    Print the contents of an index (i.e. an ordered list of table row IDs) to stdout. Therefore it's only usefull for debugging purposses.


     <indobj> "print"
    

    See also:


    Index method: table

    Get the name of the table an index is defined on.


     <indobj> "table"
    

    See also:


    Index method: what

    Report the type of this object.


     <indobj> "what"
    

    See also:


    The ADAMO selector objects in PinK

    This is a list of PinK commands and methods to handle ADAMO selector objects. For an introduction to ADAMO see the Users guide, for a description of the Fortran interface, see Reference Manual.

    PinK commands related to ADAMO selectors:


    PinK currently supports the following methods on ADAMO index objects:


    Command: cresel

    Creates an ADAMO selector for a table and an associated PinK object.


     cresel table selname [objectname]
    

    See also:


    Command: getsel

    Creates a PinK object for an existing ADAMO selector of a table. You may use cresel to create a new selector.


     getsel table selname [objectname]
    

    See also:


    Selector method: clear

    Delete all elements in a selector.


     <selobj> "clear"
    

    See also:


    Selector method: copy

    Copy the contents of an index or selector in a selector.


     <selobj> "copy" access cursor1 cursor2 [orflag]
    

    See also:


    Selector method: delete

    Delete the row identified by the ID in the window common block of the attached table from a selector.


     <selobj> "delete" [rowid] 
    

    See also:


    Selector method: drop

    Drop a selector and destroy the attached PinK object.


     <selobj> "drop"
    

    See also:


    Selector method: elements

    Get the number of table rows contained in a selector.


     <selobj> "elements"
    

    See also:


    Selector method: insert

    Insert a new the row identified by the ID in the window common block of the attached table into a selector.


     <selobj> "insert" [rowid] 
    

    See also:


    Selector method: iselement

    Test, if a row is element of a selector.


     <selobj> "iselement" [rowid] 
    

    See also:


    Selector method: lock

    Lock a selector, i.e. no further write operations (the methods clear, copy, delete, insert, operate, or and select) are allowed. You may unlock the selector again using the unlock method.


     <selobj> "lock"
    

    See also:


    Selector method: operate

    Connect the contents two a indices or selectors into one selector.


     <selobj> "operate" access1 operator access2 [orflag]
    

    See also:


    Selector method: or

    Insert the row identified by the ID in the window common block of the attached table in a selector if it's not already present.


     <selobj> "or" [rowid] 
    

    See also:


    Selector method: print

    Print the contents of a selector (i.e. an ordered subset of table row IDs) to stdout. Therefore it's only usefull for debugging purposses.


     <selobj> "print"
    

    See also:


    Selector method: select

    Insert in a selector all table row IDs for which the value of a specified field is element of a certain interval.


     <selobj> "select" column lower upper [operation]
    

    See also:


    Selector method: table

    Get the name of the table a selector is defined on.


     <selobj> "table"
    

    See also:


    Selector method: unlock

    Unlock a selector, i.e. allow again write operations (the methods clear, copy, delete, insert, operate, or and select).


     <selobj> "unlock"
    

    See also:


    Selector method: what

    Report the type of this object.


     <selobj> "what"
    

    See also:


    The miscellaneous commands of PinK

    This is a list of PinK commands which are not directly related to a specific object type. However, many of this functions are very usefull.

    General miscellaneous commands:


    Miscellaneous ADAMO commands:


    Miscellaneous commands to handle times:


    Command: getver

    Get Version of PinK, ADAMO and the GAF lib.


      getver  [*tapver [*gafver]]
    
    Parameters:     : tapver  - Version of Tap
                      gafver  - Version of GAF
    

    See also:


    Command: detachProcs

    Force redemption of zombies started by this process.
    Note that this operation is performed automatically whenever a new process is created by the exec or open commands.


     detachProcs
    

    Command: createFH

    Create a filehandler for a file opened with open.


      createFH fileId [mask procedure]
    

    See also:


    Command: getobj

    Gets the name of the PinK object associated to an ADAMO table or dataflow. You may also use grabobj to create a new PinK object.


     getobj adamohandle [method]
    

    See also:


    Command: grabobj

    Creates a PinK object for an existing ADAMO table or dataflow. You may also use getobj to get an existing PinK object for an ADAMO table or dataflow.


     grabobj adamohandle [objname [method]]
    

    See also:


    Command: setchk

    Sets the debug level of the ADAMO library.


     setchk [level]
    

    See also:


    Command: gettime

    Get the current time in UNIX time_t convention.


     gettime
    

    See also:


    Command: getUtime

    Get and/or convert the UNIX time.
    Note: This command has a very strange calling convention and is only in for compatibility reasons. It ma disappear some day... Please use the commands strftime and gettime instead.


     getUtime [[UNIX_time|"now"] format]
    
    If no argument is given, the current time in time_t convention is returned.

    See also:


    Command: strftime

    Convert the time from UNIX time_t convention into a more human readable format using the C library call strftime().


     strftime UNIX_time [format]
    

    See also:


    The PinK Library

    The PinK library is a collection of usefull PinK procedures. These procedures are PinK scripts kept in a library directory in various files. Using the tcl/tk auto_mkindex command a file called tclIndex is created which is automatically loaded during startup of PinK. Any procedure can then be called from the PinK shell which in case no procedure with the same name is defined locally sources the corresponding procedure from the library. To maintain a common user interface for PinK applications it is strongly recommended to use these procedures instaed of defining your own.

    The following list if procedures is constantly being improved and completed (as far as possible backward compatible).


    PinK procedure: cprint

    Print a canvas in color mode changing the background color to be white, using your default printer or if specified another printer (like lpr [-Pprinter]).


     cprint canvas [printer]
    
    Have a look at the source code!

    PinK procedure: csave

    Save a canvas as a postscript file in color mode changing the background color to be white. The user will be prompted for a filename using the procedure getfilename.


     csave canvas [file]
    
    Have a look at the source code!

    PinK procedure: getfilename

    Ask the user for a file name in a toplevel window providing an entry as the possibility to accept and cancel.


     getfilename [title]
    
    Have a look at the source code!

    PinK procedure: ConfigureGraph

    This procedure was taken from the BLT distribution and customized for PinK. It uses the tcl/tk send command to communicate with your script. All configuration otions of the blt_graph widget can be manioulated interactively in real time. To be able to use it you have to use xauth-style authorization for your X-terminal. Another PinK shell is executed communicating to the interpreter of your application.
     ConfigureGraph interpreter graph
    
    Have a look at the source code!

    PinK procedure: msgs

    Displays a message in a toplevel window.


     msgs text [width]
    
    Have a look at the source code!

    PinK procedure: tgraph_ini

    Initializes a timegraph based on the blt_graph widget. A time graph has as its default x-axis the time and diplays values beinig updated in time. The user can configure the graph like a usual BLT graph. To get the right labels onto the time axis use the library procedure xtime.


     tgraph_ini graph ntimes nlines
    
    Have a look at the source code!

    PinK procedure: tgraph

    Appends a new point to the line in your timegraph and draws it.


      tgraph graph line_number x y
    
    Have a look at the source code!

    PinK procedure: tgraph_reset

    Resets all lines in a timegraph, the updating can start from scratch after this call.


      tgraph_reset graph
    
    Have a look at the source code!

    PinK procedure: tprint

    Prints a BLT graph in color mode postscript format forcing the background to be white.


      tprint graph [printer]
    
    Have a look at the source code!

    PinK procedure: tsave

    Save a BLT grap as a postscript file in color mode changing the background color to be white. The user will be prompted for a filename using the procedure getfilename.


     tsave graph [file]
    
    Have a look at the source code!

    PinK procedure: xtime

    A procedure to configure the time axis tick labels of a timegraph initialized using the tgraph_ini procedure. This procedure you should usually call during configuration of your timegraph, you have to specify the first argument, whereas the other two are implicitly appended to the call if used like:

    yourgraph xaxis configure  -title "time" -command "xtime %H:%M:%S"
    
    The procedure is then called automatically whenever you update your timegraph with tgraph.


     xtime format graph UNIX_time
    
    Have a look at the source code!

    The PinK High Voltage Example

    This is a short example on how to build a hardware client, a Dad server and some PinK clients to control a high voltage power supply.

    You may obtain all source codes of this example as an archive from here.


    The Server

    The Server is build straight forward as described here in the Dad Manual.
    You may have a look at the DDL and the source code used in this example. See also the dadinit.cnf and portdef.h files.


    The Hardware client

    The client simulates a meassurement of the current high voltage values every ten seconds.
    It can also process certain commands given by the controller task (see below) via the server.
    You may have a look at the source code here.


    The Bargraph Monitor

    This PinK script displays the current values of the High Voltage in a bargraph style. It receives the newest values from the server.
    You may have a look at the PinK script here.



    The Timegraph Monitor

    This PinK script displays the current values of the High Voltage in a timegraph style. It receives the newest values from the server.
    You may have a look at the PinK script here.



    The Controller Task

    This PinK script is a tiny High Voltage Controller. It can send commands to the hardware client via the server and receive and display messages the other way round.
    You may have a look at the PinK script here.




    This page is maintained by pink@hermes.desy.de; last modification: Tue Aug 12 18:19:19 MST 1997 .