private void PopulateProfiles(RS.DeviceInfo dinfo) { RS.SenseManager pp = RS.SenseManager.CreateInstance(); RS.Device device = pp.CaptureManager.Device; if (device == null) { pp.Dispose(); } RS.StreamProfileSet profile = new RS.StreamProfileSet(); for (int s = 0; s < RS.Capture.STREAM_LIMIT; s++) { RS.StreamType st = RS.Capture.StreamTypeFromIndex(s); if (((int)dinfo.streams & (int)st) != 0) { int num = device.QueryStreamProfileSetNum(st); for (int p = 0; p < num; p++) { if (device.QueryStreamProfileSet(st, p, out profile) < RS.Status.STATUS_NO_ERROR) { break; } RS.StreamProfile sprofile = profile[st]; string profNime = ProfileToString(sprofile); profiles[profile] = sprofile; cb_Profile.Items.Add(profNime); } } else if (((int)dinfo.streams & (int)st) == 0) { } } }
// Gets the maximum specified Range of the Device in mm public float GetDeviceRange() { RS.Device device = SenseManager.CaptureManager.Device; if (device != null) { return(device.DepthSensorRange.max); } else { return(-1); } }
public override List <KinectInterop.SensorDeviceInfo> GetAvailableSensors() { List <KinectInterop.SensorDeviceInfo> alSensorInfo = new List <KinectInterop.SensorDeviceInfo>(); using (var ctx = new Context()) { DeviceList devices = ctx.QueryDevices(); for (int i = 0; i < devices.Count; i++) { using (Intel.RealSense.Device device = devices[i]) { KinectInterop.SensorDeviceInfo sensorInfo = new KinectInterop.SensorDeviceInfo(); sensorInfo.sensorId = device.Info[CameraInfo.SerialNumber]; sensorInfo.sensorName = device.Info[CameraInfo.Name]; if (sensorInfo.sensorName.StartsWith("Intel RealSense D")) { sensorInfo.sensorCaps = KinectInterop.FrameSource.TypeColor | KinectInterop.FrameSource.TypeDepth | KinectInterop.FrameSource.TypeInfrared; } else if (sensorInfo.sensorName.StartsWith("Intel RealSense T")) { sensorInfo.sensorCaps = KinectInterop.FrameSource.TypePose; } else { sensorInfo.sensorCaps = KinectInterop.FrameSource.TypeNone; } if (consoleLogMessages) { Debug.Log(string.Format(" D{0}: {1}, id: {2}", i, sensorInfo.sensorName, sensorInfo.sensorId)); } alSensorInfo.Add(sensorInfo); } } } //if (alSensorInfo.Count == 0) //{ // Debug.Log(" No sensor devices found."); //} return(alSensorInfo); }
// Get entries for color Streams private void PopulateColorDepthMenus(ToolStripMenuItem device_item) { RS.ImplDesc desc = new RS.ImplDesc(); desc.group = RS.ImplGroup.IMPL_GROUP_SENSOR; desc.subgroup = RS.ImplSubgroup.IMPL_SUBGROUP_VIDEO_CAPTURE; desc.iuid = devices_iuid[device_item]; current_device_iuid = desc.iuid; desc.cuids[0] = RS.Capture.CUID; profiles.Clear(); foreach (ToolStripMenuItem menu in streamMenue) { if (menu != null) { menu.DropDownItems.Clear(); } } RS.Capture capture; RS.DeviceInfo dinfo2 = GetCheckedDevice(); if (manager.Session.CreateImpl <RS.Capture>(desc, out capture) >= RS.Status.STATUS_NO_ERROR) { RS.Device device = capture.CreateDevice(dinfo2.didx); if (device != null) { RS.StreamProfileSet streamProfileSet = new RS.StreamProfileSet(); for (int s = 0; s < RS.Capture.STREAM_LIMIT; s++) { RS.StreamType streamType = RS.Capture.StreamTypeFromIndex(s); if (((int)dinfo2.streams & (int)streamType) != 0 && streamMenue[s] != null) { streamMenue[s].Visible = true; streamButtons[s].Visible = true; int num = device.QueryStreamProfileSetNum(streamType); for (int p = 0; p < num; p++) { if (device.QueryStreamProfileSet(streamType, p, out streamProfileSet) < RS.Status.STATUS_NO_ERROR) { break; } RS.StreamProfile streamProfile = streamProfileSet[streamType]; ToolStripMenuItem sm1 = new ToolStripMenuItem(ProfileToString(streamProfile), null, new EventHandler(Stream_Item_Click)); profiles[sm1] = streamProfile; streamMenue[s].DropDownItems.Add(sm1); } } else if (((int)dinfo2.streams & (int)streamType) == 0 && streamMenue[s] != null) { streamMenue[s].Visible = false; streamButtons[s].Visible = false; } } device.Dispose(); } capture.Dispose(); } for (int i = 0; i < RS.Capture.STREAM_LIMIT; i++) { ToolStripMenuItem menu = streamMenue[i]; if (menu != null) { streamString[i] = new ToolStripMenuItem("None", null, new EventHandler(Stream_Item_Click)); profiles[streamString[i]] = new RS.StreamProfile(); menu.DropDownItems.Add(streamString[i]); if (menu == colorMenu) { (menu.DropDownItems[0] as ToolStripMenuItem).Checked = true; } else { streamString[i].Checked = true; } } } CheckSelection(); }