Permalink
Browse files

Added 10% to the print and scan progress bars for getting them in the…

… queue
  • Loading branch information...
1 parent 1999f97 commit 8b787f729464de49d893ebacb96b5017cee33cdd Michal Migurski committed Mar 1, 2012
Showing with 11 additions and 6 deletions.
  1. +1 −1 decoder/compose2.py
  2. +5 −5 decoder/decode2.py
  3. +4 −0 site/lib/lib.compose.php
  4. +1 −0 site/www/uploaded.php
View
@@ -369,7 +369,7 @@ def main(apibase, password, print_id, pages, paper_size, orientation, layout):
#
for (index, page) in enumerate(pages):
- _update_print(float(index) / len(pages))
+ _update_print(0.1 + 0.9 * float(index) / len(pages))
page['number'] = int(page['number'])
View
@@ -372,7 +372,7 @@ def _append_image(filename, image):
s, h, path, p, q, f = urlparse(url)
uploaded_file = basename(path)
- _update_scan(uploaded_file, None, 0.1)
+ _update_scan(uploaded_file, None, 0.2)
yield 10
@@ -384,7 +384,7 @@ def _append_image(filename, image):
move(preblobs_filename, 'preblobs.jpg')
unlink(postblob_filename)
- _update_scan(uploaded_file, None, 0.2)
+ _update_scan(uploaded_file, None, 0.3)
for (s2p, paper, orientation, blobs_abcde) in paper_matches(blobs):
@@ -411,7 +411,7 @@ def _append_image(filename, image):
_append_image('postblob.jpg', postblob_img)
postblob_img.save('postblob.jpg')
- _update_scan(uploaded_file, print_id, 0.3)
+ _update_scan(uploaded_file, print_id, 0.4)
print >> stderr, 'geotiff...',
@@ -423,7 +423,7 @@ def _append_image(filename, image):
_append_file('walking-paper-%s.tif' % scan_id, geotiff_bytes)
_append_image('walking-paper-%s.jpg' % scan_id, geojpeg_img)
- _update_scan(uploaded_file, print_id, 0.4)
+ _update_scan(uploaded_file, print_id, 0.5)
print >> stderr, 'done.'
print >> stderr, 'tiles...',
@@ -435,7 +435,7 @@ def _append_image(filename, image):
for (index, (coord, scan2coord)) in enumerate(tiles_needed):
if index % 10 == 0:
- _update_scan(uploaded_file, print_id, 0.4 + 0.6 * float(index) / len(tiles_needed))
+ _update_scan(uploaded_file, print_id, 0.5 + 0.5 * float(index) / len(tiles_needed))
tile_img = extract_tile_for_coord(input, coord, scan2coord)
_append_image('%(zoom)d/%(column)d/%(row)d.jpg' % coord.__dict__, tile_img)
View
@@ -286,6 +286,8 @@ function compose_from_postvars(&$dbh, $post, $user_id)
$message['fields'] = get_form_fields($dbh, $form['id']);
}
+ $print['progress'] = 0.1; // the first 10% is getting it queued
+
set_print($dbh, $print);
$message['print_id'] = $print['id'];
add_message($dbh, json_encode($message));
@@ -448,6 +450,8 @@ function compose_from_geojson(&$dbh, $data)
$print['east'] = max($print['east'], $page['east']);
}
+ $print['progress'] = 0.1; // the first 10% is getting it queued
+
set_print($dbh, $print);
$message['print_id'] = $print['id'];
View
@@ -52,6 +52,7 @@
$scan = get_scan($dbh, $scan['id']);
$parsed_url = parse_url($url);
$scan['base_url'] = "http://{$parsed_url['host']}".dirname($parsed_url['path']);
+ $scan['progress'] = 0.1; // the first 10% is just getting the thing uploaded
set_scan($dbh, $scan);

0 comments on commit 8b787f7

Please sign in to comment.