40 lines
1.1 KiB
Python
Executable File
40 lines
1.1 KiB
Python
Executable File
from flask import Flask, render_template, send_from_directory
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route("/")
|
|
def hello_world():
|
|
return render_template('index.html')
|
|
|
|
|
|
@app.route("/calibration")
|
|
def calibration():
|
|
return render_template('calibration.html')
|
|
|
|
|
|
@app.route("/api/calibration-data")
|
|
def calibration_data():
|
|
# Return dummy output
|
|
return {
|
|
'led_0040': [-5.55700564, 8.14046472, 10.54967666],
|
|
'led_0090': [-7.06683588, 3.12804841, 6.68884105],
|
|
'led_0070': [4.75589064, -4.53847239, 4.59339772],
|
|
'led_0020': [-2.70015523, -9.65693344, 9.3807489],
|
|
'led_0050': [3.26747465, 9.09127322, 8.52493055],
|
|
'led_0010': [4.69548335, -7.92767838, 7.98930158],
|
|
'led_0030': [-7.78342731, -3.88182141, 8.52941532],
|
|
'led_0060': [9.8648123, 3.14267492, 10.09358765],
|
|
'led_0080': [-3.3681401, -7.6538693, 6.36718535],
|
|
}
|
|
|
|
|
|
@app.route('/static/<path:path>')
|
|
def send_static(path):
|
|
return send_from_directory('static', path)
|
|
|
|
|
|
@app.route('/data/<path:path>')
|
|
def send_data(path):
|
|
return send_from_directory('data', path)
|