Develop and Download Open Source Software

Browse Subversion Repository

Contents of /connection/ConnectionDeviceSearch.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 380 - (show annotations) (download) (as text)
Sun May 16 11:35:05 2010 UTC (13 years, 10 months ago) by satofumi
File MIME type: text/x-chdr
File size: 3314 byte(s)
shellViewer が動作するように調整
1 #ifndef CONNECTION_DEVICE_SEARCH_H
2 #define CONNECTION_DEVICE_SEARCH_H
3
4 #include <string>
5
6
7 /*!
8 \page connection_device_search_page シリアル ID 指定のデバイス探索
9
10 \section connection_device_search_section_abst 概要
11
12 シリアル ID 指定にて、接続するデバイスを探し出すための機能。デバイスによって、以下のどちらかが利用可能。
13 - デバイスにシリアル ID を指定し、個体判別まで可能なクラス
14 - 製品にシリアル ID がないため、そのデバイスかの判別まで可能なクラス
15
16 \n
17 \section connection_device_search_section_list 利用可能なデバイス用クラス
18 - シリアル ID を利用した個体判別までが可能なクラス
19 - UrgCtrl (URG, Top-URG)
20 \n \n
21 - デバイスの判別までが可能なクラス
22 - RunCtrl
23 - Pgm238Ctrl
24 - Tds01vCtrl
25
26 \n
27 \section connection_device_search_section_usage 使い方
28
29 URG を例に、利用方法を説明します。URG の場合、デバイス判別をするためのクラスとして、UrgIdHandler を用います。
30
31 -# デバイスのシリアル ID を確認する (参考 \ref miniterm_page)
32 \verbatim
33 % miniterm
34 VV
35 V
36 00P
37 VEND:Hokuyo Automatic Co.,Ltd.
38 PROD:SOKUIKI Sensor URG-04LX
39 FIRM:0.2.72g,06/06/02(20-5500[mm],240[deg],44-725[step],600[rpm])
40 PROT:00003,(SCIP 2.0)
41 SERI:H0614967
42 STAT:FW-dt WF:22mErCheck[FinDis with shadow ]
43 \endverbatim
44 \n
45 このデバイスのシリアル ID は「H0614967」であることがわかります。
46 \n \n
47 -# デバイス検出のプログラム内で、シリアル ID 指定でデバイスを探索する
48 \include urgIdHandlerSample.cpp
49 */
50
51
52 /*!
53 \file
54 \brief 製品番号による接続
55
56 \author Satofumi KAMIMURA
57
58 $Id$
59 */
60
61 #include <memory>
62 #include <vector>
63
64 namespace beego {
65
66 class ConnectionInterface;
67 class ProductIdHandler;
68
69
70 /*!
71 \brief 接続デバイスの探索クラス
72
73 登録しておいたデバイスの中から、対象デバイスを探索する。
74 */
75 class ConnectionDeviceSearch {
76 ConnectionDeviceSearch(const ConnectionDeviceSearch& rhs);
77 ConnectionDeviceSearch& operator = (const ConnectionDeviceSearch& rhs);
78
79 struct pImpl;
80 const std::auto_ptr<pImpl> pimpl;
81
82 public:
83 ConnectionDeviceSearch(void);
84 ~ConnectionDeviceSearch(void);
85
86 /*!
87 \brief 接続候補デバイスの登録
88
89 \param device[i] 接続候補デバイス名
90 */
91 void add(const char* device);
92
93 /*!
94 \brief 接続候補デバイス名の登録削除
95
96 \param device [i] 登録削除するデバイス名
97
98 \attention 探索で一致したデバイス名は候補から削除されるため、ユーザ側から動的に削除する必要はない。
99 */
100 void remove(const char* device);
101
102 /*!
103 \brief 接続候補デバイスのクリア
104 */
105 void clear(void);
106
107 /*!
108 \brief 未割り当ての接続候補デバイスを返す
109
110 \param devices [o] 未割り当ての接続候補デバイス
111
112 \return 未割り当ての接続候補デバイスの個数
113 */
114 size_t getLeftDevices(std::vector<std::string>& devices);
115
116 /*!
117 \brief 接続候補デバイスの探索
118
119 \param find_device [o] 一致したデバイス名
120 \param handler [i] 探索を行うデバイスのハンドラ
121 \param productId [i] 探索したいデバイスのシリアル ID
122
123 \retval true 探索に成功。find_device に見つかったデバイス名を代入して返す
124 \retval false 探索失敗
125 */
126 bool search(std::string& find_device, const ProductIdHandler* handler,
127 const char* productId = "");
128
129 /*!
130 \brief 接続候補のデバイス登録数
131
132 \return 接続候補のデバイス登録数
133 */
134 size_t size(void);
135 };
136 };
137
138 #endif /* !CONNECTION_DEVICE_SEARCH_H */

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26