Skip to content
Snippets Groups Projects
Commit a522b4c9 authored by Ben Coombs's avatar Ben Coombs
Browse files

Removed Flask and used python3 -m http.server to not break previous file...

Removed Flask and used python3 -m http.server to not break previous file structure. Added basic show/hide controls feature.
parent dfab1603
No related branches found
No related tags found
No related merge requests found
from flask import Flask, render_template;
import serial;
import time;
app = Flask(__name__)
@app.route('/')
def index():
return render_template('breath_plot.html')
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
#ser = serial.Serial('COM4', 112500, timeout=1)
#print(ser.name)
#ser.flushInput()
#while True:
# try:
# ser.write(b'A')
# time.sleep(0.1)
# ser_bytes = ser.readline()
# print(ser_bytes)
# except KeyboardInterrupt:
# print("Keyboard Interrupt")
# break
......@@ -28,7 +28,7 @@ Breath Plot: COVID-19 Respiration Analysis Software
<!-- Load plotly.js into the DOM -->
<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
<script src='./static/js/respiration_math.js'></script>
<script src='./js/respiration_math.js'></script>
<title>Public Invention Respiration Analysis</title>
......@@ -189,7 +189,10 @@ an interactive or static analysis of a respiration. It&#39;s primary purpose is
<!-- CONTROL PANEL START -->
<div class="container-fluid" id="control_area">
<div class="row">
<div class="row" id="control-panel-hidden">
<button type="button" class="btn btn-primary">SHOW CONTROLS</button>
</div>
<div class="row" id="control-panel-expanded">
<div class="col-6">
<div class="control-wrapper row">
<label class="col-2" for="control-mode">Mode:</label>
......@@ -579,7 +582,7 @@ var intervalID = null;
// CONTROL PANEL VARIABLES START
var controlsVisible = false;
// CONTROL PANEL VARIABLES END
......@@ -1490,6 +1493,19 @@ $( document ).ready(function() {
});
$("#control-panel-hidden button").click(()=> {
console.log("show panel");
if (controlsVisible){
$("#control-panel-expanded").hide();
controlsVisible = false;
} else {
$("#control-panel-expanded").show();
controlsVisible = true;
}
});
$("#control-panel-expanded").hide();
$("#control-mode").on("input", () => {
var m = $("#control-mode").val();
if (m === "0"){
......
File moved
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(112500);
}
void loop() {
// put your main code here, to run repeatedly:
// reply only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
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