diff options
author | Carl Laufer <Kraken.rf.inc@gmail.com> | 2022-01-04 09:12:30 +0100 |
---|---|---|
committer | Carl Laufer <Kraken.rf.inc@gmail.com> | 2022-01-04 09:12:30 +0100 |
commit | 7e7c2f779917cc183fd4883c69f97c3a2cc728fe (patch) | |
tree | 5a372e40ef62b3a8be70324270fad34fd368d6e6 | |
parent | tidy signal processor (diff) | |
download | krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.tar krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.tar.gz krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.tar.bz2 krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.tar.lz krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.tar.xz krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.tar.zst krakensdr_pr-7e7c2f779917cc183fd4883c69f97c3a2cc728fe.zip |
-rwxr-xr-x | _UI/_web_interface/kraken_web_interface.py | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/_UI/_web_interface/kraken_web_interface.py b/_UI/_web_interface/kraken_web_interface.py index 9274ea6..0cab81f 100755 --- a/_UI/_web_interface/kraken_web_interface.py +++ b/_UI/_web_interface/kraken_web_interface.py @@ -1032,7 +1032,7 @@ def generate_pr_page_layout(webInterface_inst): #dcc.Graph(id='doa-graph-test', figure=doa_fig),
dcc.Store(id='pr-store', data=[]),
dcc.Graph(
- style={"height": "inherit"},
+ style={"height": "inherit", "width" : "50%"},
id="pr-graph",
figure=pr_fig, #fig_dummy #doa_fig #fig_dummy
)], className="monitor_card"),
@@ -1448,40 +1448,25 @@ def plot_pr(): })
-# DOA Graph Clientside Callback
#app.clientside_callback(
# """
-# function (data, graph_type) {
+# function (data) {
+# /*return [{x: data.map(i => i.x), y: data.map(i => i.y)}, [...Array(data.length).keys()], data[0].x.length]*/
+#
+# /*const every_nth = (arr, nth) => arr.filter((e, i) => i % nth === (nth | 0) - 1);*/
+#
# return [
-# [{z: [data]}, [0], data.length]
+# [{x: data.map(i => i.x), y: data.map(i => i.y)}, [...Array(data.length).keys()], data[0].x.length],
+# /*[{z: [[every_nth(data[0].y, 1)]]}, [0], 50]*/
+# [{z: [[data[0].y]]}, [0], 50]
# ]
-#
# }
# """,
-# [Output('pr-graph', 'extendData')],
-# [Input('pr-store', 'data')]
+# [Output('spectrum-graph', 'extendData'),
+# Output('waterfall-graph', 'extendData')],
+# [Input('spectrum-store', 'data')]
#)
-
-app.clientside_callback(
- """
- function (data) {
- /*return [{x: data.map(i => i.x), y: data.map(i => i.y)}, [...Array(data.length).keys()], data[0].x.length]*/
-
- /*const every_nth = (arr, nth) => arr.filter((e, i) => i % nth === (nth | 0) - 1);*/
-
- return [
- [{x: data.map(i => i.x), y: data.map(i => i.y)}, [...Array(data.length).keys()], data[0].x.length],
- /*[{z: [[every_nth(data[0].y, 1)]]}, [0], 50]*/
- [{z: [[data[0].y]]}, [0], 50]
- ]
- }
- """,
- [Output('spectrum-graph', 'extendData'),
- Output('waterfall-graph', 'extendData')],
- [Input('spectrum-store', 'data')]
-)
-
def plot_spectrum():
global spectrum_fig
global waterfall_fig
@@ -1542,11 +1527,21 @@ def plot_spectrum(): else:
update_data = []
for m in range(1, np.size(webInterface_inst.spectrum, 0)): #webInterface_inst.module_receiver.M+1):
- #update_data.append(dict(x=webInterface_inst.spectrum[0,:], y=webInterface_inst.spectrum[m, :]))
update_data.append(dict(x=webInterface_inst.spectrum[0,:] + webInterface_inst.daq_center_freq*10**6, y=webInterface_inst.spectrum[m, :]))
+ x_app = []
+ y_app = []
+ for m in range(1, np.size(webInterface_inst.spectrum, 0)): #webInterface_inst.module_receiver.M+1):
+ x_app.append(webInterface_inst.spectrum[0,:] + webInterface_inst.daq_center_freq*10**6)
+ y_app.append(webInterface_inst.spectrum[m, :])
+
+ update_data = dict(x=x_app, y=y_app)
+
app.push_mods({
- 'spectrum-store': {'data': update_data}
+ 'spectrum-graph': {'extendData': [update_data, [0, 1, 2], len(webInterface_inst.spectrum[0,:])]},
+ 'waterfall-graph': {'extendData': [dict(z =[[webInterface_inst.spectrum[1, :]]]), [0], 50]}
+
+# 'spectrum-store': {'data': update_data}
#'spectrum-graph': {'extendData': spec},
#'waterfall-graph': {'extendData': waterfall}
})
|