def usertick_sg(): model = DeviceModel() log = SensorLog(model=model) sg = SensorGraph(log, model=model) sg.add_node('(system input 3 always) => counter 1 using copy_latest_a') sg.add_config(SlotIdentifier.FromString('controller'), config_fast_tick_secs, 'uint32_t', 2) return sg
def test_usertick(): """Make sure we properly can set the user tick input.""" model = DeviceModel() log = SensorLog(model=model) sg = SensorGraph(log, model=model) assert sg.get_tick('fast') == 0 sg.add_config(SlotIdentifier.FromString('controller'), config_fast_tick_secs, 'uint32_t', 1) assert sg.get_tick('fast') == 1
def tick2_sg(): """A sensorgrah that listens to tick1.""" model = DeviceModel() log = SensorLog(model=model) sg = SensorGraph(log, model=model) sg.add_node('(system input 6 always) => counter 1 using copy_latest_a') sg.add_config(SlotIdentifier.FromString('controller'), config_tick2_secs, 'uint32_t', 2) return sg