WordRTC  0.5.0
 全て クラス ファイル 関数 変数
WordControl.h
説明を見る。
1 // -*- C++ -*-
10 #ifndef WORDCONTROL_H
11 #define WORDCONTROL_H
12 
13 #include <rtm/Manager.h>
14 #include <rtm/DataFlowComponentBase.h>
15 #include <rtm/CorbaPort.h>
16 #include <rtm/DataInPort.h>
17 #include <rtm/DataOutPort.h>
18 #include <rtm/idl/BasicDataTypeSkel.h>
19 #include <rtm/idl/ExtendedDataTypesSkel.h>
20 #include <rtm/idl/InterfaceDataTypesSkel.h>
21 
22 #include <fstream>
23 
24 #include "WriterSVC_impl.h"
25 
26 #include "WordObject.h"
27 #include "WordTask.h"
28 
29 // Service implementation headers
30 // <rtc-template block="service_impl_h">
31 
32 // </rtc-template>
33 
34 // Service Consumer stub headers
35 // <rtc-template block="consumer_stub_h">
36 
37 // </rtc-template>
38 
39 using namespace RTC;
40 
41 
42 
43 
44 
45 
52  : public RTC::DataFlowComponentBase
53 {
54  public:
59  WordControl(RTC::Manager* manager);
60 
64  ~WordControl();
65 
70 
75  void SetFilePath(std::string FP);
76 
77  // <rtc-template block="public_attribute">
78 
79  // </rtc-template>
80 
81  // <rtc-template block="public_operation">
82 
83  // </rtc-template>
84 
89  virtual RTC::ReturnCode_t onInitialize();
90 
95  virtual RTC::ReturnCode_t onFinalize();
96 
97  /***
98  *
99  * The startup action when ExecutionContext startup
100  * former rtc_starting_entry()
101  *
102  * @param ec_id target ExecutionContext Id
103  *
104  * @return RTC::ReturnCode_t
105  *
106  *
107  */
108  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
109 
110  /***
111  *
112  * The shutdown action when ExecutionContext stop
113  * former rtc_stopping_entry()
114  *
115  * @param ec_id target ExecutionContext Id
116  *
117  * @return RTC::ReturnCode_t
118  *
119  *
120  */
121  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
122 
128  virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
129 
135  virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
136 
142  virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
143 
144  /***
145  *
146  * The aborting action when main logic error occurred.
147  * former rtc_aborting_entry()
148  *
149  * @param ec_id target ExecutionContext Id
150  *
151  * @return RTC::ReturnCode_t
152  *
153  *
154  */
155  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
156 
157  /***
158  *
159  * The error action in ERROR state
160  * former rtc_error_do()
161  *
162  * @param ec_id target ExecutionContext Id
163  *
164  * @return RTC::ReturnCode_t
165  *
166  *
167  */
168  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
169 
170  /***
171  *
172  * The reset action that is invoked resetting
173  * This is same but different the former rtc_init_entry()
174  *
175  * @param ec_id target ExecutionContext Id
176  *
177  * @return RTC::ReturnCode_t
178  *
179  *
180  */
181  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
182 
183  /***
184  *
185  * The state update action that is invoked after onExecute() action
186  * no corresponding operation exists in OpenRTm-aist-0.2.0
187  *
188  * @param ec_id target ExecutionContext Id
189  *
190  * @return RTC::ReturnCode_t
191  *
192  *
193  */
194  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
195 
196  /***
197  *
198  * The action that is invoked when execution context's rate is changed
199  * no corresponding operation exists in OpenRTm-aist-0.2.0
200  *
201  * @param ec_id target ExecutionContext Id
202  *
203  * @return RTC::ReturnCode_t
204  *
205  *
206  */
207  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
208 
209 
210  protected:
211  // <rtc-template block="protected_attribute">
212 
213  // </rtc-template>
214 
215  // <rtc-template block="protected_operation">
216 
217  // </rtc-template>
218 
219  // Configuration variable declaration
220  // <rtc-template block="config_declare">
221 
222  // </rtc-template>
223 
224  // DataInPort declaration
225  // <rtc-template block="inport_declare">
226  RTC::TimedString m_word;
228  InPort<RTC::TimedString> m_wordIn;
229  RTC::TimedFloat m_fontSize;
231  InPort<RTC::TimedFloat> m_fontSizeIn;
232  RTC::TimedString m_fontName;
234  InPort<RTC::TimedString> m_fontNameIn;
235  RTC::TimedShort m_wsCharacter;
237  InPort<RTC::TimedShort> m_wsCharacterIn;
238  RTC::TimedShort m_wsWord;
240  InPort<RTC::TimedShort> m_wsWordIn;
241  RTC::TimedShort m_wsLine;
243  InPort<RTC::TimedShort> m_wsLineIn;
244  RTC::TimedShort m_wsParagraph;
246  InPort<RTC::TimedShort> m_wsParagraphIn;
247  RTC::TimedShort m_wsWindow;
249  InPort<RTC::TimedShort> m_wsWindowIn;
250  RTC::TimedShort m_wsScreen;
252  InPort<RTC::TimedShort> m_wsScreenIn;
253  RTC::TimedRGBColour m_Char_color;
255  InPort<RTC::TimedRGBColour> m_Char_colorIn;
257  RTC::TimedBoolean m_MovementType;
259  InPort<RTC::TimedBoolean> m_MovementTypeIn;
261  RTC::TimedBoolean m_Italic;
263  InPort<RTC::TimedBoolean> m_ItalicIn;
265  RTC::TimedBoolean m_Bold;
267  InPort<RTC::TimedBoolean> m_BoldIn;
272  RTC::TimedBoolean m_Underline;
274  InPort<RTC::TimedBoolean> m_UnderlineIn;
276  RTC::TimedBoolean m_Shadow;
278  InPort<RTC::TimedBoolean> m_ShadowIn;
280  RTC::TimedBoolean m_Strikeout;
282  InPort<RTC::TimedBoolean> m_StrikeoutIn;
284  RTC::TimedBoolean m_Contoured;
286  InPort<RTC::TimedBoolean> m_ContouredIn;
288  RTC::TimedBoolean m_Emphasis;
290  InPort<RTC::TimedBoolean> m_EmphasisIn;
292  RTC::TimedRGBColour m_Back_color;
294  InPort<RTC::TimedRGBColour> m_Back_colorIn;
296  // </rtc-template>
297 
298 
299  // DataOutPort declaration
300  // <rtc-template block="outport_declare">
301  RTC::TimedString m_selWord;
303  OutPort<RTC::TimedString> m_selWordOut;
304  RTC::TimedString m_copyWord;
306  OutPort<RTC::TimedString> m_copyWordOut;
310  // </rtc-template>
311 
312  // CORBA Port declaration
313  // <rtc-template block="corbaport_declare">
314 
315  // </rtc-template>
316 
317  RTC::CorbaPort m_WriterPort;
319  // </rtc-template>
320 
321  // Service declaration
322  // <rtc-template block="service_declare">
327  // Service declaration
328  // <rtc-template block="service_declare">
329 
330  // </rtc-template>
331 
332  // Consumer declaration
333  // <rtc-template block="consumer_declare">
334 
335  // </rtc-template>
336 
337  std::string file_path;
338  float fontsize;
339  std::string fontname;
340  int char_Red;
341  int char_Blue;
343  int italic;
344  int bold;
345  std::string code;
347  int underline;
348  int shadow;
349  int strikeout;
350  int contoured;
351  int emphasis;
353  int back_Red;
355  int back_Blue;
358  private:
359  std::ofstream ofs;
360  WordTask *wt;
361 
362 
363  // <rtc-template block="private_attribute">
364 
365  // </rtc-template>
366 
367  // <rtc-template block="private_operation">
368 
369  // </rtc-template>
370 
371 };
372 
373 //コンフィギュレーションパラメータが更新されたときのコールバック
375  : public RTC::ConfigurationSetListener
376 {
377 public:
379  {
380  m_rtc = e_rtc;
381  }
382  void operator()(const coil::Properties& config_set)
383  {
384 
385  m_rtc->ConfigUpdate();
386 
387  }
388  WordControl *m_rtc;
389 
390 };
391 
392 
393 extern "C"
394 {
395  DLL_EXPORT void WordControlInit(RTC::Manager* manager);
396 };
397 
398 #endif // WORDRTC_H