public static PanTiltAlignment getInstance() { if (instance == null) { instance = new PanTiltAlignment(); } return instance; }
public static PanTiltAlignment getInstance() { if (instance == null) { instance = new PanTiltAlignment(); } return(instance); }
public static PanTiltAlignment RestoreOrDefault() { if (File.Exists(filename)) { using (TextReader reader = new StreamReader(filename)) { XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(PanTiltAlignment)); instance = (PanTiltAlignment)x.Deserialize(reader); } } else { instance = new PanTiltAlignment(); } return(instance); }
public static PanTiltAlignment RestoreOrDefault() { if (File.Exists(filename)) { using (TextReader reader = new StreamReader(filename)) { XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(PanTiltAlignment)); instance = (PanTiltAlignment)x.Deserialize(reader); } } else { instance = new PanTiltAlignment(); } return instance; }
private void Window_Loaded(object sender, EventArgs e) { _panTiltAlignment = PanTiltAlignment.RestoreOrDefault(); // panKinectTargetPosScrollBar.IsEnabled = false; SafePosture(); InitKinect(); InitPidControls(); CollectAndApplyPidControls(); dispatcherTimer.Start(); }
private void Window_Loaded(object sender, EventArgs e) { _panTiltAlignment = PanTiltAlignment.RestoreOrDefault(); bool rightGun = rightGunCheckBox.IsChecked.GetValueOrDefault(); if (rightGun) { panAlignScrollBar.Value = _panTiltAlignment.panAlignGunRight; panFactorScrollBar.Value = _panTiltAlignment.panFactorGunRight; tiltAlignScrollBar.Value = _panTiltAlignment.tiltAlignGunRight; tiltFactorScrollBar.Value = _panTiltAlignment.tiltFactorGunRight; } else { panAlignScrollBar.Value = _panTiltAlignment.panAlignGunLeft; panFactorScrollBar.Value = _panTiltAlignment.panFactorGunLeft; tiltAlignScrollBar.Value = _panTiltAlignment.tiltAlignGunLeft; tiltFactorScrollBar.Value = _panTiltAlignment.tiltFactorGunLeft; } panKinectCalibrateScrollBar.IsEnabled = false; panCalibrateScrollBar.IsEnabled = false; tiltCalibrateScrollBar.IsEnabled = false; timeGunOnMsTextBox.Text = string.Format("{0:0}", _panTiltAlignment.timeGunOnMsGunLeft); SafePosture(); InitKinect(); speak("Ready for action!"); }