Docs
This commit is contained in:
parent
84b5703f64
commit
be9d8128d6
|
|
@ -41,6 +41,9 @@ def calibrate():
|
||||||
|
|
||||||
@blueprint.route('/scan')
|
@blueprint.route('/scan')
|
||||||
def scan():
|
def scan():
|
||||||
|
"""
|
||||||
|
Starts a scan for calibration.
|
||||||
|
"""
|
||||||
conn = db.get()
|
conn = db.get()
|
||||||
|
|
||||||
if 'calibration_id' not in session:
|
if 'calibration_id' not in session:
|
||||||
|
|
@ -66,6 +69,9 @@ def scan():
|
||||||
|
|
||||||
@blueprint.route('/compute')
|
@blueprint.route('/compute')
|
||||||
def compute():
|
def compute():
|
||||||
|
"""
|
||||||
|
Compute the calibration from the scan.
|
||||||
|
"""
|
||||||
conn = db.get()
|
conn = db.get()
|
||||||
id = session['calibration_id']
|
id = session['calibration_id']
|
||||||
calib = db.Calibration.get_from_id(id, conn)
|
calib = db.Calibration.get_from_id(id, conn)
|
||||||
|
|
@ -84,6 +90,9 @@ def compute():
|
||||||
|
|
||||||
@blueprint.route('/cancel')
|
@blueprint.route('/cancel')
|
||||||
def cancel():
|
def cancel():
|
||||||
|
"""
|
||||||
|
Cancels a calibration.
|
||||||
|
"""
|
||||||
conn = db.get()
|
conn = db.get()
|
||||||
calibration = db.Calibration.get_from_id(session['calibration_id'], conn)
|
calibration = db.Calibration.get_from_id(session['calibration_id'], conn)
|
||||||
calibration.state = db.CalibrationState.HasData
|
calibration.state = db.CalibrationState.HasData
|
||||||
|
|
@ -94,6 +103,9 @@ def cancel():
|
||||||
|
|
||||||
@blueprint.route('/validate')
|
@blueprint.route('/validate')
|
||||||
def validate():
|
def validate():
|
||||||
|
"""
|
||||||
|
Validates a calibration.
|
||||||
|
"""
|
||||||
conn = db.get()
|
conn = db.get()
|
||||||
calib = utils.get_calibration(conn)
|
calib = utils.get_calibration(conn)
|
||||||
if calib is None:
|
if calib is None:
|
||||||
|
|
@ -107,6 +119,9 @@ def validate():
|
||||||
|
|
||||||
@blueprint.route('/use-last')
|
@blueprint.route('/use-last')
|
||||||
def use_last():
|
def use_last():
|
||||||
|
"""
|
||||||
|
Sets the current calibration to the last one that was validated.
|
||||||
|
"""
|
||||||
conn = db.get()
|
conn = db.get()
|
||||||
calib = db.Calibration.get_last(conn)
|
calib = db.Calibration.get_last(conn)
|
||||||
session['calibration_id'] = calib.id
|
session['calibration_id'] = calib.id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue