diff --git a/sorteerhoed/central_management.py b/sorteerhoed/central_management.py index c0296a5..f545179 100644 --- a/sorteerhoed/central_management.py +++ b/sorteerhoed/central_management.py @@ -164,7 +164,7 @@ class CentralManagement(): # park always triggers a plotter.finished after being processed elif signal.name[:4] == 'sqs.': - if signal.params['event']['HITId'] != self.currentHit.id: + if signal.params['event']['HITId'] != self.currentHit.hit_id: self.logger.warning(f"SQS hit.info hit_id != currenthit.id: {signal}, update status for older HIT") sqsHit = self.store.getHitByRemoteId(signal.params['event']['HITId']) updateStatus = False @@ -268,6 +268,8 @@ class CentralManagement(): # TODO: have HITStore/HIT take care of this by emitting a signal self.server.statusPage.set('hit_id', new_hit['HIT']['HITId']) self.server.statusPage.set('hit_created', self.currentHit.created_at) + self.server.statusPage.set('fee', f"${self.currentHit.fee:.2f}") + self.server.statusPage.set('state', self.currentHit.getStatus()) # mturk.send_test_event_notification() if self.config['amazon']['sqs_url']: @@ -325,7 +327,7 @@ class CentralManagement(): cmd = [ 'sudo', 'scanimage', '-d', 'epkowa', '--format', 'jpeg', - '--resolution=100', '-l','20','-t','30','-x',str(185), + '--resolution=100', '-l','18','-t','30','-x',str(185), '-y',str(245) ] self.logger.info(f"{cmd}") @@ -343,7 +345,7 @@ class CentralManagement(): try: f = io.BytesIO(o) img = Image.open(f) - img = img.transpose(Image.ROTATE_90) + img = img.transpose(Image.ROTATE_90).transpose(Image.FLIP_TOP_BOTTOM) img.save(filename) except Exception as e: self.logger.critical("Cannot create image from scan. Did scanner work?") diff --git a/sorteerhoed/plotter.py b/sorteerhoed/plotter.py index f9f4221..9b555c0 100644 --- a/sorteerhoed/plotter.py +++ b/sorteerhoed/plotter.py @@ -29,7 +29,11 @@ class Plotter: def park(self): self.logger.info("Queue to park plotter") self.goPark = True - self.q.put([(1/2.54)/self.plotWidth + 1,0,0]) + #self.q.put([(1/2.54)/self.plotWidth + 1,0,0]) + absPlotWidth = 26.5/2.54 + topLeft = absPlotWidth / self.plotWidth #ignore changes in config plotwidth + self.q.put([(1/2.54)/absPlotWidth + topLeft,0,0]) + def start(self): try: @@ -130,8 +134,8 @@ class Plotter: # if no info comes in for .5sec, plot that segment segment = self.q.get(True, .5) - if self.goPark: - print("seg",segment) + #if self.goPark: + # print("seg",segment) # change of pen state? draw previous segments! if (segment[2] == 1 and not self.pen_down) or (segment[2] == 0 and self.pen_down) or len(segments) > 150: diff --git a/sorteerhoed/webserver.py b/sorteerhoed/webserver.py index 3e0f6d2..1731131 100644 --- a/sorteerhoed/webserver.py +++ b/sorteerhoed/webserver.py @@ -312,7 +312,6 @@ class BackendHandler(tornado.web.RequestHandler): seconds = (hit.submit_hit_at - hit.accept_time).total_seconds() duration_m = int(seconds/60) duration_s = max(int(seconds%60), 0) - print(duration_m, duration_s) duration = (f"{duration_m}m" if duration_m else "") + f"{duration_s:02d}s" else: duration = "-" @@ -321,7 +320,7 @@ class BackendHandler(tornado.web.RequestHandler): rows.append( f""" - {hit.worker_id} + {hit.worker_id} {hit.turk_ip} {hit.turk_country} {fee} diff --git a/www/backend.html b/www/backend.html index ca93064..f8e297b 100644 --- a/www/backend.html +++ b/www/backend.html @@ -8,7 +8,7 @@
- + diff --git a/www/font/BebasNeue-Regular.eot b/www/font/BebasNeue-Regular.eot new file mode 100644 index 0000000..63df3a7 Binary files /dev/null and b/www/font/BebasNeue-Regular.eot differ diff --git a/www/font/BebasNeue-Regular.otf b/www/font/BebasNeue-Regular.otf new file mode 100644 index 0000000..4f5676c Binary files /dev/null and b/www/font/BebasNeue-Regular.otf differ diff --git a/www/font/BebasNeue-Regular.ttf b/www/font/BebasNeue-Regular.ttf new file mode 100644 index 0000000..76e22b8 Binary files /dev/null and b/www/font/BebasNeue-Regular.ttf differ diff --git a/www/font/BebasNeue-Regular.woff b/www/font/BebasNeue-Regular.woff new file mode 100644 index 0000000..457f916 Binary files /dev/null and b/www/font/BebasNeue-Regular.woff differ diff --git a/www/font/BebasNeue-Regular.woff2 b/www/font/BebasNeue-Regular.woff2 new file mode 100644 index 0000000..b4099a9 Binary files /dev/null and b/www/font/BebasNeue-Regular.woff2 differ diff --git a/www/font/DroidSansFallbackFull.ttf b/www/font/DroidSansFallbackFull.ttf new file mode 100644 index 0000000..89959f5 Binary files /dev/null and b/www/font/DroidSansFallbackFull.ttf differ diff --git a/www/font/FreeSans.ttf b/www/font/FreeSans.ttf new file mode 100644 index 0000000..7d1be71 Binary files /dev/null and b/www/font/FreeSans.ttf differ diff --git a/www/worker_specs/index.html b/www/worker_specs/index.html index 5f8d9fe..30abb21 100644 --- a/www/worker_specs/index.html +++ b/www/worker_specs/index.html @@ -37,7 +37,7 @@  task status  - task fee + calculated fee  diff --git a/www/worker_specs/style.css b/www/worker_specs/style.css index 8b97640..34b7fed 100644 --- a/www/worker_specs/style.css +++ b/www/worker_specs/style.css @@ -11,7 +11,7 @@ :root{ - --base-font-size: 22px; + --base-font-size: 17px; --spec_name-font-size: 120%; --spec_value-font-size: 250%; @@ -21,7 +21,7 @@ /* /////// GAT VOORKANT PLEK & POSITIE //////// */ /* */ /* */ /* */ --pos-x: 555px; /* */ - /* */ --pos-y: 120px; /* */ + /* */ --pos-y: 110px; /* */ /* */ --width: 420px; /* 115mm */ /* */ --height: 1000px; /* 270mm */ /* */ /* */ @@ -74,7 +74,7 @@ html, body{ .spec_value{ font-size: var(--spec_value-font-size); - padding-bottom: 2%; + padding-bottom: 3%; } @@ -91,3 +91,8 @@ html, body{ .narrative_phase_text{ font-size: var(--spec_value-font-size); } +#hit_id{ + font-size: 190%; + position: relative; + top: 5px; +}