Fortunately PCB already had a strong infrastructure supporting this idea. It has dynamic loadable plugins and the GUI and exporters are in separate HID modules. While working on pcb-gpmi and later pcb-rnd, I added the gpmi module as a separate plugin.
In version 1.0.8 to 1.1.0 a cosiderable chunk of core code has been moved into core plugins. A core plugin is just a plugin that is maintained together with the core, in the same repository, still the code is somewhat detached from the core. More importantly, the user can choose, for each plugin, separately:
I believe such modularization has benefits on multiple levels:
|
(Red means the plugin doesn't really work).
module | size [sloc] | status | configure default | class | description |
---|---|---|---|---|---|
autoplace | 613 | works | buildin | (feature) | Automatically place elements. |
autoroute | 4342 | works | buildin | (feature) | Automatically route selected or all rats. This is the original autorouter. |
dbus | 438 | disabled
(TODO: needs scconfig support) | disabled | (feature) | Remote control PCB using DBUS. |
debug | 85 | works | disabled | (feature) | Actions that help developer to debug pcb core. These are not in core because end users normally don't need these. As a plugin, due to dynamic loading, it can be dropped on an existing pcb installation with minimal risk of scaring away a reproducible bug. |
djopt | 2320 | works | buildin | (feature) | Various board optimization algorithms. |
export_bom | 385 | works | buildin | export | Export bom (Bill of Materials) |
export_gcode | 2464 | works | buildin | export | Export to gcode |
export_gerber | 981 | works | buildin | export | Export to gerber |
export_lpr | 105 | works | buildin | export | Export to lpr (using export_ps to generate postscript) |
export_nelma | 696 | works | buildin | export | Export to nelma (Numerical capacitance calculator) |
export_png | 1115 | works | buildin | export | Export to png, gif and jpeg |
export_ps | 1634 | works | buildin | export | Export postscript or embedded postscript. |
export_test | 258 | disabled
(work in progress) | buildin | export | A thin layer of code to dump exporter calls for testing the HID exporter API. |
fontmode | 166 | works | buildin | (feature) | Font editing actions. |
fp_fs | 373 | works | buildin | fp | Footprint: file system based implementation. Used to be called Newlib: load footprints from directories. Run external processes for the parametric footprints. |
fp_wget | 287 | works | buildin | fp | Footprint: get static (file) footprints from the web, e.g. from http://gedasymbols.org |
gl | 592 | disabled
(pcb-rnd has no support for opengl.) | disabled | (feature) | Common gl functions for hids. |
gpmi | 3000 | works | buildin
(if gpmi is installed) | (feature) | Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc. |
hid_batch | 305 | works | buildin | hid | HID without GUI; read actions from stdin. |
hid_gtk | 13709 | works | buildin | hid | GUI: the GTK HID. |
hid_lesstif | 6914 | works | buildin | hid | GUI: the lesstif HID. |
import_edif | 3578 | works | buildin | import | Import code for netlists in the EDIF format. |
import_sch | 291 | works | buildin | import | Imports element and netlist data from the schematics (or some other source). |
io_kicad_legacy | 56 | work-in-progress | disabled | io | Load and save the design and elements in Kicad's legacy format. |
io_pcb | 2155 | works | buildin | io | Load and save the design and elements in the original pcb text format. |
legacy_func | 72 | works | buildin | (lib) | Random collection of old/obsolete (legacy) functions. 3rd party plugins may depend on them. This module implements C functions and variables and does not register actions or flags. |
mincut | 905 | works | buildin | (feature) | Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks. |
oldactions | 117 | works | disabled | (feature) | Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout; a set of debug actions useful for writing pcb scripts: Debug(), DebugXY(), Return(). Old plugin actions to toggle or set settings that are now accessible via the unified config system (vendordrill, djopt) |
puller | 1887 | works | buildin | (feature) | Pull traces to minimize their length. |
renumber | 222 | works | buildin | (feature) | Renumber elements (renaming them) and generate a text file for back annotation. |
report | 784 | works | buildin | (feature) | Report() and ReportObject() actions - print a report about design objects. |
shand_cmd | 212 | works | buildin | (feature) | vi-like command shorthands (1..3 character long commands) |
stroke | 135 | partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings) | disabled | (feature) | Gesture recognition with libstroke. |
toporouter | 6165 | fails
(infinite loop in gts) | disabled | (feature) | Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009. |
vendordrill | 552 | works | buildin | (feature) | Vendor drill mapping. |
name | description |
---|---|
(feature) | random features directly accessible for the user, usually actions |
(lib) | code library; functionality not directly accessible for the user but other plugins may depend on it |
hid | Human Interface Device: interactive user interface, usually GUI |
import | load alien formats into the design space |
export | save (parts of) the design space in alien formats |
fp | footprint (element) library implementation |
io | native file format (save & load) implementation |