aboutsummaryrefslogtreecommitdiffstats
path: root/src/sketch.py
diff options
context:
space:
mode:
authorsara <sara.halter@gmx.ch>2021-11-06 20:11:11 +0100
committersara <sara.halter@gmx.ch>2021-11-06 20:11:11 +0100
commit9194b5e9e4d7b72bf08d01c0fde6ff78be36215e (patch)
tree0e5bcd30ed089c0674166cbcb995ca955e7ee88b /src/sketch.py
parentAn scr gearbeitet (diff)
downloadFading-9194b5e9e4d7b72bf08d01c0fde6ff78be36215e.tar.gz
Fading-9194b5e9e4d7b72bf08d01c0fde6ff78be36215e.zip
An graphischer Darstellung weitergearbeitet
Diffstat (limited to '')
-rwxr-xr-xsrc/sketch.py64
1 files changed, 53 insertions, 11 deletions
diff --git a/src/sketch.py b/src/sketch.py
index 49efd5e..a0cfa51 100755
--- a/src/sketch.py
+++ b/src/sketch.py
@@ -5,6 +5,8 @@ from dearpygui.demo import show_demo
import qpks as qp
+from math import sin #für test Sijnal
+
# Create GL context and initialize DearPyGUI
create_context()
create_viewport()
@@ -77,26 +79,39 @@ with window(label="Example Window"):
q = qp.qpsk_nogui() # Klasse initalisieren !!!
-with window(label="QPSK", width=800, height=800, on_close=_on_params_close, pos=(100,100), tag="rx_win"):
+with window(label="QPSK", width=1500, height=800, on_close=_on_params_close, pos=(100,100), tag="rx_win"):
with node_editor(callback=_on_rx_node_link, delink_callback=_on_rx_node_delink):
- with node(label="USRP Source (Random Source)", pos=(20,100)):
+ with node(label="USRP Source ", pos=(20,100)):
with node_attribute(tag="src_out", attribute_type=mvNode_Attr_Output):
- add_text("Signal from antenna")
+ add_text("Signal Source Random")
print(q.analog_random_source_x_0)
- add_text(q.analog_random_source_x_0)
- add_text(qp.test)
- add_text(q.test_2(1))
+ # TO DO: Signal Plot
+
+ with node(label="Constellation Modulator", pos=(200,200)):
+ with node_attribute(tag="modul_in", attribute_type=mvNode_Attr_Input):
+ add_text("Input")
+ add_text(f'Sample {q.sps}')
+ with node_attribute(tag="modul_out", attribute_type=mvNode_Attr_Output):
+ add_text("Output")
+
+ with node(label="Channel Model", pos=(420,100)):
+ with node_attribute(tag="channel_in", attribute_type=mvNode_Attr_Input):
+ add_text("Input")
- with node(label="Clock Sync", pos=(200,200)):
+ with node_attribute(tag="channel_out", attribute_type=mvNode_Attr_Output):
+ add_text("Output")
+
+ with node(label="Clock Sync", pos=(550,200)):
with node_attribute(tag="clksync_in", attribute_type=mvNode_Attr_Input):
add_text("Input")
with node_attribute(tag="clksync_out", attribute_type=mvNode_Attr_Output):
add_text("Synchronized")
- with node(label="Equalizer", pos=(350,100)):
+
+ with node(label="Equalizer", pos=(700,100)):
with node_attribute(attribute_type=mvNode_Attr_Static):
add_input_float(label="Gain", width=150)
@@ -106,7 +121,8 @@ with window(label="QPSK", width=800, height=800, on_close=_on_params_close, pos=
with node_attribute(tag="eq_out", attribute_type=mvNode_Attr_Output):
add_text("Equalized")
- with node(label="Phase Locked Loop", pos=(600, 200)):
+
+ with node(label="Phase Locked Loop", pos=(950, 200)):
with node_attribute(tag="pll_in", attribute_type=mvNode_Attr_Input):
add_text("Input")
@@ -114,15 +130,41 @@ with window(label="QPSK", width=800, height=800, on_close=_on_params_close, pos=
add_text("Locked")
- add_node_link(get_alias_id("src_out"), get_alias_id("clksync_in"))
+ add_node_link(get_alias_id("src_out"), get_alias_id("modul_in"))
+ add_node_link(get_alias_id("modul_out"), get_alias_id("channel_in"))
+ add_node_link(get_alias_id("channel_out"), get_alias_id("clksync_in"))
add_node_link(get_alias_id("clksync_out"), get_alias_id("eq_in"))
add_node_link(get_alias_id("eq_out"), get_alias_id("pll_in"))
+
+
#================================================
-# Plot Window
+# Plot Time Window Test
+
+# creating data
+sindatax = []
+sindatay = []
+for i in range(0, 500):
+ sindatax.append(i / 1000)
+ sindatay.append(0.5 + 0.5 * sin(50 * i / 1000))
+
with window(label="Plots"):
add_text("Hello world")
+ # create plot
+ with plot(label="Line Series", height=400, width=400):
+ # optionally create legend
+ add_plot_legend()
+
+ # REQUIRED: create x and y axes
+ add_plot_axis(mvXAxis, label="x")
+ add_plot_axis(mvYAxis, label="y", tag="y_axis")
+
+ # series belong to a y axis
+ add_line_series(sindatax, sindatay, label="0.5 + 0.5 * sin(x)", parent="y_axis")
#================================================
+
+
+
# Start window and main loop