예제 #1
0
 /// <summary>
 /// Prompt user to download the log file
 /// </summary>
 public void DownloadLog()
 {
     if (EmulationWarnings.CheckRequirement(EmulationWarnings.Requirement.VMConnected))
     {
         EmulatorManager.FetchLogFile();
     }
 }
예제 #2
0
 /// <summary>
 /// Selects robot code and starts VM.
 /// </summary>
 public void OnSelectRobotCodeButtonClicked()
 {
     if (EmulationWarnings.CheckRequirement(EmulationWarnings.Requirement.VMConnected))
     {
         AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.EmulationTab,
                                                       AnalyticsLedger.EventAction.Clicked,
                                                       "Emulation Select Code",
                                                       AnalyticsLedger.getMilliseconds().ToString());
         LoadCode();
     }
 }
예제 #3
0
        public async void RestartRobotCode()
        {
            if (EmulationWarnings.CheckRequirement(EmulationWarnings.Requirement.UserProgramPresent) && EmulationWarnings.CheckRequirement(EmulationWarnings.Requirement.UserProgramNotRestarting))
            {
                bool success = await EmulatorManager.RestartRobotCode();

                if (!success)
                {
                    UserMessageManager.Dispatch("Failed to restart user program", EmulationWarnings.WARNING_DURATION);
                }
            }
        }
예제 #4
0
 public void RobotEnabled()
 {
     if (EmulationWarnings.CheckRequirement((EmulationWarnings.Requirement.UseEmulation)) && EmulationWarnings.CheckRequirement((EmulationWarnings.Requirement.UserProgramConnected)))
     {
         if (!EmulatedRoboRIO.RobotInputs.RobotMode.Enabled && runPracticeMode)
         {
             Task.Run(RunPracticeMode);
         }
         EmulatedRoboRIO.RobotInputs.RobotMode.Enabled = true;
         enableRobotImage.sprite  = EnableColor;
         disableRobotImage.sprite = DefaultColor;
     }
 }
예제 #5
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);
            }
        }