Loading WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/OsInformation.cs +10 −2 Original line number Diff line number Diff line Loading @@ -80,6 +80,11 @@ namespace Microsoft.Tools.WindowsDevicePortal /// Windows IoT on Raspberry Pi 3 /// </summary> IoTRaspberryPi3, /// <summary> /// A virtual machine. This may or may not be an emulator. /// </summary> VirtualMachine } /// <summary> Loading Loading @@ -229,14 +234,17 @@ namespace Microsoft.Tools.WindowsDevicePortal platform = DevicePortalPlatforms.IoTRaspberryPi3; break; case "Virtual Machine": platform = DevicePortalPlatforms.VirtualMachine; break; default: platform = (DevicePortalPlatforms)Enum.Parse(typeof(DevicePortalPlatforms), this.PlatformName); break; } } catch { } { } return platform; } Loading WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs +4 −5 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ //---------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Threading.Tasks; Loading Loading @@ -37,7 +36,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<float> GetInterPupilaryDistance() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -54,7 +53,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task SetIsHttpsRequired(bool httpsRequired) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -74,7 +73,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task SetInterPupilaryDistance(float ipd) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -93,7 +92,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<bool> GetIsHttpsRequired() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicPerception.cs +64 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,10 @@ // </copyright> //---------------------------------------------------------------------------------------------- using System; using System.Runtime.Serialization; using System.Threading.Tasks; namespace Microsoft.Tools.WindowsDevicePortal { /// <content> Loading @@ -20,5 +24,65 @@ namespace Microsoft.Tools.WindowsDevicePortal /// API for controlling the Holographic Perception Simulation control stream. /// </summary> public static readonly string HolographicSimulationStreamApi = "api/holographic/simulation/control/Stream"; /// <summary> /// Gets the perception simulation control mode. /// </summary> /// <returns>The simulation control mode.</returns> /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<SimulationControlMode> GetPerceptionSimulationControlMode() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } PerceptionSimulationControlMode controlMode = await this.Get<PerceptionSimulationControlMode>(HolographicSimulationModeApi); return controlMode.Mode; } /// <summary> /// Sets the perception simulation control mode. /// </summary> /// <param name="mode">The simulation control mode.</param> /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task SetPerceptionSimulationControlMode(SimulationControlMode mode) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } string payload = string.Format( "mode={0}", (int)mode); await this.Post(HolographicSimulationModeApi, payload); } #region Data contract /// <summary> /// Enumeration defining the control modes used by the Holographic Perception Simulation. /// </summary> public enum SimulationControlMode { Default = 0, Simulation, Remote, Legacy } /// <summary> /// Object representation of Perception Simulation control mode. /// </summary> [DataContract] public class PerceptionSimulationControlMode { /// <summary> /// Gets or sets the control mode. /// </summary> [DataMember(Name = "mode")] public SimulationControlMode Mode { get; set; } } #endregion // Data contract } } WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicThermal.cs +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<ThermalStages> GetThermalStage() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/MixedRealityCapture.cs +7 −7 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>Task tracking the deletion request</returns> public async Task DeleteMrcFile(string fileName) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -99,7 +99,7 @@ namespace Microsoft.Tools.WindowsDevicePortal string fileName, bool isThumbnailRequest = false) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -125,7 +125,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>List of the capture files</returns> public async Task<MrcFileList> GetMrcFileList() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -152,7 +152,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>Status of the capture</returns> public async Task<MrcStatus> GetMrcStatus() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading Loading @@ -185,7 +185,7 @@ namespace Microsoft.Tools.WindowsDevicePortal bool includeMicrophone = true, bool includeAudio = true) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -208,7 +208,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>Task tracking the stop request</returns> public async Task StopMrcRecording() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -226,7 +226,7 @@ namespace Microsoft.Tools.WindowsDevicePortal bool includeHolograms = true, bool includeColorCamera = true) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading Loading
WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/OsInformation.cs +10 −2 Original line number Diff line number Diff line Loading @@ -80,6 +80,11 @@ namespace Microsoft.Tools.WindowsDevicePortal /// Windows IoT on Raspberry Pi 3 /// </summary> IoTRaspberryPi3, /// <summary> /// A virtual machine. This may or may not be an emulator. /// </summary> VirtualMachine } /// <summary> Loading Loading @@ -229,14 +234,17 @@ namespace Microsoft.Tools.WindowsDevicePortal platform = DevicePortalPlatforms.IoTRaspberryPi3; break; case "Virtual Machine": platform = DevicePortalPlatforms.VirtualMachine; break; default: platform = (DevicePortalPlatforms)Enum.Parse(typeof(DevicePortalPlatforms), this.PlatformName); break; } } catch { } { } return platform; } Loading
WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicOs.cs +4 −5 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ //---------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Threading.Tasks; Loading Loading @@ -37,7 +36,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<float> GetInterPupilaryDistance() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -54,7 +53,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task SetIsHttpsRequired(bool httpsRequired) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -74,7 +73,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task SetInterPupilaryDistance(float ipd) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -93,7 +92,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<bool> GetIsHttpsRequired() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading
WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicPerception.cs +64 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,10 @@ // </copyright> //---------------------------------------------------------------------------------------------- using System; using System.Runtime.Serialization; using System.Threading.Tasks; namespace Microsoft.Tools.WindowsDevicePortal { /// <content> Loading @@ -20,5 +24,65 @@ namespace Microsoft.Tools.WindowsDevicePortal /// API for controlling the Holographic Perception Simulation control stream. /// </summary> public static readonly string HolographicSimulationStreamApi = "api/holographic/simulation/control/Stream"; /// <summary> /// Gets the perception simulation control mode. /// </summary> /// <returns>The simulation control mode.</returns> /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<SimulationControlMode> GetPerceptionSimulationControlMode() { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } PerceptionSimulationControlMode controlMode = await this.Get<PerceptionSimulationControlMode>(HolographicSimulationModeApi); return controlMode.Mode; } /// <summary> /// Sets the perception simulation control mode. /// </summary> /// <param name="mode">The simulation control mode.</param> /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task SetPerceptionSimulationControlMode(SimulationControlMode mode) { if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } string payload = string.Format( "mode={0}", (int)mode); await this.Post(HolographicSimulationModeApi, payload); } #region Data contract /// <summary> /// Enumeration defining the control modes used by the Holographic Perception Simulation. /// </summary> public enum SimulationControlMode { Default = 0, Simulation, Remote, Legacy } /// <summary> /// Object representation of Perception Simulation control mode. /// </summary> [DataContract] public class PerceptionSimulationControlMode { /// <summary> /// Gets or sets the control mode. /// </summary> [DataMember(Name = "mode")] public SimulationControlMode Mode { get; set; } } #endregion // Data contract } }
WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/HolographicThermal.cs +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <remarks>This method is only supported on HoloLens devices.</remarks> public async Task<ThermalStages> GetThermalStage() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading
WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/HoloLens/MixedRealityCapture.cs +7 −7 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>Task tracking the deletion request</returns> public async Task DeleteMrcFile(string fileName) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -99,7 +99,7 @@ namespace Microsoft.Tools.WindowsDevicePortal string fileName, bool isThumbnailRequest = false) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -125,7 +125,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>List of the capture files</returns> public async Task<MrcFileList> GetMrcFileList() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -152,7 +152,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>Status of the capture</returns> public async Task<MrcStatus> GetMrcStatus() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading Loading @@ -185,7 +185,7 @@ namespace Microsoft.Tools.WindowsDevicePortal bool includeMicrophone = true, bool includeAudio = true) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -208,7 +208,7 @@ namespace Microsoft.Tools.WindowsDevicePortal /// <returns>Task tracking the stop request</returns> public async Task StopMrcRecording() { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading @@ -226,7 +226,7 @@ namespace Microsoft.Tools.WindowsDevicePortal bool includeHolograms = true, bool includeColorCamera = true) { if (this.Platform != DevicePortalPlatforms.HoloLens) if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily)) { throw new NotSupportedException("This method is only supported on HoloLens."); } Loading