Пример #1
0
 public override void Update()
 {
     if (loadingPanel.activeSelf)
     {
         Text t = loadingPanel.transform.Find("Text").GetComponent <Text>();
         if (!EmulatorManager.IsVMConnected())
         {
             uploadFinished = true;
             uploadSuccess  = false;
         }
         if (uploadFinished)
         {
             if (!uploadSuccess)
             {
                 UserMessageManager.Dispatch("Failed to upload new user program", EmulationWarnings.WARNING_DURATION);
             }
             t.text = "Loading...";
             loadingPanel.SetActive(false);
             uploadFinished = false;
         }
         else
         {
             if (Time.unscaledTime >= lastAdditionalDot + 0.75)
             {
                 dotCount = (dotCount + 1) % 4;
                 t.text   = "Loading";
                 for (int i = 0; i < dotCount; i++)
                 {
                     t.text += ".";
                 }
                 lastAdditionalDot = Time.unscaledTime;
             }
         }
     }
 }
Пример #2
0
 public void Update()
 {
     if (lastGameSpecificMessageFocused != gameSpecificMessage.isFocused)
     {
         InputControl.freeze            = gameSpecificMessage.isFocused;
         lastGameSpecificMessageFocused = gameSpecificMessage.isFocused;
     }
     VMConnectionImage.sprite       = EmulatorManager.IsVMConnected() ? StatusGood : StatusBad;
     robotCodeUploadedImage.sprite  = EmulatorManager.IsFRCUserProgramPresent() ? StatusGood : StatusBad;
     robotCodeRunningImage.sprite   = EmulatorManager.IsRunningRobotCode() ? StatusGood : StatusBad;
     robotCodeConnectedImage.sprite = EmulatorNetworkConnection.Instance.IsConnected() ? StatusGood : StatusBad;
 }
Пример #3
0
 /// <summary>
 /// Indicator for VM connection status
 /// </summary>
 private System.Collections.IEnumerator UpdateVMConnectionStatus() // TODO move to emulation toolbar
 {
     while (true)
     {
         if (EmulatorManager.IsVMConnected())
         {
             VMConnectionStatusImage.sprite = EmulatorConnection;
             if (EmulatorNetworkConnection.Instance.IsConnected())
             {
                 VMConnectionStatusMessage.text = "Connected";
             }
             else
             {
                 VMConnectionStatusMessage.text = "Ready";
                 RobotDisabled();
             }
             if (!EmulatorManager.IsRunningRobotCodeRunner() && !EmulatorManager.IsTryingToRunRobotCode() && !EmulatorManager.IsRobotCodeRestarting())
             {
                 EmulatorManager.RestartRobotCode();
             }
         }
         else
         {
             if (!EmulatorManager.IsVMInstalled())
             {
                 VMConnectionStatusImage.sprite = EmulatorNotInstalled;
                 VMConnectionStatusMessage.text = "Not Installed";
             }
             else if (!EmulatorManager.IsVMRunning())
             {
                 VMConnectionStatusImage.sprite = StartEmulator;
                 VMConnectionStatusMessage.text = "Start Emulator";
             }
             else
             {
                 VMConnectionStatusImage.sprite = EmulatorConnection;
                 VMConnectionStatusMessage.text = "Starting";
             }
             RobotDisabled();
         }
         yield return(new WaitForSeconds(1.0f)); // s
     }
 }
Пример #4
0
        public void OnVMConnectionStatusClicked()
        {
            if (EmulationWarnings.CheckRequirement((EmulationWarnings.Requirement.VMInstalled)) && !EmulatorManager.IsVMRunning() && !EmulatorManager.IsVMConnected())
            {
                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.EmulationTab,
                                                              AnalyticsLedger.EventAction.Clicked,
                                                              "Emulation Start",
                                                              AnalyticsLedger.getMilliseconds().ToString());

                if (EmulatorManager.StartEmulator()) // If successful
                {
                    EmulationDriverStation.Instance.SetActive(true);
                }
                else
                {
                    UserMessageManager.Dispatch("Emulator failed to start.", EmulationWarnings.WARNING_DURATION);
                }
            }
            else if (EmulatorManager.IsVMRunning())
            {
                EmulationDriverStation.Instance.SetKillEmulatorDialogActive(true);
            }
        }