public DeviceResources(IFactory factory, IDeviceHandle <IHMDDevice, IHMDInfo> handle) { if (factory == null || handle == null) { throw new ArgumentNullException(); } Info = handle.DeviceInfo; Device = handle.CreateDevice(); Sensor = Device.Sensor; Fusion = factory.CreateSensorFusion(Sensor); if (Info == null) { throw new ArgumentNullException(); } if (Device == null) { throw new ArgumentNullException(); } if (Sensor == null) { throw new ArgumentNullException(); } Key = new DeviceKey(Sensor.Info); }
public void TestSensorDevices() { // ReSharper disable PossibleMultipleEnumeration IDeviceManager mgr; using (mgr = Factory.CreateDeviceManager()) { mgr.RefCount.Should().Be(1); mgr.IsDisposed.Should().BeFalse(); var devices = mgr.SensorDevices; devices.Should().NotBeNull(); foreach (var desc in devices) { desc.DeviceType.Should().NotBe(DeviceType.None); desc.Should().NotBeNull(); desc.IsAvailable.Should().BeTrue(); desc.IsCreated.Should().BeFalse(); using (ISensorDevice sensor = desc.CreateDevice()) { sensor.Type.Should().BeSameAs(desc.DeviceType); sensor.Should().NotBeNull(); } desc.IsCreated.Should().BeTrue(); } } mgr.RefCount.Should().Be(0); mgr.IsDisposed.Should().BeTrue(); // ReSharper restore PossibleMultipleEnumeration }
public SensorFusion(ISensorDevice sensorDevice) { if (sensorDevice == null) { throw new ArgumentNullException(); } _sensorDevice = sensorDevice; }
public DeviceResources(IFactory factory, IDeviceHandle<IHMDDevice, IHMDInfo> handle) { if (factory == null || handle == null) throw new ArgumentNullException(); Info = handle.DeviceInfo; Device = handle.CreateDevice(); Sensor = Device.Sensor; Fusion = factory.CreateSensorFusion(Sensor); if (Info == null) throw new ArgumentNullException(); if (Device == null) throw new ArgumentNullException(); if (Sensor == null) throw new ArgumentNullException(); Key = new DeviceKey(Sensor.Info); }
public DeviceResources(IFactory factory, IDeviceHandle<IHMDDevice, IHMDInfo> handle) { if (factory == null || handle == null) throw new ArgumentNullException(); Info = handle.DeviceInfo; Device = handle.CreateDevice(); Sensor = Device.Sensor; Fusion = factory.CreateSensorFusion(Sensor); if (Info == null) throw new ArgumentNullException(); if (Device == null) throw new ArgumentNullException(); if (Sensor == null) System.Diagnostics.Trace.TraceWarning("Unable to create Sensor"); if (Sensor != null) Key = new DeviceKey(Sensor.Info); }
/// <summary> /// Creates a high-level object which accumulates information from the given /// sensor and exposes it through various properties, such as orientation, acceleration /// etc.. /// </summary> /// <remarks> /// The caller is responsible for disposing of the returned object. /// </remarks> /// <param name="sensorDevice">The sensor device who's input is to be processed</param> /// <returns></returns> /// <exception cref="ArgumentNullException">In case null is passed for the sensor device</exception> public static ISensorFusion CreateSensorFusion(ISensorDevice sensorDevice = null) { return(_platformFactory.CreateSensorFusion(sensorDevice)); }
public HMDDevice(IDevice parent, ISensorDevice sensor, HMDInfo info) { _sensor = sensor; _parent = parent; _info = info; }
public ISensorFusion CreateSensorFusion(ISensorDevice sensorDevice) { return(new SensorFusion(sensorDevice)); }
/// <summary> /// Creates a high-level object which accumulates information from the given /// sensor and exposes it through various properties, such as orientation, acceleration /// etc.. /// </summary> /// <remarks> /// The caller is responsible for disposing of the returned object. /// </remarks> /// <param name="sensorDevice">The sensor device who's input is to be processed</param> /// <returns></returns> /// <exception cref="ArgumentNullException">In case null is passed for the sensor device</exception> public static ISensorFusion CreateSensorFusion(ISensorDevice sensorDevice = null) { return _platformFactory.CreateSensorFusion(sensorDevice); }
public ISensorFusion CreateSensorFusion(ISensorDevice sensorDevice) { return new SensorFusion(sensorDevice); }