summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii
diff options
context:
space:
mode:
authormrsanchos <orokhovatskiy@gmail.com>2018-02-16 21:05:36 +0300
committermrsanchos <orokhovatskiy@gmail.com>2018-02-16 21:05:36 +0300
commitb52fd95f1cc86e86ecb696eab07c8d6b6a2e9f5d (patch)
treea8d5a8c98d8ca3b60b0805504049275a3311f59b /tracker-wii
parent82c43da829fdac974b3d6adb8742715382ddd051 (diff)
parent7a973ae2ad396c8413405e40bcb2eaab67c95d15 (diff)
Merge branch 'unstable' of https://github.com/opentrack/opentrack into unstable
Diffstat (limited to 'tracker-wii')
-rw-r--r--tracker-wii/lang/zh_CN.ts291
-rw-r--r--tracker-wii/wii_camera.cpp11
-rw-r--r--tracker-wii/wii_camera.h6
-rw-r--r--tracker-wii/wiiyourself/wiimote.cpp4
-rw-r--r--tracker-wii/wiiyourself/wiimote.h15
5 files changed, 17 insertions, 310 deletions
diff --git a/tracker-wii/lang/zh_CN.ts b/tracker-wii/lang/zh_CN.ts
index 3f3131d8..6401616d 100644
--- a/tracker-wii/lang/zh_CN.ts
+++ b/tracker-wii/lang/zh_CN.ts
@@ -1,293 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="zh_CN">
-<context>
- <name>PT_metadata</name>
- <message>
- <location filename="../../tracker-pt/ftnoir_tracker_pt.h" line="+95"/>
- <source>PointTracker 1.1</source>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
- <name>UICPTClientControls</name>
- <message>
- <location filename="../../tracker-pt/FTNoIR_PT_Controls.ui" line="+23"/>
- <source>PointTracker Settings</source>
- <translation>PointTracker设置</translation>
- </message>
- <message>
- <location line="+38"/>
- <source>Camera</source>
- <translation>摄像头</translation>
- </message>
- <message>
- <location line="+6"/>
- <source>Camera settings</source>
- <translation>摄像头设置</translation>
- </message>
- <message>
- <location line="+19"/>
- <source>°</source>
- <translation>度</translation>
- </message>
- <message>
- <location line="+22"/>
- <source>Diagonal field of view</source>
- <translation>对角线</translation>
- </message>
- <message>
- <location line="+13"/>
- <source>Width</source>
- <translation></translation>
- </message>
- <message>
- <location line="+13"/>
- <source>FPS</source>
- <translation>帧数</translation>
- </message>
- <message>
- <location line="+16"/>
- <source>Desired capture height</source>
- <translation>期望高度</translation>
- </message>
- <message>
- <location line="+3"/>
- <location line="+55"/>
- <location line="+175"/>
- <location line="+16"/>
- <source> px</source>
- <translation> 像素点</translation>
- </message>
- <message>
- <location line="-233"/>
- <source>Dynamic pose timeout</source>
- <translation>动态姿态超时时间</translation>
- </message>
- <message>
- <location line="+13"/>
- <source>Desired capture framerate</source>
- <translation>期望帧数</translation>
- </message>
- <message>
- <location line="+3"/>
- <source> Hz</source>
- <translation> 赫兹</translation>
- </message>
- <message>
- <location line="+23"/>
- <source>Desired capture width</source>
- <translation>期望宽度</translation>
- </message>
- <message>
- <location line="+22"/>
- <source>Height</source>
- <translation>高度</translation>
- </message>
- <message>
- <location line="+7"/>
- <source> ms</source>
- <translation> 毫秒</translation>
- </message>
- <message>
- <location line="+19"/>
- <source>Dynamic pose resolution</source>
- <translation>动态姿态分辨率</translation>
- </message>
- <message>
- <location line="+13"/>
- <source>Device</source>
- <translation>设备名称</translation>
- </message>
- <message>
- <location line="+16"/>
- <source>Open</source>
- <translation>打开</translation>
- </message>
- <message>
- <location line="+7"/>
- <source>Camera settings (when available)</source>
- <translation>摄像头设置 (连接时)</translation>
- </message>
- <message>
- <location line="+10"/>
- <source>Point extraction</source>
- <translation>跟踪点解析</translation>
- </message>
- <message>
- <location line="+6"/>
- <source>Max size</source>
- <translation>最大</translation>
- </message>
- <message>
- <location line="+10"/>
- <source>Threshold</source>
- <translation>大小门限值</translation>
- </message>
- <message>
- <location line="+10"/>
- <source>Min size</source>
- <translation>最小</translation>
- </message>
- <message>
- <location line="+16"/>
- <source>Intensity threshold for point extraction</source>
- <translation>点密度</translation>
- </message>
- <message>
- <location line="+25"/>
- <source>Automatic threshold</source>
- <translation>自动门限值</translation>
- </message>
- <message>
- <location line="+7"/>
- <source>Enable, slider sets point size</source>
- <translation>激活,滑动,设置跟踪点大小</translation>
- </message>
- <message>
- <location line="+7"/>
- <source>Maximum point diameter</source>
- <translation>最大点直径</translation>
- </message>
- <message>
- <location line="+16"/>
- <source>Minimum point diameter</source>
- <translation>最小点直径</translation>
- </message>
- <message>
- <location line="+20"/>
- <source>Model</source>
- <translation>点模式</translation>
- </message>
- <message>
- <location line="+28"/>
- <source>Clip</source>
- <translation>夹子式</translation>
- </message>
- <message>
- <location line="+18"/>
- <location line="+154"/>
- <location line="+129"/>
- <source>Model Dimensions</source>
- <translation>尺寸</translation>
- </message>
- <message>
- <location line="-271"/>
- <location line="+19"/>
- <location line="+48"/>
- <location line="+19"/>
- <location line="+97"/>
- <location line="+35"/>
- <location line="+32"/>
- <location line="+40"/>
- <location line="+26"/>
- <location line="+13"/>
- <location line="+13"/>
- <location line="+13"/>
- <location line="+26"/>
- <location line="+132"/>
- <location line="+26"/>
- <location line="+26"/>
- <source> mm</source>
- <translation> 毫米</translation>
- </message>
- <message>
- <location line="-511"/>
- <location line="+116"/>
- <source>Side</source>
- <translation>侧面</translation>
- </message>
- <message>
- <location line="-65"/>
- <location line="+132"/>
- <source>Front</source>
- <translation>正面</translation>
- </message>
- <message>
- <location line="-107"/>
- <source>Cap</source>
- <translation>帽子式</translation>
- </message>
- <message>
- <location line="+135"/>
- <source>Custom</source>
- <translation>自定义模式</translation>
- </message>
- <message>
- <location line="+18"/>
- <location line="+169"/>
- <location line="+106"/>
- <source>z:</source>
- <translation>Z:</translation>
- </message>
- <message>
- <location line="-249"/>
- <location line="+104"/>
- <location line="+93"/>
- <source>x:</source>
- <translation>X:</translation>
- </message>
- <message>
- <location line="-132"/>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Location of the two remaining model points&lt;br/&gt;with respect to the reference point in default pose&lt;/p&gt;&lt;p&gt;Use any units you want, not necessarily centimeters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;三点中的两点位置是相对第一个点的&lt;/p&gt;&lt;p&gt;单位不一定要用厘米&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <location line="+26"/>
- <location line="+65"/>
- <location line="+67"/>
- <source>y:</source>
- <translation>Y:</translation>
- </message>
- <message>
- <location line="-106"/>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:16pt;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot; font-size:16pt; vertical-align:sub;&quot;&gt;3&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:16pt;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot; font-size:16pt; vertical-align:sub;&quot;&gt;3&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <location line="+13"/>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:16pt;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot; font-size:16pt; vertical-align:sub;&quot;&gt;2&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:16pt;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot; font-size:16pt; vertical-align:sub;&quot;&gt;2&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <location line="+46"/>
- <source>Model position</source>
- <translation>姿态空间位置</translation>
- </message>
- <message>
- <location line="+105"/>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/opentrack/opentrack/wiki/model-calibration-for-PT-and-Aruco-trackers&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Instructions on the opentrack wiki&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/opentrack/opentrack/wiki/model-calibration-for-PT-and-Aruco-trackers&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;参考opentrack维基&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <location line="+13"/>
- <source>Start calibration</source>
- <translation>开始校准</translation>
- </message>
- <message>
- <location line="+17"/>
- <source>About</source>
- <translation>关于</translation>
- </message>
- <message>
- <location line="+6"/>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;FTNoIR PointTracker Plugin&lt;br/&gt;Version 1.1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;by Patrick Ruoff&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://ftnoirpt.sourceforge.net/&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline; color:#0000ff;&quot;&gt;Manual (external)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;FTNoIR PointTracker Plugin&lt;br/&gt;Version 1.1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Patrick Ruoff&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://ftnoirpt.sourceforge.net/&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline; color:#0000ff;&quot;&gt;参考手册 (外部链接)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
- </message>
- <message>
- <location line="+36"/>
- <source>Status</source>
- <translation>状态</translation>
- </message>
- <message>
- <location line="+6"/>
- <source>Extracted Points:</source>
- <translation>解析出的点:</translation>
- </message>
- <message>
- <location line="+7"/>
- <source>Camera Info:</source>
- <translation>设备信息:</translation>
- </message>
-</context>
+<TS version="2.1">
</TS>
diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp
index 251ab33a..2af3eca3 100644
--- a/tracker-wii/wii_camera.cpp
+++ b/tracker-wii/wii_camera.cpp
@@ -33,7 +33,12 @@ WIICamera::WIICamera(const QString& module_name) : s { module_name }
cam_info.res_x = 1024;
cam_info.res_y = 768;
cam_info.fov = 42.0f;
- cam_info.idx = 0;
+ cam_info.idx = 0;
+}
+
+WIICamera::~WIICamera()
+{
+ stop();
}
QString WIICamera::get_desired_name() const
@@ -81,14 +86,14 @@ WIICamera::result WIICamera::get_frame(pt_frame& frame_)
return result(true, cam_info);
}
-pt_camera_open_status WIICamera::start(int idx, int fps, int res_x, int res_y)
+bool WIICamera::start(int idx, int fps, int res_x, int res_y)
{
m_pDev = std::make_unique<wiimote>();
m_pDev->ChangedCallback = on_state_change;
m_pDev->CallbackTriggerFlags = (state_change_flags)(CONNECTED |
EXTENSION_CHANGED |
MOTIONPLUS_CHANGED);
- return cam_open_ok_no_change;
+ return true;
}
void WIICamera::stop()
diff --git a/tracker-wii/wii_camera.h b/tracker-wii/wii_camera.h
index d0d7f6dd..55def206 100644
--- a/tracker-wii/wii_camera.h
+++ b/tracker-wii/wii_camera.h
@@ -29,8 +29,9 @@ namespace pt_module {
struct WIICamera final : pt_camera
{
WIICamera(const QString& module_name);
+ ~WIICamera() override;
- pt_camera_open_status start(int idx, int fps, int res_x, int res_y) override;
+ bool start(int idx, int fps, int res_x, int res_y) override;
void stop() override;
result get_frame(pt_frame& Frame) override;
@@ -40,12 +41,9 @@ struct WIICamera final : pt_camera
QString get_desired_name() const override;
QString get_active_name() const override;
- operator bool() const override { return m_pDev && (!m_pDev->ConnectionLost()); }
-
void set_fov(double value) override {}
void show_camera_settings() override;
-
private:
std::unique_ptr<wiimote> m_pDev;
static void on_state_change(wiimote &remote,
diff --git a/tracker-wii/wiiyourself/wiimote.cpp b/tracker-wii/wiiyourself/wiimote.cpp
index 956c4fc6..e1e49101 100644
--- a/tracker-wii/wiiyourself/wiimote.cpp
+++ b/tracker-wii/wiiyourself/wiimote.cpp
@@ -114,13 +114,13 @@ const unsigned wiimote::FreqLookup [TOTAL_FREQUENCIES] =
{ 0, 4200, 3920, 3640, 3360,
3130, 2940, 2760, 2610, 2470 };
-const TCHAR* wiimote::ButtonNameFromBit [TOTAL_BUTTON_BITS] =
+const TCHAR* const wiimote::ButtonNameFromBit [TOTAL_BUTTON_BITS] =
{ _T("Left") , _T("Right"), _T("Down"), _T("Up"),
_T("Plus") , _T("??") , _T("??") , _T("??") ,
_T("Two") , _T("One") , _T("B") , _T("A") ,
_T("Minus"), _T("??") , _T("??") , _T("Home") };
-const TCHAR* wiimote::ClassicButtonNameFromBit [TOTAL_BUTTON_BITS] =
+const TCHAR* const wiimote::ClassicButtonNameFromBit [TOTAL_BUTTON_BITS] =
{ _T("??") , _T("TrigR") , _T("Plus") , _T("Home"),
_T("Minus"), _T("TrigL") , _T("Down") , _T("Right") ,
_T("Up") , _T("Left") , _T("ZR") , _T("X") ,
diff --git a/tracker-wii/wiiyourself/wiimote.h b/tracker-wii/wiiyourself/wiimote.h
index 1db2c098..3588b7c7 100644
--- a/tracker-wii/wiiyourself/wiimote.h
+++ b/tracker-wii/wiiyourself/wiimote.h
@@ -8,12 +8,7 @@
//
// wiimote.h (tab = 4 spaces)
-#ifdef _MSC_VER // VC
-# pragma once
-#endif
-
-#ifndef _WIIMOTE_H
-# define _WIIMOTE_H
+#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -165,7 +160,7 @@ class wiimote : public wiimote_state
const wiimote_state &new_state) {};
// get the button name from its bit index (some bits are unused)
- static const TCHAR* ButtonNameFromBit [TOTAL_BUTTON_BITS];
+ static const TCHAR* const ButtonNameFromBit [TOTAL_BUTTON_BITS];
static const TCHAR* GetButtonNameFromBit (unsigned index)
{
_ASSERT(index < TOTAL_BUTTON_BITS);
@@ -175,8 +170,8 @@ class wiimote : public wiimote_state
}
// same for the Classic Controller
- static const TCHAR* ClassicButtonNameFromBit [TOTAL_BUTTON_BITS];
- static const TCHAR* GetClassicButtonNameFromBit (unsigned index)
+ static const TCHAR* const ClassicButtonNameFromBit [TOTAL_BUTTON_BITS];
+ static const TCHAR* GetClassicButtonNameFromBit (unsigned index)
{
_ASSERT(index < TOTAL_BUTTON_BITS);
if(index >= TOTAL_BUTTON_BITS)
@@ -491,5 +486,3 @@ volatile int MotionPlusDetectCount; // waiting for the result
unsigned ExtTriggerFlags;// extension changes "
} Recording;
};
-
-#endif // _WIIMOTE_H \ No newline at end of file