mirror of
https://github.com/PotentiaRobotics/robot-gui.git
synced 2025-04-09 14:20:16 -04:00
stable random modify data
This commit is contained in:
parent
8168ec997b
commit
73f8b3f0d3
7
app.py
7
app.py
|
@ -2,7 +2,7 @@
|
|||
|
||||
from flask import Flask, render_template, request
|
||||
from flask_assets import Bundle, Environment
|
||||
|
||||
import random
|
||||
app = Flask(__name__)
|
||||
|
||||
assets = Environment(app)
|
||||
|
@ -39,7 +39,10 @@ def sendData():
|
|||
return render_template("index.html", conf='Invalid Input "'+rot+'"')
|
||||
except:
|
||||
return render_template("index.html", conf='Timeout: Unable to reach Pi')
|
||||
|
||||
@app.context_processor
|
||||
def inject_load1():
|
||||
deg = [int(random.random() * 100) / 100 for _ in range(3)]
|
||||
return {'load1': deg[0], 'load2': deg[1], 'load3' :deg[2]}
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
src="{{url_for('static', filename='images/img-knee.png')}}"
|
||||
class="img-part"
|
||||
/>
|
||||
<p class="measure">360</p>
|
||||
<p class="measure load1" id="load1">{{ load1 }}</p>
|
||||
|
||||
<form
|
||||
action='{{ url_for("sendData")}}'
|
||||
|
@ -59,7 +59,7 @@
|
|||
src="{{url_for('static', filename='images/img-knee.png')}}"
|
||||
class="img-part"
|
||||
/>
|
||||
<p class="measure">360</p>
|
||||
<p class="measure load2" id="load2">{{ load2 }}</p>
|
||||
<form
|
||||
action='{{ url_for("sendData")}}'
|
||||
class="enter-angle"
|
||||
|
@ -89,7 +89,7 @@
|
|||
src="{{url_for('static', filename='images/img-knee.png')}}"
|
||||
class="img-part"
|
||||
/>
|
||||
<p class="measure">360</p>
|
||||
<p class="measure load3" id="load3">{{ load3 }}</p>
|
||||
<form
|
||||
action='{{ url_for("sendData")}}'
|
||||
class="enter-angle"
|
||||
|
|
Loading…
Reference in New Issue
Block a user