本文整理汇总了Python中gnuradio.gr.sync_block方法的典型用法代码示例。如果您正苦于以下问题:Python gr.sync_block方法的具体用法?Python gr.sync_block怎么用?Python gr.sync_block使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnuradio.gr
的用法示例。
在下文中一共展示了gr.sync_block方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self, connection_string,baud_rate=57600):
gr.sync_block.__init__(self,
name="pymavlink_source_sink_pp",
in_sig=None,
out_sig=None)
self.connection_string=connection_string
self.baud_rate=baud_rate
#self.message_port_register_in(pmt.intern("command"))
#self.set_msg_handler(pmt.intern("command"), self.cmd_handler)
self.message_port_register_in(pmt.intern("MAVLink_IN"))
self.message_port_register_out(pmt.intern("MAVLink_OUT"))
self.mavlink_connection = mavutil.mavlink_connection(connection_string,baud=baud_rate)
self.set_msg_handler(pmt.intern("MAVLink_IN"), self.mavlink_handler)
print (self.mavlink_connection)
self.running=True
#print self.mavlink_connection
self.thread = threading.Thread(target=self.check_for_message)
self.thread.daemon = True
self.thread.start()
示例2: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self, connection_string, baud_rate=57600):
gr.sync_block.__init__(self,
name="pymavlink_source_p",
in_sig=None,
out_sig=None)
self.connection_string=connection_string
self.baud_rate=baud_rate
#self.message_port_register_in(pmt.intern("command"))
#self.set_msg_handler(pmt.intern("command"), self.cmd_handler)
self.message_port_register_out(pmt.intern("MAVLink"))
self.mavlink_connection = mavutil.mavlink_connection(connection_string,baud=baud_rate)
print (self.mavlink_connection)
self.running=True
#print self.mavlink_connection
self.thread = threading.Thread(target=self.check_for_message)
self.thread.daemon = True
self.thread.start()
示例3: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self, example_param=1.0): # only default arguments here
self.fixed_index = None
self.last_index = None
self.done = False
"""arguments to this function show up as parameters in GRC"""
gr.sync_block.__init__(
self,
name='keep m in n', # will show up in GRC
in_sig=[(np.complex64,320),np.float32],
out_sig=[(np.complex64,256),np.float32]
)
# if an attribute with the same name as a parameter is found,
# a callback is registered (properties work, too).
self.example_param = example_param
示例4: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self): # only default arguments here
"""arguments to this function show up as parameters in GRC"""
gr.sync_block.__init__(
self,
name='convert to message', # will show up in GRC
in_sig=[np.float32],
out_sig=[np.float32]
# out_sig=[]
)
# if an attribute with the same name as a parameter is found,
# a callback is registered (properties work, too).
self.message_port_register_out(pmt.to_pmt("out"))
示例5: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self): # only default arguments here
"""arguments to this function show up as parameters in GRC"""
gr.sync_block.__init__(
self,
name='convert to message 2', # will show up in GRC
in_sig=[np.float32],
out_sig=[np.float32]
# out_sig=[]
)
# if an attribute with the same name as a parameter is found,
# a callback is registered (properties work, too).
self.message_port_register_out(pmt.to_pmt("out"))
示例6: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self): # only default arguments here
"""arguments to this function show up as parameters in GRC"""
gr.sync_block.__init__(
self,
name='find corr', # will show up in GRC
in_sig=[(np.float32,320), (np.float32,320)],
out_sig=[np.float32,np.float32]
)
# if an attribute with the same name as a parameter is found,
# a callback is registered (properties work, too).
self.message_port_register_out(pmt.to_pmt("out"))
示例7: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self):
gr.sync_block.__init__(self,
name="capture_cc",
#in_sig=[<+numpy.float+>],
in_sig=[numpy.complex64, numpy.float32],
out_sig=None)
示例8: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self, connection_string,baud_rate=57600):
gr.sync_block.__init__(self,
name="pymavlink_sink_p",
in_sig=None,
out_sig=None)
self.connection_string=connection_string
self.baud_rate=baud_rate
#self.message_port_register_in(pmt.intern("command"))
#self.set_msg_handler(pmt.intern("command"), self.cmd_handler)
self.message_port_register_in(pmt.intern("MAVLink"))
self.mavlink_connection = mavutil.mavlink_connection(connection_string,baud=baud_rate)
self.set_msg_handler(pmt.intern("MAVLink"), self.mavlink_handler)
print (self.mavlink_connection)
# we will use a fifo as an encode/decode buffer
示例9: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self):
gr.sync_block.__init__(self,
name="burst_verification",
in_sig=None,
out_sig=None)
self.message_port_register_in(pmt.intern("PDU_IN"))
self.message_port_register_out(pmt.intern("Control_OUT"))
self.data=[0]*8
self.set_msg_handler(pmt.intern("PDU_IN"), self.pdu_handler)
示例10: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self):
gr.sync_block.__init__(self,
name="pdu_control_to_pdu_vector",
in_sig=None,
out_sig=None)
self.message_port_register_in(pmt.intern("Control_IN"))
self.message_port_register_out(pmt.intern("Vector_OUT"))
self.data=[0]*9
self.set_msg_handler(pmt.intern("Control_IN"), self.control_handler)
示例11: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self):
gr.sync_block.__init__(self,
name="pdu_vector_to_pdu_control",
in_sig=None,
out_sig=None)
self.message_port_register_in(pmt.intern("Vector_IN"))
self.message_port_register_out(pmt.intern("Control_OUT"))
self.data=[0]*8
self.set_msg_handler(pmt.intern("Vector_IN"), self.vector_handler)
示例12: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self, ):
gr.sync_block.__init__(self, name="Doorbell Framer", in_sig=[numpy.float32], out_sig=None)
self.last_state = 0
self.last_change = 0
self.bits = []
示例13: __init__
# 需要导入模块: from gnuradio import gr [as 别名]
# 或者: from gnuradio.gr import sync_block [as 别名]
def __init__(self,main,sz):
self.main = main
self.sz = sz
gr.sync_block.__init__(
self,
name = "My Vector sink",
in_sig = [(np.float32,self.sz)],
out_sig = None,
)
# event-related
self.drawgr = DrawGraphics()
self.drawgr.draw.connect(self.main.draw_fft_disp)