From be9d8128d608a995ba70f8d8f9e7d24adcb0ea6f Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 23 Aug 2024 15:18:26 +0200 Subject: [PATCH] Docs --- routes/calibration.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/routes/calibration.py b/routes/calibration.py index bebd12e..e976a46 100644 --- a/routes/calibration.py +++ b/routes/calibration.py @@ -41,6 +41,9 @@ def calibrate(): @blueprint.route('/scan') def scan(): + """ + Starts a scan for calibration. + """ conn = db.get() if 'calibration_id' not in session: @@ -66,6 +69,9 @@ def scan(): @blueprint.route('/compute') def compute(): + """ + Compute the calibration from the scan. + """ conn = db.get() id = session['calibration_id'] calib = db.Calibration.get_from_id(id, conn) @@ -84,6 +90,9 @@ def compute(): @blueprint.route('/cancel') def cancel(): + """ + Cancels a calibration. + """ conn = db.get() calibration = db.Calibration.get_from_id(session['calibration_id'], conn) calibration.state = db.CalibrationState.HasData @@ -94,6 +103,9 @@ def cancel(): @blueprint.route('/validate') def validate(): + """ + Validates a calibration. + """ conn = db.get() calib = utils.get_calibration(conn) if calib is None: @@ -107,6 +119,9 @@ def validate(): @blueprint.route('/use-last') def use_last(): + """ + Sets the current calibration to the last one that was validated. + """ conn = db.get() calib = db.Calibration.get_last(conn) session['calibration_id'] = calib.id