Skip to content

Open source in action

by Layne on August 9, 2010

When we need to draw up a schematic or design a PCB, we use Kicad. Kicad is a free and open source electronic design suite. Kicad works on Linux and Windows, and has an experimental Mac version.

There’s some tutorials on the Kicad website, as well as at Curious Inventor.  In less than a day, you should be able to enter a schematic, turn it into a PCB, as well as learn how to make custom footprints and schematic symbols.

Anyway–a few weeks ago, when the Open Hardware Summit was announced, we decided to do a little experiment. We both had mentioned that our schematic entry would be sped up if we had a hotkey for adding labels to wires. Matthew took up the challenge and half an hour later, had a patch to add the hotkey. He submitted it to the mailing list, and less than half an hour after that, one of the main developers said, “Short and sweet. If nobody expresses a concern in a day or two, I will commit it.” The next morning, it was committed to the source tree.

The next time Kicad makes a release (or if you check out from the source tree), you can press T in the schematic editor, eeschema, and add a label.

Open source in action.

--- eeschema/hotkeys.cpp    (revision 2518)
+++ eeschema/hotkeys.cpp    (working copy)
@@ -102,6 +102,7 @@
 #endif
 
 // Schematic editor
+static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' );
 static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' );
 static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ),
 HK_ADD_NEW_COMPONENT, 'A' );
@@ -188,6 +189,7 @@
 &HkEditComponentValue,
 &HkEditComponentFootprint,
 &HkBeginWire,
+    &HkAddLabel,
 NULL
 };
 
@@ -383,6 +385,13 @@
 }
 break;
 
+    case HK_ADD_LABEL:
+        // switch to m_ID_current_state = ID_LABEL_BUTT;
+        if( m_ID_current_state != ID_LABEL_BUTT )
+            SetToolID( ID_LABEL_BUTT, wxCURSOR_PENCIL, _( "Add Label" ) );
+        OnLeftClick( DC, MousePos );
+        break;
+
 case HK_BEGIN_WIRE:
 
 /* An item is selected. If edited and not a wire, a new command is not
--- eeschema/hotkeys.h    (revision 2518)
+++ eeschema/hotkeys.h    (working copy)
@@ -31,7 +31,8 @@
 HK_COPY_COMPONENT_OR_LABEL,
 HK_DRAG,
 HK_ADD_NEW_COMPONENT,
-    HK_BEGIN_WIRE
+    HK_BEGIN_WIRE,
+    HK_ADD_LABEL
 };
 
 // List of hotkey descriptors for eeschema

From → Uncategorized

No comments yet

Leave a Reply

Note: HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS