PDPRP Technical Telcon Description
PDPRP Technical Telcon Description
Unlike the LBC Codes, the Tcl/Tk part of the Telcon
program, telcon.tcl, does a lot more than just acting as
a GUI front-end. Here, the Tcl/Tk code does most of the work, relying
on the C code, telcon.c, only for some supporting routines
which were easier to write in C than in Tcl/Tk. The C code does nothing
(once it sets up the Tcl/Tk program) but wait for the Tcl/Tk code to
call parts of it as subroutines. Like most of the codes in the PDPRP
package, I have tried to document the Telcon sources internally. Here,
I present a sort-of flowchart for the program along with any hints or
tricks pertinent to each section.
The Tcl/Tk Code
- Initialize some variables, including asking the C program
what telescope it is controlling. The C program accepts the telescope as a
command line parameter. Ex., telcon 10, or telcon
26.
- Set up the GUI
- Ask HQ where the telescope is currently pointing and
adjust display accordingly.
- Start loading the most current image
- Start the Main Event Loop
- Start the Update Procedure if it's
time
- Update the GUI and Process Telcon GUI
Events
- Update the displayed time
- See if the user has moved the telescope by hand and update
accordingly - there may be something not quite right in the
way I check this, but I think things are working out anyhow. The program
prints a statement to the screen whenever it has tripped this condition.
The test will be obsolete once we (if ever) get a real signal that
tells us if the telescope is moving nor not. (I think the problem now
is that sometimes the PC Guider does not update soon enough after an
instructed move, so if I issue a move command, then ask where the
telescope is, I get a series of different answers until finally arriving
at the proper point. If this is a problem, maybe we could stick a short
sleep statement in after each move to give the PC Guider a chance to
show us the right answer.)
- See if telescope is moving or not and update self and HQ
accordingly. This routine and the move routine will to be changed if
we ever get a real signal saying the telescope is moving or not.
- See if I'm waiting for a New
Image and respond accordingly
- See if another program (the other Telcon, or Telpos) has started a
New Image load and act accordingly
- Sleep for 0.1 seconds, in an attempt to ease CPU burden
The C Code
The C code does most of the coordinate conversions and updates and talks to
the PC Guider via a serial port connection. It sets the
Tcl/Tk code up and running and defines the following new commands for it to
call:
- Ctelltel - tell the Tcl/Tk code which telescope
it is controlling - the 10" or 26"
- Cints - initialize a new position structure
- Cupdate - update a position structure
- Cupfor - change the update mode for a position structure
- Cmove - issue the appropriate move command to the PC Guider
- Cpcg - send a user-entered command to the PC Guider and
return the response
Return to Technical File Description Page
Return to PDPRP Technical
Info Page
Return toPDPRP Main Page.