From cc93d4a8eda0f1edf06462c36e1583549b51db1d Mon Sep 17 00:00:00 2001 From: Timothy Stack <stack@flux.utah.edu> Date: Thu, 16 Dec 2004 00:18:07 +0000 Subject: [PATCH] Handle coords a little better --- robots/emc/loclistener.in | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/robots/emc/loclistener.in b/robots/emc/loclistener.in index 2bccda39fd..3642fa15ad 100644 --- a/robots/emc/loclistener.in +++ b/robots/emc/loclistener.in @@ -99,13 +99,18 @@ class LocationInfoUpdater(EventClient): try: key, value = arg.split('=') if key == "X" or key == "x": - update["loc_x"] = str( - float(value) * pixels_per_meter) + update["loc_x"] = float(value) * pixels_per_meter + if update["loc_x"] < 0.0: + update["loc_x"] = 0.0 + pass + update["loc_x"] = str(update["loc_x"]) pass elif key == "Y" or key == "y": - # XXX 520 is hardcoded - update["loc_y"] = str( - 520 - float(value) * pixels_per_meter) + update["loc_y"] = float(value) * pixels_per_meter + if update["loc_y"] < 0.0: + update["loc_y"] = 0.0 + pass + update["loc_y"] = str(update["loc_y"]) pass else: sys.stderr.write("warning: unknown key: %s\n" % -- GitLab