public void Initialize( IMixedRealityDiagnosticsSystem diagnosticsSystem, bool visible, bool showCpu, bool showFps, bool showMemory) { base.BaseInitialize(diagnosticsSystem); this.Visible = visible; this.ShowCpu = showCpu; this.ShowFps = showFps; this.ShowMemory = showMemory; }
/// <summary> /// Resets all cached system references to null /// </summary> public static void ResetCacheReferences() { serviceCache.Clear(); boundarySystem = null; cameraSystem = null; diagnosticsSystem = null; focusProvider = null; inputSystem = null; raycastProvider = null; sceneSystem = null; spatialAwarenessSystem = null; teleportSystem = null; }
public IEnumerator TestToggleProfilerCommand() { // Confirm that the diagnostics system is enabled. IMixedRealityDiagnosticsSystem diagnosticsSystem = null; MixedRealityServiceRegistry.TryGetService <IMixedRealityDiagnosticsSystem>(out diagnosticsSystem); Assert.IsNotNull(diagnosticsSystem, "The diagnostics system is not enabled in the scene."); yield return(null); // This test uses the input system to simulate speech commands. IMixedRealityInputSystem inputSystem = null; MixedRealityServiceRegistry.TryGetService <IMixedRealityInputSystem>(out inputSystem); Assert.IsNotNull(inputSystem, "The input system is not enabled in the scene."); yield return(null); // Verify that the VisualProfiler is enabled. Assert.IsTrue(diagnosticsSystem.ShowProfiler, "The VisualProfiler is not active."); yield return(null); int frameDelay = 10; // Toggle the profiler visualization off. var gazeInputSource = inputSystem.DetectedInputSources.Where(x => x.SourceName.Equals("Gaze")).First(); inputSystem.RaiseSpeechCommandRecognized( gazeInputSource, RecognitionConfidenceLevel.High, new TimeSpan(), DateTime.Now, new SpeechCommands("toggle profiler", KeyCode.Alpha9, MixedRealityInputAction.None)); // It may take a few frames before the event is handled and the system responds to the state change. for (int i = 0; i < frameDelay; i++) { yield return(null); } // Verify that the VisualProfiler is disabled. Assert.IsFalse(diagnosticsSystem.ShowProfiler, "The VisualProfiler is active (should be inactive)."); yield return(null); }
private static void ResetCacheReferenceFromType(Type serviceType) { if (typeof(IMixedRealityBoundarySystem).IsAssignableFrom(serviceType)) { boundarySystem = null; } else if (typeof(IMixedRealityCameraSystem).IsAssignableFrom(serviceType)) { cameraSystem = null; } else if (typeof(IMixedRealityDiagnosticsSystem).IsAssignableFrom(serviceType)) { diagnosticsSystem = null; } else if (typeof(IMixedRealityFocusProvider).IsAssignableFrom(serviceType)) { focusProvider = null; } else if (typeof(IMixedRealityInputSystem).IsAssignableFrom(serviceType)) { inputSystem = null; } else if (typeof(IMixedRealityRaycastProvider).IsAssignableFrom(serviceType)) { raycastProvider = null; } else if (typeof(IMixedRealitySceneSystem).IsAssignableFrom(serviceType)) { sceneSystem = null; } else if (typeof(IMixedRealitySpatialAwarenessSystem).IsAssignableFrom(serviceType)) { sceneSystem = null; } else if (typeof(IMixedRealityTeleportSystem).IsAssignableFrom(serviceType)) { teleportSystem = null; } }
/// <inheritdoc /> public MixedRealityConsoleDiagnosticsDataProvider(string name, uint priority, BaseMixedRealityProfile profile, IMixedRealityDiagnosticsSystem parentService) : base(name, priority, profile, parentService) { }
/// <summary> /// Constructor /// </summary> /// <param name="diagnosticsSystem">The instance of the Diagnostic System that raised the event.</param> public void Initialize( IMixedRealityDiagnosticsSystem diagnosticsSystem) { BaseInitialize(diagnosticsSystem); }