void GoToPhase(CalibrationPhase newPhase)
        {
            Phase = newPhase;

            var txt = "";

            switch(Phase) {
                case CalibrationPhase.Point1Model :
                    if (Scanned != null) Scanned.SetActive(false);
                    Model.SetActive(true);
                    txt = "Aim and press select to locate position 1 in model";
                    break;
                case CalibrationPhase.Point1Scan :
                    if (Scanned!=null) Scanned.SetActive(true);
                    Model.SetActive(false);
                    txt = "Then locate position 1 in real world";
                    break;
                case CalibrationPhase.Point2Model :
                    if (Scanned != null) Scanned.SetActive(false);
                    Model.SetActive(true);
                    txt = "Locate position 2 in model";
                    break;
                case CalibrationPhase.Point2Scan :
                    if (Scanned != null) Scanned.SetActive(true);
                    Model.SetActive(false);
                    txt = "And finally position 2 in real world";
                    break;
                case CalibrationPhase.Completed :
                    AlignModelToScan();
                    if (Scanned != null) Scanned.SetActive(true);
                    Model.SetActive(true);
                    GameObject.Find("HitSphere").SetActive(false);
                    break;
            }

            var c = Phase == CalibrationPhase.Completed;
            InfoText.GetComponent<Text>().text = txt;

            foreach(var s in "Pin,Mode,Configuration".Split(',')) GameObject.Find("Button" + s).GetComponent<Image>().enabled = c;
            foreach(var s in "Mode,Configuration".Split(',')) GameObject.Find("Text" + s).GetComponent<Text>().enabled = c;
        }
        void GoToPhase(CalibrationPhase newPhase)
        {
            Phase = newPhase;

            var txt = "";

            switch (Phase)
            {
            case CalibrationPhase.Point1Model:
                if (Scanned != null)
                {
                    Scanned.SetActive(false);
                }
                Model.SetActive(true);
                txt = "Aim and press select to locate position 1 in model";
                break;

            case CalibrationPhase.Point1Scan:
                if (Scanned != null)
                {
                    Scanned.SetActive(true);
                }
                Model.SetActive(false);
                txt = "Then locate position 1 in real world";
                break;

            case CalibrationPhase.Point2Model:
                if (Scanned != null)
                {
                    Scanned.SetActive(false);
                }
                Model.SetActive(true);
                txt = "Locate position 2 in model";
                break;

            case CalibrationPhase.Point2Scan:
                if (Scanned != null)
                {
                    Scanned.SetActive(true);
                }
                Model.SetActive(false);
                txt = "And finally position 2 in real world";
                break;

            case CalibrationPhase.Completed:
                AlignModelToScan();
                if (Scanned != null)
                {
                    Scanned.SetActive(true);
                }
                Model.SetActive(true);
                GameObject.Find("HitSphere").SetActive(false);
                break;
            }

            var c = Phase == CalibrationPhase.Completed;

            InfoText.GetComponent <Text>().text = txt;

            foreach (var s in "Pin,Mode,Configuration".Split(','))
            {
                GameObject.Find("Button" + s).GetComponent <Image>().enabled = c;
            }
            foreach (var s in "Mode,Configuration".Split(','))
            {
                GameObject.Find("Text" + s).GetComponent <Text>().enabled = c;
            }
        }
 public CalibrationEventArgs(CalibrationPhase data, bool isFirst)
 {
     Data = data;
     IsFirst = isFirst;
 }
 private void UpdateCalibrationText(CalibrationPhase data, bool isFirst)
 {
     switch (data)
     {
         case CalibrationPhase.Rotate:
             TheCalibration.Text = isFirst ? "Place horizontally" : "Rotate 90° and wait";
             break;
         case CalibrationPhase.Hold:
             TheCalibration.Text = "Hold still!";
             break;
         case CalibrationPhase.Calibrated:
             Settings.Default.CalibrationOffset = _compassWorker.CalibrationOffset;
             Settings.Default.IsCalibrated = true;
             Settings.Default.Save();
             UpdateCalibrationOffsetText();
             TheCalibration.Text = "";
             TheCalibrateButton.IsEnabled = true;
             break;
     }
 }