} //End of method Start_graphic_clock(double refreshrate) protected void Manage_spiral_clock(Object sender, EventArgs events) { switch (spiral_state) { case Spiral_clock_state_type.Begin: /////double elapsed_time_between_updates_of_spiral_coordinates; double local_spiral_update_rate = spiral_rate; //In the next statement don't allow the spiral to update at a rate slower than 1.0 Hz if (local_spiral_update_rate < 1.0) { local_spiral_update_rate = 1.0; } elapsed_time_between_updates_of_spiral_coordinates = 1000.0 / local_spiral_update_rate; //Units are milliseconds elapsed_time_between_updates_of_spiral_coordinates_rounded = System.Math.Round(elapsed_time_between_updates_of_spiral_coordinates); spiral_clock.Interval = (int)elapsed_time_between_updates_of_spiral_coordinates_rounded; elapsed_time_between_updates_of_spiral_coordinates_rounded_seconds = elapsed_time_between_updates_of_spiral_coordinates_rounded / 1000.0; spiral_clock.Enabled = true; start_button.Text = "Pause"; spiral_state = Spiral_clock_state_type.Ticking; graphic_area_refresh_clock.Enabled = true; System.Console.WriteLine("Begin case finished executing"); break; case Spiral_clock_state_type.Ticking: spiral_clock.Enabled = false; spiral_state = Spiral_clock_state_type.Paused; start_button.Text = "Go"; graphic_area_refresh_clock.Enabled = false; System.Console.WriteLine("Ticking case finished executing"); break; case Spiral_clock_state_type.Paused: spiral_clock.Enabled = true; spiral_state = Spiral_clock_state_type.Ticking; start_button.Text = "Pause"; graphic_area_refresh_clock.Enabled = true; System.Console.WriteLine("Paused case finished executing"); break; default: System.Console.WriteLine("A serious error occurred in the switch statement."); break; } //End of switch } //End of Manage_spiral_clock
protected void Manage_spiral_clock(Object sender, EventArgs events) { switch (spiral_state) { case Spiral_clock_state_type.Begin: double elapsed_time_between_updates_of_spiral_coordinates; double local_spiral_update_rate = spiral_rate; if (local_spiral_update_rate < 1.0) { local_spiral_update_rate = 1.0; } elapsed_time_between_updates_of_spiral_coordinates = 1000.0 / local_spiral_update_rate; spiral_clock.Interval = (int)System.Math.Round(elapsed_time_between_updates_of_spiral_coordinates); spiral_clock.Enabled = true; start_button.Text = "Pause"; spiral_state = Spiral_clock_state_type.Ticking; graphic_area_refresh_clock.Enabled = true; System.Console.WriteLine("Begin case finished executing"); break; case Spiral_clock_state_type.Ticking: spiral_clock.Enabled = false; spiral_state = Spiral_clock_state_type.Paused; start_button.Text = "Go"; graphic_area_refresh_clock.Enabled = false; System.Console.WriteLine("Ticking case finished executing"); break; case Spiral_clock_state_type.Paused: spiral_clock.Enabled = true; spiral_state = Spiral_clock_state_type.Ticking; start_button.Text = "Pause"; graphic_area_refresh_clock.Enabled = true; System.Console.WriteLine("Paused case finished executing"); break; default: System.Console.WriteLine("A serious error occurred in the switch statement."); break; } }