當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。