• R/O
  • SSH
  • HTTPS

qrobosdk: コミット


コミットメタ情報

リビジョン1775 (tree)
日時2010-04-13 06:38:30
作者satofumi

ログメッセージ

moved RangeSensorConnectThread

変更サマリ

差分

--- trunk/widgets/RangeSensorConnectThread/RangeSensorConnectThread.cpp (revision 1774)
+++ trunk/widgets/RangeSensorConnectThread/RangeSensorConnectThread.cpp (revision 1775)
@@ -7,7 +7,7 @@
77 $Id$
88 */
99
10-#include "ConnectThread.h"
10+#include "RangeSensorConnectThread.h"
1111 #include "RangeSensor.h"
1212 #include "UrgDevice.h"
1313
@@ -15,7 +15,7 @@
1515 using namespace std;
1616
1717
18-struct ConnectThread::pImpl
18+struct RangeSensorConnectThread::pImpl
1919 {
2020 RangeSensor& sensor_;
2121
@@ -30,7 +30,7 @@
3030 };
3131
3232
33-void ConnectThread::run(void)
33+void RangeSensorConnectThread::run(void)
3434 {
3535 bool ret = pimpl->sensor_.connect(pimpl->device_.c_str(), pimpl->baudrate_);
3636 emit connected(ret);
@@ -37,18 +37,19 @@
3737 }
3838
3939
40-ConnectThread::ConnectThread(RangeSensor& sensor)
40+RangeSensorConnectThread::RangeSensorConnectThread(RangeSensor& sensor)
4141 : pimpl(new pImpl(sensor))
4242 {
4343 }
4444
4545
46-ConnectThread::~ConnectThread(void)
46+RangeSensorConnectThread::~RangeSensorConnectThread(void)
4747 {
4848 }
4949
5050
51-void ConnectThread::setConnectSettings(const string& device, long baudrate)
51+void RangeSensorConnectThread::setConnectSettings(const string& device,
52+ long baudrate)
5253 {
5354 pimpl->device_ = device;
5455 pimpl->baudrate_ = baudrate;
--- trunk/widgets/RangeSensorConnectThread/RangeSensorConnectThread.h (revision 1774)
+++ trunk/widgets/RangeSensorConnectThread/RangeSensorConnectThread.h (revision 1775)
@@ -22,13 +22,13 @@
2222 /*!
2323 \brief 接続用スレッドクラス
2424 */
25-class ConnectThread : public QThread
25+class RangeSensorConnectThread : public QThread
2626 {
2727 Q_OBJECT;
2828
2929 public:
30- ConnectThread(qrk::RangeSensor& sensor);
31- ~ConnectThread(void);
30+ RangeSensorConnectThread(qrk::RangeSensor& sensor);
31+ ~RangeSensorConnectThread(void);
3232
3333 void setConnectSettings(const std::string& device, long baudrate);
3434
@@ -39,9 +39,9 @@
3939 void run(void);
4040
4141 private:
42- ConnectThread(void);
43- ConnectThread(const ConnectThread& rhs);
44- ConnectThread& operator = (const ConnectThread& rhs);
42+ RangeSensorConnectThread(void);
43+ RangeSensorConnectThread(const RangeSensorConnectThread& rhs);
44+ RangeSensorConnectThread& operator = (const RangeSensorConnectThread& rhs);
4545
4646 struct pImpl;
4747 std::auto_ptr<pImpl> pimpl;
--- trunk/scripts/amgen.rb (revision 1774)
+++ trunk/scripts/amgen.rb (revision 1775)
@@ -1,25 +1,25 @@
11 #!/usr/bin/ruby
2-# Makefile から Makefile.am を生成するスクリプト
2+# Makefile ???? Makefile.am ???????????鴻????????
33 # Satofumi KAMIMURA
44 # $Id$
5-# 基本的に、Makefile.am 内の <program>_SOURCES に対する追加のみを行う
5+# ?堺????????Makefile.am ??? <program>_SOURCES ???????菴遵?????帥??茵???
66 #
7-# \todo symlink が既に存在してもエラーにならないようにする
7+# \todo symlink ???≪????????????????若????????????????????
88
99 require 'fileutils.rb'
1010
11-# Makefile.am 中の _SOURCES の項目を管理する
11+# Makefile.am 筝?? _SOURCES ????????膊∞??????
1212 $sources_list = []
1313
14-# 指定ファイルをインクルードパスから探しだし、cpp 共々、追加する
14+# ??絎????<?ゃ?????ゃ?潟?????若?????鴻?????≪????????cpp ?宴????菴遵??????
1515 def searchAndRegister(add_file, include_pathes)
1616
1717 #p include_pathes
1818
19- # 指定ファイルが include_pathes に存在するか、を探す
19+ # ??絎????<?ゃ???? include_pathes ????????????????≪??
2020 file_rpath = nil
2121 include_pathes.each { |rpath|
22- # ファイルの存在確認
22+ # ???<?ゃ???????∈茯?
2323 if File.exist?(rpath + add_file)
2424 file_rpath = rpath
2525 break
@@ -31,7 +31,7 @@
3131 add_file_path = file_rpath + add_file
3232 add_files = [ add_file_path ]
3333
34- # 同じ場所に cpp が存在するか、確認する
34+ # ?????贋??? cpp ??絖???????????腆肴?????
3535 add_also_cpp = nil
3636 if File.extname(add_file) != '.cpp'
3737 check_file = file_rpath + File.basename(add_file, '.*') + '.cpp'
@@ -40,12 +40,12 @@
4040 end
4141 end
4242
43- # No such file or directory なはずなので、シンボリックリンクを作成する
43+ # No such file or directory ???????????с???激?潟???????????潟????篏???????
4444 add_files.each { |file|
4545 File.symlink(file, File.basename(file))
4646 }
4747
48- # Makefile.am を追記モードで開き、追記を行う
48+ # Makefile.am ??菴処??≪?若???ч??????菴処???茵???
4949 File.open('Makefile.am', 'a') { |io|
5050 add_files.each { |file|
5151 add_basename = File.basename(file)
@@ -59,33 +59,33 @@
5959 return true
6060 end
6161
62-# ----- メイン処理 -----
63-# 引数がなければ、使い方を表示して終了
62+# ----- ?<?ゃ?喝???? -----
63+# 綣??違?????????違??篏帥???鴻??茵?ず?????篋?
6464 if ARGV.size <= 0
6565 print "usage:\n\t" + __FILE__ + " <Makefile>\n\n"
6666 exit
6767 end
6868
69-# パース情報の初期化
69+# ???若?号???宴????????
7070 makefile = ARGV[0]
71-makefile_rpath = File.dirname(makefile) + '/' # Makefile への相対パス
71+makefile_rpath = File.dirname(makefile) + '/' # Makefile ?吾???後????
7272 include_pathes = []
7373
74-# 引数渡しのファイルを Makefile と見なして読み出す
74+# 綣??井検???????<?ゃ???? Makefile ???????????水?冴??
7575 File.open(makefile) { |io|
7676 while line = io.gets
7777
78- # INCLUDE 指定のパスを抜き出す
78+ # INCLUDE ??絎??????鴻???????冴??
7979 if line =~ /^INCLUDES = (.+)/
8080 includes = Regexp.last_match[1].split(' ')
8181 includes.each { |include|
8282 include_pathes.push(makefile_rpath + include[2, 128] + '/')
8383 }
84- # Makfile のある場所も追加しておく
84+ # Makfile ???????贋????菴遵?????????
8585 include_pathes.push(makefile_rpath)
8686 end
8787
88- # REQUIRE_LIBS 指定のパスも、探索パスに含める
88+ # REQUIRE_LIBS ??絎??????鴻?????∝刈???鴻????????
8989 if line =~ /^REQUIRE_LIBS = (.+)/
9090 require_libs = Regexp.last_match[1].split(' ')
9191 require_libs.each { |lib|
@@ -95,10 +95,10 @@
9595 end
9696 }
9797
98-# Makefile.am のバックアップを作っておく
98+# Makefile.am ?????????≪??????篏??c?????
9999 FileUtils.copy('Makefile.am', 'Makefile.am.bak')
100100
101-# Makefile.am から、SOURCES に登録済みのファイルを抜き出す
101+# Makefile.am ??????SOURCES ???脂?我??帥?????<?ゃ?????????冴??
102102 File.open('Makefile.am') { |io|
103103 while line = io.gets
104104 if line =~ /_SOURCES = (.+)/
@@ -107,7 +107,7 @@
107107 end
108108 }
109109
110-# make を実行し、見つからないファイルを追加していく
110+# make ??絎?茵?????荀??ゃ???????????<?ゃ????菴遵?????????
111111 begin
112112 `make 2> errors_output.txt`
113113 make_status = $?.to_i / 256
@@ -116,20 +116,20 @@
116116 File.open('errors_output.txt') { |io|
117117 while line = io.gets
118118 if (line =~ / (.+): No such file or directory/) ||
119- (line =~ /error: (.+): そのようなファイルやディレクトリはありません/)
119+ (line =~ /error: (.+): ?????????????<?ゃ???????c???????????????障????/)
120120
121121 add_file = Regexp.last_match[1]
122122
123- # ファイルの探索と追加
123+ # ???<?ゃ????「膣≪??申??
124124 print 'Adding ' + add_file + ' ... '
125125 ret = searchAndRegister(add_file, include_pathes)
126126 if ret
127127 print "O.K.\n"
128128 else
129- # エラーになったら、強制終了させる
129+ # ?????若?????c??????綣桁?句?篋???????
130130 print "Fail !\n"
131131
132- # 変更がなかったことにしてループを抜け、メッセージを表示させる
132+ # 紊??眼???????c???????????????若???????????<???祉?若?吾??茵?ず??????
133133 changed = false
134134 break;
135135 end
@@ -138,9 +138,9 @@
138138 end
139139 }
140140 if changed == false
141- # エラーメッセージを表示させるための処理
142- # !!! ひどいな...
143- # !!! errors_output.txt のサイズによっては、正常終了とみなすべきかと
141+ # ?????若?<???祉?若?吾??茵?ず????????????????
142+ # !!! ?蚊??????..
143+ # !!! errors_output.txt ???泣?ゃ?冴?????c??????罩e幻腟?篋????帥?????鴻?????
144144 if make_status != 0
145145 print "Fail !!\n"
146146 `make`
@@ -148,5 +148,5 @@
148148 end
149149 end while (make_status != 0) && changed
150150
151-# 生成したファイルを削除して、おしまい
151+# ???????????<?ゃ???????ゃ???????????障??
152152 FileUtils.remove('errors_output.txt')
--- trunk/libs/monitor/system/qt/Lock.cpp (revision 1774)
+++ trunk/libs/monitor/system/qt/Lock.cpp (revision 1775)
@@ -48,6 +48,12 @@
4848 }
4949
5050
51+bool Lock::tryLock(void)
52+{
53+ return pimpl->mutex_.tryLock();
54+}
55+
56+
5157 void Lock::unlock(void)
5258 {
5359 pimpl->mutex_.unlock();
--- trunk/libs/monitor/system/Lock.h (revision 1774)
+++ trunk/libs/monitor/system/Lock.h (revision 1775)
@@ -45,6 +45,12 @@
4545
4646
4747 /*!
48+ \brief ロック
49+ */
50+ bool tryLock(void);
51+
52+
53+ /*!
4854 \brief アンロック
4955 */
5056 void unlock(void);
--- trunk/programs/UrgViewer/ConnectThread.h (revision 1774)
+++ trunk/programs/UrgViewer/ConnectThread.h (nonexistent)
@@ -1,50 +0,0 @@
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 */
Deleted: svn:keywords
## -1 +0,0 ##
-Id Date Author Rev URL
\ No newline at end of property
--- trunk/programs/UrgViewer/ConnectThread.cpp (revision 1774)
+++ trunk/programs/UrgViewer/ConnectThread.cpp (nonexistent)
@@ -1,55 +0,0 @@
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-}
Deleted: svn:keywords
## -1 +0,0 ##
-Id Date Author Rev URL
\ No newline at end of property
--- trunk/programs/UrgViewer/UrgViewerWindow.cpp (revision 1774)
+++ trunk/programs/UrgViewer/UrgViewerWindow.cpp (revision 1775)
@@ -9,7 +9,7 @@
99
1010 #include "UrgViewerWindow.h"
1111 #include "UrgDrawWidget.h"
12-#include "ConnectThread.h"
12+#include "RangeSensorConnectThread.h"
1313 #include "SerialConnectionWidget.h"
1414 #include "EthernetConnectionWidget.h"
1515 #include "CaptureSettingWidget.h"
@@ -69,7 +69,7 @@
6969 UrgDrawWidget urg_draw_widget_;
7070 SerialConnectionWidget serial_connection_widget_;
7171 EthernetConnectionWidget ethernet_connection_widget_;
72- ConnectThread connect_thread_;
72+ RangeSensorConnectThread connect_thread_;
7373 bool draw_intensity_;
7474 Lock urg_mutex_;
7575
--- trunk/programs/UrgViewer/package/ConnectThread.h (revision 1774)
+++ trunk/programs/UrgViewer/package/ConnectThread.h (nonexistent)
@@ -1 +0,0 @@
1-link ../ConnectThread.h
\ No newline at end of file
Deleted: svn:special
## -1 +0,0 ##
-*
\ No newline at end of property
--- trunk/programs/UrgViewer/package/ConnectThread.cpp (revision 1774)
+++ trunk/programs/UrgViewer/package/ConnectThread.cpp (nonexistent)
@@ -1 +0,0 @@
1-link ../ConnectThread.cpp
\ No newline at end of file
Deleted: svn:special
## -1 +0,0 ##
-*
\ No newline at end of property
--- trunk/programs/UrgViewer/package/RangeSensorConnectThread.cpp (nonexistent)
+++ trunk/programs/UrgViewer/package/RangeSensorConnectThread.cpp (revision 1775)
@@ -0,0 +1 @@
1+link ../../../widgets/RangeSensorConnectThread/RangeSensorConnectThread.cpp
\ No newline at end of file
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
--- trunk/programs/UrgViewer/package/RangeSensorConnectThread.h (nonexistent)
+++ trunk/programs/UrgViewer/package/RangeSensorConnectThread.h (revision 1775)
@@ -0,0 +1 @@
1+link ../../../widgets/RangeSensorConnectThread/RangeSensorConnectThread.h
\ No newline at end of file
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
--- trunk/programs/Makefile (revision 1774)
+++ trunk/programs/Makefile (revision 1775)
@@ -43,7 +43,6 @@
4343 -cd FlyFlapp/ && $(MAKE) clean
4444 -cd qtmclock/ && $(MAKE) clean
4545 -cd hyakutyping/ && $(MAKE) clean
46- -cd flex_hyakutyping/ && $(MAKE) clean
4746 -cd qpilot/ && $(MAKE) clean
4847 -cd mhack/ && $(MAKE) clean
4948 -cd qlm_batmon/ && $(MAKE) clean
旧リポジトリブラウザで表示