Exemplo n.º 1
0
 /// <summary>
 /// Prompt user to download the log file
 /// </summary>
 public void DownloadLog()
 {
     if (EmulationWarnings.CheckRequirement(EmulationWarnings.Requirement.VMConnected))
     {
         EmulatorManager.FetchLogFile();
     }
 }
Exemplo n.º 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();
     }
 }
Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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);
            }
        }