Пример #1
0
 def _on_write_param(self, node, ns, call):
     if len(call.arguments) < 1:
         return
     name = self._extract_topic(call)
     depth = get_control_depth(call, recursive = True)
     location = self._call_location(call)
     conditions = [SourceCondition(pretty_str(c), location = location)
                   for c in get_conditions(call, recursive = True)]
     wrt = WriteParameterCall(name, ns, None, location = location,
                              control_depth = depth, conditions = conditions,
                              repeats = is_under_loop(call, recursive = True))
     node.write_param.append(wrt)
     self.log.debug("Found Write on %s/%s (%s)", ns, name, "string")
Пример #2
0
 def _on_client(self, node, ns, call):
     if len(call.arguments) <= 1:
         return
     name = self._extract_topic(call)
     msg_type = self._extract_message_type(call)
     depth = get_control_depth(call, recursive = True)
     location = self._call_location(call)
     conditions = [SourceCondition(pretty_str(c), location = location)
                   for c in get_conditions(call, recursive = True)]
     cli = ServiceClientCall(name, ns, msg_type, location = location,
                             control_depth = depth, conditions = conditions,
                             repeats = is_under_loop(call, recursive = True))
     node.client.append(cli)
     self.log.debug("Found Client on %s/%s (%s)", ns, name, msg_type)
Пример #3
0
 def _on_subscription(self, node, ns, call):
     if len(call.arguments) <= 1:
         return
     name = self._extract_topic(call)
     msg_type = self._extract_message_type(call)
     queue_size = self._extract_queue_size(call)
     depth = get_control_depth(call, recursive = True)
     location = self._call_location(call)
     conditions = [SourceCondition(pretty_str(c), location = location)
                   for c in get_conditions(call, recursive = True)]
     sub = Subscription(name, ns, msg_type, queue_size, location = location,
                        control_depth = depth, conditions = conditions,
                        repeats = is_under_loop(call, recursive = True))
     node.subscribe.append(sub)
     self.log.debug("Found Subscription on %s/%s (%s)", ns, name, msg_type)