Ejemplo n.º 1
0
 public static PanTiltAlignment getInstance()
 {
     if (instance == null)
     {
         instance = new PanTiltAlignment();
     }
     return instance;
 }
Ejemplo n.º 2
0
 public static PanTiltAlignment getInstance()
 {
     if (instance == null)
     {
         instance = new PanTiltAlignment();
     }
     return(instance);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
        private void Window_Loaded(object sender, EventArgs e)
        {
            _panTiltAlignment = PanTiltAlignment.RestoreOrDefault();

            // panKinectTargetPosScrollBar.IsEnabled = false;

            SafePosture();

            InitKinect();

            InitPidControls();

            CollectAndApplyPidControls();

            dispatcherTimer.Start();
        }
Ejemplo n.º 6
0
        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!");
        }