improve ultrasound plot clients

- make plot window not to raise to the front on replot
- chmod +x
This commit is contained in:
Ultrasound PC
2025-03-26 16:18:54 +01:00
parent 6f547f0781
commit f8e3bd9ad2
3 changed files with 52 additions and 12 deletions

10
bin/us-plot Normal file → Executable file
View File

@ -1,8 +1,13 @@
#!/usr/bin/env python3
import sys
from pathlib import Path
# Add import path for inplace usage
sys.path.insert(0, str(Path(__file__).absolute().parents[1]))
from frappy.client.interactive import Client
import numpy as np
import matplotlib.pyplot as plt
from frappy.iqplot import Pause
Client('pc13252:5000')
@ -40,7 +45,7 @@ else:
npoints = float(sys.argv[3])
fig, ax = plt.subplots(figsize=(15,3))
fig.canvas.mpl_connect('close_event', on_close)
pause = Pause(fig)
try:
get_signal = iq.get_signal
print('plotting RUS signal')
@ -52,8 +57,7 @@ else:
lines = [plot(s, ax, '-', xs) for s in signal]
while True:
plt.pause(0.5)
while pause(0.5):
plt.draw()
xs, signal = get_signal(start, end, npoints)
for line, sig in zip(lines, signal):