Skip to content

Commit

Permalink
Add write_samples and description control from waterfall UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
anarkiwi committed Jul 10, 2024
1 parent 478b466 commit ab406c9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pybind11-dev \
python3-numpy
WORKDIR /root
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.110
RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.111
COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs
WORKDIR /root/gr-iqtlabs/build
COPY --from=iqtlabs/gamutrf-sigmf:latest /usr/local /usr/local
Expand Down
1 change: 1 addition & 0 deletions gamutrf/grscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def __init__(
sigmf,
zstd=True,
rotate=False,
description=description,
),
]
)
Expand Down
2 changes: 1 addition & 1 deletion gamutrfwaterfall/gamutrfwaterfall/flask_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def config_form(self):
reset = request.form.get("reset", None)
if reset == "reset":
reconf_query_str = "&".join(
[f"{k}={v}" for k, v in self.config_vars.items()]
[f"{k}=\"{v}\"" for k, v in self.config_vars.items()]
)
logging.info(f"\n\n{reconf_query_str=}\n\n")
try:
Expand Down
56 changes: 30 additions & 26 deletions gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
{% extends "base.html" %}
{% block body %}
<div class="content_container">
<img id="waterfall" src="" />
<div class="scanner_args_form">
<form action = "{{ url_for('config_form') }}" method = "post">
<p>Freq start:</p>
<p><input type="number" step="1" pattern="\d+" name="freq_start" value="{{ config_vars['freq_start']|int }}"/></p>
<p>Freq end:</p>
<p><input type="number" step="1" pattern="\d+" name="freq_end" value="{{ config_vars['freq_end']|int }}"/></p>
<p>Gain:</p>
<p><input type="number" step="1" pattern="\d+" name="igain" value="{{ config_vars['igain']|int }}"/></p>
<p>Tune overlap:</p>
<p><input type = "text" name="tuneoverlap" value="{{ config_vars['tuneoverlap'] }}"/></p>
<p>Tune step (# of FFTs):</p>
<p><input type="number" step="1" pattern="\d+" name="tune_step_fft" value="{{ config_vars['tune_step_fft']|int }}"/></p>
<p>Sweep seconds:</p>
<p><input type="number" step="1" pattern="\d+" name="sweep_sec" value="{{ config_vars['sweep_sec']|int }}"/></p>
<img id="waterfall" src="" />
<div class="scanner_args_form">
<form action = "{{ url_for('config_form') }}" method = "post">
<p>Freq start:</p>
<p><input type="number" step="1" pattern="\d+" name="freq_start" value="{{ config_vars['freq_start']|int }}"/></p>
<p>Freq end:</p>
<p><input type="number" step="1" pattern="\d+" name="freq_end" value="{{ config_vars['freq_end']|int }}"/></p>
<p>Gain:</p>
<p><input type="number" step="1" pattern="\d+" name="igain" value="{{ config_vars['igain']|int }}"/></p>
<p>Tune overlap:</p>
<p><input type = "text" name="tuneoverlap" value="{{ config_vars['tuneoverlap'] }}"/></p>
<p>Tune step (# of FFTs):</p>
<p><input type="number" step="1" pattern="\d+" name="tune_step_fft" value="{{ config_vars['tune_step_fft']|int }}"/></p>
<p>Sweep seconds:</p>
<p><input type="number" step="1" pattern="\d+" name="sweep_sec" value="{{ config_vars['sweep_sec']|int }}"/></p>
<p>Write samples:</p>
<p><input type="number" step="1" pattern="\d+" name="write_samples" value="{{ config_vars['write_samples']|int }}"/></p>
<p>SigMF description:</p>
<p><input type="number" step="1" pattern=".+" name="description" value="{{ config_vars['description'] }}"/></p>

<p><button name="reset" type="submit" value="reset">Reset</button></p>
</form>
</div>
<p><button name="reset" type="submit" value="reset">Reset</button></p>
</form>
</div>
</div>
{% endblock body %}
{% block script %}
<script>
document.getElementById("waterfall_link").className += " active";
$(document).ready(function(){
setInterval(refreshFunction, 1000);
});
document.getElementById("waterfall_link").className += " active";
$(document).ready(function(){
setInterval(refreshFunction, 1000);
});

function refreshFunction(){
function refreshFunction(){

d = new Date();
$("#waterfall").attr("src", "{{ url_for('serve_waterfall_img') }}?"+d.getTime());
d = new Date();
$("#waterfall").attr("src", "{{ url_for('serve_waterfall_img') }}?"+d.getTime());

}
}
</script>
{% endblock script %}

0 comments on commit ab406c9

Please sign in to comment.