From 7766cb056ffa242577524c55bfec51c046a7be47 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 12 Dec 2016 19:57:25 +0100 Subject: ChipDesign: a bit more final? --- chip_design/solution-to-latex.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chip_design') diff --git a/chip_design/solution-to-latex.py b/chip_design/solution-to-latex.py index 6c74f4c..46cd838 100755 --- a/chip_design/solution-to-latex.py +++ b/chip_design/solution-to-latex.py @@ -8,6 +8,13 @@ import sys # Map component index to (x, y, width, height) boxes = {} +# Reads input, line-by-line. Ignore the first line that just says "sat". +# Other lines that are accepted: +# x0 -> 2.0 +# y0 -> (/ 7.0 5.0) +# w0 -> 3.0 +# h0 -> 4.0 +# Reads it into: boxes[0] = (x, y, width, height) = (2, 7/5, 3, 4) for line in sys.stdin: line = line.strip() if line == 'sat': @@ -89,7 +96,7 @@ def print_boxes(): x, y, w, h = component x2, y2 = x + w, y + h - # Draw number for debugging + # Draw number, coordinate and dimensions for debugging tx = x + w/2 ty = y + h/2 text = r"%s\\(%s,%s)\\(%s x %s)" % (i, x, y, w, h) -- cgit v1.2.1