def redirect(): if request.method == 'POST': if request.form.get('Start') == 'Start': return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame') elif request.form.get('start') == 'Start': return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame') elif request.form.get('Home') == 'Home': return render_template('index.html') elif request.form.get('Stop') == 'Stop': return render_template('index.html')
def movec(): if request.method == 'POST': if request.form.get('center') == 'center': center() return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')
def photo(): if request.method == 'POST': if request.form.get('Photo') == '📷': take_photo() return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')
def moves(): if request.method == 'POST': if request.form.get('stop') == 'stop': brake() return render_template('panel.html') return Response(forward.brake()) return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')
def movef(): if request.method == 'POST': if request.form.get('forward') == '↑': forward() return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame') else: pass # unknown
def record(): if request.method == 'POST': if request.form.get('Start') == '▶': Recordvideo.video() return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame') elif request.form.get('Stop') == '■': Recordvideo.stop_video() return render_template('panel.html') return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame') else: return render_template("panel.html") return Response( gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')
def video_feed(): return Response(gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')