Index: doc-rnd/TODO =================================================================== --- doc-rnd/TODO (revision 1319) +++ doc-rnd/TODO (revision 1320) @@ -1,4 +1,4 @@ -UNGLIB: +UNGLIB (cleanup #3): - get rid of gcode/lists.h, and vector.[ch] (autorouter) BUGS @@ -5,7 +5,7 @@ - gpmi (and other buildings/plugins) not showing up in the about box - gtk hid: hotkeys stopped working for toggle (e.g. check "|"; check todo in ghid_menu_cb()) -CLEANUP #3 +CLEANUP #4 - scconfig: detect libstroke - libstroke: zoom - cleanup resources: Index: doc-rnd/index.html =================================================================== --- doc-rnd/index.html (revision 1319) +++ doc-rnd/index.html (revision 1320) @@ -37,7 +37,7 @@ [ba] back annotation [onpoint] on-point by Robert Drehmel [cycdrag] cycle drag; with additional feature: negative box select -[mods] modularize the code to reduce core size +[mods] modularize the code to reduce core size - for comparison, previous stats: 1.0.8 [unglib] remove glib dependency from core settings minor changes in default settings Index: doc-rnd/mods2/after.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: doc-rnd/mods2/after.png =================================================================== --- doc-rnd/mods2/after.png (nonexistent) +++ doc-rnd/mods2/after.png (revision 1320) Property changes on: doc-rnd/mods2/after.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: doc-rnd/mods2/before.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: doc-rnd/mods2/before.png =================================================================== --- doc-rnd/mods2/before.png (nonexistent) +++ doc-rnd/mods2/before.png (revision 1320) Property changes on: doc-rnd/mods2/before.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: doc-rnd/mods2/gen.sh =================================================================== --- doc-rnd/mods2/gen.sh (nonexistent) +++ doc-rnd/mods2/gen.sh (revision 1320) @@ -0,0 +1,128 @@ +#!/bin/sh + +path=../../src_plugins + +sloc() +{ + (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }' +} + +gen_pie() +{ + local bn=$1 code_size=$2 color=$3 + echo "" + echo "@slice" + echo "$code_size" + echo "@label" + echo "$bn ($code_size)" + if test ! -z "$color" + then + echo "@color" + echo "$color" + fi +} + +echo "#autogenerated by gen.sh" > mods.pie +echo "#autogenerated by gen.sh" > after.pie + +echo HIDs >&2 +code_size=`sloc ../../src/hid` +gen_pie "HIDs" $code_size "orangered" >> after.pie + +echo Core >&2 +tmp=/tmp/pcb-mods-stat +mkdir $tmp +cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp +code_size=`sloc $tmp` +gen_pie "core" $code_size "#00ff88" >> after.pie + +#echo 3rd >&2 +#code_size=`sloc ../../src_3rd` +#gen_pie "3rd" $code_size >> after.pie + + +( +cat pre.html +for n in $path/* +do + if test -d "$n" + then + echo $n >&2 + bn=`basename $n` + code_size=`sloc $n` + total=$(($total + $code_size)) + gen_pie $bn $code_size >> mods.pie +# case $bn in +# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;; +# esac + + echo "$bn$code_size" + awk ' + /^#/ { + key=$1 + sub("#", "", key) + sub("[:=]", "", key) + $1="" + DB[key]=$0 + next + } + { desc = desc " " $0 } + + function strip(s) { + sub("^[ \t]*", "", s) + sub("[ \t]*$", "", s) + return s + } + + END { + st = DB["state"] + if (st ~ "partial") + clr = "bgcolor=\"yellow\"" + else if (st ~ "works") + clr = "bgcolor=\"lightgreen\"" + else if ((st ~ "fail") || (st ~ "disable")) + clr = "bgcolor=\"red\"" + else + clr="" + + clr2 = clr + if (clr2 != "") { + sub("bgcolor=\"", "", clr2) + sub("\"", "", clr2) + print "@color" >> "mods.pie" + print clr2 >> "mods.pie" + } + + print "" st + if (DB["lstate"] != "") + print "
(" strip(DB["lstate"]) ")" + + dfl = DB["default"] + if (dfl ~ "buildin") + clr = "bgcolor=\"lightgreen\"" + else if (dfl ~ "plugin") + clr = "bgcolor=\"yellow\"" + else if ((dfl ~ "fail") || (dfl ~ "disable")) + clr = "bgcolor=\"red\"" + else + clr="" + + print "" dfl + if (DB["ldefault"] != "") + print "
(" strip(DB["ldefault"]) ")" + print "" desc + } + ' < $n/README + fi +done +cat post.html +gen_pie "plugins" "$total" "#0088ff" >> after.pie +) > index.html + +for n in mods after +do + animpie < $n.pie | animator -H -d $n + pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png + rm ${n}0000.png +done + Property changes on: doc-rnd/mods2/gen.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: doc-rnd/mods2/index.html =================================================================== --- doc-rnd/mods2/index.html (nonexistent) +++ doc-rnd/mods2/index.html (revision 1320) @@ -0,0 +1,159 @@ + + +

pcb-rnd modularization

+

Why bother...

+I believe good software should be modular. This is especially important in +the context of large software, such as CAD applications. There should be +a thin core that can model the world and provide the basic operations defined +on it but anything else should go in separate modules. +

+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 and 1.0.9 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: +

+ +

Progress in charts

+

Before-after

+All numbers are in SLOC +and are acquired running sloccount on the given directory. While lines of +code alone is not a true measure of complexity, it's a good estimation. The +slices of pie charts are the major components of the pcb-rnd executable. +
+ +
        +
Before modularization: pcb-rnd version 1.0.7 +
Note: gpmi was already a plugin +
+ After modularization: pcb-rnd version 1.0.9 +
Note: gpmi is part of the "plugins" slice +
+
+

Zooming on to the plugins

+

+ +

+(Red means the plugin doesn't really work). + +

Progress in numbers

+Below is a table with the summary of core plugins. + +
module size [sloc] status configure
default
description + + +
autoplace612 + works + buildin + Automatically place elements. +
autoroute4337 + works + buildin + Automatically route selected or all rats. This is the original autorouter. +
dbus438 + disabled +
(TODO: needs scconfig support) +
disabled + Remote control PCB using DBUS. +
djopt2320 + works + buildin + Various board optimization algorithms. +
export_bom374 + works + buildin + Export bom (Bill of Materials) +
export_gcode2452 + works + buildin + Export to gcode +
export_gerber972 + works + buildin + Export to gerber +
export_lpr96 + works + buildin + Export to lpr (using export_ps to generate postscript) +
export_nelma685 + works + buildin + Export to nelma (Numerical capacitance calculator) +
export_png1107 + works + buildin + Export to png, gif and jpeg +
export_ps1613 + works + buildin + Export postscript or embedded postscript. +
fontmode163 + works + disabled + Font editing actions. +
gpmi3003 + works + buildin +
(if gpmi is installed) +
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. +
import_edif3578 + works + buildin + Import code for netlists in the EDIF format. +
import_sch259 + works + buildin + Imports element and netlist data from the schematics (or some other source). +
legacy_func72 + works + disabled + 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. +
mincut886 + works + buildin + 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. +
oldactions57 + works + disabled + Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout +
puller1884 + works + buildin + Pull traces to minimize their length. +
renumber222 + works + buildin + Renumber elements (renaming them) and generate a text file for back annotation. +
stroke124 + partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings) + disabled +
(requires libstroke installed) +
Gesture recognition with libstroke. +
toporouter6165 + fails +
(infinite loop in gts) +
disabled + Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009. +
vendordrill572 + works + buildin + Vendor drill mapping. +
+ + Index: doc-rnd/mods2/mods.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: doc-rnd/mods2/mods.png =================================================================== --- doc-rnd/mods2/mods.png (nonexistent) +++ doc-rnd/mods2/mods.png (revision 1320) Property changes on: doc-rnd/mods2/mods.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: doc-rnd/mods2/post.html =================================================================== --- doc-rnd/mods2/post.html (nonexistent) +++ doc-rnd/mods2/post.html (revision 1320) @@ -0,0 +1,3 @@ + + + Index: doc-rnd/mods2/pre.html =================================================================== --- doc-rnd/mods2/pre.html (nonexistent) +++ doc-rnd/mods2/pre.html (revision 1320) @@ -0,0 +1,60 @@ + + +

pcb-rnd modularization

+

Why bother...

+I believe good software should be modular. This is especially important in +the context of large software, such as CAD applications. There should be +a thin core that can model the world and provide the basic operations defined +on it but anything else should go in separate modules. +

+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 and 1.0.9 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: +

+ +

Progress in charts

+

Before-after

+All numbers are in SLOC +and are acquired running sloccount on the given directory. While lines of +code alone is not a true measure of complexity, it's a good estimation. The +slices of pie charts are the major components of the pcb-rnd executable. +
+ +
        +
Before modularization: pcb-rnd version 1.0.7 +
Note: gpmi was already a plugin +
+ After modularization: pcb-rnd version 1.0.9 +
Note: gpmi is part of the "plugins" slice +
+
+

Zooming on to the plugins

+

+ +

+(Red means the plugin doesn't really work). + +

Progress in numbers

+Below is a table with the summary of core plugins. + +
module size [sloc] status configure
default
description + +