Control Section --------------- The Control section of Poco is responsible for making all connections to the hardware that controls the telescope. The purpose of the control section is to initialize the hardware and translate the Telescope and Interface sections' commands into a form the controller understands, while also translating the values read from hardware into a form that the software can use. This is separated so that a change in control hardware has a minimal impact on the rest of the program. The Control section is composed of the classes CControl, CGalilCard, CControlSim, and Cdda0x. CControl is a pure virtual base class. CGalilCard is derived from CControl and is used to communicate with a Galil motor control card and a digital to analog control card. CControlSim is also derived from CControl, but its purpose is to simulate hardware so that the Telescope and Interface sections can be tested without being connected to physical hardware. In the this incarnation, Control talks to a Galil 1800 motor control card and a digital IO card with digital to analog converters. Most of the code is centered around initializing the hardware and starting the appropriate threads. If the Galil control card can't be used at some point in the future, a new class can be created that is based on CControl and defines the virtual functions. This should require very few changes to the Interface and Telescope sections, but changes will need to be made to most of the configuration files. The CControl class has one other important function. It triggers the code that controls telescope movement in CTelescope by passing the most recent position information to the CTelescope object. CControl Virtual Functions -------------------------- int vInitializeAxis() - A pure virtual function used to initialize a single axis. void vStartController() - A pure virtual function used to start normal communications with the hardware after initialization is done. int vRunThreads() - A pure virtual function use to run communications threads made by Control. void vHaltThreads() - A pure virtual function used to stop threads made by Control. int vHandleMsgs(CQMsg *pmsg) - A pure virtual function used to handle CEventThread messages. void vStopMotion(char axis) - A pure virtual function used to stop motion on an axis. void vSetAccel(char axis, int accel) - A pure virtual function that sets acceleration for an axis. void vSetDecel(char axis, int decel) - A pure virtual function that sets deceleration for an axis. int vMoveAtSp() - A pure virtual function that is used get the motor on the specified axis at the specified speed. int vHardwareInterfacePaddle() - A pure virtual function used to monitor the status of a hardware paddle connected to Poco. int vHardwareInterfaceJoy() - A pure virtual function used to monitor the status of a hardware joystick connected to Poco. int vGetPos() - A pure virtual function used to get the most recent position reading from the controller. double vGetSp() - A pure virtual function that gets the most recent speed from the controller. double vGetAcc() - A pure virtual function that gets the most recent acceleration from the controller. void vPrintQueues() - A pure virtual function for printing the last several commands sent to the hardware, and the basic hardware response to each. int vSlewMotorMove() - A pure virtual function that starts, stops, or changes the power setting of the slew motor for the specified axis. int vSlewMotorState() - A pure virtual function that returns whether the slew motor for the given axis is on or off. int vGetActiveMotorSystem() - A pure virtual function that returns which motor system (slew or guide) is being used on the given axis. void vGetRoughPos() - A pure virtual function that returns the last position of the axis from the rough position pots, or some other backup position device. void vGetLimits() - A pure virtual function that is used to find out if any of the limit switches have been tripped. double vGetSecsBetweenUpdates() - A pure virtual function that returns the number of seconds that passed between the last position read and the current position read. double vGetSecsBetweenPIDUpdates() - A pure virtual function that returns the minimum amount of time between information updates to the Telescope and Interface sections.