PDPRP Technical Program File Description
PDPRP Technical Program File Description
As described in the User's Manual pages,
the PDPRP consist of 4 major components. Here I describe in a little
more detail how the programs work. The program links at the beginning
of each description go to pages with even more detail.
The PDPRP files live in the src directory
under the pdprp directory of my public_html space.
There, there are two directories,
lbc and
telcon.
lbc contains the LBC code while telcon
contains everything else. All programs use Tcl/Tk for their GUI and all are
event-driven. Most have a C component as well, either running the main
loop, or providing new commands to the Tcl/Tk part.
First, you may want to take a look at my Code-Writing
Conventions.
- HQ - there is
no C component to
Headquarters. HQ basically sits there and receives information
and requests for information. It does not, although it could,
directly communicate to any other programs. That is, it does not
use the Tcl/Tk send command to distribute information.
It simply uses the return command to return the
information to the calling program who calls a routine in HQ.
In this way, HQ is completely independent and cares not who is or
is not talking to it. If someone gives it information by calling
an information-accepting routine, it takes it; if someone gets
information by calling an information-returning routine, it gives
it. Obviously, this is not the only way to do things, but I chose
it so HQ is 100% independent from the other programs. You can add
new commands (information accepting and retrieving procedures)
and/or add new programs talking to HQ and no other programs
are affected. There is a test program, hqtest.tcl,
which can be run in addition to the PDPRP programs, which provides a
way the user can send and accept information to/from HQ. To run
it, simply do a wish hqtest.tcl & while in the
~obs/pdprp directory.
HQ must be running before any of the other programs will work.
- Telpos -
a combination of C and Tcl/Tk. The main
loop is executed in the Tcl/Tk code; the C code is just used to define
the commands that the Tcl/Tk code uses to communicate to the PC Guider over
the serial port. This must be running for
telcon to start up as it must get the position from
HQ which telpos provides.
Telpos also queries HQ to find out if the user has
requested a new image be loaded in telcon. If so, or
if 15 minutes have passed since the last load, it loads the latest image.
To do this, it calls another Tcl/Tk code (make_image.tcl) which
communicates with HQ and calls a shell script
(make_image) which ftps the file, calls a C program,
pdpvisual, to process the code, and an ImageMagick routine,
convert, to get the image in the right format. Once this is
all done, make_image.tcl tells HQ the image
is available and each instance of telcon eventually finds out
from HQ the image is ready and loads it into its
display. Another description of this process is in the Telcon New Image page.
The telcon README
file describes the individual files in this package.
- LBC - the main work
loop of the code is executed in C.
The C code then uses the Tcl/Tk update command in its main
loop to keep the GUI updated and active. Nonetheless, the C code calls
some of the Tcl/Tk routines and the Tcl/Tk code calls some C routines
directly. The event-loop, however, is handled in the C code. The
lbc README file describes
the individual files in the lbc directory.
- Telcon - a C
and Tcl/Tk combination with the
main event loop run in the Tcl/Tk part of the code. The C code
is mainly used to define commands and keep track of some variables
for the Tcl/Tk code.
The telcon README
file describes the individual files in this package.
Return to PDPRP Technical
Info Page
Return toPDPRP Main Page.