From f84cf70bad3833d6860228a080673cfa24aa59d7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 3 Apr 2017 19:49:41 +0200 Subject: tracker/steamvr: show device type before serial --- tracker-steamvr/steamvr.cpp | 13 ++++++++++++- tracker-steamvr/steamvr.hpp | 3 +-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index ecc738a0..7b75952e 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -85,6 +85,16 @@ void device_list::fill_device_specs(QList& list) continue; } + switch (v->GetTrackedDeviceClass(k)) + { + case vr::ETrackedDeviceClass::TrackedDeviceClass_HMD: + dev.type = "HMD"; break; + case vr::ETrackedDeviceClass::TrackedDeviceClass_Controller: + dev.type = "Controller"; break; + default: + dev.type = "Unknown"; break; + } + dev.model = str; dev.pose = device_states[k]; dev.k = k; @@ -254,7 +264,8 @@ steamvr_dialog::steamvr_dialog() device_list list; for (const device_spec& spec : list.devices()) - ui.device->addItem(QStringLiteral("%1 [%2]").arg(spec.model).arg(spec.serial), QVariant(spec.serial)); + ui.device->addItem(QStringLiteral("<%3> %1 [%2]").arg(spec.model).arg(spec.serial).arg(spec.type), + QVariant(spec.serial)); tie_setting(s.device_serial, ui.device); } diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp index 62815a58..a8903959 100644 --- a/tracker-steamvr/steamvr.hpp +++ b/tracker-steamvr/steamvr.hpp @@ -37,7 +37,7 @@ struct settings : opts struct device_spec { vr::TrackedDevicePose_t pose; - QString model, serial; + QString model, serial, type; unsigned k; }; @@ -98,7 +98,6 @@ public: private: Ui::dialog ui; settings s; - device_list devices; private slots: void doOK(); -- cgit v1.2.3