public override bool OnStart() { DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration(); config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); config.DiagnosticInfrastructureLogs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); config.DiagnosticInfrastructureLogs.ScheduledTransferLogLevelFilter = LogLevel.Error; DiagnosticMonitor.Start("DiagnosticsConnectionString", config); RoleEnvironment.Changing += RoleEnvironmentChanging; CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) => { configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)); RoleEnvironment.Changed += (anotherSender, arg) => { if (arg.Changes.OfType <RoleEnvironmentConfigurationSettingChange>() .Any((change) => (change.ConfigurationSettingName == configName))) { if (!configSetter(RoleEnvironment.GetConfigurationSettingValue(configName))) { RoleEnvironment.RequestRecycle(); } } }; }); ChirpManager.Initialize(); AvatarManager.Initialize(); ResizeRequestManager.Initialize(); return(base.OnStart()); }
/// <summary> /// Sends the specified motor speed values as Chirp audio /// </summary> public void SendMotorSpeed(sbyte speedLeft, sbyte speedRight) { // If power is zero, send motor stop instead if (speedLeft == 0 && speedRight == 0) { SendMotorStop(); return; } Debug.Log($"Sending MotorSpeed({ speedLeft }, { speedRight })"); ChirpManager.SendData(new byte[] { (byte)CommandID.MotorSpeed, (byte)speedLeft, (byte)speedRight }); // Make a byte array with type and the motor speeds, then send it as Chirp audio }
public ActionResult Create(ChirpModel cm) { try { ChirpManager.Add(User.Identity.Name, cm.Chirp); return(RedirectToAction("Index", "Home")); } catch { return(View()); } }
/// <summary> /// Called by Unity (only once) when this script is instantiated (but after Awake) only if/when script is enabled /// Initializes Chirp SDK and UI components /// </summary> private void Start() { ChirpManager.InitSDK(); ChirpManager.StartSDK(); ChirpManager.OnStateChangedEvent = ChirpStateChanged; m_CancelButton.onClick.AddListener(() => TouchFieldActive = false); m_StopButton.onClick.AddListener(SendMotorStop); m_TouchFieldTopCenterPosition = new Vector2(m_TouchField.transform.position.x, m_TouchField.transform.position.y + m_TouchField.GetComponent <RectTransform>().rect.height) - (Vector2)m_TouchField.transform.position; TouchFieldActive = false; // Also (re)sets touch field alpha to initial value (just in case) }
/// <summary> /// Called by Unity when this script is about to be destroyed /// Cleanup, stops Chirp SDK /// </summary> private void OnDestroy() { ChirpManager.ClearCallbacks(); // Clear Chirp callbacks ChirpManager.StopSDK(); }
/// <summary> /// Sends motor stop as Chirp audio /// </summary> public void SendMotorStop() { Debug.Log("Sending MotorStop"); m_SpeedRightText.text = m_SpeedLeftText.text = "0"; // Set UI texts to display '0' ChirpManager.SendData(new byte[] { (byte)CommandID.MotorStop }); // Make a byte array with motor stop type, then send it as Chirp audio }
public ActionResult ListMine() { TempData["Chirps"] = ChirpManager.FindMine(User.Identity.Name); return(RedirectToAction("Index", "Home")); }
public ActionResult ListAll() { TempData["Chirps"] = ChirpManager.FindAll(); return(RedirectToAction("Index", "Home")); }
public ActionResult List() { ViewData["Chirps"] = TempData["Chirps"] ?? ChirpManager.FindAll(); return(PartialView("ChirpList")); }