TimberVis Flexiboard: Visualization and Exploration Flexiboard for Timber Buildings IoT data sensors.
The pulse of the wood
Monitoring of Wooden houses: Time series of sensors data measuring
humidity, temperatures, vibrations and weather conditions.
https://lnu.se/forskning/forskningsprojekt/projekt-flexiboard-for-visualisering-och-utforskning-av-trabyggnader/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
939 B
35 lines
939 B
from flask import Flask, request, jsonify, send_from_directory
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route("/calculate", methods=["POST"])
|
|
def calculate():
|
|
data = request.get_json()
|
|
|
|
# Determine which form was submitted based on a form identifier or name
|
|
form_name = data.get("form_name")
|
|
|
|
if form_name == "calculatorForm":
|
|
num1 = data.get("num1")
|
|
num2 = data.get("num2")
|
|
result = num1 + num2
|
|
elif form_name == "anotherForm":
|
|
# Handle data from anotherForm
|
|
pass
|
|
elif form_name == "thirdForm":
|
|
# Handle data from thirdForm
|
|
pass
|
|
elif form_name == "fourthForm":
|
|
# Handle data from fourthForm
|
|
pass
|
|
else:
|
|
return jsonify({"error": "Invalid form_name"})
|
|
|
|
return jsonify({"result": result})
|
|
|
|
@app.route("/")
|
|
def index():
|
|
return send_from_directory("static", "forms.html")
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True)
|
|
|