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