Commits

saar drimer committed b498479

show pad name if specified

  • Participants
  • Parent commits d984290

Comments (0)

Files changed (2)

         outline_element.set("gerber_lp", board_shape_gerber_lp)
     
 
-    # add origin marker to origin layer
-    origin = et.SubElement(board_svg_layers['dimensions']['outline']['layer'], 'path',
+    # add origin marker to outline layer
+    origin = et.SubElement(board_svg_layers['dimensions']['measurements']['layer'], 'path',
                            id="origin_marker",
                            d="m -0.5,0 1,0 m -0.5,0.5 0,-1")
 
 
 
     drills = cfg['board'].get('drills')
-    if drills is not None:
+    if drills is not None and drills != {}:
         print "-- processing drills:",
         for pcb_layer in utils.get_surface_layers(cfg):
             for drill_refdef in drills[pcb_layer]:
 
 
     # add layer index for the specified layers
-    add_layer_index(['copper', 'soldermask', 'silkscreen'])
+    if cfg['board'].get('layer_index') is not None:
+        add_layer_index(['copper', 'soldermask', 'silkscreen'])
 
     # add drill index
     if cfg['board'].get('drill_index') is not None:

utils/footprint.py

                                          id='pad_drills', refdef=refdef)
 
         pad_numbers_style = utils.dict_to_style(cfg['layout_style']['board'].get('pad_numbers'))
-        pad_numbers_font_size = cfg['layout_style']['board']['pad_numbers'].get('font-size') or '0.4px'
+        pad_numbers_font_size = cfg['layout_style']['board']['pad_numbers'].get('font-size') or '0.15px'
         # remove 'px'
         pad_numbers_font_size = float(pad_numbers_font_size[:-2])
         pad_numbers_group = et.SubElement(footprint_svg_layers[cfg['board']['physical']['stackup'][0]]['copper']['pads']['layer'], 
 
             # should the pad number be shown? Default to 'yes'
             show_number = part['pins'][pin]['layout'].get('show_pin_number') or 'yes'
+            pin_name = part['pins'][pin]['layout'].get('name')
 
             if show_number.lower() == 'yes':
+                text_to_show = pin
+                if pin_name is not None:
+                    text_to_show += " %s" % pin_name
                 t = et.SubElement(pad_numbers_group, 'text',
                                   x=str(location.x),
                                   # TODO: get rid of this hack
                                   y=str(-location.y + pad_numbers_font_size/3),
                                   refdef=refdef)
-                t.text = pin
+                t.text = text_to_show
 
 
         return drill_count