Commit b2d3e9f8 authored by Daniel Brown's avatar Daniel Brown

Update to work with pipe streaming output data

parent 350dcb82
This diff is collapsed.
......@@ -4,6 +4,8 @@ import struct
import pykat.exceptions as pkex
import os
from struct import calcsize as cs
def open_pipes(pipe_name, start_kat, duration):
fifo_r = None
fifo_w = None
......@@ -57,6 +59,16 @@ def send_do_step(fifo_w):
fifo_w.write(struct.pack('b', 0))
fifo_w.flush()
def send_do_axis(fifo_w, idx, _from, to, N):
if fifo_w is not None:
fifo_w.write(("<do_axis>").encode())
fifo_w.write(struct.pack('b', cs('i') + cs('d') + cs('d') + cs('i')))
fifo_w.write(struct.pack('i', idx))
fifo_w.write(struct.pack('d', _from))
fifo_w.write(struct.pack('d', to))
fifo_w.write(struct.pack('I', N))
fifo_w.flush()
def send_update(fifo_w, idx, value):
if fifo_w is not None:
bdata = struct.pack('id', idx, value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment