public void setupCamera() { if (camera.CameraReady) { button.ButtonPressed += button_ButtonPressed; invalidate = true; serverUnreacheable = false; WindowsManager.showWindowLoadingStatic(); try { streaming = true; camera.StartStreaming(); } catch (InvalidOperationException e) { Debug.Print("Already Streaming"); } /* * timer_progress = new GT.Timer(350); * timer_progress.Tick += progressIncrement; * timer_progress.Start(); */ } }
/** * This method is triggered when the button is pressed. */ private void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state) { Debug.Print("Button pressed!"); button.ButtonPressed -= button_ButtonPressed; streaming = false; camera.StopStreaming(); camera.StopStreaming(); timer_joystick.Stop(); WindowsManager.showWindowLoadingStatic(); Thread.Sleep(200); if (NetworkUp) { initServer(); } else { Debug.Print("Network_Down!!!"); WindowsManager.showWindowNetworkDown(); } }