Callbacks





Global Variables
speed The speed of the robot as set by the user
orientation The orientation of the robot
xsize The horizontal size of the robot area
currentlocx The current x coordinate of the robot
currentlocy The current y coordinate of the robot
oldx The old x coordinate of the robot used to see if the robot has moved
oldy The old y coordinate of the robot. Also used to check for movement

draw_blackbox
 
static GdkGC *blackbox_gc The graphics content used when while copying the pixmap
static GdkPixmap *blackbox The drawable that is being copied to
GdkColor black defines the name of the color being used
Functions Called Summary
gdk_draw_pixmap function used to draw the pixmap, in this case a black box in the robot simulation area

draw_robot
Local Variable Summary
static GdkGC *blackbox_gc The graphics content used when while copying the pixmap
static GdkPixmap *blackbox The drawable that is being copied to
GdkColor color defines the name color. Used when the color yellow is created.
GdkColor black defines the name of the color black
double xend = 25*cos(radians). Used to calculate the x position of the robot figure
double yend = 25*sin(radians). Used to calculate the y position of the robot figure 
double radians Value of the orientation in radians instead of degrees. Calculated using the formula Radians=degrees*3.13159*2/360
double degrees =orientation mod 360. To convert all angles to be between 0 and 360.
double newx x location of the robot before being converted to a standard scale
double newy y location of the robot before being converted to a standard scale
double time Constant 0.5. Used for formula s=so + vot to calculate the current location
double ysize Vertical size of the robot display area. Calculates by xsize*(480.0/300.0)
Functions Called Summary
gdk_draw_pixmap function used to draw the pixmap, in this case a black box in the robot simulation area

on_exitbutton_clicked
Variable Summary
GtkButton *button  the button that is being clicked 
gpointer user_data
Functions Called Summary
gtk_clist_clear clears the location and speed list that is displayed on the GUI. Since the list is a separate widget, this will not effect any other part of the GUI.
gtk_exit() exits the program

on_window1_configure_event
Attribute Summary
GtkWidget *widget Defining which widget that is being acted upon when the event occurs
GdkEventConfigure *event Defines what the event is 
gpointer user_data
Functions Called Summary
draw_blackbox This will draw a blackbox in the robot display area so the area is black and the robot, which is yellow, will be seen easier
pthread_create Creates a new thread for the draw_robot function. This allows for the clear list button and the exit button to both work

pass_values
Attribute Summary
GtkWidget *widget 1 This is set to the address of the robot display area so that it can be used to draw the robot
GtkWidget *widget 1 This is set to the address of the location and speed list. It is needed to display the location and speed at the top of the list.

robot_delay
Attribute Summary
float seconds The seconds that you want to for your delay. Gettimeofday is used in this function to get the current seconds and microseconds.

on_window1_expose_event
Functions Called Summary
draw_blackbox Draws a blackbox inside the robot display area

control_robot
Functions Called Summary
Test.Runme Establishes a connection with the robot controller
draw_robot infinite loop that calls draw_robot so it is updated in the display area at all times.
robot_delay creates a .5 second delay between when the draw_robot is called