From fdca3d31a25b1bcec50f5a4f0a20e1d9e0f61a1b Mon Sep 17 00:00:00 2001 From: Bernd Reuther Date: Sun, 17 Oct 2021 13:31:21 +0200 Subject: [PATCH] =?UTF-8?q?Motor=20Pos=20in=20html=20eingef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kamera_server.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/kamera_server.py b/kamera_server.py index 614e6dd..04fc369 100644 --- a/kamera_server.py +++ b/kamera_server.py @@ -50,7 +50,10 @@ def main(): # Put the pin dictionary into the template data dictionary: templateData = { 'pins' : pins_out, - 'pins_in' : pins_in + 'pins_in' : pins_in, + 'pos_1' : str(m1.pos), + 'pos_2' : str(m2.pos), + 'pos_3' : str(m3.pos) } # Pass the template data into the template main.html and return it to the user return render_template('main.html', **templateData) @@ -86,7 +89,10 @@ def action(changePin, action): # Along with the pin dictionary, put the message into the template data dictionary: templateData = { 'pins' : pins_out, - 'pins_in' : pins_in + 'pins_in' : pins_in, + 'pos_1' : str(m1.pos), + 'pos_2' : str(m2.pos), + 'pos_3' : str(m3.pos) } return render_template('main.html', **templateData) @@ -128,7 +134,15 @@ def motor_eichen(): m2.eichen() m3.eichen() - return 'fahre Motoren auf Startposition' + templateData = { + 'pins' : pins_out, + 'pins_in' : pins_in, + 'pos_1' : str(m1.pos), + 'pos_2' : str(m2.pos), + 'pos_3' : str(m3.pos) + } + + return render_template('main.html', **templateData) if __name__ == "__main__": kamera_server.run(host='0.0.0.0')