aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/gui.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.py')
-rwxr-xr-xsrc/gui/gui.py37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/gui/gui.py b/src/gui/gui.py
index 5d86de1..7e2357b 100755
--- a/src/gui/gui.py
+++ b/src/gui/gui.py
@@ -45,13 +45,13 @@ show_debug()
time_plot = net.network_plot(url="udp://localhost:31415", dtype=float, \
nsamples=500, tag="time_plot", label="Time plot")
channel_plot = net.network_constellation_plot(url="udp://localhost:31416", \
- nsamples=200, tag="channel_plot", label="Channel")
+ nsamples=512, tag="channel_plot", label="Channel")
synchronized_plot = net.network_constellation_plot(url="udp://localhost:31417", \
- nsamples=200, tag="synchronized_plot", label="Synchronized")
+ nsamples=512, tag="synchronized_plot", label="Synchronized")
equalized_plot = net.network_constellation_plot(url="udp://localhost:31418", \
- nsamples=200, tag="equalized_plot", label="Equalized")
+ nsamples=512, tag="equalized_plot", label="Equalized")
locked_plot = net.network_constellation_plot(url="udp://localhost:31419", \
- nsamples=200, tag="locked_plot", label="Locked")
+ nsamples=512, tag="locked_plot", label="Locked")
constellation_plots = [channel_plot, synchronized_plot, equalized_plot, locked_plot]
network_plots = [time_plot] + constellation_plots
@@ -88,11 +88,11 @@ plots_locked = True
# Set up theme and looks
# Font
-# with font_registry():
-# # first argument ids the path to the .ttf or .otf file
-# default_font = add_font("NotoSerifCJKjp-Medium.otf", 20)
-# second_font = add_font("NotoSerifCJKjp-Medium.otf", 10)
-# test = add_font("NotoSerifCJKjp-Medium.otf", 30)
+with font_registry():
+ # first argument ids the path to the .ttf or .otf file
+ default_font = add_font("res/ttf/Hack-Regular.ttf", 20)
+ # second_font = add_font("NotoSerifCJKjp-Medium.otf", 10)
+ # test = add_font("NotoSerifCJKjp-Medium.otf", 30)
# Constellation diagrams
with theme(tag="constellation_series_theme"):
@@ -113,7 +113,7 @@ def exit(sender, data):
with window(tag="primary_window"):
# Grössere Schrifftart/ Grösse für das ganze Dokument definiert
- # bind_font(default_font)
+ bind_font(default_font)
with menu_bar():
with menu(label="Settings"):
@@ -195,7 +195,7 @@ with window(label="RX DSP Flow Graph", width=800, height=400, pos=(0,25), tag="r
# Network plots
def make_constellation_plot_window(plot, label):
- with window(label=label, no_collapse=True,
+ with window(label=label, no_collapse=True, no_close=True, \
width=plot_window_sizes[plot][0], \
height=plot_window_sizes[plot][1], \
pos=plot_window_positions[plot], \
@@ -249,12 +249,18 @@ with window(label="Bit Error Rate ", width=300, height=150, pos=(200,875)) as be
add_theme_color(mvThemeCol_Text,(0,0,0)) #Schwarz
add_theme_style(mvStyleVar_FrameRounding, 5)
- add_button(label="BER", height=60, width=150,pos=(75,60))
- bind_item_theme(last_item(),"button_ber")
+ add_button(label="BER", height=60, width=-1, tag="ber_value")
+ bind_item_theme(last_item(), "button_ber")
# bind_item_theme(ber_window, "ber_window")
# bind_item_font(ber_window, test)
+def set_ber(values):
+ ber_curr, ber_max, ber_avg = values
+ configure_item("ber_value", label=f"Current: {ber_curr}, Max: {ber_max}, Avg: {ber_avg}")
+
+ber_value = net.network_value(url="udp://localhost:31420", dtype=float, refresh_func=set_ber)
+
#================================================
# Picture Window
@@ -278,8 +284,9 @@ set_primary_window("primary_window", True)
# Main loop
while is_dearpygui_running():
- for plt in network_plots:
- plt.refresh_series(plt.series_tag)
+ for plt, tag in network_plots.items():
+ plt.refresh_series(tag)
+ ber_value.refresh()
render_dearpygui_frame()