• R/O
  • SSH
  • HTTPS

qrobosdk: コミット


コミットメタ情報

リビジョン1772 (tree)
日時2010-04-13 02:14:30
作者satofumi

ログメッセージ

added

変更サマリ

差分

--- trunk/widgets/RangeSensorConnectionThread/RangeSensorConnectionThread.cpp (nonexistent)
+++ trunk/widgets/RangeSensorConnectionThread/RangeSensorConnectionThread.cpp (revision 1772)
@@ -0,0 +1,55 @@
1+/*!
2+ \file
3+ \brief 再生時の接続用スレッド
4+
5+ \author Satofumi KAMIMURA
6+
7+ $Id$
8+*/
9+
10+#include "ConnectThread.h"
11+#include "RangeSensor.h"
12+#include "UrgDevice.h"
13+
14+using namespace qrk;
15+using namespace std;
16+
17+
18+struct ConnectThread::pImpl
19+{
20+ RangeSensor& sensor_;
21+
22+ string device_;
23+ long baudrate_;
24+
25+
26+ pImpl(RangeSensor& sensor)
27+ : sensor_(sensor), device_("dummy"), baudrate_(UrgDevice::DefaultBaudrate)
28+ {
29+ }
30+};
31+
32+
33+void ConnectThread::run(void)
34+{
35+ bool ret = pimpl->sensor_.connect(pimpl->device_.c_str(), pimpl->baudrate_);
36+ emit connected(ret);
37+}
38+
39+
40+ConnectThread::ConnectThread(RangeSensor& sensor)
41+ : pimpl(new pImpl(sensor))
42+{
43+}
44+
45+
46+ConnectThread::~ConnectThread(void)
47+{
48+}
49+
50+
51+void ConnectThread::setConnectSettings(const string& device, long baudrate)
52+{
53+ pimpl->device_ = device;
54+ pimpl->baudrate_ = baudrate;
55+}
Added: svn:keywords
## -0,0 +1 ##
+Id Date Author Rev URL
\ No newline at end of property
--- trunk/widgets/RangeSensorConnectionThread/RangeSensorConnectionThread.h (nonexistent)
+++ trunk/widgets/RangeSensorConnectionThread/RangeSensorConnectionThread.h (revision 1772)
@@ -0,0 +1,50 @@
1+#ifndef CONNECT_THREAD_H
2+#define CONNECT_THREAD_H
3+
4+/*!
5+ \file
6+ \brief 再生時の接続用スレッド
7+
8+ \author Satofumi KAMIMURA
9+
10+ $Id$
11+*/
12+
13+#include <QThread>
14+#include <memory>
15+
16+namespace qrk
17+{
18+ class RangeSensor;
19+}
20+
21+
22+/*!
23+ \brief 接続用スレッドクラス
24+*/
25+class ConnectThread : public QThread
26+{
27+ Q_OBJECT;
28+
29+public:
30+ ConnectThread(qrk::RangeSensor& sensor);
31+ ~ConnectThread(void);
32+
33+ void setConnectSettings(const std::string& device, long baudrate);
34+
35+signals:
36+ void connected(bool connected);
37+
38+protected:
39+ void run(void);
40+
41+private:
42+ ConnectThread(void);
43+ ConnectThread(const ConnectThread& rhs);
44+ ConnectThread& operator = (const ConnectThread& rhs);
45+
46+ struct pImpl;
47+ std::auto_ptr<pImpl> pimpl;
48+};
49+
50+#endif /* !CONNECT_THREAD_H */
Added: svn:keywords
## -0,0 +1 ##
+Id Date Author Rev URL
\ No newline at end of property
旧リポジトリブラウザで表示