skidl.schematics.debug_draw module

Drawing routines used for debugging place & route.

skidl.schematics.debug_draw.draw_box(bbox, scr, tx, color=(192, 255, 192), thickness=0)[source]

Draw a box in the drawing area.

Parameters:
  • bbox (BBox) – Bounding box for the box.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • color (tuple, optional) – Box color. Defaults to (192, 255, 192).

Returns:

None.

skidl.schematics.debug_draw.draw_clear(scr, color=(255, 255, 255))[source]

Clear drawing area.

Parameters:
  • scr (PyGame screen) – Screen object to be cleared.

  • color (tuple, optional) – Background color. Defaults to (255, 255, 255).

skidl.schematics.debug_draw.draw_end()[source]

Display drawing and wait for user to close PyGame window.

skidl.schematics.debug_draw.draw_endpoint(pt, scr, tx, color=(100, 100, 100), dot_radius=10)[source]

Draw a line segment endpoint in the drawing area.

Parameters:
  • pt (Point) – A point with (x,y) coords.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • color (tuple, optional) – Segment color. Defaults to (192, 255, 192).

  • dot_Radius (int, optional) – Endpoint dot radius. Defaults to 3.

skidl.schematics.debug_draw.draw_force(part, force, scr, tx, font, color=(128, 0, 0))[source]

Draw force vector affecting a part.

Parameters:
  • part (Part) – The part affected by the force.

  • force (Vector) – The force vector.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • font (PyGame font) – Font for rendering text.

  • color (tuple, optional) – Segment color. Defaults to (0,0,0).

skidl.schematics.debug_draw.draw_net(net, parts, scr, tx, font, color=(0, 0, 0), thickness=2, dot_radius=5)[source]

Draw net and connected terminals.

Parameters:
  • net (Net) – Net of conmnected terminals.

  • parts (list) – List of parts to which net will be drawn.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • font (PyGame font) – Font for rendering text.

  • color (tuple, optional) – Segment color. Defaults to (0,0,0).

  • thickness (int, optional) – Thickness of net line. Defaults to 2.

  • dot_radius (int, optional) – Radius of terminals on net. Defaults to 5.

skidl.schematics.debug_draw.draw_part(part, scr, tx, font)[source]

Draw part bounding box.

Parameters:
  • part (Part) – Part to draw.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • font (PyGame font) – Font for rendering text.

skidl.schematics.debug_draw.draw_pause()[source]

Pause drawing and then resume after button press.

skidl.schematics.debug_draw.draw_placement(parts, nets, scr, tx, font)[source]

Draw placement of parts and interconnecting nets.

Parameters:
  • parts (list) – List of Part objects.

  • nets (list) – List of Net objects.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • font (PyGame font) – Font for rendering text.

skidl.schematics.debug_draw.draw_redraw()[source]

Redraw the PyGame display.

skidl.schematics.debug_draw.draw_routing(node, bbox, parts, *other_stuff, **options)[source]

Draw routing for debugging purposes.

Parameters:
  • node (Node) – Hierarchical node.

  • bbox (BBox) – Bounding box of drawing area.

  • node – The Node being routed.

  • parts (list) – List of Parts.

  • other_stuff (list) – Other stuff with a draw() method.

  • options (dict, optional) – Dictionary of options and values. Defaults to {}.

skidl.schematics.debug_draw.draw_seg(seg, scr, tx, color=(100, 100, 100), thickness=5, dot_radius=10)[source]

Draw a line segment in the drawing area.

Parameters:
  • seg (Segment, Interval, NetInterval) – An object with two endpoints.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • color (tuple, optional) – Segment color. Defaults to (192, 255, 192).

  • seg_thickness (int, optional) – Segment line thickness. Defaults to 5.

  • dot_Radius (int, optional) – Endpoint dot radius. Defaults to 3.

skidl.schematics.debug_draw.draw_start(bbox)[source]

Initialize PyGame drawing area.

Parameters:

bbox – Bounding box of object to be drawn.

Returns:

PyGame screen that is drawn upon. tx: Matrix to transform from real coords to screen coords. font: PyGame font for rendering text.

Return type:

scr

skidl.schematics.debug_draw.draw_text(txt, pt, scr, tx, font, color=(100, 100, 100), real=True)[source]

Render text in drawing area.

Parameters:
  • txt (str) – Text string to be rendered.

  • pt (Point) – Real or screen coord for start of rendered text.

  • scr (PyGame screen) – Screen object for PyGame drawing.

  • tx (Tx) – Transformation matrix from real to screen coords.

  • font (PyGame font) – Font for rendering text.

  • color (tuple, optional) – Segment color. Defaults to (100,100,100).

  • real (Boolean) – If true, transform real pt to screen coords. Otherwise, pt is screen coords.