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


Python NetDatagram.appendData方法代码示例

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


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

示例1: eVV_VP_ACK_FAILED

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_VP_ACK_FAILED(ip, port):
    packet = SocketPacket()
    packet.add_int(VV_VP_ACK_FAILED)
    packet.add_string(ip)
    packet.add_int(port)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:12,代码来源:message_handler.py

示例2: SendPacket

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def SendPacket(rpc, addr):
    global pq
    chance = random.random()
    p = rpc.CreateNewPacket(addr)
    rpc.SendPacket(p, addr)
    nd = NetDatagram()
    nd.appendData(p.GetDatagram().getMessage())#, p.GetDatagram().getLength())
    nd.setAddress(NetAddress())
    if(chance < 0.8):
        pq.append(nd)
        return nd
开发者ID:czorn,项目名称:Modifire,代码行数:13,代码来源:TestReliablePacketController.py

示例3: eVV_ACK_OK

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_ACK_OK(ip, port, client_id):
    packet = SocketPacket()
    packet.add_int(VV_ACK_OK)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(client_id)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:13,代码来源:message_handler.py

示例4: eVV_READY

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_READY(ip, port, vv_id):
    packet = SocketPacket()
    packet.add_int(VV_READY)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(vv_id)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:13,代码来源:message_handler.py

示例5: eVV_REQ_SIGNATURE

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_REQ_SIGNATURE(ip, port, object_id):
    packet = SocketPacket()
    packet.add_int(VV_REQ_SIGNATURE)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(object_id)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:13,代码来源:message_handler.py

示例6: eVV_VP_ACK_OK

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_VP_ACK_OK(ip, port, cam_id):
    packet = SocketPacket()
    packet.add_int(VV_VP_ACK_OK)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(cam_id)  ## Added this
    packet.encode_header()

    datagram = NetDatagram()
    datagram.appendData("" + packet.get_header() + packet.get_body())
    return datagram
开发者ID:vclab,项目名称:virtual-vision-simulator,代码行数:13,代码来源:message_handler.py

示例7: eVV_CAM_MESSAGE

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_CAM_MESSAGE(ip, port, cam_id, message):
    packet = SocketPacket()
    packet.add_int(VV_CAM_MESSAGE)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(cam_id)
    packet.add_packet(message)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:14,代码来源:message_handler.py

示例8: eVV_CAM_LIST

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_CAM_LIST(ip, port, cam_list):
    packet = SocketPacket()
    packet.add_int(VV_CAM_LIST)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(len(cam_list))
    for cam in cam_list:
      packet.add_int(cam)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:15,代码来源:message_handler.py

示例9: eVV_REQ_VIDEO_ANALYSIS

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_REQ_VIDEO_ANALYSIS(ip, port, cam_id, width, height, jpeg):
    packet = SocketPacket()
    packet.add_int(VV_REQ_VIDEO_ANALYSIS)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(cam_id)
    packet.add_int(width)
    packet.add_int(height)
    packet.add_int(jpeg)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:16,代码来源:message_handler.py

示例10: eVV_TRACK_SIGNATURE

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_TRACK_SIGNATURE(ip, port, object_id, feature_str, sig):
    packet = SocketPacket()
    packet.add_int(VV_TRACK_SIGNATURE)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(object_id)
    packet.add_string(feature_str)
    packet.add_int(len(sig))
    for element in sig:
        packet.add_float(element)
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:17,代码来源:message_handler.py

示例11: eVV_IMG

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_IMG(ip, port, cam_id, width, height, depth, color_code, jpeg, timestamp, image_data):
    packet = SocketPacket()
    packet.add_int(VV_IMG)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(cam_id)
    packet.add_int(width)
    packet.add_int(height)
    packet.add_int(depth)
    packet.add_char(color_code)
    packet.add_bool(jpeg)
    packet.add_double(timestamp)
    packet.add_string(image_data)
    packet.encode_header()

    datagram = NetDatagram()
    datagram.appendData("" + packet.get_header() + packet.get_body())
    return datagram
开发者ID:vclab,项目名称:virtual-vision-simulator,代码行数:20,代码来源:message_handler.py

示例12: eVV_ADV_CAM_LIST

# 需要导入模块: from pandac.PandaModules import NetDatagram [as 别名]
# 或者: from pandac.PandaModules.NetDatagram import appendData [as 别名]
def eVV_ADV_CAM_LIST(ip, port, cam_list):
    packet = SocketPacket()
    packet.add_int(VV_ADV_CAM_LIST)
    packet.add_string(ip)
    packet.add_int(port)
    packet.add_int(len(cam_list))
    for camera in cam_list:
        id = camera.getId()
        type = camera.getType()
        position = camera.getPosition()
        direction = camera.getDirection()
        packet.add_int(id)
        packet.add_int(type)
        packet.add_float(position[0])
        packet.add_float(position[1])
        packet.add_float(position[2])
        packet.add_float(direction[0])
        packet.add_float(direction[1])
        packet.add_float(direction[2])
    packet.encode_header()
    
    datagram = NetDatagram()
    datagram.appendData('' + packet.get_header() + packet.get_body())
    return datagram
开发者ID:shubhamgoyal,项目名称:virtual-vision-simulator,代码行数:26,代码来源:message_handler.py


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