eval scheme from index page

This commit is contained in:
Nicolò Balzarotti 2023-02-22 03:48:14 +01:00
parent 44e62713c2
commit 13e1ed9f34
2 changed files with 75 additions and 54 deletions

4
dist/server.js vendored
View File

@ -199,6 +199,10 @@ function respond_manual(response) {
manual_modal({'dismissed': true});
}
function eval_scheme(id) {
socket.emit('eval scheme', document.getElementById(id).value)
}
function select_recipe(idx) {
localstate.recipe = idx;
applyState();

View File

@ -5,61 +5,78 @@
{% endblock %}
{% block content %}
<div class="columns">
<div class="column">
<br/>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Sensors
</p>
</header>
<div class="card-content">
<div id="sensor-list"></div>
</div>
</div>
<br/>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Actuators
</p>
</header>
<div class="card-content">
<div id="actuator-list"></div>
</div>
</div>
<br/>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Sensors Data
</p>
</header>
<div class="card-content">
<div class="content">
<div class="field has-addons">
<button class="button is-link" onclick="toggle_update_plot()">Pause/Unpause Plot</button>
<div class="control">
<input class="input" type="number"/ value="1000" id="point-number" />
</div>
<div class="control">
<a class="button is-info" onclick="set_plot_points()">
Update #of points
</a>
</div>
</div>
<div id="data-plot"></div>
<br/>
</div>
</div>
</div>
<div class="column">
<br/>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Sensors
</p>
</header>
<div class="card-content">
<div id="sensor-list"></div>
</div>
</div>
<div class="column">
<br/>
<div id="current-recipe"></div>
<br/>
<div id="load-recipe"></div>
<br/>
<br/>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Actuators
</p>
</header>
<div class="card-content">
<div id="actuator-list"></div>
</div>
</div>
<br/>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Sensors Data
</p>
</header>
<div class="card-content">
<div class="content">
<div class="field has-addons">
<button class="button is-link" onclick="toggle_update_plot()">Pause/Unpause Plot</button>
<div class="control">
<input class="input" type="number"/ value="1000" id="point-number" />
</div>
<div class="control">
<a class="button is-info" onclick="set_plot_points()">
Update #of points
</a>
</div>
</div>
<div id="data-plot"></div>
<br/>
</div>
</div>
</div>
<div class="card">
<header class="card-header">
<p class="card-header-title">
Manual Control
</p>
</header>
<div class="card-content">
<div class="content">
<div class="field has-addons">
<textarea class="textarea" value="#t" id="scheme-eval"/></textarea>
<a class="button is-info" onclick="eval_scheme('scheme-eval')">
Eval
</a>
</div>
</div>
</div>
</div>
</div>
<div class="column">
<br/>
<div id="current-recipe"></div>
<br/>
<div id="load-recipe"></div>
<br/>
</div>
</div>
{% endblock %}