Update webplot to use reorganized "remote" module
There was a minor change in the organization of the remote module.
This was done to allow more variability in the touch devices we
support, but it broke a couple of things in webplot that relied on
how the underlying classes were implimented. This CL updated webplot
to work with the new, more general, interface.
BUG=chromium:473324
TEST=manually ran webplot and was able to plot the points on my
touchscreen
Change-Id: I98656f8e9e1a19354e3b99e1e08bf89e20057da1
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/263729
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
diff --git a/webplot/webplot.py b/webplot/webplot.py
index 6056679..55026bb 100755
--- a/webplot/webplot.py
+++ b/webplot/webplot.py
@@ -17,14 +17,12 @@
import cherrypy
-import remote
-
from ws4py import configure_logger
from ws4py.messaging import TextMessage
from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
from ws4py.websocket import WebSocket
-from remote.remote import ChromeOSTouchDevice, AndroidTouchDevice
+from remote import ChromeOSTouchDevice, AndroidTouchDevice
# The WebSocket connection state object.
@@ -383,11 +381,13 @@
cherrypy.engine.signal_handler.handlers['SIGINT'] = InterruptHandler
cherrypy.engine.signal_handler.handlers['SIGTERM'] = InterruptHandler
+ x_min, x_max = device.device.RangeX()
+ y_min, y_max = device.device.RangeY()
+ p_min, p_max = device.device.RangeP()
+
cherrypy.quickstart(
Root(args.server_addr, args.server_port,
- device.device.x_min, device.device.x_max,
- device.device.y_min, device.device.y_max,
- device.device.p_min, device.device.p_max), '',
+ x_min, x_max, y_min, y_max, p_min, p_max), '',
config={
'/': {
'tools.staticdir.root': os.path.abspath(os.path.dirname(__file__)),