profile_gen.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- python -*-
3 #
4 # @file profile_gen.py
5 # @brief RTC profile generator
6 # @date $Date$
7 # @author Noriaki Ando <n-ando@aist.go.jp>
8 #
9 # Copyright (C) 2008
10 # Task-intelligence Research Group,
11 # Intelligent Systems Research Institute,
12 # National Institute of
13 # Advanced Industrial Science and Technology (AIST), Japan
14 # All rights reserved.
15 #
16 # $Id$
17 #
18 
19 import gen_base
20 
21 profile_yaml = """rtcProfile:
22  version: "1.0"
23  id: [id]
24 
25  basicInfo:
26  name: [basicInfo.name]
27 
28  description: [basicInfo.description]
29 
30  version: [basicInfo.version]
31 
32  vendor: [basicInfo.vendor]
33 
34  category: [basicInfo.category]
35 
36  componentType: [basicInfo.componentType]
37 
38  activityType: [basicInfo.activityType]
39 
40  componentKind: [basicInfo.componentKind]
41 
42  maxInstances: [basicInfo.maxInstances]
43 
44  abstract: [basicInfo.abstract]
45 
46  executionRate: [basicInfo.executionRate]
47 
48  executionType: [basicInfo.executionType]
49 
50  creationDate:
51  year: [basicInfo.creationDate.year]
52 
53  month: [basicInfo.creationDate.month]
54 
55  day: [basicInfo.creationDate.day]
56 
57  hour: [basicInfo.creationDate.hour]
58 
59  minute: [basicInfo.creationDate.minute]
60 
61  second: [basicInfo.creationDate.second]
62 
63  updateDate:
64  year: [basicInfo.updateDate.year]
65 
66  month: [basicInfo.updateDate.month]
67 
68  day: [basicInfo.updateDate.day]
69 
70  hour: [basicInfo.updateDate.hour]
71 
72  minute: [basicInfo.updateDate.minute]
73 
74  second: [basicInfo.updateDate.second]
75 
76  "rtcDoc::doc":
77  algorithm: [basicInfo.rtcDoc::doc.algorithm]
78 
79  creator: [basicInfo.rtcDoc::doc.creator]
80 
81  description: [basicInfo.rtcDoc::doc.description]
82 
83  inout: [basicInfo.rtcDoc::doc.inout]
84 
85  license: [basicInfo.rtcDoc::doc.license]
86 
87  reference: [basicInfo.rtcDoc::doc.reference]
88 
89  "rtcExt::versionUpLog":
90 [for log in basicInfo.rtcExt::versionUpLog]
91  - [log]
92 [endfor]
93  language:
94 [if-any language.java]
95  java:
96  library:
97 [for javalib in language.java.library]
98  - [javalib]
99 [endfor]
100 [endif]
101  actions:
102  onInitialize:
103  implemented: [actions.onInitialize.implemented]
104 
105  "rtcDoc::doc":
106  description: [actions.onInitialize.rtcDoc::doc.description]
107 
108  postCondition: [actions.onInitialize.rtcDoc::doc.postCondition]
109 
110  preCondition: [actions.onInitialize.rtcDoc::doc.preCondition]
111 
112  onActivated:
113  implemented: [actions.onActivated.implemented]
114 
115  "rtcDoc::doc":
116  description: [actions.onActivated.rtcDoc::doc.description]
117 
118  postCondition: [actions.onActivated.rtcDoc::doc.postCondition]
119 
120  preCondition: [actions.onActivated.rtcDoc::doc.preCondition]
121 
122  onDeactivated:
123  implemented: [actions.onDeactivated.implemented]
124 
125  "rtcDoc::doc":
126  description: [actions.onDeactivated.rtcDoc::doc.description]
127 
128  postCondition: [actions.onDeactivated.rtcDoc::doc.postCondition]
129 
130  preCondition: [actions.onDeactivated.rtcDoc::doc.preCondition]
131 
132  onAborting:
133  implemented: [actions.onAborting.implemented]
134 
135  "rtcDoc::doc":
136  description: [actions.onAborting.rtcDoc::doc.description]
137 
138  postCondition: [actions.onAborting.rtcDoc::doc.postCondition]
139 
140  preCondition: [actions.onAborting.rtcDoc::doc.preCondition]
141 
142  onError:
143  implemented: [actions.onError.implemented]
144 
145  "rtcDoc::doc":
146  description: [actions.onError.rtcDoc::doc.description]
147 
148  postCondition: [actions.onError.rtcDoc::doc.postCondition]
149 
150  preCondition: [actions.onError.rtcDoc::doc.preCondition]
151 
152  onReset:
153  implemented: [actions.onReset.implemented]
154 
155  "rtcDoc::doc":
156  description: [actions.onReset.rtcDoc::doc.description]
157 
158  postCondition: [actions.onReset.rtcDoc::doc.postCondition]
159 
160  preCondition: [actions.onReset.rtcDoc::doc.preCondition]
161 
162  onFinalize:
163  implemented: [actions.onFinalize.implemented]
164 
165  "rtcDoc::doc":
166  description: [actions.onFinalize.rtcDoc::doc.description]
167 
168  postCondition: [actions.onFinalize.rtcDoc::doc.postCondition]
169 
170  preCondition: [actions.onFinalize.rtcDoc::doc.preCondition]
171 
172  onStartup:
173  implemented: [actions.onStartup.implemented]
174 
175  "rtcDoc::doc":
176  description: [actions.onStartup.rtcDoc::doc.description]
177 
178  postCondition: [actions.onStartup.rtcDoc::doc.postCondition]
179 
180  preCondition: [actions.onStartup.rtcDoc::doc.preCondition]
181 
182  onRateChanged:
183  implemented: [actions.onRateChanged.implemented]
184 
185  "rtcDoc::doc":
186  description: [actions.onRateChanged.rtcDoc::doc.description]
187 
188  postCondition: [actions.onRateChanged.rtcDoc::doc.postCondition]
189 
190  preCondition: [actions.onRateChanged.rtcDoc::doc.preCondition]
191 
192  onShutdown:
193  implemented: [actions.onShutdown.implemented]
194 
195  "rtcDoc::doc":
196  description: [actions.onShutdown.rtcDoc::doc.description]
197 
198  postCondition: [actions.onShutdown.rtcDoc::doc.postCondition]
199 
200  preCondition: [actions.onShutdown.rtcDoc::doc.preCondition]
201 
202  onExecute:
203  implemented: [actions.onExecute.implemented]
204 
205  "rtcDoc::doc":
206  description: [actions.onExecute.rtcDoc::doc.description]
207 
208  postCondition: [actions.onExecute.rtcDoc::doc.postCondition]
209 
210  preCondition: [actions.onExecute.rtcDoc::doc.preCondition]
211 
212  onStateUpdate:
213  implemented: [actions.onStateUpdate.implemented]
214 
215  "rtcDoc::doc":
216  description: [actions.onStateUpdate.rtcDoc::doc.description]
217 
218  postCondition: [actions.onStateUpdate.rtcDoc::doc.postCondition]
219 
220  preCondition: [actions.onStateUpdate.rtcDoc::doc.preCondition]
221 
222  dataPorts:
223 [for dport in dataPorts]
224  -
225  portType: [dport.portType]
226 
227  name: [dport.name]
228 
229  type: [dport.type]
230 
231  interfaceType: [dport.interfaceType]
232 
233  dataflowType: [dport.dataflowType]
234 
235  subscriptionType: [dport.subscriptionType]
236 
237  idlFile: [dport.idlFile]
238 
239  "rtcDoc::doc":
240  type: [dport.rtcDoc::doc.type]
241 
242  description: [dport.rtcDoc::doc.description]
243 
244  number: [dport.rtcDoc::doc.number]
245 
246  occerrence: [dport.rtcDoc::doc.occerrence]
247 
248  operation: [dport.rtcDoc::doc.operation]
249 
250  semantics: [dport.rtcDoc::doc.semantics]
251 
252  unit: [dport.rtcDoc::doc.unit]
253 
254  "rtcExt::position": [dport.rtcExt::position]
255 
256  "rtcExt::varname": [dport.rtcExt::varname]
257 
258 [endfor]
259  servicePorts:
260 [for sport in servicePorts]
261  -
262  name: [sport.name]
263 
264  "rtcDoc::doc":
265  description: [sport.rtcDoc::doc.description]
266 
267  ifdescription: [sport.rtcDoc::doc.ifdescription]
268 
269  "rtcExt::position": [sport.rtcExt::position]
270 
271  serviceInterface:
272 [for sif in sport.serviceInterface]
273  -
274  direction: [sif.direction]
275 
276  name: [sif.name]
277 
278  type: [sif.type]
279 
280  varname: [sif.varname]
281 
282  instanceName: [sif.instanceName]
283 
284  idlFile: [sif.idlFile]
285 
286  path: [sif.path]
287 
288  "rtcDoc::doc":
289  description: [sif.rtcDoc::doc.description]
290 
291  docArgument: [sif.rtcDoc::doc.docArgument]
292 
293  docException: [sif.rtcDoc::doc.docException]
294 
295  docPostCondition: [sif.rtcDoc::doc.docPostCondition]
296 
297  docPreCondition: [sif.rtcDoc::doc.docPreCondition]
298 
299  docReturn: [sif.rtcDoc::doc.docReturn]
300 
301 [endfor]
302 [endfor]
303  configurationSet:
304  configuration:
305 [for conf in configurationSet.configuration]
306  -
307  name: [conf.name]
308 
309  type: [conf.type]
310 
311  varname: [conf.varname]
312 
313  defaultValue: [conf.defaultValue]
314 
315  "rtcDoc::doc":
316  constraint: [conf.rtcDoc::doc.constraint]
317 
318  dataname: [conf.rtcDoc::doc.dataname]
319 
320  defaultValue: [conf.rtcDoc::doc.defaultValue]
321 
322  description: [conf.rtcDoc::doc.description]
323 
324  range: [conf.rtcDoc::doc.range]
325 
326  unit: [conf.rtcDoc::doc.unit]
327 
328 [endfor]
329  parameters:
330 [if-any parameters]
331 [for param in parameters]
332  -
333  name: [param.name]
334 
335  defaultValue: [param.defaultValue]
336 
337 [endfor]
338 [endif]
339 """
340 
341 
343  def __init__(self, data):
344  self.data = data
345  self.data["fname"] = data["basicInfo"]["name"] + ".yaml"
346  self.tags = {}
347 
348  def print_yamlprofile(self):
349  self.gen(self.data["fname"], profile_yaml, self.data, self.tags)
350 
351  def print_all(self):
352  self.print_yamlprofile()
def gen(self, fname, temp_txt, data, tags)
Definition: gen_base.py:86
def __init__(self, data)
Definition: profile_gen.py:343


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:59