|
|
|
@ -12,7 +12,13 @@ output_folder = Path('./output') |
|
|
|
|
app = Flask(__name__, static_folder=str(build_folder), static_url_path='') |
|
|
|
|
CORS(app) |
|
|
|
|
|
|
|
|
|
status = 'Standby' |
|
|
|
|
STANDBY = 0 |
|
|
|
|
WARMUP = 1 |
|
|
|
|
CAPTURING = 2 |
|
|
|
|
WRITING = 3 |
|
|
|
|
DOWNLOADING = 4 |
|
|
|
|
|
|
|
|
|
status = STANDBY |
|
|
|
|
|
|
|
|
|
@app.route('/api/status', methods=['GET']) |
|
|
|
|
def status_get(): |
|
|
|
@ -97,7 +103,7 @@ def session_post(cid): |
|
|
|
|
abort(404) |
|
|
|
|
|
|
|
|
|
# go through the photo taking process |
|
|
|
|
status = 'Warming up' |
|
|
|
|
status = WARMUP |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
# warmup |
|
|
|
@ -112,7 +118,7 @@ def session_post(cid): |
|
|
|
|
print() |
|
|
|
|
abort(500) |
|
|
|
|
|
|
|
|
|
status = 'Capturing' |
|
|
|
|
status = CAPTURING |
|
|
|
|
|
|
|
|
|
# capture |
|
|
|
|
power.lights_on() |
|
|
|
@ -126,13 +132,13 @@ def session_post(cid): |
|
|
|
|
power.grid_off() |
|
|
|
|
power.lights_off() |
|
|
|
|
|
|
|
|
|
status = 'Writing to files' |
|
|
|
|
status = WRITING |
|
|
|
|
time.sleep(3) |
|
|
|
|
|
|
|
|
|
status = 'Downloading' |
|
|
|
|
status = DOWNLOADING |
|
|
|
|
download.download_all_photos(path) |
|
|
|
|
|
|
|
|
|
status = 'Standby' |
|
|
|
|
status = STANDBY |
|
|
|
|
return '' |
|
|
|
|
|
|
|
|
|
@app.route('/') |
|
|
|
|