Closed ancebfer closed 11 months ago
Thank you for the good idea and your contribution. I would appreciate if you modify the code a little, and re-request the merge request.
Your code
if pipe_in:
fig.canvas.manager.set_window_title('Standard input')
elif tcp_socket:
fig.canvas.manager.set_window_title(ser.port)
else:
fig.canvas.manager.set_window_title('tcp://localhost:'+str(tcp_socket))
Suggested code
if stdin_pipe:
fig.canvas.manager.set_window_title('Standard input')
elif tcp_socket:
fig.canvas.manager.set_window_title('tcp://localhost:'+str(tcp_socket))
else:
fig.canvas.manager.set_window_title(ser.port)
Fixed.
Thank you Antonio for the fix. Please don't mistake me. The reason I asked you to modify is to merge your work under your name so your contribution is well kept.
And the request is to fix the stdin_pipe
and also the elif tcp_socket:
clause. When you see the original code, that line is if not tcp_socket
so it should look like this.
if stdin_pipe:
fig.canvas.manager.set_window_title('Standard input')
elif tcp_socket:
fig.canvas.manager.set_window_title('tcp://localhost:'+str(tcp_socket))
else:
fig.canvas.manager.set_window_title(ser.port)
So I'll merge your code and modify those lines.
Thank you again for your contribution.
Adds standard input pipe command line argument.
For example, 1 Hz sine/cosine wave generator with 10 ms sample period (waves.py):
Can be plotted in real time with:
./waves.py | arduplot -n -w 500 -e 10
Also data samples can be logged simultaeously:
./waves.py | tee waves.log | arduplot -n -w 500 -e 10