当前位置: 首页>>代码示例>>Python>>正文


Python OpenRTM_aist.split方法代码示例

本文整理汇总了Python中OpenRTM_aist.split方法的典型用法代码示例。如果您正苦于以下问题:Python OpenRTM_aist.split方法的具体用法?Python OpenRTM_aist.split怎么用?Python OpenRTM_aist.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenRTM_aist的用法示例。


在下文中一共展示了OpenRTM_aist.split方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initConsumers

# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import split [as 别名]
  def initConsumers(self):
    self._rtcout.RTC_TRACE("initConsumers()")

    # create OuPort consumers
    factory = OpenRTM_aist.OutPortConsumerFactory.instance()
    consumer_types = factory.getIdentifiers()
    self._rtcout.RTC_DEBUG("available consumers: %s",
                           OpenRTM_aist.flatten(consumer_types))

    if self._properties.hasKey("consumer_types") and \
          OpenRTM_aist.normalize(self._properties.getProperty("consumer_types")) != "all":
      self._rtcout.RTC_DEBUG("allowed consumers: %s",
                             self._properties.getProperty("consumer_types"))

      temp_types = consumer_types
      consumer_types = []
      active_types = OpenRTM_aist.split(self._properties.getProperty("consumer_types"), ",")

      temp_types.sort()
      active_types.sort()

      set_ctypes = set(temp_types).intersection(set(active_types))
      consumer_types = consumer_types + list(set_ctypes)

    # OutPortConsumer supports "pull" dataflow type
    if len(consumer_types) > 0:
      self._rtcout.RTC_PARANOID("dataflow_type pull is supported")
      self.appendProperty("dataport.dataflow_type", "pull")
      self.appendProperty("dataport.interface_type",
                          OpenRTM_aist.flatten(consumer_types))

    self._consumerTypes = consumer_types
    return
开发者ID:thomas-moulard,项目名称:python-openrtm-aist-deb,代码行数:35,代码来源:InPortBase.py

示例2: initProviders

# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import split [as 别名]
  def initProviders(self):
    self._rtcout.RTC_TRACE("initProviders()")

    # create InPort providers
    factory = OpenRTM_aist.InPortProviderFactory.instance()
    provider_types = factory.getIdentifiers()

    self._rtcout.RTC_DEBUG("available providers: %s",
                           OpenRTM_aist.flatten(provider_types))

    if self._properties.hasKey("provider_types") and \
          OpenRTM_aist.normalize(self._properties.getProperty("provider_types")) != "all":
      self._rtcout.RTC_DEBUG("allowed providers: %s",
                             self._properties.getProperty("provider_types"))

      temp_types = provider_types
      provider_types = []
      active_types = OpenRTM_aist.split(self._properties.getProperty("provider_types"), ",")

      temp_types.sort()
      active_types.sort()

      set_ptypes = set(temp_types).intersection(set(active_types))
      provider_types = provider_types + list(set_ptypes)

    # InPortProvider supports "push" dataflow type
    if len(provider_types) > 0:
      self._rtcout.RTC_DEBUG("dataflow_type push is supported")
      self.appendProperty("dataport.dataflow_type", "push")
      self.appendProperty("dataport.interface_type",
                          OpenRTM_aist.flatten(provider_types))

    self._providerTypes = provider_types
    return
开发者ID:thomas-moulard,项目名称:python-openrtm-aist-deb,代码行数:36,代码来源:InPortBase.py

示例3: __call__

# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import split [as 别名]
  def __call__(self, info, cdrdata, data):
    endian = info.properties.getProperty("serializer.cdr.endian","little")
    if endian is not "little" and endian is not None:
      endian = OpenRTM_aist.split(endian, ",") # Maybe endian is ["little","big"]
      endian = OpenRTM_aist.normalize(endian) # Maybe self._endian is "little" or "big"

    if endian == "little":
      endian = True
    elif endian == "big":
      endian = False
    else:
      endian = True

    _data = cdrUnmarshal(any.to_any(data).typecode(), cdrdata, endian)
    return _data
开发者ID:thomas-moulard,项目名称:python-openrtm-aist-deb,代码行数:17,代码来源:ConnectorListener.py

示例4: __init__

# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import split [as 别名]
  def __init__(self, info, consumer, listeners, buffer = 0):
    OpenRTM_aist.OutPortConnector.__init__(self, info)

    self._buffer = buffer
    self._consumer = consumer
    self._listeners = listeners

    # publisher/buffer creation. This may throw std::bad_alloc;
    self._publisher = self.createPublisher(info)
    if not self._buffer:
      self._buffer = self.createBuffer(info)


    if not self._publisher or not self._buffer or not self._consumer:
      raise

    if self._publisher.init(info.properties) != self.PORT_OK:
      raise
        
    if self._profile.properties.hasKey("serializer"):
      endian = self._profile.properties.getProperty("serializer.cdr.endian")
      if not endian:
        self._rtcout.RTC_ERROR("write(): endian is not set.")
        raise
        
      endian = OpenRTM_aist.split(endian, ",") # Maybe endian is ["little","big"]
      endian = OpenRTM_aist.normalize(endian) # Maybe self._endian is "little" or "big"
      if endian == "little":
        self._endian = True
      elif endian == "big":
        self._endian = False
      else:
        self._endian = None

    else:
      self._endian = True # little endian

    self._buffer.init(info.properties.getNode("buffer"))
    self._consumer.init(info.properties)
    self._publisher.setConsumer(self._consumer)
    self._publisher.setBuffer(self._buffer)
    self._publisher.setListener(self._profile, self._listeners)

    self.onConnect()
    return
开发者ID:thomas-moulard,项目名称:python-openrtm-aist-deb,代码行数:47,代码来源:OutPortPushConnector.py

示例5: appendStringValue

# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import split [as 别名]
def appendStringValue(nv, name, value):
  index = find_index(nv, name)
  if index >= 0:
    tmp_str = nv[index].value.value()
    values = OpenRTM_aist.split(tmp_str,",")
    find_flag = False
    for val in values:
      if val == value:
        find_flag = True

    if not find_flag:
      tmp_str += ", "
      tmp_str += value
      nv[index].value = any.to_any(tmp_str)
  else:
    OpenRTM_aist.CORBA_SeqUtil.push_back(nv, newNV(name, value))

  return True
开发者ID:thomas-moulard,项目名称:python-openrtm-aist-deb,代码行数:20,代码来源:NVUtil.py

示例6: setConnectorInfo

# 需要导入模块: import OpenRTM_aist [as 别名]
# 或者: from OpenRTM_aist import split [as 别名]
  def setConnectorInfo(self, info):
    self._profile = info

    if self._profile.properties.hasKey("serializer"):
      endian = self._profile.properties.getProperty("serializer.cdr.endian")
      if not endian:
        self._rtcout.RTC_ERROR("InPortConnector.setConnectorInfo(): endian is not supported.")
        return RTC.RTC_ERROR
        
      endian = OpenRTM_aist.split(endian, ",") # Maybe endian is ["little","big"]
      endian = OpenRTM_aist.normalize(endian) # Maybe self._endian is "little" or "big"

      if endian == "little":
        self._endian = True
      elif endian == "big":
        self._endian = False
      else:
        self._endian = None
            
    else:
      self._endian = True # little endian

    return RTC.RTC_OK
开发者ID:yosuke,项目名称:OpenRTM-aist-Python,代码行数:25,代码来源:OutPortConnector.py


注:本文中的OpenRTM_aist.split方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。