From 01bfd701dd8cd1c32297b615cc1b004b2578a502 Mon Sep 17 00:00:00 2001 From: Christopher Stone Date: Fri, 9 Feb 2018 21:39:59 +0000 Subject: [PATCH] Added docstrings --- telemetry/code/monitor/graph_plotter_rewrite.py | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/telemetry/code/monitor/graph_plotter_rewrite.py b/telemetry/code/monitor/graph_plotter_rewrite.py index 40cf883..57e2c9f 100755 --- a/telemetry/code/monitor/graph_plotter_rewrite.py +++ b/telemetry/code/monitor/graph_plotter_rewrite.py @@ -9,6 +9,7 @@ from colours import * class Plot: def __init__(self, title="Unknown", size=(640, 480)): + """Setup a the details of a plot, and create a corresponding window""" self.title = title self.size = size self.font = 'Arkhip' @@ -18,17 +19,21 @@ class Plot: self.window.on_draw = self.draw def resize(self, width, height): + """Handle a pyglet resize event, then give control back to the event loop""" self.size = (width, height) super(pyglet.window.Window, self.window).on_resize(width, height) def draw(self): + """Draw all the components of the graph""" self.drawBackground() self.drawHeading() def drawBackground(self): + """Draw the graph background, currently a plain colour""" pyglet.image.SolidColorImagePattern(WHITE).create_image(self.size[0], self.size[1]).blit(0, 0) def drawHeading(self): + """Draw a title for the graph (duplicated in the window titlebar, if present""" heading = pyglet.text.Label(self.title, color=BLACK, font_name=self.font, font_size=self.size[0]/50, x=self.size[0]/2, y=self.size[1], anchor_x='center', anchor_y='top') @@ -38,6 +43,7 @@ plots = [] plots.append(Plot("This is a test plot")) def pollSerial(foo): + """Dummy, will check serial port for incoming data""" # Note, foo seems to be a float pass -- libgit2 0.21.2