示例#1
0
def main():
    raw_data = InputLayer(gen_dummy_data, rate=20, name="dummy input")
    buffer = BufferLayer(raw_data, buffer_size=10)
    offset = OffsetLayer(MeanLayer(buffer), offset=25)
    plotter = CirclePlotter(offset)
    offset.set_signal_in(plotter.get_port('click'))
    LayerManager.run()
示例#2
0
def main():

    concat = MergeLayer(None,
                        trigger=LayerTrigger.LAYER,
                        trigger_source='in2',
                        discard_old=False)
    concat.set_input(DummyInputLayer(rate=.5), 'in1')
    concat.set_input(DummyInputLayer(rate=2), 'in2')
    PrintLayer(concat)

    LayerManager.run()
示例#3
0
def main():

    # Send out frame count, print response
    reader, writer = make_udp_layers(local_port=56789, remote_port=56788)
    PrintLayer(reader, label="reader: ")
    writer.set_input(InputLayer())

    # Loopback layer
    reader2, writer2 = make_udp_layers(local_port=56788, remote_port=56789)
    writer2.set_input(TransformLayer(reader2, lambda x: int(x)*2))

    LayerManager.run()
示例#4
0
def main():
    raw_data = InputLayer(gen_dummy_data, rate=50, name="dummy input")
    decode_layer = DecodeLayer(raw_data, decoder=decode)
    buffer = BufferLayer(decode_layer.get_port('x1'))
    # buffer2 = BufferLayer(decode_layer.get_port('x2'))

    fig_manager = FigureManager(create_fig=create_fig)
    SimplePlotLayer(buffer,
                    plot_key='x1',
                    plot_config=plot_config,
                    fig_manager=fig_manager)
    # SimplePlotLayer(buffer2, plot_key='x2', plot_config=plot_config, fig_manager=fig_manager)
    BarPlotLayer(decode_layer.get_port('x2'),
                 plot_key='x2',
                 plot_config=plot_config,
                 fig_manager=fig_manager)
    LayerManager.run()
示例#5
0
def main():
    input_layer = InputLayer(gen_dummy_data, rate=30, name="dummy input")
    split_layer = DecodeLayer(input_layer, decoder=decoder, name="decoder")
    buffer_1 = BufferLayer(split_layer.get_port('x1'),
                           buffer_size=100,
                           name="buffer1")
    buffer_2 = BufferLayer(split_layer.get_port('x2'),
                           buffer_size=100,
                           name="buffer2")
    fig_manager = FigureManager(create_fig=create_fig)
    SimplePlotLayer(buffer_1,
                    plot_key='x1',
                    plot_config=plot_config,
                    fig_manager=fig_manager)
    SimplePlotLayer(buffer_2,
                    plot_key='x2',
                    plot_config=plot_config,
                    fig_manager=fig_manager)
    LayerManager.run()
示例#6
0
文件: stop.py 项目: Zuko09/pyrealtime
def main():
    serial_layer = InputLayer(gen_dummy_data, name="dummy input")
    buffer = BufferLayer(serial_layer, buffer_size=10, name="buffer")
    PrintLayer(buffer)
    SimplePlotLayer(buffer, ylim=(0, 1000))
    LayerManager.run()
示例#7
0
def main():
    raw_data = InputLayer(gen_dummy_data, rate=5, name="dummy input")
    TextPlotLayer(raw_data)
    LayerManager.run()
示例#8
0
文件: udp.py 项目: Zuko09/pyrealtime
def main():
    raw_data = UDPReadLayer(name="input")
    buffer = BufferLayer(raw_data, buffer_size=5, name="buffer")
    SimplePlotLayer(buffer, plot_config=plot_config)
    LayerManager.run()
示例#9
0
def main():
    # serial_layer = InputLayer(gen_dummy_data, rate=30, name="dummy input")
    serial_layer = SerialReadLayer(device_name='KitProg', baud_rate=115200)
    buffer = BufferLayer(serial_layer, buffer_size=100, name="buffer")
    SimplePlotLayer(buffer, ylim=(0, 100))
    LayerManager.run()