Skip to content
Snippets Groups Projects
Commit cf610ef8 authored by adam-abed-abud's avatar adam-abed-abud
Browse files

UI improvements

parent 8a635460
No related branches found
No related tags found
No related merge requests found
......@@ -76,8 +76,7 @@ def monitoring(source_address):
data_receiver = hevclient.get_values()
data_alarms = hevclient.get_alarms()
if data_receiver != None:
# data alarms can have length of 6, joining all the strings
......
No preview for this file type
No preview for this file type
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="user-md" class="svg-inline--fa fa-user-md fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zM104 424c0 13.3 10.7 24 24 24s24-10.7 24-24-10.7-24-24-24-24 10.7-24 24zm216-135.4v49c36.5 7.4 64 39.8 64 78.4v41.7c0 7.6-5.4 14.2-12.9 15.7l-32.2 6.4c-4.3.9-8.5-1.9-9.4-6.3l-3.1-15.7c-.9-4.3 1.9-8.6 6.3-9.4l19.3-3.9V416c0-62.8-96-65.1-96 1.9v26.7l19.3 3.9c4.3.9 7.1 5.1 6.3 9.4l-3.1 15.7c-.9 4.3-5.1 7.1-9.4 6.3l-31.2-4.2c-7.9-1.1-13.8-7.8-13.8-15.9V416c0-38.6 27.5-70.9 64-78.4v-45.2c-2.2.7-4.4 1.1-6.6 1.9-18 6.3-37.3 9.8-57.4 9.8s-39.4-3.5-57.4-9.8c-7.4-2.6-14.9-4.2-22.6-5.2v81.6c23.1 6.9 40 28.1 40 53.4 0 30.9-25.1 56-56 56s-56-25.1-56-56c0-25.3 16.9-46.5 40-53.4v-80.4C48.5 301 0 355.8 0 422.4v44.8C0 491.9 20.1 512 44.8 512h358.4c24.7 0 44.8-20.1 44.8-44.8v-44.8c0-72-56.8-130.3-128-133.8z"></path></svg>
\ No newline at end of file
......@@ -23,6 +23,7 @@ function last_results() {
var seconds = date.getSeconds();
// terrible hack to show the time in reverse order
initial_xaxis.push(-i);
//initial_xaxis.push(data[i]["timestamp"]);
initial_yaxis_pressure.push(data[i]["pressure_buffer"]);
initial_yaxis_volume.push(data[i]["pressure_inhale"]);
initial_yaxis_flow.push(data[i]["temperature_buffer"]);
......@@ -71,6 +72,7 @@ function requestChartVar() {
// add the point
chart_pressure.data.labels.push(0);
//chart_pressure.data.labels.push(point["timestamp"]);
chart_pressure.data.datasets[0].data.push(point["pressure_buffer"]);
// add the point
......@@ -84,7 +86,6 @@ function requestChartVar() {
chart_pressure.update();
chart_flow.update();
chart_volume.update();
},
cache: false
......
......@@ -79,14 +79,14 @@ $(document).ready(function() {
label: 'A',
yAxisID: 'A',
data: [],
label: "pressure_buffer",
label: "Buffer",
borderColor: "#0000FF",
fill: false,
},{
label: 'B',
yAxisID: 'B',
data: [],
label: "pressure_inhale",
label: "Inhale",
borderColor: "#000000",
fill: false,
}
......@@ -203,7 +203,7 @@ function updateChartType() {
},
scales: {
xAxes: [{
type: 'time',
//type: 'time',
time: {
unit: 'second',
displayFormat: 'second'
......
......@@ -65,11 +65,10 @@
<div class="sb-sidenav-menu">
<div class="nav">
<a href="/"> <div id="fan-icon" class = "sb-nav-link-icon border-invisible {{'active' if fan_active }}">
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="fan" class="fa-fan fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path class="path-icon" d="M352.57 128c-28.09 0-54.09 4.52-77.06 12.86l12.41-123.11C289 7.31 279.81-1.18 269.33.13 189.63 10.13 128 77.64 128 159.43c0 28.09 4.52 54.09 12.86 77.06L17.75 224.08C7.31 223-1.18 232.19.13 242.67c10 79.7 77.51 141.33 159.3 141.33 28.09 0 54.09-4.52 77.06-12.86l-12.41 123.11c-1.05 10.43 8.11 18.93 18.59 17.62 79.7-10 141.33-77.51 141.33-159.3 0-28.09-4.52-54.09-12.86-77.06l123.11 12.41c10.44 1.05 18.93-8.11 17.62-18.59-10-79.7-77.51-141.33-159.3-141.33zM256 288a32 32 0 1 1 32-32 32 32 0 0 1-32 32z"></path></svg>
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="user-md" class="fa-user-md fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path class="path-icon" d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zM104 424c0 13.3 10.7 24 24 24s24-10.7 24-24-10.7-24-24-24-24 10.7-24 24zm216-135.4v49c36.5 7.4 64 39.8 64 78.4v41.7c0 7.6-5.4 14.2-12.9 15.7l-32.2 6.4c-4.3.9-8.5-1.9-9.4-6.3l-3.1-15.7c-.9-4.3 1.9-8.6 6.3-9.4l19.3-3.9V416c0-62.8-96-65.1-96 1.9v26.7l19.3 3.9c4.3.9 7.1 5.1 6.3 9.4l-3.1 15.7c-.9 4.3-5.1 7.1-9.4 6.3l-31.2-4.2c-7.9-1.1-13.8-7.8-13.8-15.9V416c0-38.6 27.5-70.9 64-78.4v-45.2c-2.2.7-4.4 1.1-6.6 1.9-18 6.3-37.3 9.8-57.4 9.8s-39.4-3.5-57.4-9.8c-7.4-2.6-14.9-4.2-22.6-5.2v81.6c23.1 6.9 40 28.1 40 53.4 0 30.9-25.1 56-56 56s-56-25.1-56-56c0-25.3 16.9-46.5 40-53.4v-80.4C48.5 301 0 355.8 0 422.4v44.8C0 491.9 20.1 512 44.8 512h358.4c24.7 0 44.8-20.1 44.8-44.8v-44.8c0-72-56.8-130.3-128-133.8z"></path></svg>
</div></a>
<a href="prototype"> <div class = "sb-nav-link-icon border-invisible {{'active' if prototype_active}}">
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="hammer" class="fa-hammer fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path class="path-icon" fill="currentColor" d="M571.31 193.94l-22.63-22.63c-6.25-6.25-16.38-6.25-22.63 0l-11.31 11.31-28.9-28.9c5.63-21.31.36-44.9-16.35-61.61l-45.25-45.25c-62.48-62.48-163.79-62.48-226.28 0l90.51 45.25v18.75c0 16.97 6.74 33.25 18.75 45.25l49.14 49.14c16.71 16.71 40.3 21.98 61.61 16.35l28.9 28.9-11.31 11.31c-6.25 6.25-6.25 16.38 0 22.63l22.63 22.63c6.25 6.25 16.38 6.25 22.63 0l90.51-90.51c6.23-6.24 6.23-16.37-.02-22.62zm-286.72-15.2c-3.7-3.7-6.84-7.79-9.85-11.95L19.64 404.96c-25.57 23.88-26.26 64.19-1.53 88.93s65.05 24.05 88.93-1.53l238.13-255.07c-3.96-2.91-7.9-5.87-11.44-9.41l-49.14-49.14z"></path></svg>
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="fan" class="fa-fan fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path class="path-icon" d="M352.57 128c-28.09 0-54.09 4.52-77.06 12.86l12.41-123.11C289 7.31 279.81-1.18 269.33.13 189.63 10.13 128 77.64 128 159.43c0 28.09 4.52 54.09 12.86 77.06L17.75 224.08C7.31 223-1.18 232.19.13 242.67c10 79.7 77.51 141.33 159.3 141.33 28.09 0 54.09-4.52 77.06-12.86l-12.41 123.11c-1.05 10.43 8.11 18.93 18.59 17.62 79.7-10 141.33-77.51 141.33-159.3 0-28.09-4.52-54.09-12.86-77.06l123.11 12.41c10.44 1.05 18.93-8.11 17.62-18.59-10-79.7-77.51-141.33-159.3-141.33zM256 288a32 32 0 1 1 32-32 32 32 0 0 1-32 32z"></path></svg>
</div></a>
<a href="charts"> <div class = "sb-nav-link-icon border-invisible {{'active' if charts_active}}">
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chart-area" class="fa-chart-area fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path class="path-icon" d="M500 384c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v308h436zM372.7 159.5L288 216l-85.3-113.7c-5.1-6.8-15.5-6.3-19.9 1L96 248v104h384l-89.9-187.8c-3.2-6.5-11.4-8.7-17.4-4.7z"></path></svg>
......
......@@ -51,7 +51,7 @@
<div class="card-header d-flex align-items-center justify-content-between py-1 min-height-1b">
<a class="small text-dark stretched-link col-center" href="#">Mode</a>
</div>
<div class="card-body px-1 py-1 tiny"><span class = "reading-main" id="fsm_state">0</span></div>
<div class="card-body px-1 py-1 tiny"><span class = "reading-main" id="fsm_state">IDLE</span></div>
</div>
</div>
......
......@@ -51,7 +51,7 @@
<div class="card-header d-flex align-items-center justify-content-between py-1 min-height-1b">
<a class="small text-dark stretched-link col-center" href="#">State</a>
</div>
<div class="card-body px-1 py-3"><span class = "reading-main" id="fsm_state">000.00</span></div>
<div class="card-body px-1 py-3"><span class = "reading-main" id="fsm_state">IDLE</span></div>
</div>
</div>
......
......@@ -42,6 +42,7 @@ class HEVClient(object):
payload = json.loads(data.decode("utf-8"))
except json.decoder.JSONDecodeError:
logging.warning(f"Could not decode packet: {data}")
raise
with self._lock:
self._values = payload["sensors"]
self._alarms = payload["alarms"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment